@fluentui/web-components 3.0.0-beta.99 → 3.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +326 -2
- package/custom-elements.json +1886 -609
- package/dist/esm/accordion/accordion.js +3 -5
- package/dist/esm/accordion/accordion.js.map +1 -1
- package/dist/{dts → esm}/accordion-item/accordion-item.d.ts +1 -0
- package/dist/esm/accordion-item/accordion-item.js.map +1 -1
- package/dist/{dts → esm}/button/button.base.d.ts +3 -10
- package/dist/esm/button/button.base.js +25 -11
- package/dist/esm/button/button.base.js.map +1 -1
- package/dist/esm/button/button.template.js +0 -1
- package/dist/esm/button/button.template.js.map +1 -1
- package/dist/{dts → esm}/checkbox/checkbox.base.d.ts +10 -1
- package/dist/esm/checkbox/checkbox.base.js +24 -2
- package/dist/esm/checkbox/checkbox.base.js.map +1 -1
- package/dist/esm/checkbox/checkbox.template.js +0 -1
- package/dist/esm/checkbox/checkbox.template.js.map +1 -1
- package/dist/esm/compound-button/compound-button.styles.js +7 -1
- package/dist/esm/compound-button/compound-button.styles.js.map +1 -1
- package/dist/{dts → esm}/dialog/dialog.d.ts +3 -0
- package/dist/esm/dialog/dialog.js +22 -1
- package/dist/esm/dialog/dialog.js.map +1 -1
- package/dist/esm/dialog/dialog.options.d.ts +21 -0
- package/dist/esm/dialog/dialog.options.js +14 -0
- package/dist/esm/dialog/dialog.options.js.map +1 -1
- package/dist/esm/dialog/dialog.styles.js +7 -1
- package/dist/esm/dialog/dialog.styles.js.map +1 -1
- package/dist/esm/dialog/dialog.template.js +0 -4
- package/dist/esm/dialog/dialog.template.js.map +1 -1
- package/dist/{dts → esm}/dialog/index.d.ts +1 -1
- package/dist/esm/dialog/index.js +1 -1
- package/dist/esm/dialog/index.js.map +1 -1
- package/dist/{dts → esm}/dialog-body/dialog-body.d.ts +5 -3
- package/dist/esm/dialog-body/dialog-body.js +16 -12
- package/dist/esm/dialog-body/dialog-body.js.map +1 -1
- package/dist/esm/dialog-body/dialog-body.styles.js +24 -8
- package/dist/esm/dialog-body/dialog-body.styles.js.map +1 -1
- package/dist/esm/dialog-body/dialog-body.template.js +10 -35
- package/dist/esm/dialog-body/dialog-body.template.js.map +1 -1
- package/dist/{dts → esm}/divider/divider.options.d.ts +1 -4
- package/dist/{dts → esm}/drawer/drawer.d.ts +14 -0
- package/dist/esm/drawer/drawer.js +50 -0
- package/dist/esm/drawer/drawer.js.map +1 -1
- package/dist/esm/drawer/drawer.template.js +1 -4
- package/dist/esm/drawer/drawer.template.js.map +1 -1
- package/dist/{dts → esm}/drawer-body/drawer-body.d.ts +7 -0
- package/dist/esm/drawer-body/drawer-body.js +16 -0
- package/dist/esm/drawer-body/drawer-body.js.map +1 -1
- package/dist/esm/drawer-body/drawer-body.template.js +1 -1
- package/dist/esm/drawer-body/drawer-body.template.js.map +1 -1
- package/dist/{dts → esm}/dropdown/dropdown.base.d.ts +30 -16
- package/dist/esm/dropdown/dropdown.base.js +114 -62
- package/dist/esm/dropdown/dropdown.base.js.map +1 -1
- package/dist/esm/dropdown/dropdown.definition.js +0 -3
- package/dist/esm/dropdown/dropdown.definition.js.map +1 -1
- package/dist/esm/dropdown/dropdown.styles.js +28 -25
- package/dist/esm/dropdown/dropdown.styles.js.map +1 -1
- package/dist/esm/dropdown/dropdown.template.js +4 -2
- package/dist/esm/dropdown/dropdown.template.js.map +1 -1
- package/dist/{dts → esm}/field/field.base.d.ts +3 -0
- package/dist/esm/field/field.base.js +21 -10
- package/dist/esm/field/field.base.js.map +1 -1
- package/dist/esm/field/field.styles.js +13 -15
- package/dist/esm/field/field.styles.js.map +1 -1
- package/dist/esm/field/field.template.js +2 -10
- package/dist/esm/field/field.template.js.map +1 -1
- package/dist/{dts → esm}/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/label/label.template.js +1 -1
- package/dist/esm/label/label.template.js.map +1 -1
- package/dist/{dts → esm}/listbox/listbox.d.ts +8 -2
- package/dist/esm/listbox/listbox.js +17 -5
- package/dist/esm/listbox/listbox.js.map +1 -1
- package/dist/esm/listbox/listbox.styles.js +38 -2
- package/dist/esm/listbox/listbox.styles.js.map +1 -1
- package/dist/{dts → esm}/listbox/listbox.template.d.ts +1 -2
- package/dist/esm/listbox/listbox.template.js +2 -9
- package/dist/esm/listbox/listbox.template.js.map +1 -1
- package/dist/esm/menu/menu.js +7 -3
- package/dist/esm/menu/menu.js.map +1 -1
- package/dist/{dts → esm}/menu-item/menu-item.options.d.ts +10 -0
- package/dist/esm/menu-item/menu-item.options.js +14 -0
- package/dist/esm/menu-item/menu-item.options.js.map +1 -1
- package/dist/esm/menu-item/menu-item.styles.js +1 -1
- package/dist/esm/menu-list/menu-list.js +3 -7
- package/dist/esm/menu-list/menu-list.js.map +1 -1
- package/dist/esm/option/option.js +1 -0
- package/dist/esm/option/option.js.map +1 -1
- package/dist/esm/option/option.styles.js +8 -2
- package/dist/esm/option/option.styles.js.map +1 -1
- package/dist/{dts → esm}/progress-bar/progress-bar.base.d.ts +4 -5
- package/dist/esm/progress-bar/progress-bar.base.js +26 -15
- package/dist/esm/progress-bar/progress-bar.base.js.map +1 -1
- package/dist/{dts → esm}/progress-bar/progress-bar.d.ts +1 -1
- package/dist/esm/progress-bar/progress-bar.styles.js +11 -0
- package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.template.js +2 -8
- package/dist/esm/progress-bar/progress-bar.template.js.map +1 -1
- package/dist/{dts → esm}/radio/radio.d.ts +0 -1
- package/dist/esm/radio/radio.js +0 -7
- package/dist/esm/radio/radio.js.map +1 -1
- package/dist/{dts → esm}/radio-group/radio-group.d.ts +15 -0
- package/dist/esm/radio-group/radio-group.js +46 -6
- package/dist/esm/radio-group/radio-group.js.map +1 -1
- package/dist/{dts → esm}/radio-group/radio-group.options.d.ts +1 -4
- package/dist/esm/radio-group/radio-group.styles.js +5 -1
- package/dist/esm/radio-group/radio-group.styles.js.map +1 -1
- package/dist/{dts → esm}/rating-display/rating-display.base.d.ts +20 -32
- package/dist/esm/rating-display/rating-display.base.js +63 -48
- package/dist/esm/rating-display/rating-display.base.js.map +1 -1
- package/dist/{dts → esm}/rating-display/rating-display.d.ts +1 -13
- package/dist/esm/rating-display/rating-display.js +0 -16
- package/dist/esm/rating-display/rating-display.js.map +1 -1
- package/dist/esm/rating-display/rating-display.styles.js +65 -38
- package/dist/esm/rating-display/rating-display.styles.js.map +1 -1
- package/dist/esm/rating-display/rating-display.template.d.ts +17 -0
- package/dist/esm/rating-display/rating-display.template.js +11 -15
- package/dist/esm/rating-display/rating-display.template.js.map +1 -1
- package/dist/esm/slider/slider.js +2 -2
- package/dist/esm/slider/slider.js.map +1 -1
- package/dist/esm/slider/slider.template.js +0 -1
- package/dist/esm/slider/slider.template.js.map +1 -1
- package/dist/{dts → esm}/styles/states/index.d.ts +5 -0
- package/dist/esm/styles/states/index.js +5 -0
- package/dist/esm/styles/states/index.js.map +1 -1
- package/dist/esm/switch/switch.styles.js +4 -0
- package/dist/esm/switch/switch.styles.js.map +1 -1
- package/dist/esm/switch/switch.template.js +0 -1
- package/dist/esm/switch/switch.template.js.map +1 -1
- package/dist/{dts → esm}/tab/index.d.ts +1 -0
- package/dist/esm/tab/index.js +1 -0
- package/dist/esm/tab/index.js.map +1 -1
- package/dist/esm/tab/tab.options.d.ts +10 -0
- package/dist/esm/tab/tab.options.js +15 -0
- package/dist/esm/tab/tab.options.js.map +1 -0
- package/dist/esm/tab/tab.styles.js +12 -7
- package/dist/esm/tab/tab.styles.js.map +1 -1
- package/dist/{dts → esm}/tablist/tablist.base.d.ts +13 -2
- package/dist/esm/tablist/tablist.base.js +23 -0
- package/dist/esm/tablist/tablist.base.js.map +1 -1
- package/dist/{dts → esm}/tablist/tablist.options.d.ts +1 -4
- package/dist/esm/tablist/tablist.styles.js +2 -2
- package/dist/esm/tablist/tablist.template.js +1 -1
- package/dist/esm/tablist/tablist.template.js.map +1 -1
- package/dist/esm/text/text.styles.js +0 -1
- package/dist/esm/text/text.styles.js.map +1 -1
- package/dist/{dts → esm}/textarea/textarea.base.d.ts +1 -0
- package/dist/esm/textarea/textarea.base.js +14 -6
- package/dist/esm/textarea/textarea.base.js.map +1 -1
- package/dist/esm/textarea/textarea.template.js +2 -14
- package/dist/esm/textarea/textarea.template.js.map +1 -1
- package/dist/{dts → esm}/tree/tree.base.d.ts +7 -1
- package/dist/esm/tree/tree.base.js +9 -0
- package/dist/esm/tree/tree.base.js.map +1 -1
- package/dist/{dts → esm}/tree/tree.d.ts +4 -4
- package/dist/esm/tree/tree.js +2 -2
- package/dist/esm/tree/tree.js.map +1 -1
- package/dist/esm/tree/tree.styles.js +2 -1
- package/dist/esm/tree/tree.styles.js.map +1 -1
- package/dist/esm/tree/tree.template.js +2 -7
- package/dist/esm/tree/tree.template.js.map +1 -1
- package/dist/{dts → esm}/tree-item/tree-item.base.d.ts +8 -1
- package/dist/esm/tree-item/tree-item.base.js +18 -0
- package/dist/esm/tree-item/tree-item.base.js.map +1 -1
- package/dist/{dts → esm}/tree-item/tree-item.d.ts +3 -3
- package/dist/esm/tree-item/tree-item.js +1 -1
- package/dist/esm/tree-item/tree-item.js.map +1 -1
- package/dist/esm/tree-item/tree-item.styles.js +5 -0
- package/dist/esm/tree-item/tree-item.styles.js.map +1 -1
- package/dist/esm/tree-item/tree-item.template.js +5 -13
- package/dist/esm/tree-item/tree-item.template.js.map +1 -1
- package/dist/{dts → esm}/tsdoc-metadata.json +1 -1
- package/dist/esm/utils/element-internals.js +0 -3
- package/dist/esm/utils/element-internals.js.map +1 -1
- package/dist/{dts → esm}/utils/language.d.ts +1 -1
- package/dist/esm/utils/request-idle-callback.d.ts +41 -0
- package/dist/esm/utils/request-idle-callback.js +72 -0
- package/dist/esm/utils/request-idle-callback.js.map +1 -0
- package/dist/web-components.d.ts +177 -105
- package/dist/web-components.js +766 -533
- package/dist/web-components.min.js +228 -217
- package/package.json +26 -53
- package/dist/dts/dialog/dialog.options.d.ts +0 -11
- package/dist/dts/rating-display/rating-display.template.d.ts +0 -14
- /package/dist/{dts → esm}/accordion/accordion.bench.d.ts +0 -0
- /package/dist/{dts → esm}/accordion/accordion.d.ts +0 -0
- /package/dist/{dts → esm}/accordion/accordion.definition.d.ts +0 -0
- /package/dist/{dts → esm}/accordion/accordion.options.d.ts +0 -0
- /package/dist/{dts → esm}/accordion/accordion.styles.d.ts +0 -0
- /package/dist/{dts → esm}/accordion/accordion.template.d.ts +0 -0
- /package/dist/{dts → esm}/accordion/define.d.ts +0 -0
- /package/dist/{dts → esm}/accordion/index.d.ts +0 -0
- /package/dist/{dts → esm}/accordion-item/accordion-item.base.d.ts +0 -0
- /package/dist/{dts → esm}/accordion-item/accordion-item.bench.d.ts +0 -0
- /package/dist/{dts → esm}/accordion-item/accordion-item.definition.d.ts +0 -0
- /package/dist/{dts → esm}/accordion-item/accordion-item.options.d.ts +0 -0
- /package/dist/{dts → esm}/accordion-item/accordion-item.styles.d.ts +0 -0
- /package/dist/{dts → esm}/accordion-item/accordion-item.template.d.ts +0 -0
- /package/dist/{dts → esm}/accordion-item/define.d.ts +0 -0
- /package/dist/{dts → esm}/accordion-item/index.d.ts +0 -0
- /package/dist/{dts → esm}/anchor-button/anchor-button.base.d.ts +0 -0
- /package/dist/{dts → esm}/anchor-button/anchor-button.bench.d.ts +0 -0
- /package/dist/{dts → esm}/anchor-button/anchor-button.d.ts +0 -0
- /package/dist/{dts → esm}/anchor-button/anchor-button.definition.d.ts +0 -0
- /package/dist/{dts → esm}/anchor-button/anchor-button.options.d.ts +0 -0
- /package/dist/{dts → esm}/anchor-button/anchor-button.styles.d.ts +0 -0
- /package/dist/{dts → esm}/anchor-button/anchor-button.template.d.ts +0 -0
- /package/dist/{dts → esm}/anchor-button/define.d.ts +0 -0
- /package/dist/{dts → esm}/anchor-button/index.d.ts +0 -0
- /package/dist/{dts → esm}/avatar/avatar.base.d.ts +0 -0
- /package/dist/{dts → esm}/avatar/avatar.bench.d.ts +0 -0
- /package/dist/{dts → esm}/avatar/avatar.d.ts +0 -0
- /package/dist/{dts → esm}/avatar/avatar.definition.d.ts +0 -0
- /package/dist/{dts → esm}/avatar/avatar.options.d.ts +0 -0
- /package/dist/{dts → esm}/avatar/avatar.styles.d.ts +0 -0
- /package/dist/{dts → esm}/avatar/avatar.template.d.ts +0 -0
- /package/dist/{dts → esm}/avatar/define.d.ts +0 -0
- /package/dist/{dts → esm}/avatar/index.d.ts +0 -0
- /package/dist/{dts → esm}/badge/badge.bench.d.ts +0 -0
- /package/dist/{dts → esm}/badge/badge.d.ts +0 -0
- /package/dist/{dts → esm}/badge/badge.definition.d.ts +0 -0
- /package/dist/{dts → esm}/badge/badge.options.d.ts +0 -0
- /package/dist/{dts → esm}/badge/badge.styles.d.ts +0 -0
- /package/dist/{dts → esm}/badge/badge.template.d.ts +0 -0
- /package/dist/{dts → esm}/badge/define.d.ts +0 -0
- /package/dist/{dts → esm}/badge/index.d.ts +0 -0
- /package/dist/{dts → esm}/button/button.bench.d.ts +0 -0
- /package/dist/{dts → esm}/button/button.d.ts +0 -0
- /package/dist/{dts → esm}/button/button.definition.d.ts +0 -0
- /package/dist/{dts → esm}/button/button.options.d.ts +0 -0
- /package/dist/{dts → esm}/button/button.styles.d.ts +0 -0
- /package/dist/{dts → esm}/button/button.template.d.ts +0 -0
- /package/dist/{dts → esm}/button/define.d.ts +0 -0
- /package/dist/{dts → esm}/button/index.d.ts +0 -0
- /package/dist/{dts → esm}/checkbox/checkbox.bench.d.ts +0 -0
- /package/dist/{dts → esm}/checkbox/checkbox.d.ts +0 -0
- /package/dist/{dts → esm}/checkbox/checkbox.definition.d.ts +0 -0
- /package/dist/{dts → esm}/checkbox/checkbox.options.d.ts +0 -0
- /package/dist/{dts → esm}/checkbox/checkbox.styles.d.ts +0 -0
- /package/dist/{dts → esm}/checkbox/checkbox.template.d.ts +0 -0
- /package/dist/{dts → esm}/checkbox/define.d.ts +0 -0
- /package/dist/{dts → esm}/checkbox/index.d.ts +0 -0
- /package/dist/{dts → esm}/compound-button/compound-button.bench.d.ts +0 -0
- /package/dist/{dts → esm}/compound-button/compound-button.d.ts +0 -0
- /package/dist/{dts → esm}/compound-button/compound-button.definition.d.ts +0 -0
- /package/dist/{dts → esm}/compound-button/compound-button.options.d.ts +0 -0
- /package/dist/{dts → esm}/compound-button/compound-button.styles.d.ts +0 -0
- /package/dist/{dts → esm}/compound-button/compound-button.template.d.ts +0 -0
- /package/dist/{dts → esm}/compound-button/define.d.ts +0 -0
- /package/dist/{dts → esm}/compound-button/index.d.ts +0 -0
- /package/dist/{dts → esm}/counter-badge/counter-badge.bench.d.ts +0 -0
- /package/dist/{dts → esm}/counter-badge/counter-badge.d.ts +0 -0
- /package/dist/{dts → esm}/counter-badge/counter-badge.definition.d.ts +0 -0
- /package/dist/{dts → esm}/counter-badge/counter-badge.options.d.ts +0 -0
- /package/dist/{dts → esm}/counter-badge/counter-badge.styles.d.ts +0 -0
- /package/dist/{dts → esm}/counter-badge/counter-badge.template.d.ts +0 -0
- /package/dist/{dts → esm}/counter-badge/define.d.ts +0 -0
- /package/dist/{dts → esm}/counter-badge/index.d.ts +0 -0
- /package/dist/{dts → esm}/dialog/define.d.ts +0 -0
- /package/dist/{dts → esm}/dialog/dialog.bench.d.ts +0 -0
- /package/dist/{dts → esm}/dialog/dialog.definition.d.ts +0 -0
- /package/dist/{dts → esm}/dialog/dialog.styles.d.ts +0 -0
- /package/dist/{dts → esm}/dialog/dialog.template.d.ts +0 -0
- /package/dist/{dts → esm}/dialog-body/define.d.ts +0 -0
- /package/dist/{dts → esm}/dialog-body/dialog-body.bench.d.ts +0 -0
- /package/dist/{dts → esm}/dialog-body/dialog-body.definition.d.ts +0 -0
- /package/dist/{dts → esm}/dialog-body/dialog-body.styles.d.ts +0 -0
- /package/dist/{dts → esm}/dialog-body/dialog-body.template.d.ts +0 -0
- /package/dist/{dts → esm}/dialog-body/index.d.ts +0 -0
- /package/dist/{dts → esm}/divider/define.d.ts +0 -0
- /package/dist/{dts → esm}/divider/divider.base.d.ts +0 -0
- /package/dist/{dts → esm}/divider/divider.bench.d.ts +0 -0
- /package/dist/{dts → esm}/divider/divider.d.ts +0 -0
- /package/dist/{dts → esm}/divider/divider.definition.d.ts +0 -0
- /package/dist/{dts → esm}/divider/divider.styles.d.ts +0 -0
- /package/dist/{dts → esm}/divider/divider.template.d.ts +0 -0
- /package/dist/{dts → esm}/divider/index.d.ts +0 -0
- /package/dist/{dts → esm}/drawer/define.d.ts +0 -0
- /package/dist/{dts → esm}/drawer/drawer.definition.d.ts +0 -0
- /package/dist/{dts → esm}/drawer/drawer.options.d.ts +0 -0
- /package/dist/{dts → esm}/drawer/drawer.styles.d.ts +0 -0
- /package/dist/{dts → esm}/drawer/drawer.template.d.ts +0 -0
- /package/dist/{dts → esm}/drawer/index.d.ts +0 -0
- /package/dist/{dts → esm}/drawer-body/define.d.ts +0 -0
- /package/dist/{dts → esm}/drawer-body/drawer-body.definition.d.ts +0 -0
- /package/dist/{dts → esm}/drawer-body/drawer-body.styles.d.ts +0 -0
- /package/dist/{dts → esm}/drawer-body/drawer-body.template.d.ts +0 -0
- /package/dist/{dts → esm}/drawer-body/index.d.ts +0 -0
- /package/dist/{dts → esm}/dropdown/define.d.ts +0 -0
- /package/dist/{dts → esm}/dropdown/dropdown.d.ts +0 -0
- /package/dist/{dts → esm}/dropdown/dropdown.definition.d.ts +0 -0
- /package/dist/{dts → esm}/dropdown/dropdown.options.d.ts +0 -0
- /package/dist/{dts → esm}/dropdown/dropdown.styles.d.ts +0 -0
- /package/dist/{dts → esm}/dropdown/dropdown.template.d.ts +0 -0
- /package/dist/{dts → esm}/dropdown/index.d.ts +0 -0
- /package/dist/{dts → esm}/field/define.d.ts +0 -0
- /package/dist/{dts → esm}/field/field.bench.d.ts +0 -0
- /package/dist/{dts → esm}/field/field.d.ts +0 -0
- /package/dist/{dts → esm}/field/field.definition.d.ts +0 -0
- /package/dist/{dts → esm}/field/field.options.d.ts +0 -0
- /package/dist/{dts → esm}/field/field.styles.d.ts +0 -0
- /package/dist/{dts → esm}/field/field.template.d.ts +0 -0
- /package/dist/{dts → esm}/field/index.d.ts +0 -0
- /package/dist/{dts → esm}/fluent-design-system.d.ts +0 -0
- /package/dist/{dts → esm}/image/define.d.ts +0 -0
- /package/dist/{dts → esm}/image/image.bench.d.ts +0 -0
- /package/dist/{dts → esm}/image/image.d.ts +0 -0
- /package/dist/{dts → esm}/image/image.definition.d.ts +0 -0
- /package/dist/{dts → esm}/image/image.options.d.ts +0 -0
- /package/dist/{dts → esm}/image/image.styles.d.ts +0 -0
- /package/dist/{dts → esm}/image/image.template.d.ts +0 -0
- /package/dist/{dts → esm}/image/index.d.ts +0 -0
- /package/dist/{dts → esm}/index-rollup.d.ts +0 -0
- /package/dist/{dts → esm}/label/define.d.ts +0 -0
- /package/dist/{dts → esm}/label/index.d.ts +0 -0
- /package/dist/{dts → esm}/label/label.bench.d.ts +0 -0
- /package/dist/{dts → esm}/label/label.d.ts +0 -0
- /package/dist/{dts → esm}/label/label.definition.d.ts +0 -0
- /package/dist/{dts → esm}/label/label.options.d.ts +0 -0
- /package/dist/{dts → esm}/label/label.styles.d.ts +0 -0
- /package/dist/{dts → esm}/label/label.template.d.ts +0 -0
- /package/dist/{dts → esm}/link/define.d.ts +0 -0
- /package/dist/{dts → esm}/link/index.d.ts +0 -0
- /package/dist/{dts → esm}/link/link.bench.d.ts +0 -0
- /package/dist/{dts → esm}/link/link.d.ts +0 -0
- /package/dist/{dts → esm}/link/link.definition.d.ts +0 -0
- /package/dist/{dts → esm}/link/link.options.d.ts +0 -0
- /package/dist/{dts → esm}/link/link.styles.d.ts +0 -0
- /package/dist/{dts → esm}/link/link.template.d.ts +0 -0
- /package/dist/{dts → esm}/listbox/define.d.ts +0 -0
- /package/dist/{dts → esm}/listbox/index.d.ts +0 -0
- /package/dist/{dts → esm}/listbox/listbox.definition.d.ts +0 -0
- /package/dist/{dts → esm}/listbox/listbox.options.d.ts +0 -0
- /package/dist/{dts → esm}/listbox/listbox.styles.d.ts +0 -0
- /package/dist/{dts → esm}/menu/define.d.ts +0 -0
- /package/dist/{dts → esm}/menu/index.d.ts +0 -0
- /package/dist/{dts → esm}/menu/menu.bench.d.ts +0 -0
- /package/dist/{dts → esm}/menu/menu.d.ts +0 -0
- /package/dist/{dts → esm}/menu/menu.definition.d.ts +0 -0
- /package/dist/{dts → esm}/menu/menu.styles.d.ts +0 -0
- /package/dist/{dts → esm}/menu/menu.template.d.ts +0 -0
- /package/dist/{dts → esm}/menu-button/define.d.ts +0 -0
- /package/dist/{dts → esm}/menu-button/index.d.ts +0 -0
- /package/dist/{dts → esm}/menu-button/menu-button.bench.d.ts +0 -0
- /package/dist/{dts → esm}/menu-button/menu-button.d.ts +0 -0
- /package/dist/{dts → esm}/menu-button/menu-button.definition.d.ts +0 -0
- /package/dist/{dts → esm}/menu-button/menu-button.options.d.ts +0 -0
- /package/dist/{dts → esm}/menu-button/menu-button.template.d.ts +0 -0
- /package/dist/{dts → esm}/menu-item/define.d.ts +0 -0
- /package/dist/{dts → esm}/menu-item/index.d.ts +0 -0
- /package/dist/{dts → esm}/menu-item/menu-item.bench.d.ts +0 -0
- /package/dist/{dts → esm}/menu-item/menu-item.d.ts +0 -0
- /package/dist/{dts → esm}/menu-item/menu-item.definition.d.ts +0 -0
- /package/dist/{dts → esm}/menu-item/menu-item.styles.d.ts +0 -0
- /package/dist/{dts → esm}/menu-item/menu-item.template.d.ts +0 -0
- /package/dist/{dts → esm}/menu-list/define.d.ts +0 -0
- /package/dist/{dts → esm}/menu-list/index.d.ts +0 -0
- /package/dist/{dts → esm}/menu-list/menu-list.bench.d.ts +0 -0
- /package/dist/{dts → esm}/menu-list/menu-list.d.ts +0 -0
- /package/dist/{dts → esm}/menu-list/menu-list.definition.d.ts +0 -0
- /package/dist/{dts → esm}/menu-list/menu-list.styles.d.ts +0 -0
- /package/dist/{dts → esm}/menu-list/menu-list.template.d.ts +0 -0
- /package/dist/{dts → esm}/message-bar/define.d.ts +0 -0
- /package/dist/{dts → esm}/message-bar/index.d.ts +0 -0
- /package/dist/{dts → esm}/message-bar/message-bar.bench.d.ts +0 -0
- /package/dist/{dts → esm}/message-bar/message-bar.d.ts +0 -0
- /package/dist/{dts → esm}/message-bar/message-bar.definition.d.ts +0 -0
- /package/dist/{dts → esm}/message-bar/message-bar.options.d.ts +0 -0
- /package/dist/{dts → esm}/message-bar/message-bar.styles.d.ts +0 -0
- /package/dist/{dts → esm}/message-bar/message-bar.template.d.ts +0 -0
- /package/dist/{dts → esm}/option/define.d.ts +0 -0
- /package/dist/{dts → esm}/option/index.d.ts +0 -0
- /package/dist/{dts → esm}/option/option.d.ts +0 -0
- /package/dist/{dts → esm}/option/option.definition.d.ts +0 -0
- /package/dist/{dts → esm}/option/option.options.d.ts +0 -0
- /package/dist/{dts → esm}/option/option.styles.d.ts +0 -0
- /package/dist/{dts → esm}/option/option.template.d.ts +0 -0
- /package/dist/{dts → esm}/patterns/aria-globals.d.ts +0 -0
- /package/dist/{dts → esm}/patterns/index.d.ts +0 -0
- /package/dist/{dts → esm}/patterns/start-end.d.ts +0 -0
- /package/dist/{dts → esm}/progress-bar/define.d.ts +0 -0
- /package/dist/{dts → esm}/progress-bar/index.d.ts +0 -0
- /package/dist/{dts → esm}/progress-bar/progress-bar.bench.d.ts +0 -0
- /package/dist/{dts → esm}/progress-bar/progress-bar.definition.d.ts +0 -0
- /package/dist/{dts → esm}/progress-bar/progress-bar.options.d.ts +0 -0
- /package/dist/{dts → esm}/progress-bar/progress-bar.styles.d.ts +0 -0
- /package/dist/{dts → esm}/progress-bar/progress-bar.template.d.ts +0 -0
- /package/dist/{dts → esm}/radio/define.d.ts +0 -0
- /package/dist/{dts → esm}/radio/index.d.ts +0 -0
- /package/dist/{dts → esm}/radio/radio.bench.d.ts +0 -0
- /package/dist/{dts → esm}/radio/radio.definition.d.ts +0 -0
- /package/dist/{dts → esm}/radio/radio.options.d.ts +0 -0
- /package/dist/{dts → esm}/radio/radio.styles.d.ts +0 -0
- /package/dist/{dts → esm}/radio/radio.template.d.ts +0 -0
- /package/dist/{dts → esm}/radio-group/define.d.ts +0 -0
- /package/dist/{dts → esm}/radio-group/index.d.ts +0 -0
- /package/dist/{dts → esm}/radio-group/radio-group.bench.d.ts +0 -0
- /package/dist/{dts → esm}/radio-group/radio-group.definition.d.ts +0 -0
- /package/dist/{dts → esm}/radio-group/radio-group.styles.d.ts +0 -0
- /package/dist/{dts → esm}/radio-group/radio-group.template.d.ts +0 -0
- /package/dist/{dts → esm}/rating-display/define.d.ts +0 -0
- /package/dist/{dts → esm}/rating-display/index.d.ts +0 -0
- /package/dist/{dts → esm}/rating-display/rating-display.definition.d.ts +0 -0
- /package/dist/{dts → esm}/rating-display/rating-display.options.d.ts +0 -0
- /package/dist/{dts → esm}/rating-display/rating-display.styles.d.ts +0 -0
- /package/dist/{dts → esm}/slider/define.d.ts +0 -0
- /package/dist/{dts → esm}/slider/index.d.ts +0 -0
- /package/dist/{dts → esm}/slider/slider-utilities.d.ts +0 -0
- /package/dist/{dts → esm}/slider/slider.bench.d.ts +0 -0
- /package/dist/{dts → esm}/slider/slider.d.ts +0 -0
- /package/dist/{dts → esm}/slider/slider.definition.d.ts +0 -0
- /package/dist/{dts → esm}/slider/slider.options.d.ts +0 -0
- /package/dist/{dts → esm}/slider/slider.styles.d.ts +0 -0
- /package/dist/{dts → esm}/slider/slider.template.d.ts +0 -0
- /package/dist/{dts → esm}/spinner/define.d.ts +0 -0
- /package/dist/{dts → esm}/spinner/index.d.ts +0 -0
- /package/dist/{dts → esm}/spinner/spinner.base.d.ts +0 -0
- /package/dist/{dts → esm}/spinner/spinner.bench.d.ts +0 -0
- /package/dist/{dts → esm}/spinner/spinner.d.ts +0 -0
- /package/dist/{dts → esm}/spinner/spinner.definition.d.ts +0 -0
- /package/dist/{dts → esm}/spinner/spinner.options.d.ts +0 -0
- /package/dist/{dts → esm}/spinner/spinner.styles.d.ts +0 -0
- /package/dist/{dts → esm}/spinner/spinner.template.d.ts +0 -0
- /package/dist/{dts → esm}/styles/index.d.ts +0 -0
- /package/dist/{dts → esm}/styles/partials/badge.partials.d.ts +0 -0
- /package/dist/{dts → esm}/styles/partials/index.d.ts +0 -0
- /package/dist/{dts → esm}/styles/partials/typography.partials.d.ts +0 -0
- /package/dist/{dts → esm}/switch/define.d.ts +0 -0
- /package/dist/{dts → esm}/switch/index.d.ts +0 -0
- /package/dist/{dts → esm}/switch/switch.bench.d.ts +0 -0
- /package/dist/{dts → esm}/switch/switch.d.ts +0 -0
- /package/dist/{dts → esm}/switch/switch.definition.d.ts +0 -0
- /package/dist/{dts → esm}/switch/switch.options.d.ts +0 -0
- /package/dist/{dts → esm}/switch/switch.styles.d.ts +0 -0
- /package/dist/{dts → esm}/switch/switch.template.d.ts +0 -0
- /package/dist/{dts → esm}/tab/define.d.ts +0 -0
- /package/dist/{dts → esm}/tab/tab.bench.d.ts +0 -0
- /package/dist/{dts → esm}/tab/tab.d.ts +0 -0
- /package/dist/{dts → esm}/tab/tab.definition.d.ts +0 -0
- /package/dist/{dts → esm}/tab/tab.styles.d.ts +0 -0
- /package/dist/{dts → esm}/tab/tab.template.d.ts +0 -0
- /package/dist/{dts → esm}/tab-panel/define.d.ts +0 -0
- /package/dist/{dts → esm}/tab-panel/index.d.ts +0 -0
- /package/dist/{dts → esm}/tab-panel/tab-panel.bench.d.ts +0 -0
- /package/dist/{dts → esm}/tab-panel/tab-panel.d.ts +0 -0
- /package/dist/{dts → esm}/tab-panel/tab-panel.definition.d.ts +0 -0
- /package/dist/{dts → esm}/tab-panel/tab-panel.styles.d.ts +0 -0
- /package/dist/{dts → esm}/tab-panel/tab-panel.template.d.ts +0 -0
- /package/dist/{dts → esm}/tablist/define.d.ts +0 -0
- /package/dist/{dts → esm}/tablist/index.d.ts +0 -0
- /package/dist/{dts → esm}/tablist/tablist.bench.d.ts +0 -0
- /package/dist/{dts → esm}/tablist/tablist.d.ts +0 -0
- /package/dist/{dts → esm}/tablist/tablist.definition.d.ts +0 -0
- /package/dist/{dts → esm}/tablist/tablist.styles.d.ts +0 -0
- /package/dist/{dts → esm}/tablist/tablist.template.d.ts +0 -0
- /package/dist/{dts → esm}/tabs/define.d.ts +0 -0
- /package/dist/{dts → esm}/tabs/index.d.ts +0 -0
- /package/dist/{dts → esm}/tabs/tabs.base.d.ts +0 -0
- /package/dist/{dts → esm}/tabs/tabs.bench.d.ts +0 -0
- /package/dist/{dts → esm}/tabs/tabs.d.ts +0 -0
- /package/dist/{dts → esm}/tabs/tabs.definition.d.ts +0 -0
- /package/dist/{dts → esm}/tabs/tabs.options.d.ts +0 -0
- /package/dist/{dts → esm}/tabs/tabs.styles.d.ts +0 -0
- /package/dist/{dts → esm}/tabs/tabs.template.d.ts +0 -0
- /package/dist/{dts → esm}/text/define.d.ts +0 -0
- /package/dist/{dts → esm}/text/index.d.ts +0 -0
- /package/dist/{dts → esm}/text/text.bench.d.ts +0 -0
- /package/dist/{dts → esm}/text/text.d.ts +0 -0
- /package/dist/{dts → esm}/text/text.definition.d.ts +0 -0
- /package/dist/{dts → esm}/text/text.options.d.ts +0 -0
- /package/dist/{dts → esm}/text/text.styles.d.ts +0 -0
- /package/dist/{dts → esm}/text/text.template.d.ts +0 -0
- /package/dist/{dts → esm}/text-input/define.d.ts +0 -0
- /package/dist/{dts → esm}/text-input/index.d.ts +0 -0
- /package/dist/{dts → esm}/text-input/text-input.base.d.ts +0 -0
- /package/dist/{dts → esm}/text-input/text-input.bench.d.ts +0 -0
- /package/dist/{dts → esm}/text-input/text-input.d.ts +0 -0
- /package/dist/{dts → esm}/text-input/text-input.definition.d.ts +0 -0
- /package/dist/{dts → esm}/text-input/text-input.options.d.ts +0 -0
- /package/dist/{dts → esm}/text-input/text-input.styles.d.ts +0 -0
- /package/dist/{dts → esm}/text-input/text-input.template.d.ts +0 -0
- /package/dist/{dts → esm}/textarea/define.d.ts +0 -0
- /package/dist/{dts → esm}/textarea/index.d.ts +0 -0
- /package/dist/{dts → esm}/textarea/textarea.bench.d.ts +0 -0
- /package/dist/{dts → esm}/textarea/textarea.d.ts +0 -0
- /package/dist/{dts → esm}/textarea/textarea.definition.d.ts +0 -0
- /package/dist/{dts → esm}/textarea/textarea.options.d.ts +0 -0
- /package/dist/{dts → esm}/textarea/textarea.styles.d.ts +0 -0
- /package/dist/{dts → esm}/textarea/textarea.template.d.ts +0 -0
- /package/dist/{dts → esm}/theme/design-tokens.d.ts +0 -0
- /package/dist/{dts → esm}/theme/index.d.ts +0 -0
- /package/dist/{dts → esm}/theme/set-theme.d.ts +0 -0
- /package/dist/{dts → esm}/theme/set-theme.global.bench.d.ts +0 -0
- /package/dist/{dts → esm}/theme/set-theme.local.bench.d.ts +0 -0
- /package/dist/{dts → esm}/theme/set-theme.shadow.bench.d.ts +0 -0
- /package/dist/{dts → esm}/toggle-button/define.d.ts +0 -0
- /package/dist/{dts → esm}/toggle-button/index.d.ts +0 -0
- /package/dist/{dts → esm}/toggle-button/toggle-button.bench.d.ts +0 -0
- /package/dist/{dts → esm}/toggle-button/toggle-button.d.ts +0 -0
- /package/dist/{dts → esm}/toggle-button/toggle-button.definition.d.ts +0 -0
- /package/dist/{dts → esm}/toggle-button/toggle-button.options.d.ts +0 -0
- /package/dist/{dts → esm}/toggle-button/toggle-button.styles.d.ts +0 -0
- /package/dist/{dts → esm}/toggle-button/toggle-button.template.d.ts +0 -0
- /package/dist/{dts → esm}/tooltip/define.d.ts +0 -0
- /package/dist/{dts → esm}/tooltip/index.d.ts +0 -0
- /package/dist/{dts → esm}/tooltip/tooltip.d.ts +0 -0
- /package/dist/{dts → esm}/tooltip/tooltip.definition.d.ts +0 -0
- /package/dist/{dts → esm}/tooltip/tooltip.options.d.ts +0 -0
- /package/dist/{dts → esm}/tooltip/tooltip.styles.d.ts +0 -0
- /package/dist/{dts → esm}/tooltip/tooltip.template.d.ts +0 -0
- /package/dist/{dts → esm}/tree/define.d.ts +0 -0
- /package/dist/{dts → esm}/tree/index.d.ts +0 -0
- /package/dist/{dts → esm}/tree/tree.bench.d.ts +0 -0
- /package/dist/{dts → esm}/tree/tree.definition.d.ts +0 -0
- /package/dist/{dts → esm}/tree/tree.styles.d.ts +0 -0
- /package/dist/{dts → esm}/tree/tree.template.d.ts +0 -0
- /package/dist/{dts → esm}/tree-item/define.d.ts +0 -0
- /package/dist/{dts → esm}/tree-item/index.d.ts +0 -0
- /package/dist/{dts → esm}/tree-item/tree-item.bench.d.ts +0 -0
- /package/dist/{dts → esm}/tree-item/tree-item.definition.d.ts +0 -0
- /package/dist/{dts → esm}/tree-item/tree-item.options.d.ts +0 -0
- /package/dist/{dts → esm}/tree-item/tree-item.styles.d.ts +0 -0
- /package/dist/{dts → esm}/tree-item/tree-item.template.d.ts +0 -0
- /package/dist/{dts → esm}/utils/apply-mixins.d.ts +0 -0
- /package/dist/{dts → esm}/utils/behaviors/match-media-stylesheet-behavior.d.ts +0 -0
- /package/dist/{dts → esm}/utils/benchmark-dependencies/tokens.d.ts +0 -0
- /package/dist/{dts → esm}/utils/benchmark-wrapper.d.ts +0 -0
- /package/dist/{dts → esm}/utils/converters.d.ts +0 -0
- /package/dist/{dts → esm}/utils/direction.d.ts +0 -0
- /package/dist/{dts → esm}/utils/display.d.ts +0 -0
- /package/dist/{dts → esm}/utils/element-internals.d.ts +0 -0
- /package/dist/{dts → esm}/utils/focusable-element.d.ts +0 -0
- /package/dist/{dts → esm}/utils/get-initials.d.ts +0 -0
- /package/dist/{dts → esm}/utils/index.d.ts +0 -0
- /package/dist/{dts → esm}/utils/root-active-element.d.ts +0 -0
- /package/dist/{dts → esm}/utils/support.d.ts +0 -0
- /package/dist/{dts → esm}/utils/template-helpers.d.ts +0 -0
- /package/dist/{dts → esm}/utils/typings.d.ts +0 -0
- /package/dist/{dts → esm}/utils/unique-id.d.ts +0 -0
- /package/dist/{dts → esm}/utils/whitespace-filter.d.ts +0 -0
package/dist/web-components.js
CHANGED
|
@@ -2438,7 +2438,7 @@ function compileNode(context, parentId, node, nodeIndex) {
|
|
|
2438
2438
|
// comment
|
|
2439
2439
|
const parts = Parser.parse(node.data, context.directives);
|
|
2440
2440
|
if (parts !== null) {
|
|
2441
|
-
context.addFactory(
|
|
2441
|
+
context.addFactory(/* eslint-disable-next-line @typescript-eslint/no-use-before-define */
|
|
2442
2442
|
Compiler.aggregate(parts), parentId, nodeId, nodeIndex, null);
|
|
2443
2443
|
}
|
|
2444
2444
|
break;
|
|
@@ -2872,74 +2872,6 @@ function slotted(propertyOrOptions) {
|
|
|
2872
2872
|
return new SlottedDirective(propertyOrOptions);
|
|
2873
2873
|
}
|
|
2874
2874
|
|
|
2875
|
-
/**
|
|
2876
|
-
* The runtime behavior for child node observation.
|
|
2877
|
-
* @public
|
|
2878
|
-
*/
|
|
2879
|
-
class ChildrenDirective extends NodeObservationDirective {
|
|
2880
|
-
/**
|
|
2881
|
-
* Creates an instance of ChildrenDirective.
|
|
2882
|
-
* @param options - The options to use in configuring the child observation behavior.
|
|
2883
|
-
*/
|
|
2884
|
-
constructor(options) {
|
|
2885
|
-
super(options);
|
|
2886
|
-
this.observerProperty = Symbol();
|
|
2887
|
-
this.handleEvent = (mutations, observer) => {
|
|
2888
|
-
const target = observer.target;
|
|
2889
|
-
this.updateTarget(this.getSource(target), this.computeNodes(target));
|
|
2890
|
-
};
|
|
2891
|
-
options.childList = true;
|
|
2892
|
-
}
|
|
2893
|
-
/**
|
|
2894
|
-
* Begins observation of the nodes.
|
|
2895
|
-
* @param target - The target to observe.
|
|
2896
|
-
*/
|
|
2897
|
-
observe(target) {
|
|
2898
|
-
let observer = target[this.observerProperty];
|
|
2899
|
-
if (!observer) {
|
|
2900
|
-
observer = new MutationObserver(this.handleEvent);
|
|
2901
|
-
observer.toJSON = noop;
|
|
2902
|
-
target[this.observerProperty] = observer;
|
|
2903
|
-
}
|
|
2904
|
-
observer.target = target;
|
|
2905
|
-
observer.observe(target, this.options);
|
|
2906
|
-
}
|
|
2907
|
-
/**
|
|
2908
|
-
* Disconnects observation of the nodes.
|
|
2909
|
-
* @param target - The target to unobserve.
|
|
2910
|
-
*/
|
|
2911
|
-
disconnect(target) {
|
|
2912
|
-
const observer = target[this.observerProperty];
|
|
2913
|
-
observer.target = null;
|
|
2914
|
-
observer.disconnect();
|
|
2915
|
-
}
|
|
2916
|
-
/**
|
|
2917
|
-
* Retrieves the raw nodes that should be assigned to the source property.
|
|
2918
|
-
* @param target - The target to get the node to.
|
|
2919
|
-
*/
|
|
2920
|
-
getNodes(target) {
|
|
2921
|
-
if ("selector" in this.options) {
|
|
2922
|
-
return Array.from(target.querySelectorAll(this.options.selector));
|
|
2923
|
-
}
|
|
2924
|
-
return Array.from(target.childNodes);
|
|
2925
|
-
}
|
|
2926
|
-
}
|
|
2927
|
-
HTMLDirective.define(ChildrenDirective);
|
|
2928
|
-
/**
|
|
2929
|
-
* A directive that observes the `childNodes` of an element and updates a property
|
|
2930
|
-
* whenever they change.
|
|
2931
|
-
* @param propertyOrOptions - The options used to configure child node observation.
|
|
2932
|
-
* @public
|
|
2933
|
-
*/
|
|
2934
|
-
function children(propertyOrOptions) {
|
|
2935
|
-
if (isString(propertyOrOptions)) {
|
|
2936
|
-
propertyOrOptions = {
|
|
2937
|
-
property: propertyOrOptions
|
|
2938
|
-
};
|
|
2939
|
-
}
|
|
2940
|
-
return new ChildrenDirective(propertyOrOptions);
|
|
2941
|
-
}
|
|
2942
|
-
|
|
2943
2875
|
const booleanMode = "boolean";
|
|
2944
2876
|
const reflectMode = "reflect";
|
|
2945
2877
|
/**
|
|
@@ -4011,70 +3943,70 @@ const FASTElement = Object.assign(createFASTElement(HTMLElement), {
|
|
|
4011
3943
|
compose
|
|
4012
3944
|
});
|
|
4013
3945
|
|
|
4014
|
-
var __defProp$
|
|
4015
|
-
var __getOwnPropDesc$
|
|
4016
|
-
var __decorateClass$
|
|
4017
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
3946
|
+
var __defProp$R = Object.defineProperty;
|
|
3947
|
+
var __getOwnPropDesc$R = Object.getOwnPropertyDescriptor;
|
|
3948
|
+
var __decorateClass$R = (decorators, target, key, kind) => {
|
|
3949
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$R(target, key) : target;
|
|
4018
3950
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4019
|
-
if (kind && result) __defProp$
|
|
3951
|
+
if (kind && result) __defProp$R(target, key, result);
|
|
4020
3952
|
return result;
|
|
4021
3953
|
};
|
|
4022
3954
|
class ARIAGlobalStatesAndProperties {}
|
|
4023
|
-
__decorateClass$
|
|
3955
|
+
__decorateClass$R([attr({
|
|
4024
3956
|
attribute: "aria-atomic"
|
|
4025
3957
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", 2);
|
|
4026
|
-
__decorateClass$
|
|
3958
|
+
__decorateClass$R([attr({
|
|
4027
3959
|
attribute: "aria-busy"
|
|
4028
3960
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", 2);
|
|
4029
|
-
__decorateClass$
|
|
3961
|
+
__decorateClass$R([attr({
|
|
4030
3962
|
attribute: "aria-controls"
|
|
4031
3963
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaControls", 2);
|
|
4032
|
-
__decorateClass$
|
|
3964
|
+
__decorateClass$R([attr({
|
|
4033
3965
|
attribute: "aria-current"
|
|
4034
3966
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", 2);
|
|
4035
|
-
__decorateClass$
|
|
3967
|
+
__decorateClass$R([attr({
|
|
4036
3968
|
attribute: "aria-describedby"
|
|
4037
3969
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", 2);
|
|
4038
|
-
__decorateClass$
|
|
3970
|
+
__decorateClass$R([attr({
|
|
4039
3971
|
attribute: "aria-details"
|
|
4040
3972
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", 2);
|
|
4041
|
-
__decorateClass$
|
|
3973
|
+
__decorateClass$R([attr({
|
|
4042
3974
|
attribute: "aria-disabled"
|
|
4043
3975
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", 2);
|
|
4044
|
-
__decorateClass$
|
|
3976
|
+
__decorateClass$R([attr({
|
|
4045
3977
|
attribute: "aria-errormessage"
|
|
4046
3978
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", 2);
|
|
4047
|
-
__decorateClass$
|
|
3979
|
+
__decorateClass$R([attr({
|
|
4048
3980
|
attribute: "aria-flowto"
|
|
4049
3981
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", 2);
|
|
4050
|
-
__decorateClass$
|
|
3982
|
+
__decorateClass$R([attr({
|
|
4051
3983
|
attribute: "aria-haspopup"
|
|
4052
3984
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", 2);
|
|
4053
|
-
__decorateClass$
|
|
3985
|
+
__decorateClass$R([attr({
|
|
4054
3986
|
attribute: "aria-hidden"
|
|
4055
3987
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", 2);
|
|
4056
|
-
__decorateClass$
|
|
3988
|
+
__decorateClass$R([attr({
|
|
4057
3989
|
attribute: "aria-invalid"
|
|
4058
3990
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", 2);
|
|
4059
|
-
__decorateClass$
|
|
3991
|
+
__decorateClass$R([attr({
|
|
4060
3992
|
attribute: "aria-keyshortcuts"
|
|
4061
3993
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", 2);
|
|
4062
|
-
__decorateClass$
|
|
3994
|
+
__decorateClass$R([attr({
|
|
4063
3995
|
attribute: "aria-label"
|
|
4064
3996
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", 2);
|
|
4065
|
-
__decorateClass$
|
|
3997
|
+
__decorateClass$R([attr({
|
|
4066
3998
|
attribute: "aria-labelledby"
|
|
4067
3999
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", 2);
|
|
4068
|
-
__decorateClass$
|
|
4000
|
+
__decorateClass$R([attr({
|
|
4069
4001
|
attribute: "aria-live"
|
|
4070
4002
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaLive", 2);
|
|
4071
|
-
__decorateClass$
|
|
4003
|
+
__decorateClass$R([attr({
|
|
4072
4004
|
attribute: "aria-owns"
|
|
4073
4005
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", 2);
|
|
4074
|
-
__decorateClass$
|
|
4006
|
+
__decorateClass$R([attr({
|
|
4075
4007
|
attribute: "aria-relevant"
|
|
4076
4008
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", 2);
|
|
4077
|
-
__decorateClass$
|
|
4009
|
+
__decorateClass$R([attr({
|
|
4078
4010
|
attribute: "aria-roledescription"
|
|
4079
4011
|
})], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", 2);
|
|
4080
4012
|
|
|
@@ -4341,12 +4273,12 @@ function applyMixins(derivedCtor, ...baseCtors) {
|
|
|
4341
4273
|
});
|
|
4342
4274
|
}
|
|
4343
4275
|
|
|
4344
|
-
var __defProp$
|
|
4345
|
-
var __getOwnPropDesc$
|
|
4346
|
-
var __decorateClass$
|
|
4347
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4276
|
+
var __defProp$Q = Object.defineProperty;
|
|
4277
|
+
var __getOwnPropDesc$Q = Object.getOwnPropertyDescriptor;
|
|
4278
|
+
var __decorateClass$Q = (decorators, target, key, kind) => {
|
|
4279
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$Q(target, key) : target;
|
|
4348
4280
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4349
|
-
if (kind && result) __defProp$
|
|
4281
|
+
if (kind && result) __defProp$Q(target, key, result);
|
|
4350
4282
|
return result;
|
|
4351
4283
|
};
|
|
4352
4284
|
class BaseAccordionItem extends FASTElement {
|
|
@@ -4364,25 +4296,25 @@ class BaseAccordionItem extends FASTElement {
|
|
|
4364
4296
|
this.id = uniqueId$1("accordion-");
|
|
4365
4297
|
}
|
|
4366
4298
|
}
|
|
4367
|
-
__decorateClass$
|
|
4299
|
+
__decorateClass$Q([attr({
|
|
4368
4300
|
attribute: "heading-level",
|
|
4369
4301
|
mode: "fromView",
|
|
4370
4302
|
converter: nullableNumberConverter
|
|
4371
4303
|
})], BaseAccordionItem.prototype, "headinglevel", 2);
|
|
4372
|
-
__decorateClass$
|
|
4304
|
+
__decorateClass$Q([attr({
|
|
4373
4305
|
mode: "boolean"
|
|
4374
4306
|
})], BaseAccordionItem.prototype, "expanded", 2);
|
|
4375
|
-
__decorateClass$
|
|
4307
|
+
__decorateClass$Q([attr({
|
|
4376
4308
|
mode: "boolean"
|
|
4377
4309
|
})], BaseAccordionItem.prototype, "disabled", 2);
|
|
4378
|
-
__decorateClass$
|
|
4310
|
+
__decorateClass$Q([attr], BaseAccordionItem.prototype, "id", 2);
|
|
4379
4311
|
|
|
4380
|
-
var __defProp$
|
|
4381
|
-
var __getOwnPropDesc$
|
|
4382
|
-
var __decorateClass$
|
|
4383
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4312
|
+
var __defProp$P = Object.defineProperty;
|
|
4313
|
+
var __getOwnPropDesc$P = Object.getOwnPropertyDescriptor;
|
|
4314
|
+
var __decorateClass$P = (decorators, target, key, kind) => {
|
|
4315
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$P(target, key) : target;
|
|
4384
4316
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4385
|
-
if (kind && result) __defProp$
|
|
4317
|
+
if (kind && result) __defProp$P(target, key, result);
|
|
4386
4318
|
return result;
|
|
4387
4319
|
};
|
|
4388
4320
|
class AccordionItem extends BaseAccordionItem {
|
|
@@ -4391,11 +4323,11 @@ class AccordionItem extends BaseAccordionItem {
|
|
|
4391
4323
|
this.block = false;
|
|
4392
4324
|
}
|
|
4393
4325
|
}
|
|
4394
|
-
__decorateClass$
|
|
4395
|
-
__decorateClass$
|
|
4326
|
+
__decorateClass$P([attr], AccordionItem.prototype, "size", 2);
|
|
4327
|
+
__decorateClass$P([attr({
|
|
4396
4328
|
attribute: "marker-position"
|
|
4397
4329
|
})], AccordionItem.prototype, "markerPosition", 2);
|
|
4398
|
-
__decorateClass$
|
|
4330
|
+
__decorateClass$P([attr({
|
|
4399
4331
|
mode: "boolean"
|
|
4400
4332
|
})], AccordionItem.prototype, "block", 2);
|
|
4401
4333
|
applyMixins(AccordionItem, StartEnd);
|
|
@@ -4509,7 +4441,7 @@ const colorPaletteYellowBackground3 = "var(--colorPaletteYellowBackground3)";
|
|
|
4509
4441
|
const colorPaletteYellowBorder1 = "var(--colorPaletteYellowBorder1)";
|
|
4510
4442
|
const colorPaletteYellowForeground2 = "var(--colorPaletteYellowForeground2)";
|
|
4511
4443
|
const colorPaletteMarigoldBackground2 = "var(--colorPaletteMarigoldBackground2)";
|
|
4512
|
-
const
|
|
4444
|
+
const colorPaletteMarigoldBorderActive = "var(--colorPaletteMarigoldBorderActive)";
|
|
4513
4445
|
const colorPaletteMarigoldForeground2 = "var(--colorPaletteMarigoldForeground2)";
|
|
4514
4446
|
const colorPaletteAnchorBackground2 = "var(--colorPaletteAnchorBackground2)";
|
|
4515
4447
|
const colorPaletteAnchorForeground2 = "var(--colorPaletteAnchorForeground2)";
|
|
@@ -4700,12 +4632,12 @@ const AccordionExpandMode = {
|
|
|
4700
4632
|
multi: "multi"
|
|
4701
4633
|
};
|
|
4702
4634
|
|
|
4703
|
-
var __defProp$
|
|
4704
|
-
var __getOwnPropDesc$
|
|
4705
|
-
var __decorateClass$
|
|
4706
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4635
|
+
var __defProp$O = Object.defineProperty;
|
|
4636
|
+
var __getOwnPropDesc$O = Object.getOwnPropertyDescriptor;
|
|
4637
|
+
var __decorateClass$O = (decorators, target, key, kind) => {
|
|
4638
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$O(target, key) : target;
|
|
4707
4639
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4708
|
-
if (kind && result) __defProp$
|
|
4640
|
+
if (kind && result) __defProp$O(target, key, result);
|
|
4709
4641
|
return result;
|
|
4710
4642
|
};
|
|
4711
4643
|
class Accordion extends FASTElement {
|
|
@@ -4727,10 +4659,8 @@ class Accordion extends FASTElement {
|
|
|
4727
4659
|
children.forEach(child => Observable.getNotifier(child).subscribe(this, "disabled"));
|
|
4728
4660
|
this.accordionItems = children.filter(child => !child.hasAttribute("disabled"));
|
|
4729
4661
|
this.accordionItems.forEach((item, index) => {
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
Observable.getNotifier(item).subscribe(this, "expanded");
|
|
4733
|
-
}
|
|
4662
|
+
item.addEventListener("click", this.expandedChangedHandler);
|
|
4663
|
+
Observable.getNotifier(item).subscribe(this, "expanded");
|
|
4734
4664
|
});
|
|
4735
4665
|
if (this.isSingleExpandMode()) {
|
|
4736
4666
|
const expandedItem = this.findExpandedItem();
|
|
@@ -4844,10 +4774,10 @@ class Accordion extends FASTElement {
|
|
|
4844
4774
|
});
|
|
4845
4775
|
}
|
|
4846
4776
|
}
|
|
4847
|
-
__decorateClass$
|
|
4777
|
+
__decorateClass$O([attr({
|
|
4848
4778
|
attribute: "expand-mode"
|
|
4849
4779
|
})], Accordion.prototype, "expandmode", 2);
|
|
4850
|
-
__decorateClass$
|
|
4780
|
+
__decorateClass$O([observable], Accordion.prototype, "slottedAccordionItems", 2);
|
|
4851
4781
|
|
|
4852
4782
|
const styles$F = css`
|
|
4853
4783
|
${display("flex")}
|
|
@@ -4943,12 +4873,12 @@ const AnchorAttributes = {
|
|
|
4943
4873
|
type: "type"
|
|
4944
4874
|
};
|
|
4945
4875
|
|
|
4946
|
-
var __defProp$
|
|
4947
|
-
var __getOwnPropDesc$
|
|
4948
|
-
var __decorateClass$
|
|
4949
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4876
|
+
var __defProp$N = Object.defineProperty;
|
|
4877
|
+
var __getOwnPropDesc$N = Object.getOwnPropertyDescriptor;
|
|
4878
|
+
var __decorateClass$N = (decorators, target, key, kind) => {
|
|
4879
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$N(target, key) : target;
|
|
4950
4880
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4951
|
-
if (kind && result) __defProp$
|
|
4881
|
+
if (kind && result) __defProp$N(target, key, result);
|
|
4952
4882
|
return result;
|
|
4953
4883
|
};
|
|
4954
4884
|
class BaseAnchor extends FASTElement {
|
|
@@ -5056,21 +4986,21 @@ class BaseAnchor extends FASTElement {
|
|
|
5056
4986
|
return proxy;
|
|
5057
4987
|
}
|
|
5058
4988
|
}
|
|
5059
|
-
__decorateClass$
|
|
5060
|
-
__decorateClass$
|
|
5061
|
-
__decorateClass$
|
|
5062
|
-
__decorateClass$
|
|
5063
|
-
__decorateClass$
|
|
5064
|
-
__decorateClass$
|
|
5065
|
-
__decorateClass$
|
|
5066
|
-
__decorateClass$
|
|
4989
|
+
__decorateClass$N([attr], BaseAnchor.prototype, "download", 2);
|
|
4990
|
+
__decorateClass$N([attr], BaseAnchor.prototype, "href", 2);
|
|
4991
|
+
__decorateClass$N([attr], BaseAnchor.prototype, "hreflang", 2);
|
|
4992
|
+
__decorateClass$N([attr], BaseAnchor.prototype, "ping", 2);
|
|
4993
|
+
__decorateClass$N([attr], BaseAnchor.prototype, "referrerpolicy", 2);
|
|
4994
|
+
__decorateClass$N([attr], BaseAnchor.prototype, "rel", 2);
|
|
4995
|
+
__decorateClass$N([attr], BaseAnchor.prototype, "target", 2);
|
|
4996
|
+
__decorateClass$N([attr], BaseAnchor.prototype, "type", 2);
|
|
5067
4997
|
|
|
5068
|
-
var __defProp$
|
|
5069
|
-
var __getOwnPropDesc$
|
|
5070
|
-
var __decorateClass$
|
|
5071
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4998
|
+
var __defProp$M = Object.defineProperty;
|
|
4999
|
+
var __getOwnPropDesc$M = Object.getOwnPropertyDescriptor;
|
|
5000
|
+
var __decorateClass$M = (decorators, target, key, kind) => {
|
|
5001
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$M(target, key) : target;
|
|
5072
5002
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5073
|
-
if (kind && result) __defProp$
|
|
5003
|
+
if (kind && result) __defProp$M(target, key, result);
|
|
5074
5004
|
return result;
|
|
5075
5005
|
};
|
|
5076
5006
|
class AnchorButton extends BaseAnchor {
|
|
@@ -5111,10 +5041,10 @@ class AnchorButton extends BaseAnchor {
|
|
|
5111
5041
|
toggleState(this.elementInternals, "icon", !!next);
|
|
5112
5042
|
}
|
|
5113
5043
|
}
|
|
5114
|
-
__decorateClass$
|
|
5115
|
-
__decorateClass$
|
|
5116
|
-
__decorateClass$
|
|
5117
|
-
__decorateClass$
|
|
5044
|
+
__decorateClass$M([attr], AnchorButton.prototype, "appearance", 2);
|
|
5045
|
+
__decorateClass$M([attr], AnchorButton.prototype, "shape", 2);
|
|
5046
|
+
__decorateClass$M([attr], AnchorButton.prototype, "size", 2);
|
|
5047
|
+
__decorateClass$M([attr({
|
|
5118
5048
|
attribute: "icon-only",
|
|
5119
5049
|
mode: "boolean"
|
|
5120
5050
|
})], AnchorButton.prototype, "iconOnly", 2);
|
|
@@ -5190,12 +5120,12 @@ function getInitials(displayName, isRtl, options) {
|
|
|
5190
5120
|
return getInitialsLatin(displayName, isRtl, options?.firstInitialOnly);
|
|
5191
5121
|
}
|
|
5192
5122
|
|
|
5193
|
-
var __defProp$
|
|
5194
|
-
var __getOwnPropDesc$
|
|
5195
|
-
var __decorateClass$
|
|
5196
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5123
|
+
var __defProp$L = Object.defineProperty;
|
|
5124
|
+
var __getOwnPropDesc$L = Object.getOwnPropertyDescriptor;
|
|
5125
|
+
var __decorateClass$L = (decorators, target, key, kind) => {
|
|
5126
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$L(target, key) : target;
|
|
5197
5127
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5198
|
-
if (kind && result) __defProp$
|
|
5128
|
+
if (kind && result) __defProp$L(target, key, result);
|
|
5199
5129
|
return result;
|
|
5200
5130
|
};
|
|
5201
5131
|
class BaseAvatar extends FASTElement {
|
|
@@ -5210,8 +5140,8 @@ class BaseAvatar extends FASTElement {
|
|
|
5210
5140
|
this.elementInternals.role = "img";
|
|
5211
5141
|
}
|
|
5212
5142
|
}
|
|
5213
|
-
__decorateClass$
|
|
5214
|
-
__decorateClass$
|
|
5143
|
+
__decorateClass$L([attr], BaseAvatar.prototype, "name", 2);
|
|
5144
|
+
__decorateClass$L([attr], BaseAvatar.prototype, "initials", 2);
|
|
5215
5145
|
|
|
5216
5146
|
const AvatarNamedColor = {
|
|
5217
5147
|
darkRed: "dark-red",
|
|
@@ -5252,12 +5182,12 @@ const AvatarColor = {
|
|
|
5252
5182
|
...AvatarNamedColor
|
|
5253
5183
|
};
|
|
5254
5184
|
|
|
5255
|
-
var __defProp$
|
|
5256
|
-
var __getOwnPropDesc$
|
|
5257
|
-
var __decorateClass$
|
|
5258
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5185
|
+
var __defProp$K = Object.defineProperty;
|
|
5186
|
+
var __getOwnPropDesc$K = Object.getOwnPropertyDescriptor;
|
|
5187
|
+
var __decorateClass$K = (decorators, target, key, kind) => {
|
|
5188
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$K(target, key) : target;
|
|
5259
5189
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5260
|
-
if (kind && result) __defProp$
|
|
5190
|
+
if (kind && result) __defProp$K(target, key, result);
|
|
5261
5191
|
return result;
|
|
5262
5192
|
};
|
|
5263
5193
|
const _Avatar = class _Avatar extends BaseAvatar {
|
|
@@ -5312,14 +5242,14 @@ const _Avatar = class _Avatar extends BaseAvatar {
|
|
|
5312
5242
|
* An array of the available Avatar named colors
|
|
5313
5243
|
*/
|
|
5314
5244
|
_Avatar.colors = Object.values(AvatarNamedColor);
|
|
5315
|
-
__decorateClass$
|
|
5316
|
-
__decorateClass$
|
|
5317
|
-
__decorateClass$
|
|
5318
|
-
__decorateClass$
|
|
5245
|
+
__decorateClass$K([attr], _Avatar.prototype, "active", 2);
|
|
5246
|
+
__decorateClass$K([attr], _Avatar.prototype, "shape", 2);
|
|
5247
|
+
__decorateClass$K([attr], _Avatar.prototype, "appearance", 2);
|
|
5248
|
+
__decorateClass$K([attr({
|
|
5319
5249
|
converter: nullableNumberConverter
|
|
5320
5250
|
})], _Avatar.prototype, "size", 2);
|
|
5321
|
-
__decorateClass$
|
|
5322
|
-
__decorateClass$
|
|
5251
|
+
__decorateClass$K([attr], _Avatar.prototype, "color", 2);
|
|
5252
|
+
__decorateClass$K([attr({
|
|
5323
5253
|
attribute: "color-id"
|
|
5324
5254
|
})], _Avatar.prototype, "colorId", 2);
|
|
5325
5255
|
let Avatar = _Avatar;
|
|
@@ -5378,12 +5308,12 @@ const BadgeColor = {
|
|
|
5378
5308
|
warning: "warning"
|
|
5379
5309
|
};
|
|
5380
5310
|
|
|
5381
|
-
var __defProp$
|
|
5382
|
-
var __getOwnPropDesc$
|
|
5383
|
-
var __decorateClass$
|
|
5384
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5311
|
+
var __defProp$J = Object.defineProperty;
|
|
5312
|
+
var __getOwnPropDesc$J = Object.getOwnPropertyDescriptor;
|
|
5313
|
+
var __decorateClass$J = (decorators, target, key, kind) => {
|
|
5314
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$J(target, key) : target;
|
|
5385
5315
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5386
|
-
if (kind && result) __defProp$
|
|
5316
|
+
if (kind && result) __defProp$J(target, key, result);
|
|
5387
5317
|
return result;
|
|
5388
5318
|
};
|
|
5389
5319
|
class Badge extends FASTElement {
|
|
@@ -5393,10 +5323,10 @@ class Badge extends FASTElement {
|
|
|
5393
5323
|
this.color = BadgeColor.brand;
|
|
5394
5324
|
}
|
|
5395
5325
|
}
|
|
5396
|
-
__decorateClass$
|
|
5397
|
-
__decorateClass$
|
|
5398
|
-
__decorateClass$
|
|
5399
|
-
__decorateClass$
|
|
5326
|
+
__decorateClass$J([attr], Badge.prototype, "appearance", 2);
|
|
5327
|
+
__decorateClass$J([attr], Badge.prototype, "color", 2);
|
|
5328
|
+
__decorateClass$J([attr], Badge.prototype, "shape", 2);
|
|
5329
|
+
__decorateClass$J([attr], Badge.prototype, "size", 2);
|
|
5400
5330
|
applyMixins(Badge, StartEnd);
|
|
5401
5331
|
|
|
5402
5332
|
const badgeBaseStyles = css.partial`
|
|
@@ -5773,19 +5703,19 @@ const definition$D = Badge.compose({
|
|
|
5773
5703
|
|
|
5774
5704
|
definition$D.define(FluentDesignSystem.registry);
|
|
5775
5705
|
|
|
5776
|
-
var __defProp$
|
|
5777
|
-
var __getOwnPropDesc$
|
|
5778
|
-
var __decorateClass$
|
|
5779
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5706
|
+
var __defProp$I = Object.defineProperty;
|
|
5707
|
+
var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
|
|
5708
|
+
var __decorateClass$I = (decorators, target, key, kind) => {
|
|
5709
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target;
|
|
5780
5710
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5781
|
-
if (kind && result) __defProp$
|
|
5711
|
+
if (kind && result) __defProp$I(target, key, result);
|
|
5782
5712
|
return result;
|
|
5783
5713
|
};
|
|
5784
5714
|
class BaseButton extends FASTElement {
|
|
5785
5715
|
constructor() {
|
|
5786
5716
|
super();
|
|
5717
|
+
this.disabled = false;
|
|
5787
5718
|
this.disabledFocusable = false;
|
|
5788
|
-
this.tabIndex = 0;
|
|
5789
5719
|
/**
|
|
5790
5720
|
* The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
5791
5721
|
*
|
|
@@ -5794,6 +5724,16 @@ class BaseButton extends FASTElement {
|
|
|
5794
5724
|
this.elementInternals = this.attachInternals();
|
|
5795
5725
|
this.elementInternals.role = "button";
|
|
5796
5726
|
}
|
|
5727
|
+
disabledChanged() {
|
|
5728
|
+
if (!this.$fastController.isConnected) {
|
|
5729
|
+
return;
|
|
5730
|
+
}
|
|
5731
|
+
if (this.disabled) {
|
|
5732
|
+
this.removeAttribute("tabindex");
|
|
5733
|
+
} else {
|
|
5734
|
+
this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
|
|
5735
|
+
}
|
|
5736
|
+
}
|
|
5797
5737
|
/**
|
|
5798
5738
|
* Sets the element's internal disabled state when the element is focusable while disabled.
|
|
5799
5739
|
*
|
|
@@ -5852,6 +5792,7 @@ class BaseButton extends FASTElement {
|
|
|
5852
5792
|
connectedCallback() {
|
|
5853
5793
|
super.connectedCallback();
|
|
5854
5794
|
this.elementInternals.ariaDisabled = `${!!this.disabledFocusable}`;
|
|
5795
|
+
this.disabledChanged();
|
|
5855
5796
|
}
|
|
5856
5797
|
/**
|
|
5857
5798
|
* This fallback creates a new slot, then creates a submit button to mirror the custom element's
|
|
@@ -5961,7 +5902,7 @@ class BaseButton extends FASTElement {
|
|
|
5961
5902
|
if (!this.elementInternals.form || this.disabled || this.type !== ButtonType.submit) {
|
|
5962
5903
|
return;
|
|
5963
5904
|
}
|
|
5964
|
-
if (!this.name && !this.formAction && !this.formEnctype && !this.
|
|
5905
|
+
if (!this.name && !this.formAction && !this.formEnctype && !this.formAttribute && !this.formMethod && !this.formNoValidate && !this.formTarget) {
|
|
5965
5906
|
this.elementInternals.form.requestSubmit();
|
|
5966
5907
|
return;
|
|
5967
5908
|
}
|
|
@@ -5982,51 +5923,46 @@ class BaseButton extends FASTElement {
|
|
|
5982
5923
|
* @public
|
|
5983
5924
|
*/
|
|
5984
5925
|
BaseButton.formAssociated = true;
|
|
5985
|
-
__decorateClass$
|
|
5926
|
+
__decorateClass$I([attr({
|
|
5986
5927
|
mode: "boolean"
|
|
5987
5928
|
})], BaseButton.prototype, "autofocus", 2);
|
|
5988
|
-
__decorateClass$
|
|
5989
|
-
__decorateClass$
|
|
5929
|
+
__decorateClass$I([observable], BaseButton.prototype, "defaultSlottedContent", 2);
|
|
5930
|
+
__decorateClass$I([attr({
|
|
5990
5931
|
mode: "boolean"
|
|
5991
5932
|
})], BaseButton.prototype, "disabled", 2);
|
|
5992
|
-
__decorateClass$
|
|
5933
|
+
__decorateClass$I([attr({
|
|
5993
5934
|
attribute: "disabled-focusable",
|
|
5994
5935
|
mode: "boolean"
|
|
5995
5936
|
})], BaseButton.prototype, "disabledFocusable", 2);
|
|
5996
|
-
__decorateClass$
|
|
5997
|
-
attribute: "tabindex",
|
|
5998
|
-
mode: "fromView",
|
|
5999
|
-
converter: nullableNumberConverter
|
|
6000
|
-
})], BaseButton.prototype, "tabIndex", 2);
|
|
6001
|
-
__decorateClass$J([attr({
|
|
5937
|
+
__decorateClass$I([attr({
|
|
6002
5938
|
attribute: "formaction"
|
|
6003
5939
|
})], BaseButton.prototype, "formAction", 2);
|
|
6004
|
-
__decorateClass$
|
|
5940
|
+
__decorateClass$I([attr({
|
|
6005
5941
|
attribute: "form"
|
|
6006
5942
|
})], BaseButton.prototype, "formAttribute", 2);
|
|
6007
|
-
__decorateClass$
|
|
5943
|
+
__decorateClass$I([attr({
|
|
6008
5944
|
attribute: "formenctype"
|
|
6009
5945
|
})], BaseButton.prototype, "formEnctype", 2);
|
|
6010
|
-
__decorateClass$
|
|
5946
|
+
__decorateClass$I([attr({
|
|
6011
5947
|
attribute: "formmethod"
|
|
6012
5948
|
})], BaseButton.prototype, "formMethod", 2);
|
|
6013
|
-
__decorateClass$
|
|
5949
|
+
__decorateClass$I([attr({
|
|
6014
5950
|
attribute: "formnovalidate",
|
|
6015
5951
|
mode: "boolean"
|
|
6016
5952
|
})], BaseButton.prototype, "formNoValidate", 2);
|
|
6017
|
-
__decorateClass$
|
|
5953
|
+
__decorateClass$I([attr({
|
|
6018
5954
|
attribute: "formtarget"
|
|
6019
5955
|
})], BaseButton.prototype, "formTarget", 2);
|
|
6020
|
-
__decorateClass$
|
|
6021
|
-
__decorateClass$
|
|
6022
|
-
__decorateClass$
|
|
5956
|
+
__decorateClass$I([attr], BaseButton.prototype, "name", 2);
|
|
5957
|
+
__decorateClass$I([attr], BaseButton.prototype, "type", 2);
|
|
5958
|
+
__decorateClass$I([attr], BaseButton.prototype, "value", 2);
|
|
6023
5959
|
|
|
6024
|
-
var __defProp$
|
|
6025
|
-
var __getOwnPropDesc$
|
|
6026
|
-
var __decorateClass$
|
|
6027
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5960
|
+
var __defProp$H = Object.defineProperty;
|
|
5961
|
+
var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
|
|
5962
|
+
var __decorateClass$H = (decorators, target, key, kind) => {
|
|
5963
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target;
|
|
6028
5964
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6029
|
-
if (kind && result) __defProp$
|
|
5965
|
+
if (kind && result) __defProp$H(target, key, result);
|
|
6030
5966
|
return result;
|
|
6031
5967
|
};
|
|
6032
5968
|
class Button extends BaseButton {
|
|
@@ -6035,17 +5971,17 @@ class Button extends BaseButton {
|
|
|
6035
5971
|
this.iconOnly = false;
|
|
6036
5972
|
}
|
|
6037
5973
|
}
|
|
6038
|
-
__decorateClass$
|
|
6039
|
-
__decorateClass$
|
|
6040
|
-
__decorateClass$
|
|
6041
|
-
__decorateClass$
|
|
5974
|
+
__decorateClass$H([attr], Button.prototype, "appearance", 2);
|
|
5975
|
+
__decorateClass$H([attr], Button.prototype, "shape", 2);
|
|
5976
|
+
__decorateClass$H([attr], Button.prototype, "size", 2);
|
|
5977
|
+
__decorateClass$H([attr({
|
|
6042
5978
|
attribute: "icon-only",
|
|
6043
5979
|
mode: "boolean"
|
|
6044
5980
|
})], Button.prototype, "iconOnly", 2);
|
|
6045
5981
|
applyMixins(Button, StartEnd);
|
|
6046
5982
|
|
|
6047
5983
|
function buttonTemplate$1(options = {}) {
|
|
6048
|
-
return html`<template
|
|
5984
|
+
return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @keypress="${(x, c) => x.keypressHandler(c.event)}">${startSlotTemplate(options)}<span class="content" part="content"><slot ${slotted("defaultSlottedContent")}></slot></span>${endSlotTemplate(options)}</template>`;
|
|
6049
5985
|
}
|
|
6050
5986
|
const template$C = buttonTemplate$1();
|
|
6051
5987
|
|
|
@@ -6057,18 +5993,26 @@ const definition$C = Button.compose({
|
|
|
6057
5993
|
|
|
6058
5994
|
definition$C.define(FluentDesignSystem.registry);
|
|
6059
5995
|
|
|
6060
|
-
var __defProp$
|
|
6061
|
-
var __getOwnPropDesc$
|
|
6062
|
-
var __decorateClass$
|
|
6063
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
5996
|
+
var __defProp$G = Object.defineProperty;
|
|
5997
|
+
var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor;
|
|
5998
|
+
var __decorateClass$G = (decorators, target, key, kind) => {
|
|
5999
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target;
|
|
6064
6000
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6065
|
-
if (kind && result) __defProp$
|
|
6001
|
+
if (kind && result) __defProp$G(target, key, result);
|
|
6066
6002
|
return result;
|
|
6067
6003
|
};
|
|
6068
6004
|
class BaseCheckbox extends FASTElement {
|
|
6069
6005
|
constructor() {
|
|
6070
6006
|
super(...arguments);
|
|
6071
6007
|
this.initialValue = "on";
|
|
6008
|
+
/**
|
|
6009
|
+
* Tracks whether the space key was pressed down while the checkbox was focused.
|
|
6010
|
+
* This is used to prevent inadvertently checking a required, unchecked checkbox when the space key is pressed on a
|
|
6011
|
+
* submit button and field validation is triggered.
|
|
6012
|
+
*
|
|
6013
|
+
* @internal
|
|
6014
|
+
*/
|
|
6015
|
+
this._keydownPressed = false;
|
|
6072
6016
|
/**
|
|
6073
6017
|
* Indicates that the checked state has been changed by the user.
|
|
6074
6018
|
*
|
|
@@ -6117,6 +6061,11 @@ class BaseCheckbox extends FASTElement {
|
|
|
6117
6061
|
* @internal
|
|
6118
6062
|
*/
|
|
6119
6063
|
disabledChanged(prev, next) {
|
|
6064
|
+
if (this.disabled) {
|
|
6065
|
+
this.removeAttribute("tabindex");
|
|
6066
|
+
} else {
|
|
6067
|
+
this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
|
|
6068
|
+
}
|
|
6120
6069
|
this.elementInternals.ariaDisabled = this.disabled ? "true" : "false";
|
|
6121
6070
|
toggleState(this.elementInternals, "disabled", this.disabled);
|
|
6122
6071
|
}
|
|
@@ -6272,6 +6221,7 @@ class BaseCheckbox extends FASTElement {
|
|
|
6272
6221
|
}
|
|
6273
6222
|
connectedCallback() {
|
|
6274
6223
|
super.connectedCallback();
|
|
6224
|
+
this.disabled = !!this.disabledAttribute;
|
|
6275
6225
|
this.setAriaChecked();
|
|
6276
6226
|
this.setValidity();
|
|
6277
6227
|
}
|
|
@@ -6287,7 +6237,8 @@ class BaseCheckbox extends FASTElement {
|
|
|
6287
6237
|
return true;
|
|
6288
6238
|
}
|
|
6289
6239
|
/**
|
|
6290
|
-
* Prevents scrolling when the user presses the space key
|
|
6240
|
+
* Prevents scrolling when the user presses the space key, and sets a flag to indicate that the space key was pressed
|
|
6241
|
+
* down while the checkbox was focused.
|
|
6291
6242
|
*
|
|
6292
6243
|
* @param e - the event object
|
|
6293
6244
|
* @internal
|
|
@@ -6296,6 +6247,7 @@ class BaseCheckbox extends FASTElement {
|
|
|
6296
6247
|
if (e.key !== " ") {
|
|
6297
6248
|
return true;
|
|
6298
6249
|
}
|
|
6250
|
+
this._keydownPressed = true;
|
|
6299
6251
|
}
|
|
6300
6252
|
/**
|
|
6301
6253
|
* Toggles the checked state when the user releases the space key.
|
|
@@ -6304,9 +6256,10 @@ class BaseCheckbox extends FASTElement {
|
|
|
6304
6256
|
* @internal
|
|
6305
6257
|
*/
|
|
6306
6258
|
keyupHandler(e) {
|
|
6307
|
-
if (e.key !== " ") {
|
|
6259
|
+
if (!this._keydownPressed || e.key !== " ") {
|
|
6308
6260
|
return true;
|
|
6309
6261
|
}
|
|
6262
|
+
this._keydownPressed = false;
|
|
6310
6263
|
this.click();
|
|
6311
6264
|
}
|
|
6312
6265
|
/**
|
|
@@ -6396,36 +6349,36 @@ class BaseCheckbox extends FASTElement {
|
|
|
6396
6349
|
* @public
|
|
6397
6350
|
*/
|
|
6398
6351
|
BaseCheckbox.formAssociated = true;
|
|
6399
|
-
__decorateClass$
|
|
6352
|
+
__decorateClass$G([attr({
|
|
6400
6353
|
mode: "boolean"
|
|
6401
6354
|
})], BaseCheckbox.prototype, "autofocus", 2);
|
|
6402
|
-
__decorateClass$
|
|
6403
|
-
__decorateClass$
|
|
6355
|
+
__decorateClass$G([observable], BaseCheckbox.prototype, "disabled", 2);
|
|
6356
|
+
__decorateClass$G([attr({
|
|
6404
6357
|
attribute: "disabled",
|
|
6405
6358
|
mode: "boolean"
|
|
6406
6359
|
})], BaseCheckbox.prototype, "disabledAttribute", 2);
|
|
6407
|
-
__decorateClass$
|
|
6360
|
+
__decorateClass$G([attr({
|
|
6408
6361
|
attribute: "form"
|
|
6409
6362
|
})], BaseCheckbox.prototype, "formAttribute", 2);
|
|
6410
|
-
__decorateClass$
|
|
6363
|
+
__decorateClass$G([attr({
|
|
6411
6364
|
attribute: "checked",
|
|
6412
6365
|
mode: "boolean"
|
|
6413
6366
|
})], BaseCheckbox.prototype, "initialChecked", 2);
|
|
6414
|
-
__decorateClass$
|
|
6367
|
+
__decorateClass$G([attr({
|
|
6415
6368
|
attribute: "value",
|
|
6416
6369
|
mode: "fromView"
|
|
6417
6370
|
})], BaseCheckbox.prototype, "initialValue", 2);
|
|
6418
|
-
__decorateClass$
|
|
6419
|
-
__decorateClass$
|
|
6371
|
+
__decorateClass$G([attr], BaseCheckbox.prototype, "name", 2);
|
|
6372
|
+
__decorateClass$G([attr({
|
|
6420
6373
|
mode: "boolean"
|
|
6421
6374
|
})], BaseCheckbox.prototype, "required", 2);
|
|
6422
6375
|
|
|
6423
|
-
var __defProp$
|
|
6424
|
-
var __getOwnPropDesc$
|
|
6425
|
-
var __decorateClass$
|
|
6426
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6376
|
+
var __defProp$F = Object.defineProperty;
|
|
6377
|
+
var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor;
|
|
6378
|
+
var __decorateClass$F = (decorators, target, key, kind) => {
|
|
6379
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target;
|
|
6427
6380
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6428
|
-
if (kind && result) __defProp$
|
|
6381
|
+
if (kind && result) __defProp$F(target, key, result);
|
|
6429
6382
|
return result;
|
|
6430
6383
|
};
|
|
6431
6384
|
class Checkbox extends BaseCheckbox {
|
|
@@ -6468,9 +6421,9 @@ class Checkbox extends BaseCheckbox {
|
|
|
6468
6421
|
super.toggleChecked(force);
|
|
6469
6422
|
}
|
|
6470
6423
|
}
|
|
6471
|
-
__decorateClass$
|
|
6472
|
-
__decorateClass$
|
|
6473
|
-
__decorateClass$
|
|
6424
|
+
__decorateClass$F([observable], Checkbox.prototype, "indeterminate", 2);
|
|
6425
|
+
__decorateClass$F([attr], Checkbox.prototype, "shape", 2);
|
|
6426
|
+
__decorateClass$F([attr], Checkbox.prototype, "size", 2);
|
|
6474
6427
|
|
|
6475
6428
|
const activeState = stateSelector("active");
|
|
6476
6429
|
const badInputState = stateSelector("bad-input");
|
|
@@ -6481,7 +6434,7 @@ const disabledState = stateSelector("disabled");
|
|
|
6481
6434
|
stateSelector("error");
|
|
6482
6435
|
const flipBlockState = stateSelector("flip-block");
|
|
6483
6436
|
const focusVisibleState = stateSelector("focus-visible");
|
|
6484
|
-
|
|
6437
|
+
stateSelector("has-message");
|
|
6485
6438
|
const indeterminateState = stateSelector("indeterminate");
|
|
6486
6439
|
const multipleState = stateSelector("multiple");
|
|
6487
6440
|
const openState = stateSelector("open");
|
|
@@ -6490,6 +6443,7 @@ const placeholderShownState = stateSelector("placeholder-shown");
|
|
|
6490
6443
|
const pressedState = stateSelector("pressed");
|
|
6491
6444
|
const rangeOverflowState = stateSelector("range-overflow");
|
|
6492
6445
|
const rangeUnderflowState = stateSelector("range-underflow");
|
|
6446
|
+
const requiredState = stateSelector("required");
|
|
6493
6447
|
const selectedState = stateSelector("selected");
|
|
6494
6448
|
const stepMismatchState = stateSelector("step-mismatch");
|
|
6495
6449
|
const submenuState = stateSelector("submenu");
|
|
@@ -6506,7 +6460,7 @@ const styles$A = css`
|
|
|
6506
6460
|
:host{--size:16px;background-color:${colorNeutralBackground1};border-radius:${borderRadiusSmall};border:${strokeWidthThin} solid ${colorNeutralStrokeAccessible};box-sizing:border-box;cursor:pointer;position:relative;width:var(--size)}:host,.indeterminate-indicator,.checked-indicator{aspect-ratio:1}:host(:hover){border-color:${colorNeutralStrokeAccessibleHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(${checkedState}:hover){background-color:${colorCompoundBrandBackgroundHover};border-color:${colorCompoundBrandStrokeHover}}:host(${checkedState}:active){background-color:${colorCompoundBrandBackgroundPressed};border-color:${colorCompoundBrandStrokePressed}}:host(:focus-visible){outline:none}:host(:not([slot='input']))::after{content:'';position:absolute;inset:-8px;box-sizing:border-box;outline:none;border:${strokeWidthThick} solid ${colorTransparentStroke};border-radius:${borderRadiusMedium}}:host(:not([slot='input']):focus-visible)::after{border-color:${colorStrokeFocus2}}.indeterminate-indicator,.checked-indicator{color:${colorNeutralForegroundInverted};inset:0;margin:auto;position:absolute}::slotted([slot='checked-indicator']),.checked-indicator{fill:currentColor;display:inline-flex;flex:1 0 auto;width:12px}:host(:not(${checkedState})) *:is(::slotted([slot='checked-indicator']),.checked-indicator){display:none}:host(${checkedState}),:host(${indeterminateState}){border-color:${colorCompoundBrandStroke}}:host(${checkedState}),:host(${indeterminateState}) .indeterminate-indicator{background-color:${colorCompoundBrandBackground}}:host(${indeterminateState}) .indeterminate-indicator{border-radius:${borderRadiusSmall};position:absolute;width:calc(var(--size) / 2);inset:0}:host([size='large']){--size:20px}:host([size='large']) ::slotted([slot='checked-indicator']),:host([size='large']) .checked-indicator{width:16px}:host([shape='circular']),:host([shape='circular']) .indeterminate-indicator{border-radius:${borderRadiusCircular}}:host([disabled]),:host([disabled]${checkedState}){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}:host([disabled]){cursor:unset}:host([disabled]${indeterminateState}) .indeterminate-indicator{background-color:${colorNeutralStrokeDisabled}}:host([disabled]${checkedState}) .checked-indicator{color:${colorNeutralStrokeDisabled}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
6507
6461
|
:host{border-color:FieldText}:host(:not([slot='input']:focus-visible))::after{border-color:Canvas}:host(:not([disabled]):hover),:host(${checkedState}:not([disabled]):hover),:host(:not([slot='input']):focus-visible)::after{border-color:Highlight}.indeterminate-indicator,.checked-indicator{color:HighlightText}:host(${checkedState}),:host(${indeterminateState}) .indeterminate-indicator{background-color:FieldText}:host(${checkedState}:not([disabled]):hover),:host(${indeterminateState}:not([disabled]):hover) .indeterminate-indicator{background-color:Highlight}:host([disabled]){border-color:GrayText}:host([disabled]${indeterminateState}) .indeterminate-indicator{background-color:GrayText}:host([disabled]),:host([disabled]${checkedState}) .checked-indicator{color:GrayText}`));
|
|
6508
6462
|
|
|
6509
|
-
const checkedIndicator$2 = html.partial(
|
|
6463
|
+
const checkedIndicator$2 = html.partial(/* html */
|
|
6510
6464
|
`
|
|
6511
6465
|
<svg
|
|
6512
6466
|
fill="currentColor"
|
|
@@ -6519,12 +6473,12 @@ const checkedIndicator$2 = html.partial( /* html */
|
|
|
6519
6473
|
<path d="M9.76 3.2c.3.29.32.76.04 1.06l-4.25 4.5a.75.75 0 0 1-1.08.02L2.22 6.53a.75.75 0 0 1 1.06-1.06l1.7 1.7L8.7 3.24a.75.75 0 0 1 1.06-.04Z" fill="currentColor"></path>
|
|
6520
6474
|
</svg>
|
|
6521
6475
|
`);
|
|
6522
|
-
const indeterminateIndicator = html.partial(
|
|
6476
|
+
const indeterminateIndicator = html.partial(/* html */
|
|
6523
6477
|
`
|
|
6524
6478
|
<span class="indeterminate-indicator"></span>
|
|
6525
6479
|
`);
|
|
6526
6480
|
function checkboxTemplate(options = {}) {
|
|
6527
|
-
return html`<template
|
|
6481
|
+
return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @input="${(x, c) => x.inputHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @keyup="${(x, c) => x.keyupHandler(c.event)}"><slot name="checked-indicator">${staticallyCompose(options.checkedIndicator)}</slot><slot name="indeterminate-indicator">${staticallyCompose(options.indeterminateIndicator)}</slot></template>`;
|
|
6528
6482
|
}
|
|
6529
6483
|
const template$B = checkboxTemplate({
|
|
6530
6484
|
checkedIndicator: checkedIndicator$2,
|
|
@@ -6546,7 +6500,9 @@ const styles$z = css`
|
|
|
6546
6500
|
|
|
6547
6501
|
:host,:host(:is([size])){gap:12px;height:auto;padding-top:14px;padding-inline:12px;padding-bottom:16px;font-size:${fontSizeBase300};line-height:${lineHeightBase300}}.content{display:flex;flex-direction:column;text-align:start}::slotted([slot='description']){color:${colorNeutralForeground2};line-height:100%;font-size:${fontSizeBase200};font-weight:${fontWeightRegular}}::slotted(svg),:host([size='large']) ::slotted(svg){font-size:40px;height:40px;width:40px}:host(:hover) ::slotted([slot='description']){color:${colorNeutralForeground2Hover}}:host(:active) ::slotted([slot='description']){color:${colorNeutralForeground2Pressed}}:host(:is([appearance='primary'],[appearance='primary']:is(:hover,:active))) ::slotted([slot='description']){color:${colorNeutralForegroundOnBrand}}:host(:is([appearance='transparent'],[appearance='subtle'],[appearance='subtle']:is(:hover,:active)))
|
|
6548
6502
|
::slotted([slot='description']){color:${colorNeutralForeground2}}:host([appearance='transparent']:hover) ::slotted([slot='description']){color:${colorNeutralForeground2BrandHover}}:host([appearance='transparent']:active) ::slotted([slot='description']){color:${colorNeutralForeground2BrandPressed}}:host(:is(:disabled,:disabled[appearance],[disabled-focusable],[disabled-focusable][appearance]))
|
|
6549
|
-
::slotted([slot='description']){color:${colorNeutralForegroundDisabled}}:host([size='small']){padding:8px;padding-bottom:10px}:host([icon-only]){min-width:52px;max-width:52px;padding:${spacingHorizontalSNudge}}:host([icon-only][size='small']){min-width:48px;max-width:48px;padding:${spacingHorizontalXS}}:host([icon-only][size='large']){min-width:56px;max-width:56px;padding:${spacingHorizontalS}}:host([size='large']){padding-top:18px;padding-inline:16px;padding-bottom:20px;font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large']) ::slotted([slot='description']){font-size:${fontSizeBase300}}
|
|
6503
|
+
::slotted([slot='description']){color:${colorNeutralForegroundDisabled}}:host([size='small']){padding:8px;padding-bottom:10px}:host([icon-only]){min-width:52px;max-width:52px;padding:${spacingHorizontalSNudge}}:host([icon-only][size='small']){min-width:48px;max-width:48px;padding:${spacingHorizontalXS}}:host([icon-only][size='large']){min-width:56px;max-width:56px;padding:${spacingHorizontalS}}:host([size='large']){padding-top:18px;padding-inline:16px;padding-bottom:20px;font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large']) ::slotted([slot='description']){font-size:${fontSizeBase300}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
6504
|
+
:host([appearance='primary']:not(:hover,:focus-visible,:disabled,[disabled-focusable]))
|
|
6505
|
+
::slotted([slot='description']){color:HighlightText}`));
|
|
6550
6506
|
|
|
6551
6507
|
function buttonTemplate(options = {}) {
|
|
6552
6508
|
return html`<template ?disabled="${x => x.disabled}" tabindex="${x => x.disabled ? null : x.tabIndex ?? 0}">${startSlotTemplate(options)}<span class="content" part="content"><slot ${slotted("defaultSlottedContent")}></slot><slot name="description"></slot></span>${endSlotTemplate(options)}</template>`;
|
|
@@ -6561,12 +6517,12 @@ const definition$A = CompoundButton.compose({
|
|
|
6561
6517
|
|
|
6562
6518
|
definition$A.define(FluentDesignSystem.registry);
|
|
6563
6519
|
|
|
6564
|
-
var __defProp$
|
|
6565
|
-
var __getOwnPropDesc$
|
|
6566
|
-
var __decorateClass$
|
|
6567
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6520
|
+
var __defProp$E = Object.defineProperty;
|
|
6521
|
+
var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
|
|
6522
|
+
var __decorateClass$E = (decorators, target, key, kind) => {
|
|
6523
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target;
|
|
6568
6524
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6569
|
-
if (kind && result) __defProp$
|
|
6525
|
+
if (kind && result) __defProp$E(target, key, result);
|
|
6570
6526
|
return result;
|
|
6571
6527
|
};
|
|
6572
6528
|
class CounterBadge extends FASTElement {
|
|
@@ -6603,22 +6559,22 @@ class CounterBadge extends FASTElement {
|
|
|
6603
6559
|
return;
|
|
6604
6560
|
}
|
|
6605
6561
|
}
|
|
6606
|
-
__decorateClass$
|
|
6607
|
-
__decorateClass$
|
|
6608
|
-
__decorateClass$
|
|
6609
|
-
__decorateClass$
|
|
6610
|
-
__decorateClass$
|
|
6562
|
+
__decorateClass$E([attr], CounterBadge.prototype, "appearance", 2);
|
|
6563
|
+
__decorateClass$E([attr], CounterBadge.prototype, "color", 2);
|
|
6564
|
+
__decorateClass$E([attr], CounterBadge.prototype, "shape", 2);
|
|
6565
|
+
__decorateClass$E([attr], CounterBadge.prototype, "size", 2);
|
|
6566
|
+
__decorateClass$E([attr({
|
|
6611
6567
|
converter: nullableNumberConverter
|
|
6612
6568
|
})], CounterBadge.prototype, "count", 2);
|
|
6613
|
-
__decorateClass$
|
|
6569
|
+
__decorateClass$E([attr({
|
|
6614
6570
|
attribute: "overflow-count",
|
|
6615
6571
|
converter: nullableNumberConverter
|
|
6616
6572
|
})], CounterBadge.prototype, "overflowCount", 2);
|
|
6617
|
-
__decorateClass$
|
|
6573
|
+
__decorateClass$E([attr({
|
|
6618
6574
|
attribute: "show-zero",
|
|
6619
6575
|
mode: "boolean"
|
|
6620
6576
|
})], CounterBadge.prototype, "showZero", 2);
|
|
6621
|
-
__decorateClass$
|
|
6577
|
+
__decorateClass$E([attr({
|
|
6622
6578
|
mode: "boolean"
|
|
6623
6579
|
})], CounterBadge.prototype, "dot", 2);
|
|
6624
6580
|
applyMixins(CounterBadge, StartEnd);
|
|
@@ -6651,13 +6607,19 @@ const DialogType = {
|
|
|
6651
6607
|
nonModal: "non-modal",
|
|
6652
6608
|
alert: "alert"
|
|
6653
6609
|
};
|
|
6610
|
+
function isDialog(element, tagName = "-dialog") {
|
|
6611
|
+
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
6612
|
+
return false;
|
|
6613
|
+
}
|
|
6614
|
+
return element.tagName.toLowerCase().endsWith(tagName);
|
|
6615
|
+
}
|
|
6654
6616
|
|
|
6655
|
-
var __defProp$
|
|
6656
|
-
var __getOwnPropDesc$
|
|
6657
|
-
var __decorateClass$
|
|
6658
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6617
|
+
var __defProp$D = Object.defineProperty;
|
|
6618
|
+
var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
|
|
6619
|
+
var __decorateClass$D = (decorators, target, key, kind) => {
|
|
6620
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
|
|
6659
6621
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6660
|
-
if (kind && result) __defProp$
|
|
6622
|
+
if (kind && result) __defProp$D(target, key, result);
|
|
6661
6623
|
return result;
|
|
6662
6624
|
};
|
|
6663
6625
|
class Dialog extends FASTElement {
|
|
@@ -6687,6 +6649,26 @@ class Dialog extends FASTElement {
|
|
|
6687
6649
|
});
|
|
6688
6650
|
};
|
|
6689
6651
|
}
|
|
6652
|
+
typeChanged(prev, next) {
|
|
6653
|
+
if (!this.dialog) {
|
|
6654
|
+
return;
|
|
6655
|
+
}
|
|
6656
|
+
if (next === DialogType.alert) {
|
|
6657
|
+
this.dialog.setAttribute("role", "alertdialog");
|
|
6658
|
+
} else {
|
|
6659
|
+
this.dialog.removeAttribute("role");
|
|
6660
|
+
}
|
|
6661
|
+
if (next !== DialogType.nonModal) {
|
|
6662
|
+
this.dialog.setAttribute("aria-modal", "true");
|
|
6663
|
+
} else {
|
|
6664
|
+
this.dialog.removeAttribute("aria-modal");
|
|
6665
|
+
}
|
|
6666
|
+
}
|
|
6667
|
+
/** @internal */
|
|
6668
|
+
connectedCallback() {
|
|
6669
|
+
super.connectedCallback();
|
|
6670
|
+
this.typeChanged(void 0, this.type);
|
|
6671
|
+
}
|
|
6690
6672
|
/**
|
|
6691
6673
|
* @public
|
|
6692
6674
|
* Method to show the dialog
|
|
@@ -6718,26 +6700,25 @@ class Dialog extends FASTElement {
|
|
|
6718
6700
|
* @returns boolean
|
|
6719
6701
|
*/
|
|
6720
6702
|
clickHandler(event) {
|
|
6721
|
-
event.preventDefault();
|
|
6722
6703
|
if (this.dialog.open && this.type !== DialogType.alert && event.target === this.dialog) {
|
|
6723
6704
|
this.hide();
|
|
6724
6705
|
}
|
|
6725
6706
|
return true;
|
|
6726
6707
|
}
|
|
6727
6708
|
}
|
|
6728
|
-
__decorateClass$
|
|
6729
|
-
__decorateClass$
|
|
6709
|
+
__decorateClass$D([observable], Dialog.prototype, "dialog", 2);
|
|
6710
|
+
__decorateClass$D([attr({
|
|
6730
6711
|
attribute: "aria-describedby"
|
|
6731
6712
|
})], Dialog.prototype, "ariaDescribedby", 2);
|
|
6732
|
-
__decorateClass$
|
|
6713
|
+
__decorateClass$D([attr({
|
|
6733
6714
|
attribute: "aria-labelledby"
|
|
6734
6715
|
})], Dialog.prototype, "ariaLabelledby", 2);
|
|
6735
|
-
__decorateClass$
|
|
6716
|
+
__decorateClass$D([attr], Dialog.prototype, "type", 2);
|
|
6736
6717
|
|
|
6737
|
-
const template$y = html`<dialog
|
|
6718
|
+
const template$y = html`<dialog class="dialog" part="dialog" aria-describedby="${x => x.ariaDescribedby}" aria-labelledby="${x => x.ariaLabelledby}" aria-label="${x => x.ariaLabel}" @click="${(x, c) => x.clickHandler(c.event)}" @cancel="${x => x.hide()}" ${ref("dialog")}><slot></slot></dialog>`;
|
|
6738
6719
|
|
|
6739
6720
|
const styles$x = css`
|
|
6740
|
-
@layer base{:host{--dialog-backdrop:${colorBackgroundOverlay};--dialog-starting-scale:0.85}::backdrop{background:var(--dialog-backdrop,rgba(0,0,0,0.4))}dialog{background:${colorNeutralBackground1};border-radius:${borderRadiusXLarge};border:none;box-shadow:${shadow64};color:${colorNeutralForeground1};max-height:
|
|
6721
|
+
@layer base{:host{--dialog-backdrop:${colorBackgroundOverlay};--dialog-starting-scale:0.85}::backdrop{background:var(--dialog-backdrop,rgba(0,0,0,0.4))}dialog{background:${colorNeutralBackground1};border-radius:${borderRadiusXLarge};border:none;box-shadow:${shadow64};color:${colorNeutralForeground1};max-height:100vh;padding:0;width:100%;max-width:600px}:host([type='non-modal']) dialog{inset:0;position:fixed;z-index:2;overflow:auto}@supports (max-height:1dvh){dialog{max-height:100dvh}}}@layer animations{@media (prefers-reduced-motion:no-preference){dialog,::backdrop{transition:display allow-discrete,opacity,overlay allow-discrete,scale;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid};opacity:0}::backdrop{transition-timing-function:${curveLinear}}[open],[open]::backdrop{opacity:1}dialog:not([open]){scale:var(--dialog-starting-scale);transition-timing-function:${curveAccelerateMid}}}@starting-style{[open],[open]::backdrop{opacity:0}dialog{scale:var(--dialog-starting-scale)}}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
6741
6722
|
@layer base{dialog{border:${strokeWidthThin} solid ${colorTransparentStroke}}}`));
|
|
6742
6723
|
|
|
6743
6724
|
const definition$y = Dialog.compose({
|
|
@@ -6748,45 +6729,30 @@ const definition$y = Dialog.compose({
|
|
|
6748
6729
|
|
|
6749
6730
|
definition$y.define(FluentDesignSystem.registry);
|
|
6750
6731
|
|
|
6751
|
-
var __defProp$D = Object.defineProperty;
|
|
6752
|
-
var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
|
|
6753
|
-
var __decorateClass$D = (decorators, target, key, kind) => {
|
|
6754
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
|
|
6755
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6756
|
-
if (kind && result) __defProp$D(target, key, result);
|
|
6757
|
-
return result;
|
|
6758
|
-
};
|
|
6759
6732
|
class DialogBody extends FASTElement {
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6733
|
+
/**
|
|
6734
|
+
* Handles click event for the close slot
|
|
6735
|
+
*
|
|
6736
|
+
* @param e - the click event
|
|
6737
|
+
* @internal
|
|
6738
|
+
*/
|
|
6739
|
+
clickHandler(event) {
|
|
6740
|
+
if (!event.defaultPrevented) {
|
|
6741
|
+
const dialog = this.parentElement;
|
|
6742
|
+
if (isDialog(dialog)) {
|
|
6743
|
+
dialog.hide();
|
|
6744
|
+
}
|
|
6745
|
+
}
|
|
6746
|
+
return true;
|
|
6763
6747
|
}
|
|
6764
6748
|
}
|
|
6765
|
-
__decorateClass$D([attr({
|
|
6766
|
-
mode: "boolean",
|
|
6767
|
-
attribute: "no-title-action"
|
|
6768
|
-
})], DialogBody.prototype, "noTitleAction", 2);
|
|
6769
6749
|
|
|
6770
|
-
const
|
|
6771
|
-
<svg
|
|
6772
|
-
fill="currentColor"
|
|
6773
|
-
aria-hidden="true"
|
|
6774
|
-
width="20"
|
|
6775
|
-
height="20"
|
|
6776
|
-
viewBox="0 0 20 20"
|
|
6777
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
6778
|
-
>
|
|
6779
|
-
<path
|
|
6780
|
-
d="m4.09 4.22.06-.07a.5.5 0 0 1 .63-.06l.07.06L10 9.29l5.15-5.14a.5.5 0 0 1 .63-.06l.07.06c.18.17.2.44.06.63l-.06.07L10.71 10l5.14 5.15c.18.17.2.44.06.63l-.06.07a.5.5 0 0 1-.63.06l-.07-.06L10 10.71l-5.15 5.14a.5.5 0 0 1-.63.06l-.07-.06a.5.5 0 0 1-.06-.63l.06-.07L9.29 10 4.15 4.85a.5.5 0 0 1-.06-.63l.06-.07-.06.07Z"
|
|
6781
|
-
fill="currentColor"
|
|
6782
|
-
></path>
|
|
6783
|
-
</svg>`);
|
|
6784
|
-
const template$x = html`<div class="title" part="title"><slot name="title"></slot><slot name="title-action"><fluent-button ?hidden=${x => x.noTitleAction || x.parentNode?.type === DialogType.alert} tabindex="0" part="title-action" class="title-action" appearance="transparent" icon-only @click=${x => x.parentNode?.hide()} ${ref("defaultTitleAction")}>${dismissed16Regular}</fluent-button></slot></div><div class="content" part="content"><slot></slot></div><div class="actions" part="actions"><slot name="action"></slot></div>`;
|
|
6750
|
+
const template$x = html`<template><div class="title" part="title"><slot name="title"></slot><slot name="title-action"></slot><slot name="close" @click="${(x, c) => x.clickHandler(c.event)}"></slot></div><div class="content" part="content"><slot></slot></div><div class="actions" part="actions"><slot name="action"></slot></div></template>`;
|
|
6785
6751
|
|
|
6786
6752
|
const styles$w = css`
|
|
6787
6753
|
${display("grid")}
|
|
6788
6754
|
|
|
6789
|
-
:host{background:${colorNeutralBackground1};box-sizing:border-box;gap:${spacingVerticalS};padding:${spacingVerticalXXL} ${spacingHorizontalXXL};container:dialog-body / inline-size}.title{box-sizing:border-box;align-items:flex-start;background:${colorNeutralBackground1};color:${colorNeutralForeground1};column-gap:8px;display:flex;font-family:${fontFamilyBase};font-size:${fontSizeBase500};font-weight:${fontWeightSemibold};inset-block-start:0;justify-content:space-between;line-height:${lineHeightBase500};margin-block-end:calc(${spacingVerticalS} * -1);margin-block-start:calc(${spacingVerticalXXL} * -1);padding-block-end:${spacingVerticalS};padding-block-start:${spacingVerticalXXL}
|
|
6755
|
+
:host{background:${colorNeutralBackground1};box-sizing:border-box;gap:${spacingVerticalS};padding:${spacingVerticalXXL} ${spacingHorizontalXXL};container:dialog-body / inline-size}.title{box-sizing:border-box;align-items:flex-start;background:${colorNeutralBackground1};color:${colorNeutralForeground1};column-gap:8px;display:flex;font-family:${fontFamilyBase};font-size:${fontSizeBase500};font-weight:${fontWeightSemibold};inset-block-start:0;justify-content:space-between;line-height:${lineHeightBase500};margin-block-end:calc(${spacingVerticalS} * -1);margin-block-start:calc(${spacingVerticalXXL} * -1);padding-block-end:${spacingVerticalS};padding-block-start:${spacingVerticalXXL}}.content{box-sizing:border-box;color:${colorNeutralForeground1};font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};min-height:32px}.actions{box-sizing:border-box;background:${colorNeutralBackground1};display:flex;flex-direction:column;gap:${spacingVerticalS};inset-block-end:0;margin-block-end:calc(${spacingVerticalXXL} * -1);padding-block-end:${spacingVerticalXXL};padding-block-start:${spacingVerticalL}}::slotted([slot='title-action']){margin-inline-start:auto}::slotted([slot='title']){font:inherit;padding:0;margin:0}:not(:has(:is([slot='title'],[slot='title-action']))) .title{justify-content:end}@container (min-width:480px){.actions{align-items:center;flex-direction:row;justify-content:flex-end;margin-block-start:calc(${spacingVerticalS} * -1);padding-block-start:${spacingVerticalS}}}@media (min-height:480px){.title{position:sticky;z-index:1}.actions{position:sticky;z-index:2}`;
|
|
6790
6756
|
|
|
6791
6757
|
const definition$x = DialogBody.compose({
|
|
6792
6758
|
name: `${FluentDesignSystem.prefix}-dialog-body`,
|
|
@@ -6952,6 +6918,28 @@ class Drawer extends FASTElement {
|
|
|
6952
6918
|
});
|
|
6953
6919
|
};
|
|
6954
6920
|
}
|
|
6921
|
+
typeChanged() {
|
|
6922
|
+
if (!this.dialog) {
|
|
6923
|
+
return;
|
|
6924
|
+
}
|
|
6925
|
+
this.updateDialogRole();
|
|
6926
|
+
if (this.type === DrawerType.modal) {
|
|
6927
|
+
this.dialog.setAttribute("aria-modal", "true");
|
|
6928
|
+
} else {
|
|
6929
|
+
this.dialog.removeAttribute("aria-modal");
|
|
6930
|
+
}
|
|
6931
|
+
}
|
|
6932
|
+
/** @internal */
|
|
6933
|
+
connectedCallback() {
|
|
6934
|
+
super.connectedCallback();
|
|
6935
|
+
this.typeChanged();
|
|
6936
|
+
this.observeRoleAttr();
|
|
6937
|
+
}
|
|
6938
|
+
/** @internal */
|
|
6939
|
+
disconnectedCallback() {
|
|
6940
|
+
super.disconnectedCallback();
|
|
6941
|
+
this.roleAttrObserver.disconnect();
|
|
6942
|
+
}
|
|
6955
6943
|
/**
|
|
6956
6944
|
* @public
|
|
6957
6945
|
* Method to show the drawer
|
|
@@ -6989,6 +6977,32 @@ class Drawer extends FASTElement {
|
|
|
6989
6977
|
}
|
|
6990
6978
|
return true;
|
|
6991
6979
|
}
|
|
6980
|
+
/**
|
|
6981
|
+
* @public
|
|
6982
|
+
* Handles cancel events on the drawer.
|
|
6983
|
+
*/
|
|
6984
|
+
cancelHandler() {
|
|
6985
|
+
this.hide();
|
|
6986
|
+
}
|
|
6987
|
+
observeRoleAttr() {
|
|
6988
|
+
if (this.roleAttrObserver) {
|
|
6989
|
+
return;
|
|
6990
|
+
}
|
|
6991
|
+
this.roleAttrObserver = new MutationObserver(() => {
|
|
6992
|
+
this.updateDialogRole();
|
|
6993
|
+
});
|
|
6994
|
+
this.roleAttrObserver.observe(this, {
|
|
6995
|
+
attributes: true,
|
|
6996
|
+
attributeFilter: ["role"]
|
|
6997
|
+
});
|
|
6998
|
+
}
|
|
6999
|
+
updateDialogRole() {
|
|
7000
|
+
console.log(this.role);
|
|
7001
|
+
if (!this.dialog) {
|
|
7002
|
+
return;
|
|
7003
|
+
}
|
|
7004
|
+
this.dialog.role = this.type === DrawerType.modal ? "dialog" : this.role;
|
|
7005
|
+
}
|
|
6992
7006
|
}
|
|
6993
7007
|
__decorateClass$A([attr], Drawer.prototype, "type", 2);
|
|
6994
7008
|
__decorateClass$A([attr({
|
|
@@ -7009,7 +7023,7 @@ const styles$u = css`
|
|
|
7009
7023
|
:host{--dialog-backdrop:${colorBackgroundOverlay}}:host([type='non-modal']) dialog[open]::backdrop{display:none}:host([type='non-modal']) dialog{position:fixed;top:0;bottom:0}:host([type='inline']){height:100%;width:fit-content}:host([type='inline']) dialog[open]{box-shadow:none;position:relative}:host([size='small']) dialog{width:320px;max-width:320px}:host([size='large']) dialog{width:940px;max-width:940px}:host([size='full']) dialog{width:100%;max-width:100%}:host([position='end']) dialog{margin-inline-start:auto;margin-inline-end:0}dialog{box-sizing:border-box;z-index:var(--drawer-elevation,1000);font-size:${fontSizeBase300};line-height:${lineHeightBase300};font-family:${fontFamilyBase};font-weight:${fontWeightRegular};color:${colorNeutralForeground1};max-width:var(--drawer-width,592px);max-height:100vh;height:100%;margin-inline-start:0;margin-inline-end:auto;border-inline-end-color:${colorTransparentStroke};border-inline-start-color:var(--drawer-separator,${colorTransparentStroke});outline:none;top:0;bottom:0;width:var(--drawer-width,592px);border-radius:0;padding:0;max-width:var(--drawer-width,592px);box-shadow:${shadow64};border:${strokeWidthThin} solid ${colorTransparentStroke};background:${colorNeutralBackground1}}dialog::backdrop{background:var(--dialog-backdrop)}@layer animations{@media (prefers-reduced-motion:no-preference){dialog{transition:display allow-discrete,opacity,overlay allow-discrete,transform;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid}}:host dialog:not([open]){transform:translateX(-100%);transition-timing-function:${curveAccelerateMid}}:host([position='end']) dialog:not([open]){transform:translateX(100%);transition-timing-function:${curveAccelerateMid}}dialog[open]{transform:translateX(0)}dialog::backdrop{transition:display allow-discrete,opacity,overlay allow-discrete,scale;transition-duration:${durationGentle};transition-timing-function:${curveDecelerateMid};background:var(--dialog-backdrop,${colorBackgroundOverlay});opacity:0}dialog[open]::backdrop{opacity:1}dialog::backdrop{transition-timing-function:${curveLinear}}}@starting-style{dialog[open]{transform:translateX(-100%)}:host([position='end']) dialog[open]{transform:translateX(100%)}dialog[open]::backdrop{opacity:0}}}`;
|
|
7010
7024
|
|
|
7011
7025
|
function drawerTemplate() {
|
|
7012
|
-
return html`<dialog class="dialog" part="dialog"
|
|
7026
|
+
return html`<dialog class="dialog" part="dialog" aria-describedby="${x => x.ariaDescribedby}" aria-labelledby="${x => x.ariaLabelledby}" aria-label="${x => x.ariaLabel}" size="${x => x.size}" position="${x => x.position}" @click="${(x, c) => x.clickHandler(c.event)}" @cancel="${x => x.cancelHandler()}" ${ref("dialog")}><slot></slot></dialog>`;
|
|
7013
7027
|
}
|
|
7014
7028
|
const template$v = drawerTemplate();
|
|
7015
7029
|
|
|
@@ -7021,14 +7035,30 @@ const definition$v = Drawer.compose({
|
|
|
7021
7035
|
|
|
7022
7036
|
definition$v.define(FluentDesignSystem.registry);
|
|
7023
7037
|
|
|
7024
|
-
class DrawerBody extends FASTElement {
|
|
7038
|
+
class DrawerBody extends FASTElement {
|
|
7039
|
+
/**
|
|
7040
|
+
* Handles click event for the close slot
|
|
7041
|
+
*
|
|
7042
|
+
* @param e - the click event
|
|
7043
|
+
* @internal
|
|
7044
|
+
*/
|
|
7045
|
+
clickHandler(event) {
|
|
7046
|
+
if (!event.defaultPrevented) {
|
|
7047
|
+
const dialog = this.parentElement;
|
|
7048
|
+
if (isDialog(dialog, "-drawer")) {
|
|
7049
|
+
dialog.hide();
|
|
7050
|
+
}
|
|
7051
|
+
}
|
|
7052
|
+
return true;
|
|
7053
|
+
}
|
|
7054
|
+
}
|
|
7025
7055
|
|
|
7026
7056
|
const styles$t = css`
|
|
7027
7057
|
${display("grid")}
|
|
7028
7058
|
:host{box-sizing:border-box;grid-template-rows:min-content auto min-content;position:relative;height:100%;padding:${spacingHorizontalXL};max-height:100svh}.header{display:flex;justify-content:space-between;align-items:center;${typographySubtitle1Styles}}.footer{display:flex;justify-content:flex-start;gap:${spacingHorizontalM}}::slotted([slot='title']){font:inherit;padding:0;margin:0}`;
|
|
7029
7059
|
|
|
7030
7060
|
function drawerBodyTemplate() {
|
|
7031
|
-
return html`<div class="header" part="header"><slot name="title"></slot><slot name="close"></slot></div><div class="content" part="content"><slot></slot></div><div class="footer" part="footer"><slot name="footer"></slot></div>`;
|
|
7061
|
+
return html`<div class="header" part="header"><slot name="title"></slot><slot name="close" @click="${(x, c) => x.clickHandler(c.event)}"></slot></div><div class="content" part="content"><slot></slot></div><div class="footer" part="footer"><slot name="footer"></slot></div>`;
|
|
7032
7062
|
}
|
|
7033
7063
|
const template$u = drawerBodyTemplate();
|
|
7034
7064
|
|
|
@@ -7064,6 +7094,46 @@ function uniqueId(prefix = "id-") {
|
|
|
7064
7094
|
return document.getElementById(str) ? uniqueId(prefix) : str;
|
|
7065
7095
|
}
|
|
7066
7096
|
|
|
7097
|
+
function requestIdleCallback(callback, options) {
|
|
7098
|
+
if ("requestIdleCallback" in globalThis) {
|
|
7099
|
+
return globalThis.requestIdleCallback(callback, options);
|
|
7100
|
+
}
|
|
7101
|
+
const start = Date.now();
|
|
7102
|
+
return setTimeout(() => {
|
|
7103
|
+
callback({
|
|
7104
|
+
didTimeout: options?.timeout ? Date.now() - start >= options.timeout : false,
|
|
7105
|
+
timeRemaining: () => 0
|
|
7106
|
+
});
|
|
7107
|
+
}, 1);
|
|
7108
|
+
}
|
|
7109
|
+
function cancelIdleCallback(id) {
|
|
7110
|
+
if ("cancelIdleCallback" in globalThis) {
|
|
7111
|
+
globalThis.cancelIdleCallback(id);
|
|
7112
|
+
} else {
|
|
7113
|
+
clearTimeout(id);
|
|
7114
|
+
}
|
|
7115
|
+
}
|
|
7116
|
+
function waitForConnectedDescendants(target, callback, options) {
|
|
7117
|
+
let idleCallbackId;
|
|
7118
|
+
const shallow = options?.shallow ?? false;
|
|
7119
|
+
const query = `${shallow ? ":scope > " : ""}:not(:defined)`;
|
|
7120
|
+
const timeout = options?.timeout ?? 50;
|
|
7121
|
+
const scheduleCheck = deadline => {
|
|
7122
|
+
if (idleCallbackId) {
|
|
7123
|
+
cancelIdleCallback(idleCallbackId);
|
|
7124
|
+
idleCallbackId = void 0;
|
|
7125
|
+
}
|
|
7126
|
+
if (!target.querySelector(query) || deadline && deadline.timeRemaining() <= 0) {
|
|
7127
|
+
callback();
|
|
7128
|
+
return;
|
|
7129
|
+
}
|
|
7130
|
+
idleCallbackId = requestIdleCallback(scheduleCheck, {
|
|
7131
|
+
timeout
|
|
7132
|
+
});
|
|
7133
|
+
};
|
|
7134
|
+
scheduleCheck();
|
|
7135
|
+
}
|
|
7136
|
+
|
|
7067
7137
|
const DropdownAppearance = {
|
|
7068
7138
|
filledDarker: "filled-darker",
|
|
7069
7139
|
filledLighter: "filled-lighter",
|
|
@@ -7076,11 +7146,11 @@ const DropdownType = {
|
|
|
7076
7146
|
select: "select"
|
|
7077
7147
|
};
|
|
7078
7148
|
|
|
7079
|
-
const dropdownIndicatorTemplate = html`<svg class="chevron-down-20-regular"
|
|
7080
|
-
const dropdownInputTemplate = html`<input @input="${(x, c) => x.inputHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" aria-activedescendant="${x => x.activeDescendant}" aria-controls="${x => x.listbox?.id ?? null}" aria-labelledby="${x => x.ariaLabelledBy}" aria-expanded="${x => x.open}" aria-haspopup="listbox" placeholder="${x => x.placeholder}" role="combobox" ?disabled="${x => x.disabled}" type="${x => x.type}" value="${x => x.valueAttribute}" ${ref("control")} />`;
|
|
7081
|
-
const dropdownButtonTemplate = html`<button aria-activedescendant="${x => x.activeDescendant}" aria-controls="${x => x.listbox?.id ?? null}" aria-expanded="${x => x.open}" aria-haspopup="listbox" role="combobox" ?disabled="${x => x.disabled}" type="button" ${ref("control")}>${x => x.displayValue}</button>`;
|
|
7149
|
+
const dropdownIndicatorTemplate = html`<svg class="chevron-down-20-regular" aria-hidden="true" slot="indicator" viewBox="0 0 20 20" ${ref("indicator")}><path d="M15.85 7.65a.5.5 0 0 1 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 8.35a.5.5 0 1 1 .7-.7L10 12.8l5.15-5.16a.5.5 0 0 1 .7 0" fill="currentColor" /></svg>`;
|
|
7150
|
+
const dropdownInputTemplate = html`<input @input="${(x, c) => x.inputHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" aria-activedescendant="${x => x.activeDescendant}" aria-controls="${x => x.listbox?.id ?? null}" aria-labelledby="${x => x.ariaLabelledBy}" aria-expanded="${x => x.open}" aria-haspopup="listbox" placeholder="${x => x.placeholder}" role="combobox" ?disabled="${x => x.disabled}" type="${x => x.type}" value="${x => x.valueAttribute}" slot="control" ${ref("control")} />`;
|
|
7151
|
+
const dropdownButtonTemplate = html`<button aria-activedescendant="${x => x.activeDescendant}" aria-controls="${x => x.listbox?.id ?? null}" aria-expanded="${x => x.open}" aria-haspopup="listbox" role="combobox" ?disabled="${x => x.disabled}" type="button" slot="control" ${ref("control")}>${x => x.displayValue}</button>`;
|
|
7082
7152
|
function dropdownTemplate(options = {}) {
|
|
7083
|
-
return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @mousedown="${(x, c) => x.mousedownHandler(c.event)}"><div class="control"><slot name="control" ${ref("controlSlot")}></slot><slot name="indicator" ${ref("indicatorSlot")}>${staticallyCompose(options.indicator)}</slot></div><slot ${
|
|
7153
|
+
return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @mousedown="${(x, c) => x.mousedownHandler(c.event)}"><div class="control"><slot name="control" ${ref("controlSlot")}></slot><slot name="indicator" ${ref("indicatorSlot")}>${staticallyCompose(options.indicator)}</slot></div><slot @slotchange="${(x, c) => x.slotchangeHandler(c.event)}"></slot></template>`;
|
|
7084
7154
|
}
|
|
7085
7155
|
const template$t = dropdownTemplate({
|
|
7086
7156
|
indicator: dropdownIndicatorTemplate
|
|
@@ -7102,6 +7172,31 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7102
7172
|
this.required = false;
|
|
7103
7173
|
this.type = DropdownType.dropdown;
|
|
7104
7174
|
this.valueAttribute = "";
|
|
7175
|
+
/**
|
|
7176
|
+
* Repositions the listbox to align with the control element. Used when the browser does not support CSS anchor
|
|
7177
|
+
* positioning.
|
|
7178
|
+
*
|
|
7179
|
+
* @internal
|
|
7180
|
+
*/
|
|
7181
|
+
this.repositionListbox = () => {
|
|
7182
|
+
if (this.frameId) {
|
|
7183
|
+
cancelAnimationFrame(this.frameId);
|
|
7184
|
+
}
|
|
7185
|
+
this.frameId = requestAnimationFrame(() => {
|
|
7186
|
+
const controlRect = this.getBoundingClientRect();
|
|
7187
|
+
const right = window.innerWidth - controlRect.right;
|
|
7188
|
+
const left = controlRect.left;
|
|
7189
|
+
this.listbox.style.minWidth = `${controlRect.width}px`;
|
|
7190
|
+
this.listbox.style.top = `${controlRect.top}px`;
|
|
7191
|
+
if (left + controlRect.width > window.innerWidth || getDirection(this) === "rtl" && right - controlRect.width > 0) {
|
|
7192
|
+
this.listbox.style.right = `${right}px`;
|
|
7193
|
+
this.listbox.style.left = "unset";
|
|
7194
|
+
} else {
|
|
7195
|
+
this.listbox.style.left = `${left}px`;
|
|
7196
|
+
this.listbox.style.right = "unset";
|
|
7197
|
+
}
|
|
7198
|
+
});
|
|
7199
|
+
};
|
|
7105
7200
|
/**
|
|
7106
7201
|
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
7107
7202
|
*
|
|
@@ -7109,7 +7204,6 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7109
7204
|
*/
|
|
7110
7205
|
this.elementInternals = this.attachInternals();
|
|
7111
7206
|
this.elementInternals.role = "presentation";
|
|
7112
|
-
this.addEventListener("connected", this.listboxConnectedHandler);
|
|
7113
7207
|
Updates.enqueue(() => {
|
|
7114
7208
|
this.insertControl();
|
|
7115
7209
|
});
|
|
@@ -7152,7 +7246,6 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7152
7246
|
controlChanged(prev, next) {
|
|
7153
7247
|
if (next) {
|
|
7154
7248
|
next.id = next.id || uniqueId("input-");
|
|
7155
|
-
this.controlSlot?.assign(next);
|
|
7156
7249
|
}
|
|
7157
7250
|
}
|
|
7158
7251
|
/**
|
|
@@ -7201,7 +7294,7 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7201
7294
|
if (next) {
|
|
7202
7295
|
next.dropdown = this;
|
|
7203
7296
|
next.popover = "manual";
|
|
7204
|
-
|
|
7297
|
+
next.tabIndex = -1;
|
|
7205
7298
|
const notifier = Observable.getNotifier(this);
|
|
7206
7299
|
notifier.subscribe(next);
|
|
7207
7300
|
for (const key of ["disabled", "multiple"]) {
|
|
@@ -7213,6 +7306,11 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7213
7306
|
});
|
|
7214
7307
|
this.setValidity();
|
|
7215
7308
|
});
|
|
7309
|
+
if (AnchorPositioningCSSSupported) {
|
|
7310
|
+
const anchorName = uniqueId("--dropdown-anchor-");
|
|
7311
|
+
this.style.setProperty("anchor-name", anchorName);
|
|
7312
|
+
this.listbox.style.setProperty("position-anchor", anchorName);
|
|
7313
|
+
}
|
|
7216
7314
|
}
|
|
7217
7315
|
}
|
|
7218
7316
|
/**
|
|
@@ -7252,11 +7350,9 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7252
7350
|
toggleState(this.elementInternals, "open", next);
|
|
7253
7351
|
this.elementInternals.ariaExpanded = next ? "true" : "false";
|
|
7254
7352
|
this.activeIndex = this.selectedIndex ?? -1;
|
|
7255
|
-
if (
|
|
7256
|
-
|
|
7257
|
-
return;
|
|
7353
|
+
if (!AnchorPositioningCSSSupported) {
|
|
7354
|
+
this.anchorPositionFallback(next);
|
|
7258
7355
|
}
|
|
7259
|
-
_BaseDropdown.AnchorPositionFallbackObserver?.unobserve(this.listbox);
|
|
7260
7356
|
}
|
|
7261
7357
|
/**
|
|
7262
7358
|
* Changes the slotted control element based on the dropdown type.
|
|
@@ -7277,25 +7373,6 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7277
7373
|
get enabledOptions() {
|
|
7278
7374
|
return this.listbox?.enabledOptions ?? [];
|
|
7279
7375
|
}
|
|
7280
|
-
/**
|
|
7281
|
-
* Resets the form value to its initial value when the form is reset.
|
|
7282
|
-
*
|
|
7283
|
-
* @internal
|
|
7284
|
-
*/
|
|
7285
|
-
formResetCallback() {
|
|
7286
|
-
this.enabledOptions.forEach((x, i) => {
|
|
7287
|
-
if (this.multiple) {
|
|
7288
|
-
x.selected = !!x.defaultSelected;
|
|
7289
|
-
return;
|
|
7290
|
-
}
|
|
7291
|
-
if (!x.defaultSelected) {
|
|
7292
|
-
x.selected = false;
|
|
7293
|
-
return;
|
|
7294
|
-
}
|
|
7295
|
-
this.selectOption(i);
|
|
7296
|
-
});
|
|
7297
|
-
this.setValidity();
|
|
7298
|
-
}
|
|
7299
7376
|
/**
|
|
7300
7377
|
* A reference to the first freeform option, if present.
|
|
7301
7378
|
*
|
|
@@ -7445,7 +7522,7 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7445
7522
|
}
|
|
7446
7523
|
const target = e.target;
|
|
7447
7524
|
this.focus();
|
|
7448
|
-
if (target === this.control && !this.isCombobox) {
|
|
7525
|
+
if ((target === this.control || e.composedPath().includes(this.indicator)) && !this.isCombobox) {
|
|
7449
7526
|
this.listbox.togglePopover();
|
|
7450
7527
|
return true;
|
|
7451
7528
|
}
|
|
@@ -7511,6 +7588,25 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7511
7588
|
}
|
|
7512
7589
|
return true;
|
|
7513
7590
|
}
|
|
7591
|
+
/**
|
|
7592
|
+
* Resets the form value to its initial value when the form is reset.
|
|
7593
|
+
*
|
|
7594
|
+
* @internal
|
|
7595
|
+
*/
|
|
7596
|
+
formResetCallback() {
|
|
7597
|
+
this.enabledOptions.forEach((x, i) => {
|
|
7598
|
+
if (this.multiple) {
|
|
7599
|
+
x.selected = !!x.defaultSelected;
|
|
7600
|
+
return;
|
|
7601
|
+
}
|
|
7602
|
+
if (!x.defaultSelected) {
|
|
7603
|
+
x.selected = false;
|
|
7604
|
+
return;
|
|
7605
|
+
}
|
|
7606
|
+
this.selectOption(i);
|
|
7607
|
+
});
|
|
7608
|
+
this.setValidity();
|
|
7609
|
+
}
|
|
7514
7610
|
/**
|
|
7515
7611
|
* Ensures the active index is within bounds of the enabled options. Out-of-bounds indices are wrapped to the opposite
|
|
7516
7612
|
* end of the range.
|
|
@@ -7683,6 +7779,22 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7683
7779
|
}, message ?? this.validationMessage, anchor ?? this.control);
|
|
7684
7780
|
}
|
|
7685
7781
|
}
|
|
7782
|
+
/**
|
|
7783
|
+
* Handles the `slotchange` event for the dropdown.
|
|
7784
|
+
* Sets the `listbox` property when a valid listbox is assigned to the default slot.
|
|
7785
|
+
*
|
|
7786
|
+
* @param e - the slot change event
|
|
7787
|
+
* @internal
|
|
7788
|
+
*/
|
|
7789
|
+
slotchangeHandler(e) {
|
|
7790
|
+
const target = e.target;
|
|
7791
|
+
waitForConnectedDescendants(this, () => {
|
|
7792
|
+
const listbox = target.assignedElements().find(el => isListbox(el));
|
|
7793
|
+
if (listbox) {
|
|
7794
|
+
this.listbox = listbox;
|
|
7795
|
+
}
|
|
7796
|
+
});
|
|
7797
|
+
}
|
|
7686
7798
|
/**
|
|
7687
7799
|
* Updates the freeform option with the provided value.
|
|
7688
7800
|
*
|
|
@@ -7702,52 +7814,60 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7702
7814
|
this.freeformOption.value = value;
|
|
7703
7815
|
this.freeformOption.hidden = false;
|
|
7704
7816
|
}
|
|
7705
|
-
connectedCallback() {
|
|
7706
|
-
super.connectedCallback();
|
|
7707
|
-
this.anchorPositionFallback();
|
|
7708
|
-
}
|
|
7709
7817
|
disconnectedCallback() {
|
|
7710
|
-
_BaseDropdown.AnchorPositionFallbackObserver?.
|
|
7818
|
+
_BaseDropdown.AnchorPositionFallbackObserver?.disconnect();
|
|
7819
|
+
this.debounceController?.abort();
|
|
7711
7820
|
super.disconnectedCallback();
|
|
7712
7821
|
}
|
|
7713
|
-
/**
|
|
7714
|
-
* Handles the connected event for the listbox.
|
|
7715
|
-
*
|
|
7716
|
-
* @param e - the event object
|
|
7717
|
-
* @internal
|
|
7718
|
-
*/
|
|
7719
|
-
listboxConnectedHandler(e) {
|
|
7720
|
-
const target = e.target;
|
|
7721
|
-
if (isListbox(target)) {
|
|
7722
|
-
this.listbox = target;
|
|
7723
|
-
}
|
|
7724
|
-
}
|
|
7725
7822
|
/**
|
|
7726
7823
|
* When anchor positioning isn't supported, an intersection observer is used to flip the listbox when it hits the
|
|
7727
7824
|
* viewport bounds. One static observer is used for all dropdowns.
|
|
7728
7825
|
*
|
|
7729
7826
|
* @internal
|
|
7730
7827
|
*/
|
|
7731
|
-
anchorPositionFallback() {
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
if (
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7828
|
+
anchorPositionFallback(shouldObserve) {
|
|
7829
|
+
if (!_BaseDropdown.AnchorPositionFallbackObserver) {
|
|
7830
|
+
_BaseDropdown.AnchorPositionFallbackObserver = new IntersectionObserver(entries => {
|
|
7831
|
+
entries.forEach(({
|
|
7832
|
+
boundingClientRect,
|
|
7833
|
+
isIntersecting,
|
|
7834
|
+
target
|
|
7835
|
+
}) => {
|
|
7836
|
+
if (isListbox(target)) {
|
|
7837
|
+
if (boundingClientRect.bottom > window.innerHeight) {
|
|
7838
|
+
toggleState(target.elementInternals, "flip-block", true);
|
|
7839
|
+
return;
|
|
7840
|
+
}
|
|
7841
|
+
if (boundingClientRect.top < 0) {
|
|
7842
|
+
toggleState(target.elementInternals, "flip-block", false);
|
|
7843
|
+
}
|
|
7745
7844
|
}
|
|
7746
|
-
}
|
|
7845
|
+
});
|
|
7846
|
+
}, {
|
|
7847
|
+
threshold: 1
|
|
7747
7848
|
});
|
|
7748
|
-
}
|
|
7749
|
-
|
|
7750
|
-
|
|
7849
|
+
}
|
|
7850
|
+
if (shouldObserve) {
|
|
7851
|
+
this.debounceController = new AbortController();
|
|
7852
|
+
_BaseDropdown.AnchorPositionFallbackObserver.observe(this.listbox);
|
|
7853
|
+
window.addEventListener("scroll", this.repositionListbox, {
|
|
7854
|
+
passive: true,
|
|
7855
|
+
capture: true,
|
|
7856
|
+
signal: this.debounceController.signal
|
|
7857
|
+
});
|
|
7858
|
+
window.addEventListener("resize", this.repositionListbox, {
|
|
7859
|
+
passive: true,
|
|
7860
|
+
signal: this.debounceController.signal
|
|
7861
|
+
});
|
|
7862
|
+
this.repositionListbox();
|
|
7863
|
+
return;
|
|
7864
|
+
}
|
|
7865
|
+
_BaseDropdown.AnchorPositionFallbackObserver.unobserve(this.listbox);
|
|
7866
|
+
this.debounceController?.abort();
|
|
7867
|
+
if (this.frameId) {
|
|
7868
|
+
cancelAnimationFrame(this.frameId);
|
|
7869
|
+
this.frameId = void 0;
|
|
7870
|
+
}
|
|
7751
7871
|
}
|
|
7752
7872
|
};
|
|
7753
7873
|
/**
|
|
@@ -7778,7 +7898,6 @@ __decorateClass$z([attr({
|
|
|
7778
7898
|
mode: "fromView"
|
|
7779
7899
|
})], _BaseDropdown.prototype, "initialValue", 2);
|
|
7780
7900
|
__decorateClass$z([observable], _BaseDropdown.prototype, "listbox", 2);
|
|
7781
|
-
__decorateClass$z([observable], _BaseDropdown.prototype, "listboxSlot", 2);
|
|
7782
7901
|
__decorateClass$z([attr({
|
|
7783
7902
|
mode: "boolean"
|
|
7784
7903
|
})], _BaseDropdown.prototype, "multiple", 2);
|
|
@@ -7814,15 +7933,12 @@ __decorateClass$y([attr], Dropdown.prototype, "size", 2);
|
|
|
7814
7933
|
const styles$s = css`
|
|
7815
7934
|
${display("inline-flex")}
|
|
7816
7935
|
|
|
7817
|
-
:host{anchor-name:--dropdown-trigger;box-sizing:border-box;color:${colorNeutralForeground1};cursor:pointer}:host(${placeholderShownState}){color:${colorNeutralForeground4}}.control{appearance:none;background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border
|
|
7936
|
+
:host{anchor-name:--dropdown-trigger;box-sizing:border-box;color:${colorNeutralForeground1};cursor:pointer}:host(${placeholderShownState}){color:${colorNeutralForeground4}}.control{appearance:none;background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:${strokeWidthThin} solid ${colorTransparentStroke};box-shadow:inset 0 0 0 ${strokeWidthThin} var(--control-border-color);box-sizing:border-box;color:inherit;column-gap:${spacingHorizontalXXS};display:inline-flex;justify-content:space-between;min-width:160px;overflow:hidden;padding:${spacingVerticalSNudge} ${spacingHorizontalMNudge};position:relative;text-align:start;width:100%;z-index:1;${typographyBody1Styles}}:host([size='small']) .control{column-gap:${spacingHorizontalXXS};padding:${spacingVerticalXS} ${spacingHorizontalSNudge};${typographyCaption1Styles}}:host([size='large']) .control{column-gap:${spacingHorizontalS};padding:${spacingVerticalS} ${spacingHorizontalM};${typographyBody2Styles}}::slotted(:is(input,button)){all:unset;flex:1 1 auto}::slotted(button){cursor:pointer}::slotted(input){cursor:text}:where(slot[name='indicator'] > *,::slotted([slot='indicator'])){all:unset;align-items:center;appearance:none;aspect-ratio:1;color:${colorNeutralForeground3};display:inline-flex;justify-content:center;width:20px}:host([size='small']) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){width:16px}:host([size='large']) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){width:24px}.control::after,.control::before{content:'' / '';inset:auto 0 0;pointer-events:none;position:absolute}.control::before{height:${strokeWidthThin}}.control::after{background-color:${colorCompoundBrandStroke};height:${strokeWidthThick};scale:0 1;transition:scale ${durationUltraFast} ${curveDecelerateMid}}:host(:where(:focus-within)) .control{border-radius:${borderRadiusMedium};box-shadow:inset 0 0 0 1px ${colorStrokeFocus1};outline:${strokeWidthThick} solid ${colorStrokeFocus2}}:host(:where(${openState},:focus-within)) .control::after{scale:1 1;transition-duration:${durationNormal};transition-timing-function:${curveAccelerateMid}}:host(:where([appearance='outline'],[appearance='transparent'])) .control::before{background-color:${colorNeutralStrokeAccessible}}:host([appearance='transparent']) .control{--control-border-color:${colorTransparentStrokeInteractive};background-color:${colorTransparentBackground};border-radius:${borderRadiusNone}}:host([appearance='outline']) .control{--control-border-color:${colorNeutralStroke1}}:host([appearance='outline']) .control:hover{--control-border-color:${colorNeutralStroke1Hover}}:host(:where([appearance='outline'],[appearance='transparent'])) .control:hover::before{background-color:${colorNeutralStrokeAccessibleHover}}:host([appearance='outline']) .control:hover::after{background-color:${colorCompoundBrandBackgroundHover}}:host([appearance='outline']) .control:active{--control-border-color:${colorNeutralStroke1Pressed}}:host(:where([appearance='outline'],[appearance='transparent'])) .control:active::before{background-color:${colorNeutralStrokeAccessiblePressed}}:host(:where([appearance='outline'],[appearance='transparent'])) .control:active::after{background-color:${colorCompoundBrandBackgroundPressed}}:host([appearance='filled-darker']) .control{background-color:${colorNeutralBackground3}}:host(:where([appearance='filled-lighter'],[appearance='filled-darker'])) .control{--control-border-color:${colorTransparentStroke}}:host(:disabled),:host(:disabled) ::slotted(:where(button,input)){cursor:not-allowed}:host(:disabled) .control::before,:host(:disabled) .control::after{content:none}:host(:disabled) .control:is(*,:active,:hover),:host(:disabled) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){--control-border-color:${colorNeutralStrokeDisabled};background-color:${colorNeutralBackgroundDisabled};color:${colorNeutralForegroundDisabled}}::slotted([popover]:not(:popover-open)){display:none}@supports not (anchor-name:--anchor){:host{--listbox-max-height:50vh;--margin-offset:calc(${lineHeightBase300} + (${spacingVerticalSNudge} * 2) + ${strokeWidthThin})}:host([size='small']){--margin-offset:calc(${lineHeightBase200} + (${spacingVerticalXS} * 2) + ${strokeWidthThin})}:host([size='large']){--margin-offset:calc(${lineHeightBase400} + (${spacingVerticalS} * 2) + ${strokeWidthThin})}}@media (forced-colors:active){:host(:disabled) .control{border-color:GrayText}:host(:disabled) :where(slot[name='indicator'] > *,::slotted([slot='indicator'])){color:GrayText}`;
|
|
7818
7937
|
|
|
7819
7938
|
const definition$t = Dropdown.compose({
|
|
7820
7939
|
name: `${FluentDesignSystem.prefix}-dropdown`,
|
|
7821
7940
|
template: template$t,
|
|
7822
|
-
styles: styles$s
|
|
7823
|
-
shadowOptions: {
|
|
7824
|
-
slotAssignment: "manual"
|
|
7825
|
-
}
|
|
7941
|
+
styles: styles$s
|
|
7826
7942
|
});
|
|
7827
7943
|
|
|
7828
7944
|
definition$t.define(FluentDesignSystem.registry);
|
|
@@ -7887,15 +8003,6 @@ class BaseField extends FASTElement {
|
|
|
7887
8003
|
*/
|
|
7888
8004
|
messageSlotChanged(prev, next) {
|
|
7889
8005
|
toggleState(this.elementInternals, "has-message", !!next.length);
|
|
7890
|
-
if (!next.length) {
|
|
7891
|
-
this.removeEventListener("invalid", this.invalidHandler, {
|
|
7892
|
-
capture: true
|
|
7893
|
-
});
|
|
7894
|
-
return;
|
|
7895
|
-
}
|
|
7896
|
-
this.addEventListener("invalid", this.invalidHandler, {
|
|
7897
|
-
capture: true
|
|
7898
|
-
});
|
|
7899
8006
|
}
|
|
7900
8007
|
/**
|
|
7901
8008
|
* Sets the `input` property to the first slotted input.
|
|
@@ -7905,9 +8012,9 @@ class BaseField extends FASTElement {
|
|
|
7905
8012
|
* @internal
|
|
7906
8013
|
*/
|
|
7907
8014
|
slottedInputsChanged(prev, next) {
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
this.
|
|
8015
|
+
const filtered = next?.filter(node => node.nodeType === Node.ELEMENT_NODE) ?? [];
|
|
8016
|
+
if (filtered?.length) {
|
|
8017
|
+
this.input = filtered?.[0];
|
|
7911
8018
|
}
|
|
7912
8019
|
}
|
|
7913
8020
|
/**
|
|
@@ -7920,6 +8027,11 @@ class BaseField extends FASTElement {
|
|
|
7920
8027
|
if (next) {
|
|
7921
8028
|
this.setStates();
|
|
7922
8029
|
this.setLabelProperties();
|
|
8030
|
+
this.slottedInputObserver.observe(this.input, {
|
|
8031
|
+
attributes: true,
|
|
8032
|
+
attributeFilter: ["disabled", "required", "readonly"],
|
|
8033
|
+
subtree: true
|
|
8034
|
+
});
|
|
7923
8035
|
}
|
|
7924
8036
|
}
|
|
7925
8037
|
/**
|
|
@@ -7945,6 +8057,22 @@ class BaseField extends FASTElement {
|
|
|
7945
8057
|
}
|
|
7946
8058
|
return true;
|
|
7947
8059
|
}
|
|
8060
|
+
connectedCallback() {
|
|
8061
|
+
super.connectedCallback();
|
|
8062
|
+
this.addEventListener("invalid", this.invalidHandler, {
|
|
8063
|
+
capture: true
|
|
8064
|
+
});
|
|
8065
|
+
this.slottedInputObserver = new MutationObserver(() => {
|
|
8066
|
+
this.setStates();
|
|
8067
|
+
});
|
|
8068
|
+
}
|
|
8069
|
+
disconnectedCallback() {
|
|
8070
|
+
this.slottedInputObserver.disconnect();
|
|
8071
|
+
this.removeEventListener("invalid", this.invalidHandler, {
|
|
8072
|
+
capture: true
|
|
8073
|
+
});
|
|
8074
|
+
super.disconnectedCallback();
|
|
8075
|
+
}
|
|
7948
8076
|
/**
|
|
7949
8077
|
* Applies the `focus-visible` state to the element when the slotted input receives visible focus.
|
|
7950
8078
|
*
|
|
@@ -7991,7 +8119,6 @@ class BaseField extends FASTElement {
|
|
|
7991
8119
|
if (label instanceof HTMLLabelElement) {
|
|
7992
8120
|
label.htmlFor = label.htmlFor || this.input.id;
|
|
7993
8121
|
label.id = label.id || `${this.input.id}--label`;
|
|
7994
|
-
label.setAttribute("aria-hidden", "true");
|
|
7995
8122
|
this.input.setAttribute("aria-labelledby", label.id);
|
|
7996
8123
|
}
|
|
7997
8124
|
});
|
|
@@ -8011,7 +8138,7 @@ class BaseField extends FASTElement {
|
|
|
8011
8138
|
}
|
|
8012
8139
|
}
|
|
8013
8140
|
setValidationStates() {
|
|
8014
|
-
if (!this.input
|
|
8141
|
+
if (!this.input?.validity) {
|
|
8015
8142
|
return;
|
|
8016
8143
|
}
|
|
8017
8144
|
for (const [flag, value] of Object.entries(ValidationFlags)) {
|
|
@@ -8045,16 +8172,9 @@ __decorateClass$w([attr({
|
|
|
8045
8172
|
const styles$r = css`
|
|
8046
8173
|
${display("inline-grid")}
|
|
8047
8174
|
|
|
8048
|
-
:host{color:${colorNeutralForeground1};align-items:center;gap:0 ${spacingHorizontalM};justify-items:start
|
|
8175
|
+
:host{color:${colorNeutralForeground1};align-items:center;gap:0 ${spacingHorizontalM};justify-items:start}:has([slot='message']){color:${colorNeutralForeground1};row-gap:${spacingVerticalS}}:not(::slotted([slot='label'])){gap:0}:host([label-position='before']){grid-template-areas:'label input' 'label message'}:host([label-position='after']){gap:0;grid-template-areas:'input label' 'message message';grid-template-columns:auto 1fr}:host([label-position='after']) ::slotted([slot='input']){margin-inline-end:${spacingHorizontalM}}:host([label-position='above']){grid-template-areas:'label' 'input' 'message';row-gap:${spacingVerticalXXS}}:host([label-position='below']){grid-template-areas:'input' 'label' 'message';justify-items:center}:host([label-position='below']) ::slotted([slot='label']){margin-block-start:${spacingVerticalM}}:host(${requiredState}) ::slotted([slot='label'])::after{content:'*' / '';color:${colorPaletteRedForeground1};margin-inline-start:${spacingHorizontalXS}}::slotted([slot='input']){grid-area:input}::slotted([slot='message']){color:${colorNeutralForeground3};font-family:${fontFamilyBase};font-size:${fontSizeBase200};font-weight:${fontWeightRegular};grid-area:message;line-height:${lineHeightBase200};margin-block-start:${spacingVerticalXXS}}:host(${focusVisibleState}:focus-within){border-radius:${borderRadiusMedium};outline:${strokeWidthThick} solid ${colorStrokeFocus2}}::slotted(label),::slotted([slot='label']){cursor:inherit;display:inline-flex;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};grid-area:label;line-height:${lineHeightBase300};justify-self:stretch;user-select:none}:host([size='small']) ::slotted(label){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host([size='large']) ::slotted(label){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='large']) ::slotted(label),:host([weight='semibold']) ::slotted(label){font-weight:${fontWeightSemibold}}:host(${disabledState}){cursor:default}::slotted([flag]){display:none}:host(${badInputState}) ::slotted([flag='${ValidationFlags.badInput}']),:host(${customErrorState}) ::slotted([flag='${ValidationFlags.customError}']),:host(${patternMismatchState}) ::slotted([flag='${ValidationFlags.patternMismatch}']),:host(${rangeOverflowState}) ::slotted([flag='${ValidationFlags.rangeOverflow}']),:host(${rangeUnderflowState}) ::slotted([flag='${ValidationFlags.rangeUnderflow}']),:host(${stepMismatchState}) ::slotted([flag='${ValidationFlags.stepMismatch}']),:host(${tooLongState}) ::slotted([flag='${ValidationFlags.tooLong}']),:host(${tooShortState}) ::slotted([flag='${ValidationFlags.tooShort}']),:host(${typeMismatchState}) ::slotted([flag='${ValidationFlags.typeMismatch}']),:host(${valueMissingState}) ::slotted([flag='${ValidationFlags.valueMissing}']),:host(${validState}) ::slotted([flag='${ValidationFlags.valid}']){display:block}`;
|
|
8049
8176
|
|
|
8050
|
-
const template$s = html`<template @click="${(x, c) => x.clickHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" ${
|
|
8051
|
-
property: "slottedInputs",
|
|
8052
|
-
attributes: true,
|
|
8053
|
-
attributeFilter: ["disabled", "required", "readonly"],
|
|
8054
|
-
subtree: true,
|
|
8055
|
-
selector: '[slot="input"]',
|
|
8056
|
-
filter: elements()
|
|
8057
|
-
})}><slot name="label" part="label" ${slotted("labelSlot")}></slot><slot name="input" part="input"></slot><slot name="message" part="message" ${slotted({
|
|
8177
|
+
const template$s = html`<template @click="${(x, c) => x.clickHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}"><slot name="label" part="label" ${slotted("labelSlot")}></slot><slot name="input" part="input" ${slotted("slottedInputs")}></slot><slot name="message" part="message" ${slotted({
|
|
8058
8178
|
property: "messageSlot",
|
|
8059
8179
|
filter: elements("[flag]")
|
|
8060
8180
|
})}></slot></template>`;
|
|
@@ -8134,7 +8254,7 @@ const styles$p = css`
|
|
|
8134
8254
|
:host{color:${colorNeutralForeground1};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};user-select:none}.asterisk{color:${colorPaletteRedForeground1};margin-inline-start:${spacingHorizontalXS}}:host([size='small']){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host([size='large']){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host(:is([size='large'],[weight='semibold'])){font-weight:${fontWeightSemibold}}:host([disabled]),:host([disabled]) .asterisk{color:${colorNeutralForegroundDisabled}}`;
|
|
8135
8255
|
|
|
8136
8256
|
function labelTemplate() {
|
|
8137
|
-
return html`<slot></slot><span part="asterisk" class="asterisk" ?hidden="${x => !x.required}">*</span>`;
|
|
8257
|
+
return html`<slot></slot><span part="asterisk" class="asterisk" aria-hidden="true" ?hidden="${x => !x.required}">*</span>`;
|
|
8138
8258
|
}
|
|
8139
8259
|
const template$q = labelTemplate();
|
|
8140
8260
|
|
|
@@ -8283,10 +8403,6 @@ class Listbox extends FASTElement {
|
|
|
8283
8403
|
}
|
|
8284
8404
|
return true;
|
|
8285
8405
|
}
|
|
8286
|
-
connectedCallback() {
|
|
8287
|
-
super.connectedCallback();
|
|
8288
|
-
this.$emit("connected");
|
|
8289
|
-
}
|
|
8290
8406
|
/**
|
|
8291
8407
|
* Handles observable subscriptions for the listbox.
|
|
8292
8408
|
*
|
|
@@ -8326,6 +8442,20 @@ class Listbox extends FASTElement {
|
|
|
8326
8442
|
}
|
|
8327
8443
|
this.selectedIndex = selectedIndex;
|
|
8328
8444
|
}
|
|
8445
|
+
/**
|
|
8446
|
+
* Handles the `slotchange` event for the default slot.
|
|
8447
|
+
* Sets the `options` property to the list of slotted options.
|
|
8448
|
+
*
|
|
8449
|
+
* @param e - The slotchange event
|
|
8450
|
+
* @public
|
|
8451
|
+
*/
|
|
8452
|
+
slotchangeHandler(e) {
|
|
8453
|
+
const target = e.target;
|
|
8454
|
+
waitForConnectedDescendants(this, () => {
|
|
8455
|
+
const options = target.assignedElements().filter(option => isDropdownOption(option));
|
|
8456
|
+
this.options = options;
|
|
8457
|
+
});
|
|
8458
|
+
}
|
|
8329
8459
|
}
|
|
8330
8460
|
__decorateClass$s([attr({
|
|
8331
8461
|
attribute: "id",
|
|
@@ -8339,13 +8469,10 @@ __decorateClass$s([observable], Listbox.prototype, "dropdown", 2);
|
|
|
8339
8469
|
const styles$n = css`
|
|
8340
8470
|
${display("inline-flex")}
|
|
8341
8471
|
|
|
8342
|
-
:host{background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border
|
|
8472
|
+
:host{background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:${strokeWidthThin} solid ${colorTransparentStroke};box-shadow:${shadow16};box-sizing:border-box;flex-direction:column;margin:0;min-width:160px;padding:${spacingHorizontalXS};row-gap:${spacingHorizontalXXS};width:auto}:host([popover]){inset:unset;overflow:auto}@supports (anchor-name:--anchor){:host([popover]){position:absolute;margin-block-start:0;max-height:var(--listbox-max-height,calc(50vh - anchor-size(self-block)));min-width:anchor-size(width);position-anchor:--dropdown;position-area:block-end span-inline-end;position-try-fallbacks:flip-inline,flip-block,--flip-block,block-start}@position-try --flip-block{bottom:anchor(top);top:unset}}@supports not (anchor-name:--anchor){:host([popover]){margin-block-start:var(--margin-offset,0);max-height:var(--listbox-max-height,50vh);position:fixed}:host([popover]${flipBlockState}){margin-block-start:revert;translate:0 -100%}}`;
|
|
8343
8473
|
|
|
8344
8474
|
function listboxTemplate() {
|
|
8345
|
-
return html`<template id="${x => x.id}" @beforetoggle="${(x, c) => x.beforetoggleHandler(c.event)}" @click="${(x, c) => x.clickHandler(c.event)}"><slot ${
|
|
8346
|
-
property: "options",
|
|
8347
|
-
filter: node => isDropdownOption(node)
|
|
8348
|
-
})}></slot></template>`;
|
|
8475
|
+
return html`<template id="${x => x.id}" @beforetoggle="${(x, c) => x.beforetoggleHandler(c.event)}" @click="${(x, c) => x.clickHandler(c.event)}"><slot @slotchange="${(x, c) => x.slotchangeHandler(c.event)}"></slot></template>`;
|
|
8349
8476
|
}
|
|
8350
8477
|
const template$o = listboxTemplate();
|
|
8351
8478
|
|
|
@@ -8360,7 +8487,7 @@ definition$o.define(FluentDesignSystem.registry);
|
|
|
8360
8487
|
class MenuButton extends Button {}
|
|
8361
8488
|
|
|
8362
8489
|
const template$n = buttonTemplate$1({
|
|
8363
|
-
end: html.partial(
|
|
8490
|
+
end: html.partial(/* html */
|
|
8364
8491
|
`
|
|
8365
8492
|
<svg slot="end" fill="currentColor" aria-hidden="true" width="1em" height="1em" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
8366
8493
|
<path d="M15.85 7.65c.2.2.2.5 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 8.35a.5.5 0 1 1 .7-.7L10 12.8l5.15-5.16c.2-.2.5-.2.7 0Z" fill="currentColor"></path>
|
|
@@ -8395,6 +8522,12 @@ const MenuItemRole = {
|
|
|
8395
8522
|
[MenuItemRole.menuitemcheckbox]: "menuitemcheckbox",
|
|
8396
8523
|
[MenuItemRole.menuitemradio]: "menuitemradio"
|
|
8397
8524
|
});
|
|
8525
|
+
function isMenuItem(element, tagName = "-menu-item") {
|
|
8526
|
+
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
8527
|
+
return false;
|
|
8528
|
+
}
|
|
8529
|
+
return element.tagName.toLowerCase().endsWith(tagName);
|
|
8530
|
+
}
|
|
8398
8531
|
|
|
8399
8532
|
var __defProp$r = Object.defineProperty;
|
|
8400
8533
|
var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
|
|
@@ -8607,7 +8740,7 @@ applyMixins(MenuItem, StartEnd);
|
|
|
8607
8740
|
const styles$m = css`
|
|
8608
8741
|
${display("grid")}
|
|
8609
8742
|
|
|
8610
|
-
:host{--indent:0;align-items:center;background:${colorNeutralBackground1};border-radius:${borderRadiusMedium};color:${colorNeutralForeground2};contain:layout;cursor:pointer;flex-shrink:0;font:${fontWeightRegular} ${fontSizeBase300} / ${lineHeightBase300} ${fontFamilyBase};grid-gap:4px;grid-template-columns:20px 20px auto 20px;height:32px;overflow:visible;padding:0 10px}:host(:hover){background:${colorNeutralBackground1Hover};color:${colorNeutralForeground2Hover}}:host(:active){background-color:${colorNeutralBackground1Selected};color:${colorNeutralForeground2Pressed}}:host(:active) ::slotted([slot='start']){color:${colorCompoundBrandForeground1Pressed}}:host(${disabledState}){background-color:${colorNeutralBackgroundDisabled};color:${colorNeutralForegroundDisabled}}:host(${disabledState}) ::slotted([slot='start']),:host(${disabledState}) ::slotted([slot='end']){color:${colorNeutralForegroundDisabled}}:host(:focus-visible){border-radius:${borderRadiusMedium};outline:2px solid ${colorStrokeFocus2}}.content{white-space:nowrap;flex-grow:1;grid-column:auto / span 2;padding:0 2px}:host(:not(${checkedState})) .indicator,:host(:not(${checkedState})) ::slotted([slot='indicator']),:host(:not(${submenuState})) .submenu-glyph,:host(:not(${submenuState})) ::slotted([slot='submenu-glyph']){display:none}::slotted([slot='end']){color:${colorNeutralForeground3};font:${fontWeightRegular} ${fontSizeBase200} / ${lineHeightBase200} ${fontFamilyBase};white-space:nowrap}:host([data-indent='1']){--indent:1}:host([data-indent='2']){--indent:2;grid-template-columns:20px 20px auto auto}:host(${submenuState}){grid-template-columns:20px auto auto 20px}:host([data-indent='2']${submenuState}){grid-template-columns:20px 20px auto auto 20px}.indicator,::slotted([slot='indicator']){grid-column:1 / span 1;width:20px}::slotted([slot='start']){display:inline-flex;grid-column:calc(var(--indent)) / span 1}.content{grid-column:calc(var(--indent) + 1) / span 1}::slotted([slot='end']){grid-column:calc(var(--indent) + 2) / span 1;justify-self:end}.submenu-glyph,::slotted([slot='submenu-glyph']){grid-column:-2 / span 1;justify-self:end}@layer popover{:host{anchor-name:--menu-trigger;position:relative}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position:absolute;position-anchor:--menu-trigger;position-area:inline-end span-block-end;position-try-fallbacks:flip-inline;z-index:1}::slotted([popover]:not(:popover-open)){display:none}::slotted([popover]:popover-open){inset:unset}@supports not (anchor-name:--menu-trigger){::slotted([popover]){align-self:start}}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
8743
|
+
:host{--indent:0;align-items:center;background:${colorNeutralBackground1};border-radius:${borderRadiusMedium};color:${colorNeutralForeground2};contain:layout;cursor:pointer;flex-shrink:0;font:${fontWeightRegular} ${fontSizeBase300} / ${lineHeightBase300} ${fontFamilyBase};grid-gap:4px;grid-template-columns:20px 20px auto 20px;height:32px;overflow:visible;padding:0 10px}:host(:hover){background:${colorNeutralBackground1Hover};color:${colorNeutralForeground2Hover}}:host(:active){background-color:${colorNeutralBackground1Selected};color:${colorNeutralForeground2Pressed}}:host(:active) ::slotted([slot='start']){color:${colorCompoundBrandForeground1Pressed}}:host(${disabledState}){background-color:${colorNeutralBackgroundDisabled};color:${colorNeutralForegroundDisabled}}:host(${disabledState}) ::slotted([slot='start']),:host(${disabledState}) ::slotted([slot='end']){color:${colorNeutralForegroundDisabled}}:host(:focus-visible){border-radius:${borderRadiusMedium};outline:2px solid ${colorStrokeFocus2}}.content{white-space:nowrap;flex-grow:1;grid-column:auto / span 2;padding:0 2px}:host(:not(${checkedState})) .indicator,:host(:not(${checkedState})) ::slotted([slot='indicator']),:host(:not(${submenuState})) .submenu-glyph,:host(:not(${submenuState})) ::slotted([slot='submenu-glyph']){display:none}::slotted([slot='end']){color:${colorNeutralForeground3};font:${fontWeightRegular} ${fontSizeBase200} / ${lineHeightBase200} ${fontFamilyBase};white-space:nowrap}:host([data-indent='1']){--indent:1}:host([data-indent='2']){--indent:2;grid-template-columns:20px 20px auto auto}:host(${submenuState}){grid-template-columns:20px auto auto 20px}:host([data-indent='2']${submenuState}){grid-template-columns:20px 20px auto auto 20px}.indicator,::slotted([slot='indicator']){grid-column:1 / span 1;width:20px}::slotted([slot='start']){display:inline-flex;grid-column:calc(var(--indent)) / span 1}.content{grid-column:calc(var(--indent) + 1) / span 1}::slotted([slot='end']){grid-column:calc(var(--indent) + 2) / span 1;justify-self:end}.submenu-glyph,::slotted([slot='submenu-glyph']){grid-column:-2 / span 1;justify-self:end}@layer popover{:host{anchor-name:--menu-trigger;position:relative}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position:absolute;position-anchor:--menu-trigger;position-area:inline-end span-block-end;position-try-fallbacks:flip-inline,block-start,block-end;z-index:1}::slotted([popover]:not(:popover-open)){display:none}::slotted([popover]:popover-open){inset:unset}@supports not (anchor-name:--menu-trigger){::slotted([popover]){align-self:start}}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
8611
8744
|
:host(${disabledState}),:host(${disabledState}) ::slotted([slot='start']),:host(${disabledState}) ::slotted([slot='end']){color:GrayText}`));
|
|
8612
8745
|
|
|
8613
8746
|
const Checkmark16Filled = html.partial(`<svg class="indicator" fill="currentColor" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.05 3.49c.28.3.27.77-.04 1.06l-7.93 7.47A.85.85 0 014.9 12L2.22 9.28a.75.75 0 111.06-1.06l2.24 2.27 7.47-7.04a.75.75 0 011.06.04z" fill="currentColor"></path></svg>`);
|
|
@@ -8718,7 +8851,7 @@ const _MenuList = class _MenuList extends FASTElement {
|
|
|
8718
8851
|
* check if the item is a menu item
|
|
8719
8852
|
*/
|
|
8720
8853
|
this.isMenuItemElement = el => {
|
|
8721
|
-
return el
|
|
8854
|
+
return isMenuItem(el) || isHTMLElement(el) && el.getAttribute("role") in _MenuList.focusableElementRoles;
|
|
8722
8855
|
};
|
|
8723
8856
|
/**
|
|
8724
8857
|
* check if the item is focusable
|
|
@@ -8818,9 +8951,7 @@ const _MenuList = class _MenuList extends FASTElement {
|
|
|
8818
8951
|
return Math.max(accum, elementValue);
|
|
8819
8952
|
}, 0);
|
|
8820
8953
|
filteredMenuListItems?.forEach(item => {
|
|
8821
|
-
|
|
8822
|
-
item.setAttribute("data-indent", `${indent}`);
|
|
8823
|
-
}
|
|
8954
|
+
item.dataset.indent = `${indent}`;
|
|
8824
8955
|
});
|
|
8825
8956
|
}
|
|
8826
8957
|
/**
|
|
@@ -8931,10 +9062,12 @@ class Menu extends FASTElement {
|
|
|
8931
9062
|
*/
|
|
8932
9063
|
this.toggleHandler = e => {
|
|
8933
9064
|
if (e.type === "toggle" && e.newState) {
|
|
8934
|
-
const newState = e.newState === "open"
|
|
9065
|
+
const newState = e.newState === "open";
|
|
8935
9066
|
this._trigger?.setAttribute("aria-expanded", `${newState}`);
|
|
8936
9067
|
this._open = newState;
|
|
8937
|
-
this.
|
|
9068
|
+
if (this._open) {
|
|
9069
|
+
this.focusMenuList();
|
|
9070
|
+
}
|
|
8938
9071
|
}
|
|
8939
9072
|
};
|
|
8940
9073
|
/**
|
|
@@ -8977,7 +9110,9 @@ class Menu extends FASTElement {
|
|
|
8977
9110
|
*/
|
|
8978
9111
|
connectedCallback() {
|
|
8979
9112
|
super.connectedCallback();
|
|
8980
|
-
|
|
9113
|
+
queueMicrotask(() => {
|
|
9114
|
+
this.setComponent();
|
|
9115
|
+
});
|
|
8981
9116
|
}
|
|
8982
9117
|
/**
|
|
8983
9118
|
* Called when the element is disconnected from the DOM.
|
|
@@ -9332,6 +9467,7 @@ class DropdownOption extends FASTElement {
|
|
|
9332
9467
|
disabledChanged(prev, next) {
|
|
9333
9468
|
this.elementInternals.ariaDisabled = this.disabled ? "true" : "false";
|
|
9334
9469
|
toggleState(this.elementInternals, "disabled", this.disabled);
|
|
9470
|
+
this.setFormValue(!this.disabled && this.selected ? this.value : null);
|
|
9335
9471
|
}
|
|
9336
9472
|
/**
|
|
9337
9473
|
* Sets the disabled state when the `disabled` attribute changes.
|
|
@@ -9510,10 +9646,10 @@ const styles$i = css`
|
|
|
9510
9646
|
${display("inline-grid")}
|
|
9511
9647
|
|
|
9512
9648
|
:host{-webkit-tap-highlight-color:transparent;${typographyBody1Styles}
|
|
9513
|
-
align-items:center;background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};
|
|
9514
|
-
'indicator start description'}::slotted([slot='description']){color:${colorNeutralForeground3};grid-area:description;${typographyCaption1Styles}}`;
|
|
9649
|
+
align-items:center;background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};box-sizing:border-box;color:${colorNeutralForeground2};column-gap:${spacingHorizontalXS};cursor:pointer;grid-template-areas:'indicator start content';grid-template-columns:auto auto 1fr;min-height:32px;padding:${spacingHorizontalSNudge};text-align:start}.content{grid-area:content;line-height:1}::slotted([slot='start']){grid-area:start}:host(:hover){background-color:${colorNeutralBackground1Hover};color:${colorNeutralForeground2Hover}}:host(:active){background-color:${colorNeutralBackground1Pressed};color:${colorNeutralForeground2Pressed}}:host(:disabled){background-color:${colorNeutralBackground1};color:${colorNeutralForegroundDisabled};cursor:default}.checkmark-16-filled{fill:currentColor;width:16px}slot[name='checked-indicator'] > *,::slotted([slot='checked-indicator']){aspect-ratio:1;flex:0 0 auto;grid-area:indicator;visibility:hidden}:host(${selectedState}) :is(slot[name='checked-indicator'] > *,::slotted([slot='checked-indicator'])){visibility:visible}:host(${multipleState}) .checkmark-16-filled,:host(:not(${multipleState})) .checkmark-12-regular{display:none}:host(${multipleState}) .checkmark-12-regular{background-color:${colorNeutralBackground1};border-radius:${borderRadiusSmall};border:${strokeWidthThin} solid ${colorNeutralStrokeAccessible};box-sizing:border-box;cursor:pointer;fill:transparent;position:relative;visibility:visible;width:16px}:host(${multipleState}${selectedState}) .checkmark-12-regular{background-color:${colorCompoundBrandBackground};border-color:${colorCompoundBrandStroke};fill:${colorNeutralForegroundInverted}}:host(:disabled${multipleState}) .checkmark-12-regular{border-color:${colorNeutralStrokeDisabled}}:host(:disabled${multipleState}${selectedState}) .checkmark-12-regular{background-color:${colorNeutralBackgroundDisabled}}:host(${activeState}){border:${strokeWidthThick} solid ${colorStrokeFocus2}}@supports (selector(:host(:has(*)))){:host(:has([slot='start']:not([size='16']))){column-gap:${spacingHorizontalSNudge}}}:host(${descriptionState}){column-gap:${spacingHorizontalSNudge};grid-template-areas:'indicator start content'
|
|
9650
|
+
'indicator start description'}::slotted([slot='description']){color:${colorNeutralForeground3};grid-area:description;${typographyCaption1Styles}}@media (forced-colors:active){:host(:disabled){color:GrayText}}`;
|
|
9515
9651
|
|
|
9516
|
-
const checkedIndicator$1 = html.partial(
|
|
9652
|
+
const checkedIndicator$1 = html.partial(/* html */
|
|
9517
9653
|
`
|
|
9518
9654
|
<svg aria-hidden="true" class="checkmark-16-filled" viewBox="0 0 16 16">
|
|
9519
9655
|
<path
|
|
@@ -9585,6 +9721,7 @@ class BaseProgressBar extends FASTElement {
|
|
|
9585
9721
|
*/
|
|
9586
9722
|
valueChanged(prev, next) {
|
|
9587
9723
|
this.elementInternals.ariaValueNow = typeof next === "number" ? `${next}` : null;
|
|
9724
|
+
this.setIndicatorWidth();
|
|
9588
9725
|
}
|
|
9589
9726
|
/**
|
|
9590
9727
|
* Updates the percent complete when the `min` property changes.
|
|
@@ -9594,6 +9731,7 @@ class BaseProgressBar extends FASTElement {
|
|
|
9594
9731
|
*/
|
|
9595
9732
|
minChanged(prev, next) {
|
|
9596
9733
|
this.elementInternals.ariaValueMin = typeof next === "number" ? `${next}` : null;
|
|
9734
|
+
this.setIndicatorWidth();
|
|
9597
9735
|
}
|
|
9598
9736
|
/**
|
|
9599
9737
|
* Updates the percent complete when the `max` property changes.
|
|
@@ -9604,15 +9742,29 @@ class BaseProgressBar extends FASTElement {
|
|
|
9604
9742
|
*/
|
|
9605
9743
|
maxChanged(prev, next) {
|
|
9606
9744
|
this.elementInternals.ariaValueMax = typeof next === "number" ? `${next}` : null;
|
|
9745
|
+
this.setIndicatorWidth();
|
|
9746
|
+
}
|
|
9747
|
+
connectedCallback() {
|
|
9748
|
+
super.connectedCallback();
|
|
9749
|
+
this.setIndicatorWidth();
|
|
9607
9750
|
}
|
|
9608
|
-
|
|
9751
|
+
setIndicatorWidth() {
|
|
9752
|
+
if (!this.$fastController.isConnected || CSS.supports("width: attr(value type(<number>))")) {
|
|
9753
|
+
return;
|
|
9754
|
+
}
|
|
9755
|
+
if (typeof this.value !== "number") {
|
|
9756
|
+
this.indicator.style.removeProperty("width");
|
|
9757
|
+
return;
|
|
9758
|
+
}
|
|
9609
9759
|
const min = this.min ?? 0;
|
|
9610
9760
|
const max = this.max ?? 100;
|
|
9611
9761
|
const value = this.value ?? 0;
|
|
9612
9762
|
const range = max - min;
|
|
9613
|
-
|
|
9763
|
+
const width = range === 0 ? 0 : Math.fround((value - min) / range * 100);
|
|
9764
|
+
this.indicator.style.setProperty("width", `${width}%`);
|
|
9614
9765
|
}
|
|
9615
9766
|
}
|
|
9767
|
+
__decorateClass$m([observable], BaseProgressBar.prototype, "indicator", 2);
|
|
9616
9768
|
__decorateClass$m([attr({
|
|
9617
9769
|
attribute: "validation-state"
|
|
9618
9770
|
})], BaseProgressBar.prototype, "validationState", 2);
|
|
@@ -9625,7 +9777,6 @@ __decorateClass$m([attr({
|
|
|
9625
9777
|
__decorateClass$m([attr({
|
|
9626
9778
|
converter: nullableNumberConverter
|
|
9627
9779
|
})], BaseProgressBar.prototype, "max", 2);
|
|
9628
|
-
__decorateClass$m([volatile], BaseProgressBar.prototype, "percentComplete", 1);
|
|
9629
9780
|
|
|
9630
9781
|
var __defProp$l = Object.defineProperty;
|
|
9631
9782
|
var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
|
|
@@ -9642,13 +9793,13 @@ __decorateClass$l([attr], ProgressBar.prototype, "shape", 2);
|
|
|
9642
9793
|
const styles$h = css`
|
|
9643
9794
|
${display("block")}
|
|
9644
9795
|
|
|
9645
|
-
:host{width:100%;height:2px;overflow-x:hidden;background-color:${colorNeutralBackground6};border-radius:${borderRadiusMedium};contain:content}:host([thickness='large']){height:4px}:host([shape='square']){border-radius:${borderRadiusNone}}.indicator{background-color:${colorCompoundBrandBackground};border-radius:inherit;height:100%}:host([value]) .indicator{transition:all 0.2s ease-in-out}:host(:not([value])) .indicator{position:relative;width:33%;background-image:linear-gradient(
|
|
9796
|
+
:host{width:100%;height:2px;overflow-x:hidden;background-color:${colorNeutralBackground6};border-radius:${borderRadiusMedium};contain:content;@supports (width:attr(value type(<number>))){--max:attr(max type(<number>),100);--min:attr(min type(<number>),0);--value:attr(value type(<number>),0);--indicator-width:clamp(0%,calc((var(--value) - var(--min)) / (var(--max) - var(--min)) * 100%),100%)}}:host([thickness='large']){height:4px}:host([shape='square']){border-radius:${borderRadiusNone}}.indicator{background-color:${colorCompoundBrandBackground};border-radius:inherit;height:100%}:host([value]) .indicator{transition:all 0.2s ease-in-out;@supports (width:attr(value type(<number>))){width:var(--indicator-width)}}:host(:not([value])) .indicator{position:relative;width:33%;background-image:linear-gradient(
|
|
9646
9797
|
to right,${colorNeutralBackground6} 0%,${colorTransparentBackground} 50%,${colorNeutralBackground6} 100%
|
|
9647
9798
|
);animation-name:indeterminate;animation-duration:3s;animation-timing-function:linear;animation-iteration-count:infinite}:host([validation-state='error']) .indicator{background-color:${colorPaletteRedBackground3}}:host([validation-state='warning']) .indicator{background-color:${colorPaletteDarkOrangeBackground3}}:host([validation-state='success']) .indicator{background-color:${colorPaletteGreenBackground3}}@layer animations{@media (prefers-reduced-motion:no-preference){:host([value]){transition:none}:host(:not([value])) .indicator{animation-duration:0.01ms;animation-iteration-count:1}}}@keyframes indeterminate{0%{inset-inline-start:-33%}100%{inset-inline-start:100%}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
9648
9799
|
:host{background-color:CanvasText}.indicator,:host(:is([validation-state='success'],[validation-state='warning'],[validation-state='error'])) .indicator{background-color:Highlight}`));
|
|
9649
9800
|
|
|
9650
9801
|
function progressTemplate() {
|
|
9651
|
-
return html`<div class="indicator" part="indicator"
|
|
9802
|
+
return html`<div class="indicator" part="indicator" ${ref("indicator")}></div>`;
|
|
9652
9803
|
}
|
|
9653
9804
|
const template$h = progressTemplate();
|
|
9654
9805
|
|
|
@@ -9661,10 +9812,6 @@ const definition$h = ProgressBar.compose({
|
|
|
9661
9812
|
definition$h.define(FluentDesignSystem.registry);
|
|
9662
9813
|
|
|
9663
9814
|
class Radio extends BaseCheckbox {
|
|
9664
|
-
connectedCallback() {
|
|
9665
|
-
super.connectedCallback();
|
|
9666
|
-
this.tabIndex = this.disabled ? -1 : 0;
|
|
9667
|
-
}
|
|
9668
9815
|
constructor() {
|
|
9669
9816
|
super();
|
|
9670
9817
|
this.elementInternals.role = "radio";
|
|
@@ -9679,9 +9826,6 @@ class Radio extends BaseCheckbox {
|
|
|
9679
9826
|
*/
|
|
9680
9827
|
disabledChanged(prev, next) {
|
|
9681
9828
|
super.disabledChanged(prev, next);
|
|
9682
|
-
if (next) {
|
|
9683
|
-
this.tabIndex = -1;
|
|
9684
|
-
}
|
|
9685
9829
|
this.$emit("disabled", next, {
|
|
9686
9830
|
bubbles: true
|
|
9687
9831
|
});
|
|
@@ -9792,7 +9936,7 @@ class RadioGroup extends FASTElement {
|
|
|
9792
9936
|
if (this.$fastController.isConnected) {
|
|
9793
9937
|
this.checkedIndex = -1;
|
|
9794
9938
|
this.radios?.forEach(radio => {
|
|
9795
|
-
radio.disabled = radio.disabledAttribute || this.disabled;
|
|
9939
|
+
radio.disabled = !!radio.disabledAttribute || !!this.disabled;
|
|
9796
9940
|
});
|
|
9797
9941
|
this.restrictFocus();
|
|
9798
9942
|
}
|
|
@@ -9852,12 +9996,20 @@ class RadioGroup extends FASTElement {
|
|
|
9852
9996
|
radio.checked = index === checkedIndex;
|
|
9853
9997
|
}
|
|
9854
9998
|
radio.name = this.name ?? radio.name;
|
|
9855
|
-
radio.disabled = this.disabled || radio.disabledAttribute;
|
|
9999
|
+
radio.disabled = !!this.disabled || !!radio.disabledAttribute;
|
|
9856
10000
|
});
|
|
9857
10001
|
if (!this.dirtyState && this.initialValue) {
|
|
9858
10002
|
this.value = this.initialValue;
|
|
9859
10003
|
}
|
|
9860
|
-
if (!this.value
|
|
10004
|
+
if (!this.value ||
|
|
10005
|
+
// This logic covers the case when the RadioGroup doesn't have a `value`
|
|
10006
|
+
// attribute, but does have a checked child Radio. Without this condition,
|
|
10007
|
+
// the checked Radio's value will be assigned to `this.value`, and
|
|
10008
|
+
// `checkedIndex` will be the checked Radio's index, but `this.checkedIndex`
|
|
10009
|
+
// will remain `undefined`, which would cause the RadioGroup to add
|
|
10010
|
+
// `tabindex=-1` to the checked Radio, and effectively makes the whole
|
|
10011
|
+
// RadioGroup unfocusable.
|
|
10012
|
+
this.value && typeof this.checkedIndex !== "number" && checkedIndex >= 0) {
|
|
9861
10013
|
this.checkedIndex = checkedIndex;
|
|
9862
10014
|
}
|
|
9863
10015
|
const radioIds = next.map(radio => radio.id).join(" ").trim();
|
|
@@ -10145,17 +10297,43 @@ class RadioGroup extends FASTElement {
|
|
|
10145
10297
|
* @param anchor - Optional anchor to use for the validation message.
|
|
10146
10298
|
*
|
|
10147
10299
|
* @internal
|
|
10300
|
+
* @remarks
|
|
10301
|
+
* RadioGroup validation is reported through the individual Radio elements rather than the RadioGroup itself.
|
|
10302
|
+
* This is necessary because:
|
|
10303
|
+
* 1. Each Radio is form-associated (extends BaseCheckbox which has `formAssociated = true`)
|
|
10304
|
+
* 2. Browser validation UIs and screen readers announce validation against individual form controls
|
|
10305
|
+
* 3. For groups like RadioGroup, the browser needs to report the error on a specific member of the group
|
|
10306
|
+
* 4. We anchor the error to the first Radio so it receives focus and announcement
|
|
10307
|
+
*
|
|
10308
|
+
* When the group is invalid (required but no selection):
|
|
10309
|
+
* - Only the first Radio gets the invalid state with the validation message
|
|
10310
|
+
* - Other Radios are kept valid since selecting any of them would satisfy the requirement
|
|
10311
|
+
*
|
|
10312
|
+
* When the group becomes valid (user selects any Radio):
|
|
10313
|
+
* - All Radios are cleared back to valid state
|
|
10314
|
+
* - This allows form submission to proceed
|
|
10148
10315
|
*/
|
|
10149
10316
|
setValidity(flags, message, anchor) {
|
|
10150
10317
|
if (this.$fastController.isConnected) {
|
|
10151
|
-
|
|
10152
|
-
|
|
10318
|
+
const isInvalid = this.required && !this.value && !this.disabled;
|
|
10319
|
+
if (!isInvalid) {
|
|
10320
|
+
this.enabledRadios?.forEach(radio => {
|
|
10321
|
+
radio.elementInternals.setValidity({});
|
|
10322
|
+
});
|
|
10153
10323
|
return;
|
|
10154
10324
|
}
|
|
10155
|
-
|
|
10156
|
-
valueMissing:
|
|
10325
|
+
const validationFlags = {
|
|
10326
|
+
valueMissing: true,
|
|
10157
10327
|
...flags
|
|
10158
|
-
}
|
|
10328
|
+
};
|
|
10329
|
+
const validationMessage = message ?? this.validationMessage;
|
|
10330
|
+
this.enabledRadios?.forEach((radio, index) => {
|
|
10331
|
+
if (index === 0) {
|
|
10332
|
+
radio.elementInternals.setValidity(validationFlags, validationMessage, radio);
|
|
10333
|
+
} else {
|
|
10334
|
+
radio.elementInternals.setValidity({});
|
|
10335
|
+
}
|
|
10336
|
+
});
|
|
10159
10337
|
}
|
|
10160
10338
|
}
|
|
10161
10339
|
/**
|
|
@@ -10196,7 +10374,7 @@ __decorateClass$k([attr({
|
|
|
10196
10374
|
const styles$g = css`
|
|
10197
10375
|
${display("flex")}
|
|
10198
10376
|
|
|
10199
|
-
:host{-webkit-tap-highlight-color:transparent;cursor:pointer;gap:${spacingVerticalL}}:host([orientation='vertical']){flex-direction:column;justify-content:flex-start}:host([orientation='horizontal']){flex-direction:row}::slotted(*){color:${colorNeutralForeground3}}::slotted(:hover){color:${colorNeutralForeground2}}::slotted(:active){color:${colorNeutralForeground1}}::slotted(${disabledState}){color:${colorNeutralForegroundDisabled}}::slotted(${checkedState}){color:${colorNeutralForeground1}}`;
|
|
10377
|
+
:host{-webkit-tap-highlight-color:transparent;cursor:pointer;gap:${spacingVerticalL}}:host([orientation='vertical']){flex-direction:column;justify-content:flex-start}:host([orientation='horizontal']){flex-direction:row}::slotted(*){color:${colorNeutralForeground3}}::slotted(:hover){color:${colorNeutralForeground2}}::slotted(:active){color:${colorNeutralForeground1}}::slotted(${disabledState}){color:${colorNeutralForegroundDisabled}}::slotted(${checkedState}){color:${colorNeutralForeground1}}:host([slot='input']){margin:${spacingVerticalS} ${spacingHorizontalS}}`;
|
|
10200
10378
|
|
|
10201
10379
|
function radioGroupTemplate() {
|
|
10202
10380
|
return html`<template @disabled="${(x, c) => x.disabledRadioHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @focusout="${(x, c) => x.focusoutHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot @slotchange="${(x, c) => x.slotchangeHandler(c.event)}"></slot></template>`;
|
|
@@ -10217,7 +10395,7 @@ const styles$f = css`
|
|
|
10217
10395
|
:host{--size:16px;aspect-ratio:1;background-color:${colorNeutralBackground1};border:${strokeWidthThin} solid ${colorNeutralStrokeAccessible};border-radius:${borderRadiusCircular};box-sizing:border-box;position:relative;width:var(--size)}:host([size='large']){--size:20px}.checked-indicator{aspect-ratio:1;border-radius:${borderRadiusCircular};color:${colorNeutralForegroundInverted};inset:0;margin:auto;position:absolute;width:calc(var(--size) * 0.625)}:host(:not([slot='input']))::after{content:'' / '';position:absolute;display:block;inset:-8px;box-sizing:border-box;outline:none;border:${strokeWidthThick} solid ${colorTransparentStroke};border-radius:${borderRadiusMedium}}:host(:not([slot='input']):focus-visible)::after{border-color:${colorStrokeFocus2}}:host(:hover){border-color:${colorNeutralStrokeAccessibleHover}}:host(${checkedState}){border-color:${colorCompoundBrandStroke}}:host(${checkedState}) .checked-indicator{background-color:${colorCompoundBrandBackground}}:host(${checkedState}:hover) .checked-indicator{background-color:${colorCompoundBrandBackgroundHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(${checkedState}:active) .checked-indicator{background-color:${colorCompoundBrandBackgroundPressed}}:host(:focus-visible){outline:none}:host(${disabledState}){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}:host(${checkedState}${disabledState}) .checked-indicator{background-color:${colorNeutralStrokeDisabled}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
10218
10396
|
:host{border-color:FieldText}:host(:not([slot='input']:focus-visible))::after{border-color:Canvas}:host(:not(${disabledState}):hover),:host(:not([slot='input']):focus-visible)::after{border-color:Highlight}.checked-indicator{color:HighlightText}:host(${checkedState}) .checked-indicator{background-color:FieldText}:host(${checkedState}:not(${disabledState}):hover) .checked-indicator{background-color:Highlight}:host(${disabledState}){border-color:GrayText;color:GrayText}:host(${disabledState}${checkedState}) .checked-indicator{background-color:GrayText}`));
|
|
10219
10397
|
|
|
10220
|
-
const checkedIndicator = html.partial(
|
|
10398
|
+
const checkedIndicator = html.partial(/* html */
|
|
10221
10399
|
`
|
|
10222
10400
|
<span part="checked-indicator" class="checked-indicator" role="presentation"></span>
|
|
10223
10401
|
`);
|
|
@@ -10244,6 +10422,19 @@ var __decorateClass$j = (decorators, target, key, kind) => {
|
|
|
10244
10422
|
if (kind && result) __defProp$j(target, key, result);
|
|
10245
10423
|
return result;
|
|
10246
10424
|
};
|
|
10425
|
+
const SUPPORTS_ATTR_TYPE = CSS.supports("width: attr(value type(<number>))");
|
|
10426
|
+
const CUSTOM_PROPERTY_NAME = {
|
|
10427
|
+
max: "--_attr-max",
|
|
10428
|
+
value: "--_attr-value",
|
|
10429
|
+
maskImageFilled: "--_mask-image-filled",
|
|
10430
|
+
maskImageOutlined: "--_mask-image-outlined"
|
|
10431
|
+
};
|
|
10432
|
+
function svgToDataURI(svg) {
|
|
10433
|
+
if (!svg) {
|
|
10434
|
+
return "";
|
|
10435
|
+
}
|
|
10436
|
+
return ["data:image/svg+xml", encodeURIComponent(svg.replace(/\n/g, "").replace(/\s+/g, " "))].join(",");
|
|
10437
|
+
}
|
|
10247
10438
|
class BaseRatingDisplay extends FASTElement {
|
|
10248
10439
|
constructor() {
|
|
10249
10440
|
super();
|
|
@@ -10253,16 +10444,20 @@ class BaseRatingDisplay extends FASTElement {
|
|
|
10253
10444
|
* @internal
|
|
10254
10445
|
*/
|
|
10255
10446
|
this.elementInternals = this.attachInternals();
|
|
10256
|
-
this.
|
|
10447
|
+
this.defaultCustomIconViewBox = "0 0 20 20";
|
|
10257
10448
|
this.elementInternals.role = "img";
|
|
10449
|
+
this.numberFormatter = new Intl.NumberFormat();
|
|
10258
10450
|
}
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10451
|
+
maxChanged() {
|
|
10452
|
+
this.setCustomPropertyValue("max");
|
|
10453
|
+
}
|
|
10454
|
+
valueChanged() {
|
|
10455
|
+
this.setCustomPropertyValue("value");
|
|
10456
|
+
}
|
|
10457
|
+
connectedCallback() {
|
|
10458
|
+
super.connectedCallback();
|
|
10459
|
+
this.setCustomPropertyValue("value");
|
|
10460
|
+
this.setCustomPropertyValue("max");
|
|
10266
10461
|
}
|
|
10267
10462
|
/**
|
|
10268
10463
|
* Returns "count" as string, formatted according to the locale.
|
|
@@ -10270,41 +10465,47 @@ class BaseRatingDisplay extends FASTElement {
|
|
|
10270
10465
|
* @internal
|
|
10271
10466
|
*/
|
|
10272
10467
|
get formattedCount() {
|
|
10273
|
-
return this.count ? this.
|
|
10274
|
-
}
|
|
10275
|
-
/**
|
|
10276
|
-
* Gets the selected value
|
|
10277
|
-
*
|
|
10278
|
-
* @protected
|
|
10279
|
-
*/
|
|
10280
|
-
getSelectedValue() {
|
|
10281
|
-
return Math.round((this.value ?? 0) * 2) / 2;
|
|
10282
|
-
}
|
|
10283
|
-
/**
|
|
10284
|
-
* Gets the maximum icons to render
|
|
10285
|
-
*
|
|
10286
|
-
* @protected
|
|
10287
|
-
*/
|
|
10288
|
-
getMaxIcons() {
|
|
10289
|
-
return (this.max ?? 5) * 2;
|
|
10468
|
+
return this.count ? this.numberFormatter.format(this.count) : "";
|
|
10290
10469
|
}
|
|
10291
|
-
/**
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10470
|
+
/** @internal */
|
|
10471
|
+
handleSlotChange() {
|
|
10472
|
+
const icon = this.iconSlot.assignedElements()?.find(el => el.nodeName.toLowerCase() === "svg");
|
|
10473
|
+
this.renderSlottedIcon(icon ?? null);
|
|
10474
|
+
}
|
|
10475
|
+
renderSlottedIcon(svg) {
|
|
10476
|
+
if (!svg) {
|
|
10477
|
+
this.display.style.removeProperty(CUSTOM_PROPERTY_NAME.maskImageFilled);
|
|
10478
|
+
this.display.style.removeProperty(CUSTOM_PROPERTY_NAME.maskImageOutlined);
|
|
10479
|
+
return;
|
|
10480
|
+
}
|
|
10481
|
+
const innerSvg = svg.innerHTML;
|
|
10482
|
+
const viewBox = svg.getAttribute("viewBox") ?? this.iconViewBox ?? this.defaultCustomIconViewBox;
|
|
10483
|
+
const customSvgFilled = `
|
|
10484
|
+
<svg
|
|
10485
|
+
viewBox="${viewBox}"
|
|
10486
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10487
|
+
>${innerSvg}</svg>`;
|
|
10488
|
+
const customSvgOutlined = `
|
|
10489
|
+
<svg
|
|
10490
|
+
viewBox="${viewBox}"
|
|
10491
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10492
|
+
fill="none"
|
|
10493
|
+
stroke="black"
|
|
10494
|
+
stroke-width="2"
|
|
10495
|
+
>${innerSvg}</svg>`;
|
|
10496
|
+
this.display.style.setProperty(CUSTOM_PROPERTY_NAME.maskImageFilled, `url(${svgToDataURI(customSvgFilled)})`);
|
|
10497
|
+
this.display.style.setProperty(CUSTOM_PROPERTY_NAME.maskImageOutlined, `url(${svgToDataURI(customSvgOutlined)})`);
|
|
10498
|
+
}
|
|
10499
|
+
setCustomPropertyValue(propertyName) {
|
|
10500
|
+
if (!this.display || SUPPORTS_ATTR_TYPE) {
|
|
10501
|
+
return;
|
|
10301
10502
|
}
|
|
10302
|
-
const
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10503
|
+
const propertyValue = this[propertyName];
|
|
10504
|
+
if (typeof propertyValue !== "number" || Number.isNaN(propertyValue)) {
|
|
10505
|
+
this.display.style.removeProperty(CUSTOM_PROPERTY_NAME[propertyName]);
|
|
10506
|
+
} else {
|
|
10507
|
+
this.display.style.setProperty(CUSTOM_PROPERTY_NAME[propertyName], `${propertyValue}`);
|
|
10306
10508
|
}
|
|
10307
|
-
return htmlString;
|
|
10308
10509
|
}
|
|
10309
10510
|
}
|
|
10310
10511
|
__decorateClass$j([attr({
|
|
@@ -10319,8 +10520,6 @@ __decorateClass$j([attr({
|
|
|
10319
10520
|
__decorateClass$j([attr({
|
|
10320
10521
|
converter: nullableNumberConverter
|
|
10321
10522
|
})], BaseRatingDisplay.prototype, "value", 2);
|
|
10322
|
-
__decorateClass$j([observable], BaseRatingDisplay.prototype, "slottedIcon", 2);
|
|
10323
|
-
__decorateClass$j([observable], BaseRatingDisplay.prototype, "customIcon", 2);
|
|
10324
10523
|
|
|
10325
10524
|
var __defProp$i = Object.defineProperty;
|
|
10326
10525
|
var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
|
|
@@ -10335,22 +10534,6 @@ class RatingDisplay extends BaseRatingDisplay {
|
|
|
10335
10534
|
super(...arguments);
|
|
10336
10535
|
this.compact = false;
|
|
10337
10536
|
}
|
|
10338
|
-
/**
|
|
10339
|
-
* Overrides the selected value and returns 1 if compact is true.
|
|
10340
|
-
*
|
|
10341
|
-
* @override
|
|
10342
|
-
*/
|
|
10343
|
-
getSelectedValue() {
|
|
10344
|
-
return Math.round((this.compact ? 1 : this.value ?? 0) * 2) / 2;
|
|
10345
|
-
}
|
|
10346
|
-
/**
|
|
10347
|
-
* Overrides the maximum icons and returns a max of 1 if compact is true.
|
|
10348
|
-
*
|
|
10349
|
-
* @override
|
|
10350
|
-
*/
|
|
10351
|
-
getMaxIcons() {
|
|
10352
|
-
return (this.compact ? 1 : this.max ?? 5) * 2;
|
|
10353
|
-
}
|
|
10354
10537
|
}
|
|
10355
10538
|
__decorateClass$i([attr], RatingDisplay.prototype, "color", 2);
|
|
10356
10539
|
__decorateClass$i([attr], RatingDisplay.prototype, "size", 2);
|
|
@@ -10358,21 +10541,30 @@ __decorateClass$i([attr({
|
|
|
10358
10541
|
mode: "boolean"
|
|
10359
10542
|
})], RatingDisplay.prototype, "compact", 2);
|
|
10360
10543
|
|
|
10361
|
-
const
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10544
|
+
const defaultIconPath = `<path d="M5.28347 1.54605C5.57692 0.951448 6.42479 0.951449 6.71825 1.54605L7.82997 3.79866L10.3159 4.15988C10.9721 4.25523 11.2341 5.0616 10.7592 5.52443L8.96043 7.27785L9.38507 9.7537C9.49716 10.4072 8.81122 10.9056 8.22431 10.597L6.00086 9.4281L3.7774 10.597C3.19049 10.9056 2.50455 10.4072 2.61664 9.7537L3.04128 7.27784L1.24246 5.52443C0.767651 5.0616 1.02966 4.25523 1.68584 4.15988L4.17174 3.79865L5.28347 1.54605Z" />`;
|
|
10545
|
+
const defaultIconFilled = `
|
|
10546
|
+
<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">${defaultIconPath}</svg>
|
|
10547
|
+
`;
|
|
10548
|
+
const defaultIconOutlined = `
|
|
10549
|
+
<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"
|
|
10550
|
+
fill="none" stroke="black" stroke-width="2"
|
|
10551
|
+
>${defaultIconPath}</svg>
|
|
10552
|
+
`;
|
|
10368
10553
|
function ratingDisplayTemplate() {
|
|
10369
|
-
return html
|
|
10370
|
-
property: "slottedIcon",
|
|
10371
|
-
filter: elements("svg")
|
|
10372
|
-
})}>${star}</slot><slot name="value"><span class="value-label" aria-hidden="true">${x => x.value}</span></slot><slot name="count"><span class="count-label" aria-hidden="true">${x => x.formattedCount}</span></slot>`;
|
|
10554
|
+
return html`<div ${ref("display")} class="display" aria-hidden="true"></div><slot name="icon" ${ref("iconSlot")} @slotchange="${x => x.handleSlotChange()}"></slot><slot name="value"><span class="value-label" aria-hidden="true">${x => x.value}</span></slot><slot name="count"><span class="count-label" aria-hidden="true">${x => x.formattedCount}</span></slot>`;
|
|
10373
10555
|
}
|
|
10374
10556
|
const template$e = ratingDisplayTemplate();
|
|
10375
10557
|
|
|
10558
|
+
const styles$e = css`
|
|
10559
|
+
${display("inline-flex")}
|
|
10560
|
+
|
|
10561
|
+
:host{--_icon-size:16px;--_icon-gradient-degree:90deg;--_icon-color-value:${colorPaletteMarigoldBorderActive};--_icon-color-empty:${colorPaletteMarigoldBackground2};--_default-value:0;--_default-max:5;--_mask-image-filled:url(${svgToDataURI(defaultIconFilled)});--_mask-image-outlined:url(${svgToDataURI(defaultIconOutlined)});--_mask-position-x:left;align-items:center;color:${colorNeutralForeground1};font-family:${fontFamilyBase};font-size:${fontSizeBase200};line-height:${lineHeightBase200};contain:layout style;user-select:none}:host(:dir(rtl)){--_icon-gradient-degree:-90deg;--_mask-position-x:right}:host([size='small']){--_icon-size:12px}:host([size='large']){--_icon-size:20px;font-size:${fontSizeBase300};line-height:${lineHeightBase300}}::slotted([slot='icon']){display:none}:host([color='neutral']){--_icon-color-value:${colorNeutralForeground1};--_icon-color-empty:${colorNeutralBackground6}}:host([color='brand']){--_icon-color-value:${colorBrandForeground1};--_icon-color-empty:${colorBrandBackground2}}@supports (width:attr(value type(<number>))){:host{--_attr-value:attr(value type(<number>));--_attr-max:attr(max type(<number>))}}:host([compact]) .display{--_max:1}.display{--_value:max(0,round(var(--_attr-value,var(--_default-value)) * 2) / 2);--_max:max(1,var(--_attr-max,var(--_default-max)));--_mask-inline-size:calc(var(--_icon-size) + ${spacingHorizontalXXS});--_icon-gradient-stop-visual-adjustment:0px;--_icon-gradient-stop:calc(
|
|
10562
|
+
var(--_mask-inline-size) * var(--_value) - var(--_icon-gradient-stop-visual-adjustment)
|
|
10563
|
+
);background-image:linear-gradient(
|
|
10564
|
+
var(--_icon-gradient-degree),var(--_icon-color-value) var(--_icon-gradient-stop),var(--_icon-color-empty) calc(var(--_icon-gradient-stop) + 0.5px)
|
|
10565
|
+
);block-size:var(--_icon-size);display:grid;inline-size:calc(var(--_max) * var(--_mask-inline-size) - ${spacingHorizontalXXS} / 2);mask-image:var(--_mask-image-filled);mask-repeat:repeat no-repeat;mask-size:var(--_mask-inline-size) var(--_icon-size);mask-position:var(--_mask-position-x) center}.value-label,::slotted([slot='value']){display:block;margin-inline-start:${spacingHorizontalXS};font-weight:${fontWeightSemibold}}:host([size='small']) .value-label,:host([size='small']) ::slotted([slot='value']){margin-inline-start:${spacingHorizontalXXS}}:host([size='large']) .value-label,:host([size='large']) ::slotted([slot='value']){margin-inline-start:${spacingHorizontalSNudge}}:host(:not([count])) .count-label{display:none}.count-label::before,::slotted([slot='count'])::before{content:'·';margin-inline:${spacingHorizontalXS}}:host([size='small']) .count-label::before,:host([size='small']) ::slotted([slot='count'])::before{margin-inline:${spacingHorizontalXXS}}:host([size='large']) .count-label::before,:host([size='large']) ::slotted([slot='count'])::before{margin-inline:${spacingHorizontalSNudge}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
10566
|
+
.display{--_icon-color-value:CanvasText;--_icon-color-empty:Canvas;--_icon-gradient-stop-visual-adjustment:0.5px;forced-color-adjust:none}.display::before{background-color:var(--_icon-color-value);content:'';grid-area:1 / 1 / -1 / -1;mask:inherit;mask-image:var(--_mask-image-outlined)}`));
|
|
10567
|
+
|
|
10376
10568
|
const definition$e = RatingDisplay.compose({
|
|
10377
10569
|
name: `${FluentDesignSystem.prefix}-rating-display`,
|
|
10378
10570
|
template: template$e,
|
|
@@ -10853,7 +11045,7 @@ class Slider extends FASTElement {
|
|
|
10853
11045
|
* Places the thumb based on the current value
|
|
10854
11046
|
*/
|
|
10855
11047
|
setSliderPosition() {
|
|
10856
|
-
const newPct = convertPixelToPercent(parseFloat(this.value), this.minAsNumber, this.maxAsNumber, this.direction);
|
|
11048
|
+
const newPct = convertPixelToPercent(parseFloat(this.value), this.minAsNumber, this.maxAsNumber, this.orientation === Orientation.vertical ? void 0 : this.direction);
|
|
10857
11049
|
const percentage = newPct * 100;
|
|
10858
11050
|
this.position = `--slider-thumb: ${percentage}%; --slider-progress: ${percentage}%`;
|
|
10859
11051
|
}
|
|
@@ -10888,7 +11080,7 @@ class Slider extends FASTElement {
|
|
|
10888
11080
|
*/
|
|
10889
11081
|
calculateNewValue(rawValue) {
|
|
10890
11082
|
this.setupTrackConstraints();
|
|
10891
|
-
const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.vertical ? this.trackMinHeight : this.trackMinWidth, this.orientation === Orientation.vertical ? this.trackHeight : this.trackWidth, this.direction);
|
|
11083
|
+
const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.vertical ? this.trackMinHeight : this.trackMinWidth, this.orientation === Orientation.vertical ? this.trackHeight : this.trackWidth, this.orientation === Orientation.vertical ? void 0 : this.direction);
|
|
10892
11084
|
const newValue = (this.maxAsNumber - this.minAsNumber) * newPosition + this.minAsNumber;
|
|
10893
11085
|
return this.convertToConstrainedValue(newValue);
|
|
10894
11086
|
}
|
|
@@ -10960,7 +11152,7 @@ const styles$d = css`
|
|
|
10960
11152
|
.track:hover,.track:active,.track{background:WindowText}.thumb:hover,.thumb:active,.thumb{background:ButtonText}:host(:hover) .track::before,:host(:active) .track::before,.track::before{background:Highlight}`));
|
|
10961
11153
|
|
|
10962
11154
|
function sliderTemplate(options = {}) {
|
|
10963
|
-
return html`<template
|
|
11155
|
+
return html`<template @pointerdown="${(x, c) => x.handlePointerDown(c.event)}" @keydown="${(x, c) => x.handleKeydown(c.event)}"><div ${ref("track")} part="track-container" class="track" style="${x => x.position}"></div><div ${ref("thumb")} part="thumb-container" class="thumb-container" style="${x => x.position}" @pointerdown="${(x, c) => x.handleThumbPointerDown(c.event)}"><slot name="thumb">${staticallyCompose(options.thumb)}</slot></div></template>`;
|
|
10964
11156
|
}
|
|
10965
11157
|
const template$d = sliderTemplate({
|
|
10966
11158
|
thumb: `<div class="thumb"></div>`
|
|
@@ -11023,7 +11215,7 @@ class Switch extends BaseCheckbox {
|
|
|
11023
11215
|
}
|
|
11024
11216
|
|
|
11025
11217
|
function switchTemplate(options = {}) {
|
|
11026
|
-
return html`<template
|
|
11218
|
+
return html`<template @click="${(x, c) => x.clickHandler(c.event)}" @input="${(x, c) => x.inputHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @keyup="${(x, c) => x.keyupHandler(c.event)}"><slot name="switch">${staticallyCompose(options.switch)}</slot></template>`;
|
|
11027
11219
|
}
|
|
11028
11220
|
const template$b = switchTemplate({
|
|
11029
11221
|
switch: `<span class="checked-indicator" part="checked-indicator"></span>`
|
|
@@ -11032,7 +11224,7 @@ const template$b = switchTemplate({
|
|
|
11032
11224
|
const styles$b = css`
|
|
11033
11225
|
${display("inline-flex")}
|
|
11034
11226
|
|
|
11035
|
-
:host{box-sizing:border-box;align-items:center;flex-direction:row;outline:none;user-select:none;contain:content;padding:0 ${spacingHorizontalXXS};width:40px;height:20px;background-color:${colorTransparentBackground};border:1px solid ${colorNeutralStrokeAccessible};border-radius:${borderRadiusCircular}
|
|
11227
|
+
:host{box-sizing:border-box;align-items:center;flex-direction:row;outline:none;user-select:none;contain:content;padding:0 ${spacingHorizontalXXS};width:40px;height:20px;background-color:${colorTransparentBackground};border:1px solid ${colorNeutralStrokeAccessible};border-radius:${borderRadiusCircular}}:host(:enabled){cursor:pointer}:host(:hover){background:none;border-color:${colorNeutralStrokeAccessibleHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(:disabled),:host([readonly]){border:1px solid ${colorNeutralStrokeDisabled};background-color:none;pointer:default}:host(${checkedState}){background:${colorCompoundBrandBackground};border-color:${colorCompoundBrandBackground}}:host(${checkedState}:hover){background:${colorCompoundBrandBackgroundHover};border-color:${colorCompoundBrandBackgroundHover}}:host(${checkedState}:active){background:${colorCompoundBrandBackgroundPressed};border-color:${colorCompoundBrandBackgroundPressed}}:host(${checkedState}:disabled){background:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}.checked-indicator{height:14px;width:14px;border-radius:50%;margin-inline-start:0;background-color:${colorNeutralForeground3};transition-duration:${durationNormal};transition-timing-function:${curveEasyEase};transition-property:margin-inline-start}:host(${checkedState}) .checked-indicator{background-color:${colorNeutralForegroundInverted};margin-inline-start:calc(100% - 14px)}:host(${checkedState}:hover) .checked-indicator{background:${colorNeutralForegroundInvertedHover}}:host(${checkedState}:active) .checked-indicator{background:${colorNeutralForegroundInvertedPressed}}:host(:hover) .checked-indicator{background-color:${colorNeutralForeground3Hover}}:host(:active) .checked-indicator{background-color:${colorNeutralForeground3Pressed}}:host(:disabled) .checked-indicator,:host([readonly]) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(${checkedState}:disabled) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(:focus-visible){outline:none}:host(:not([slot='input']):focus-visible){border-color:${colorTransparentStroke};outline:${strokeWidthThick} solid ${colorTransparentStroke};outline-offset:1px;box-shadow:${shadow4},0 0 0 2px ${colorStrokeFocus2}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
11036
11228
|
:host{border-color:InactiveBorder}:host(${checkedState}),:host(${checkedState}:active),:host(${checkedState}:hover){background:Highlight;border-color:Highlight}.checked-indicator,:host(:hover) .checked-indicator,:host(:active) .checked-indicator{background-color:ActiveCaption}:host(${checkedState}) .checked-indicator,:host(${checkedState}:hover) .checked-indicator,:host(${checkedState}:active) .checked-indicator{background-color:ButtonFace}:host(:disabled) .checked-indicator,:host(${checkedState}:disabled) .checked-indicator{background-color:GrayText}`));
|
|
11037
11229
|
|
|
11038
11230
|
const definition$b = Switch.compose({
|
|
@@ -11095,7 +11287,7 @@ const template$9 = tabTemplate({});
|
|
|
11095
11287
|
const styles$9 = css`
|
|
11096
11288
|
${display("inline-flex")}
|
|
11097
11289
|
|
|
11098
|
-
:host{position:relative;flex-direction:
|
|
11290
|
+
:host{position:relative;flex-direction:row;align-items:center;cursor:pointer;box-sizing:border-box;justify-content:center;line-height:${lineHeightBase300};font-family:${fontFamilyBase};font-size:${fontSizeBase300};color:${colorNeutralForeground2};fill:currentcolor;grid-row:1;padding:${spacingHorizontalM} ${spacingHorizontalMNudge};border-radius:${borderRadiusMedium};gap:4px}:host .tab-content{display:inline-flex;flex-direction:column;padding:0 2px}:host([aria-selected='true']){color:${colorNeutralForeground1};font-weight:${fontWeightSemibold}}:host .tab-content::after{content:var(--textContent);visibility:hidden;height:0;line-height:${lineHeightBase300};font-weight:${fontWeightSemibold}}:host([aria-selected='true'])::after{background-color:${colorCompoundBrandStroke};border-radius:${borderRadiusCircular};content:'';inset:0;position:absolute;z-index:2}:host([aria-selected='false']:hover)::after{background-color:${colorNeutralStroke1Hover};border-radius:${borderRadiusCircular};content:'';inset:0;position:absolute;z-index:1}:host([aria-selected='true'][disabled])::after{background-color:${colorNeutralForegroundDisabled}}::slotted([slot='start']),::slotted([slot='end']){display:flex}:host([disabled]){cursor:not-allowed;fill:${colorNeutralForegroundDisabled};color:${colorNeutralForegroundDisabled}}:host([disabled]:hover)::after{background-color:unset}:host(:focus){outline:none}:host(:focus-visible){border-radius:${borderRadiusSmall};box-shadow:0 0 0 3px ${colorStrokeFocus2};outline:1px solid ${colorStrokeFocus1}}:host([data-hasIndent]){display:grid;grid-template-columns:20px 1fr auto}:host([data-hasIndent]) .tab-content{grid-column:2}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
11099
11291
|
:host([aria-selected='true'])::after{background-color:Highlight}`));
|
|
11100
11292
|
|
|
11101
11293
|
const definition$9 = Tab.compose({
|
|
@@ -11557,6 +11749,13 @@ const isFocusableElement = el => {
|
|
|
11557
11749
|
return !isARIADisabledElement(el) && !isHiddenElement(el);
|
|
11558
11750
|
};
|
|
11559
11751
|
|
|
11752
|
+
function isTab(element, tagName = "-tab") {
|
|
11753
|
+
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
11754
|
+
return false;
|
|
11755
|
+
}
|
|
11756
|
+
return element.tagName.toLowerCase().endsWith(tagName);
|
|
11757
|
+
}
|
|
11758
|
+
|
|
11560
11759
|
const TablistAppearance = {
|
|
11561
11760
|
subtle: "subtle",
|
|
11562
11761
|
transparent: "transparent"
|
|
@@ -11647,6 +11846,9 @@ class BaseTablist extends FASTElement {
|
|
|
11647
11846
|
*/
|
|
11648
11847
|
disabledChanged(prev, next) {
|
|
11649
11848
|
toggleState(this.elementInternals, "disabled", next);
|
|
11849
|
+
if (this.$fastController.isConnected) {
|
|
11850
|
+
this.setTabs();
|
|
11851
|
+
}
|
|
11650
11852
|
}
|
|
11651
11853
|
/**
|
|
11652
11854
|
* @internal
|
|
@@ -11683,6 +11885,13 @@ class BaseTablist extends FASTElement {
|
|
|
11683
11885
|
}
|
|
11684
11886
|
}
|
|
11685
11887
|
}
|
|
11888
|
+
/**
|
|
11889
|
+
* Updates the tabs property when content in the tabs slot changes.
|
|
11890
|
+
* @internal
|
|
11891
|
+
*/
|
|
11892
|
+
slottedTabsChanged(prev, next) {
|
|
11893
|
+
this.tabs = next?.filter(tab => isTab(tab)) ?? [];
|
|
11894
|
+
}
|
|
11686
11895
|
/**
|
|
11687
11896
|
* @internal
|
|
11688
11897
|
*/
|
|
@@ -11717,10 +11926,15 @@ class BaseTablist extends FASTElement {
|
|
|
11717
11926
|
*/
|
|
11718
11927
|
setTabs() {
|
|
11719
11928
|
this.activeTabIndex = this.getActiveIndex();
|
|
11929
|
+
const hasStartSlot = this.tabs.some(tab => !!tab.querySelector("[slot='start']"));
|
|
11720
11930
|
this.tabs.forEach((tab, index) => {
|
|
11721
11931
|
if (tab.slot === "tab") {
|
|
11722
11932
|
const isActiveTab = this.activeTabIndex === index && isFocusableElement(tab);
|
|
11723
11933
|
const tabId = this.tabIds[index];
|
|
11934
|
+
console.log("disabled", this.disabled);
|
|
11935
|
+
if (!tab.disabled) {
|
|
11936
|
+
this.disabled ? tab.setAttribute("aria-disabled", "true") : tab.removeAttribute("aria-disabled");
|
|
11937
|
+
}
|
|
11724
11938
|
tab.setAttribute("id", tabId);
|
|
11725
11939
|
tab.setAttribute("aria-selected", isActiveTab ? "true" : "false");
|
|
11726
11940
|
tab.addEventListener("click", this.handleTabClick);
|
|
@@ -11730,6 +11944,9 @@ class BaseTablist extends FASTElement {
|
|
|
11730
11944
|
this.activetab = tab;
|
|
11731
11945
|
this.activeid = tabId;
|
|
11732
11946
|
}
|
|
11947
|
+
if (hasStartSlot && this.orientation === TablistOrientation.vertical) {
|
|
11948
|
+
tab.setAttribute("data-hasIndent", "");
|
|
11949
|
+
}
|
|
11733
11950
|
}
|
|
11734
11951
|
});
|
|
11735
11952
|
}
|
|
@@ -11787,6 +12004,7 @@ __decorateClass$c([attr({
|
|
|
11787
12004
|
})], BaseTablist.prototype, "disabled", 2);
|
|
11788
12005
|
__decorateClass$c([attr], BaseTablist.prototype, "orientation", 2);
|
|
11789
12006
|
__decorateClass$c([attr], BaseTablist.prototype, "activeid", 2);
|
|
12007
|
+
__decorateClass$c([observable], BaseTablist.prototype, "slottedTabs", 2);
|
|
11790
12008
|
__decorateClass$c([observable], BaseTablist.prototype, "tabs", 2);
|
|
11791
12009
|
|
|
11792
12010
|
var __defProp$b = Object.defineProperty;
|
|
@@ -11939,12 +12157,12 @@ class Tablist extends BaseTablist {
|
|
|
11939
12157
|
__decorateClass$b([attr], Tablist.prototype, "appearance", 2);
|
|
11940
12158
|
__decorateClass$b([attr], Tablist.prototype, "size", 2);
|
|
11941
12159
|
|
|
11942
|
-
const template$7 = html`<template role="tablist"><slot name="tab" ${slotted("
|
|
12160
|
+
const template$7 = html`<template role="tablist"><slot name="tab" ${slotted("slottedTabs")}></slot></template>`;
|
|
11943
12161
|
|
|
11944
12162
|
const styles$7 = css`
|
|
11945
12163
|
${display("flex")}
|
|
11946
12164
|
|
|
11947
|
-
:host{--tabPaddingInline:inherit;--tabPaddingBlock:inherit;--tabIndicatorInsetInline:0;--tabIndicatorInsetBlock:0;box-sizing:border-box;color:${colorNeutralForeground2};flex-direction:row}:host([orientation='vertical']){flex-direction:column}:host ::slotted([role='tab']){
|
|
12165
|
+
:host{--tabPaddingInline:inherit;--tabPaddingBlock:inherit;--tabIndicatorInsetInline:0;--tabIndicatorInsetBlock:0;box-sizing:border-box;color:${colorNeutralForeground2};flex-direction:row}:host([orientation='vertical']){flex-direction:column}:host([orientation='vertical']) ::slotted([role='tab']){justify-content:flex-start}:host ::slotted([slot='tab'][data-animate='true'])::after{transition-property:transform;transition-duration:${durationSlow};transition-timing-function:${curveDecelerateMax}}:host ::slotted([slot='tab'])::after{height:${strokeWidthThicker};margin-block-start:auto;transform-origin:left;transform:translateX(var(--tabIndicatorOffset)) scaleX(var(--tabIndicatorScale))}:host([orientation='vertical']) ::slotted([slot='tab'])::after{width:${strokeWidthThicker};height:unset;margin-block-start:unset;transform-origin:top;transform:translateY(var(--tabIndicatorOffset)) scaleY(var(--tabIndicatorScale))}:host ::slotted([slot='tab'])::before{height:${strokeWidthThicker};border-radius:${borderRadiusCircular};content:'';inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock);position:absolute;margin-top:auto}:host ::slotted([slot='tab'])::before{inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock)}:host ::slotted([slot='tab'][aria-selected='true'])::before{background-color:${colorNeutralForegroundDisabled}}:host ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:${strokeWidthThicker};margin-block-start:auto;transform-origin:left}:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:unset;width:${strokeWidthThicker};margin-inline-end:auto;transform-origin:top}:host(:where([size='small'],[size='large'])) ::slotted([slot='tab']){padding-inline:var(--tabPaddingInline);padding-block:var(--tabPaddingBlock)}:host([size='small']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalSNudge};--tabPaddingInline:${spacingHorizontalSNudge};font-size:${fontSizeBase300};line-height:${lineHeightBase300}}:host([size='large']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalL};--tabPaddingInline:${spacingHorizontalMNudge};font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host ::slotted([slot='tab'])::after,:host ::slotted([slot='tab'])::before,:host ::slotted([slot='tab']:hover)::after{inset-inline:var(--tabIndicatorInsetInline)}:host ::slotted([slot='tab']){--tabIndicatorInsetInline:${spacingHorizontalMNudge}}:host([size='small']) ::slotted([slot='tab']){--tabIndicatorInsetInline:${spacingHorizontalSNudge}}:host([size='large']) ::slotted([slot='tab']){--tabIndicatorInsetInline:${spacingHorizontalMNudge}}:host([orientation='vertical']) ::slotted([slot='tab']){padding-block:var(--tabPaddingBlock)}:host([orientation='vertical']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalS}}:host([orientation='vertical'][size='small']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalXXS}}:host([orientation='vertical'][size='large']) ::slotted([slot='tab']){--tabPaddingBlock:${spacingVerticalS}}:host([orientation='vertical']) ::slotted([slot='tab'])::after,:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab']:hover)::after{inset-inline:0;inset-block:var(--tabIndicatorInsetBlock)}:host([orientation='vertical']){--tabIndicatorInsetBlock:${spacingVerticalS}}:host([orientation='vertical'][size='small']){--tabIndicatorInsetBlock:${spacingVerticalSNudge}}:host([orientation='vertical'][size='large']){--tabIndicatorInsetBlock:${spacingVerticalMNudge}}:host([disabled]){cursor:not-allowed;color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab']){pointer-events:none;cursor:not-allowed;color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab']:after){background-color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab'][aria-selected='true'])::after{background-color:${colorNeutralForegroundDisabled}}:host([disabled]) ::slotted([slot='tab']:hover):before{content:unset}:host([appearance='subtle']) ::slotted([slot='tab']:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground1Hover};fill:${colorCompoundBrandForeground1Hover}}:host([appearance='subtle']) ::slotted([slot='tab']:active){background-color:${colorSubtleBackgroundPressed};fill:${colorSubtleBackgroundPressed};color:${colorNeutralForeground1}}`;
|
|
11948
12166
|
|
|
11949
12167
|
const definition$7 = Tablist.compose({
|
|
11950
12168
|
name: `${FluentDesignSystem.prefix}-tablist`,
|
|
@@ -11983,6 +12201,8 @@ class BaseTextArea extends FASTElement {
|
|
|
11983
12201
|
* @internal
|
|
11984
12202
|
*/
|
|
11985
12203
|
this.elementInternals = this.attachInternals();
|
|
12204
|
+
this.filteredLabelSlottedNodes = [];
|
|
12205
|
+
this.labelSlottedNodes = [];
|
|
11986
12206
|
this.userInteracted = false;
|
|
11987
12207
|
this.preConnectControlEl = document.createElement("textarea");
|
|
11988
12208
|
this.autoResize = false;
|
|
@@ -11999,10 +12219,11 @@ class BaseTextArea extends FASTElement {
|
|
|
11999
12219
|
this.value = next;
|
|
12000
12220
|
}
|
|
12001
12221
|
labelSlottedNodesChanged() {
|
|
12222
|
+
this.filteredLabelSlottedNodes = this.labelSlottedNodes.filter(whitespaceFilter);
|
|
12002
12223
|
if (this.labelEl) {
|
|
12003
|
-
this.labelEl.hidden = !this.
|
|
12224
|
+
this.labelEl.hidden = !this.filteredLabelSlottedNodes.length;
|
|
12004
12225
|
}
|
|
12005
|
-
this.
|
|
12226
|
+
this.filteredLabelSlottedNodes.forEach(node => {
|
|
12006
12227
|
node.disabled = this.disabled;
|
|
12007
12228
|
node.required = this.required;
|
|
12008
12229
|
});
|
|
@@ -12036,8 +12257,8 @@ class BaseTextArea extends FASTElement {
|
|
|
12036
12257
|
}
|
|
12037
12258
|
requiredChanged() {
|
|
12038
12259
|
this.elementInternals.ariaRequired = `${!!this.required}`;
|
|
12039
|
-
if (this.
|
|
12040
|
-
this.
|
|
12260
|
+
if (this.filteredLabelSlottedNodes?.length) {
|
|
12261
|
+
this.filteredLabelSlottedNodes.forEach(node => node.required = this.required);
|
|
12041
12262
|
}
|
|
12042
12263
|
}
|
|
12043
12264
|
resizeChanged(prev, next) {
|
|
@@ -12272,8 +12493,8 @@ class BaseTextArea extends FASTElement {
|
|
|
12272
12493
|
if (this.controlEl) {
|
|
12273
12494
|
this.controlEl.disabled = disabled;
|
|
12274
12495
|
}
|
|
12275
|
-
if (this.
|
|
12276
|
-
this.
|
|
12496
|
+
if (this.filteredLabelSlottedNodes?.length) {
|
|
12497
|
+
this.filteredLabelSlottedNodes.forEach(node => node.disabled = this.disabled);
|
|
12277
12498
|
}
|
|
12278
12499
|
}
|
|
12279
12500
|
toggleUserValidityState() {
|
|
@@ -12446,13 +12667,7 @@ const styles$6 = css`
|
|
|
12446
12667
|
:host{--border-color:FieldText;--border-block-end-color:FieldText;--focus-indicator-color:Highlight;--placeholder-color:FieldText}:host(:hover),:host(:active),:host(:focus-within){--border-color:Highlight;--border-block-end-color:Highlight}:host(:disabled){--color:GrayText;--border-color:GrayText;--border-block-end-color:GrayText;--placeholder-color:GrayText}`));
|
|
12447
12668
|
|
|
12448
12669
|
function textAreaTemplate() {
|
|
12449
|
-
return html`<template><label ${ref("labelEl")} for="control" part="label"><slot name="label" ${slotted({
|
|
12450
|
-
property: "labelSlottedNodes",
|
|
12451
|
-
filter: whitespaceFilter
|
|
12452
|
-
})}></slot></label><div class="root" part="root"><textarea ${ref("controlEl")} id="control" class="control" part="control" ?required="${x => x.required}" ?disabled="${x => x.disabled}" ?readonly="${x => x.readOnly}" ?spellcheck="${x => x.spellcheck}" autocomplete="${x => x.autocomplete}" maxlength="${x => x.maxLength}" minlength="${x => x.minLength}" placeholder="${x => x.placeholder}" @change="${x => x.handleControlChange()}" @select="${x => x.handleControlSelect()}" @input="${x => x.handleControlInput()}"></textarea></div><div hidden><slot ${slotted({
|
|
12453
|
-
property: "defaultSlottedNodes",
|
|
12454
|
-
filter: whitespaceFilter
|
|
12455
|
-
})}></slot></div></template>`;
|
|
12670
|
+
return html`<template><label ${ref("labelEl")} for="control" part="label"><slot name="label" ${slotted("labelSlottedNodes")}></slot></label><div class="root" part="root"><textarea ${ref("controlEl")} id="control" class="control" part="control" ?required="${x => x.required}" ?disabled="${x => x.disabled}" ?readonly="${x => x.readOnly}" ?spellcheck="${x => x.spellcheck}" autocomplete="${x => x.autocomplete}" maxlength="${x => x.maxLength}" minlength="${x => x.minLength}" placeholder="${x => x.placeholder}" @change="${x => x.handleControlChange()}" @select="${x => x.handleControlSelect()}" @input="${x => x.handleControlInput()}"></textarea></div><div hidden><slot ${slotted("defaultSlottedNodes")}></slot></div></template>`;
|
|
12456
12671
|
}
|
|
12457
12672
|
const template$6 = textAreaTemplate();
|
|
12458
12673
|
|
|
@@ -12955,7 +13170,7 @@ __decorateClass$6([attr], Text.prototype, "align", 2);
|
|
|
12955
13170
|
const styles$4 = css`
|
|
12956
13171
|
${display("inline")}
|
|
12957
13172
|
|
|
12958
|
-
:host{
|
|
13173
|
+
:host{font-family:${fontFamilyBase};font-size:${fontSizeBase300};line-height:${lineHeightBase300};font-weight:${fontWeightRegular};text-align:start}:host([nowrap]),:host([nowrap]) ::slotted(*){white-space:nowrap;overflow:hidden}:host([truncate]),:host([truncate]) ::slotted(*){text-overflow:ellipsis}:host([block]){display:block}:host([italic]){font-style:italic}:host([underline]){text-decoration-line:underline}:host([strikethrough]){text-decoration-line:line-through}:host([underline][strikethrough]){text-decoration-line:line-through underline}:host([size='100']){font-size:${fontSizeBase100};line-height:${lineHeightBase100}}:host([size='200']){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host([size='400']){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host([size='500']){font-size:${fontSizeBase500};line-height:${lineHeightBase500}}:host([size='600']){font-size:${fontSizeBase600};line-height:${lineHeightBase600}}:host([size='700']){font-size:${fontSizeHero700};line-height:${lineHeightHero700}}:host([size='800']){font-size:${fontSizeHero800};line-height:${lineHeightHero800}}:host([size='900']){font-size:${fontSizeHero900};line-height:${lineHeightHero900}}:host([size='1000']){font-size:${fontSizeHero1000};line-height:${lineHeightHero1000}}:host([font='monospace']){font-family:${fontFamilyMonospace}}:host([font='numeric']){font-family:${fontFamilyNumeric}}:host([weight='medium']){font-weight:${fontWeightMedium}}:host([weight='semibold']){font-weight:${fontWeightSemibold}}:host([weight='bold']){font-weight:${fontWeightBold}}:host([align='center']){text-align:center}:host([align='end']){text-align:end}:host([align='justify']){text-align:justify}::slotted(*){font:inherit;line-height:inherit;text-decoration-line:inherit;text-align:inherit;text-decoration-line:inherit;margin:0}`;
|
|
12959
13174
|
|
|
12960
13175
|
const template$4 = html`<slot></slot>`;
|
|
12961
13176
|
|
|
@@ -13295,6 +13510,7 @@ class BaseTree extends FASTElement {
|
|
|
13295
13510
|
this.childTreeItems = [];
|
|
13296
13511
|
this.elementInternals.role = "tree";
|
|
13297
13512
|
}
|
|
13513
|
+
/** @internal */
|
|
13298
13514
|
childTreeItemsChanged() {
|
|
13299
13515
|
this.updateCurrentSelected();
|
|
13300
13516
|
}
|
|
@@ -13391,6 +13607,9 @@ class BaseTree extends FASTElement {
|
|
|
13391
13607
|
}
|
|
13392
13608
|
if (e.target === this) {
|
|
13393
13609
|
this.currentFocused = this.getValidFocusableItem();
|
|
13610
|
+
if (this.currentFocused && this.currentFocused.tabIndex < 0) {
|
|
13611
|
+
this.currentFocused.tabIndex = 0;
|
|
13612
|
+
}
|
|
13394
13613
|
this.currentFocused?.focus();
|
|
13395
13614
|
return;
|
|
13396
13615
|
}
|
|
@@ -13478,6 +13697,10 @@ class BaseTree extends FASTElement {
|
|
|
13478
13697
|
focusItem.focus();
|
|
13479
13698
|
}
|
|
13480
13699
|
}
|
|
13700
|
+
/** @internal */
|
|
13701
|
+
handleDefaultSlotChange() {
|
|
13702
|
+
this.childTreeItems = this.defaultSlot.assignedElements().filter(el => isTreeItem(el));
|
|
13703
|
+
}
|
|
13481
13704
|
}
|
|
13482
13705
|
__decorateClass$3([observable], BaseTree.prototype, "currentSelected", 2);
|
|
13483
13706
|
__decorateClass$3([observable], BaseTree.prototype, "childTreeItems", 2);
|
|
@@ -13529,12 +13752,10 @@ __decorateClass$2([attr], Tree.prototype, "appearance", 2);
|
|
|
13529
13752
|
|
|
13530
13753
|
const styles$1 = css`
|
|
13531
13754
|
${display("block")}
|
|
13755
|
+
|
|
13532
13756
|
:host{outline:none}`;
|
|
13533
13757
|
|
|
13534
|
-
const template$1 = html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusHandler(c.event)}" @focusout="${(x, c) => x.blurHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" ${
|
|
13535
|
-
property: "childTreeItems",
|
|
13536
|
-
filter: node => isTreeItem(node)
|
|
13537
|
-
})}><slot></slot></template>`;
|
|
13758
|
+
const template$1 = html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @focusin="${(x, c) => x.focusHandler(c.event)}" @focusout="${(x, c) => x.blurHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}"><slot ${ref("defaultSlot")} @slotchange="${x => x.handleDefaultSlotChange()}"></slot></template>`;
|
|
13538
13759
|
|
|
13539
13760
|
const definition$1 = Tree.compose({
|
|
13540
13761
|
name: `${FluentDesignSystem.prefix}-tree`,
|
|
@@ -13592,6 +13813,7 @@ class BaseTreeItem extends FASTElement {
|
|
|
13592
13813
|
* @internal
|
|
13593
13814
|
*/
|
|
13594
13815
|
selectedChanged(prev, next) {
|
|
13816
|
+
this.updateTabindexBySelected();
|
|
13595
13817
|
this.$emit("change");
|
|
13596
13818
|
toggleState(this.elementInternals, "selected", next);
|
|
13597
13819
|
this.elementInternals.ariaSelected = next ? "true" : "false";
|
|
@@ -13613,6 +13835,10 @@ class BaseTreeItem extends FASTElement {
|
|
|
13613
13835
|
this.empty = this.childTreeItems?.length === 0;
|
|
13614
13836
|
this.updateChildTreeItems();
|
|
13615
13837
|
}
|
|
13838
|
+
connectedCallback() {
|
|
13839
|
+
super.connectedCallback();
|
|
13840
|
+
this.updateTabindexBySelected();
|
|
13841
|
+
}
|
|
13616
13842
|
/**
|
|
13617
13843
|
* Updates the childrens indent
|
|
13618
13844
|
*
|
|
@@ -13653,7 +13879,17 @@ class BaseTreeItem extends FASTElement {
|
|
|
13653
13879
|
get isNestedItem() {
|
|
13654
13880
|
return isTreeItem(this.parentElement);
|
|
13655
13881
|
}
|
|
13882
|
+
updateTabindexBySelected() {
|
|
13883
|
+
if (this.$fastController.isConnected) {
|
|
13884
|
+
this.tabIndex = this.selected ? 0 : -1;
|
|
13885
|
+
}
|
|
13886
|
+
}
|
|
13887
|
+
/** @internal */
|
|
13888
|
+
handleItemSlotChange() {
|
|
13889
|
+
this.childTreeItems = this.itemSlot.assignedElements().filter(el => isTreeItem(el));
|
|
13890
|
+
}
|
|
13656
13891
|
}
|
|
13892
|
+
__decorateClass$1([observable], BaseTreeItem.prototype, "itemSlot", 2);
|
|
13657
13893
|
__decorateClass$1([attr({
|
|
13658
13894
|
mode: "boolean"
|
|
13659
13895
|
})], BaseTreeItem.prototype, "expanded", 2);
|
|
@@ -13729,13 +13965,10 @@ const styles = css`
|
|
|
13729
13965
|
${display("block")}
|
|
13730
13966
|
|
|
13731
13967
|
:host{outline:none;font-size:${fontSizeBase300};line-height:${lineHeightBase300}}:host(:focus-visible) .positioning-region{box-shadow:${spacingVerticalNone} ${spacingVerticalNone} ${spacingVerticalNone} ${spacingVerticalXXS}
|
|
13732
|
-
${colorStrokeFocus2} inset}.positioning-region{display:flex;align-items:center;justify-content:space-between;cursor:pointer;height:${spacingVerticalXXXL};padding-inline-start:calc(var(--indent) * ${spacingHorizontalXXL});padding-inline-end:${spacingVerticalS};border-radius:${borderRadiusMedium};background-color:${colorSubtleBackground};color:${colorNeutralForeground2};gap:${spacingHorizontalXS}}@media (prefers-contrast:more){:host(:focus-visible) .positioning-region{outline:1px solid ${colorStrokeFocus2}}}.content{display:flex;align-items:center;gap:${spacingHorizontalXS}}.chevron{display:flex;align-items:center;flex-shrink:0;justify-content:center;width:${spacingHorizontalXXL};height:${spacingVerticalXXL};transition:transform ${durationFaster} ${curveEasyEaseMax};transform:rotate(0deg)}.chevron:dir(rtl){transform:rotate(180deg)}.aside{display:flex;align-items:center}.positioning-region:hover{background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground2Hover}}.positioning-region:active{background-color:${colorSubtleBackgroundPressed};color:${colorNeutralForeground2Pressed}}::slotted([slot='start']),::slotted([slot='end']),::slotted(:not([slot])){display:flex;align-items:center;min-width:0}::slotted([slot='start']){flex-shrink:0}::slotted(:not([slot])){padding-inline:${spacingHorizontalXXS}}.items{display:none}:host([expanded]) .items{display:block}:host([empty]) .chevron,:host([empty]) .items{visibility:hidden}:host([selected]) .positioning-region{background-color:${colorSubtleBackgroundSelected};color:${colorNeutralForeground2Selected}}:host([selected]) .content,:host([selected]) .chevron{color:${colorNeutralForeground3Selected}}:host([size='small']) .positioning-region{height:${spacingVerticalXXL};padding-inline-start:calc(var(--indent) * ${spacingHorizontalM})}:host([appearance='subtle-alpha']) .positioning-region:hover{background-color:${colorSubtleBackgroundLightAlphaHover}}:host([appearance='subtle-alpha']) .positioning-region:active{background-color:${colorSubtleBackgroundLightAlphaPressed}}:host([appearance='subtle-alpha'][selected]) .positioning-region{background-color:${colorSubtleBackgroundLightAlphaSelected};color:${colorNeutralForeground2Selected}}:host([appearance='transparent']) .positioning-region{background-color:${colorTransparentBackground}}:host([appearance='transparent']) .positioning-region:hover{background-color:${colorTransparentBackgroundHover}}:host([appearance='transparent']) .positioning-region:active{background-color:${colorTransparentBackgroundPressed}}:host([appearance='transparent'][selected]) .positioning-region{background-color:${colorTransparentBackgroundSelected};color:${colorNeutralForeground2Selected}}:host([expanded]) .chevron{transform:rotate(90deg)}`;
|
|
13968
|
+
${colorStrokeFocus2} inset}.positioning-region{display:flex;align-items:center;justify-content:space-between;cursor:pointer;height:${spacingVerticalXXXL};padding-inline-start:calc(var(--indent) * ${spacingHorizontalXXL});padding-inline-end:${spacingVerticalS};border-radius:${borderRadiusMedium};background-color:${colorSubtleBackground};color:${colorNeutralForeground2};gap:${spacingHorizontalXS}}@media (prefers-contrast:more){:host(:focus-visible) .positioning-region{outline:1px solid ${colorStrokeFocus2}}}.content{display:flex;align-items:center;gap:${spacingHorizontalXS}}.chevron{display:flex;align-items:center;flex-shrink:0;justify-content:center;width:${spacingHorizontalXXL};height:${spacingVerticalXXL};transition:transform ${durationFaster} ${curveEasyEaseMax};transform:rotate(0deg)}.chevron:dir(rtl){transform:rotate(180deg)}.chevron svg{inline-size:12px;block-size:12px}.aside{display:flex;align-items:center}.positioning-region:hover{background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground2Hover}}.positioning-region:active{background-color:${colorSubtleBackgroundPressed};color:${colorNeutralForeground2Pressed}}::slotted([slot='start']),::slotted([slot='end']),::slotted(:not([slot])){display:flex;align-items:center;min-width:0}::slotted([slot='start']){flex-shrink:0}::slotted(:not([slot])){padding-inline:${spacingHorizontalXXS}}.items{display:none}:host([expanded]) .items{display:block}:host([empty]) .chevron,:host([empty]) .items{visibility:hidden}:host([selected]) .positioning-region{background-color:${colorSubtleBackgroundSelected};color:${colorNeutralForeground2Selected}}:host([selected]) .content,:host([selected]) .chevron{color:${colorNeutralForeground3Selected}}:host([size='small']) .positioning-region{height:${spacingVerticalXXL};padding-inline-start:calc(var(--indent) * ${spacingHorizontalM})}:host([appearance='subtle-alpha']) .positioning-region:hover{background-color:${colorSubtleBackgroundLightAlphaHover}}:host([appearance='subtle-alpha']) .positioning-region:active{background-color:${colorSubtleBackgroundLightAlphaPressed}}:host([appearance='subtle-alpha'][selected]) .positioning-region{background-color:${colorSubtleBackgroundLightAlphaSelected};color:${colorNeutralForeground2Selected}}:host([appearance='transparent']) .positioning-region{background-color:${colorTransparentBackground}}:host([appearance='transparent']) .positioning-region:hover{background-color:${colorTransparentBackgroundHover}}:host([appearance='transparent']) .positioning-region:active{background-color:${colorTransparentBackgroundPressed}}:host([appearance='transparent'][selected]) .positioning-region{background-color:${colorTransparentBackgroundSelected};color:${colorNeutralForeground2Selected}}:host([expanded]) .chevron{transform:rotate(90deg)}`;
|
|
13733
13969
|
|
|
13734
|
-
const chevronIcon = html`<svg
|
|
13735
|
-
const template = html`<template
|
|
13736
|
-
property: "childTreeItems",
|
|
13737
|
-
filter: node => isTreeItem(node)
|
|
13738
|
-
})}><div class="positioning-region" part="positioning-region"><div class="content" part="content"><span class="chevron" part="chevron"><slot name="chevron">${chevronIcon}</slot></span><slot name="start"></slot><slot></slot><slot name="end"></slot></div><div class="aside" part="aside"><slot name="aside"></slot></div></div><div role="group" class="items" part="items"><slot name="item"></slot></div></template>`;
|
|
13970
|
+
const chevronIcon = html`<svg viewBox="0 0 12 12" fill="currentColor"><path d="M4.65 2.15a.5.5 0 000 .7L7.79 6 4.65 9.15a.5.5 0 10.7.7l3.5-3.5a.5.5 0 000-.7l-3.5-3.5a.5.5 0 00-.7 0z"></path></svg>`;
|
|
13971
|
+
const template = html`<template slot="${x => x.isNestedItem ? "item" : void 0}"><div class="positioning-region" part="positioning-region"><div class="content" part="content"><span class="chevron" part="chevron" aria-hidden="true"><slot name="chevron">${chevronIcon}</slot></span><slot name="start"></slot><slot></slot><slot name="end"></slot></div><div class="aside" part="aside"><slot name="aside"></slot></div></div><div role="group" class="items" part="items"><slot name="item" ${ref("itemSlot")} @slotchange="${x => x.handleItemSlotChange()}"></slot></div></template>`;
|
|
13739
13972
|
|
|
13740
13973
|
const definition = TreeItem.compose({
|
|
13741
13974
|
name: `${FluentDesignSystem.prefix}-tree-item`,
|