@aquera/nile-elements 2.0.12 → 2.0.13
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 +4 -0
- package/dist/index.js +95 -102
- package/dist/nile-select/nile-select.cjs.js +2 -2
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.cjs.js +1 -1
- package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.esm.js +12 -17
- package/dist/nile-select/nile-select.esm.js +43 -42
- package/dist/nile-select/virtual-scroll-helper.cjs.js +1 -1
- package/dist/nile-select/virtual-scroll-helper.cjs.js.map +1 -1
- package/dist/nile-select/virtual-scroll-helper.esm.js +2 -0
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +4 -4
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +12 -17
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +26 -26
- package/dist/src/nile-select/nile-select.css.js +12 -17
- package/dist/src/nile-select/nile-select.css.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +18 -2
- package/dist/src/nile-select/nile-select.js +226 -64
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-select/nile-select.test.d.ts +1 -0
- package/dist/src/nile-select/nile-select.test.js +896 -17
- package/dist/src/nile-select/nile-select.test.js.map +1 -1
- package/dist/src/nile-select/virtual-scroll-helper.js +2 -0
- package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js +12 -17
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +10 -2
- package/dist/src/nile-virtual-select/nile-virtual-select.js +142 -30
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +331 -16
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-select/nile-select.css.ts +12 -17
- package/src/nile-select/nile-select.test.ts +1112 -17
- package/src/nile-select/nile-select.ts +237 -67
- package/src/nile-select/virtual-scroll-helper.ts +2 -0
- package/src/nile-virtual-select/nile-virtual-select.css.ts +12 -17
- package/src/nile-virtual-select/nile-virtual-select.test.ts +404 -16
- package/src/nile-virtual-select/nile-virtual-select.ts +200 -79
- package/vscode-html-custom-data.json +9 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-select.css.js","sourceRoot":"","sources":["../../../src/nile-select/nile-select.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0pBxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,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 { css } from 'lit';\n\n/**\n * Select_2 CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n --ng-nxt-gen-outline: var(--ng-border-width-1) solid var(--ng-colors-border-brand);\n --ng-nxt-gen-outline-error: var(--ng-border-width-1) solid var(--ng-colors-border-error);\n --ng-private-outline-transparent: var(--ng-border-width-1) solid transparent;\n --ng-box-shadow: 0px 12px 16px -4px var(--ng-colors-effects-shadow-lg-01, rgba(10, 13, 18, 0.08)), 0px 4px 6px -2px var(--ng-colors-effects-shadow-lg-02, rgba(10, 13, 18, 0.03)), 0px 2px 2px -1px var(--ng-colors-effects-shadow-lg-03, rgba(10, 13, 18, 0.04));\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([disabled]) .form-control--has-label .form-control__label {\n user-select: none;\n -webkit-user-select: none;\n }\n \n [hidden] {\n display: none !important;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: block;\n margin-bottom: var(--nile-spacing-sm, var(--ng-spacing-sm));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-medium));\n line-height: var(--nile-spacing-2xl, var(--ng-line-height-text-sm));\n letter-spacing: 0.2px;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-tertiary-600));\n margin-top: var(--nile-spacing-lg, var(--ng-spacing-lg));\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: var(--nile-spacing-xs, var(--ng-spacing-sm));\n }\n\n :host {\n display: block;\n }\n\n /** The popup */\n .select {\n flex: 1 1 auto;\n display: inline-flex;\n width: 100%;\n position: relative;\n vertical-align: middle;\n }\n\n .select::part(popup) {\n z-index: 9999;\n }\n\n .select[data-current-placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .select[data-current-placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n /* Combobox */\n .select__combobox {\n flex: 1;\n display: flex;\n width: 100%;\n min-width: 0;\n position: relative;\n align-items: center;\n justify-content: start;\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-medium));\n letter-spacing: normal;\n vertical-align: middle;\n overflow: hidden;\n cursor: pointer;\n transition: 150ms color, 150ms border, 150ms box-shadow,\n 150ms background-color;\n }\n\n .select__display-input {\n position: relative;\n width: 100%;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n border: none;\n background: none;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n cursor: inherit;\n overflow: hidden;\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n margin: var(--nile-spacing-none, var(--ng-spacing-none));\n -webkit-appearance: none;\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n }\n\n\n .select__display-input::placeholder {\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n color: var(--nile-colors-text-placeholder, var(--ng-colors-text-placeholder));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n }\n\n .select--disabled.select--placeholder-visible .select__display-input::placeholder {\n color: var(--nile-colors-dark-500,var(--ng-colors-text-disabled));\n }\n\n .select--disabled .select__display-input{\n color:var(--nile-colors-dark-500, var(--ng-colors-text-disabled));\n pointer-events:none;\n }\n\n .select:not(.select--disabled):hover .select__display-input {\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n }\n\n .select__display-input:focus {\n outline: none;\n }\n\n /* Visually hide the display input when multiple is enabled */\n .select--multiple:not(.select--placeholder-visible) .select__display-input {\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n }\n\n .select__value-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: var(--nile-spacing-none);\n margin: var(--nile-spacing-none);\n opacity: 0;\n z-index: -1;\n }\n\n .select__tags {\n display: flex;\n flex: 1;\n align-items: center;\n flex-wrap: nowrap;\n margin-inline-start: var(--nile-spacing-7px, var(--ng-spacing-md));\n width: 100%;\n overflow: hidden;\n }\n\n .select__tags-count {\n color: var(--nile-colors-primary-600, var(--ng-colors-text-brand-secondary-700));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n line-height: var(--nile-line-height-xsmall);\n letter-spacing: 0.2px;\n margin: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .select__tags-count-clearable {\n margin-right: var(--nile-spacing-5xl, var(--ng-spacing-5xl));\n }\n\n button.select__tags-count {\n appearance: none;\n -webkit-appearance: none;\n background: none;\n text-align: inherit;\n }\n\n button.select__tags-count:disabled {\n cursor: not-allowed;\n }\n\n .select__tags--fitted {\n min-width: 0;\n }\n\n .select__tags nile-lite-tooltip.select__tag-tip {\n display: contents;\n }\n\n .select__tags nile-tag {\n flex: 0 1 auto;\n cursor: pointer;\n min-width: 0;\n }\n\n /* A chip is capped - and so truncated - only when a tooltip can reveal the\n full value. Without one it keeps its natural width and the fit pass moves\n the surplus into the +N button instead. */\n :host([showtooltip]) .select__tags nile-tag {\n max-width: var(--nile-width-180px, var(--ng-height-180px));\n }\n\n /* Only the fitted layout can move a chip into the +N button, so only there\n can a chip refuse to shrink. */\n :host(:not([showtooltip])) .select__tags--fitted nile-tag {\n flex-shrink: 0;\n }\n\n .select__tags nile-tag::part(base) {\n max-width: 100%;\n }\n\n .select__tags nile-tag::part(prefix_content_wrapper) {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n .select__tags nile-tag::part(content) {\n display: block;\n flex: 1 1 auto;\n min-width: 0;\n /* The tag's line-height of 1 leaves the clip box shorter than the glyph\n box, so descenders are cut. Pad the clip box, negate it in layout. */\n padding-block: 3px;\n margin-block: -3px;\n overflow: hidden;\n white-space: nowrap;\n }\n\n :host([showtooltip]) .select__tags nile-tag::part(content) {\n text-overflow: ellipsis;\n }\n\n .select__tags nile-tag::part(remove-button) {\n flex: 0 0 auto;\n }\n\n .select__tags--fitted nile-tag:focus-visible {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-colors-border-brand));\n outline-offset: 1px;\n border-radius: var(--nile-radius-sm, var(--ng-radius-sm));\n }\n\n .select__tags--fitted .select__tags-count {\n flex: 0 0 auto;\n margin: 0;\n padding: 0 var(--nile-spacing-xsmall, var(--ng-spacing-md));\n height: var(--nile-height-26px, var(--ng-height-26px));\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n cursor: pointer;\n border: 1px dashed\n var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n border-radius: var(--nile-radius-sm, var(--ng-radius-sm));\n }\n\n .select__tags--fitted .select__tags-count:focus-visible {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-colors-border-brand));\n outline-offset: 1px;\n }\n\n .select__tags::slotted(nile-tag) {\n cursor: pointer !important;\n }\n\n .select--disabled .select__tags,\n .select--disabled .select__tags::slotted(nile-tag) {\n cursor: not-allowed !important;\n }\n\n /* Standard selects */\n .select--standard .select__combobox {\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-neutral-500, var(--ng-colors-border-primary));\n /* outline: var(--nile-outline-none, var(--ng-private-outline-transparent)); */\n }\n\n .select--standard .select__combobox:hover {\n border: 1px solid var(--nile-colors-dark-900, var(--ng-colors-border-neutral));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n /* outline: var(--nile-outline-none, var(--ng-nxt-gen-outline)); */\n }\n\n .select--error:hover:not(.select--disabled) .select__combobox{\n border-color: var(--nile-colors-red-500, var(--ng-colors-border-error));\n /* outline: var(--nile-outline-none, var(--ng-colors-border-error)); */\n }\n\n .select--standard.select--disabled .select__combobox {\n background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));\n border-color: var(--nile-colors-neutral-500,var(--ng-colors-border-disabled) );\n color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));\n cursor: not-allowed;\n outline: none;\n }\n\n .select--standard:not(.select--disabled).select--open .select__combobox,\n .select--standard:not(.select--disabled).select--focused .select__combobox {\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-primary));\n }\n\n .select--warning .select__combobox {\n border-color: var(--nile-colors-yellow-500, var(--ng-colors-border-warning));\n }\n\n .select--error .select__combobox {\n border-color: var(--nile-colors-red-500, var(--ng-colors-border-error));\n outline: var(--nile-outline-none, var(--ng-private-outline-transparent));\n }\n\n\n\n\n .select--success {\n border-color: var(--nile-colors-green-500, var(--ng-componentcolors-utility-success-500));\n }\n\n /* Filled selects */\n .select--filled .select__combobox {\n border: none;\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n }\n\n .select--filled:hover:not(.select--disabled) .select__combobox {\n background-color: var(--nile-colors-neutral-100);\n }\n\n .select--filled.select--disabled .select__combobox {\n background-color: var(--nile-colors-neutral-100);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .select--filled:not(.select--disabled).select--open .select__combobox,\n .select--filled:not(.select--disabled).select--focused .select__combobox {\n background-color: var(--nile-colors-neutral-100);\n outline: 3px solid rgba(0, 89, 255, 0.4);\n }\n\n .select--medium .select__combobox {\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n\n padding: var(--nile-spacing-lg, var(--ng-spacing-md)) var(--nile-spacing-lg, var(--ng-spacing-lg));\n height: var(--nile-height-40px, var(--ng-height-40px));\n box-sizing: border-box;\n }\n\n .select--medium .select__clear {\n margin-inline-start: var(--nile-spacing-lg, var(--ng-spacing-lg));\n margin-right: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .select--medium .select__prefix::slotted(*) {\n margin-inline-end: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .select--medium .select__prefix.multiple::slotted(*) {\n margin-right: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .select--medium:not(.select--placeholder-visible) .select__prefix.multiple::slotted(*) {\n margin-inline-start: var(--nile-spacing-xsmall, var(--ng-spacing-lg));\n }\n\n .select--medium.select--multiple:not(.select--placeholder-visible)\n .select__combobox {\n padding-inline-start: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n\n .select--medium .select__tags {\n gap: var(--nile-spacing-3px, var(--ng-spacing-sm));\n }\n\n /* Pills */\n .select--pill.select--medium .select__combobox {\n border-radius: var(--nile-radius-3xl);\n }\n\n /* Prefix */\n .select__prefix {\n flex: 0;\n display: inline-flex;\n align-items: center;\n color: var(--nile-colors-dark-500);\n }\n\n .select__suffix {\n flex: 0;\n display: inline-flex;\n align-items: center;\n color: var(--nile-colors-dark-500);\n }\n\n /* Clear button */\n .select__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n color: var(--nile-colors-primary-600, var(--ng-colors-text-brand-secondary-700));\n border: none;\n background: none;\n padding: var(--nile-spacing-none);\n transition: 150ms color;\n cursor: pointer;\n }\n\n .select__clear:hover {\n color: var(--nile-colors-dark-500);\n }\n\n .select__clear:focus {\n outline: none;\n }\n\n /* Expand icon */\n .select__expand-icon {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n transition: 250ms rotate ease;\n rotate: 0;\n margin-inline-start: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .select--open .select__expand-icon {\n rotate: -180deg;\n }\n\n /* Listbox */\n .select__listbox {\n display: block;\n position: relative;\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-neutral-500, var(--ng-colors-border-secondary-alt));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n padding-block: var(--nile-spacing-none, var(--ng-spacing-none));\n padding-inline: var(--nile-spacing-none, var(--ng-spacing-none));\n overflow: auto;\n overscroll-behavior: none;\n /* Make sure it adheres to the popup's auto size */\n max-width: var(--auto-size-available-width);\n max-height: var(--auto-size-available-height);\n box-shadow: var(--nile-box-shadow-none, var(--ng-shadow-xs));\n }\n\n .select__options__search-enabled {\n padding-top: var(--nile-spacing-10px, var(--ng-spacing-lg));\n }\n\n .select__options {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n\n color: rgb(133, 129, 129);\n }\n\n .select__listbox::slotted(nile-divider) {\n --spacing: var(--nile-spacing-xs, var(--ng-spacing-sm));\n }\n\n .select__listbox::slotted(small) {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-semi-bold, var(--ng-font-weight-semibold));\n color: var(--nile-colors-dark-500);\n padding-block: var(--nile-spacing-xs, var(--ng-spacing-sm));\n padding-inline: var(--nile-spacing-xl, var(--ng-spacing-xl));\n }\n\n .select__search {\n position: sticky;\n top: 0px;\n z-index: 1;\n width: calc(100% - 16px);\n padding: var(--nile-spacing-md, var(--ng-spacing-md));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n margin-bottom: -8px;\n }\n\n .select__pre-footer-area {\n position: sticky;\n bottom: 0;\n z-index: 1;\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n container-type: inline-size;\n container-name: nile-select-footer;\n }\n\n .select__custom-footer {\n display: block;\n border-top: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n padding: var(--nile-spacing-lg, var(--ng-spacing-lg)) ;\n }\n\n .select__custom-footer:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-primary-hover));\n }\n\n\n /* Default: visible + centered footer with proper nxtgen fallbacks. */\n .select__footer {\n position: sticky;\n bottom: 0px;\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n border-top: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n height: 15px;\n /* Auto layout */\n display: var(--nile-display-flex, var(--ng-display-flex));\n flex-direction: row;\n align-items: center;\n padding: var(--nile-spacing-md, var(--ng-spacing-md)) var(--nile-spacing-lg, var(--ng-spacing-lg));\n gap: var(--nile-spacing-none, var(--ng-spacing-none));\n justify-content: space-between;\n }\n\n .select__footer-action,\n .select__footer .select__clear {\n display: inline-flex;\n align-items: center;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n min-width: 0;\n }\n\n .select__footer-glyph {\n flex: 0 0 auto;\n display: inline-flex;\n vertical-align: middle;\n }\n\n .select__footer-label {\n white-space: nowrap;\n }\n\n @container nile-select-footer (max-width: 178px) {\n .select__clear .select__footer-label {\n display: none;\n }\n }\n\n @container nile-select-footer (max-width: 137px) {\n .select__footer-label {\n display: none;\n }\n }\n\n :host([legacy]) .select__footer {\n background: var(--nile-colors-neutral-100);\n border-top: 1px solid var(--nile-colors-neutral-400);\n display: var(--nile-display-flex, var(--ng-display-none));\n align-items: flex-start;\n padding: var(--nile-spacing-md) var(--nile-spacing-lg)\n var(--nile-spacing-xl);\n }\n\n .tag__prefix[slot='prefix'] {\n height: 14px;\n display: inline-block;\n overflow: hidden;\n }\n\n .tag__prefix[slot='prefix'] img {\n max-height: 100%;\n }\n\n .select__loader {\n width: 100%;\n text-align: center;\n display: block;\n }\n\n .select__loader--icon {\n margin-top: var(--nile-spacing-xl, var(--ng-spacing-xl));\n animation: spin 0.6s linear infinite;\n }\n\n .select__no-results {\n padding: var(--nile-spacing-lg, var(--ng-spacing-lg));\n }\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n\n .select__prefix--from-options {\n margin-inline-end: var(--nile-spacing-lg, var(--ng-spacing-md));\n }\n\n .select__prefix--from-options img{\n max-height: var(--nile-height-none, var(--ng-height-24px));\n max-width: var(--nile-width-none, var(--ng-width-6));\n }\n\n .select__hide-default {\n display: none;\n }\n \n .select.select--open .select__combobox {\n border-color: var(--nile-colors-neutral-500,var(--ng-colors-border-brand));\n box-shadow: 0 0 0 1px var(--ng-colors-border-brand) inset ;\n}\n\n.select.select--open:hover .select__combobox {\n border-color: var(--nile-colors-neutral-500,var(--ng-colors-border-brand));\n box-shadow: 0 0 0 1px var(--ng-colors-border-brand) inset ;\n}\n\n.select.select--open .select__combobox:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-brand));\n box-shadow: 0 0 0 1px var(--ng-colors-border-brand) inset ;\n}\n\n:host([stickyHeader]) .select__footer-area {\n z-index: 1;\n}\n\n.select--disabled .select__combobox{\n user-select: none ;\n -webkit-user-select: none ;\n} \n`;\n\nexport default [styles];\n"]}
|
|
1
|
+
{"version":3,"file":"nile-select.css.js","sourceRoot":"","sources":["../../../src/nile-select/nile-select.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqpBxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,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 { css } from 'lit';\n\n/**\n * Select_2 CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n --ng-nxt-gen-outline: var(--ng-border-width-1) solid var(--ng-colors-border-brand);\n --ng-nxt-gen-outline-error: var(--ng-border-width-1) solid var(--ng-colors-border-error);\n --ng-private-outline-transparent: var(--ng-border-width-1) solid transparent;\n --ng-box-shadow: 0px 12px 16px -4px var(--ng-colors-effects-shadow-lg-01, rgba(10, 13, 18, 0.08)), 0px 4px 6px -2px var(--ng-colors-effects-shadow-lg-02, rgba(10, 13, 18, 0.03)), 0px 2px 2px -1px var(--ng-colors-effects-shadow-lg-03, rgba(10, 13, 18, 0.04));\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([disabled]) .form-control--has-label .form-control__label {\n user-select: none;\n -webkit-user-select: none;\n }\n \n [hidden] {\n display: none !important;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: block;\n margin-bottom: var(--nile-spacing-sm, var(--ng-spacing-sm));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-medium));\n line-height: var(--nile-spacing-2xl, var(--ng-line-height-text-sm));\n letter-spacing: 0.2px;\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-tertiary-600));\n margin-top: var(--nile-spacing-lg, var(--ng-spacing-lg));\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n }\n\n .form-control--has-help-text.form-control--radio-group\n .form-control__help-text {\n margin-top: var(--nile-spacing-xs, var(--ng-spacing-sm));\n }\n\n :host {\n display: block;\n }\n\n /** The popup */\n .select {\n flex: 1 1 auto;\n display: inline-flex;\n width: 100%;\n position: relative;\n vertical-align: middle;\n }\n\n .select::part(popup) {\n z-index: 9999;\n }\n\n .select[data-current-placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .select[data-current-placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n /* Combobox */\n .select__combobox {\n flex: 1;\n display: flex;\n width: 100%;\n min-width: 0;\n position: relative;\n align-items: center;\n justify-content: start;\n font-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-medium));\n letter-spacing: normal;\n vertical-align: middle;\n overflow: hidden;\n cursor: pointer;\n transition: 150ms color, 150ms border, 150ms box-shadow,\n 150ms background-color;\n }\n\n .select__display-input {\n position: relative;\n width: 100%;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n border: none;\n background: none;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n cursor: inherit;\n overflow: hidden;\n padding: var(--nile-spacing-none, var(--ng-spacing-none));\n margin: var(--nile-spacing-none, var(--ng-spacing-none));\n -webkit-appearance: none;\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n }\n\n\n .select__display-input::placeholder {\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n color: var(--nile-colors-text-placeholder, var(--ng-colors-text-placeholder));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n }\n\n .select--disabled.select--placeholder-visible .select__display-input::placeholder {\n color: var(--nile-colors-dark-500,var(--ng-colors-text-disabled));\n }\n\n .select--disabled .select__display-input{\n color:var(--nile-colors-dark-500, var(--ng-colors-text-disabled));\n pointer-events:none;\n }\n\n .select:not(.select--disabled):hover .select__display-input {\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n }\n\n .select__display-input:focus {\n outline: none;\n }\n\n /* Visually hide the display input when multiple is enabled */\n .select--multiple:not(.select--placeholder-visible) .select__display-input {\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n }\n\n .select__value-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: var(--nile-spacing-none);\n margin: var(--nile-spacing-none);\n opacity: 0;\n z-index: -1;\n }\n\n .select__tags {\n display: flex;\n flex: 1;\n align-items: center;\n flex-wrap: nowrap;\n margin-inline-start: var(--nile-spacing-7px, var(--ng-spacing-md));\n width: 100%;\n overflow: hidden;\n }\n\n .select__tags-count {\n color: var(--nile-colors-primary-600, var(--ng-colors-text-brand-secondary-700));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n line-height: var(--nile-line-height-xsmall);\n letter-spacing: 0.2px;\n margin: var(--nile-spacing-sm, var(--ng-spacing-sm));\n }\n\n .select__tags-count-clearable {\n margin-right: var(--nile-spacing-5xl, var(--ng-spacing-5xl));\n }\n\n button.select__tags-count {\n appearance: none;\n -webkit-appearance: none;\n background: none;\n text-align: inherit;\n }\n\n button.select__tags-count:disabled {\n cursor: not-allowed;\n }\n\n .select__tags--fitted {\n min-width: 0;\n }\n\n .select__tags nile-lite-tooltip.select__tag-tip {\n display: contents;\n }\n\n :host([showtooltip]) .select__tags nile-tag {\n flex: 0 1 auto;\n cursor: pointer;\n min-width: 0;\n max-width: var(--nile-width-180px, var(--ng-height-180px));\n }\n\n :host([showtooltip]) .select__tags nile-tag::part(base) {\n max-width: 100%;\n }\n\n :host([showtooltip]) .select__tags nile-tag::part(prefix_content_wrapper) {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n :host([showtooltip]) .select__tags nile-tag::part(content) {\n display: block;\n flex: 1 1 auto;\n min-width: 0;\n /* The tag's line-height of 1 leaves the clip box shorter than the glyph\n box, so descenders are cut. Pad the clip box, negate it in layout. */\n padding-block: 3px;\n margin-block: -3px;\n overflow: hidden;\n white-space: nowrap;\n }\n\n :host([showtooltip]) .select__tags nile-tag::part(content) {\n text-overflow: ellipsis;\n }\n\n :host([showtooltip]) .select__tags nile-tag::part(remove-button) {\n flex: 0 0 auto;\n }\n\n .select__tags--fitted nile-tag:focus-visible {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-colors-border-brand));\n outline-offset: 1px;\n border-radius: var(--nile-radius-sm, var(--ng-radius-sm));\n }\n\n .select__tags--fitted .select__tags-count {\n flex: 0 0 auto;\n margin: 0;\n padding: 0 var(--nile-spacing-xsmall, var(--ng-spacing-md));\n height: var(--nile-height-26px, var(--ng-height-26px));\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n cursor: pointer;\n border: 1px dashed\n var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n border-radius: var(--nile-radius-sm, var(--ng-radius-sm));\n }\n\n .select__tags--fitted .select__tags-count:focus-visible {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-colors-border-brand));\n outline-offset: 1px;\n }\n\n .select__tags::slotted(nile-tag) {\n cursor: pointer !important;\n }\n\n .select--disabled .select__tags,\n .select--disabled .select__tags::slotted(nile-tag) {\n cursor: not-allowed !important;\n }\n\n /* Standard selects */\n .select--standard .select__combobox {\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-neutral-500, var(--ng-colors-border-primary));\n /* outline: var(--nile-outline-none, var(--ng-private-outline-transparent)); */\n }\n\n .select--standard .select__combobox:hover {\n border: 1px solid var(--nile-colors-dark-900, var(--ng-colors-border-neutral));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n /* outline: var(--nile-outline-none, var(--ng-nxt-gen-outline)); */\n }\n\n .select--error:hover:not(.select--disabled) .select__combobox{\n border-color: var(--nile-colors-red-500, var(--ng-colors-border-error));\n /* outline: var(--nile-outline-none, var(--ng-colors-border-error)); */\n }\n\n .select--standard.select--disabled .select__combobox {\n background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));\n border-color: var(--nile-colors-neutral-500,var(--ng-colors-border-disabled) );\n color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));\n cursor: not-allowed;\n outline: none;\n }\n\n .select--standard:not(.select--disabled).select--open .select__combobox,\n .select--standard:not(.select--disabled).select--focused .select__combobox {\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-primary));\n }\n\n .select--warning .select__combobox {\n border-color: var(--nile-colors-yellow-500, var(--ng-colors-border-warning));\n }\n\n .select--error .select__combobox {\n border-color: var(--nile-colors-red-500, var(--ng-colors-border-error));\n outline: var(--nile-outline-none, var(--ng-private-outline-transparent));\n }\n\n\n\n\n .select--success {\n border-color: var(--nile-colors-green-500, var(--ng-componentcolors-utility-success-500));\n }\n\n /* Filled selects */\n .select--filled .select__combobox {\n border: none;\n background-color: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n }\n\n .select--filled:hover:not(.select--disabled) .select__combobox {\n background-color: var(--nile-colors-neutral-100);\n }\n\n .select--filled.select--disabled .select__combobox {\n background-color: var(--nile-colors-neutral-100);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .select--filled:not(.select--disabled).select--open .select__combobox,\n .select--filled:not(.select--disabled).select--focused .select__combobox {\n background-color: var(--nile-colors-neutral-100);\n outline: 3px solid rgba(0, 89, 255, 0.4);\n }\n\n .select--medium .select__combobox {\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n\n padding: var(--nile-spacing-lg, var(--ng-spacing-md)) var(--nile-spacing-lg, var(--ng-spacing-lg));\n height: var(--nile-height-40px, var(--ng-height-40px));\n box-sizing: border-box;\n }\n\n .select--medium .select__clear {\n margin-inline-start: var(--nile-spacing-lg, var(--ng-spacing-lg));\n margin-right: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .select--medium .select__prefix::slotted(*) {\n margin-inline-end: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .select--medium .select__prefix.multiple::slotted(*) {\n margin-right: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .select--medium:not(.select--placeholder-visible) .select__prefix.multiple::slotted(*) {\n margin-inline-start: var(--nile-spacing-xsmall, var(--ng-spacing-lg));\n }\n\n .select--medium.select--multiple:not(.select--placeholder-visible)\n .select__combobox {\n padding-inline-start: var(--nile-spacing-none, var(--ng-spacing-none));\n }\n\n .select--medium .select__tags {\n gap: var(--nile-spacing-3px, var(--ng-spacing-sm));\n }\n\n /* Pills */\n .select--pill.select--medium .select__combobox {\n border-radius: var(--nile-radius-3xl);\n }\n\n /* Prefix */\n .select__prefix {\n flex: 0;\n display: inline-flex;\n align-items: center;\n color: var(--nile-colors-dark-500);\n }\n\n .select__suffix {\n flex: 0;\n display: inline-flex;\n align-items: center;\n color: var(--nile-colors-dark-500);\n }\n\n /* Clear button */\n .select__clear {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n color: var(--nile-colors-primary-600, var(--ng-colors-text-brand-secondary-700));\n border: none;\n background: none;\n padding: var(--nile-spacing-none);\n transition: 150ms color;\n cursor: pointer;\n }\n\n .select__clear:hover {\n color: var(--nile-colors-dark-500);\n }\n\n .select__clear:focus {\n outline: none;\n }\n\n /* Expand icon */\n .select__expand-icon {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n transition: 250ms rotate ease;\n rotate: 0;\n margin-inline-start: var(--nile-spacing-md, var(--ng-spacing-md));\n }\n\n .select--open .select__expand-icon {\n rotate: -180deg;\n }\n\n /* Listbox */\n .select__listbox {\n display: block;\n position: relative;\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border: solid 1px var(--nile-colors-neutral-500, var(--ng-colors-border-secondary-alt));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n padding-block: var(--nile-spacing-none, var(--ng-spacing-none));\n padding-inline: var(--nile-spacing-none, var(--ng-spacing-none));\n overflow: auto;\n overscroll-behavior: none;\n /* Make sure it adheres to the popup's auto size */\n max-width: var(--auto-size-available-width);\n max-height: var(--auto-size-available-height);\n box-shadow: var(--nile-box-shadow-none, var(--ng-shadow-xs));\n }\n\n .select__options__search-enabled {\n padding-top: var(--nile-spacing-10px, var(--ng-spacing-lg));\n }\n\n .select__options {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n\n color: rgb(133, 129, 129);\n }\n\n .select__listbox::slotted(nile-divider) {\n --spacing: var(--nile-spacing-xs, var(--ng-spacing-sm));\n }\n\n .select__listbox::slotted(small) {\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));\n font-weight: var(--nile-font-weight-semi-bold, var(--ng-font-weight-semibold));\n color: var(--nile-colors-dark-500);\n padding-block: var(--nile-spacing-xs, var(--ng-spacing-sm));\n padding-inline: var(--nile-spacing-xl, var(--ng-spacing-xl));\n }\n\n .select__search {\n position: sticky;\n top: 0px;\n z-index: 1;\n width: calc(100% - 16px);\n padding: var(--nile-spacing-md, var(--ng-spacing-md));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n margin-bottom: -8px;\n }\n\n .select__pre-footer-area {\n position: sticky;\n bottom: 0;\n z-index: 1;\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n }\n\n .select__pre-footer-area--query {\n container-type: inline-size;\n container-name: nile-select-footer;\n }\n\n .select__custom-footer {\n display: block;\n border-top: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n padding: var(--nile-spacing-lg, var(--ng-spacing-lg)) ;\n }\n\n .select__custom-footer:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-primary-hover));\n }\n\n\n /* Default: visible + centered footer with proper nxtgen fallbacks. */\n .select__footer {\n position: sticky;\n bottom: 0px;\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n border-top: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n height: 15px;\n /* Auto layout */\n display: var(--nile-display-flex, var(--ng-display-flex));\n flex-direction: row;\n align-items: center;\n padding: var(--nile-spacing-md, var(--ng-spacing-md)) var(--nile-spacing-lg, var(--ng-spacing-lg));\n gap: var(--nile-spacing-none, var(--ng-spacing-none));\n justify-content: space-between;\n }\n\n .select__footer-action,\n .select__footer .select__clear {\n display: inline-flex;\n align-items: center;\n gap: var(--nile-spacing-sm, var(--ng-spacing-sm));\n min-width: 0;\n }\n\n .select__footer-glyph {\n flex: 0 0 auto;\n display: inline-flex;\n vertical-align: middle;\n }\n\n .select__footer-label {\n white-space: nowrap;\n }\n\n @container nile-select-footer (max-width: 178px) {\n .select__clear .select__footer-label {\n display: none;\n }\n }\n\n @container nile-select-footer (max-width: 137px) {\n .select__footer-label {\n display: none;\n }\n }\n\n :host([legacy]) .select__footer {\n background: var(--nile-colors-neutral-100);\n border-top: 1px solid var(--nile-colors-neutral-400);\n display: var(--nile-display-flex, var(--ng-display-none));\n align-items: flex-start;\n padding: var(--nile-spacing-md) var(--nile-spacing-lg)\n var(--nile-spacing-xl);\n }\n\n .tag__prefix[slot='prefix'] {\n height: 14px;\n display: inline-block;\n overflow: hidden;\n }\n\n .tag__prefix[slot='prefix'] img {\n max-height: 100%;\n }\n\n .select__loader {\n width: 100%;\n text-align: center;\n display: block;\n }\n\n .select__loader--icon {\n margin-top: var(--nile-spacing-xl, var(--ng-spacing-xl));\n animation: spin 0.6s linear infinite;\n }\n\n .select__no-results {\n padding: var(--nile-spacing-lg, var(--ng-spacing-lg));\n }\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n\n .select__invisible {\n opacity: 0;\n }\n\n .select__prefix--from-options {\n margin-inline-end: var(--nile-spacing-lg, var(--ng-spacing-md));\n }\n\n .select__prefix--from-options img{\n max-height: var(--nile-height-none, var(--ng-height-24px));\n max-width: var(--nile-width-none, var(--ng-width-6));\n }\n\n .select__hide-default {\n display: none;\n }\n \n .select.select--open .select__combobox {\n border-color: var(--nile-colors-neutral-500,var(--ng-colors-border-brand));\n box-shadow: 0 0 0 1px var(--ng-colors-border-brand) inset ;\n}\n\n.select.select--open:hover .select__combobox {\n border-color: var(--nile-colors-neutral-500,var(--ng-colors-border-brand));\n box-shadow: 0 0 0 1px var(--ng-colors-border-brand) inset ;\n}\n\n.select.select--open .select__combobox:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-brand));\n box-shadow: 0 0 0 1px var(--ng-colors-border-brand) inset ;\n}\n\n:host([stickyHeader]) .select__footer-area {\n z-index: 1;\n}\n\n.select--disabled .select__combobox{\n user-select: none ;\n -webkit-user-select: none ;\n} \n`;\n\nexport default [styles];\n"]}
|
|
@@ -88,6 +88,7 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
|
88
88
|
private resizeController;
|
|
89
89
|
private visibilityManager?;
|
|
90
90
|
private chipFitFrame;
|
|
91
|
+
private measurableWatch?;
|
|
91
92
|
private lastChipLayout;
|
|
92
93
|
private clippedChips;
|
|
93
94
|
private clipFrame;
|
|
@@ -102,6 +103,7 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
|
102
103
|
selectedOptions: NileOption[];
|
|
103
104
|
oldValue: string | string[];
|
|
104
105
|
private hiddenChipCount;
|
|
106
|
+
oldMaxOptionsVisible: number;
|
|
105
107
|
/** Last measured width of the overflow button, in px. */
|
|
106
108
|
private lastOverflowWidth;
|
|
107
109
|
/** The name of the select, submitted as a name/value pair with form data. */
|
|
@@ -156,13 +158,16 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
|
156
158
|
get maxOptionsVisible(): number;
|
|
157
159
|
set maxOptionsVisible(value: number);
|
|
158
160
|
private get chipFittingEnabled();
|
|
161
|
+
private get legacyTagFitEnabled();
|
|
162
|
+
private setFittedMaxOptionsVisible;
|
|
159
163
|
/** Minimum width, in px, of a squeezed chip. Needs `showtooltip`. */
|
|
160
164
|
chipMinWidth: number;
|
|
161
165
|
/** Maximum width, in px, of a squeezed chip. Needs `showtooltip`. */
|
|
162
166
|
chipMaxWidth: number;
|
|
163
167
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
168
|
+
* Opts into the fitted chip row: chips are sized between chipMinWidth and chipMaxWidth, the
|
|
169
|
+
* rest collapse into a +N button, and a clipped chip shows its full value in a tooltip.
|
|
170
|
+
* Off by default, which keeps the pre-2.0.9 chip row.
|
|
166
171
|
*/
|
|
167
172
|
showTooltip: boolean;
|
|
168
173
|
/** Disables the select control. */
|
|
@@ -225,6 +230,9 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
|
225
230
|
disconnectedCallback(): void;
|
|
226
231
|
private setupResizeObserver;
|
|
227
232
|
private syncVirtualSelectMaxOptionsVisible;
|
|
233
|
+
syncValueFromVirtualSelect(event: CustomEvent<{
|
|
234
|
+
value?: string | string[];
|
|
235
|
+
}>): void;
|
|
228
236
|
protected updated(_changedProperties: PropertyValues): void;
|
|
229
237
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
230
238
|
setCheckBoxInOption(checked: boolean): void;
|
|
@@ -268,6 +276,7 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
|
268
276
|
private handleDefaultSlotChange;
|
|
269
277
|
private handleTagRemove;
|
|
270
278
|
private getAllOptions;
|
|
279
|
+
private prefixCopies;
|
|
271
280
|
private getOptionPrefixNodes;
|
|
272
281
|
private getFirstOption;
|
|
273
282
|
private setCurrentOption;
|
|
@@ -306,15 +315,20 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
|
306
315
|
blur(): void;
|
|
307
316
|
onInputChange(event: Event): void;
|
|
308
317
|
calculateTotalWidthOfTags(): void;
|
|
318
|
+
private calculateWidthOfSelectTagsDiv;
|
|
319
|
+
private fitTagsLegacy;
|
|
309
320
|
private allocateChipWidths;
|
|
310
321
|
private computeChipFit;
|
|
311
322
|
private layoutChips;
|
|
323
|
+
private labelOverflows;
|
|
312
324
|
private isChipClipped;
|
|
313
325
|
private refreshClippedChips;
|
|
314
326
|
private scheduleClipCheck;
|
|
315
327
|
/** A chip gets a tooltip only while its text is measured as clipped. */
|
|
316
328
|
private chipTooltipDisabled;
|
|
317
329
|
private destroyChipFit;
|
|
330
|
+
private refitWhenMeasurable;
|
|
331
|
+
private stopMeasurableWatch;
|
|
318
332
|
private getChipLabel;
|
|
319
333
|
private handleChipKeyDown;
|
|
320
334
|
/** Moves focus to the next chip, the last chip, or the field after a removal. */
|
|
@@ -322,6 +336,8 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
|
322
336
|
private handleOverflowActivate;
|
|
323
337
|
private handleOverflowKeyDown;
|
|
324
338
|
private renderFittedTags;
|
|
339
|
+
private renderLegacyTags;
|
|
340
|
+
private renderLegacyTag;
|
|
325
341
|
handleInputAfterInit(): void;
|
|
326
342
|
render(): any;
|
|
327
343
|
nileInput(value: any): void;
|
|
@@ -100,7 +100,15 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
100
100
|
this.requestUpdate('maxOptionsVisible', previous);
|
|
101
101
|
}
|
|
102
102
|
get chipFittingEnabled() {
|
|
103
|
-
return !!this.multiple && !this.maxOptionsVisibleExplicit;
|
|
103
|
+
return !!this.multiple && this.showTooltip && !this.maxOptionsVisibleExplicit;
|
|
104
|
+
}
|
|
105
|
+
get legacyTagFitEnabled() {
|
|
106
|
+
return !!this.multiple && !this.showTooltip;
|
|
107
|
+
}
|
|
108
|
+
setFittedMaxOptionsVisible(value) {
|
|
109
|
+
const previous = this._maxOptionsVisible;
|
|
110
|
+
this._maxOptionsVisible = value;
|
|
111
|
+
this.requestUpdate('maxOptionsVisible', previous);
|
|
104
112
|
}
|
|
105
113
|
/** Gets the validity state object */
|
|
106
114
|
get validity() {
|
|
@@ -118,6 +126,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
118
126
|
this.scrolling = false;
|
|
119
127
|
this.options = [];
|
|
120
128
|
this.resizeController = new ResizeController(this, {
|
|
129
|
+
target: null,
|
|
121
130
|
callback: (entries) => {
|
|
122
131
|
for (const entry of entries) {
|
|
123
132
|
if (entry.target.classList.contains('select__tags')) {
|
|
@@ -135,6 +144,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
135
144
|
this.selectedOptions = [];
|
|
136
145
|
this.oldValue = '';
|
|
137
146
|
this.hiddenChipCount = 0;
|
|
147
|
+
this.oldMaxOptionsVisible = 1;
|
|
138
148
|
/** Last measured width of the overflow button, in px. */
|
|
139
149
|
this.lastOverflowWidth = 0;
|
|
140
150
|
/** The name of the select, submitted as a name/value pair with form data. */
|
|
@@ -191,8 +201,9 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
191
201
|
/** Maximum width, in px, of a squeezed chip. Needs `showtooltip`. */
|
|
192
202
|
this.chipMaxWidth = 180;
|
|
193
203
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
204
|
+
* Opts into the fitted chip row: chips are sized between chipMinWidth and chipMaxWidth, the
|
|
205
|
+
* rest collapse into a +N button, and a clipped chip shows its full value in a tooltip.
|
|
206
|
+
* Off by default, which keeps the pre-2.0.9 chip row.
|
|
196
207
|
*/
|
|
197
208
|
this.showTooltip = false;
|
|
198
209
|
/** Disables the select control. */
|
|
@@ -250,6 +261,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
250
261
|
this.handleWindowScroll = () => {
|
|
251
262
|
this.portalManager.updatePortalAppendPosition();
|
|
252
263
|
};
|
|
264
|
+
this.prefixCopies = new WeakMap();
|
|
253
265
|
}
|
|
254
266
|
connectedCallback() {
|
|
255
267
|
super.connectedCallback();
|
|
@@ -266,6 +278,9 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
266
278
|
this.handleWindowScroll = this.handleWindowScroll.bind(this);
|
|
267
279
|
// Because this is a form control, it shouldn't be opened initially
|
|
268
280
|
this.open = false;
|
|
281
|
+
if (this.hasUpdated && this.chipFittingEnabled) {
|
|
282
|
+
this.calculateTotalWidthOfTags();
|
|
283
|
+
}
|
|
269
284
|
this.emit('nile-init');
|
|
270
285
|
}
|
|
271
286
|
disconnectedCallback() {
|
|
@@ -282,7 +297,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
282
297
|
this.emit('nile-destroy');
|
|
283
298
|
}
|
|
284
299
|
setupResizeObserver() {
|
|
285
|
-
const wanted = this.autoResize && this.chipFittingEnabled
|
|
300
|
+
const wanted = this.autoResize && (this.chipFittingEnabled || this.legacyTagFitEnabled)
|
|
286
301
|
? this.shadowRoot?.querySelector('.select__tags') ??
|
|
287
302
|
undefined
|
|
288
303
|
: undefined;
|
|
@@ -312,6 +327,13 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
312
327
|
inner.maxOptionsVisible = this._maxOptionsVisible;
|
|
313
328
|
}
|
|
314
329
|
}
|
|
330
|
+
syncValueFromVirtualSelect(event) {
|
|
331
|
+
if (event.composedPath()[0] !== event.currentTarget)
|
|
332
|
+
return;
|
|
333
|
+
if (!event.detail || !('value' in event.detail))
|
|
334
|
+
return;
|
|
335
|
+
this.value = event.detail.value ?? (this.multiple ? [] : '');
|
|
336
|
+
}
|
|
315
337
|
updated(_changedProperties) {
|
|
316
338
|
if (_changedProperties.has('searchEnabled')) {
|
|
317
339
|
this.updateGroupStickyOffsets();
|
|
@@ -327,9 +349,15 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
327
349
|
}
|
|
328
350
|
if (_changedProperties.has('autoResize') ||
|
|
329
351
|
_changedProperties.has('multiple') ||
|
|
330
|
-
_changedProperties.has('maxOptionsVisible')
|
|
352
|
+
_changedProperties.has('maxOptionsVisible') ||
|
|
353
|
+
_changedProperties.has('showTooltip')) {
|
|
331
354
|
this.setupResizeObserver();
|
|
332
355
|
}
|
|
356
|
+
if (_changedProperties.has('showTooltip') &&
|
|
357
|
+
_changedProperties.get('showTooltip') !== undefined &&
|
|
358
|
+
this.legacyTagFitEnabled) {
|
|
359
|
+
this.calculateTotalWidthOfTags();
|
|
360
|
+
}
|
|
333
361
|
this.syncVirtualSelectMaxOptionsVisible();
|
|
334
362
|
if (_changedProperties.has('enableDescription')) {
|
|
335
363
|
this.setEnableDescriptionInOptions();
|
|
@@ -799,11 +827,23 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
799
827
|
}
|
|
800
828
|
return options;
|
|
801
829
|
}
|
|
802
|
-
getOptionPrefixNodes(option) {
|
|
830
|
+
getOptionPrefixNodes(option, site) {
|
|
803
831
|
const prefixSlot = option.shadowRoot?.querySelector('slot[name="prefix"]');
|
|
804
832
|
if (!prefixSlot)
|
|
805
833
|
return [];
|
|
806
|
-
|
|
834
|
+
const sources = prefixSlot.assignedElements();
|
|
835
|
+
const markup = sources.map(el => el.outerHTML).join('');
|
|
836
|
+
let sites = this.prefixCopies.get(option);
|
|
837
|
+
if (!sites) {
|
|
838
|
+
sites = new Map();
|
|
839
|
+
this.prefixCopies.set(option, sites);
|
|
840
|
+
}
|
|
841
|
+
const cached = sites.get(site);
|
|
842
|
+
if (cached && cached.markup === markup)
|
|
843
|
+
return cached.nodes;
|
|
844
|
+
const nodes = sources.map(el => el.cloneNode(true));
|
|
845
|
+
sites.set(site, { markup, nodes });
|
|
846
|
+
return nodes;
|
|
807
847
|
}
|
|
808
848
|
// Gets the first <nile-option> element
|
|
809
849
|
getFirstOption() {
|
|
@@ -1135,6 +1175,10 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1135
1175
|
event.stopPropagation();
|
|
1136
1176
|
}
|
|
1137
1177
|
calculateTotalWidthOfTags() {
|
|
1178
|
+
if (this.legacyTagFitEnabled) {
|
|
1179
|
+
this.fitTagsLegacy();
|
|
1180
|
+
return;
|
|
1181
|
+
}
|
|
1138
1182
|
if (!this.chipFittingEnabled)
|
|
1139
1183
|
return;
|
|
1140
1184
|
if (this.chipFitFrame)
|
|
@@ -1144,6 +1188,49 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1144
1188
|
this.layoutChips();
|
|
1145
1189
|
});
|
|
1146
1190
|
}
|
|
1191
|
+
calculateWidthOfSelectTagsDiv() {
|
|
1192
|
+
if (this.shadowRoot) {
|
|
1193
|
+
const selectTagsDiv = this.shadowRoot.querySelector('div.select__tags');
|
|
1194
|
+
if (selectTagsDiv instanceof HTMLElement) {
|
|
1195
|
+
const width = selectTagsDiv.offsetWidth;
|
|
1196
|
+
return width - 70;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
fitTagsLegacy() {
|
|
1201
|
+
if (this.maxOptionsVisible !== Infinity) {
|
|
1202
|
+
this.oldMaxOptionsVisible = this.maxOptionsVisible;
|
|
1203
|
+
}
|
|
1204
|
+
this.setFittedMaxOptionsVisible(Infinity);
|
|
1205
|
+
setTimeout(() => {
|
|
1206
|
+
const widths = [];
|
|
1207
|
+
if (this.shadowRoot) {
|
|
1208
|
+
const tags = this.shadowRoot.querySelectorAll('nile-tag');
|
|
1209
|
+
tags.forEach(tag => {
|
|
1210
|
+
if (tag instanceof HTMLElement) {
|
|
1211
|
+
widths.push(tag.offsetWidth);
|
|
1212
|
+
}
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
if (this.value.length !== widths.length) {
|
|
1216
|
+
return;
|
|
1217
|
+
}
|
|
1218
|
+
const widthOfSelectTagsDiv = this.calculateWidthOfSelectTagsDiv();
|
|
1219
|
+
if (!widthOfSelectTagsDiv) {
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
let summ = 0;
|
|
1223
|
+
let lastindex = 0;
|
|
1224
|
+
for (let i = 0; i < widths.length; i++) {
|
|
1225
|
+
summ += widths[i];
|
|
1226
|
+
if (summ > widthOfSelectTagsDiv) {
|
|
1227
|
+
lastindex = i;
|
|
1228
|
+
break;
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
this.setFittedMaxOptionsVisible(lastindex);
|
|
1232
|
+
}, 1);
|
|
1233
|
+
}
|
|
1147
1234
|
allocateChipWidths(natural, available) {
|
|
1148
1235
|
const min = this.chipMinWidth;
|
|
1149
1236
|
const max = this.chipMaxWidth;
|
|
@@ -1223,6 +1310,11 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1223
1310
|
this.hiddenChipCount = 0;
|
|
1224
1311
|
return;
|
|
1225
1312
|
}
|
|
1313
|
+
if (container.clientWidth === 0) {
|
|
1314
|
+
this.refitWhenMeasurable(container);
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
this.stopMeasurableWatch();
|
|
1226
1318
|
const overflowEl = container.querySelector('.select__tags-count');
|
|
1227
1319
|
for (const chip of chips) {
|
|
1228
1320
|
chip.style.display = '';
|
|
@@ -1268,13 +1360,45 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1268
1360
|
}
|
|
1269
1361
|
this.refreshClippedChips();
|
|
1270
1362
|
}
|
|
1363
|
+
labelOverflows(content) {
|
|
1364
|
+
let left = Infinity;
|
|
1365
|
+
let right = -Infinity;
|
|
1366
|
+
const range = document.createRange();
|
|
1367
|
+
for (const node of content.assignedNodes({ flatten: true })) {
|
|
1368
|
+
let rect;
|
|
1369
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
1370
|
+
if (!node.textContent?.trim())
|
|
1371
|
+
continue;
|
|
1372
|
+
range.selectNodeContents(node);
|
|
1373
|
+
rect = range.getBoundingClientRect();
|
|
1374
|
+
}
|
|
1375
|
+
else if (node instanceof Element) {
|
|
1376
|
+
rect = node.getBoundingClientRect();
|
|
1377
|
+
}
|
|
1378
|
+
else {
|
|
1379
|
+
continue;
|
|
1380
|
+
}
|
|
1381
|
+
if (rect.width === 0)
|
|
1382
|
+
continue;
|
|
1383
|
+
left = Math.min(left, rect.left);
|
|
1384
|
+
right = Math.max(right, rect.right);
|
|
1385
|
+
}
|
|
1386
|
+
if (right < left)
|
|
1387
|
+
return false;
|
|
1388
|
+
const box = content.getBoundingClientRect();
|
|
1389
|
+
const styles = getComputedStyle(content);
|
|
1390
|
+
const boxLeft = box.left + parseFloat(styles.borderLeftWidth) + parseFloat(styles.paddingLeft);
|
|
1391
|
+
const boxRight = box.right - parseFloat(styles.borderRightWidth) - parseFloat(styles.paddingRight);
|
|
1392
|
+
const epsilon = 1 / 64;
|
|
1393
|
+
return right > boxRight + epsilon || left < boxLeft - epsilon;
|
|
1394
|
+
}
|
|
1271
1395
|
isChipClipped(el) {
|
|
1272
1396
|
if (!el)
|
|
1273
1397
|
return false;
|
|
1274
1398
|
const root = el.shadowRoot;
|
|
1275
1399
|
if (root) {
|
|
1276
1400
|
const content = root.querySelector('[part="content"]');
|
|
1277
|
-
if (content &&
|
|
1401
|
+
if (content && this.labelOverflows(content))
|
|
1278
1402
|
return true;
|
|
1279
1403
|
const inner = root.querySelector('[part="prefix_content_wrapper"]');
|
|
1280
1404
|
if (inner && inner.scrollWidth > inner.clientWidth + 1)
|
|
@@ -1316,6 +1440,26 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1316
1440
|
cancelAnimationFrame(this.clipFrame);
|
|
1317
1441
|
this.clipFrame = 0;
|
|
1318
1442
|
this.lastChipLayout = { hidden: -1, visible: -1 };
|
|
1443
|
+
this.stopMeasurableWatch();
|
|
1444
|
+
}
|
|
1445
|
+
refitWhenMeasurable(container) {
|
|
1446
|
+
if (!this.isConnected)
|
|
1447
|
+
return;
|
|
1448
|
+
if (this.measurableWatch?.target === container)
|
|
1449
|
+
return;
|
|
1450
|
+
this.stopMeasurableWatch();
|
|
1451
|
+
const observer = new ResizeObserver(entries => {
|
|
1452
|
+
if (!entries.some(entry => entry.contentRect.width > 0))
|
|
1453
|
+
return;
|
|
1454
|
+
this.stopMeasurableWatch();
|
|
1455
|
+
this.calculateTotalWidthOfTags();
|
|
1456
|
+
});
|
|
1457
|
+
observer.observe(container);
|
|
1458
|
+
this.measurableWatch = { observer, target: container };
|
|
1459
|
+
}
|
|
1460
|
+
stopMeasurableWatch() {
|
|
1461
|
+
this.measurableWatch?.observer.disconnect();
|
|
1462
|
+
this.measurableWatch = undefined;
|
|
1319
1463
|
}
|
|
1320
1464
|
getChipLabel(option) {
|
|
1321
1465
|
return (option.getTextLabel?.() ?? '').trim();
|
|
@@ -1370,7 +1514,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1370
1514
|
<div part="tags" class="select__tags select__tags--fitted">
|
|
1371
1515
|
${this.selectedOptions.map((option, index) => {
|
|
1372
1516
|
const label = this.getChipLabel(option);
|
|
1373
|
-
const prefixNodes = this.getOptionPrefixNodes(option);
|
|
1517
|
+
const prefixNodes = this.getOptionPrefixNodes(option, 'chip');
|
|
1374
1518
|
return html `
|
|
1375
1519
|
<nile-lite-tooltip
|
|
1376
1520
|
class="select__tag-tip"
|
|
@@ -1422,6 +1566,65 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1422
1566
|
</div>
|
|
1423
1567
|
`;
|
|
1424
1568
|
}
|
|
1569
|
+
renderLegacyTags() {
|
|
1570
|
+
return html `
|
|
1571
|
+
<div part="tags" class="select__tags">
|
|
1572
|
+
${this.selectedOptions.map((option, index) => {
|
|
1573
|
+
if (index < this.maxOptionsVisible || this.maxOptionsVisible <= 0) {
|
|
1574
|
+
return this.showTooltip
|
|
1575
|
+
? html `<nile-lite-tooltip
|
|
1576
|
+
class="select__tag-tip"
|
|
1577
|
+
.content=${option.getTextLabel()}
|
|
1578
|
+
?disabled=${this.chipTooltipDisabled(index)}
|
|
1579
|
+
>${this.renderLegacyTag(option, index)}</nile-lite-tooltip
|
|
1580
|
+
>`
|
|
1581
|
+
: this.renderLegacyTag(option, index);
|
|
1582
|
+
}
|
|
1583
|
+
else if (index === this.maxOptionsVisible) {
|
|
1584
|
+
return html `
|
|
1585
|
+
<span class="select__tags-count"
|
|
1586
|
+
>+${this.selectedOptions.length - index} More
|
|
1587
|
+
</span>
|
|
1588
|
+
`;
|
|
1589
|
+
}
|
|
1590
|
+
else {
|
|
1591
|
+
return null;
|
|
1592
|
+
}
|
|
1593
|
+
})}
|
|
1594
|
+
</div>
|
|
1595
|
+
`;
|
|
1596
|
+
}
|
|
1597
|
+
renderLegacyTag(option, index) {
|
|
1598
|
+
const prefixNodes = this.getOptionPrefixNodes(option, 'chip');
|
|
1599
|
+
const classes = {
|
|
1600
|
+
select__invisible: index + 1 > this.oldMaxOptionsVisible &&
|
|
1601
|
+
this.maxOptionsVisible === Infinity,
|
|
1602
|
+
};
|
|
1603
|
+
return html `
|
|
1604
|
+
<nile-tag
|
|
1605
|
+
class=${classMap(classes)}
|
|
1606
|
+
part="tag"
|
|
1607
|
+
exportparts="
|
|
1608
|
+
base:tag__base,
|
|
1609
|
+
content:tag__content,
|
|
1610
|
+
remove-button:tag__remove-button,
|
|
1611
|
+
remove-button__base:tag__remove-button__base,
|
|
1612
|
+
prefix:tag__prefix,
|
|
1613
|
+
prefix_content_wrapper:tag__prefix_content_wrapper
|
|
1614
|
+
"
|
|
1615
|
+
style=${ifDefined(this.showTooltip ? `max-width:${this.chipMaxWidth}px` : undefined)}
|
|
1616
|
+
?pill=${this.pill}
|
|
1617
|
+
size=${this.size}
|
|
1618
|
+
removable
|
|
1619
|
+
@nile-remove=${(event) => this.handleTagRemove(event, option)}
|
|
1620
|
+
>
|
|
1621
|
+
${prefixNodes.length
|
|
1622
|
+
? html `<span class="tag__prefix" slot="prefix">${prefixNodes}</span>`
|
|
1623
|
+
: ''}
|
|
1624
|
+
${option.getTextLabel()}
|
|
1625
|
+
</nile-tag>
|
|
1626
|
+
`;
|
|
1627
|
+
}
|
|
1425
1628
|
handleInputAfterInit() {
|
|
1426
1629
|
this.shadowRoot?.querySelector('nile-input')?.inputFocus();
|
|
1427
1630
|
}
|
|
@@ -1439,7 +1642,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1439
1642
|
const hasHelpText = (this.helpText || this.help_text) ? true : false;
|
|
1440
1643
|
const hasErrorMessage = this.errorMessage ? true : false;
|
|
1441
1644
|
const prefixNodes = this.selectedOptions[0]
|
|
1442
|
-
? this.getOptionPrefixNodes(this.selectedOptions[0])
|
|
1645
|
+
? this.getOptionPrefixNodes(this.selectedOptions[0], 'trigger')
|
|
1443
1646
|
: [];
|
|
1444
1647
|
return html `
|
|
1445
1648
|
<div
|
|
@@ -1553,57 +1756,7 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1553
1756
|
${this.multiple
|
|
1554
1757
|
? this.chipFittingEnabled
|
|
1555
1758
|
? this.renderFittedTags()
|
|
1556
|
-
:
|
|
1557
|
-
<div part="tags" class="select__tags">
|
|
1558
|
-
${this.selectedOptions.map((option, index) => {
|
|
1559
|
-
if (index < this.maxOptionsVisible ||
|
|
1560
|
-
this.maxOptionsVisible <= 0) {
|
|
1561
|
-
const prefixNodes = this.getOptionPrefixNodes(option);
|
|
1562
|
-
return html `
|
|
1563
|
-
<nile-lite-tooltip
|
|
1564
|
-
class="select__tag-tip"
|
|
1565
|
-
.content=${option.getTextLabel()}
|
|
1566
|
-
?disabled=${this.chipTooltipDisabled(index)}
|
|
1567
|
-
>
|
|
1568
|
-
<nile-tag
|
|
1569
|
-
part="tag"
|
|
1570
|
-
exportparts="
|
|
1571
|
-
base:tag__base,
|
|
1572
|
-
content:tag__content,
|
|
1573
|
-
remove-button:tag__remove-button,
|
|
1574
|
-
remove-button__base:tag__remove-button__base,
|
|
1575
|
-
prefix:tag__prefix,
|
|
1576
|
-
prefix_content_wrapper:tag__prefix_content_wrapper
|
|
1577
|
-
"
|
|
1578
|
-
style="max-width:${this.chipMaxWidth}px"
|
|
1579
|
-
?pill=${this.pill}
|
|
1580
|
-
size=${this.size}
|
|
1581
|
-
removable
|
|
1582
|
-
@nile-remove=${(event) => this.handleTagRemove(event, option)}
|
|
1583
|
-
>
|
|
1584
|
-
${prefixNodes.length
|
|
1585
|
-
? html `<span class="tag__prefix" slot="prefix"
|
|
1586
|
-
>${prefixNodes}</span
|
|
1587
|
-
>`
|
|
1588
|
-
: ''}
|
|
1589
|
-
${option.getTextLabel()}
|
|
1590
|
-
</nile-tag>
|
|
1591
|
-
</nile-lite-tooltip>
|
|
1592
|
-
`;
|
|
1593
|
-
}
|
|
1594
|
-
else if (index === this.maxOptionsVisible) {
|
|
1595
|
-
return html `
|
|
1596
|
-
<span class="select__tags-count"
|
|
1597
|
-
>+${this.selectedOptions.length - index} More
|
|
1598
|
-
</span>
|
|
1599
|
-
`;
|
|
1600
|
-
}
|
|
1601
|
-
else {
|
|
1602
|
-
return null;
|
|
1603
|
-
}
|
|
1604
|
-
})}
|
|
1605
|
-
</div>
|
|
1606
|
-
`
|
|
1759
|
+
: this.renderLegacyTags()
|
|
1607
1760
|
: ''}
|
|
1608
1761
|
|
|
1609
1762
|
<input
|
|
@@ -1715,7 +1868,13 @@ let NileSelect = class NileSelect extends NileElement {
|
|
|
1715
1868
|
</div>
|
|
1716
1869
|
|
|
1717
1870
|
${this.hasSlotController.test('pre-footer') || this.multiple
|
|
1718
|
-
? html `<div
|
|
1871
|
+
? html `<div
|
|
1872
|
+
part="footer-area"
|
|
1873
|
+
class=${classMap({
|
|
1874
|
+
'select__pre-footer-area': true,
|
|
1875
|
+
'select__pre-footer-area--query': !this.noWidthSync || this.portal,
|
|
1876
|
+
})}
|
|
1877
|
+
>
|
|
1719
1878
|
${this.hasSlotController.test('pre-footer')
|
|
1720
1879
|
? html `
|
|
1721
1880
|
<div part="pre-footer" @click=${this.handlePreFooterClick}>
|
|
@@ -1827,6 +1986,9 @@ __decorate([
|
|
|
1827
1986
|
__decorate([
|
|
1828
1987
|
state()
|
|
1829
1988
|
], NileSelect.prototype, "hiddenChipCount", void 0);
|
|
1989
|
+
__decorate([
|
|
1990
|
+
state()
|
|
1991
|
+
], NileSelect.prototype, "oldMaxOptionsVisible", void 0);
|
|
1830
1992
|
__decorate([
|
|
1831
1993
|
property()
|
|
1832
1994
|
], NileSelect.prototype, "name", void 0);
|
|
@@ -1922,10 +2084,10 @@ __decorate([
|
|
|
1922
2084
|
property({ attribute: 'max-options-visible', type: Number })
|
|
1923
2085
|
], NileSelect.prototype, "maxOptionsVisible", null);
|
|
1924
2086
|
__decorate([
|
|
1925
|
-
property({ type: Number,
|
|
2087
|
+
property({ type: Number, attribute: true })
|
|
1926
2088
|
], NileSelect.prototype, "chipMinWidth", void 0);
|
|
1927
2089
|
__decorate([
|
|
1928
|
-
property({ type: Number,
|
|
2090
|
+
property({ type: Number, attribute: true })
|
|
1929
2091
|
], NileSelect.prototype, "chipMaxWidth", void 0);
|
|
1930
2092
|
__decorate([
|
|
1931
2093
|
property({ type: Boolean, attribute: true, reflect: true })
|