@aquera/nile-elements 0.1.58 → 0.1.59-beta-1.1
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.
- package/README.md +7 -0
- package/demo/index.html +150 -33
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1420 -654
- package/dist/internal/form.cjs.js +1 -1
- package/dist/internal/form.cjs.js.map +1 -1
- package/dist/internal/form.esm.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/index.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -17
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +8 -29
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
- package/dist/nile-button/nile-button.test.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
- package/dist/nile-card/nile-card.test.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.cjs.js +1 -1
- package/dist/nile-option/nile-option.css.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.css.esm.js +1 -1
- package/dist/nile-option/nile-option.esm.js +2 -2
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +2 -2
- package/dist/nile-select/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.test.esm.js +2 -2
- package/dist/nile-select/virtual-scroll-helper.cjs.js +2 -0
- package/dist/nile-select/virtual-scroll-helper.cjs.js.map +1 -0
- package/dist/nile-select/virtual-scroll-helper.esm.js +38 -0
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-virtual-select/index.cjs.js +2 -0
- package/dist/nile-virtual-select/index.cjs.js.map +1 -0
- package/dist/nile-virtual-select/index.esm.js +1 -0
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +2 -0
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -0
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +2 -0
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -0
- package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +477 -0
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +227 -0
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +2 -0
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +1 -0
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +93 -0
- package/dist/nile-virtual-select/renderer.cjs.js +2 -0
- package/dist/nile-virtual-select/renderer.cjs.js.map +1 -0
- package/dist/nile-virtual-select/renderer.esm.js +28 -0
- package/dist/nile-virtual-select/search-manager.cjs.js +2 -0
- package/dist/nile-virtual-select/search-manager.cjs.js.map +1 -0
- package/dist/nile-virtual-select/search-manager.esm.js +1 -0
- package/dist/nile-virtual-select/selection-manager.cjs.js +2 -0
- package/dist/nile-virtual-select/selection-manager.cjs.js.map +1 -0
- package/dist/nile-virtual-select/selection-manager.esm.js +1 -0
- package/dist/nile-virtual-select/types.cjs.js +2 -0
- package/dist/nile-virtual-select/types.cjs.js.map +1 -0
- package/dist/nile-virtual-select/types.esm.js +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/form.js +2 -2
- package/dist/src/internal/form.js.map +1 -1
- package/dist/src/nile-option/nile-option.css.js +1 -1
- package/dist/src/nile-option/nile-option.css.js.map +1 -1
- package/dist/src/nile-option/nile-option.d.ts +5 -1
- package/dist/src/nile-option/nile-option.js +21 -6
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +11 -2
- package/dist/src/nile-select/nile-select.js +37 -18
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-select/virtual-scroll-helper.d.ts +9 -0
- package/dist/src/nile-select/virtual-scroll-helper.js +51 -0
- package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -0
- package/dist/src/nile-virtual-select/index.d.ts +1 -0
- package/dist/src/nile-virtual-select/index.js +2 -0
- package/dist/src/nile-virtual-select/index.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.css.d.ts +12 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js +489 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +266 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.js +1226 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +7 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +631 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -0
- package/dist/src/nile-virtual-select/renderer.d.ts +16 -0
- package/dist/src/nile-virtual-select/renderer.js +72 -0
- package/dist/src/nile-virtual-select/renderer.js.map +1 -0
- package/dist/src/nile-virtual-select/search-manager.d.ts +12 -0
- package/dist/src/nile-virtual-select/search-manager.js +40 -0
- package/dist/src/nile-virtual-select/search-manager.js.map +1 -0
- package/dist/src/nile-virtual-select/selection-manager.d.ts +12 -0
- package/dist/src/nile-virtual-select/selection-manager.js +64 -0
- package/dist/src/nile-virtual-select/selection-manager.js.map +1 -0
- package/dist/src/nile-virtual-select/types.d.ts +50 -0
- package/dist/src/nile-virtual-select/types.js +8 -0
- package/dist/src/nile-virtual-select/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/virtualize-a4a40d96.esm.js +22 -0
- package/dist/virtualize-b6a2fbe0.cjs.js +18 -0
- package/dist/virtualize-b6a2fbe0.cjs.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +3 -1
- package/src/internal/form.ts +2 -2
- package/src/nile-option/nile-option.css.ts +1 -1
- package/src/nile-option/nile-option.ts +17 -3
- package/src/nile-select/nile-select.ts +35 -9
- package/src/nile-select/virtual-scroll-helper.ts +56 -0
- package/src/nile-virtual-select/index.ts +1 -0
- package/src/nile-virtual-select/nile-virtual-select.css.ts +491 -0
- package/src/nile-virtual-select/nile-virtual-select.test.ts +774 -0
- package/src/nile-virtual-select/nile-virtual-select.ts +1314 -0
- package/src/nile-virtual-select/renderer.ts +100 -0
- package/src/nile-virtual-select/search-manager.ts +50 -0
- package/src/nile-virtual-select/selection-manager.ts +75 -0
- package/src/nile-virtual-select/types.ts +54 -0
- package/vscode-html-custom-data.json +229 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-option.js","sourceRoot":"","sources":["../../../src/nile-option/nile-option.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,kBAAkB,CAAC;AAE1B;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AAGI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,WAAW;IAApC;;QAOI,YAAO,GAAG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;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAkB;AAqD7D;IADC,KAAK,CAAC,UAAU,CAAC;sDAGjB;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;sDAGjB;AAGD;IADC,KAAK,CAAC,OAAO,CAAC;mDAed;AApGU,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAkJtB;;AAED,eAAe,UAAU,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, CSSResultArray, TemplateResult } from 'lit';\nimport { styles } from './nile-option.css';\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport NileElement from '../internal/nile-element';\nimport '../nile-checkbox';\n\n/**\n * Nile icon component.\n *\n * @tag nile-option\n *\n */\n\n/**\n * @summary Options define the selectable items within various form controls such as [select](/components/select).\n * @status stable\n *\n * @dependency nile-icon\n *\n * @slot - The option's label.\n * @slot prefix - Used to prepend an icon or similar element to the menu item.\n * @slot suffix - Used to append an icon or similar element to the menu item.\n *\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart base - The component's base wrapper.\n * @csspart label - The option's label.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart suffix - The container that wraps the suffix.\n */\n\n@customElement('nile-option')\nexport class NileOption extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private cachedTextLabel: string;\n\n @query('.option__label') defaultSlot: HTMLSlotElement;\n\n @state() current = false; // the user has keyed into the option, but hasn't selected it yet (shows a highlight)\n @state() selected = false; // the option is selected and has aria-selected=\"true\"\n @state() hasHover = false; // we need this because Safari doesn't honor :hover styles while dragging\n @state() hidden = false; // the option is hidden\n @state() isMultipleSelect = false;\n\n /**\n * The option's value. When selected, the containing form control will receive this value. The value must be unique\n * from other options in the same group. Values may not contain spaces, as spaces are used as delimiters when listing\n * multiple values.\n */\n @property({ reflect: true }) value = '';\n\n @property({ type: Boolean }) showCheckbox: boolean = false;\n\n /** Draws the option in a disabled state, preventing selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'option');\n this.setAttribute('aria-selected', 'false');\n\n // Find the closest parent 'nile-select' element\n const parentSelect = this.closest('nile-select');\n\n // Check if the parent has the 'multiple' attribute\n if (parentSelect && parentSelect.hasAttribute('multiple')) {\n let multipleValue = parentSelect.getAttribute('multiple');\n if (multipleValue !== 'false') {\n if(multipleValue === ''){\n multipleValue = 'true';\n }\n this.isMultipleSelect = Boolean(multipleValue);\n }\n }\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if(_changedProperties.has('showCheckbox')) {\n this.isMultipleSelect = this.showCheckbox;\n }\n }\n\n private handleDefaultSlotChange() {\n const textLabel = this.getTextLabel();\n\n // Ignore the first time the label is set\n if (typeof this.cachedTextLabel === 'undefined') {\n this.cachedTextLabel = textLabel;\n return;\n }\n\n // When the label changes, emit a slotchange event so parent controls see it\n if (textLabel !== this.cachedTextLabel) {\n this.cachedTextLabel = textLabel;\n this.emit('slotchange');\n }\n }\n\n private handleMouseEnter() {\n this.hasHover = true;\n }\n\n private handleMouseLeave() {\n this.hasHover = false;\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('selected')\n handleSelectedChange() {\n this.setAttribute('aria-selected', this.selected ? 'true' : 'false');\n }\n\n @watch('value')\n handleValueChange() {\n // Ensure the value is a string. This ensures the next line doesn't error and allows framework users to pass numbers\n // instead of requiring them to cast the value to a string.\n if (typeof this.value !== 'string') {\n this.value = String(this.value);\n }\n\n // if (this.value.includes(' ')) {\n // console.error(\n // `Option values cannot include a space. All spaces have been replaced with underscores.`,\n // this\n // );\n // this.value = this.value.replace(/ /g, '_');\n // }\n }\n\n /** Returns a plain text label based on the option's content. */\n getTextLabel() {\n // Search for a label element inside the component\n const labelElement = this.querySelector('label');\n\n // If a label element is found, return its text content\n if (labelElement) {\n return labelElement.textContent?.trim() ?? '';\n }\n\n // If no label element is found, return the existing behavior\n return (this.textContent ?? '').trim();\n }\n\n render() {\n return html`\n ${!this.hidden\n ? html` <div\n part=\"base\"\n class=${classMap({\n option: true,\n 'option--single-select': !this.isMultipleSelect,\n 'option--current': this.selected && !this.isMultipleSelect,\n 'option--disabled': this.disabled,\n 'option--selected': this.selected && !this.isMultipleSelect,\n 'option--hover': this.hasHover,\n })}\n @mouseenter=${this.handleMouseEnter}\n @mouseleave=${this.handleMouseLeave}\n >\n\n ${this.isMultipleSelect ? html`<nile-checkbox class=\"option--checkbox\" .checked=${this.selected}></nile-checkbox>` : ''}\n\n <slot part=\"prefix\" name=\"prefix\" class=\"option__prefix\"></slot>\n <slot\n part=\"label\"\n class=\"option__label\"\n @slotchange=${this.handleDefaultSlotChange}\n ></slot>\n <slot part=\"suffix\" name=\"suffix\" class=\"option__suffix\"></slot>\n </div>`\n : ''}\n `;\n }\n}\n\nexport default NileOption;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-option': NileOption;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"nile-option.js","sourceRoot":"","sources":["../../../src/nile-option/nile-option.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,K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AAE;;;;;;4BAMrG,IAAI,CAAC,uBAAuB;;;iBAGvC;YACT,CAAC,CAAC,EAAE;KACP,CAAC;IACJ,CAAC;;AA9JM,iBAAM,GAAmB,MAAM,AAAzB,CAA0B;AAId;IAAxB,KAAK,CAAC,gBAAgB,CAAC;+CAA8B;AAE7C;IAAR,KAAK,EAAE;2CAAiB;AAChB;IAAR,KAAK,EAAE;4CAAkB;AACjB;IAAR,KAAK,EAAE;0CAAgB;AACf;IAAR,KAAK,EAAE;oDAA0B;AAOL;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAY;AAEX;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDAA+B;AAGf;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAkB;AAGjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAkB;AAGjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAkB;AAyD7D;IADC,KAAK,CAAC,UAAU,CAAC;sDAGjB;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;sDAGjB;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;sDAGjB;AAGD;IADC,KAAK,CAAC,OAAO,CAAC;mDAed;AAlHU,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAgKtB;;AAED,eAAe,UAAU,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, CSSResultArray, TemplateResult } from 'lit';\nimport { styles } from './nile-option.css';\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport NileElement from '../internal/nile-element';\nimport '../nile-checkbox';\n\n/**\n * Nile icon component.\n *\n * @tag nile-option\n *\n */\n\n/**\n * @summary Options define the selectable items within various form controls such as [select](/components/select).\n * @status stable\n *\n * @dependency nile-icon\n *\n * @slot - The option's label.\n * @slot prefix - Used to prepend an icon or similar element to the menu item.\n * @slot suffix - Used to append an icon or similar element to the menu item.\n *\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart base - The component's base wrapper.\n * @csspart label - The option's label.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart suffix - The container that wraps the suffix.\n */\n\n@customElement('nile-option')\nexport class NileOption extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private cachedTextLabel: string;\n\n @query('.option__label') defaultSlot: HTMLSlotElement;\n\n @state() current = false; // the user has keyed into the option, but hasn't selected it yet (shows a highlight)\n @state() hasHover = false; // we need this because Safari doesn't honor :hover styles while dragging\n @state() hidden = false; // the option is hidden\n @state() isMultipleSelect = false;\n\n /**\n * The option's value. When selected, the containing form control will receive this value. The value must be unique\n * from other options in the same group. Values may not contain spaces, as spaces are used as delimiters when listing\n * multiple values.\n */\n @property({ reflect: true }) value = '';\n\n @property({ type: Boolean }) showCheckbox: boolean = false;\n\n /** Draws the option in a disabled state, preventing selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Forces the option to display in multiple select mode with checkboxes. */\n @property({ type: Boolean, reflect: true }) multiple = false;\n\n /** Indicates whether the option is selected. */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'option');\n this.setAttribute('aria-selected', 'false');\n\n // Find the closest parent 'nile-select' or 'nile-virtual-select' element\n const parentSelect = this.closest('nile-select') || this.closest('nile-virtual-select');\n\n // Check if the parent has the 'multiple' attribute\n if (parentSelect && parentSelect.hasAttribute('multiple')) {\n let multipleValue = parentSelect.getAttribute('multiple');\n if (multipleValue !== 'false') {\n if(multipleValue === ''){\n multipleValue = 'true';\n }\n this.isMultipleSelect = Boolean(multipleValue);\n }\n }\n\n if (this.multiple) {\n this.isMultipleSelect = true;\n }\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if(_changedProperties.has('showCheckbox')) {\n this.isMultipleSelect = this.showCheckbox;\n }\n }\n\n private handleDefaultSlotChange() {\n const textLabel = this.getTextLabel();\n\n // Ignore the first time the label is set\n if (typeof this.cachedTextLabel === 'undefined') {\n this.cachedTextLabel = textLabel;\n return;\n }\n\n // When the label changes, emit a slotchange event so parent controls see it\n if (textLabel !== this.cachedTextLabel) {\n this.cachedTextLabel = textLabel;\n this.emit('slotchange');\n }\n }\n\n private handleMouseEnter() {\n this.hasHover = true;\n }\n\n private handleMouseLeave() {\n this.hasHover = false;\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('selected')\n handleSelectedChange() {\n this.setAttribute('aria-selected', this.selected ? 'true' : 'false');\n }\n\n @watch('multiple')\n handleMultipleChange() {\n this.isMultipleSelect = this.multiple;\n }\n\n @watch('value')\n handleValueChange() {\n // Ensure the value is a string. This ensures the next line doesn't error and allows framework users to pass numbers\n // instead of requiring them to cast the value to a string.\n if (typeof this.value !== 'string') {\n this.value = String(this.value);\n }\n\n // if (this.value.includes(' ')) {\n // console.error(\n // `Option values cannot include a space. All spaces have been replaced with underscores.`,\n // this\n // );\n // this.value = this.value.replace(/ /g, '_');\n // }\n }\n\n /** Returns a plain text label based on the option's content. */\n getTextLabel() {\n // Search for a label element inside the component\n const labelElement = this.querySelector('label');\n\n // If a label element is found, return its text content\n if (labelElement) {\n return labelElement.textContent?.trim() ?? '';\n }\n\n // If no label element is found, return the existing behavior\n return (this.textContent ?? '').trim();\n }\n\n render() {\n return html`\n ${!this.hidden\n ? html` <div\n part=\"base\"\n class=${classMap({\n option: true,\n 'option--single-select': !this.isMultipleSelect,\n 'option--current': this.selected && !this.isMultipleSelect,\n 'option--disabled': this.disabled,\n 'option--selected': this.selected && !this.isMultipleSelect,\n 'option--hover': this.hasHover,\n })}\n @mouseenter=${this.handleMouseEnter}\n @mouseleave=${this.handleMouseLeave}\n >\n\n ${this.isMultipleSelect ? html`<nile-checkbox class=\"option--checkbox\" .checked=${this.selected}></nile-checkbox>` : ''}\n\n <slot part=\"prefix\" name=\"prefix\" class=\"option__prefix\"></slot>\n <slot\n part=\"label\"\n class=\"option__label\"\n @slotchange=${this.handleDefaultSlotChange}\n ></slot>\n <slot part=\"suffix\" name=\"suffix\" class=\"option__suffix\"></slot>\n </div>`\n : ''}\n `;\n }\n}\n\nexport default NileOption;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-option': NileOption;\n }\n}\n"]}
|
@@ -12,6 +12,8 @@ import type { CSSResultGroup, PropertyValues } from 'lit';
|
|
12
12
|
import type { NileFormControl } from '../internal/nile-element';
|
13
13
|
import type NileOption from '../nile-option/nile-option';
|
14
14
|
import type NilePopup from '../nile-popup/nile-popup';
|
15
|
+
import type { RenderItemConfig } from '../nile-virtual-select/types.js';
|
16
|
+
import '../nile-virtual-select/nile-virtual-select';
|
15
17
|
/**
|
16
18
|
* Nile icon component.
|
17
19
|
*
|
@@ -26,6 +28,7 @@ import type NilePopup from '../nile-popup/nile-popup';
|
|
26
28
|
* @dependency nile-icon
|
27
29
|
* @dependency nile-popup
|
28
30
|
* @dependency nile-tag
|
31
|
+
* @dependency nile-virtual-select
|
29
32
|
*
|
30
33
|
* @slot - The listbox options. Must be `<nile-option>` elements. You can use `<nile-divider>` to group items visually.
|
31
34
|
* @slot label - The input's label. Alternatively, you can use the `label` attribute.
|
@@ -64,7 +67,8 @@ import type NilePopup from '../nile-popup/nile-popup';
|
|
64
67
|
*/
|
65
68
|
export declare class NileSelect extends NileElement implements NileFormControl {
|
66
69
|
static styles: CSSResultGroup;
|
67
|
-
private
|
70
|
+
private formControlController;
|
71
|
+
private virtualScrollHelper;
|
68
72
|
private readonly hasSlotController;
|
69
73
|
private typeToSelectString;
|
70
74
|
private typeToSelectTimeout;
|
@@ -151,10 +155,15 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
151
155
|
oldMaxOptionsVisible: number;
|
152
156
|
showNoResults: boolean;
|
153
157
|
noResultsMessage: string;
|
158
|
+
/** Enhanced configuration for rendering items with support for display text, value, and search text */
|
159
|
+
renderItemConfig?: RenderItemConfig;
|
160
|
+
data: any;
|
161
|
+
enableVirtualScroll: boolean;
|
154
162
|
/** Gets the validity state object */
|
155
163
|
get validity(): ValidityState;
|
156
164
|
/** Gets the validation message */
|
157
165
|
get validationMessage(): string;
|
166
|
+
constructor();
|
158
167
|
connectedCallback(): void;
|
159
168
|
disconnectedCallback(): void;
|
160
169
|
protected updated(_changedProperties: PropertyValues): void;
|
@@ -222,7 +231,7 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
222
231
|
onInputChange(event: Event): void;
|
223
232
|
calculateWidthOfSelectTagsDiv(): number | undefined;
|
224
233
|
calculateTotalWidthOfTags(): void;
|
225
|
-
render():
|
234
|
+
render(): any;
|
226
235
|
nileInput(value: any): void;
|
227
236
|
nileChange(value: any): void;
|
228
237
|
}
|
@@ -24,6 +24,8 @@ import { watch } from '../internal/watch';
|
|
24
24
|
import NileElement from '../internal/nile-element';
|
25
25
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
26
26
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
27
|
+
import '../nile-virtual-select/nile-virtual-select';
|
28
|
+
import { VirtualScrollHelper } from './virtual-scroll-helper';
|
27
29
|
/**
|
28
30
|
* Nile icon component.
|
29
31
|
*
|
@@ -38,6 +40,7 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
|
38
40
|
* @dependency nile-icon
|
39
41
|
* @dependency nile-popup
|
40
42
|
* @dependency nile-tag
|
43
|
+
* @dependency nile-virtual-select
|
41
44
|
*
|
42
45
|
* @slot - The listbox options. Must be `<nile-option>` elements. You can use `<nile-divider>` to group items visually.
|
43
46
|
* @slot label - The input's label. Alternatively, you can use the `label` attribute.
|
@@ -75,12 +78,16 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
|
75
78
|
* @csspart expand-icon - The container that wraps the expand icon.
|
76
79
|
*/
|
77
80
|
let NileSelect = class NileSelect extends NileElement {
|
81
|
+
/** Gets the validity state object */
|
82
|
+
get validity() {
|
83
|
+
return this.valueInput?.validity;
|
84
|
+
}
|
85
|
+
/** Gets the validation message */
|
86
|
+
get validationMessage() {
|
87
|
+
return this.valueInput?.validationMessage;
|
88
|
+
}
|
78
89
|
constructor() {
|
79
|
-
super(
|
80
|
-
// protected override BUBBLES=false;
|
81
|
-
this.formControlController = new FormControlController(this, {
|
82
|
-
assumeInteractionOn: ['nile-blur', 'nile-input'],
|
83
|
-
});
|
90
|
+
super();
|
84
91
|
this.hasSlotController = new HasSlotController(this, 'help-text', 'label');
|
85
92
|
this.typeToSelectString = '';
|
86
93
|
this.hasFocus = false;
|
@@ -160,17 +167,17 @@ let NileSelect = class NileSelect extends NileElement {
|
|
160
167
|
this.oldMaxOptionsVisible = 1;
|
161
168
|
this.showNoResults = false;
|
162
169
|
this.noResultsMessage = 'No results found';
|
163
|
-
|
164
|
-
|
165
|
-
get validity() {
|
166
|
-
return this.valueInput?.validity;
|
167
|
-
}
|
168
|
-
/** Gets the validation message */
|
169
|
-
get validationMessage() {
|
170
|
-
return this.valueInput?.validationMessage;
|
170
|
+
this.data = [];
|
171
|
+
this.enableVirtualScroll = false;
|
171
172
|
}
|
172
173
|
connectedCallback() {
|
173
174
|
super.connectedCallback();
|
175
|
+
if (!this.enableVirtualScroll) {
|
176
|
+
this.formControlController = new FormControlController(this, {
|
177
|
+
assumeInteractionOn: ['nile-blur', 'nile-input'],
|
178
|
+
});
|
179
|
+
}
|
180
|
+
this.virtualScrollHelper = new VirtualScrollHelper(this);
|
174
181
|
this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);
|
175
182
|
this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);
|
176
183
|
this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
@@ -587,7 +594,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
587
594
|
}
|
588
595
|
// Update validity
|
589
596
|
this.updateComplete.then(() => {
|
590
|
-
this.formControlController
|
597
|
+
this.formControlController?.updateValidity();
|
591
598
|
});
|
592
599
|
this.calculateTotalWidthOfTags();
|
593
600
|
}
|
@@ -629,8 +636,8 @@ let NileSelect = class NileSelect extends NileElement {
|
|
629
636
|
return filteredOptions;
|
630
637
|
}
|
631
638
|
handleInvalid(event) {
|
632
|
-
this.formControlController
|
633
|
-
this.formControlController
|
639
|
+
this.formControlController?.setValidity(false);
|
640
|
+
this.formControlController?.emitInvalidEvent(event);
|
634
641
|
}
|
635
642
|
handleDisabledChange() {
|
636
643
|
// Close the listbox when the control is disabled
|
@@ -712,7 +719,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
712
719
|
}
|
713
720
|
/** Gets the associated form, if one exists. */
|
714
721
|
getForm() {
|
715
|
-
return this.formControlController
|
722
|
+
return this.formControlController?.getForm() || null;
|
716
723
|
}
|
717
724
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
718
725
|
reportValidity() {
|
@@ -721,7 +728,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
721
728
|
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
722
729
|
setCustomValidity(message) {
|
723
730
|
this.valueInput.setCustomValidity(message);
|
724
|
-
this.formControlController
|
731
|
+
this.formControlController?.updateValidity();
|
725
732
|
}
|
726
733
|
/** Sets focus on the control. */
|
727
734
|
focus(options) {
|
@@ -780,6 +787,9 @@ let NileSelect = class NileSelect extends NileElement {
|
|
780
787
|
}, 1);
|
781
788
|
}
|
782
789
|
render() {
|
790
|
+
if (this.enableVirtualScroll) {
|
791
|
+
return this.virtualScrollHelper.renderVirtualizedContent();
|
792
|
+
}
|
783
793
|
const hasLabelSlot = this.hasSlotController.test('label');
|
784
794
|
const hasHelpTextSlot = this.hasSlotController.test('help-text');
|
785
795
|
const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');
|
@@ -1239,6 +1249,15 @@ __decorate([
|
|
1239
1249
|
__decorate([
|
1240
1250
|
property({ type: String })
|
1241
1251
|
], NileSelect.prototype, "noResultsMessage", void 0);
|
1252
|
+
__decorate([
|
1253
|
+
property({ attribute: false })
|
1254
|
+
], NileSelect.prototype, "renderItemConfig", void 0);
|
1255
|
+
__decorate([
|
1256
|
+
property({ type: Array })
|
1257
|
+
], NileSelect.prototype, "data", void 0);
|
1258
|
+
__decorate([
|
1259
|
+
property({ type: Boolean })
|
1260
|
+
], NileSelect.prototype, "enableVirtualScroll", void 0);
|
1242
1261
|
__decorate([
|
1243
1262
|
watch('disabled', { waitUntilFirstUpdate: true })
|
1244
1263
|
], NileSelect.prototype, "handleDisabledChange", null);
|