38 lines
1.5 KiB
JavaScript
Executable file
38 lines
1.5 KiB
JavaScript
Executable file
import { attachShadow, h, Host, proxyCustomElement } from '@stencil/core/internal/client';
|
|
import { b as getIonMode } from './ionic-global.js';
|
|
|
|
const reorderIosCss = ":host([slot]){display:none;line-height:0;z-index:100}.reorder-icon{display:block;font-size:22px}.reorder-icon{font-size:34px;opacity:0.4}";
|
|
|
|
const reorderMdCss = ":host([slot]){display:none;line-height:0;z-index:100}.reorder-icon{display:block;font-size:22px}.reorder-icon{font-size:31px;opacity:0.3}";
|
|
|
|
const Reorder = class extends HTMLElement {
|
|
constructor() {
|
|
super();
|
|
this.__registerHost();
|
|
attachShadow(this);
|
|
}
|
|
onClick(ev) {
|
|
const reorderGroup = this.el.closest('ion-reorder-group');
|
|
ev.preventDefault();
|
|
// Only stop event propagation if the reorder is inside of an enabled
|
|
// reorder group. This allows interaction with clickable children components.
|
|
if (!reorderGroup || !reorderGroup.disabled) {
|
|
ev.stopImmediatePropagation();
|
|
}
|
|
}
|
|
render() {
|
|
const mode = getIonMode(this);
|
|
const reorderIcon = mode === 'ios' ? 'reorder-three-outline' : 'reorder-two-sharp';
|
|
return (h(Host, { class: mode }, h("slot", null, h("ion-icon", { name: reorderIcon, lazy: false, class: "reorder-icon", part: "icon" }))));
|
|
}
|
|
get el() { return this; }
|
|
static get style() { return {
|
|
ios: reorderIosCss,
|
|
md: reorderMdCss
|
|
}; }
|
|
};
|
|
|
|
const IonReorder = /*@__PURE__*/proxyCustomElement(Reorder, [33,"ion-reorder",null,[[2,"click","onClick"]]]);
|
|
|
|
export { IonReorder };
|