@aqua-ds/web-components
Version:
AquaDS Web Components
56 lines (52 loc) • 2.22 kB
JavaScript
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
const aqAutocompleteItemCss = ".aq-autocomplete-item-hydrated{-ms-flex-pack:justify;justify-content:space-between;width:auto}.aq-autocomplete-item__flag{display:contents}.aq-autocomplete-item--disabled{pointer-events:none;color:var(--color-paper-dark)}";
const AqAutocompleteItem = /*@__PURE__*/ proxyCustomElement(class AqAutocompleteItem extends HTMLElement {
constructor(registerHost) {
super();
if (registerHost !== false) {
this.__registerHost();
}
this.isMultiselect = false;
this.paddingItem = '';
this.source = { isSelected: false };
this.isDisabled = false;
}
getStyleClass() {
return {
'aq-autocomplete-item': true,
'aq-autocomplete-item--disabled': this.isDisabled,
'aq-autocomplete-item--multiselect': this.isMultiselect,
'aq-autocomplete-item--selected': this.source?.isSelected,
};
}
render() {
const getStyleClass = this.getStyleClass();
return (h("div", { key: 'e81da258fd6b62927dc8a13273be7f1c5fd62494', class: getStyleClass, style: {
paddingLeft: this.paddingItem,
display: 'block',
justifyContent: 'space-between',
minWidth: 'fit-content',
} }, h("slot", { key: '4a3402e82ee6690e8ff6feea5db19cdc47f03261' })));
}
get el() { return this; }
static get style() { return aqAutocompleteItemCss; }
}, [260, "aq-autocomplete-item", {
"isMultiselect": [4, "is-multiselect"],
"paddingItem": [1, "padding-item"],
"source": [16],
"isDisabled": [4, "is-disabled"]
}]);
function defineCustomElement() {
if (typeof customElements === "undefined") {
return;
}
const components = ["aq-autocomplete-item"];
components.forEach(tagName => { switch (tagName) {
case "aq-autocomplete-item":
if (!customElements.get(tagName)) {
customElements.define(tagName, AqAutocompleteItem);
}
break;
} });
}
export { AqAutocompleteItem as A, defineCustomElement as d };