@ni/fast-foundation 0.0.2
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 +58 -0
- package/dist/dts/accordion/accordion.d.ts +65 -0
- package/dist/dts/accordion/accordion.template.d.ts +8 -0
- package/dist/dts/accordion/index.d.ts +2 -0
- package/dist/dts/accordion-item/accordion-item.d.ts +76 -0
- package/dist/dts/accordion-item/accordion-item.template.d.ts +8 -0
- package/dist/dts/accordion-item/index.d.ts +2 -0
- package/dist/dts/anchor/anchor.d.ts +128 -0
- package/dist/dts/anchor/anchor.template.d.ts +8 -0
- package/dist/dts/anchor/index.d.ts +2 -0
- package/dist/dts/anchored-region/anchored-region-config.d.ts +117 -0
- package/dist/dts/anchored-region/anchored-region.d.ts +389 -0
- package/dist/dts/anchored-region/anchored-region.template.d.ts +8 -0
- package/dist/dts/anchored-region/index.d.ts +3 -0
- package/dist/dts/avatar/avatar.d.ts +62 -0
- package/dist/dts/avatar/avatar.template.d.ts +8 -0
- package/dist/dts/avatar/index.d.ts +2 -0
- package/dist/dts/badge/badge.d.ts +36 -0
- package/dist/dts/badge/badge.template.d.ts +8 -0
- package/dist/dts/badge/index.d.ts +2 -0
- package/dist/dts/breadcrumb/breadcrumb.d.ts +27 -0
- package/dist/dts/breadcrumb/breadcrumb.template.d.ts +8 -0
- package/dist/dts/breadcrumb/index.d.ts +2 -0
- package/dist/dts/breadcrumb-item/breadcrumb-item.d.ts +36 -0
- package/dist/dts/breadcrumb-item/breadcrumb-item.template.d.ts +8 -0
- package/dist/dts/breadcrumb-item/index.d.ts +2 -0
- package/dist/dts/button/button.d.ts +167 -0
- package/dist/dts/button/button.form-associated.d.ts +16 -0
- package/dist/dts/button/button.template.d.ts +8 -0
- package/dist/dts/button/index.d.ts +2 -0
- package/dist/dts/calendar/calendar.d.ts +178 -0
- package/dist/dts/calendar/calendar.template.d.ts +58 -0
- package/dist/dts/calendar/date-formatter.d.ts +124 -0
- package/dist/dts/calendar/index.d.ts +3 -0
- package/dist/dts/card/card.d.ts +10 -0
- package/dist/dts/card/card.template.d.ts +8 -0
- package/dist/dts/card/index.d.ts +2 -0
- package/dist/dts/checkbox/checkbox.d.ts +58 -0
- package/dist/dts/checkbox/checkbox.form-associated.d.ts +16 -0
- package/dist/dts/checkbox/checkbox.template.d.ts +8 -0
- package/dist/dts/checkbox/index.d.ts +2 -0
- package/dist/dts/combobox/combobox.d.ts +341 -0
- package/dist/dts/combobox/combobox.form-associated.d.ts +16 -0
- package/dist/dts/combobox/combobox.options.d.ts +15 -0
- package/dist/dts/combobox/combobox.template.d.ts +8 -0
- package/dist/dts/combobox/index.d.ts +3 -0
- package/dist/dts/data-grid/data-grid-cell.d.ts +62 -0
- package/dist/dts/data-grid/data-grid-cell.template.d.ts +9 -0
- package/dist/dts/data-grid/data-grid-row.d.ts +119 -0
- package/dist/dts/data-grid/data-grid-row.template.d.ts +10 -0
- package/dist/dts/data-grid/data-grid.d.ts +218 -0
- package/dist/dts/data-grid/data-grid.options.d.ts +49 -0
- package/dist/dts/data-grid/data-grid.template.d.ts +10 -0
- package/dist/dts/data-grid/index.d.ts +6 -0
- package/dist/dts/design-system/component-presentation.d.ts +66 -0
- package/dist/dts/design-system/design-system.d.ts +104 -0
- package/dist/dts/design-system/index.d.ts +3 -0
- package/dist/dts/design-system/registration-context.d.ts +106 -0
- package/dist/dts/design-token/custom-property-manager.d.ts +35 -0
- package/dist/dts/design-token/design-token.d.ts +139 -0
- package/dist/dts/design-token/interfaces.d.ts +31 -0
- package/dist/dts/di/di.d.ts +858 -0
- package/dist/dts/di/index.d.ts +1 -0
- package/dist/dts/dialog/dialog.d.ts +153 -0
- package/dist/dts/dialog/dialog.template.d.ts +8 -0
- package/dist/dts/dialog/index.d.ts +2 -0
- package/dist/dts/directives/reflect-attributes.d.ts +18 -0
- package/dist/dts/disclosure/disclosure.d.ts +59 -0
- package/dist/dts/disclosure/disclosure.template.d.ts +8 -0
- package/dist/dts/disclosure/index.d.ts +2 -0
- package/dist/dts/divider/divider.d.ts +28 -0
- package/dist/dts/divider/divider.options.d.ts +19 -0
- package/dist/dts/divider/divider.template.d.ts +8 -0
- package/dist/dts/divider/index.d.ts +2 -0
- package/dist/dts/flipper/flipper.d.ts +57 -0
- package/dist/dts/flipper/flipper.options.d.ts +13 -0
- package/dist/dts/flipper/flipper.template.d.ts +8 -0
- package/dist/dts/flipper/index.d.ts +2 -0
- package/dist/dts/form-associated/form-associated.d.ts +177 -0
- package/dist/dts/form-associated/index.d.ts +1 -0
- package/dist/dts/foundation-element/foundation-element.d.ts +120 -0
- package/dist/dts/foundation-element/index.d.ts +1 -0
- package/dist/dts/horizontal-scroll/horizontal-scroll.d.ts +242 -0
- package/dist/dts/horizontal-scroll/horizontal-scroll.template.d.ts +7 -0
- package/dist/dts/horizontal-scroll/index.d.ts +2 -0
- package/dist/dts/index-rollup.d.ts +2 -0
- package/dist/dts/index.d.ts +53 -0
- package/dist/dts/interfaces.d.ts +4 -0
- package/dist/dts/listbox/index.d.ts +3 -0
- package/dist/dts/listbox/listbox.d.ts +314 -0
- package/dist/dts/listbox/listbox.element.d.ts +223 -0
- package/dist/dts/listbox/listbox.template.d.ts +8 -0
- package/dist/dts/listbox-option/index.d.ts +2 -0
- package/dist/dts/listbox-option/listbox-option.d.ts +176 -0
- package/dist/dts/listbox-option/listbox-option.template.d.ts +8 -0
- package/dist/dts/menu/index.d.ts +2 -0
- package/dist/dts/menu/menu.d.ts +78 -0
- package/dist/dts/menu/menu.template.d.ts +8 -0
- package/dist/dts/menu-item/index.d.ts +2 -0
- package/dist/dts/menu-item/menu-item.d.ts +160 -0
- package/dist/dts/menu-item/menu-item.options.d.ts +29 -0
- package/dist/dts/menu-item/menu-item.template.d.ts +10 -0
- package/dist/dts/number-field/index.d.ts +2 -0
- package/dist/dts/number-field/number-field.d.ts +227 -0
- package/dist/dts/number-field/number-field.form-associated.d.ts +16 -0
- package/dist/dts/number-field/number-field.template.d.ts +8 -0
- package/dist/dts/patterns/aria-global.d.ts +189 -0
- package/dist/dts/patterns/index.d.ts +2 -0
- package/dist/dts/patterns/start-end.d.ts +65 -0
- package/dist/dts/picker/index.d.ts +10 -0
- package/dist/dts/picker/picker-list-item.d.ts +38 -0
- package/dist/dts/picker/picker-list-item.template.d.ts +8 -0
- package/dist/dts/picker/picker-list.d.ts +8 -0
- package/dist/dts/picker/picker-list.template.d.ts +8 -0
- package/dist/dts/picker/picker-menu-option.d.ts +37 -0
- package/dist/dts/picker/picker-menu-option.template.d.ts +8 -0
- package/dist/dts/picker/picker-menu.d.ts +46 -0
- package/dist/dts/picker/picker-menu.template.d.ts +8 -0
- package/dist/dts/picker/picker.d.ts +390 -0
- package/dist/dts/picker/picker.form-associated.d.ts +16 -0
- package/dist/dts/picker/picker.template.d.ts +8 -0
- package/dist/dts/progress/base-progress.d.ts +71 -0
- package/dist/dts/progress/index.d.ts +2 -0
- package/dist/dts/progress/progress.template.d.ts +8 -0
- package/dist/dts/progress-ring/index.d.ts +1 -0
- package/dist/dts/progress-ring/progress-ring.template.d.ts +8 -0
- package/dist/dts/radio/index.d.ts +2 -0
- package/dist/dts/radio/radio.d.ts +70 -0
- package/dist/dts/radio/radio.form-associated.d.ts +16 -0
- package/dist/dts/radio/radio.template.d.ts +8 -0
- package/dist/dts/radio-group/index.d.ts +2 -0
- package/dist/dts/radio-group/radio-group.d.ts +101 -0
- package/dist/dts/radio-group/radio-group.template.d.ts +8 -0
- package/dist/dts/search/index.d.ts +2 -0
- package/dist/dts/search/search.d.ts +162 -0
- package/dist/dts/search/search.form-associated.d.ts +16 -0
- package/dist/dts/search/search.template.d.ts +8 -0
- package/dist/dts/select/index.d.ts +3 -0
- package/dist/dts/select/select.d.ts +289 -0
- package/dist/dts/select/select.form-associated.d.ts +16 -0
- package/dist/dts/select/select.options.d.ts +13 -0
- package/dist/dts/select/select.template.d.ts +8 -0
- package/dist/dts/skeleton/index.d.ts +2 -0
- package/dist/dts/skeleton/skeleton.d.ts +47 -0
- package/dist/dts/skeleton/skeleton.template.d.ts +8 -0
- package/dist/dts/slider/index.d.ts +2 -0
- package/dist/dts/slider/slider-utilities.d.ts +5 -0
- package/dist/dts/slider/slider.d.ts +230 -0
- package/dist/dts/slider/slider.form-associated.d.ts +16 -0
- package/dist/dts/slider/slider.template.d.ts +8 -0
- package/dist/dts/slider-label/index.d.ts +2 -0
- package/dist/dts/slider-label/slider-label.d.ts +81 -0
- package/dist/dts/slider-label/slider-label.template.d.ts +8 -0
- package/dist/dts/switch/index.d.ts +2 -0
- package/dist/dts/switch/switch.d.ts +60 -0
- package/dist/dts/switch/switch.form-associated.d.ts +16 -0
- package/dist/dts/switch/switch.template.d.ts +8 -0
- package/dist/dts/tab/index.d.ts +2 -0
- package/dist/dts/tab/tab.d.ts +17 -0
- package/dist/dts/tab/tab.template.d.ts +8 -0
- package/dist/dts/tab-panel/index.d.ts +2 -0
- package/dist/dts/tab-panel/tab-panel.d.ts +10 -0
- package/dist/dts/tab-panel/tab-panel.template.d.ts +8 -0
- package/dist/dts/tabs/index.d.ts +2 -0
- package/dist/dts/tabs/tabs.d.ts +140 -0
- package/dist/dts/tabs/tabs.template.d.ts +8 -0
- package/dist/dts/test-utilities/fixture.d.ts +89 -0
- package/dist/dts/test-utilities/timeout.d.ts +4 -0
- package/dist/dts/text-area/index.d.ts +2 -0
- package/dist/dts/text-area/text-area.d.ts +149 -0
- package/dist/dts/text-area/text-area.form-associated.d.ts +16 -0
- package/dist/dts/text-area/text-area.options.d.ts +27 -0
- package/dist/dts/text-area/text-area.template.d.ts +8 -0
- package/dist/dts/text-field/index.d.ts +2 -0
- package/dist/dts/text-field/text-field.d.ts +166 -0
- package/dist/dts/text-field/text-field.form-associated.d.ts +16 -0
- package/dist/dts/text-field/text-field.options.d.ts +31 -0
- package/dist/dts/text-field/text-field.template.d.ts +8 -0
- package/dist/dts/toolbar/index.d.ts +2 -0
- package/dist/dts/toolbar/toolbar.d.ts +167 -0
- package/dist/dts/toolbar/toolbar.template.d.ts +9 -0
- package/dist/dts/tooltip/index.d.ts +2 -0
- package/dist/dts/tooltip/tooltip.d.ts +239 -0
- package/dist/dts/tooltip/tooltip.options.d.ts +69 -0
- package/dist/dts/tooltip/tooltip.template.d.ts +8 -0
- package/dist/dts/tree-item/index.d.ts +2 -0
- package/dist/dts/tree-item/tree-item.d.ts +141 -0
- package/dist/dts/tree-item/tree-item.template.d.ts +8 -0
- package/dist/dts/tree-view/index.d.ts +2 -0
- package/dist/dts/tree-view/tree-view.d.ts +99 -0
- package/dist/dts/tree-view/tree-view.template.d.ts +8 -0
- package/dist/dts/utilities/apply-mixins.d.ts +6 -0
- package/dist/dts/utilities/composed-contains.d.ts +12 -0
- package/dist/dts/utilities/composed-parent.d.ts +10 -0
- package/dist/dts/utilities/direction.d.ts +7 -0
- package/dist/dts/utilities/index.d.ts +8 -0
- package/dist/dts/utilities/intersection-service.d.ts +30 -0
- package/dist/dts/utilities/match-media-stylesheet-behavior.d.ts +124 -0
- package/dist/dts/utilities/property-stylesheet-behavior.d.ts +38 -0
- package/dist/dts/utilities/resize-observer.d.ts +31 -0
- package/dist/dts/utilities/root-active-element.d.ts +1 -0
- package/dist/dts/utilities/style/disabled.d.ts +5 -0
- package/dist/dts/utilities/style/display.d.ts +17 -0
- package/dist/dts/utilities/style/focus.d.ts +8 -0
- package/dist/dts/utilities/style/index.d.ts +3 -0
- package/dist/dts/utilities/whitespace-filter.d.ts +9 -0
- package/dist/esm/accordion/accordion.js +185 -0
- package/dist/esm/accordion/accordion.template.js +11 -0
- package/dist/esm/accordion/index.js +2 -0
- package/dist/esm/accordion-item/accordion-item.js +72 -0
- package/dist/esm/accordion-item/accordion-item.template.js +49 -0
- package/dist/esm/accordion-item/index.js +2 -0
- package/dist/esm/anchor/anchor.js +85 -0
- package/dist/esm/anchor/anchor.template.js +47 -0
- package/dist/esm/anchor/index.js +2 -0
- package/dist/esm/anchored-region/anchored-region-config.js +59 -0
- package/dist/esm/anchored-region/anchored-region.js +964 -0
- package/dist/esm/anchored-region/anchored-region.template.js +12 -0
- package/dist/esm/anchored-region/index.js +3 -0
- package/dist/esm/avatar/avatar.js +39 -0
- package/dist/esm/avatar/avatar.template.js +23 -0
- package/dist/esm/avatar/index.js +2 -0
- package/dist/esm/badge/badge.js +40 -0
- package/dist/esm/badge/badge.template.js +12 -0
- package/dist/esm/badge/index.js +2 -0
- package/dist/esm/breadcrumb/breadcrumb.js +70 -0
- package/dist/esm/breadcrumb/breadcrumb.template.js +14 -0
- package/dist/esm/breadcrumb/index.js +2 -0
- package/dist/esm/breadcrumb-item/breadcrumb-item.js +23 -0
- package/dist/esm/breadcrumb-item/breadcrumb-item.template.js +24 -0
- package/dist/esm/breadcrumb-item/index.js +2 -0
- package/dist/esm/button/button.form-associated.js +15 -0
- package/dist/esm/button/button.js +183 -0
- package/dist/esm/button/button.template.js +51 -0
- package/dist/esm/button/index.js +2 -0
- package/dist/esm/calendar/calendar.js +280 -0
- package/dist/esm/calendar/calendar.template.js +191 -0
- package/dist/esm/calendar/date-formatter.js +144 -0
- package/dist/esm/calendar/index.js +3 -0
- package/dist/esm/card/card.js +10 -0
- package/dist/esm/card/card.template.js +8 -0
- package/dist/esm/card/index.js +2 -0
- package/dist/esm/checkbox/checkbox.form-associated.js +15 -0
- package/dist/esm/checkbox/checkbox.js +75 -0
- package/dist/esm/checkbox/checkbox.template.js +35 -0
- package/dist/esm/checkbox/index.js +2 -0
- package/dist/esm/combobox/combobox.form-associated.js +15 -0
- package/dist/esm/combobox/combobox.js +587 -0
- package/dist/esm/combobox/combobox.options.js +10 -0
- package/dist/esm/combobox/combobox.template.js +66 -0
- package/dist/esm/combobox/index.js +3 -0
- package/dist/esm/data-grid/data-grid-cell.js +229 -0
- package/dist/esm/data-grid/data-grid-cell.template.js +23 -0
- package/dist/esm/data-grid/data-grid-row.js +203 -0
- package/dist/esm/data-grid/data-grid-row.template.js +47 -0
- package/dist/esm/data-grid/data-grid.js +440 -0
- package/dist/esm/data-grid/data-grid.options.js +31 -0
- package/dist/esm/data-grid/data-grid.template.js +36 -0
- package/dist/esm/data-grid/index.js +6 -0
- package/dist/esm/design-system/component-presentation.js +86 -0
- package/dist/esm/design-system/design-system.js +207 -0
- package/dist/esm/design-system/index.js +3 -0
- package/dist/esm/design-system/registration-context.js +1 -0
- package/dist/esm/design-token/custom-property-manager.js +216 -0
- package/dist/esm/design-token/design-token.js +657 -0
- package/dist/esm/design-token/interfaces.js +1 -0
- package/dist/esm/di/di.js +1341 -0
- package/dist/esm/di/index.js +1 -0
- package/dist/esm/dialog/dialog.js +280 -0
- package/dist/esm/dialog/dialog.template.js +30 -0
- package/dist/esm/dialog/index.js +2 -0
- package/dist/esm/directives/reflect-attributes.js +88 -0
- package/dist/esm/disclosure/disclosure.js +72 -0
- package/dist/esm/disclosure/disclosure.template.js +20 -0
- package/dist/esm/disclosure/index.js +2 -0
- package/dist/esm/divider/divider.js +39 -0
- package/dist/esm/divider/divider.options.js +14 -0
- package/dist/esm/divider/divider.template.js +8 -0
- package/dist/esm/divider/index.js +2 -0
- package/dist/esm/flipper/flipper.js +65 -0
- package/dist/esm/flipper/flipper.options.js +8 -0
- package/dist/esm/flipper/flipper.template.js +30 -0
- package/dist/esm/flipper/index.js +2 -0
- package/dist/esm/form-associated/form-associated.js +464 -0
- package/dist/esm/form-associated/index.js +1 -0
- package/dist/esm/foundation-element/foundation-element.js +132 -0
- package/dist/esm/foundation-element/index.js +1 -0
- package/dist/esm/horizontal-scroll/horizontal-scroll.js +380 -0
- package/dist/esm/horizontal-scroll/horizontal-scroll.template.js +62 -0
- package/dist/esm/horizontal-scroll/index.js +2 -0
- package/dist/esm/index-rollup.js +2 -0
- package/dist/esm/index.js +54 -0
- package/dist/esm/interfaces.js +1 -0
- package/dist/esm/listbox/index.js +3 -0
- package/dist/esm/listbox/listbox.element.js +448 -0
- package/dist/esm/listbox/listbox.js +528 -0
- package/dist/esm/listbox/listbox.template.js +27 -0
- package/dist/esm/listbox-option/index.js +2 -0
- package/dist/esm/listbox-option/listbox-option.js +200 -0
- package/dist/esm/listbox-option/listbox-option.template.js +25 -0
- package/dist/esm/menu/index.js +2 -0
- package/dist/esm/menu/menu.js +290 -0
- package/dist/esm/menu/menu.template.js +15 -0
- package/dist/esm/menu-item/index.js +2 -0
- package/dist/esm/menu-item/menu-item.js +251 -0
- package/dist/esm/menu-item/menu-item.options.js +26 -0
- package/dist/esm/menu-item/menu-item.template.js +78 -0
- package/dist/esm/number-field/index.js +2 -0
- package/dist/esm/number-field/number-field.form-associated.js +15 -0
- package/dist/esm/number-field/number-field.js +288 -0
- package/dist/esm/number-field/number-field.template.js +84 -0
- package/dist/esm/patterns/aria-global.js +70 -0
- package/dist/esm/patterns/index.js +2 -0
- package/dist/esm/patterns/start-end.js +84 -0
- package/dist/esm/picker/index.js +10 -0
- package/dist/esm/picker/picker-list-item.js +71 -0
- package/dist/esm/picker/picker-list-item.template.js +17 -0
- package/dist/esm/picker/picker-list.js +8 -0
- package/dist/esm/picker/picker-list.template.js +13 -0
- package/dist/esm/picker/picker-menu-option.js +61 -0
- package/dist/esm/picker/picker-menu-option.template.js +16 -0
- package/dist/esm/picker/picker-menu.js +59 -0
- package/dist/esm/picker/picker-menu.template.js +29 -0
- package/dist/esm/picker/picker.form-associated.js +15 -0
- package/dist/esm/picker/picker.js +759 -0
- package/dist/esm/picker/picker.template.js +97 -0
- package/dist/esm/progress/base-progress.js +69 -0
- package/dist/esm/progress/index.js +2 -0
- package/dist/esm/progress/progress.template.js +31 -0
- package/dist/esm/progress-ring/index.js +1 -0
- package/dist/esm/progress-ring/progress-ring.template.js +45 -0
- package/dist/esm/radio/index.js +2 -0
- package/dist/esm/radio/radio.form-associated.js +15 -0
- package/dist/esm/radio/radio.js +108 -0
- package/dist/esm/radio/radio.template.js +31 -0
- package/dist/esm/radio-group/index.js +2 -0
- package/dist/esm/radio-group/radio-group.js +390 -0
- package/dist/esm/radio-group/radio-group.template.js +29 -0
- package/dist/esm/search/index.js +2 -0
- package/dist/esm/search/search.form-associated.js +15 -0
- package/dist/esm/search/search.js +157 -0
- package/dist/esm/search/search.template.js +93 -0
- package/dist/esm/select/index.js +3 -0
- package/dist/esm/select/select.form-associated.js +15 -0
- package/dist/esm/select/select.js +490 -0
- package/dist/esm/select/select.options.js +8 -0
- package/dist/esm/select/select.template.js +72 -0
- package/dist/esm/skeleton/index.js +2 -0
- package/dist/esm/skeleton/skeleton.js +35 -0
- package/dist/esm/skeleton/skeleton.template.js +20 -0
- package/dist/esm/slider/index.js +2 -0
- package/dist/esm/slider/slider-utilities.js +11 -0
- package/dist/esm/slider/slider.form-associated.js +15 -0
- package/dist/esm/slider/slider.js +452 -0
- package/dist/esm/slider/slider.template.js +40 -0
- package/dist/esm/slider-label/index.js +2 -0
- package/dist/esm/slider-label/slider-label.js +158 -0
- package/dist/esm/slider-label/slider-label.template.js +24 -0
- package/dist/esm/switch/index.js +2 -0
- package/dist/esm/switch/switch.form-associated.js +15 -0
- package/dist/esm/switch/switch.js +79 -0
- package/dist/esm/switch/switch.template.js +37 -0
- package/dist/esm/tab/index.js +2 -0
- package/dist/esm/tab/tab.js +15 -0
- package/dist/esm/tab/tab.template.js +10 -0
- package/dist/esm/tab-panel/index.js +2 -0
- package/dist/esm/tab-panel/tab-panel.js +10 -0
- package/dist/esm/tab-panel/tab-panel.template.js +10 -0
- package/dist/esm/tabs/index.js +2 -0
- package/dist/esm/tabs/tabs.js +375 -0
- package/dist/esm/tabs/tabs.template.js +26 -0
- package/dist/esm/test-utilities/fixture.js +90 -0
- package/dist/esm/test-utilities/timeout.js +13 -0
- package/dist/esm/text-area/index.js +2 -0
- package/dist/esm/text-area/text-area.form-associated.js +15 -0
- package/dist/esm/text-area/text-area.js +146 -0
- package/dist/esm/text-area/text-area.options.js +22 -0
- package/dist/esm/text-area/text-area.template.js +64 -0
- package/dist/esm/text-field/index.js +2 -0
- package/dist/esm/text-field/text-field.form-associated.js +15 -0
- package/dist/esm/text-field/text-field.js +183 -0
- package/dist/esm/text-field/text-field.options.js +26 -0
- package/dist/esm/text-field/text-field.template.js +70 -0
- package/dist/esm/toolbar/index.js +2 -0
- package/dist/esm/toolbar/toolbar.js +271 -0
- package/dist/esm/toolbar/toolbar.template.js +37 -0
- package/dist/esm/tooltip/index.js +2 -0
- package/dist/esm/tooltip/tooltip.js +512 -0
- package/dist/esm/tooltip/tooltip.options.js +63 -0
- package/dist/esm/tooltip/tooltip.template.js +32 -0
- package/dist/esm/tree-item/index.js +2 -0
- package/dist/esm/tree-item/tree-item.js +150 -0
- package/dist/esm/tree-item/tree-item.template.js +52 -0
- package/dist/esm/tree-view/index.js +2 -0
- package/dist/esm/tree-view/tree-view.js +268 -0
- package/dist/esm/tree-view/tree-view.template.js +18 -0
- package/dist/esm/utilities/apply-mixins.js +20 -0
- package/dist/esm/utilities/composed-contains.js +22 -0
- package/dist/esm/utilities/composed-parent.js +23 -0
- package/dist/esm/utilities/direction.js +10 -0
- package/dist/esm/utilities/index.js +8 -0
- package/dist/esm/utilities/intersection-service.js +91 -0
- package/dist/esm/utilities/match-media-stylesheet-behavior.js +140 -0
- package/dist/esm/utilities/property-stylesheet-behavior.js +52 -0
- package/dist/esm/utilities/resize-observer.js +5 -0
- package/dist/esm/utilities/root-active-element.js +8 -0
- package/dist/esm/utilities/style/disabled.js +5 -0
- package/dist/esm/utilities/style/display.js +14 -0
- package/dist/esm/utilities/style/focus.js +9 -0
- package/dist/esm/utilities/style/index.js +3 -0
- package/dist/esm/utilities/whitespace-filter.js +13 -0
- package/dist/fast-foundation.d.ts +9744 -0
- package/dist/fast-foundation.js +19097 -0
- package/dist/fast-foundation.min.js +19 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/package.json +101 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ListboxElement } from "../listbox/listbox.element.js";
|
|
2
|
+
import { FormAssociated } from "../form-associated/form-associated.js";
|
|
3
|
+
class _Select extends ListboxElement {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A form-associated base class for the {@link @ni/fast-foundation#(Select:class)} component.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export class FormAssociatedSelect extends FormAssociated(_Select) {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.proxy = document.createElement("select");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, DOM, Observable, observable, volatile } from "@ni/fast-element";
|
|
3
|
+
import { keyArrowDown, keyArrowUp, keyEnd, keyEnter, keyEscape, keyHome, keySpace, keyTab, uniqueId, } from "@ni/fast-web-utilities";
|
|
4
|
+
import { DelegatesARIAListbox, Listbox } from "../listbox/listbox.js";
|
|
5
|
+
import { StartEnd } from "../patterns/start-end.js";
|
|
6
|
+
import { applyMixins } from "../utilities/apply-mixins.js";
|
|
7
|
+
import { FormAssociatedSelect } from "./select.form-associated.js";
|
|
8
|
+
import { SelectPosition } from "./select.options.js";
|
|
9
|
+
/**
|
|
10
|
+
* A Select Custom HTML Element.
|
|
11
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#select | ARIA select }.
|
|
12
|
+
*
|
|
13
|
+
* @slot start - Content which can be provided before the button content
|
|
14
|
+
* @slot end - Content which can be provided after the button content
|
|
15
|
+
* @slot button-container - The element representing the select button
|
|
16
|
+
* @slot selected-value - The selected value
|
|
17
|
+
* @slot indicator - The visual indicator for the expand/collapse state of the button
|
|
18
|
+
* @slot - The default slot for slotted options
|
|
19
|
+
* @csspart control - The element representing the select invoking element
|
|
20
|
+
* @csspart selected-value - The element wrapping the selected value
|
|
21
|
+
* @csspart indicator - The element wrapping the visual indicator
|
|
22
|
+
* @csspart listbox - The listbox element
|
|
23
|
+
* @fires input - Fires a custom 'input' event when the value updates
|
|
24
|
+
* @fires change - Fires a custom 'change' event when the value updates
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export class Select extends FormAssociatedSelect {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
/**
|
|
32
|
+
* The open attribute.
|
|
33
|
+
*
|
|
34
|
+
* @public
|
|
35
|
+
* @remarks
|
|
36
|
+
* HTML Attribute: open
|
|
37
|
+
*/
|
|
38
|
+
this.open = false;
|
|
39
|
+
/**
|
|
40
|
+
* Indicates the initial state of the position attribute.
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
this.forcedPosition = false;
|
|
45
|
+
/**
|
|
46
|
+
* The unique id for the internal listbox element.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
this.listboxId = uniqueId("listbox-");
|
|
51
|
+
/**
|
|
52
|
+
* The max height for the listbox when opened.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
this.maxHeight = 0;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Sets focus and synchronizes ARIA attributes when the open property changes.
|
|
60
|
+
*
|
|
61
|
+
* @param prev - the previous open value
|
|
62
|
+
* @param next - the current open value
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
openChanged(prev, next) {
|
|
67
|
+
if (!this.collapsible) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (this.open) {
|
|
71
|
+
this.ariaControls = this.listboxId;
|
|
72
|
+
this.ariaExpanded = "true";
|
|
73
|
+
this.setPositioning();
|
|
74
|
+
this.focusAndScrollOptionIntoView();
|
|
75
|
+
this.indexWhenOpened = this.selectedIndex;
|
|
76
|
+
// focus is directed to the element when `open` is changed programmatically
|
|
77
|
+
DOM.queueUpdate(() => this.focus());
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this.ariaControls = "";
|
|
81
|
+
this.ariaExpanded = "false";
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The component is collapsible when in single-selection mode with no size attribute.
|
|
85
|
+
*
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
get collapsible() {
|
|
89
|
+
return !(this.multiple || typeof this.size === "number");
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The value property.
|
|
93
|
+
*
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
get value() {
|
|
97
|
+
Observable.track(this, "value");
|
|
98
|
+
return this._value;
|
|
99
|
+
}
|
|
100
|
+
set value(next) {
|
|
101
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
102
|
+
const prev = `${this._value}`;
|
|
103
|
+
if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) {
|
|
104
|
+
const selectedIndex = this._options.findIndex(el => el.value === next);
|
|
105
|
+
const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null;
|
|
106
|
+
const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null;
|
|
107
|
+
if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) {
|
|
108
|
+
next = "";
|
|
109
|
+
this.selectedIndex = selectedIndex;
|
|
110
|
+
}
|
|
111
|
+
next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next;
|
|
112
|
+
}
|
|
113
|
+
if (prev !== next) {
|
|
114
|
+
this._value = next;
|
|
115
|
+
super.valueChanged(prev, next);
|
|
116
|
+
Observable.notify(this, "value");
|
|
117
|
+
this.updateDisplayValue();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Sets the value and display value to match the first selected option.
|
|
122
|
+
*
|
|
123
|
+
* @param shouldEmit - if true, the input and change events will be emitted
|
|
124
|
+
*
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
updateValue(shouldEmit) {
|
|
128
|
+
var _a, _b;
|
|
129
|
+
if (this.$fastController.isConnected) {
|
|
130
|
+
this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
|
|
131
|
+
}
|
|
132
|
+
if (shouldEmit) {
|
|
133
|
+
this.$emit("input");
|
|
134
|
+
this.$emit("change", this, {
|
|
135
|
+
bubbles: true,
|
|
136
|
+
composed: undefined,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Updates the proxy value when the selected index changes.
|
|
142
|
+
*
|
|
143
|
+
* @param prev - the previous selected index
|
|
144
|
+
* @param next - the next selected index
|
|
145
|
+
*
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
selectedIndexChanged(prev, next) {
|
|
149
|
+
super.selectedIndexChanged(prev, next);
|
|
150
|
+
this.updateValue();
|
|
151
|
+
}
|
|
152
|
+
positionChanged(prev, next) {
|
|
153
|
+
this.positionAttribute = next;
|
|
154
|
+
this.setPositioning();
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Calculate and apply listbox positioning based on available viewport space.
|
|
158
|
+
*
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
setPositioning() {
|
|
162
|
+
const currentBox = this.getBoundingClientRect();
|
|
163
|
+
const viewportHeight = window.innerHeight;
|
|
164
|
+
const availableBottom = viewportHeight - currentBox.bottom;
|
|
165
|
+
this.position = this.forcedPosition
|
|
166
|
+
? this.positionAttribute
|
|
167
|
+
: currentBox.top > availableBottom
|
|
168
|
+
? SelectPosition.above
|
|
169
|
+
: SelectPosition.below;
|
|
170
|
+
this.positionAttribute = this.forcedPosition
|
|
171
|
+
? this.positionAttribute
|
|
172
|
+
: this.position;
|
|
173
|
+
this.maxHeight =
|
|
174
|
+
this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The value displayed on the button.
|
|
178
|
+
*
|
|
179
|
+
* @public
|
|
180
|
+
*/
|
|
181
|
+
get displayValue() {
|
|
182
|
+
var _a, _b;
|
|
183
|
+
Observable.track(this, "displayValue");
|
|
184
|
+
return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Synchronize the `aria-disabled` property when the `disabled` property changes.
|
|
188
|
+
*
|
|
189
|
+
* @param prev - The previous disabled value
|
|
190
|
+
* @param next - The next disabled value
|
|
191
|
+
*
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
disabledChanged(prev, next) {
|
|
195
|
+
if (super.disabledChanged) {
|
|
196
|
+
super.disabledChanged(prev, next);
|
|
197
|
+
}
|
|
198
|
+
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Reset the element to its first selectable option when its parent form is reset.
|
|
202
|
+
*
|
|
203
|
+
* @internal
|
|
204
|
+
*/
|
|
205
|
+
formResetCallback() {
|
|
206
|
+
this.setProxyOptions();
|
|
207
|
+
// Call the base class's implementation setDefaultSelectedOption instead of the select's
|
|
208
|
+
// override, in order to reset the selectedIndex without using the value property.
|
|
209
|
+
super.setDefaultSelectedOption();
|
|
210
|
+
if (this.selectedIndex === -1) {
|
|
211
|
+
this.selectedIndex = 0;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Handle opening and closing the listbox when the select is clicked.
|
|
216
|
+
*
|
|
217
|
+
* @param e - the mouse event
|
|
218
|
+
* @internal
|
|
219
|
+
*/
|
|
220
|
+
clickHandler(e) {
|
|
221
|
+
// do nothing if the select is disabled
|
|
222
|
+
if (this.disabled) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (this.open) {
|
|
226
|
+
const captured = e.target.closest(`option,[role=option]`);
|
|
227
|
+
if (captured && captured.disabled) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
super.clickHandler(e);
|
|
232
|
+
this.open = this.collapsible && !this.open;
|
|
233
|
+
if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
|
|
234
|
+
this.updateValue(true);
|
|
235
|
+
}
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Handles focus state when the element or its children lose focus.
|
|
240
|
+
*
|
|
241
|
+
* @param e - The focus event
|
|
242
|
+
* @internal
|
|
243
|
+
*/
|
|
244
|
+
focusoutHandler(e) {
|
|
245
|
+
var _a;
|
|
246
|
+
super.focusoutHandler(e);
|
|
247
|
+
if (!this.open) {
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
const focusTarget = e.relatedTarget;
|
|
251
|
+
if (this.isSameNode(focusTarget)) {
|
|
252
|
+
this.focus();
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) {
|
|
256
|
+
this.open = false;
|
|
257
|
+
if (this.indexWhenOpened !== this.selectedIndex) {
|
|
258
|
+
this.updateValue(true);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Updates the value when an option's value changes.
|
|
264
|
+
*
|
|
265
|
+
* @param source - the source object
|
|
266
|
+
* @param propertyName - the property to evaluate
|
|
267
|
+
*
|
|
268
|
+
* @internal
|
|
269
|
+
* @override
|
|
270
|
+
*/
|
|
271
|
+
handleChange(source, propertyName) {
|
|
272
|
+
super.handleChange(source, propertyName);
|
|
273
|
+
if (propertyName === "value") {
|
|
274
|
+
this.updateValue();
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Synchronize the form-associated proxy and updates the value property of the element.
|
|
279
|
+
*
|
|
280
|
+
* @param prev - the previous collection of slotted option elements
|
|
281
|
+
* @param next - the next collection of slotted option elements
|
|
282
|
+
*
|
|
283
|
+
* @internal
|
|
284
|
+
*/
|
|
285
|
+
slottedOptionsChanged(prev, next) {
|
|
286
|
+
this.options.forEach(o => {
|
|
287
|
+
const notifier = Observable.getNotifier(o);
|
|
288
|
+
notifier.unsubscribe(this, "value");
|
|
289
|
+
});
|
|
290
|
+
super.slottedOptionsChanged(prev, next);
|
|
291
|
+
this.options.forEach(o => {
|
|
292
|
+
const notifier = Observable.getNotifier(o);
|
|
293
|
+
notifier.subscribe(this, "value");
|
|
294
|
+
});
|
|
295
|
+
this.setProxyOptions();
|
|
296
|
+
this.updateValue();
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Prevents focus when size is set and a scrollbar is clicked.
|
|
300
|
+
*
|
|
301
|
+
* @param e - the mouse event object
|
|
302
|
+
*
|
|
303
|
+
* @override
|
|
304
|
+
* @internal
|
|
305
|
+
*/
|
|
306
|
+
mousedownHandler(e) {
|
|
307
|
+
var _a;
|
|
308
|
+
if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) {
|
|
309
|
+
return super.mousedownHandler(e);
|
|
310
|
+
}
|
|
311
|
+
return this.collapsible;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Sets the multiple property on the proxy element.
|
|
315
|
+
*
|
|
316
|
+
* @param prev - the previous multiple value
|
|
317
|
+
* @param next - the current multiple value
|
|
318
|
+
*/
|
|
319
|
+
multipleChanged(prev, next) {
|
|
320
|
+
super.multipleChanged(prev, next);
|
|
321
|
+
if (this.proxy) {
|
|
322
|
+
this.proxy.multiple = next;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Updates the selectedness of each option when the list of selected options changes.
|
|
327
|
+
*
|
|
328
|
+
* @param prev - the previous list of selected options
|
|
329
|
+
* @param next - the current list of selected options
|
|
330
|
+
*
|
|
331
|
+
* @override
|
|
332
|
+
* @internal
|
|
333
|
+
*/
|
|
334
|
+
selectedOptionsChanged(prev, next) {
|
|
335
|
+
var _a;
|
|
336
|
+
super.selectedOptionsChanged(prev, next);
|
|
337
|
+
(_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => {
|
|
338
|
+
var _a;
|
|
339
|
+
const proxyOption = (_a = this.proxy) === null || _a === void 0 ? void 0 : _a.options.item(i);
|
|
340
|
+
if (proxyOption) {
|
|
341
|
+
proxyOption.selected = o.selected;
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Sets the selected index to match the first option with the selected attribute, or
|
|
347
|
+
* the first selectable option.
|
|
348
|
+
*
|
|
349
|
+
* @override
|
|
350
|
+
* @internal
|
|
351
|
+
*/
|
|
352
|
+
setDefaultSelectedOption() {
|
|
353
|
+
var _a;
|
|
354
|
+
const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter);
|
|
355
|
+
const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex(el => el.hasAttribute("selected") || el.selected || el.value === this.value);
|
|
356
|
+
if (selectedIndex !== -1) {
|
|
357
|
+
this.selectedIndex = selectedIndex;
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
this.selectedIndex = 0;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Resets and fills the proxy to match the component's options.
|
|
364
|
+
*
|
|
365
|
+
* @internal
|
|
366
|
+
*/
|
|
367
|
+
setProxyOptions() {
|
|
368
|
+
if (this.proxy instanceof HTMLSelectElement && this.options) {
|
|
369
|
+
this.proxy.options.length = 0;
|
|
370
|
+
this.options.forEach(option => {
|
|
371
|
+
const proxyOption = option.proxy ||
|
|
372
|
+
(option instanceof HTMLOptionElement ? option.cloneNode() : null);
|
|
373
|
+
if (proxyOption) {
|
|
374
|
+
this.proxy.options.add(proxyOption);
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Handle keyboard interaction for the select.
|
|
381
|
+
*
|
|
382
|
+
* @param e - the keyboard event
|
|
383
|
+
* @internal
|
|
384
|
+
*/
|
|
385
|
+
keydownHandler(e) {
|
|
386
|
+
super.keydownHandler(e);
|
|
387
|
+
const key = e.key || e.key.charCodeAt(0);
|
|
388
|
+
switch (key) {
|
|
389
|
+
case keySpace: {
|
|
390
|
+
e.preventDefault();
|
|
391
|
+
if (this.collapsible && this.typeAheadExpired) {
|
|
392
|
+
this.open = !this.open;
|
|
393
|
+
}
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
case keyHome:
|
|
397
|
+
case keyEnd: {
|
|
398
|
+
e.preventDefault();
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
case keyEnter: {
|
|
402
|
+
e.preventDefault();
|
|
403
|
+
this.open = !this.open;
|
|
404
|
+
break;
|
|
405
|
+
}
|
|
406
|
+
case keyEscape: {
|
|
407
|
+
if (this.collapsible && this.open) {
|
|
408
|
+
e.preventDefault();
|
|
409
|
+
this.open = false;
|
|
410
|
+
}
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
case keyTab: {
|
|
414
|
+
if (this.collapsible && this.open) {
|
|
415
|
+
e.preventDefault();
|
|
416
|
+
this.open = false;
|
|
417
|
+
}
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
|
|
422
|
+
this.updateValue(true);
|
|
423
|
+
this.indexWhenOpened = this.selectedIndex;
|
|
424
|
+
}
|
|
425
|
+
return !(key === keyArrowDown || key === keyArrowUp);
|
|
426
|
+
}
|
|
427
|
+
connectedCallback() {
|
|
428
|
+
super.connectedCallback();
|
|
429
|
+
this.forcedPosition = !!this.positionAttribute;
|
|
430
|
+
this.addEventListener("contentchange", this.updateDisplayValue);
|
|
431
|
+
}
|
|
432
|
+
disconnectedCallback() {
|
|
433
|
+
this.removeEventListener("contentchange", this.updateDisplayValue);
|
|
434
|
+
super.disconnectedCallback();
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Updates the proxy's size property when the size attribute changes.
|
|
438
|
+
*
|
|
439
|
+
* @param prev - the previous size
|
|
440
|
+
* @param next - the current size
|
|
441
|
+
*
|
|
442
|
+
* @override
|
|
443
|
+
* @internal
|
|
444
|
+
*/
|
|
445
|
+
sizeChanged(prev, next) {
|
|
446
|
+
super.sizeChanged(prev, next);
|
|
447
|
+
if (this.proxy) {
|
|
448
|
+
this.proxy.size = next;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
*
|
|
453
|
+
* @internal
|
|
454
|
+
*/
|
|
455
|
+
updateDisplayValue() {
|
|
456
|
+
if (this.collapsible) {
|
|
457
|
+
Observable.notify(this, "displayValue");
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
__decorate([
|
|
462
|
+
attr({ attribute: "open", mode: "boolean" })
|
|
463
|
+
], Select.prototype, "open", void 0);
|
|
464
|
+
__decorate([
|
|
465
|
+
volatile
|
|
466
|
+
], Select.prototype, "collapsible", null);
|
|
467
|
+
__decorate([
|
|
468
|
+
observable
|
|
469
|
+
], Select.prototype, "control", void 0);
|
|
470
|
+
__decorate([
|
|
471
|
+
attr({ attribute: "position" })
|
|
472
|
+
], Select.prototype, "positionAttribute", void 0);
|
|
473
|
+
__decorate([
|
|
474
|
+
observable
|
|
475
|
+
], Select.prototype, "position", void 0);
|
|
476
|
+
__decorate([
|
|
477
|
+
observable
|
|
478
|
+
], Select.prototype, "maxHeight", void 0);
|
|
479
|
+
/**
|
|
480
|
+
* Includes ARIA states and properties relating to the ARIA select role.
|
|
481
|
+
*
|
|
482
|
+
* @public
|
|
483
|
+
*/
|
|
484
|
+
export class DelegatesARIASelect {
|
|
485
|
+
}
|
|
486
|
+
__decorate([
|
|
487
|
+
observable
|
|
488
|
+
], DelegatesARIASelect.prototype, "ariaControls", void 0);
|
|
489
|
+
applyMixins(DelegatesARIASelect, DelegatesARIAListbox);
|
|
490
|
+
applyMixins(Select, StartEnd, DelegatesARIASelect);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { html, ref, slotted, when } from "@ni/fast-element";
|
|
2
|
+
import { Listbox } from "../listbox/listbox.js";
|
|
3
|
+
import { endSlotTemplate, startSlotTemplate } from "../patterns/start-end.js";
|
|
4
|
+
/**
|
|
5
|
+
* The template for the {@link @ni/fast-foundation#(Select:class)} component.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export const selectTemplate = (context, definition) => html `
|
|
9
|
+
<template
|
|
10
|
+
class="${x => [
|
|
11
|
+
x.collapsible && "collapsible",
|
|
12
|
+
x.collapsible && x.open && "open",
|
|
13
|
+
x.disabled && "disabled",
|
|
14
|
+
x.collapsible && x.position,
|
|
15
|
+
]
|
|
16
|
+
.filter(Boolean)
|
|
17
|
+
.join(" ")}"
|
|
18
|
+
aria-activedescendant="${x => x.ariaActiveDescendant}"
|
|
19
|
+
aria-controls="${x => x.ariaControls}"
|
|
20
|
+
aria-disabled="${x => x.ariaDisabled}"
|
|
21
|
+
aria-expanded="${x => x.ariaExpanded}"
|
|
22
|
+
aria-haspopup="${x => (x.collapsible ? "listbox" : null)}"
|
|
23
|
+
aria-multiselectable="${x => x.ariaMultiSelectable}"
|
|
24
|
+
?open="${x => x.open}"
|
|
25
|
+
role="combobox"
|
|
26
|
+
tabindex="${x => (!x.disabled ? "0" : null)}"
|
|
27
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
28
|
+
@focusin="${(x, c) => x.focusinHandler(c.event)}"
|
|
29
|
+
@focusout="${(x, c) => x.focusoutHandler(c.event)}"
|
|
30
|
+
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
31
|
+
@mousedown="${(x, c) => x.mousedownHandler(c.event)}"
|
|
32
|
+
>
|
|
33
|
+
${when(x => x.collapsible, html `
|
|
34
|
+
<div
|
|
35
|
+
class="control"
|
|
36
|
+
part="control"
|
|
37
|
+
?disabled="${x => x.disabled}"
|
|
38
|
+
${ref("control")}
|
|
39
|
+
>
|
|
40
|
+
${startSlotTemplate(context, definition)}
|
|
41
|
+
<slot name="button-container">
|
|
42
|
+
<div class="selected-value" part="selected-value">
|
|
43
|
+
<slot name="selected-value">${x => x.displayValue}</slot>
|
|
44
|
+
</div>
|
|
45
|
+
<div aria-hidden="true" class="indicator" part="indicator">
|
|
46
|
+
<slot name="indicator">
|
|
47
|
+
${definition.indicator || ""}
|
|
48
|
+
</slot>
|
|
49
|
+
</div>
|
|
50
|
+
</slot>
|
|
51
|
+
${endSlotTemplate(context, definition)}
|
|
52
|
+
</div>
|
|
53
|
+
`)}
|
|
54
|
+
<div
|
|
55
|
+
class="listbox"
|
|
56
|
+
id="${x => x.listboxId}"
|
|
57
|
+
part="listbox"
|
|
58
|
+
role="listbox"
|
|
59
|
+
?disabled="${x => x.disabled}"
|
|
60
|
+
?hidden="${x => (x.collapsible ? !x.open : false)}"
|
|
61
|
+
${ref("listbox")}
|
|
62
|
+
>
|
|
63
|
+
<slot
|
|
64
|
+
${slotted({
|
|
65
|
+
filter: Listbox.slottedOptionFilter,
|
|
66
|
+
flatten: true,
|
|
67
|
+
property: "slottedOptions",
|
|
68
|
+
})}
|
|
69
|
+
></slot>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
72
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from "@ni/fast-element";
|
|
3
|
+
import { FoundationElement } from "../foundation-element/foundation-element.js";
|
|
4
|
+
/**
|
|
5
|
+
* A Skeleton Custom HTML Element.
|
|
6
|
+
*
|
|
7
|
+
* @slot - The default slot
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export class Skeleton extends FoundationElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
/**
|
|
15
|
+
* Indicates what the shape of the Skeleton should be.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
* @remarks
|
|
19
|
+
* HTML Attribute: shape
|
|
20
|
+
*/
|
|
21
|
+
this.shape = "rect";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
__decorate([
|
|
25
|
+
attr
|
|
26
|
+
], Skeleton.prototype, "fill", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
attr
|
|
29
|
+
], Skeleton.prototype, "shape", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
attr
|
|
32
|
+
], Skeleton.prototype, "pattern", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
attr({ mode: "boolean" })
|
|
35
|
+
], Skeleton.prototype, "shimmer", void 0);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { html, when } from "@ni/fast-element";
|
|
2
|
+
/**
|
|
3
|
+
* The template for the fast-skeleton component
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export const skeletonTemplate = (context, definition) => html `
|
|
7
|
+
<template
|
|
8
|
+
class="${x => (x.shape === "circle" ? "circle" : "rect")}"
|
|
9
|
+
pattern="${x => x.pattern}"
|
|
10
|
+
?shimmer="${x => x.shimmer}"
|
|
11
|
+
>
|
|
12
|
+
${when(x => x.shimmer === true, html `
|
|
13
|
+
<span class="shimmer"></span>
|
|
14
|
+
`)}
|
|
15
|
+
<object type="image/svg+xml" data="${x => x.pattern}" role="presentation">
|
|
16
|
+
<img class="pattern" src="${x => x.pattern}" />
|
|
17
|
+
</object>
|
|
18
|
+
<slot></slot>
|
|
19
|
+
</template>
|
|
20
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Direction, limit } from "@ni/fast-web-utilities";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a pixel coordinate on the track to a percent of the track's range
|
|
4
|
+
*/
|
|
5
|
+
export function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
|
|
6
|
+
let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition));
|
|
7
|
+
if (direction === Direction.rtl) {
|
|
8
|
+
pct = 1 - pct;
|
|
9
|
+
}
|
|
10
|
+
return pct;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FormAssociated } from "../form-associated/form-associated.js";
|
|
2
|
+
import { FoundationElement } from "../foundation-element/foundation-element.js";
|
|
3
|
+
class _Slider extends FoundationElement {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A form-associated base class for the {@link @ni/fast-foundation#(Slider:class)} component.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export class FormAssociatedSlider extends FormAssociated(_Slider) {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.proxy = document.createElement("input");
|
|
14
|
+
}
|
|
15
|
+
}
|