@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,512 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, DOM, observable } from "@ni/fast-element";
|
|
3
|
+
import { Direction, keyEscape } from "@ni/fast-web-utilities";
|
|
4
|
+
import { getDirection } from "../utilities/direction.js";
|
|
5
|
+
import { FoundationElement } from "../foundation-element/foundation-element.js";
|
|
6
|
+
import { TooltipPosition } from "./tooltip.options.js";
|
|
7
|
+
export { TooltipPosition };
|
|
8
|
+
/**
|
|
9
|
+
* An Tooltip Custom HTML Element.
|
|
10
|
+
*
|
|
11
|
+
* @slot - The default slot for the tooltip content
|
|
12
|
+
* @csspart tooltip - The tooltip element
|
|
13
|
+
* @fires dismiss - Fires a custom 'dismiss' event when the tooltip is visible and escape key is pressed
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export class Tooltip extends FoundationElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
/**
|
|
21
|
+
* The id of the element the tooltip is anchored to
|
|
22
|
+
*
|
|
23
|
+
* @defaultValue - undefined
|
|
24
|
+
* @public
|
|
25
|
+
* HTML Attribute: anchor
|
|
26
|
+
*/
|
|
27
|
+
this.anchor = "";
|
|
28
|
+
/**
|
|
29
|
+
* The delay in milliseconds before a tooltip is shown after a hover event
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue - 300
|
|
32
|
+
* @public
|
|
33
|
+
* HTML Attribute: delay
|
|
34
|
+
*/
|
|
35
|
+
this.delay = 300;
|
|
36
|
+
/**
|
|
37
|
+
* Controls when the tooltip updates its position, default is 'anchor' which only updates when
|
|
38
|
+
* the anchor is resized. 'auto' will update on scroll/resize events.
|
|
39
|
+
* Corresponds to anchored-region auto-update-mode.
|
|
40
|
+
* @public
|
|
41
|
+
* @remarks
|
|
42
|
+
* HTML Attribute: auto-update-mode
|
|
43
|
+
*/
|
|
44
|
+
this.autoUpdateMode = "anchor";
|
|
45
|
+
/**
|
|
46
|
+
* the html element currently being used as anchor.
|
|
47
|
+
* Setting this directly overrides the anchor attribute.
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
this.anchorElement = null;
|
|
52
|
+
/**
|
|
53
|
+
* The current viewport element instance
|
|
54
|
+
*
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
this.viewportElement = null;
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
* @defaultValue "dynamic"
|
|
61
|
+
*/
|
|
62
|
+
this.verticalPositioningMode = "dynamic";
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
* @defaultValue "dynamic"
|
|
66
|
+
*/
|
|
67
|
+
this.horizontalPositioningMode = "dynamic";
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
this.horizontalInset = "false";
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
this.verticalInset = "false";
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
this.horizontalScaling = "content";
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
this.verticalScaling = "content";
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
this.verticalDefaultPosition = undefined;
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
this.horizontalDefaultPosition = undefined;
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
this.tooltipVisible = false;
|
|
96
|
+
/**
|
|
97
|
+
* Track current direction to pass to the anchored region
|
|
98
|
+
* updated when tooltip is shown
|
|
99
|
+
*
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
this.currentDirection = Direction.ltr;
|
|
103
|
+
/**
|
|
104
|
+
* The timer that tracks delay time before the tooltip is shown on hover
|
|
105
|
+
*/
|
|
106
|
+
this.showDelayTimer = null;
|
|
107
|
+
/**
|
|
108
|
+
* The timer that tracks delay time before the tooltip is hidden
|
|
109
|
+
*/
|
|
110
|
+
this.hideDelayTimer = null;
|
|
111
|
+
/**
|
|
112
|
+
* Indicates whether the anchor is currently being hovered or has focus
|
|
113
|
+
*/
|
|
114
|
+
this.isAnchorHoveredFocused = false;
|
|
115
|
+
/**
|
|
116
|
+
* Indicates whether the region is currently being hovered
|
|
117
|
+
*/
|
|
118
|
+
this.isRegionHovered = false;
|
|
119
|
+
/**
|
|
120
|
+
* invoked when the anchored region's position relative to the anchor changes
|
|
121
|
+
*
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
this.handlePositionChange = (ev) => {
|
|
125
|
+
this.classList.toggle("top", this.region.verticalPosition === "start");
|
|
126
|
+
this.classList.toggle("bottom", this.region.verticalPosition === "end");
|
|
127
|
+
this.classList.toggle("inset-top", this.region.verticalPosition === "insetStart");
|
|
128
|
+
this.classList.toggle("inset-bottom", this.region.verticalPosition === "insetEnd");
|
|
129
|
+
this.classList.toggle("center-vertical", this.region.verticalPosition === "center");
|
|
130
|
+
this.classList.toggle("left", this.region.horizontalPosition === "start");
|
|
131
|
+
this.classList.toggle("right", this.region.horizontalPosition === "end");
|
|
132
|
+
this.classList.toggle("inset-left", this.region.horizontalPosition === "insetStart");
|
|
133
|
+
this.classList.toggle("inset-right", this.region.horizontalPosition === "insetEnd");
|
|
134
|
+
this.classList.toggle("center-horizontal", this.region.horizontalPosition === "center");
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* mouse enters region
|
|
138
|
+
*/
|
|
139
|
+
this.handleRegionMouseOver = (ev) => {
|
|
140
|
+
this.isRegionHovered = true;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* mouse leaves region
|
|
144
|
+
*/
|
|
145
|
+
this.handleRegionMouseOut = (ev) => {
|
|
146
|
+
this.isRegionHovered = false;
|
|
147
|
+
this.startHideDelayTimer();
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* mouse enters anchor
|
|
151
|
+
*/
|
|
152
|
+
this.handleAnchorMouseOver = (ev) => {
|
|
153
|
+
if (this.tooltipVisible) {
|
|
154
|
+
// tooltip is already visible, just set the anchor hover flag
|
|
155
|
+
this.isAnchorHoveredFocused = true;
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this.startShowDelayTimer();
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* mouse leaves anchor
|
|
162
|
+
*/
|
|
163
|
+
this.handleAnchorMouseOut = (ev) => {
|
|
164
|
+
this.isAnchorHoveredFocused = false;
|
|
165
|
+
this.clearShowDelayTimer();
|
|
166
|
+
this.startHideDelayTimer();
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* anchor gets focus
|
|
170
|
+
*/
|
|
171
|
+
this.handleAnchorFocusIn = (ev) => {
|
|
172
|
+
this.startShowDelayTimer();
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* anchor loses focus
|
|
176
|
+
*/
|
|
177
|
+
this.handleAnchorFocusOut = (ev) => {
|
|
178
|
+
this.isAnchorHoveredFocused = false;
|
|
179
|
+
this.clearShowDelayTimer();
|
|
180
|
+
this.startHideDelayTimer();
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* starts the hide timer
|
|
184
|
+
*/
|
|
185
|
+
this.startHideDelayTimer = () => {
|
|
186
|
+
this.clearHideDelayTimer();
|
|
187
|
+
if (!this.tooltipVisible) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
// allow 60 ms for account for pointer to move between anchor/tooltip
|
|
191
|
+
// without hiding tooltip
|
|
192
|
+
this.hideDelayTimer = window.setTimeout(() => {
|
|
193
|
+
this.updateTooltipVisibility();
|
|
194
|
+
}, 60);
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* clears the hide delay
|
|
198
|
+
*/
|
|
199
|
+
this.clearHideDelayTimer = () => {
|
|
200
|
+
if (this.hideDelayTimer !== null) {
|
|
201
|
+
clearTimeout(this.hideDelayTimer);
|
|
202
|
+
this.hideDelayTimer = null;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* starts the show timer if not currently running
|
|
207
|
+
*/
|
|
208
|
+
this.startShowDelayTimer = () => {
|
|
209
|
+
if (this.isAnchorHoveredFocused) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (this.delay > 1) {
|
|
213
|
+
if (this.showDelayTimer === null)
|
|
214
|
+
this.showDelayTimer = window.setTimeout(() => {
|
|
215
|
+
this.startHover();
|
|
216
|
+
}, this.delay);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this.startHover();
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* start hover
|
|
223
|
+
*/
|
|
224
|
+
this.startHover = () => {
|
|
225
|
+
this.isAnchorHoveredFocused = true;
|
|
226
|
+
this.updateTooltipVisibility();
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* clears the show delay
|
|
230
|
+
*/
|
|
231
|
+
this.clearShowDelayTimer = () => {
|
|
232
|
+
if (this.showDelayTimer !== null) {
|
|
233
|
+
clearTimeout(this.showDelayTimer);
|
|
234
|
+
this.showDelayTimer = null;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Gets the anchor element by id
|
|
239
|
+
*/
|
|
240
|
+
this.getAnchor = () => {
|
|
241
|
+
const rootNode = this.getRootNode();
|
|
242
|
+
if (rootNode instanceof ShadowRoot) {
|
|
243
|
+
return rootNode.getElementById(this.anchor);
|
|
244
|
+
}
|
|
245
|
+
return document.getElementById(this.anchor);
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* handles key down events to check for dismiss
|
|
249
|
+
*/
|
|
250
|
+
this.handleDocumentKeydown = (e) => {
|
|
251
|
+
if (!e.defaultPrevented && this.tooltipVisible) {
|
|
252
|
+
switch (e.key) {
|
|
253
|
+
case keyEscape:
|
|
254
|
+
this.isAnchorHoveredFocused = false;
|
|
255
|
+
this.updateTooltipVisibility();
|
|
256
|
+
this.$emit("dismiss");
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* determines whether to show or hide the tooltip based on current state
|
|
263
|
+
*/
|
|
264
|
+
this.updateTooltipVisibility = () => {
|
|
265
|
+
if (this.visible === false) {
|
|
266
|
+
this.hideTooltip();
|
|
267
|
+
}
|
|
268
|
+
else if (this.visible === true) {
|
|
269
|
+
this.showTooltip();
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
if (this.isAnchorHoveredFocused || this.isRegionHovered) {
|
|
274
|
+
this.showTooltip();
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
this.hideTooltip();
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* shows the tooltip
|
|
282
|
+
*/
|
|
283
|
+
this.showTooltip = () => {
|
|
284
|
+
if (this.tooltipVisible) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
this.currentDirection = getDirection(this);
|
|
288
|
+
this.tooltipVisible = true;
|
|
289
|
+
document.addEventListener("keydown", this.handleDocumentKeydown);
|
|
290
|
+
DOM.queueUpdate(this.setRegionProps);
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* hides the tooltip
|
|
294
|
+
*/
|
|
295
|
+
this.hideTooltip = () => {
|
|
296
|
+
if (!this.tooltipVisible) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
this.clearHideDelayTimer();
|
|
300
|
+
if (this.region !== null && this.region !== undefined) {
|
|
301
|
+
this.region.removeEventListener("positionchange", this.handlePositionChange);
|
|
302
|
+
this.region.viewportElement = null;
|
|
303
|
+
this.region.anchorElement = null;
|
|
304
|
+
this.region.removeEventListener("mouseover", this.handleRegionMouseOver);
|
|
305
|
+
this.region.removeEventListener("mouseout", this.handleRegionMouseOut);
|
|
306
|
+
}
|
|
307
|
+
document.removeEventListener("keydown", this.handleDocumentKeydown);
|
|
308
|
+
this.tooltipVisible = false;
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* updates the tooltip anchored region props after it has been
|
|
312
|
+
* added to the DOM
|
|
313
|
+
*/
|
|
314
|
+
this.setRegionProps = () => {
|
|
315
|
+
if (!this.tooltipVisible) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
this.region.viewportElement = this.viewportElement;
|
|
319
|
+
this.region.anchorElement = this.anchorElement;
|
|
320
|
+
this.region.addEventListener("positionchange", this.handlePositionChange);
|
|
321
|
+
this.region.addEventListener("mouseover", this.handleRegionMouseOver, {
|
|
322
|
+
passive: true,
|
|
323
|
+
});
|
|
324
|
+
this.region.addEventListener("mouseout", this.handleRegionMouseOut, {
|
|
325
|
+
passive: true,
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
visibleChanged() {
|
|
330
|
+
if (this.$fastController.isConnected) {
|
|
331
|
+
this.updateTooltipVisibility();
|
|
332
|
+
this.updateLayout();
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
anchorChanged() {
|
|
336
|
+
if (this.$fastController.isConnected) {
|
|
337
|
+
this.anchorElement = this.getAnchor();
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
positionChanged() {
|
|
341
|
+
if (this.$fastController.isConnected) {
|
|
342
|
+
this.updateLayout();
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
anchorElementChanged(oldValue) {
|
|
346
|
+
if (this.$fastController.isConnected) {
|
|
347
|
+
if (oldValue !== null && oldValue !== undefined) {
|
|
348
|
+
oldValue.removeEventListener("mouseover", this.handleAnchorMouseOver);
|
|
349
|
+
oldValue.removeEventListener("mouseout", this.handleAnchorMouseOut);
|
|
350
|
+
oldValue.removeEventListener("focusin", this.handleAnchorFocusIn);
|
|
351
|
+
oldValue.removeEventListener("focusout", this.handleAnchorFocusOut);
|
|
352
|
+
}
|
|
353
|
+
if (this.anchorElement !== null && this.anchorElement !== undefined) {
|
|
354
|
+
this.anchorElement.addEventListener("mouseover", this.handleAnchorMouseOver, { passive: true });
|
|
355
|
+
this.anchorElement.addEventListener("mouseout", this.handleAnchorMouseOut, { passive: true });
|
|
356
|
+
this.anchorElement.addEventListener("focusin", this.handleAnchorFocusIn, {
|
|
357
|
+
passive: true,
|
|
358
|
+
});
|
|
359
|
+
this.anchorElement.addEventListener("focusout", this.handleAnchorFocusOut, { passive: true });
|
|
360
|
+
const anchorId = this.anchorElement.id;
|
|
361
|
+
if (this.anchorElement.parentElement !== null) {
|
|
362
|
+
this.anchorElement.parentElement
|
|
363
|
+
.querySelectorAll(":hover")
|
|
364
|
+
.forEach(element => {
|
|
365
|
+
if (element.id === anchorId) {
|
|
366
|
+
this.startShowDelayTimer();
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (this.region !== null &&
|
|
372
|
+
this.region !== undefined &&
|
|
373
|
+
this.tooltipVisible) {
|
|
374
|
+
this.region.anchorElement = this.anchorElement;
|
|
375
|
+
}
|
|
376
|
+
this.updateLayout();
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
viewportElementChanged() {
|
|
380
|
+
if (this.region !== null && this.region !== undefined) {
|
|
381
|
+
this.region.viewportElement = this.viewportElement;
|
|
382
|
+
}
|
|
383
|
+
this.updateLayout();
|
|
384
|
+
}
|
|
385
|
+
connectedCallback() {
|
|
386
|
+
super.connectedCallback();
|
|
387
|
+
this.anchorElement = this.getAnchor();
|
|
388
|
+
this.updateTooltipVisibility();
|
|
389
|
+
}
|
|
390
|
+
disconnectedCallback() {
|
|
391
|
+
this.hideTooltip();
|
|
392
|
+
this.clearShowDelayTimer();
|
|
393
|
+
this.clearHideDelayTimer();
|
|
394
|
+
super.disconnectedCallback();
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* updated the properties being passed to the anchored region
|
|
398
|
+
*/
|
|
399
|
+
updateLayout() {
|
|
400
|
+
this.verticalPositioningMode = "locktodefault";
|
|
401
|
+
this.horizontalPositioningMode = "locktodefault";
|
|
402
|
+
switch (this.position) {
|
|
403
|
+
case TooltipPosition.top:
|
|
404
|
+
case TooltipPosition.bottom:
|
|
405
|
+
this.verticalDefaultPosition = this.position;
|
|
406
|
+
this.horizontalDefaultPosition = "center";
|
|
407
|
+
break;
|
|
408
|
+
case TooltipPosition.right:
|
|
409
|
+
case TooltipPosition.left:
|
|
410
|
+
case TooltipPosition.start:
|
|
411
|
+
case TooltipPosition.end:
|
|
412
|
+
this.verticalDefaultPosition = "center";
|
|
413
|
+
this.horizontalDefaultPosition = this.position;
|
|
414
|
+
break;
|
|
415
|
+
case TooltipPosition.topLeft:
|
|
416
|
+
this.verticalDefaultPosition = "top";
|
|
417
|
+
this.horizontalDefaultPosition = "left";
|
|
418
|
+
break;
|
|
419
|
+
case TooltipPosition.topRight:
|
|
420
|
+
this.verticalDefaultPosition = "top";
|
|
421
|
+
this.horizontalDefaultPosition = "right";
|
|
422
|
+
break;
|
|
423
|
+
case TooltipPosition.bottomLeft:
|
|
424
|
+
this.verticalDefaultPosition = "bottom";
|
|
425
|
+
this.horizontalDefaultPosition = "left";
|
|
426
|
+
break;
|
|
427
|
+
case TooltipPosition.bottomRight:
|
|
428
|
+
this.verticalDefaultPosition = "bottom";
|
|
429
|
+
this.horizontalDefaultPosition = "right";
|
|
430
|
+
break;
|
|
431
|
+
case TooltipPosition.topStart:
|
|
432
|
+
this.verticalDefaultPosition = "top";
|
|
433
|
+
this.horizontalDefaultPosition = "start";
|
|
434
|
+
break;
|
|
435
|
+
case TooltipPosition.topEnd:
|
|
436
|
+
this.verticalDefaultPosition = "top";
|
|
437
|
+
this.horizontalDefaultPosition = "end";
|
|
438
|
+
break;
|
|
439
|
+
case TooltipPosition.bottomStart:
|
|
440
|
+
this.verticalDefaultPosition = "bottom";
|
|
441
|
+
this.horizontalDefaultPosition = "start";
|
|
442
|
+
break;
|
|
443
|
+
case TooltipPosition.bottomEnd:
|
|
444
|
+
this.verticalDefaultPosition = "bottom";
|
|
445
|
+
this.horizontalDefaultPosition = "end";
|
|
446
|
+
break;
|
|
447
|
+
default:
|
|
448
|
+
this.verticalPositioningMode = "dynamic";
|
|
449
|
+
this.horizontalPositioningMode = "dynamic";
|
|
450
|
+
this.verticalDefaultPosition = void 0;
|
|
451
|
+
this.horizontalDefaultPosition = "center";
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
__decorate([
|
|
457
|
+
attr({ mode: "boolean" })
|
|
458
|
+
], Tooltip.prototype, "visible", void 0);
|
|
459
|
+
__decorate([
|
|
460
|
+
attr
|
|
461
|
+
], Tooltip.prototype, "anchor", void 0);
|
|
462
|
+
__decorate([
|
|
463
|
+
attr
|
|
464
|
+
], Tooltip.prototype, "delay", void 0);
|
|
465
|
+
__decorate([
|
|
466
|
+
attr
|
|
467
|
+
], Tooltip.prototype, "position", void 0);
|
|
468
|
+
__decorate([
|
|
469
|
+
attr({ attribute: "auto-update-mode" })
|
|
470
|
+
], Tooltip.prototype, "autoUpdateMode", void 0);
|
|
471
|
+
__decorate([
|
|
472
|
+
attr({ attribute: "horizontal-viewport-lock" })
|
|
473
|
+
], Tooltip.prototype, "horizontalViewportLock", void 0);
|
|
474
|
+
__decorate([
|
|
475
|
+
attr({ attribute: "vertical-viewport-lock" })
|
|
476
|
+
], Tooltip.prototype, "verticalViewportLock", void 0);
|
|
477
|
+
__decorate([
|
|
478
|
+
observable
|
|
479
|
+
], Tooltip.prototype, "anchorElement", void 0);
|
|
480
|
+
__decorate([
|
|
481
|
+
observable
|
|
482
|
+
], Tooltip.prototype, "viewportElement", void 0);
|
|
483
|
+
__decorate([
|
|
484
|
+
observable
|
|
485
|
+
], Tooltip.prototype, "verticalPositioningMode", void 0);
|
|
486
|
+
__decorate([
|
|
487
|
+
observable
|
|
488
|
+
], Tooltip.prototype, "horizontalPositioningMode", void 0);
|
|
489
|
+
__decorate([
|
|
490
|
+
observable
|
|
491
|
+
], Tooltip.prototype, "horizontalInset", void 0);
|
|
492
|
+
__decorate([
|
|
493
|
+
observable
|
|
494
|
+
], Tooltip.prototype, "verticalInset", void 0);
|
|
495
|
+
__decorate([
|
|
496
|
+
observable
|
|
497
|
+
], Tooltip.prototype, "horizontalScaling", void 0);
|
|
498
|
+
__decorate([
|
|
499
|
+
observable
|
|
500
|
+
], Tooltip.prototype, "verticalScaling", void 0);
|
|
501
|
+
__decorate([
|
|
502
|
+
observable
|
|
503
|
+
], Tooltip.prototype, "verticalDefaultPosition", void 0);
|
|
504
|
+
__decorate([
|
|
505
|
+
observable
|
|
506
|
+
], Tooltip.prototype, "horizontalDefaultPosition", void 0);
|
|
507
|
+
__decorate([
|
|
508
|
+
observable
|
|
509
|
+
], Tooltip.prototype, "tooltipVisible", void 0);
|
|
510
|
+
__decorate([
|
|
511
|
+
observable
|
|
512
|
+
], Tooltip.prototype, "currentDirection", void 0);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumerates possible tooltip positions
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export const TooltipPosition = {
|
|
7
|
+
/**
|
|
8
|
+
* The tooltip is positioned above the element
|
|
9
|
+
*/
|
|
10
|
+
top: "top",
|
|
11
|
+
/**
|
|
12
|
+
* The tooltip is positioned to the right of the element
|
|
13
|
+
*/
|
|
14
|
+
right: "right",
|
|
15
|
+
/**
|
|
16
|
+
* The tooltip is positioned below the element
|
|
17
|
+
*/
|
|
18
|
+
bottom: "bottom",
|
|
19
|
+
/**
|
|
20
|
+
* The tooltip is positioned to the left of the element
|
|
21
|
+
*/
|
|
22
|
+
left: "left",
|
|
23
|
+
/**
|
|
24
|
+
* The tooltip is positioned before the element
|
|
25
|
+
*/
|
|
26
|
+
start: "start",
|
|
27
|
+
/**
|
|
28
|
+
* The tooltip is positioned after the element
|
|
29
|
+
*/
|
|
30
|
+
end: "end",
|
|
31
|
+
/**
|
|
32
|
+
* The tooltip is positioned above the element and to the left
|
|
33
|
+
*/
|
|
34
|
+
topLeft: "top-left",
|
|
35
|
+
/**
|
|
36
|
+
* The tooltip is positioned above the element and to the right
|
|
37
|
+
*/
|
|
38
|
+
topRight: "top-right",
|
|
39
|
+
/**
|
|
40
|
+
* The tooltip is positioned below the element and to the left
|
|
41
|
+
*/
|
|
42
|
+
bottomLeft: "bottom-left",
|
|
43
|
+
/**
|
|
44
|
+
* The tooltip is positioned below the element and to the right
|
|
45
|
+
*/
|
|
46
|
+
bottomRight: "bottom-right",
|
|
47
|
+
/**
|
|
48
|
+
* The tooltip is positioned above the element and to the left
|
|
49
|
+
*/
|
|
50
|
+
topStart: "top-start",
|
|
51
|
+
/**
|
|
52
|
+
* The tooltip is positioned above the element and to the right
|
|
53
|
+
*/
|
|
54
|
+
topEnd: "top-end",
|
|
55
|
+
/**
|
|
56
|
+
* The tooltip is positioned below the element and to the left
|
|
57
|
+
*/
|
|
58
|
+
bottomStart: "bottom-start",
|
|
59
|
+
/**
|
|
60
|
+
* The tooltip is positioned below the element and to the right
|
|
61
|
+
*/
|
|
62
|
+
bottomEnd: "bottom-end",
|
|
63
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { html, ref, when } from "@ni/fast-element";
|
|
2
|
+
import { AnchoredRegion } from "../anchored-region/anchored-region.js";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a template for the {@link @ni/fast-foundation#(Tooltip:class)} component using the provided prefix.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const tooltipTemplate = (context, definition) => {
|
|
8
|
+
return html `
|
|
9
|
+
${when(x => x.tooltipVisible, html `
|
|
10
|
+
<${context.tagFor(AnchoredRegion)}
|
|
11
|
+
fixed-placement="true"
|
|
12
|
+
auto-update-mode="${x => x.autoUpdateMode}"
|
|
13
|
+
vertical-positioning-mode="${x => x.verticalPositioningMode}"
|
|
14
|
+
vertical-default-position="${x => x.verticalDefaultPosition}"
|
|
15
|
+
vertical-inset="${x => x.verticalInset}"
|
|
16
|
+
vertical-scaling="${x => x.verticalScaling}"
|
|
17
|
+
horizontal-positioning-mode="${x => x.horizontalPositioningMode}"
|
|
18
|
+
horizontal-default-position="${x => x.horizontalDefaultPosition}"
|
|
19
|
+
horizontal-scaling="${x => x.horizontalScaling}"
|
|
20
|
+
horizontal-inset="${x => x.horizontalInset}"
|
|
21
|
+
vertical-viewport-lock="${x => x.horizontalViewportLock}"
|
|
22
|
+
horizontal-viewport-lock="${x => x.verticalViewportLock}"
|
|
23
|
+
dir="${x => x.currentDirection}"
|
|
24
|
+
${ref("region")}
|
|
25
|
+
>
|
|
26
|
+
<div class="tooltip" part="tooltip" role="tooltip">
|
|
27
|
+
<slot></slot>
|
|
28
|
+
</div>
|
|
29
|
+
</${context.tagFor(AnchoredRegion)}>
|
|
30
|
+
`)}
|
|
31
|
+
`;
|
|
32
|
+
};
|