@digital-realty/ix-filter-select 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,7 +90,7 @@ export declare class IxFilterSelect extends filterSelectBaseClass {
90
90
  formStateRestoreCallback(formState: string): void;
91
91
  private handleFocusChange;
92
92
  focus(): void;
93
- renderViewMoreButton(): typeof nothing | import("lit").TemplateResult<1>;
94
- render(): import("lit").TemplateResult<1>;
93
+ renderViewMoreButton(): typeof nothing | import("lit-html").TemplateResult<1>;
94
+ render(): import("lit-html").TemplateResult<1>;
95
95
  }
96
96
  export {};
@@ -280,6 +280,7 @@ export class IxFilterSelect extends filterSelectBaseClass {
280
280
  ?required=${this.required}
281
281
  @focus=${this.handleFocusChange}
282
282
  @blur=${this.handleFocusChange}
283
+ autocomplete="off"
283
284
  />
284
285
  <slot name="end" slot="end">
285
286
  ${this.value.length
@@ -1 +1 @@
1
- {"version":3,"file":"IxFilterSelect.js","sourceRoot":"","sources":["../src/IxFilterSelect.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,yCAAyC,CAAC;AACjD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,2BAA2B,CAAC;AAGnC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC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AkE;AAEjE;IAAR,KAAK,EAAE;mDAA0B;AAEzB;IAAR,KAAK,EAAE;gDAA0B;AAMzB;IAAR,KAAK,EAAE;6CAAuB;AAEtB;IAAR,KAAK,EAAE;+CAAyB;AAKxB;IAAR,KAAK,EAAE;mDAA6B;AAM5B;IAAR,KAAK,EAAE;uDAA8B;AAE7B;IAAR,KAAK,EAAE;mDAA6B","sourcesContent":["import { html, LitElement, nothing, PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { requestUpdateOnAriaChange } from '@material/web/internal/aria/delegate.js';\nimport '@digital-realty/ix-field/ix-field.js';\nimport '@digital-realty/ix-menu/ix-menu.js';\nimport '@digital-realty/ix-menu/ix-menu-item.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-button';\nimport { IxMenu } from '@digital-realty/ix-menu';\nimport { IxField } from '@digital-realty/ix-field';\nimport { repeat } from 'lit/directives/repeat.js';\nimport {\n mixinOnReportValidity,\n onReportValidity,\n} from '@material/web/labs/behaviors/on-report-validity.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '@material/web/labs/behaviors/constraint-validation.js';\nimport {\n getFormValue,\n mixinFormAssociated,\n} from '@material/web/labs/behaviors/form-associated.js';\nimport { mixinElementInternals } from '@material/web/labs/behaviors/element-internals.js';\nimport { TextFieldValidator } from '@material/web/labs/behaviors/validators/text-field-validator.js';\nimport { Validator } from '@material/web/labs/behaviors/validators/validator.js';\nimport { IxFilterSelectStyles } from './ix-filter-select-styles.js';\n\nexport interface IFilterSelectOption {\n value: string;\n label: string;\n}\n\nconst filterSelectBaseClass = mixinOnReportValidity(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement))\n )\n);\n\nexport class IxFilterSelect extends filterSelectBaseClass {\n static get styles() {\n return [IxFilterSelectStyles];\n }\n\n static {\n requestUpdateOnAriaChange(IxFilterSelect);\n }\n\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n @query('ix-menu') menu!: IxMenu;\n\n @query('input')\n readonly input!: HTMLInputElement;\n\n @query('.field') private readonly field!: IxField | null;\n\n @property({ type: Array }) options: IFilterSelectOption[] = [];\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) label = '';\n\n @property({ type: String, attribute: 'error-text' }) errorText =\n 'Invalid error text';\n\n @property({ type: String, attribute: 'no-options-text' }) noFilteredOptions =\n 'No options';\n\n @property({ attribute: 'supporting-text' }) supportingText = '';\n\n @property({ type: Boolean, reflect: true }) error = false;\n\n @property({ type: Number, reflect: true }) tabIndex = 0;\n\n @property({ type: Boolean, reflect: true }) required = false;\n\n @property({ type: Function }) onViewMoreButtonClick: any;\n\n @property({ type: Boolean }) isViewMoreButtonVisible = false;\n\n @property({ type: Boolean }) isViewMoreButtonLoading = false;\n\n @property({ type: String }) viewMoreButtonLabel = 'View More';\n\n @state() private filteredOptions: IFilterSelectOption[] = [];\n\n @state() public selectedItem: IFilterSelectOption | undefined = undefined;\n\n @state() private filterValue = '';\n\n @state() private menuOpen = false;\n\n /**\n * Returns true when the text field has been interacted with. Native\n * validation errors only display in response to user interactions.\n */\n @state() private dirty = false;\n\n @state() private focused = false;\n\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n\n @state() private menuOpening = false;\n\n private get hasError() {\n return !this.dirty && (this.error || this.nativeError);\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\n }\n\n private getInput() {\n if (!this.input) {\n // If the input is not yet defined, synchronously render.\n // e.g.\n // const textField = document.createElement('md-outlined-text-field');\n // document.body.appendChild(textField);\n // textField.focus(); // synchronously render\n this.connectedCallback();\n this.scheduleUpdate();\n }\n\n if (this.isUpdatePending) {\n // If there are pending updates, synchronously perform them. This ensures\n // that constraint validation properties (like `required`) are synced\n // before interacting with input APIs that depend on them.\n this.scheduleUpdate();\n }\n\n return this.input!;\n }\n\n firstUpdated() {\n this.filterOptions();\n }\n\n protected override updated(changedProperties: PropertyValues) {\n if (changedProperties.has('disabled')) {\n this.tabIndex = this.disabled ? -1 : 0;\n }\n\n if (changedProperties.has('options')) {\n this.filteredOptions = this.options;\n\n if (!this.selectedItem) {\n const item = this.options.find(({ value }) => value === this.value);\n this.selectItem(item);\n }\n }\n\n this.setMenuPosition();\n }\n\n handleMenuOpening = () => {\n this.menuOpening = true;\n this.menuOpen = true;\n this.setMenuPosition();\n };\n\n menuOpened = () => {\n this.setMenuPosition();\n this.menuOpening = false;\n };\n\n setMenuPosition = () => {\n const innerMenu = this.menu?.shadowRoot?.querySelector(\n '.menu'\n ) as HTMLElement;\n if (innerMenu) {\n innerMenu.style.width = '100%';\n innerMenu.style.height = 'auto';\n innerMenu.style.insetBlockStart = this.supportingText ? '-1rem' : '0';\n }\n };\n\n handleMenuClosed = () => {\n this.menuOpening = false;\n this.menuOpen = false;\n };\n\n handleInput = (e: InputEvent) => {\n const { value } = e.target as HTMLInputElement;\n this.dirty = true;\n this.filterValue = value;\n this.value = value;\n this.filterOptions();\n };\n\n selectItem = (item: IFilterSelectOption | undefined) => {\n if (item) {\n this.selectedItem = item;\n this.value = item.value;\n this.filterValue = item.label;\n this.filteredOptions = this.options;\n if (this.menuOpen || this.menuOpening) {\n this.menu.close();\n }\n this.dispatchEvent(\n new CustomEvent('select-filter-select', {\n detail: { value: item.value, label: item.label },\n bubbles: true,\n composed: true,\n })\n );\n }\n };\n\n toggleOpen = (e: Event) => {\n e.stopPropagation();\n if (!this.menu.open) {\n this.filterOptions();\n this.menu.show();\n this.menuOpening = true;\n this.setMenuPosition();\n } else {\n this.menu.close();\n }\n };\n\n filterOptions() {\n const filterValue =\n this.filterValue.trim().toLowerCase() ||\n this.value.trim().toLocaleLowerCase();\n\n if (!filterValue) {\n this.filteredOptions = this.options;\n }\n\n this.filteredOptions = this.options.filter(item =>\n item.label.toLowerCase().includes(filterValue)\n );\n }\n\n clear() {\n this.value = '';\n this.filterValue = '';\n this.selectedItem = undefined;\n this.focus();\n this.dispatchEvent(\n new CustomEvent('clear-filter-select', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n /** @private */\n formResetCallback() {\n this.reset();\n }\n\n /**\n * Reset the text field to its default value.\n */\n reset() {\n this.value = '';\n const originalValue = this.getAttribute('value');\n const item = this.options.find(({ value }) => value === originalValue);\n this.selectItem(item);\n this.dirty = false;\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n override attributeChangedCallback(\n attribute: string,\n newValue: string | null,\n oldValue: string | null\n ) {\n if (attribute === 'value' && this.dirty) {\n // After user input, changing the value attribute no longer updates the\n // text field's value (until reset). This matches native <input> behavior.\n return;\n }\n\n super.attributeChangedCallback(attribute, newValue, oldValue);\n }\n\n [createValidator](): Validator<unknown> {\n return new TextFieldValidator(() => ({\n state: this as any,\n renderedControl: this.input,\n }));\n }\n\n [getValidityAnchor](): HTMLElement | null {\n return this.input;\n }\n\n [onReportValidity](invalidEvent: Event | null) {\n // Prevent default pop-up behavior.\n invalidEvent?.preventDefault();\n\n this.nativeError = !!invalidEvent;\n this.nativeErrorText = this.validationMessage;\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n\n declare name: string;\n\n override [getFormValue]() {\n return this.value;\n }\n\n override formStateRestoreCallback(formState: string) {\n this.value = formState;\n }\n\n private handleFocusChange() {\n this.focused = this.input?.matches(':focus') ?? false;\n\n if (this.menuOpen || this.menuOpening) return;\n\n if (this.focused) {\n this.menu.show();\n this.menuOpening = true;\n this.setMenuPosition();\n }\n }\n\n override focus() {\n // Required for the case that the user slots a focusable element into the\n // leading icon slot such as an iconbutton due to how delegatesFocus works.\n this.getInput().focus();\n }\n\n renderViewMoreButton() {\n if (!this.isViewMoreButtonVisible) return nothing;\n\n return html` <div class=\"filter-select-footer-section\">\n <ix-button\n type=\"button\"\n appearance=\"text\"\n ?disabled=${this.isViewMoreButtonLoading}\n .submitting=${this.isViewMoreButtonLoading}\n @click=${() => this.onViewMoreButtonClick()}\n >\n <span class=\"button-label\">${this.viewMoreButtonLabel}</span>\n </ix-button>\n </div>`;\n }\n\n render() {\n const classes = {\n disabled: this.disabled,\n error: !this.disabled && this.hasError,\n };\n\n return html`\n <div class=\"filter-select\">\n <ix-field\n class=\"${classMap(classes)}\"\n id=\"anchor\"\n ?focused=${this.focused}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?error=${this.hasError}\n error-text=${!this.menuOpen && !this.menuOpening\n ? this.getErrorText()\n : nothing}\n label=${this.label}\n @click=${() => (!this.disabled ? this.input.focus() : null)}\n supporting-text=${this.supportingText}\n ?populated=${this.filterValue.length || this.value.length}\n >\n <input\n id=\"filter\"\n aria-invalid=${this.hasError}\n @input=${this.handleInput}\n .value=${this.filterValue}\n class=\"flex-fill input\"\n type=\"text\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n @focus=${this.handleFocusChange}\n @blur=${this.handleFocusChange}\n />\n <slot name=\"end\" slot=\"end\">\n ${this.value.length\n ? html`<ix-icon-button\n @click=${this.clear}\n icon=\"close\"\n aria-label=\"clear\"\n ></ix-icon-button>`\n : nothing}\n <ix-icon-button\n @click=${this.toggleOpen}\n class=\"open-icon\"\n icon=${`arrow_drop_${this.menuOpen ? 'up' : 'down'}`}\n aria-label=\"options\"\n ></ix-icon-button>\n </slot>\n </ix-field>\n <div class=\"menu\">\n <ix-menu\n anchor=\"anchor\"\n @opening=${this.handleMenuOpening}\n @opened=${this.menuOpened}\n @closed=${this.handleMenuClosed}\n default-focus=\"none\"\n skip-restore-focus\n >\n ${this.filteredOptions?.length\n ? repeat(\n this.filteredOptions,\n (item, index) => `${item.value}-${index}`,\n item =>\n html`<ix-menu-item\n @click=${() => {\n this.selectItem(item);\n }}\n @keydown=${(e: KeyboardEvent) => {\n const selectionKeys = ['Space', 'Enter'];\n if (selectionKeys.includes(e.key)) {\n this.selectItem(item);\n }\n }}\n class=${this.value === item.value ? 'selected' : ''}\n >\n <div slot=\"headline\">${item.label}</div>\n </ix-menu-item>`\n )\n : html`<ix-menu-item>${this.noFilteredOptions}</ix-menu-item>`}\n ${this.renderViewMoreButton()}\n </ix-menu>\n </div>\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"IxFilterSelect.js","sourceRoot":"","sources":["../src/IxFilterSelect.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,yCAAyC,CAAC;AACjD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,2BAA2B,CAAC;AAGnC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,mBAAmB,GACpB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAErG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAOpE,MAAM,qBAAqB,GAAG,qBAAqB,CACjD,yBAAyB,CACvB,mBAAmB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CACvD,CACF,CA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,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;iDAC7B;AAEmC;IAAzD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;yDAC1C;AAE6B;IAA3C,QAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;sDAAqB;AAEpB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAAe;AAEf;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAc;AAEZ;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAkB;AAE/B;IAA7B,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;6DAA4B;AAE5B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+DAAiC;AAEhC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+DAAiC;AAEjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAmC;AAErD;IAAR,KAAK,EAAE;uDAAqD;AAEpD;IAAR,KAAK,EAAE;oDAAkE;AAEjE;IAAR,KAAK,EAAE;mDAA0B;AAEzB;IAAR,KAAK,EAAE;gDAA0B;AAMzB;IAAR,KAAK,EAAE;6CAAuB;AAEtB;IAAR,KAAK,EAAE;+CAAyB;AAKxB;IAAR,KAAK,EAAE;mDAA6B;AAM5B;IAAR,KAAK,EAAE;uDAA8B;AAE7B;IAAR,KAAK,EAAE;mDAA6B","sourcesContent":["import { html, LitElement, nothing, PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { requestUpdateOnAriaChange } from '@material/web/internal/aria/delegate.js';\nimport '@digital-realty/ix-field/ix-field.js';\nimport '@digital-realty/ix-menu/ix-menu.js';\nimport '@digital-realty/ix-menu/ix-menu-item.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-button';\nimport { IxMenu } from '@digital-realty/ix-menu';\nimport { IxField } from '@digital-realty/ix-field';\nimport { repeat } from 'lit/directives/repeat.js';\nimport {\n mixinOnReportValidity,\n onReportValidity,\n} from '@material/web/labs/behaviors/on-report-validity.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '@material/web/labs/behaviors/constraint-validation.js';\nimport {\n getFormValue,\n mixinFormAssociated,\n} from '@material/web/labs/behaviors/form-associated.js';\nimport { mixinElementInternals } from '@material/web/labs/behaviors/element-internals.js';\nimport { TextFieldValidator } from '@material/web/labs/behaviors/validators/text-field-validator.js';\nimport { Validator } from '@material/web/labs/behaviors/validators/validator.js';\nimport { IxFilterSelectStyles } from './ix-filter-select-styles.js';\n\nexport interface IFilterSelectOption {\n value: string;\n label: string;\n}\n\nconst filterSelectBaseClass = mixinOnReportValidity(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement))\n )\n);\n\nexport class IxFilterSelect extends filterSelectBaseClass {\n static get styles() {\n return [IxFilterSelectStyles];\n }\n\n static {\n requestUpdateOnAriaChange(IxFilterSelect);\n }\n\n /** @nocollapse */\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n @query('ix-menu') menu!: IxMenu;\n\n @query('input')\n readonly input!: HTMLInputElement;\n\n @query('.field') private readonly field!: IxField | null;\n\n @property({ type: Array }) options: IFilterSelectOption[] = [];\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) label = '';\n\n @property({ type: String, attribute: 'error-text' }) errorText =\n 'Invalid error text';\n\n @property({ type: String, attribute: 'no-options-text' }) noFilteredOptions =\n 'No options';\n\n @property({ attribute: 'supporting-text' }) supportingText = '';\n\n @property({ type: Boolean, reflect: true }) error = false;\n\n @property({ type: Number, reflect: true }) tabIndex = 0;\n\n @property({ type: Boolean, reflect: true }) required = false;\n\n @property({ type: Function }) onViewMoreButtonClick: any;\n\n @property({ type: Boolean }) isViewMoreButtonVisible = false;\n\n @property({ type: Boolean }) isViewMoreButtonLoading = false;\n\n @property({ type: String }) viewMoreButtonLabel = 'View More';\n\n @state() private filteredOptions: IFilterSelectOption[] = [];\n\n @state() public selectedItem: IFilterSelectOption | undefined = undefined;\n\n @state() private filterValue = '';\n\n @state() private menuOpen = false;\n\n /**\n * Returns true when the text field has been interacted with. Native\n * validation errors only display in response to user interactions.\n */\n @state() private dirty = false;\n\n @state() private focused = false;\n\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n\n @state() private menuOpening = false;\n\n private get hasError() {\n return !this.dirty && (this.error || this.nativeError);\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\n }\n\n private getInput() {\n if (!this.input) {\n // If the input is not yet defined, synchronously render.\n // e.g.\n // const textField = document.createElement('md-outlined-text-field');\n // document.body.appendChild(textField);\n // textField.focus(); // synchronously render\n this.connectedCallback();\n this.scheduleUpdate();\n }\n\n if (this.isUpdatePending) {\n // If there are pending updates, synchronously perform them. This ensures\n // that constraint validation properties (like `required`) are synced\n // before interacting with input APIs that depend on them.\n this.scheduleUpdate();\n }\n\n return this.input!;\n }\n\n firstUpdated() {\n this.filterOptions();\n }\n\n protected override updated(changedProperties: PropertyValues) {\n if (changedProperties.has('disabled')) {\n this.tabIndex = this.disabled ? -1 : 0;\n }\n\n if (changedProperties.has('options')) {\n this.filteredOptions = this.options;\n\n if (!this.selectedItem) {\n const item = this.options.find(({ value }) => value === this.value);\n this.selectItem(item);\n }\n }\n\n this.setMenuPosition();\n }\n\n handleMenuOpening = () => {\n this.menuOpening = true;\n this.menuOpen = true;\n this.setMenuPosition();\n };\n\n menuOpened = () => {\n this.setMenuPosition();\n this.menuOpening = false;\n };\n\n setMenuPosition = () => {\n const innerMenu = this.menu?.shadowRoot?.querySelector(\n '.menu'\n ) as HTMLElement;\n if (innerMenu) {\n innerMenu.style.width = '100%';\n innerMenu.style.height = 'auto';\n innerMenu.style.insetBlockStart = this.supportingText ? '-1rem' : '0';\n }\n };\n\n handleMenuClosed = () => {\n this.menuOpening = false;\n this.menuOpen = false;\n };\n\n handleInput = (e: InputEvent) => {\n const { value } = e.target as HTMLInputElement;\n this.dirty = true;\n this.filterValue = value;\n this.value = value;\n this.filterOptions();\n };\n\n selectItem = (item: IFilterSelectOption | undefined) => {\n if (item) {\n this.selectedItem = item;\n this.value = item.value;\n this.filterValue = item.label;\n this.filteredOptions = this.options;\n if (this.menuOpen || this.menuOpening) {\n this.menu.close();\n }\n this.dispatchEvent(\n new CustomEvent('select-filter-select', {\n detail: { value: item.value, label: item.label },\n bubbles: true,\n composed: true,\n })\n );\n }\n };\n\n toggleOpen = (e: Event) => {\n e.stopPropagation();\n if (!this.menu.open) {\n this.filterOptions();\n this.menu.show();\n this.menuOpening = true;\n this.setMenuPosition();\n } else {\n this.menu.close();\n }\n };\n\n filterOptions() {\n const filterValue =\n this.filterValue.trim().toLowerCase() ||\n this.value.trim().toLocaleLowerCase();\n\n if (!filterValue) {\n this.filteredOptions = this.options;\n }\n\n this.filteredOptions = this.options.filter(item =>\n item.label.toLowerCase().includes(filterValue)\n );\n }\n\n clear() {\n this.value = '';\n this.filterValue = '';\n this.selectedItem = undefined;\n this.focus();\n this.dispatchEvent(\n new CustomEvent('clear-filter-select', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n /** @private */\n formResetCallback() {\n this.reset();\n }\n\n /**\n * Reset the text field to its default value.\n */\n reset() {\n this.value = '';\n const originalValue = this.getAttribute('value');\n const item = this.options.find(({ value }) => value === originalValue);\n this.selectItem(item);\n this.dirty = false;\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n override attributeChangedCallback(\n attribute: string,\n newValue: string | null,\n oldValue: string | null\n ) {\n if (attribute === 'value' && this.dirty) {\n // After user input, changing the value attribute no longer updates the\n // text field's value (until reset). This matches native <input> behavior.\n return;\n }\n\n super.attributeChangedCallback(attribute, newValue, oldValue);\n }\n\n [createValidator](): Validator<unknown> {\n return new TextFieldValidator(() => ({\n state: this as any,\n renderedControl: this.input,\n }));\n }\n\n [getValidityAnchor](): HTMLElement | null {\n return this.input;\n }\n\n [onReportValidity](invalidEvent: Event | null) {\n // Prevent default pop-up behavior.\n invalidEvent?.preventDefault();\n\n this.nativeError = !!invalidEvent;\n this.nativeErrorText = this.validationMessage;\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n\n declare name: string;\n\n override [getFormValue]() {\n return this.value;\n }\n\n override formStateRestoreCallback(formState: string) {\n this.value = formState;\n }\n\n private handleFocusChange() {\n this.focused = this.input?.matches(':focus') ?? false;\n\n if (this.menuOpen || this.menuOpening) return;\n\n if (this.focused) {\n this.menu.show();\n this.menuOpening = true;\n this.setMenuPosition();\n }\n }\n\n override focus() {\n // Required for the case that the user slots a focusable element into the\n // leading icon slot such as an iconbutton due to how delegatesFocus works.\n this.getInput().focus();\n }\n\n renderViewMoreButton() {\n if (!this.isViewMoreButtonVisible) return nothing;\n\n return html` <div class=\"filter-select-footer-section\">\n <ix-button\n type=\"button\"\n appearance=\"text\"\n ?disabled=${this.isViewMoreButtonLoading}\n .submitting=${this.isViewMoreButtonLoading}\n @click=${() => this.onViewMoreButtonClick()}\n >\n <span class=\"button-label\">${this.viewMoreButtonLabel}</span>\n </ix-button>\n </div>`;\n }\n\n render() {\n const classes = {\n disabled: this.disabled,\n error: !this.disabled && this.hasError,\n };\n\n return html`\n <div class=\"filter-select\">\n <ix-field\n class=\"${classMap(classes)}\"\n id=\"anchor\"\n ?focused=${this.focused}\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?error=${this.hasError}\n error-text=${!this.menuOpen && !this.menuOpening\n ? this.getErrorText()\n : nothing}\n label=${this.label}\n @click=${() => (!this.disabled ? this.input.focus() : null)}\n supporting-text=${this.supportingText}\n ?populated=${this.filterValue.length || this.value.length}\n >\n <input\n id=\"filter\"\n aria-invalid=${this.hasError}\n @input=${this.handleInput}\n .value=${this.filterValue}\n class=\"flex-fill input\"\n type=\"text\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n @focus=${this.handleFocusChange}\n @blur=${this.handleFocusChange}\n autocomplete=\"off\"\n />\n <slot name=\"end\" slot=\"end\">\n ${this.value.length\n ? html`<ix-icon-button\n @click=${this.clear}\n icon=\"close\"\n aria-label=\"clear\"\n ></ix-icon-button>`\n : nothing}\n <ix-icon-button\n @click=${this.toggleOpen}\n class=\"open-icon\"\n icon=${`arrow_drop_${this.menuOpen ? 'up' : 'down'}`}\n aria-label=\"options\"\n ></ix-icon-button>\n </slot>\n </ix-field>\n <div class=\"menu\">\n <ix-menu\n anchor=\"anchor\"\n @opening=${this.handleMenuOpening}\n @opened=${this.menuOpened}\n @closed=${this.handleMenuClosed}\n default-focus=\"none\"\n skip-restore-focus\n >\n ${this.filteredOptions?.length\n ? repeat(\n this.filteredOptions,\n (item, index) => `${item.value}-${index}`,\n item =>\n html`<ix-menu-item\n @click=${() => {\n this.selectItem(item);\n }}\n @keydown=${(e: KeyboardEvent) => {\n const selectionKeys = ['Space', 'Enter'];\n if (selectionKeys.includes(e.key)) {\n this.selectItem(item);\n }\n }}\n class=${this.value === item.value ? 'selected' : ''}\n >\n <div slot=\"headline\">${item.label}</div>\n </ix-menu-item>`\n )\n : html`<ix-menu-item>${this.noFilteredOptions}</ix-menu-item>`}\n ${this.renderViewMoreButton()}\n </ix-menu>\n </div>\n </div>\n `;\n }\n}\n"]}
@@ -2,4 +2,4 @@ import{__decorate}from"tslib";import{css,LitElement,nothing,html}from"lit";impor
2
2
  --md-sys-text-color-secondary
3
3
  );--md-icon-button-pressed-icon-color:var(--md-sys-text-color-secondary);--md-icon-button-pressed-state-layer-color:var(
4
4
  --md-sys-text-color-secondary
5
- )}.open-icon{margin-right:.5rem}.filter-select{position:relative}.filter-select-footer-section{display:flex;justify-content:space-between;padding:.5rem 1rem}`,filterSelectBaseClass=mixinOnReportValidity(mixinConstraintValidation(mixinFormAssociated(mixinElementInternals(LitElement))));class IxFilterSelect extends filterSelectBaseClass{constructor(){super(...arguments),this.options=[],this.value="",this.label="",this.errorText="Invalid error text",this.noFilteredOptions="No options",this.supportingText="",this.error=!1,this.tabIndex=0,this.required=!1,this.isViewMoreButtonVisible=!1,this.isViewMoreButtonLoading=!1,this.viewMoreButtonLabel="View More",this.filteredOptions=[],this.selectedItem=void 0,this.filterValue="",this.menuOpen=!1,this.dirty=!1,this.focused=!1,this.nativeError=!1,this.nativeErrorText="",this.menuOpening=!1,this.handleMenuOpening=()=>{this.menuOpening=!0,this.menuOpen=!0,this.setMenuPosition()},this.menuOpened=()=>{this.setMenuPosition(),this.menuOpening=!1},this.setMenuPosition=()=>{var e=null==(e=null==(e=this.menu)?void 0:e.shadowRoot)?void 0:e.querySelector(".menu");e&&(e.style.width="100%",e.style.height="auto",e.style.insetBlockStart=this.supportingText?"-1rem":"0")},this.handleMenuClosed=()=>{this.menuOpening=!1,this.menuOpen=!1},this.handleInput=e=>{e=e.target.value;this.dirty=!0,this.filterValue=e,this.value=e,this.filterOptions()},this.selectItem=e=>{e&&(this.selectedItem=e,this.value=e.value,this.filterValue=e.label,this.filteredOptions=this.options,(this.menuOpen||this.menuOpening)&&this.menu.close(),this.dispatchEvent(new CustomEvent("select-filter-select",{detail:{value:e.value,label:e.label},bubbles:!0,composed:!0})))},this.toggleOpen=e=>{e.stopPropagation(),this.menu.open?this.menu.close():(this.filterOptions(),this.menu.show(),this.menuOpening=!0,this.setMenuPosition())}}static get styles(){return[IxFilterSelectStyles]}get hasError(){return!this.dirty&&(this.error||this.nativeError)}getErrorText(){return this.error?this.errorText:this.nativeErrorText}getInput(){return this.input||(this.connectedCallback(),this.scheduleUpdate()),this.isUpdatePending&&this.scheduleUpdate(),this.input}firstUpdated(){this.filterOptions()}updated(e){e.has("disabled")&&(this.tabIndex=this.disabled?-1:0),e.has("options")&&(this.filteredOptions=this.options,this.selectedItem||(e=this.options.find(({value:e})=>e===this.value),this.selectItem(e))),this.setMenuPosition()}filterOptions(){let t=this.filterValue.trim().toLowerCase()||this.value.trim().toLocaleLowerCase();t||(this.filteredOptions=this.options),this.filteredOptions=this.options.filter(e=>e.label.toLowerCase().includes(t))}clear(){this.value="",this.filterValue="",this.selectedItem=void 0,this.focus(),this.dispatchEvent(new CustomEvent("clear-filter-select",{bubbles:!0,composed:!0}))}formResetCallback(){this.reset()}reset(){this.value="";let t=this.getAttribute("value");var e=this.options.find(({value:e})=>e===t);this.selectItem(e),this.dirty=!1,this.nativeError=!1,this.nativeErrorText=""}attributeChangedCallback(e,t,i){"value"===e&&this.dirty||super.attributeChangedCallback(e,t,i)}[createValidator](){return new TextFieldValidator(()=>({state:this,renderedControl:this.input}))}[getValidityAnchor](){return this.input}[onReportValidity](e){null!=e&&e.preventDefault(),this.nativeError=!!e,this.nativeErrorText=this.validationMessage}[getFormValue](){return this.value}formStateRestoreCallback(e){this.value=e}handleFocusChange(){var e;this.focused=null!=(e=null==(e=this.input)?void 0:e.matches(":focus"))&&e,this.menuOpen||this.menuOpening||this.focused&&(this.menu.show(),this.menuOpening=!0,this.setMenuPosition())}focus(){this.getInput().focus()}renderViewMoreButton(){return this.isViewMoreButtonVisible?html`<div class="filter-select-footer-section"><ix-button type="button" appearance="text" ?disabled="${this.isViewMoreButtonLoading}" .submitting="${this.isViewMoreButtonLoading}" @click="${()=>this.onViewMoreButtonClick()}"><span class="button-label">${this.viewMoreButtonLabel}</span></ix-button></div>`:nothing}render(){var e={disabled:this.disabled,error:!this.disabled&&this.hasError};return html`<div class="filter-select"><ix-field class="${classMap(e)}" id="anchor" ?focused="${this.focused}" ?disabled="${this.disabled}" ?required="${this.required}" ?error="${this.hasError}" error-text="${this.menuOpen||this.menuOpening?nothing:this.getErrorText()}" label="${this.label}" @click="${()=>this.disabled?null:this.input.focus()}" supporting-text="${this.supportingText}" ?populated="${this.filterValue.length||this.value.length}"><input id="filter" aria-invalid="${this.hasError}" @input="${this.handleInput}" .value="${this.filterValue}" class="flex-fill input" type="text" ?disabled="${this.disabled}" ?required="${this.required}" @focus="${this.handleFocusChange}" @blur="${this.handleFocusChange}"><slot name="end" slot="end">${this.value.length?html`<ix-icon-button @click="${this.clear}" icon="close" aria-label="clear"></ix-icon-button>`:nothing}<ix-icon-button @click="${this.toggleOpen}" class="open-icon" icon="${"arrow_drop_"+(this.menuOpen?"up":"down")}" aria-label="options"></ix-icon-button></slot></ix-field><div class="menu"><ix-menu anchor="anchor" @opening="${this.handleMenuOpening}" @opened="${this.menuOpened}" @closed="${this.handleMenuClosed}" default-focus="none" skip-restore-focus>${null!=(e=this.filteredOptions)&&e.length?repeat(this.filteredOptions,(e,t)=>e.value+"-"+t,t=>html`<ix-menu-item @click="${()=>{this.selectItem(t)}}" @keydown="${e=>{["Space","Enter"].includes(e.key)&&this.selectItem(t)}}" class="${this.value===t.value?"selected":""}"><div slot="headline">${t.label}</div></ix-menu-item>`):html`<ix-menu-item>${this.noFilteredOptions}</ix-menu-item>`} ${this.renderViewMoreButton()}</ix-menu></div></div>`}}requestUpdateOnAriaChange(IxFilterSelect),IxFilterSelect.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0},__decorate([query("ix-menu")],IxFilterSelect.prototype,"menu",void 0),__decorate([query("input")],IxFilterSelect.prototype,"input",void 0),__decorate([query(".field")],IxFilterSelect.prototype,"field",void 0),__decorate([property({type:Array})],IxFilterSelect.prototype,"options",void 0),__decorate([property({type:String})],IxFilterSelect.prototype,"value",void 0),__decorate([property({type:String})],IxFilterSelect.prototype,"label",void 0),__decorate([property({type:String,attribute:"error-text"})],IxFilterSelect.prototype,"errorText",void 0),__decorate([property({type:String,attribute:"no-options-text"})],IxFilterSelect.prototype,"noFilteredOptions",void 0),__decorate([property({attribute:"supporting-text"})],IxFilterSelect.prototype,"supportingText",void 0),__decorate([property({type:Boolean,reflect:!0})],IxFilterSelect.prototype,"error",void 0),__decorate([property({type:Number,reflect:!0})],IxFilterSelect.prototype,"tabIndex",void 0),__decorate([property({type:Boolean,reflect:!0})],IxFilterSelect.prototype,"required",void 0),__decorate([property({type:Function})],IxFilterSelect.prototype,"onViewMoreButtonClick",void 0),__decorate([property({type:Boolean})],IxFilterSelect.prototype,"isViewMoreButtonVisible",void 0),__decorate([property({type:Boolean})],IxFilterSelect.prototype,"isViewMoreButtonLoading",void 0),__decorate([property({type:String})],IxFilterSelect.prototype,"viewMoreButtonLabel",void 0),__decorate([state()],IxFilterSelect.prototype,"filteredOptions",void 0),__decorate([state()],IxFilterSelect.prototype,"selectedItem",void 0),__decorate([state()],IxFilterSelect.prototype,"filterValue",void 0),__decorate([state()],IxFilterSelect.prototype,"menuOpen",void 0),__decorate([state()],IxFilterSelect.prototype,"dirty",void 0),__decorate([state()],IxFilterSelect.prototype,"focused",void 0),__decorate([state()],IxFilterSelect.prototype,"nativeError",void 0),__decorate([state()],IxFilterSelect.prototype,"nativeErrorText",void 0),__decorate([state()],IxFilterSelect.prototype,"menuOpening",void 0),window.customElements.define("ix-filter-select",IxFilterSelect);
5
+ )}.open-icon{margin-right:.5rem}.filter-select{position:relative}.filter-select-footer-section{display:flex;justify-content:space-between;padding:.5rem 1rem}`,filterSelectBaseClass=mixinOnReportValidity(mixinConstraintValidation(mixinFormAssociated(mixinElementInternals(LitElement))));class IxFilterSelect extends filterSelectBaseClass{constructor(){super(...arguments),this.options=[],this.value="",this.label="",this.errorText="Invalid error text",this.noFilteredOptions="No options",this.supportingText="",this.error=!1,this.tabIndex=0,this.required=!1,this.isViewMoreButtonVisible=!1,this.isViewMoreButtonLoading=!1,this.viewMoreButtonLabel="View More",this.filteredOptions=[],this.selectedItem=void 0,this.filterValue="",this.menuOpen=!1,this.dirty=!1,this.focused=!1,this.nativeError=!1,this.nativeErrorText="",this.menuOpening=!1,this.handleMenuOpening=()=>{this.menuOpening=!0,this.menuOpen=!0,this.setMenuPosition()},this.menuOpened=()=>{this.setMenuPosition(),this.menuOpening=!1},this.setMenuPosition=()=>{var e=null==(e=null==(e=this.menu)?void 0:e.shadowRoot)?void 0:e.querySelector(".menu");e&&(e.style.width="100%",e.style.height="auto",e.style.insetBlockStart=this.supportingText?"-1rem":"0")},this.handleMenuClosed=()=>{this.menuOpening=!1,this.menuOpen=!1},this.handleInput=e=>{e=e.target.value;this.dirty=!0,this.filterValue=e,this.value=e,this.filterOptions()},this.selectItem=e=>{e&&(this.selectedItem=e,this.value=e.value,this.filterValue=e.label,this.filteredOptions=this.options,(this.menuOpen||this.menuOpening)&&this.menu.close(),this.dispatchEvent(new CustomEvent("select-filter-select",{detail:{value:e.value,label:e.label},bubbles:!0,composed:!0})))},this.toggleOpen=e=>{e.stopPropagation(),this.menu.open?this.menu.close():(this.filterOptions(),this.menu.show(),this.menuOpening=!0,this.setMenuPosition())}}static get styles(){return[IxFilterSelectStyles]}get hasError(){return!this.dirty&&(this.error||this.nativeError)}getErrorText(){return this.error?this.errorText:this.nativeErrorText}getInput(){return this.input||(this.connectedCallback(),this.scheduleUpdate()),this.isUpdatePending&&this.scheduleUpdate(),this.input}firstUpdated(){this.filterOptions()}updated(e){e.has("disabled")&&(this.tabIndex=this.disabled?-1:0),e.has("options")&&(this.filteredOptions=this.options,this.selectedItem||(e=this.options.find(({value:e})=>e===this.value),this.selectItem(e))),this.setMenuPosition()}filterOptions(){let t=this.filterValue.trim().toLowerCase()||this.value.trim().toLocaleLowerCase();t||(this.filteredOptions=this.options),this.filteredOptions=this.options.filter(e=>e.label.toLowerCase().includes(t))}clear(){this.value="",this.filterValue="",this.selectedItem=void 0,this.focus(),this.dispatchEvent(new CustomEvent("clear-filter-select",{bubbles:!0,composed:!0}))}formResetCallback(){this.reset()}reset(){this.value="";let t=this.getAttribute("value");var e=this.options.find(({value:e})=>e===t);this.selectItem(e),this.dirty=!1,this.nativeError=!1,this.nativeErrorText=""}attributeChangedCallback(e,t,i){"value"===e&&this.dirty||super.attributeChangedCallback(e,t,i)}[createValidator](){return new TextFieldValidator(()=>({state:this,renderedControl:this.input}))}[getValidityAnchor](){return this.input}[onReportValidity](e){null!=e&&e.preventDefault(),this.nativeError=!!e,this.nativeErrorText=this.validationMessage}[getFormValue](){return this.value}formStateRestoreCallback(e){this.value=e}handleFocusChange(){var e;this.focused=null!=(e=null==(e=this.input)?void 0:e.matches(":focus"))&&e,this.menuOpen||this.menuOpening||this.focused&&(this.menu.show(),this.menuOpening=!0,this.setMenuPosition())}focus(){this.getInput().focus()}renderViewMoreButton(){return this.isViewMoreButtonVisible?html`<div class="filter-select-footer-section"><ix-button type="button" appearance="text" ?disabled="${this.isViewMoreButtonLoading}" .submitting="${this.isViewMoreButtonLoading}" @click="${()=>this.onViewMoreButtonClick()}"><span class="button-label">${this.viewMoreButtonLabel}</span></ix-button></div>`:nothing}render(){var e={disabled:this.disabled,error:!this.disabled&&this.hasError};return html`<div class="filter-select"><ix-field class="${classMap(e)}" id="anchor" ?focused="${this.focused}" ?disabled="${this.disabled}" ?required="${this.required}" ?error="${this.hasError}" error-text="${this.menuOpen||this.menuOpening?nothing:this.getErrorText()}" label="${this.label}" @click="${()=>this.disabled?null:this.input.focus()}" supporting-text="${this.supportingText}" ?populated="${this.filterValue.length||this.value.length}"><input id="filter" aria-invalid="${this.hasError}" @input="${this.handleInput}" .value="${this.filterValue}" class="flex-fill input" type="text" ?disabled="${this.disabled}" ?required="${this.required}" @focus="${this.handleFocusChange}" @blur="${this.handleFocusChange}" autocomplete="off"><slot name="end" slot="end">${this.value.length?html`<ix-icon-button @click="${this.clear}" icon="close" aria-label="clear"></ix-icon-button>`:nothing}<ix-icon-button @click="${this.toggleOpen}" class="open-icon" icon="${"arrow_drop_"+(this.menuOpen?"up":"down")}" aria-label="options"></ix-icon-button></slot></ix-field><div class="menu"><ix-menu anchor="anchor" @opening="${this.handleMenuOpening}" @opened="${this.menuOpened}" @closed="${this.handleMenuClosed}" default-focus="none" skip-restore-focus>${null!=(e=this.filteredOptions)&&e.length?repeat(this.filteredOptions,(e,t)=>e.value+"-"+t,t=>html`<ix-menu-item @click="${()=>{this.selectItem(t)}}" @keydown="${e=>{["Space","Enter"].includes(e.key)&&this.selectItem(t)}}" class="${this.value===t.value?"selected":""}"><div slot="headline">${t.label}</div></ix-menu-item>`):html`<ix-menu-item>${this.noFilteredOptions}</ix-menu-item>`} ${this.renderViewMoreButton()}</ix-menu></div></div>`}}requestUpdateOnAriaChange(IxFilterSelect),IxFilterSelect.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0},__decorate([query("ix-menu")],IxFilterSelect.prototype,"menu",void 0),__decorate([query("input")],IxFilterSelect.prototype,"input",void 0),__decorate([query(".field")],IxFilterSelect.prototype,"field",void 0),__decorate([property({type:Array})],IxFilterSelect.prototype,"options",void 0),__decorate([property({type:String})],IxFilterSelect.prototype,"value",void 0),__decorate([property({type:String})],IxFilterSelect.prototype,"label",void 0),__decorate([property({type:String,attribute:"error-text"})],IxFilterSelect.prototype,"errorText",void 0),__decorate([property({type:String,attribute:"no-options-text"})],IxFilterSelect.prototype,"noFilteredOptions",void 0),__decorate([property({attribute:"supporting-text"})],IxFilterSelect.prototype,"supportingText",void 0),__decorate([property({type:Boolean,reflect:!0})],IxFilterSelect.prototype,"error",void 0),__decorate([property({type:Number,reflect:!0})],IxFilterSelect.prototype,"tabIndex",void 0),__decorate([property({type:Boolean,reflect:!0})],IxFilterSelect.prototype,"required",void 0),__decorate([property({type:Function})],IxFilterSelect.prototype,"onViewMoreButtonClick",void 0),__decorate([property({type:Boolean})],IxFilterSelect.prototype,"isViewMoreButtonVisible",void 0),__decorate([property({type:Boolean})],IxFilterSelect.prototype,"isViewMoreButtonLoading",void 0),__decorate([property({type:String})],IxFilterSelect.prototype,"viewMoreButtonLabel",void 0),__decorate([state()],IxFilterSelect.prototype,"filteredOptions",void 0),__decorate([state()],IxFilterSelect.prototype,"selectedItem",void 0),__decorate([state()],IxFilterSelect.prototype,"filterValue",void 0),__decorate([state()],IxFilterSelect.prototype,"menuOpen",void 0),__decorate([state()],IxFilterSelect.prototype,"dirty",void 0),__decorate([state()],IxFilterSelect.prototype,"focused",void 0),__decorate([state()],IxFilterSelect.prototype,"nativeError",void 0),__decorate([state()],IxFilterSelect.prototype,"nativeErrorText",void 0),__decorate([state()],IxFilterSelect.prototype,"menuOpening",void 0),window.customElements.define("ix-filter-select",IxFilterSelect);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent ix-filter-select following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "Digital Realty",
6
- "version": "1.1.6",
6
+ "version": "1.1.8",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -26,16 +26,15 @@
26
26
  "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
27
27
  },
28
28
  "dependencies": {
29
- "@digital-realty/ix-button": "^3.3.5",
30
- "@digital-realty/ix-field": "^1.1.5",
31
- "@digital-realty/ix-icon-button": "^1.1.5",
32
- "@digital-realty/ix-menu": "^1.1.5",
29
+ "@digital-realty/ix-button": "^3.3.7",
30
+ "@digital-realty/ix-field": "^1.1.6",
31
+ "@digital-realty/ix-icon-button": "^1.1.6",
32
+ "@digital-realty/ix-menu": "^1.1.6",
33
33
  "@material/web": "1.2.0",
34
- "lit": "^2.8.0 || ^3.0.0"
34
+ "lit": "^3.2.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@custom-elements-manifest/analyzer": "^0.4.17",
38
- "@digital-realty/theme": "^1.0.30",
39
38
  "@open-wc/eslint-config": "^9.2.1",
40
39
  "@open-wc/testing": "^3.1.6",
41
40
  "@typescript-eslint/eslint-plugin": "^5.48.0",
@@ -102,5 +101,5 @@
102
101
  "README.md",
103
102
  "LICENSE"
104
103
  ],
105
- "gitHead": "92c0f42cb9c15996c1f970b15bd1a0222bd8f45e"
104
+ "gitHead": "1ff5e33be95294574b667763de6a356a82a64cd6"
106
105
  }