@fluentui/web-components 3.0.0-rc.14 → 3.0.0-rc.16
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 +26 -2
- package/custom-elements.json +10963 -11559
- package/dist/esm/accordion/accordion.d.ts +4 -7
- package/dist/esm/accordion/accordion.definition.js +2 -2
- package/dist/esm/accordion/accordion.definition.js.map +1 -1
- package/dist/esm/accordion/accordion.js +4 -7
- package/dist/esm/accordion/accordion.js.map +1 -1
- package/dist/esm/accordion/accordion.options.d.ts +7 -1
- package/dist/esm/accordion/accordion.options.js +7 -0
- package/dist/esm/accordion/accordion.options.js.map +1 -1
- package/dist/esm/accordion/accordion.styles.js +1 -1
- package/dist/esm/accordion/accordion.styles.js.map +1 -1
- package/dist/esm/accordion/index.d.ts +1 -0
- package/dist/esm/accordion/index.js +1 -0
- package/dist/esm/accordion/index.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.base.d.ts +0 -8
- package/dist/esm/accordion-item/accordion-item.base.js +3 -12
- package/dist/esm/accordion-item/accordion-item.base.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.d.ts +2 -4
- package/dist/esm/accordion-item/accordion-item.definition.js +2 -2
- package/dist/esm/accordion-item/accordion-item.definition.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.js +1 -1
- package/dist/esm/accordion-item/accordion-item.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.options.d.ts +6 -0
- package/dist/esm/accordion-item/accordion-item.options.js +7 -0
- package/dist/esm/accordion-item/accordion-item.options.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.styles.js +1 -1
- package/dist/esm/accordion-item/accordion-item.styles.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.template.js +7 -7
- package/dist/esm/accordion-item/accordion-item.template.js.map +1 -1
- package/dist/esm/accordion-item/index.d.ts +1 -0
- package/dist/esm/accordion-item/index.js +1 -0
- package/dist/esm/accordion-item/index.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.base.d.ts +1 -1
- package/dist/esm/anchor-button/anchor-button.base.js +7 -7
- package/dist/esm/anchor-button/anchor-button.base.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.d.ts +1 -2
- package/dist/esm/anchor-button/anchor-button.definition.js +2 -2
- package/dist/esm/anchor-button/anchor-button.definition.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.js +1 -1
- package/dist/esm/anchor-button/anchor-button.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.options.d.ts +7 -1
- package/dist/esm/anchor-button/anchor-button.options.js +7 -0
- package/dist/esm/anchor-button/anchor-button.options.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.styles.js +4 -3
- package/dist/esm/anchor-button/anchor-button.styles.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.template.js +1 -1
- package/dist/esm/anchor-button/anchor-button.template.js.map +1 -1
- package/dist/esm/anchor-button/index.d.ts +1 -0
- package/dist/esm/anchor-button/index.js +1 -0
- package/dist/esm/anchor-button/index.js.map +1 -1
- package/dist/esm/avatar/avatar.definition.js +2 -2
- package/dist/esm/avatar/avatar.definition.js.map +1 -1
- package/dist/esm/avatar/avatar.options.d.ts +7 -1
- package/dist/esm/avatar/avatar.options.js +7 -0
- package/dist/esm/avatar/avatar.options.js.map +1 -1
- package/dist/esm/avatar/avatar.styles.js +1 -1
- package/dist/esm/avatar/avatar.styles.js.map +1 -1
- package/dist/esm/avatar/index.d.ts +1 -0
- package/dist/esm/avatar/index.js +1 -0
- package/dist/esm/avatar/index.js.map +1 -1
- package/dist/esm/badge/badge.d.ts +1 -1
- package/dist/esm/badge/badge.definition.js +2 -2
- package/dist/esm/badge/badge.definition.js.map +1 -1
- package/dist/esm/badge/badge.js +1 -1
- package/dist/esm/badge/badge.js.map +1 -1
- package/dist/esm/badge/badge.options.d.ts +9 -2
- package/dist/esm/badge/badge.options.js +7 -0
- package/dist/esm/badge/badge.options.js.map +1 -1
- package/dist/esm/badge/badge.styles.js +5 -4
- package/dist/esm/badge/badge.styles.js.map +1 -1
- package/dist/esm/badge/badge.template.js +1 -1
- package/dist/esm/badge/badge.template.js.map +1 -1
- package/dist/esm/badge/index.d.ts +1 -0
- package/dist/esm/badge/index.js +1 -0
- package/dist/esm/badge/index.js.map +1 -1
- package/dist/esm/button/button.d.ts +1 -1
- package/dist/esm/button/button.definition.js +2 -2
- package/dist/esm/button/button.definition.js.map +1 -1
- package/dist/esm/button/button.js +1 -1
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/button/button.options.d.ts +8 -2
- package/dist/esm/button/button.options.js +7 -0
- package/dist/esm/button/button.options.js.map +1 -1
- package/dist/esm/button/button.styles.js +5 -3
- package/dist/esm/button/button.styles.js.map +1 -1
- package/dist/esm/button/button.template.js +1 -1
- package/dist/esm/button/button.template.js.map +1 -1
- package/dist/esm/button/index.d.ts +1 -0
- package/dist/esm/button/index.js +1 -0
- package/dist/esm/button/index.js.map +1 -1
- package/dist/esm/checkbox/checkbox.definition.js +2 -2
- package/dist/esm/checkbox/checkbox.definition.js.map +1 -1
- package/dist/esm/checkbox/checkbox.options.d.ts +6 -0
- package/dist/esm/checkbox/checkbox.options.js +7 -0
- package/dist/esm/checkbox/checkbox.options.js.map +1 -1
- package/dist/esm/checkbox/checkbox.styles.js +4 -3
- package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
- package/dist/esm/checkbox/index.d.ts +1 -0
- package/dist/esm/checkbox/index.js +1 -0
- package/dist/esm/checkbox/index.js.map +1 -1
- package/dist/esm/compound-button/compound-button.definition.js +2 -2
- package/dist/esm/compound-button/compound-button.definition.js.map +1 -1
- package/dist/esm/compound-button/compound-button.options.d.ts +7 -1
- package/dist/esm/compound-button/compound-button.options.js +7 -0
- package/dist/esm/compound-button/compound-button.options.js.map +1 -1
- package/dist/esm/compound-button/compound-button.styles.js +4 -3
- package/dist/esm/compound-button/compound-button.styles.js.map +1 -1
- package/dist/esm/compound-button/compound-button.template.js +1 -1
- package/dist/esm/compound-button/compound-button.template.js.map +1 -1
- package/dist/esm/compound-button/index.d.ts +1 -0
- package/dist/esm/compound-button/index.js +1 -0
- package/dist/esm/compound-button/index.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.d.ts +1 -1
- package/dist/esm/counter-badge/counter-badge.definition.js +2 -2
- package/dist/esm/counter-badge/counter-badge.definition.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.js +1 -1
- package/dist/esm/counter-badge/counter-badge.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.options.d.ts +7 -1
- package/dist/esm/counter-badge/counter-badge.options.js +7 -0
- package/dist/esm/counter-badge/counter-badge.options.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.styles.js +1 -1
- package/dist/esm/counter-badge/counter-badge.styles.js.map +1 -1
- package/dist/esm/counter-badge/index.d.ts +1 -0
- package/dist/esm/counter-badge/index.js +1 -0
- package/dist/esm/counter-badge/index.js.map +1 -1
- package/dist/esm/dialog/dialog.definition.js +2 -2
- package/dist/esm/dialog/dialog.definition.js.map +1 -1
- package/dist/esm/dialog/dialog.options.d.ts +7 -1
- package/dist/esm/dialog/dialog.options.js +7 -0
- package/dist/esm/dialog/dialog.options.js.map +1 -1
- package/dist/esm/dialog/dialog.styles.js +4 -3
- package/dist/esm/dialog/dialog.styles.js.map +1 -1
- package/dist/esm/dialog/index.d.ts +1 -0
- package/dist/esm/dialog/index.js +1 -0
- package/dist/esm/dialog/index.js.map +1 -1
- package/dist/esm/dialog-body/dialog-body.definition.js +2 -2
- package/dist/esm/dialog-body/dialog-body.definition.js.map +1 -1
- package/dist/esm/dialog-body/dialog-body.options.d.ts +6 -0
- package/dist/esm/dialog-body/dialog-body.options.js +8 -0
- package/dist/esm/dialog-body/dialog-body.options.js.map +1 -0
- package/dist/esm/dialog-body/dialog-body.styles.js +1 -1
- package/dist/esm/dialog-body/dialog-body.styles.js.map +1 -1
- package/dist/esm/dialog-body/index.d.ts +1 -0
- package/dist/esm/dialog-body/index.js +1 -0
- package/dist/esm/dialog-body/index.js.map +1 -1
- package/dist/esm/divider/divider.definition.js +2 -2
- package/dist/esm/divider/divider.definition.js.map +1 -1
- package/dist/esm/divider/divider.options.d.ts +7 -1
- package/dist/esm/divider/divider.options.js +7 -0
- package/dist/esm/divider/divider.options.js.map +1 -1
- package/dist/esm/divider/divider.styles.js +5 -3
- package/dist/esm/divider/divider.styles.js.map +1 -1
- package/dist/esm/divider/index.d.ts +1 -0
- package/dist/esm/divider/index.js +1 -0
- package/dist/esm/divider/index.js.map +1 -1
- package/dist/esm/drawer/drawer.d.ts +8 -7
- package/dist/esm/drawer/drawer.definition.js +2 -2
- package/dist/esm/drawer/drawer.definition.js.map +1 -1
- package/dist/esm/drawer/drawer.js +8 -8
- package/dist/esm/drawer/drawer.js.map +1 -1
- package/dist/esm/drawer/drawer.options.d.ts +7 -1
- package/dist/esm/drawer/drawer.options.js +7 -0
- package/dist/esm/drawer/drawer.options.js.map +1 -1
- package/dist/esm/drawer/drawer.styles.js +1 -1
- package/dist/esm/drawer/drawer.styles.js.map +1 -1
- package/dist/esm/drawer/index.d.ts +1 -0
- package/dist/esm/drawer/index.js +1 -0
- package/dist/esm/drawer/index.js.map +1 -1
- package/dist/esm/drawer-body/drawer-body.definition.js +2 -2
- package/dist/esm/drawer-body/drawer-body.definition.js.map +1 -1
- package/dist/esm/drawer-body/drawer-body.options.d.ts +6 -0
- package/dist/esm/drawer-body/drawer-body.options.js +8 -0
- package/dist/esm/drawer-body/drawer-body.options.js.map +1 -0
- package/dist/esm/drawer-body/drawer-body.styles.js +1 -1
- package/dist/esm/drawer-body/drawer-body.styles.js.map +1 -1
- package/dist/esm/drawer-body/index.d.ts +1 -0
- package/dist/esm/drawer-body/index.js +1 -0
- package/dist/esm/drawer-body/index.js.map +1 -1
- package/dist/esm/dropdown/dropdown.definition.js +2 -2
- package/dist/esm/dropdown/dropdown.definition.js.map +1 -1
- package/dist/esm/dropdown/dropdown.options.d.ts +6 -0
- package/dist/esm/dropdown/dropdown.options.js +7 -0
- package/dist/esm/dropdown/dropdown.options.js.map +1 -1
- package/dist/esm/dropdown/index.d.ts +1 -0
- package/dist/esm/dropdown/index.js +1 -0
- package/dist/esm/dropdown/index.js.map +1 -1
- package/dist/esm/field/field.definition.js +2 -2
- package/dist/esm/field/field.definition.js.map +1 -1
- package/dist/esm/field/field.options.d.ts +6 -0
- package/dist/esm/field/field.options.js +7 -0
- package/dist/esm/field/field.options.js.map +1 -1
- package/dist/esm/field/index.d.ts +1 -0
- package/dist/esm/field/index.js +1 -0
- package/dist/esm/field/index.js.map +1 -1
- package/dist/esm/fluent-design-system.js +1 -1
- package/dist/esm/fluent-design-system.js.map +1 -1
- package/dist/esm/image/image.definition.js +2 -2
- package/dist/esm/image/image.definition.js.map +1 -1
- package/dist/esm/image/image.options.d.ts +7 -1
- package/dist/esm/image/image.options.js +7 -0
- package/dist/esm/image/image.options.js.map +1 -1
- package/dist/esm/image/index.d.ts +1 -0
- package/dist/esm/image/index.js +1 -0
- package/dist/esm/image/index.js.map +1 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/label/index.d.ts +1 -0
- package/dist/esm/label/index.js +1 -0
- package/dist/esm/label/index.js.map +1 -1
- package/dist/esm/label/label.definition.js +2 -2
- package/dist/esm/label/label.definition.js.map +1 -1
- package/dist/esm/label/label.options.d.ts +7 -1
- package/dist/esm/label/label.options.js +7 -0
- package/dist/esm/label/label.options.js.map +1 -1
- package/dist/esm/label/label.styles.js +1 -1
- package/dist/esm/label/label.styles.js.map +1 -1
- package/dist/esm/link/index.d.ts +1 -0
- package/dist/esm/link/index.js +1 -0
- package/dist/esm/link/index.js.map +1 -1
- package/dist/esm/link/link.definition.js +2 -2
- package/dist/esm/link/link.definition.js.map +1 -1
- package/dist/esm/link/link.options.d.ts +7 -1
- package/dist/esm/link/link.options.js +7 -0
- package/dist/esm/link/link.options.js.map +1 -1
- package/dist/esm/link/link.styles.js +5 -3
- package/dist/esm/link/link.styles.js.map +1 -1
- package/dist/esm/listbox/index.d.ts +1 -0
- package/dist/esm/listbox/index.js +1 -0
- package/dist/esm/listbox/index.js.map +1 -1
- package/dist/esm/listbox/listbox.definition.js +2 -2
- package/dist/esm/listbox/listbox.definition.js.map +1 -1
- package/dist/esm/listbox/listbox.options.d.ts +6 -0
- package/dist/esm/listbox/listbox.options.js +7 -0
- package/dist/esm/listbox/listbox.options.js.map +1 -1
- package/dist/esm/menu/index.d.ts +1 -0
- package/dist/esm/menu/index.js +1 -0
- package/dist/esm/menu/index.js.map +1 -1
- package/dist/esm/menu/menu.definition.js +2 -2
- package/dist/esm/menu/menu.definition.js.map +1 -1
- package/dist/esm/menu/menu.js +4 -3
- package/dist/esm/menu/menu.js.map +1 -1
- package/dist/esm/menu/menu.options.d.ts +6 -0
- package/dist/esm/menu/menu.options.js +8 -0
- package/dist/esm/menu/menu.options.js.map +1 -0
- package/dist/esm/menu/menu.styles.js +1 -1
- package/dist/esm/menu/menu.styles.js.map +1 -1
- package/dist/esm/menu-button/index.d.ts +1 -0
- package/dist/esm/menu-button/index.js +1 -0
- package/dist/esm/menu-button/index.js.map +1 -1
- package/dist/esm/menu-button/menu-button.definition.js +2 -2
- package/dist/esm/menu-button/menu-button.definition.js.map +1 -1
- package/dist/esm/menu-button/menu-button.options.d.ts +7 -1
- package/dist/esm/menu-button/menu-button.options.js +7 -0
- package/dist/esm/menu-button/menu-button.options.js.map +1 -1
- package/dist/esm/menu-item/index.d.ts +1 -0
- package/dist/esm/menu-item/index.js +1 -0
- package/dist/esm/menu-item/index.js.map +1 -1
- package/dist/esm/menu-item/menu-item.d.ts +3 -1
- package/dist/esm/menu-item/menu-item.definition.js +2 -2
- package/dist/esm/menu-item/menu-item.definition.js.map +1 -1
- package/dist/esm/menu-item/menu-item.js +19 -7
- package/dist/esm/menu-item/menu-item.js.map +1 -1
- package/dist/esm/menu-item/menu-item.options.d.ts +7 -1
- package/dist/esm/menu-item/menu-item.options.js +7 -0
- package/dist/esm/menu-item/menu-item.options.js.map +1 -1
- package/dist/esm/menu-item/menu-item.styles.js +5 -3
- package/dist/esm/menu-item/menu-item.styles.js.map +1 -1
- package/dist/esm/menu-item/menu-item.template.js +3 -2
- package/dist/esm/menu-item/menu-item.template.js.map +1 -1
- package/dist/esm/menu-list/index.d.ts +1 -0
- package/dist/esm/menu-list/index.js +1 -0
- package/dist/esm/menu-list/index.js.map +1 -1
- package/dist/esm/menu-list/menu-list.base.d.ts +5 -24
- package/dist/esm/menu-list/menu-list.base.js +20 -125
- package/dist/esm/menu-list/menu-list.base.js.map +1 -1
- package/dist/esm/menu-list/menu-list.d.ts +5 -1
- package/dist/esm/menu-list/menu-list.definition.js +2 -2
- package/dist/esm/menu-list/menu-list.definition.js.map +1 -1
- package/dist/esm/menu-list/menu-list.js +23 -1
- package/dist/esm/menu-list/menu-list.js.map +1 -1
- package/dist/esm/menu-list/menu-list.options.d.ts +6 -0
- package/dist/esm/menu-list/menu-list.options.js +8 -0
- package/dist/esm/menu-list/menu-list.options.js.map +1 -0
- package/dist/esm/menu-list/menu-list.styles.js +1 -1
- package/dist/esm/menu-list/menu-list.styles.js.map +1 -1
- package/dist/esm/menu-list/menu-list.template.js +1 -5
- package/dist/esm/menu-list/menu-list.template.js.map +1 -1
- package/dist/esm/message-bar/index.d.ts +1 -0
- package/dist/esm/message-bar/index.js +1 -0
- package/dist/esm/message-bar/index.js.map +1 -1
- package/dist/esm/message-bar/message-bar.definition.js +2 -1
- package/dist/esm/message-bar/message-bar.definition.js.map +1 -1
- package/dist/esm/message-bar/message-bar.options.d.ts +6 -0
- package/dist/esm/message-bar/message-bar.options.js +7 -0
- package/dist/esm/message-bar/message-bar.options.js.map +1 -1
- package/dist/esm/message-bar/message-bar.template.d.ts +3 -3
- package/dist/esm/message-bar/message-bar.template.js +3 -3
- package/dist/esm/option/index.d.ts +1 -0
- package/dist/esm/option/index.js +1 -0
- package/dist/esm/option/index.js.map +1 -1
- package/dist/esm/option/option.definition.js +2 -2
- package/dist/esm/option/option.definition.js.map +1 -1
- package/dist/esm/option/option.options.d.ts +6 -0
- package/dist/esm/option/option.options.js +7 -0
- package/dist/esm/option/option.options.js.map +1 -1
- package/dist/esm/patterns/start-end.d.ts +1 -1
- package/dist/esm/patterns/start-end.js +1 -1
- package/dist/esm/patterns/start-end.js.map +1 -1
- package/dist/esm/progress-bar/index.d.ts +1 -0
- package/dist/esm/progress-bar/index.js +1 -0
- package/dist/esm/progress-bar/index.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.definition.js +2 -2
- package/dist/esm/progress-bar/progress-bar.definition.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.options.d.ts +7 -1
- package/dist/esm/progress-bar/progress-bar.options.js +7 -0
- package/dist/esm/progress-bar/progress-bar.options.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.styles.js +5 -3
- package/dist/esm/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/esm/radio/index.d.ts +1 -0
- package/dist/esm/radio/index.js +1 -0
- package/dist/esm/radio/index.js.map +1 -1
- package/dist/esm/radio/radio.d.ts +1 -1
- package/dist/esm/radio/radio.definition.js +2 -2
- package/dist/esm/radio/radio.definition.js.map +1 -1
- package/dist/esm/radio/radio.js +1 -1
- package/dist/esm/radio/radio.options.d.ts +6 -0
- package/dist/esm/radio/radio.options.js +7 -0
- package/dist/esm/radio/radio.options.js.map +1 -1
- package/dist/esm/radio/radio.styles.js +4 -3
- package/dist/esm/radio/radio.styles.js.map +1 -1
- package/dist/esm/radio/radio.template.js +1 -1
- package/dist/esm/radio/radio.template.js.map +1 -1
- package/dist/esm/radio-group/index.d.ts +1 -0
- package/dist/esm/radio-group/index.js +1 -0
- package/dist/esm/radio-group/index.js.map +1 -1
- package/dist/esm/radio-group/radio-group.base.d.ts +3 -16
- package/dist/esm/radio-group/radio-group.base.js +30 -88
- package/dist/esm/radio-group/radio-group.base.js.map +1 -1
- package/dist/esm/radio-group/radio-group.d.ts +5 -0
- package/dist/esm/radio-group/radio-group.definition.js +2 -2
- package/dist/esm/radio-group/radio-group.definition.js.map +1 -1
- package/dist/esm/radio-group/radio-group.js +22 -0
- package/dist/esm/radio-group/radio-group.js.map +1 -1
- package/dist/esm/radio-group/radio-group.options.d.ts +7 -1
- package/dist/esm/radio-group/radio-group.options.js +7 -0
- package/dist/esm/radio-group/radio-group.options.js.map +1 -1
- package/dist/esm/radio-group/radio-group.styles.js +1 -1
- package/dist/esm/radio-group/radio-group.styles.js.map +1 -1
- package/dist/esm/radio-group/radio-group.template.js +1 -1
- package/dist/esm/radio-group/radio-group.template.js.map +1 -1
- package/dist/esm/rating-display/index.d.ts +1 -0
- package/dist/esm/rating-display/index.js +1 -0
- package/dist/esm/rating-display/index.js.map +1 -1
- package/dist/esm/rating-display/rating-display.definition.js +2 -2
- package/dist/esm/rating-display/rating-display.definition.js.map +1 -1
- package/dist/esm/rating-display/rating-display.options.d.ts +7 -1
- package/dist/esm/rating-display/rating-display.options.js +7 -0
- package/dist/esm/rating-display/rating-display.options.js.map +1 -1
- package/dist/esm/rating-display/rating-display.styles.js +5 -3
- package/dist/esm/rating-display/rating-display.styles.js.map +1 -1
- package/dist/esm/slider/index.d.ts +1 -0
- package/dist/esm/slider/index.js +1 -0
- package/dist/esm/slider/index.js.map +1 -1
- package/dist/esm/slider/slider.definition.js +2 -2
- package/dist/esm/slider/slider.definition.js.map +1 -1
- package/dist/esm/slider/slider.options.d.ts +8 -1
- package/dist/esm/slider/slider.options.js +7 -0
- package/dist/esm/slider/slider.options.js.map +1 -1
- package/dist/esm/slider/slider.styles.js +5 -3
- package/dist/esm/slider/slider.styles.js.map +1 -1
- package/dist/esm/spinner/index.d.ts +1 -0
- package/dist/esm/spinner/index.js +1 -0
- package/dist/esm/spinner/index.js.map +1 -1
- package/dist/esm/spinner/spinner.definition.js +2 -2
- package/dist/esm/spinner/spinner.definition.js.map +1 -1
- package/dist/esm/spinner/spinner.options.d.ts +7 -1
- package/dist/esm/spinner/spinner.options.js +7 -0
- package/dist/esm/spinner/spinner.options.js.map +1 -1
- package/dist/esm/spinner/spinner.styles.js +5 -3
- package/dist/esm/spinner/spinner.styles.js.map +1 -1
- package/dist/esm/styles/index.d.ts +2 -1
- package/dist/esm/styles/index.js +2 -1
- package/dist/esm/styles/index.js.map +1 -1
- package/dist/esm/styles/partials/badge.partials.js +1 -1
- package/dist/esm/styles/partials/badge.partials.js.map +1 -1
- package/dist/esm/switch/index.d.ts +1 -0
- package/dist/esm/switch/index.js +1 -0
- package/dist/esm/switch/index.js.map +1 -1
- package/dist/esm/switch/switch.d.ts +1 -1
- package/dist/esm/switch/switch.definition.js +2 -2
- package/dist/esm/switch/switch.definition.js.map +1 -1
- package/dist/esm/switch/switch.options.d.ts +7 -1
- package/dist/esm/switch/switch.options.js +7 -0
- package/dist/esm/switch/switch.options.js.map +1 -1
- package/dist/esm/switch/switch.styles.js +4 -3
- package/dist/esm/switch/switch.styles.js.map +1 -1
- package/dist/esm/switch/switch.template.js +1 -1
- package/dist/esm/switch/switch.template.js.map +1 -1
- package/dist/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.d.ts +2 -0
- package/dist/esm/tab/tab.definition.js +2 -2
- package/dist/esm/tab/tab.definition.js.map +1 -1
- package/dist/esm/tab/tab.js +13 -3
- package/dist/esm/tab/tab.js.map +1 -1
- package/dist/esm/tab/tab.options.d.ts +6 -0
- package/dist/esm/tab/tab.options.js +7 -0
- package/dist/esm/tab/tab.options.js.map +1 -1
- package/dist/esm/tab/tab.styles.js +23 -3
- package/dist/esm/tab/tab.styles.js.map +1 -1
- package/dist/esm/tab/tab.template.js +2 -2
- package/dist/esm/tab/tab.template.js.map +1 -1
- package/dist/esm/tablist/index.d.ts +1 -0
- package/dist/esm/tablist/index.js +1 -0
- package/dist/esm/tablist/index.js.map +1 -1
- package/dist/esm/tablist/tablist.base.d.ts +13 -45
- package/dist/esm/tablist/tablist.base.js +76 -185
- package/dist/esm/tablist/tablist.base.js.map +1 -1
- package/dist/esm/tablist/tablist.d.ts +5 -73
- package/dist/esm/tablist/tablist.definition.js +2 -2
- package/dist/esm/tablist/tablist.definition.js.map +1 -1
- package/dist/esm/tablist/tablist.js +20 -130
- package/dist/esm/tablist/tablist.js.map +1 -1
- package/dist/esm/tablist/tablist.options.d.ts +7 -1
- package/dist/esm/tablist/tablist.options.js +7 -0
- package/dist/esm/tablist/tablist.options.js.map +1 -1
- package/dist/esm/tablist/tablist.styles.js +83 -65
- package/dist/esm/tablist/tablist.styles.js.map +1 -1
- package/dist/esm/tablist/tablist.template.js +5 -1
- package/dist/esm/tablist/tablist.template.js.map +1 -1
- package/dist/esm/text/index.d.ts +1 -0
- package/dist/esm/text/index.js +1 -0
- package/dist/esm/text/index.js.map +1 -1
- package/dist/esm/text/text.definition.js +2 -2
- package/dist/esm/text/text.definition.js.map +1 -1
- package/dist/esm/text/text.options.d.ts +7 -1
- package/dist/esm/text/text.options.js +7 -0
- package/dist/esm/text/text.options.js.map +1 -1
- package/dist/esm/text/text.styles.js +1 -1
- package/dist/esm/text/text.styles.js.map +1 -1
- package/dist/esm/text-input/index.d.ts +1 -0
- package/dist/esm/text-input/index.js +1 -0
- package/dist/esm/text-input/index.js.map +1 -1
- package/dist/esm/text-input/text-input.definition.js +2 -2
- package/dist/esm/text-input/text-input.definition.js.map +1 -1
- package/dist/esm/text-input/text-input.options.d.ts +6 -0
- package/dist/esm/text-input/text-input.options.js +7 -0
- package/dist/esm/text-input/text-input.options.js.map +1 -1
- package/dist/esm/textarea/index.d.ts +1 -0
- package/dist/esm/textarea/index.js +1 -0
- package/dist/esm/textarea/index.js.map +1 -1
- package/dist/esm/textarea/textarea.base.js +1 -1
- package/dist/esm/textarea/textarea.base.js.map +1 -1
- package/dist/esm/textarea/textarea.definition.js +2 -2
- package/dist/esm/textarea/textarea.definition.js.map +1 -1
- package/dist/esm/textarea/textarea.options.d.ts +6 -0
- package/dist/esm/textarea/textarea.options.js +7 -0
- package/dist/esm/textarea/textarea.options.js.map +1 -1
- package/dist/esm/textarea/textarea.styles.js +4 -3
- package/dist/esm/textarea/textarea.styles.js.map +1 -1
- package/dist/esm/toggle-button/index.d.ts +1 -0
- package/dist/esm/toggle-button/index.js +1 -0
- package/dist/esm/toggle-button/index.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.definition.js +2 -2
- package/dist/esm/toggle-button/toggle-button.definition.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.options.d.ts +8 -2
- package/dist/esm/toggle-button/toggle-button.options.js +7 -0
- package/dist/esm/toggle-button/toggle-button.options.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.styles.js +4 -3
- package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/esm/tooltip/index.d.ts +1 -0
- package/dist/esm/tooltip/index.js +1 -0
- package/dist/esm/tooltip/index.js.map +1 -1
- package/dist/esm/tooltip/tooltip.d.ts +2 -2
- package/dist/esm/tooltip/tooltip.definition.js +2 -2
- package/dist/esm/tooltip/tooltip.definition.js.map +1 -1
- package/dist/esm/tooltip/tooltip.js +2 -2
- package/dist/esm/tooltip/tooltip.options.d.ts +6 -0
- package/dist/esm/tooltip/tooltip.options.js +7 -0
- package/dist/esm/tooltip/tooltip.options.js.map +1 -1
- package/dist/esm/tree/index.d.ts +1 -0
- package/dist/esm/tree/index.js +1 -0
- package/dist/esm/tree/index.js.map +1 -1
- package/dist/esm/tree/tree.base.d.ts +5 -28
- package/dist/esm/tree/tree.base.js +20 -105
- package/dist/esm/tree/tree.base.js.map +1 -1
- package/dist/esm/tree/tree.d.ts +5 -0
- package/dist/esm/tree/tree.definition.js +2 -2
- package/dist/esm/tree/tree.definition.js.map +1 -1
- package/dist/esm/tree/tree.js +23 -0
- package/dist/esm/tree/tree.js.map +1 -1
- package/dist/esm/tree/tree.options.d.ts +6 -0
- package/dist/esm/tree/tree.options.js +8 -0
- package/dist/esm/tree/tree.options.js.map +1 -0
- package/dist/esm/tree/tree.template.js +2 -3
- package/dist/esm/tree/tree.template.js.map +1 -1
- package/dist/esm/tree-item/index.d.ts +1 -0
- package/dist/esm/tree-item/index.js +1 -0
- package/dist/esm/tree-item/index.js.map +1 -1
- package/dist/esm/tree-item/tree-item.base.d.ts +6 -3
- package/dist/esm/tree-item/tree-item.base.js +31 -11
- package/dist/esm/tree-item/tree-item.base.js.map +1 -1
- package/dist/esm/tree-item/tree-item.definition.js +2 -2
- package/dist/esm/tree-item/tree-item.definition.js.map +1 -1
- package/dist/esm/tree-item/tree-item.options.d.ts +6 -0
- package/dist/esm/tree-item/tree-item.options.js +7 -0
- package/dist/esm/tree-item/tree-item.options.js.map +1 -1
- package/dist/esm/tree-item/tree-item.template.js +1 -1
- package/dist/esm/tree-item/tree-item.template.js.map +1 -1
- package/dist/esm/utils/focusgroup.d.ts +22 -0
- package/dist/esm/utils/focusgroup.js +42 -0
- package/dist/esm/utils/focusgroup.js.map +1 -0
- package/dist/esm/utils/index.d.ts +0 -1
- package/dist/esm/utils/index.js +0 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/web-components.d.ts +70 -347
- package/dist/web-components.js +1279 -1321
- package/dist/web-components.min.js +242 -259
- package/package.json +4 -2
- package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.d.ts +0 -124
- package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js +0 -142
- package/dist/esm/utils/behaviors/match-media-stylesheet-behavior.js.map +0 -1
package/dist/web-components.js
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
const FluentDesignSystem = Object.freeze({
|
|
2
2
|
prefix: "fluent",
|
|
3
3
|
shadowRootMode: "open",
|
|
4
|
-
registry: customElements
|
|
4
|
+
registry: globalThis.customElements
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
+
function isCustomElement(tagSuffix) {
|
|
8
|
+
return element => {
|
|
9
|
+
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return element.tagName.toLowerCase().endsWith(tagSuffix);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function isAccordionItem(element, tagName2 = "-accordion-item") {
|
|
17
|
+
return isCustomElement(tagName2)(element);
|
|
18
|
+
}
|
|
19
|
+
const tagName$F = `${FluentDesignSystem.prefix}-accordion-item`;
|
|
20
|
+
|
|
7
21
|
let kernelMode;
|
|
8
22
|
const kernelAttr = "fast-kernel";
|
|
9
23
|
try {
|
|
@@ -3943,180 +3957,6 @@ const FASTElement = Object.assign(createFASTElement(HTMLElement), {
|
|
|
3943
3957
|
compose
|
|
3944
3958
|
});
|
|
3945
3959
|
|
|
3946
|
-
var __defProp$P = Object.defineProperty;
|
|
3947
|
-
var __getOwnPropDesc$P = Object.getOwnPropertyDescriptor;
|
|
3948
|
-
var __decorateClass$P = (decorators, target, key, kind) => {
|
|
3949
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$P(target, key) : target;
|
|
3950
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3951
|
-
if (kind && result) __defProp$P(target, key, result);
|
|
3952
|
-
return result;
|
|
3953
|
-
};
|
|
3954
|
-
class ARIAGlobalStatesAndProperties {}
|
|
3955
|
-
__decorateClass$P([attr({
|
|
3956
|
-
attribute: "aria-atomic"
|
|
3957
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", 2);
|
|
3958
|
-
__decorateClass$P([attr({
|
|
3959
|
-
attribute: "aria-busy"
|
|
3960
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", 2);
|
|
3961
|
-
__decorateClass$P([attr({
|
|
3962
|
-
attribute: "aria-controls"
|
|
3963
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaControls", 2);
|
|
3964
|
-
__decorateClass$P([attr({
|
|
3965
|
-
attribute: "aria-current"
|
|
3966
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", 2);
|
|
3967
|
-
__decorateClass$P([attr({
|
|
3968
|
-
attribute: "aria-describedby"
|
|
3969
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", 2);
|
|
3970
|
-
__decorateClass$P([attr({
|
|
3971
|
-
attribute: "aria-details"
|
|
3972
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", 2);
|
|
3973
|
-
__decorateClass$P([attr({
|
|
3974
|
-
attribute: "aria-disabled"
|
|
3975
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", 2);
|
|
3976
|
-
__decorateClass$P([attr({
|
|
3977
|
-
attribute: "aria-errormessage"
|
|
3978
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", 2);
|
|
3979
|
-
__decorateClass$P([attr({
|
|
3980
|
-
attribute: "aria-flowto"
|
|
3981
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", 2);
|
|
3982
|
-
__decorateClass$P([attr({
|
|
3983
|
-
attribute: "aria-haspopup"
|
|
3984
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", 2);
|
|
3985
|
-
__decorateClass$P([attr({
|
|
3986
|
-
attribute: "aria-hidden"
|
|
3987
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", 2);
|
|
3988
|
-
__decorateClass$P([attr({
|
|
3989
|
-
attribute: "aria-invalid"
|
|
3990
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", 2);
|
|
3991
|
-
__decorateClass$P([attr({
|
|
3992
|
-
attribute: "aria-keyshortcuts"
|
|
3993
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", 2);
|
|
3994
|
-
__decorateClass$P([attr({
|
|
3995
|
-
attribute: "aria-label"
|
|
3996
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", 2);
|
|
3997
|
-
__decorateClass$P([attr({
|
|
3998
|
-
attribute: "aria-labelledby"
|
|
3999
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", 2);
|
|
4000
|
-
__decorateClass$P([attr({
|
|
4001
|
-
attribute: "aria-live"
|
|
4002
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaLive", 2);
|
|
4003
|
-
__decorateClass$P([attr({
|
|
4004
|
-
attribute: "aria-owns"
|
|
4005
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", 2);
|
|
4006
|
-
__decorateClass$P([attr({
|
|
4007
|
-
attribute: "aria-relevant"
|
|
4008
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", 2);
|
|
4009
|
-
__decorateClass$P([attr({
|
|
4010
|
-
attribute: "aria-roledescription"
|
|
4011
|
-
})], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", 2);
|
|
4012
|
-
|
|
4013
|
-
const numberLikeStringConverter = {
|
|
4014
|
-
fromView(value) {
|
|
4015
|
-
const valueAsNumber = parseFloat(value);
|
|
4016
|
-
return Number.isNaN(valueAsNumber) ? "" : valueAsNumber.toString();
|
|
4017
|
-
},
|
|
4018
|
-
toView(value) {
|
|
4019
|
-
const valueAsNumber = parseFloat(value);
|
|
4020
|
-
return Number.isNaN(valueAsNumber) ? void 0 : valueAsNumber.toString();
|
|
4021
|
-
}
|
|
4022
|
-
};
|
|
4023
|
-
|
|
4024
|
-
/**
|
|
4025
|
-
* Standard orientation values
|
|
4026
|
-
*/
|
|
4027
|
-
const Orientation = {
|
|
4028
|
-
horizontal: "horizontal",
|
|
4029
|
-
vertical: "vertical"
|
|
4030
|
-
};
|
|
4031
|
-
|
|
4032
|
-
/**
|
|
4033
|
-
* Returns the index of the last element in the array where predicate is true, and -1 otherwise.
|
|
4034
|
-
*
|
|
4035
|
-
* @param array - the array to test
|
|
4036
|
-
* @param predicate - find calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findIndex returns -1.
|
|
4037
|
-
*/
|
|
4038
|
-
function findLastIndex(array, predicate) {
|
|
4039
|
-
let k = array.length;
|
|
4040
|
-
while (k--) {
|
|
4041
|
-
if (predicate(array[k], k, array)) {
|
|
4042
|
-
return k;
|
|
4043
|
-
}
|
|
4044
|
-
}
|
|
4045
|
-
return -1;
|
|
4046
|
-
}
|
|
4047
|
-
|
|
4048
|
-
/**
|
|
4049
|
-
* A test that ensures that all arguments are HTML Elements
|
|
4050
|
-
*/
|
|
4051
|
-
function isHTMLElement(...args) {
|
|
4052
|
-
return args.every(arg => arg instanceof HTMLElement);
|
|
4053
|
-
}
|
|
4054
|
-
|
|
4055
|
-
/**
|
|
4056
|
-
* String values for use with KeyboardEvent.key
|
|
4057
|
-
*/
|
|
4058
|
-
const keyArrowDown = "ArrowDown";
|
|
4059
|
-
const keyArrowLeft = "ArrowLeft";
|
|
4060
|
-
const keyArrowRight = "ArrowRight";
|
|
4061
|
-
const keyArrowUp = "ArrowUp";
|
|
4062
|
-
const keyEnd = "End";
|
|
4063
|
-
const keyEnter = "Enter";
|
|
4064
|
-
const keyEscape = "Escape";
|
|
4065
|
-
const keyHome = "Home";
|
|
4066
|
-
const keySpace = " ";
|
|
4067
|
-
const keyTab = "Tab";
|
|
4068
|
-
|
|
4069
|
-
/**
|
|
4070
|
-
* Expose ltr and rtl strings
|
|
4071
|
-
*/
|
|
4072
|
-
var Direction;
|
|
4073
|
-
(function (Direction) {
|
|
4074
|
-
Direction["ltr"] = "ltr";
|
|
4075
|
-
Direction["rtl"] = "rtl";
|
|
4076
|
-
})(Direction || (Direction = {}));
|
|
4077
|
-
|
|
4078
|
-
/**
|
|
4079
|
-
* This method keeps a given value within the bounds of a min and max value. If the value
|
|
4080
|
-
* is larger than the max, the minimum value will be returned. If the value is smaller than the minimum,
|
|
4081
|
-
* the maximum will be returned. Otherwise, the value is returned un-changed.
|
|
4082
|
-
*/
|
|
4083
|
-
function wrapInBounds(min, max, value) {
|
|
4084
|
-
if (value < min) {
|
|
4085
|
-
return max;
|
|
4086
|
-
} else if (value > max) {
|
|
4087
|
-
return min;
|
|
4088
|
-
}
|
|
4089
|
-
return value;
|
|
4090
|
-
}
|
|
4091
|
-
/**
|
|
4092
|
-
* Ensures that a value is between a min and max value. If value is lower than min, min will be returned.
|
|
4093
|
-
* If value is greater than max, max will be returned.
|
|
4094
|
-
*/
|
|
4095
|
-
function limit(min, max, value) {
|
|
4096
|
-
return Math.min(Math.max(value, min), max);
|
|
4097
|
-
}
|
|
4098
|
-
|
|
4099
|
-
let uniqueIdCounter$1 = 0;
|
|
4100
|
-
/**
|
|
4101
|
-
* Generates a unique ID based on incrementing a counter.
|
|
4102
|
-
*/
|
|
4103
|
-
function uniqueId$1(prefix = "") {
|
|
4104
|
-
return `${prefix}${uniqueIdCounter$1++}`;
|
|
4105
|
-
}
|
|
4106
|
-
|
|
4107
|
-
const getDirection = rootNode => {
|
|
4108
|
-
return rootNode.closest("[dir]")?.dir === "rtl" ? Direction.rtl : Direction.ltr;
|
|
4109
|
-
};
|
|
4110
|
-
|
|
4111
|
-
function isCustomElement(tagSuffix) {
|
|
4112
|
-
return element => {
|
|
4113
|
-
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
4114
|
-
return false;
|
|
4115
|
-
}
|
|
4116
|
-
return element.tagName.toLowerCase().endsWith(tagSuffix);
|
|
4117
|
-
};
|
|
4118
|
-
}
|
|
4119
|
-
|
|
4120
3960
|
function staticallyCompose(item) {
|
|
4121
3961
|
if (!item) {
|
|
4122
3962
|
return InlineTemplateDirective.empty;
|
|
@@ -4130,136 +3970,6 @@ function staticallyCompose(item) {
|
|
|
4130
3970
|
return item;
|
|
4131
3971
|
}
|
|
4132
3972
|
|
|
4133
|
-
const whitespaceFilter = value => value.nodeType !== Node.TEXT_NODE || !!value.nodeValue?.trim().length;
|
|
4134
|
-
|
|
4135
|
-
const hidden = `:host([hidden]){display:none}`;
|
|
4136
|
-
function display(displayValue) {
|
|
4137
|
-
return `${hidden}:host{display:${displayValue}}`;
|
|
4138
|
-
}
|
|
4139
|
-
|
|
4140
|
-
class MatchMediaBehavior {
|
|
4141
|
-
/**
|
|
4142
|
-
*
|
|
4143
|
-
* @param query - The media query to operate from.
|
|
4144
|
-
*/
|
|
4145
|
-
constructor(query) {
|
|
4146
|
-
/**
|
|
4147
|
-
* The behavior needs to operate on element instances but elements might share a behavior instance.
|
|
4148
|
-
* To ensure proper attachment / detachment per instance, we construct a listener for
|
|
4149
|
-
* each bind invocation and cache the listeners by element reference.
|
|
4150
|
-
*/
|
|
4151
|
-
this.listenerCache = /* @__PURE__ */new WeakMap();
|
|
4152
|
-
this.query = query;
|
|
4153
|
-
}
|
|
4154
|
-
/**
|
|
4155
|
-
* Binds the behavior to the element.
|
|
4156
|
-
* @param controller - The host controller orchestrating this behavior.
|
|
4157
|
-
*/
|
|
4158
|
-
connectedCallback(controller) {
|
|
4159
|
-
const {
|
|
4160
|
-
query
|
|
4161
|
-
} = this;
|
|
4162
|
-
let listener = this.listenerCache.get(controller);
|
|
4163
|
-
if (!listener) {
|
|
4164
|
-
listener = this.constructListener(controller);
|
|
4165
|
-
this.listenerCache.set(controller, listener);
|
|
4166
|
-
}
|
|
4167
|
-
listener.bind(query)();
|
|
4168
|
-
query.addEventListener("change", listener);
|
|
4169
|
-
}
|
|
4170
|
-
/**
|
|
4171
|
-
* Unbinds the behavior from the element.
|
|
4172
|
-
* @param controller - The host controller orchestrating this behavior.
|
|
4173
|
-
*/
|
|
4174
|
-
disconnectedCallback(controller) {
|
|
4175
|
-
const listener = this.listenerCache.get(controller);
|
|
4176
|
-
if (listener) {
|
|
4177
|
-
this.query.removeEventListener("change", listener);
|
|
4178
|
-
}
|
|
4179
|
-
}
|
|
4180
|
-
}
|
|
4181
|
-
class MatchMediaStyleSheetBehavior extends MatchMediaBehavior {
|
|
4182
|
-
/**
|
|
4183
|
-
* Constructs a {@link MatchMediaStyleSheetBehavior} instance.
|
|
4184
|
-
* @param query - The media query to operate from.
|
|
4185
|
-
* @param styles - The styles to coordinate with the query.
|
|
4186
|
-
*/
|
|
4187
|
-
constructor(query, styles) {
|
|
4188
|
-
super(query);
|
|
4189
|
-
this.styles = styles;
|
|
4190
|
-
}
|
|
4191
|
-
/**
|
|
4192
|
-
* Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for
|
|
4193
|
-
* a provided query.
|
|
4194
|
-
* @param query - The media query to operate from.
|
|
4195
|
-
*
|
|
4196
|
-
* @public
|
|
4197
|
-
* @example
|
|
4198
|
-
*
|
|
4199
|
-
* ```ts
|
|
4200
|
-
* import { css } from "@microsoft/fast-element";
|
|
4201
|
-
* import { MatchMediaStyleSheetBehavior } from "@fluentui/web-components";
|
|
4202
|
-
*
|
|
4203
|
-
* const landscapeBehavior = MatchMediaStyleSheetBehavior.with(
|
|
4204
|
-
* window.matchMedia("(orientation: landscape)")
|
|
4205
|
-
* );
|
|
4206
|
-
*
|
|
4207
|
-
* const styles = css`
|
|
4208
|
-
* :host {
|
|
4209
|
-
* width: 200px;
|
|
4210
|
-
* height: 400px;
|
|
4211
|
-
* }
|
|
4212
|
-
* `
|
|
4213
|
-
* .withBehaviors(landscapeBehavior(css`
|
|
4214
|
-
* :host {
|
|
4215
|
-
* width: 400px;
|
|
4216
|
-
* height: 200px;
|
|
4217
|
-
* }
|
|
4218
|
-
* `))
|
|
4219
|
-
* ```
|
|
4220
|
-
*/
|
|
4221
|
-
static with(query) {
|
|
4222
|
-
return styles => {
|
|
4223
|
-
return new MatchMediaStyleSheetBehavior(query, styles);
|
|
4224
|
-
};
|
|
4225
|
-
}
|
|
4226
|
-
/**
|
|
4227
|
-
* Constructs a match-media listener for a provided element.
|
|
4228
|
-
* @param source - the element for which to attach or detach styles.
|
|
4229
|
-
*/
|
|
4230
|
-
constructListener(controller) {
|
|
4231
|
-
let attached = false;
|
|
4232
|
-
const styles = this.styles;
|
|
4233
|
-
return function listener() {
|
|
4234
|
-
const {
|
|
4235
|
-
matches
|
|
4236
|
-
} = this;
|
|
4237
|
-
if (matches && !attached) {
|
|
4238
|
-
controller.addStyles(styles);
|
|
4239
|
-
attached = matches;
|
|
4240
|
-
} else if (!matches && attached) {
|
|
4241
|
-
controller.removeStyles(styles);
|
|
4242
|
-
attached = matches;
|
|
4243
|
-
}
|
|
4244
|
-
};
|
|
4245
|
-
}
|
|
4246
|
-
/**
|
|
4247
|
-
* Unbinds the behavior from the element.
|
|
4248
|
-
* @param controller - The host controller orchestrating this behavior.
|
|
4249
|
-
* @internal
|
|
4250
|
-
*/
|
|
4251
|
-
removedCallback(controller) {
|
|
4252
|
-
controller.removeStyles(this.styles);
|
|
4253
|
-
}
|
|
4254
|
-
}
|
|
4255
|
-
const forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(forced-colors)"));
|
|
4256
|
-
MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: dark)"));
|
|
4257
|
-
MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: light)"));
|
|
4258
|
-
|
|
4259
|
-
const AnchorPositioningCSSSupported = CSS.supports("anchor-name: --a");
|
|
4260
|
-
const AnchorPositioningHTMLSupported = "anchor" in HTMLElement.prototype;
|
|
4261
|
-
const CustomStatesSetSupported = CSS.supports("selector(:state(g))");
|
|
4262
|
-
|
|
4263
3973
|
class StartEnd {}
|
|
4264
3974
|
function endSlotTemplate(options) {
|
|
4265
3975
|
return html`<slot name="end" ${ref("end")}>${staticallyCompose(options.end)}</slot>`.inline();
|
|
@@ -4302,7 +4012,6 @@ class BaseAccordionItem extends FASTElement {
|
|
|
4302
4012
|
this.headinglevel = 2;
|
|
4303
4013
|
this.expanded = false;
|
|
4304
4014
|
this.disabled = false;
|
|
4305
|
-
this.id = uniqueId$1("accordion-");
|
|
4306
4015
|
}
|
|
4307
4016
|
}
|
|
4308
4017
|
__decorateClass$O([attr({
|
|
@@ -4316,7 +4025,7 @@ __decorateClass$O([attr({
|
|
|
4316
4025
|
__decorateClass$O([attr({
|
|
4317
4026
|
mode: "boolean"
|
|
4318
4027
|
})], BaseAccordionItem.prototype, "disabled", 2);
|
|
4319
|
-
__decorateClass$O([
|
|
4028
|
+
__decorateClass$O([observable], BaseAccordionItem.prototype, "expandbutton", 2);
|
|
4320
4029
|
|
|
4321
4030
|
var __defProp$N = Object.defineProperty;
|
|
4322
4031
|
var __getOwnPropDesc$N = Object.getOwnPropertyDescriptor;
|
|
@@ -4341,6 +4050,11 @@ __decorateClass$N([attr({
|
|
|
4341
4050
|
})], AccordionItem.prototype, "block", 2);
|
|
4342
4051
|
applyMixins(AccordionItem, StartEnd);
|
|
4343
4052
|
|
|
4053
|
+
const hidden = `:host([hidden]){display:none}`;
|
|
4054
|
+
function display(displayValue) {
|
|
4055
|
+
return `${hidden}:host{display:${displayValue}}`;
|
|
4056
|
+
}
|
|
4057
|
+
|
|
4344
4058
|
const colorNeutralForeground1 = "var(--colorNeutralForeground1)";
|
|
4345
4059
|
const colorNeutralForeground1Hover = "var(--colorNeutralForeground1Hover)";
|
|
4346
4060
|
const colorNeutralForeground1Pressed = "var(--colorNeutralForeground1Pressed)";
|
|
@@ -4621,7 +4335,7 @@ const chevronDown20Filled = html.partial(`<svg
|
|
|
4621
4335
|
/>
|
|
4622
4336
|
</svg>`);
|
|
4623
4337
|
function accordionItemTemplate(options = {}) {
|
|
4624
|
-
return html`<div class="heading" part="heading" role="heading" aria-level="${x => x.headinglevel}"><button class="button" part="button"
|
|
4338
|
+
return html`<div class="heading" part="heading" role="heading" aria-level="${x => x.headinglevel}"><button class="button" part="button" id="control" aria-controls="panel" aria-expanded="${x => x.expanded}" ?disabled="${x => x.disabled}" ${ref("expandbutton")}><slot name="heading"></slot></button>${startSlotTemplate(options)}<slot name="marker-expanded">${staticallyCompose(options.expandedIcon)}</slot><slot name="marker-collapsed">${staticallyCompose(options.collapsedIcon)}</slot></div><div class="content" part="content" id="panel" role="region" aria-labelledby="control"><slot></slot></div>`;
|
|
4625
4339
|
}
|
|
4626
4340
|
const template$F = accordionItemTemplate({
|
|
4627
4341
|
collapsedIcon: chevronRight20Filled,
|
|
@@ -4629,13 +4343,19 @@ const template$F = accordionItemTemplate({
|
|
|
4629
4343
|
});
|
|
4630
4344
|
|
|
4631
4345
|
const definition$F = AccordionItem.compose({
|
|
4632
|
-
name:
|
|
4346
|
+
name: tagName$F,
|
|
4633
4347
|
template: template$F,
|
|
4634
4348
|
styles: styles$E
|
|
4635
4349
|
});
|
|
4636
4350
|
|
|
4637
4351
|
definition$F.define(FluentDesignSystem.registry);
|
|
4638
4352
|
|
|
4353
|
+
const AccordionExpandMode = {
|
|
4354
|
+
single: "single",
|
|
4355
|
+
multi: "multi"
|
|
4356
|
+
};
|
|
4357
|
+
const tagName$E = `${FluentDesignSystem.prefix}-accordion`;
|
|
4358
|
+
|
|
4639
4359
|
function requestIdleCallback(callback, options) {
|
|
4640
4360
|
if ("requestIdleCallback" in globalThis) {
|
|
4641
4361
|
return globalThis.requestIdleCallback(callback, options);
|
|
@@ -4671,15 +4391,6 @@ function waitForConnectedDescendants(target, callback, options) {
|
|
|
4671
4391
|
scheduleCheck();
|
|
4672
4392
|
}
|
|
4673
4393
|
|
|
4674
|
-
function isAccordionItem(element, tagName = "-accordion-item") {
|
|
4675
|
-
return isCustomElement(tagName)(element);
|
|
4676
|
-
}
|
|
4677
|
-
|
|
4678
|
-
const AccordionExpandMode = {
|
|
4679
|
-
single: "single",
|
|
4680
|
-
multi: "multi"
|
|
4681
|
-
};
|
|
4682
|
-
|
|
4683
4394
|
var __defProp$M = Object.defineProperty;
|
|
4684
4395
|
var __getOwnPropDesc$M = Object.getOwnPropertyDescriptor;
|
|
4685
4396
|
var __decorateClass$M = (decorators, target, key, kind) => {
|
|
@@ -4700,7 +4411,6 @@ class Accordion extends FASTElement {
|
|
|
4700
4411
|
/**
|
|
4701
4412
|
* Resets event listeners and sets the `accordionItems` property
|
|
4702
4413
|
* then rebinds event listeners to each non-disabled item
|
|
4703
|
-
* @returns {void}
|
|
4704
4414
|
*/
|
|
4705
4415
|
this.setItems = () => {
|
|
4706
4416
|
waitForConnectedDescendants(this, () => {
|
|
@@ -4723,7 +4433,7 @@ class Accordion extends FASTElement {
|
|
|
4723
4433
|
};
|
|
4724
4434
|
/**
|
|
4725
4435
|
* Removes event listeners from the previous accordion items
|
|
4726
|
-
* @param oldValue An array of the previous accordion items
|
|
4436
|
+
* @param oldValue - An array of the previous accordion items
|
|
4727
4437
|
*/
|
|
4728
4438
|
this.removeItemListeners = oldValue => {
|
|
4729
4439
|
oldValue.forEach((item, index) => {
|
|
@@ -4734,7 +4444,7 @@ class Accordion extends FASTElement {
|
|
|
4734
4444
|
};
|
|
4735
4445
|
/**
|
|
4736
4446
|
* Changes the expanded state of the accordion item
|
|
4737
|
-
* @param evt Click event
|
|
4447
|
+
* @param evt - Click event
|
|
4738
4448
|
* @returns
|
|
4739
4449
|
*/
|
|
4740
4450
|
this.expandedChangedHandler = evt => {
|
|
@@ -4787,7 +4497,6 @@ class Accordion extends FASTElement {
|
|
|
4787
4497
|
}
|
|
4788
4498
|
/**
|
|
4789
4499
|
* Find the first expanded item in the accordion
|
|
4790
|
-
* @returns {void}
|
|
4791
4500
|
*/
|
|
4792
4501
|
findExpandedItem() {
|
|
4793
4502
|
if (!this.accordionItems || this.accordionItems?.length === 0) {
|
|
@@ -4797,15 +4506,14 @@ class Accordion extends FASTElement {
|
|
|
4797
4506
|
}
|
|
4798
4507
|
/**
|
|
4799
4508
|
* Checks if the accordion is in single expand mode
|
|
4800
|
-
* @returns
|
|
4509
|
+
* @returns true if the accordion is in single expand mode.
|
|
4801
4510
|
*/
|
|
4802
4511
|
isSingleExpandMode() {
|
|
4803
4512
|
return this.expandmode === AccordionExpandMode.single;
|
|
4804
4513
|
}
|
|
4805
4514
|
/**
|
|
4806
4515
|
* Controls the behavior of the accordion in single expand mode
|
|
4807
|
-
* @param expandedItem The item to expand in single expand mode
|
|
4808
|
-
* @returns {void}
|
|
4516
|
+
* @param expandedItem - The item to expand in single expand mode
|
|
4809
4517
|
*/
|
|
4810
4518
|
setSingleExpandMode(expandedItem) {
|
|
4811
4519
|
if (this.accordionItems.length === 0) {
|
|
@@ -4852,13 +4560,55 @@ function accordionTemplate() {
|
|
|
4852
4560
|
const template$E = accordionTemplate();
|
|
4853
4561
|
|
|
4854
4562
|
const definition$E = Accordion.compose({
|
|
4855
|
-
name:
|
|
4563
|
+
name: tagName$E,
|
|
4856
4564
|
template: template$E,
|
|
4857
4565
|
styles: styles$D
|
|
4858
4566
|
});
|
|
4859
4567
|
|
|
4860
4568
|
definition$E.define(FluentDesignSystem.registry);
|
|
4861
4569
|
|
|
4570
|
+
const ButtonAppearance = {
|
|
4571
|
+
primary: "primary",
|
|
4572
|
+
outline: "outline",
|
|
4573
|
+
subtle: "subtle",
|
|
4574
|
+
transparent: "transparent"
|
|
4575
|
+
};
|
|
4576
|
+
const ButtonShape = {
|
|
4577
|
+
circular: "circular",
|
|
4578
|
+
rounded: "rounded",
|
|
4579
|
+
square: "square"
|
|
4580
|
+
};
|
|
4581
|
+
const ButtonSize = {
|
|
4582
|
+
small: "small",
|
|
4583
|
+
medium: "medium",
|
|
4584
|
+
large: "large"
|
|
4585
|
+
};
|
|
4586
|
+
const ButtonType = {
|
|
4587
|
+
submit: "submit",
|
|
4588
|
+
reset: "reset",
|
|
4589
|
+
button: "button"
|
|
4590
|
+
};
|
|
4591
|
+
const tagName$D = `${FluentDesignSystem.prefix}-button`;
|
|
4592
|
+
|
|
4593
|
+
const AnchorButtonAppearance = ButtonAppearance;
|
|
4594
|
+
const AnchorButtonShape = ButtonShape;
|
|
4595
|
+
const AnchorButtonSize = ButtonSize;
|
|
4596
|
+
const AnchorAttributes = {
|
|
4597
|
+
download: "download",
|
|
4598
|
+
href: "href",
|
|
4599
|
+
hreflang: "hreflang",
|
|
4600
|
+
ping: "ping",
|
|
4601
|
+
referrerpolicy: "referrerpolicy",
|
|
4602
|
+
rel: "rel",
|
|
4603
|
+
target: "target",
|
|
4604
|
+
type: "type"
|
|
4605
|
+
};
|
|
4606
|
+
const tagName$C = `${FluentDesignSystem.prefix}-anchor-button`;
|
|
4607
|
+
|
|
4608
|
+
const AnchorPositioningCSSSupported = CSS.supports("anchor-name: --a");
|
|
4609
|
+
const AnchorPositioningHTMLSupported = "anchor" in HTMLElement.prototype;
|
|
4610
|
+
const CustomStatesSetSupported = CSS.supports("selector(:state(g))");
|
|
4611
|
+
|
|
4862
4612
|
const statesMap = /* @__PURE__ */new Map();
|
|
4863
4613
|
function stateSelector(state) {
|
|
4864
4614
|
return statesMap.get(state) ?? statesMap.set(state, CustomStatesSetSupported ? `:state(${state})` : `[state--${state}]`).get(state);
|
|
@@ -4896,41 +4646,80 @@ function swapStates(elementInternals, prev = "", next = "", States, prefix = "")
|
|
|
4896
4646
|
}
|
|
4897
4647
|
}
|
|
4898
4648
|
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
const ButtonShape = {
|
|
4906
|
-
circular: "circular",
|
|
4907
|
-
rounded: "rounded",
|
|
4908
|
-
square: "square"
|
|
4909
|
-
};
|
|
4910
|
-
const ButtonSize = {
|
|
4911
|
-
small: "small",
|
|
4912
|
-
medium: "medium",
|
|
4913
|
-
large: "large"
|
|
4914
|
-
};
|
|
4915
|
-
const ButtonType = {
|
|
4916
|
-
submit: "submit",
|
|
4917
|
-
reset: "reset",
|
|
4918
|
-
button: "button"
|
|
4649
|
+
/**
|
|
4650
|
+
* Standard orientation values
|
|
4651
|
+
*/
|
|
4652
|
+
const Orientation = {
|
|
4653
|
+
horizontal: "horizontal",
|
|
4654
|
+
vertical: "vertical"
|
|
4919
4655
|
};
|
|
4920
4656
|
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
}
|
|
4657
|
+
/**
|
|
4658
|
+
* Returns the index of the last element in the array where predicate is true, and -1 otherwise.
|
|
4659
|
+
*
|
|
4660
|
+
* @param array - the array to test
|
|
4661
|
+
* @param predicate - find calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findIndex returns -1.
|
|
4662
|
+
*/
|
|
4663
|
+
function findLastIndex(array, predicate) {
|
|
4664
|
+
let k = array.length;
|
|
4665
|
+
while (k--) {
|
|
4666
|
+
if (predicate(array[k], k, array)) {
|
|
4667
|
+
return k;
|
|
4668
|
+
}
|
|
4669
|
+
}
|
|
4670
|
+
return -1;
|
|
4671
|
+
}
|
|
4672
|
+
|
|
4673
|
+
/**
|
|
4674
|
+
* A test that ensures that all arguments are HTML Elements
|
|
4675
|
+
*/
|
|
4676
|
+
function isHTMLElement(...args) {
|
|
4677
|
+
return args.every(arg => arg instanceof HTMLElement);
|
|
4678
|
+
}
|
|
4679
|
+
|
|
4680
|
+
/**
|
|
4681
|
+
* String values for use with KeyboardEvent.key
|
|
4682
|
+
*/
|
|
4683
|
+
const keyArrowDown = "ArrowDown";
|
|
4684
|
+
const keyArrowLeft = "ArrowLeft";
|
|
4685
|
+
const keyArrowRight = "ArrowRight";
|
|
4686
|
+
const keyArrowUp = "ArrowUp";
|
|
4687
|
+
const keyEnd = "End";
|
|
4688
|
+
const keyEnter = "Enter";
|
|
4689
|
+
const keyEscape = "Escape";
|
|
4690
|
+
const keyHome = "Home";
|
|
4691
|
+
const keySpace = " ";
|
|
4692
|
+
const keyTab = "Tab";
|
|
4693
|
+
|
|
4694
|
+
/**
|
|
4695
|
+
* Expose ltr and rtl strings
|
|
4696
|
+
*/
|
|
4697
|
+
var Direction;
|
|
4698
|
+
(function (Direction) {
|
|
4699
|
+
Direction["ltr"] = "ltr";
|
|
4700
|
+
Direction["rtl"] = "rtl";
|
|
4701
|
+
})(Direction || (Direction = {}));
|
|
4702
|
+
|
|
4703
|
+
/**
|
|
4704
|
+
* This method keeps a given value within the bounds of a min and max value. If the value
|
|
4705
|
+
* is larger than the max, the minimum value will be returned. If the value is smaller than the minimum,
|
|
4706
|
+
* the maximum will be returned. Otherwise, the value is returned un-changed.
|
|
4707
|
+
*/
|
|
4708
|
+
/**
|
|
4709
|
+
* Ensures that a value is between a min and max value. If value is lower than min, min will be returned.
|
|
4710
|
+
* If value is greater than max, max will be returned.
|
|
4711
|
+
*/
|
|
4712
|
+
function limit(min, max, value) {
|
|
4713
|
+
return Math.min(Math.max(value, min), max);
|
|
4714
|
+
}
|
|
4715
|
+
|
|
4716
|
+
let uniqueIdCounter$1 = 0;
|
|
4717
|
+
/**
|
|
4718
|
+
* Generates a unique ID based on incrementing a counter.
|
|
4719
|
+
*/
|
|
4720
|
+
function uniqueId$1(prefix = "") {
|
|
4721
|
+
return `${prefix}${uniqueIdCounter$1++}`;
|
|
4722
|
+
}
|
|
4934
4723
|
|
|
4935
4724
|
var __defProp$L = Object.defineProperty;
|
|
4936
4725
|
var __getOwnPropDesc$L = Object.getOwnPropertyDescriptor;
|
|
@@ -4995,11 +4784,12 @@ class BaseAnchor extends FASTElement {
|
|
|
4995
4784
|
* @internal
|
|
4996
4785
|
*/
|
|
4997
4786
|
clickHandler(e) {
|
|
4787
|
+
if (e.composedPath()[0] === this.internalProxyAnchor) {
|
|
4788
|
+
e.stopImmediatePropagation();
|
|
4789
|
+
return true;
|
|
4790
|
+
}
|
|
4998
4791
|
if (this.href) {
|
|
4999
|
-
const newTab =
|
|
5000
|
-
if (newTab) {
|
|
5001
|
-
e.preventDefault();
|
|
5002
|
-
}
|
|
4792
|
+
const newTab = e.ctrlKey || e.metaKey;
|
|
5003
4793
|
this.handleNavigation(newTab);
|
|
5004
4794
|
}
|
|
5005
4795
|
return true;
|
|
@@ -5023,7 +4813,7 @@ class BaseAnchor extends FASTElement {
|
|
|
5023
4813
|
}
|
|
5024
4814
|
/**
|
|
5025
4815
|
* Handles navigation based on input
|
|
5026
|
-
* If
|
|
4816
|
+
* If a modified activation requests a new tab, opens the href in a new window.
|
|
5027
4817
|
* @internal
|
|
5028
4818
|
*/
|
|
5029
4819
|
handleNavigation(newTab) {
|
|
@@ -5044,8 +4834,7 @@ class BaseAnchor extends FASTElement {
|
|
|
5044
4834
|
}
|
|
5045
4835
|
createProxyElement() {
|
|
5046
4836
|
const proxy = this.internalProxyAnchor ?? document.createElement("a");
|
|
5047
|
-
proxy.
|
|
5048
|
-
proxy.tabIndex = -1;
|
|
4837
|
+
proxy.inert = true;
|
|
5049
4838
|
return proxy;
|
|
5050
4839
|
}
|
|
5051
4840
|
}
|
|
@@ -5120,14 +4909,12 @@ const baseButtonStyles = css`
|
|
|
5120
4909
|
const styles$C = css`
|
|
5121
4910
|
${baseButtonStyles}
|
|
5122
4911
|
|
|
5123
|
-
:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable])),:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable]):hover),:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable]):hover:active){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled};color:${colorNeutralForegroundDisabled};cursor:not-allowed}:host([appearance='primary']:is(:disabled,[disabled-focusable])),:host([appearance='primary']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){border-color:transparent}:host([appearance='outline']:is(:disabled,[disabled-focusable])),:host([appearance='outline']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){background-color:${colorTransparentBackground}}:host([appearance='subtle']:is(:disabled,[disabled-focusable])),:host([appearance='subtle']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){background-color:${colorTransparentBackground};border-color:transparent}:host([appearance='transparent']:is(:disabled,[disabled-focusable])),:host([appearance='transparent']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){border-color:transparent;background-color:${colorTransparentBackground}}
|
|
5124
|
-
:host{background-color:ButtonFace;color:ButtonText}:host(:is(:hover,:focus-visible)){border-color:Highlight !important}:host([appearance='primary']:not(:is(:hover,:focus-visible))){background-color:Highlight;color:HighlightText;forced-color-adjust:none}:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable])){background-color:ButtonFace;color:GrayText;border-color:ButtonText}`));
|
|
4912
|
+
:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable])),:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable]):hover),:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable]):hover:active){background-color:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled};color:${colorNeutralForegroundDisabled};cursor:not-allowed}:host([appearance='primary']:is(:disabled,[disabled-focusable])),:host([appearance='primary']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){border-color:transparent}:host([appearance='outline']:is(:disabled,[disabled-focusable])),:host([appearance='outline']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){background-color:${colorTransparentBackground}}:host([appearance='subtle']:is(:disabled,[disabled-focusable])),:host([appearance='subtle']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){background-color:${colorTransparentBackground};border-color:transparent}:host([appearance='transparent']:is(:disabled,[disabled-focusable])),:host([appearance='transparent']:is(:disabled,[disabled-focusable]):is(:hover,:hover:active)){border-color:transparent;background-color:${colorTransparentBackground}}@media (forced-colors:active){:host{background-color:ButtonFace;color:ButtonText}:host(:is(:hover,:focus-visible)){border-color:Highlight !important}:host([appearance='primary']:not(:is(:hover,:focus-visible))){background-color:Highlight;color:HighlightText;forced-color-adjust:none}:host(:is(:disabled,[disabled-focusable],[appearance]:disabled,[appearance][disabled-focusable])){background-color:ButtonFace;color:GrayText;border-color:ButtonText}}`;
|
|
5125
4913
|
|
|
5126
4914
|
const styles$B = css`
|
|
5127
4915
|
${baseButtonStyles}
|
|
5128
4916
|
|
|
5129
|
-
::slotted(a){position:absolute;inset:0}
|
|
5130
|
-
:host{border-color:LinkText;color:LinkText}`));
|
|
4917
|
+
::slotted(a){position:absolute;inset:0}@media (forced-colors:active){:host{border-color:LinkText;color:LinkText}}`;
|
|
5131
4918
|
|
|
5132
4919
|
function anchorTemplate$1(options = {}) {
|
|
5133
4920
|
return html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}">${startSlotTemplate(options)}<span class="content" part="content"><slot></slot></span>${endSlotTemplate(options)}</template>`;
|
|
@@ -5135,13 +4922,53 @@ function anchorTemplate$1(options = {}) {
|
|
|
5135
4922
|
const template$D = anchorTemplate$1();
|
|
5136
4923
|
|
|
5137
4924
|
const definition$D = AnchorButton.compose({
|
|
5138
|
-
name:
|
|
4925
|
+
name: tagName$C,
|
|
5139
4926
|
template: template$D,
|
|
5140
4927
|
styles: styles$B
|
|
5141
4928
|
});
|
|
5142
4929
|
|
|
5143
4930
|
definition$D.define(FluentDesignSystem.registry);
|
|
5144
4931
|
|
|
4932
|
+
const AvatarNamedColor = {
|
|
4933
|
+
darkRed: "dark-red",
|
|
4934
|
+
cranberry: "cranberry",
|
|
4935
|
+
red: "red",
|
|
4936
|
+
pumpkin: "pumpkin",
|
|
4937
|
+
peach: "peach",
|
|
4938
|
+
marigold: "marigold",
|
|
4939
|
+
gold: "gold",
|
|
4940
|
+
brass: "brass",
|
|
4941
|
+
brown: "brown",
|
|
4942
|
+
forest: "forest",
|
|
4943
|
+
seafoam: "seafoam",
|
|
4944
|
+
darkGreen: "dark-green",
|
|
4945
|
+
lightTeal: "light-teal",
|
|
4946
|
+
teal: "teal",
|
|
4947
|
+
steel: "steel",
|
|
4948
|
+
blue: "blue",
|
|
4949
|
+
royalBlue: "royal-blue",
|
|
4950
|
+
cornflower: "cornflower",
|
|
4951
|
+
navy: "navy",
|
|
4952
|
+
lavender: "lavender",
|
|
4953
|
+
purple: "purple",
|
|
4954
|
+
grape: "grape",
|
|
4955
|
+
lilac: "lilac",
|
|
4956
|
+
pink: "pink",
|
|
4957
|
+
magenta: "magenta",
|
|
4958
|
+
plum: "plum",
|
|
4959
|
+
beige: "beige",
|
|
4960
|
+
mink: "mink",
|
|
4961
|
+
platinum: "platinum",
|
|
4962
|
+
anchor: "anchor"
|
|
4963
|
+
};
|
|
4964
|
+
const AvatarColor = {
|
|
4965
|
+
neutral: "neutral",
|
|
4966
|
+
brand: "brand",
|
|
4967
|
+
colorful: "colorful",
|
|
4968
|
+
...AvatarNamedColor
|
|
4969
|
+
};
|
|
4970
|
+
const tagName$B = `${FluentDesignSystem.prefix}-avatar`;
|
|
4971
|
+
|
|
5145
4972
|
const UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
|
|
5146
4973
|
const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
|
|
5147
4974
|
const PHONENUMBER_REGEX = /^\d+[\d\s]*(:?ext|x|)\s*\d+$/i;
|
|
@@ -5303,45 +5130,6 @@ __decorateClass$J([observable], BaseAvatar.prototype, "slottedDefaults", 2);
|
|
|
5303
5130
|
__decorateClass$J([attr], BaseAvatar.prototype, "name", 2);
|
|
5304
5131
|
__decorateClass$J([attr], BaseAvatar.prototype, "initials", 2);
|
|
5305
5132
|
|
|
5306
|
-
const AvatarNamedColor = {
|
|
5307
|
-
darkRed: "dark-red",
|
|
5308
|
-
cranberry: "cranberry",
|
|
5309
|
-
red: "red",
|
|
5310
|
-
pumpkin: "pumpkin",
|
|
5311
|
-
peach: "peach",
|
|
5312
|
-
marigold: "marigold",
|
|
5313
|
-
gold: "gold",
|
|
5314
|
-
brass: "brass",
|
|
5315
|
-
brown: "brown",
|
|
5316
|
-
forest: "forest",
|
|
5317
|
-
seafoam: "seafoam",
|
|
5318
|
-
darkGreen: "dark-green",
|
|
5319
|
-
lightTeal: "light-teal",
|
|
5320
|
-
teal: "teal",
|
|
5321
|
-
steel: "steel",
|
|
5322
|
-
blue: "blue",
|
|
5323
|
-
royalBlue: "royal-blue",
|
|
5324
|
-
cornflower: "cornflower",
|
|
5325
|
-
navy: "navy",
|
|
5326
|
-
lavender: "lavender",
|
|
5327
|
-
purple: "purple",
|
|
5328
|
-
grape: "grape",
|
|
5329
|
-
lilac: "lilac",
|
|
5330
|
-
pink: "pink",
|
|
5331
|
-
magenta: "magenta",
|
|
5332
|
-
plum: "plum",
|
|
5333
|
-
beige: "beige",
|
|
5334
|
-
mink: "mink",
|
|
5335
|
-
platinum: "platinum",
|
|
5336
|
-
anchor: "anchor"
|
|
5337
|
-
};
|
|
5338
|
-
const AvatarColor = {
|
|
5339
|
-
neutral: "neutral",
|
|
5340
|
-
brand: "brand",
|
|
5341
|
-
colorful: "colorful",
|
|
5342
|
-
...AvatarNamedColor
|
|
5343
|
-
};
|
|
5344
|
-
|
|
5345
5133
|
var __defProp$I = Object.defineProperty;
|
|
5346
5134
|
var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
|
|
5347
5135
|
var __decorateClass$I = (decorators, target, key, kind) => {
|
|
@@ -5444,7 +5232,7 @@ function avatarTemplate() {
|
|
|
5444
5232
|
const template$C = avatarTemplate();
|
|
5445
5233
|
|
|
5446
5234
|
const definition$C = Avatar.compose({
|
|
5447
|
-
name:
|
|
5235
|
+
name: tagName$B,
|
|
5448
5236
|
template: template$C,
|
|
5449
5237
|
styles: styles$A
|
|
5450
5238
|
});
|
|
@@ -5467,6 +5255,7 @@ const BadgeColor = {
|
|
|
5467
5255
|
success: "success",
|
|
5468
5256
|
warning: "warning"
|
|
5469
5257
|
};
|
|
5258
|
+
const tagName$A = `${FluentDesignSystem.prefix}-badge`;
|
|
5470
5259
|
|
|
5471
5260
|
var __defProp$H = Object.defineProperty;
|
|
5472
5261
|
var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
|
|
@@ -5737,109 +5526,6 @@ const badgeTintStyles = css.partial`
|
|
|
5737
5526
|
}
|
|
5738
5527
|
`;
|
|
5739
5528
|
|
|
5740
|
-
const typographyBody1Styles = css.partial`
|
|
5741
|
-
font-family: ${fontFamilyBase};
|
|
5742
|
-
font-size: ${fontSizeBase300};
|
|
5743
|
-
line-height: ${lineHeightBase300};
|
|
5744
|
-
font-weight: ${fontWeightRegular};
|
|
5745
|
-
`;
|
|
5746
|
-
css.partial`
|
|
5747
|
-
font-family: ${fontFamilyBase};
|
|
5748
|
-
font-size: ${fontSizeBase300};
|
|
5749
|
-
line-height: ${lineHeightBase300};
|
|
5750
|
-
font-weight: ${fontWeightSemibold};
|
|
5751
|
-
`;
|
|
5752
|
-
css.partial`
|
|
5753
|
-
font-family: ${fontFamilyBase};
|
|
5754
|
-
font-size: ${fontSizeBase300};
|
|
5755
|
-
line-height: ${lineHeightBase300};
|
|
5756
|
-
font-weight: ${fontWeightBold};
|
|
5757
|
-
`;
|
|
5758
|
-
const typographyBody2Styles = css.partial`
|
|
5759
|
-
font-family: ${fontFamilyBase};
|
|
5760
|
-
font-size: ${fontSizeBase400};
|
|
5761
|
-
line-height: ${lineHeightBase400};
|
|
5762
|
-
font-weight: ${fontWeightRegular};
|
|
5763
|
-
`;
|
|
5764
|
-
const typographyCaption1Styles = css.partial`
|
|
5765
|
-
font-family: ${fontFamilyBase};
|
|
5766
|
-
font-size: ${fontSizeBase200};
|
|
5767
|
-
line-height: ${lineHeightBase200};
|
|
5768
|
-
font-weight: ${fontWeightRegular};
|
|
5769
|
-
`;
|
|
5770
|
-
css.partial`
|
|
5771
|
-
font-family: ${fontFamilyBase};
|
|
5772
|
-
font-size: ${fontSizeBase200};
|
|
5773
|
-
line-height: ${lineHeightBase200};
|
|
5774
|
-
font-weight: ${fontWeightSemibold};
|
|
5775
|
-
`;
|
|
5776
|
-
css.partial`
|
|
5777
|
-
font-family: ${fontFamilyBase};
|
|
5778
|
-
font-size: ${fontSizeBase200};
|
|
5779
|
-
line-height: ${lineHeightBase200};
|
|
5780
|
-
font-weight: ${fontWeightBold};
|
|
5781
|
-
`;
|
|
5782
|
-
css.partial`
|
|
5783
|
-
font-family: ${fontFamilyBase};
|
|
5784
|
-
font-size: ${fontSizeBase100};
|
|
5785
|
-
line-height: ${lineHeightBase100};
|
|
5786
|
-
font-weight: ${fontWeightRegular};
|
|
5787
|
-
`;
|
|
5788
|
-
css.partial`
|
|
5789
|
-
font-family: ${fontFamilyBase};
|
|
5790
|
-
font-size: ${fontSizeBase100};
|
|
5791
|
-
line-height: ${lineHeightBase100};
|
|
5792
|
-
font-weight: ${fontWeightSemibold};
|
|
5793
|
-
`;
|
|
5794
|
-
const typographySubtitle1Styles = css.partial`
|
|
5795
|
-
font-family: ${fontFamilyBase};
|
|
5796
|
-
font-size: ${fontSizeBase500};
|
|
5797
|
-
line-height: ${lineHeightBase500};
|
|
5798
|
-
font-weight: ${fontWeightSemibold};
|
|
5799
|
-
`;
|
|
5800
|
-
css.partial`
|
|
5801
|
-
font-family: ${fontFamilyBase};
|
|
5802
|
-
font-size: ${fontSizeBase400};
|
|
5803
|
-
line-height: ${lineHeightBase400};
|
|
5804
|
-
font-weight: ${fontWeightSemibold};
|
|
5805
|
-
`;
|
|
5806
|
-
css.partial`
|
|
5807
|
-
font-family: ${fontFamilyBase};
|
|
5808
|
-
font-size: ${fontSizeBase400};
|
|
5809
|
-
line-height: ${lineHeightBase400};
|
|
5810
|
-
font-weight: ${fontWeightBold};
|
|
5811
|
-
`;
|
|
5812
|
-
css.partial`
|
|
5813
|
-
font-family: ${fontFamilyBase};
|
|
5814
|
-
font-size: ${fontSizeHero800};
|
|
5815
|
-
line-height: ${lineHeightHero800};
|
|
5816
|
-
font-weight: ${fontWeightSemibold};
|
|
5817
|
-
`;
|
|
5818
|
-
css.partial`
|
|
5819
|
-
font-family: ${fontFamilyBase};
|
|
5820
|
-
font-size: ${fontSizeHero700};
|
|
5821
|
-
line-height: ${lineHeightHero700};
|
|
5822
|
-
font-weight: ${fontWeightSemibold};
|
|
5823
|
-
`;
|
|
5824
|
-
css.partial`
|
|
5825
|
-
font-family: ${fontFamilyBase};
|
|
5826
|
-
font-size: ${fontSizeBase600};
|
|
5827
|
-
line-height: ${lineHeightBase600};
|
|
5828
|
-
font-weight: ${fontWeightSemibold};
|
|
5829
|
-
`;
|
|
5830
|
-
css.partial`
|
|
5831
|
-
font-family: ${fontFamilyBase};
|
|
5832
|
-
font-size: ${fontSizeHero900};
|
|
5833
|
-
line-height: ${lineHeightHero900};
|
|
5834
|
-
font-weight: ${fontWeightSemibold};
|
|
5835
|
-
`;
|
|
5836
|
-
css.partial`
|
|
5837
|
-
font-family: ${fontFamilyBase};
|
|
5838
|
-
font-size: ${fontSizeHero1000};
|
|
5839
|
-
line-height: ${lineHeightHero1000};
|
|
5840
|
-
font-weight: ${fontWeightSemibold};
|
|
5841
|
-
`;
|
|
5842
|
-
|
|
5843
5529
|
const styles$z = css`
|
|
5844
5530
|
:host([shape='square']){border-radius:${borderRadiusNone}}:host([shape='rounded']){border-radius:${borderRadiusMedium}}:host([shape='rounded']:is([size='tiny'],[size='extra-small'],[size='small'])){border-radius:${borderRadiusSmall}}${badgeTintStyles}
|
|
5845
5531
|
${badgeOutlineStyles}
|
|
@@ -5847,8 +5533,8 @@ const styles$z = css`
|
|
|
5847
5533
|
${badgeFilledStyles}
|
|
5848
5534
|
${badgeSizeStyles}
|
|
5849
5535
|
${badgeBaseStyles}
|
|
5850
|
-
|
|
5851
|
-
|
|
5536
|
+
|
|
5537
|
+
@media (forced-colors:active){:host,:host([appearance='outline']),:host([appearance='tint']){border-color:CanvasText}}`;
|
|
5852
5538
|
|
|
5853
5539
|
function badgeTemplate(options = {}) {
|
|
5854
5540
|
return html` ${startSlotTemplate(options)}<slot>${staticallyCompose(options.defaultContent)}</slot>${endSlotTemplate(options)} `;
|
|
@@ -5856,7 +5542,7 @@ function badgeTemplate(options = {}) {
|
|
|
5856
5542
|
const template$B = badgeTemplate();
|
|
5857
5543
|
|
|
5858
5544
|
const definition$B = Badge.compose({
|
|
5859
|
-
name:
|
|
5545
|
+
name: tagName$A,
|
|
5860
5546
|
template: template$B,
|
|
5861
5547
|
styles: styles$z
|
|
5862
5548
|
});
|
|
@@ -6158,13 +5844,15 @@ function buttonTemplate$1(options = {}) {
|
|
|
6158
5844
|
const template$A = buttonTemplate$1();
|
|
6159
5845
|
|
|
6160
5846
|
const definition$A = Button.compose({
|
|
6161
|
-
name:
|
|
5847
|
+
name: tagName$D,
|
|
6162
5848
|
template: template$A,
|
|
6163
5849
|
styles: styles$C
|
|
6164
5850
|
});
|
|
6165
5851
|
|
|
6166
5852
|
definition$A.define(FluentDesignSystem.registry);
|
|
6167
5853
|
|
|
5854
|
+
const tagName$z = `${FluentDesignSystem.prefix}-checkbox`;
|
|
5855
|
+
|
|
6168
5856
|
var __defProp$E = Object.defineProperty;
|
|
6169
5857
|
var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
|
|
6170
5858
|
var __decorateClass$E = (decorators, target, key, kind) => {
|
|
@@ -6629,8 +6317,7 @@ const valueMissingState = stateSelector("value-missing");
|
|
|
6629
6317
|
const styles$y = css`
|
|
6630
6318
|
${display("inline-flex")}
|
|
6631
6319
|
|
|
6632
|
-
: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}}
|
|
6633
|
-
: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}`));
|
|
6320
|
+
: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}}@media (forced-colors:active){: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}}`;
|
|
6634
6321
|
|
|
6635
6322
|
const checkedIndicator$2 = html.partial(/* html */
|
|
6636
6323
|
`
|
|
@@ -6658,13 +6345,15 @@ const template$z = checkboxTemplate({
|
|
|
6658
6345
|
});
|
|
6659
6346
|
|
|
6660
6347
|
const definition$z = Checkbox.compose({
|
|
6661
|
-
name:
|
|
6348
|
+
name: tagName$z,
|
|
6662
6349
|
template: template$z,
|
|
6663
6350
|
styles: styles$y
|
|
6664
6351
|
});
|
|
6665
6352
|
|
|
6666
6353
|
definition$z.define(FluentDesignSystem.registry);
|
|
6667
6354
|
|
|
6355
|
+
const tagName$y = `${FluentDesignSystem.prefix}-compound-button`;
|
|
6356
|
+
|
|
6668
6357
|
class CompoundButton extends Button {}
|
|
6669
6358
|
|
|
6670
6359
|
const styles$x = css`
|
|
@@ -6672,9 +6361,8 @@ const styles$x = css`
|
|
|
6672
6361
|
|
|
6673
6362
|
: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)))
|
|
6674
6363
|
::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]))
|
|
6675
|
-
::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}}
|
|
6676
|
-
|
|
6677
|
-
::slotted([slot='description']){color:HighlightText}`));
|
|
6364
|
+
::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}}@media (forced-colors:active){:host([appearance='primary']:not(:hover,:focus-visible,:disabled,[disabled-focusable]))
|
|
6365
|
+
::slotted([slot='description']){color:HighlightText}}`;
|
|
6678
6366
|
|
|
6679
6367
|
function buttonTemplate(options = {}) {
|
|
6680
6368
|
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>`;
|
|
@@ -6682,13 +6370,15 @@ function buttonTemplate(options = {}) {
|
|
|
6682
6370
|
const template$y = buttonTemplate();
|
|
6683
6371
|
|
|
6684
6372
|
const definition$y = CompoundButton.compose({
|
|
6685
|
-
name:
|
|
6373
|
+
name: tagName$y,
|
|
6686
6374
|
template: template$y,
|
|
6687
6375
|
styles: styles$x
|
|
6688
6376
|
});
|
|
6689
6377
|
|
|
6690
6378
|
definition$y.define(FluentDesignSystem.registry);
|
|
6691
6379
|
|
|
6380
|
+
const tagName$x = `${FluentDesignSystem.prefix}-counter-badge`;
|
|
6381
|
+
|
|
6692
6382
|
var __defProp$C = Object.defineProperty;
|
|
6693
6383
|
var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
|
|
6694
6384
|
var __decorateClass$C = (decorators, target, key, kind) => {
|
|
@@ -6768,7 +6458,7 @@ function composeTemplate(options = {}) {
|
|
|
6768
6458
|
const template$x = composeTemplate();
|
|
6769
6459
|
|
|
6770
6460
|
const definition$x = CounterBadge.compose({
|
|
6771
|
-
name:
|
|
6461
|
+
name: tagName$x,
|
|
6772
6462
|
template: template$x,
|
|
6773
6463
|
styles: styles$w
|
|
6774
6464
|
});
|
|
@@ -6780,12 +6470,13 @@ const DialogType = {
|
|
|
6780
6470
|
nonModal: "non-modal",
|
|
6781
6471
|
alert: "alert"
|
|
6782
6472
|
};
|
|
6783
|
-
function isDialog(element,
|
|
6473
|
+
function isDialog(element, tagName2 = "-dialog") {
|
|
6784
6474
|
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
6785
6475
|
return false;
|
|
6786
6476
|
}
|
|
6787
|
-
return element.tagName.toLowerCase().endsWith(
|
|
6477
|
+
return element.tagName.toLowerCase().endsWith(tagName2);
|
|
6788
6478
|
}
|
|
6479
|
+
const tagName$w = `${FluentDesignSystem.prefix}-dialog`;
|
|
6789
6480
|
|
|
6790
6481
|
var __defProp$B = Object.defineProperty;
|
|
6791
6482
|
var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
|
|
@@ -6905,17 +6596,18 @@ __decorateClass$B([attr], Dialog.prototype, "type", 2);
|
|
|
6905
6596
|
const template$w = 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>`;
|
|
6906
6597
|
|
|
6907
6598
|
const styles$v = css`
|
|
6908
|
-
@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)}}}
|
|
6909
|
-
@layer base{dialog{border:${strokeWidthThin} solid ${colorTransparentStroke}}}`));
|
|
6599
|
+
@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)}}}@media (forced-colors:active){@layer base{dialog{border:${strokeWidthThin} solid ${colorTransparentStroke}}}}`;
|
|
6910
6600
|
|
|
6911
6601
|
const definition$w = Dialog.compose({
|
|
6912
|
-
name:
|
|
6602
|
+
name: tagName$w,
|
|
6913
6603
|
template: template$w,
|
|
6914
6604
|
styles: styles$v
|
|
6915
6605
|
});
|
|
6916
6606
|
|
|
6917
6607
|
definition$w.define(FluentDesignSystem.registry);
|
|
6918
6608
|
|
|
6609
|
+
const tagName$v = `${FluentDesignSystem.prefix}-dialog-body`;
|
|
6610
|
+
|
|
6919
6611
|
class DialogBody extends FASTElement {
|
|
6920
6612
|
/**
|
|
6921
6613
|
* Handles click event for the close slot
|
|
@@ -6942,7 +6634,7 @@ const styles$u = css`
|
|
|
6942
6634
|
: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}`;
|
|
6943
6635
|
|
|
6944
6636
|
const definition$v = DialogBody.compose({
|
|
6945
|
-
name:
|
|
6637
|
+
name: tagName$v,
|
|
6946
6638
|
template: template$v,
|
|
6947
6639
|
styles: styles$u
|
|
6948
6640
|
});
|
|
@@ -6960,6 +6652,7 @@ const DividerRole = {
|
|
|
6960
6652
|
presentation: "presentation"
|
|
6961
6653
|
};
|
|
6962
6654
|
const DividerOrientation = Orientation;
|
|
6655
|
+
const tagName$u = `${FluentDesignSystem.prefix}-divider`;
|
|
6963
6656
|
|
|
6964
6657
|
var __defProp$A = Object.defineProperty;
|
|
6965
6658
|
var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
|
|
@@ -7041,11 +6734,10 @@ const template$u = dividerTemplate();
|
|
|
7041
6734
|
const styles$t = css`
|
|
7042
6735
|
${display("flex")}
|
|
7043
6736
|
|
|
7044
|
-
:host{contain:content}:host::after,:host::before{align-self:center;background:${colorNeutralStroke2};box-sizing:border-box;content:'';display:flex;flex-grow:1;height:${strokeWidthThin}}:host([inset]){padding:0 12px}:host ::slotted(*){color:${colorNeutralForeground2};font-family:${fontFamilyBase};font-size:${fontSizeBase200};font-weight:${fontWeightRegular};margin:0;padding:0 12px}:host([align-content='start'])::before,:host([align-content='end'])::after{flex-basis:12px;flex-grow:0;flex-shrink:0}:host([orientation='vertical']){align-items:center;flex-direction:column;height:100%;min-height:84px}:host([orientation='vertical']):empty{min-height:20px}:host([orientation='vertical'][inset])::before{margin-top:12px}:host([orientation='vertical'][inset])::after{margin-bottom:12px}:host([orientation='vertical']):empty::before,:host([orientation='vertical']):empty::after{height:10px;min-height:10px;flex-grow:0}:host([orientation='vertical'])::before,:host([orientation='vertical'])::after{width:${strokeWidthThin};min-height:20px;height:100%}:host([orientation='vertical']) ::slotted(*){display:flex;flex-direction:column;padding:12px 0;line-height:20px}:host([orientation='vertical'][align-content='start'])::before{min-height:8px}:host([orientation='vertical'][align-content='end'])::after{min-height:8px}:host([appearance='strong'])::before,:host([appearance='strong'])::after{background:${colorNeutralStroke1}}:host([appearance='strong']) ::slotted(*){color:${colorNeutralForeground1}}:host([appearance='brand'])::before,:host([appearance='brand'])::after{background:${colorBrandStroke1}}:host([appearance='brand']) ::slotted(*){color:${colorBrandForeground1}}:host([appearance='subtle'])::before,:host([appearance='subtle'])::after{background:${colorNeutralStroke3}}:host([appearance='subtle']) ::slotted(*){color:${colorNeutralForeground3}}
|
|
7045
|
-
:host([appearance='strong'])::before,:host([appearance='strong'])::after,:host([appearance='brand'])::before,:host([appearance='brand'])::after,:host([appearance='subtle'])::before,:host([appearance='subtle'])::after,:host::after,:host::before{background:WindowText;color:WindowText}`));
|
|
6737
|
+
:host{contain:content}:host::after,:host::before{align-self:center;background:${colorNeutralStroke2};box-sizing:border-box;content:'';display:flex;flex-grow:1;height:${strokeWidthThin}}:host([inset]){padding:0 12px}:host ::slotted(*){color:${colorNeutralForeground2};font-family:${fontFamilyBase};font-size:${fontSizeBase200};font-weight:${fontWeightRegular};margin:0;padding:0 12px}:host([align-content='start'])::before,:host([align-content='end'])::after{flex-basis:12px;flex-grow:0;flex-shrink:0}:host([orientation='vertical']){align-items:center;flex-direction:column;height:100%;min-height:84px}:host([orientation='vertical']):empty{min-height:20px}:host([orientation='vertical'][inset])::before{margin-top:12px}:host([orientation='vertical'][inset])::after{margin-bottom:12px}:host([orientation='vertical']):empty::before,:host([orientation='vertical']):empty::after{height:10px;min-height:10px;flex-grow:0}:host([orientation='vertical'])::before,:host([orientation='vertical'])::after{width:${strokeWidthThin};min-height:20px;height:100%}:host([orientation='vertical']) ::slotted(*){display:flex;flex-direction:column;padding:12px 0;line-height:20px}:host([orientation='vertical'][align-content='start'])::before{min-height:8px}:host([orientation='vertical'][align-content='end'])::after{min-height:8px}:host([appearance='strong'])::before,:host([appearance='strong'])::after{background:${colorNeutralStroke1}}:host([appearance='strong']) ::slotted(*){color:${colorNeutralForeground1}}:host([appearance='brand'])::before,:host([appearance='brand'])::after{background:${colorBrandStroke1}}:host([appearance='brand']) ::slotted(*){color:${colorBrandForeground1}}:host([appearance='subtle'])::before,:host([appearance='subtle'])::after{background:${colorNeutralStroke3}}:host([appearance='subtle']) ::slotted(*){color:${colorNeutralForeground3}}@media (forced-colors:active){:host([appearance='strong'])::before,:host([appearance='strong'])::after,:host([appearance='brand'])::before,:host([appearance='brand'])::after,:host([appearance='subtle'])::before,:host([appearance='subtle'])::after,:host::after,:host::before{background:WindowText;color:WindowText}}`;
|
|
7046
6738
|
|
|
7047
6739
|
const definition$u = Divider.compose({
|
|
7048
|
-
name:
|
|
6740
|
+
name: tagName$u,
|
|
7049
6741
|
template: template$u,
|
|
7050
6742
|
styles: styles$t
|
|
7051
6743
|
});
|
|
@@ -7067,6 +6759,7 @@ const DrawerType = {
|
|
|
7067
6759
|
modal: "modal",
|
|
7068
6760
|
inline: "inline"
|
|
7069
6761
|
};
|
|
6762
|
+
const tagName$t = `${FluentDesignSystem.prefix}-drawer`;
|
|
7070
6763
|
|
|
7071
6764
|
var __defProp$y = Object.defineProperty;
|
|
7072
6765
|
var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
|
|
@@ -7162,7 +6855,6 @@ class Drawer extends FASTElement {
|
|
|
7162
6855
|
* Handles click events on the drawer.
|
|
7163
6856
|
*/
|
|
7164
6857
|
clickHandler(event) {
|
|
7165
|
-
event.preventDefault();
|
|
7166
6858
|
if (this.dialog.open && event.target === this.dialog) {
|
|
7167
6859
|
this.hide();
|
|
7168
6860
|
}
|
|
@@ -7219,13 +6911,15 @@ function drawerTemplate() {
|
|
|
7219
6911
|
const template$t = drawerTemplate();
|
|
7220
6912
|
|
|
7221
6913
|
const definition$t = Drawer.compose({
|
|
7222
|
-
name:
|
|
6914
|
+
name: tagName$t,
|
|
7223
6915
|
template: template$t,
|
|
7224
6916
|
styles: styles$s
|
|
7225
6917
|
});
|
|
7226
6918
|
|
|
7227
6919
|
definition$t.define(FluentDesignSystem.registry);
|
|
7228
6920
|
|
|
6921
|
+
const tagName$s = `${FluentDesignSystem.prefix}-drawer-body`;
|
|
6922
|
+
|
|
7229
6923
|
class DrawerBody extends FASTElement {
|
|
7230
6924
|
/**
|
|
7231
6925
|
* Handles click event for the close slot
|
|
@@ -7244,6 +6938,109 @@ class DrawerBody extends FASTElement {
|
|
|
7244
6938
|
}
|
|
7245
6939
|
}
|
|
7246
6940
|
|
|
6941
|
+
const typographyBody1Styles = css.partial`
|
|
6942
|
+
font-family: ${fontFamilyBase};
|
|
6943
|
+
font-size: ${fontSizeBase300};
|
|
6944
|
+
line-height: ${lineHeightBase300};
|
|
6945
|
+
font-weight: ${fontWeightRegular};
|
|
6946
|
+
`;
|
|
6947
|
+
css.partial`
|
|
6948
|
+
font-family: ${fontFamilyBase};
|
|
6949
|
+
font-size: ${fontSizeBase300};
|
|
6950
|
+
line-height: ${lineHeightBase300};
|
|
6951
|
+
font-weight: ${fontWeightSemibold};
|
|
6952
|
+
`;
|
|
6953
|
+
css.partial`
|
|
6954
|
+
font-family: ${fontFamilyBase};
|
|
6955
|
+
font-size: ${fontSizeBase300};
|
|
6956
|
+
line-height: ${lineHeightBase300};
|
|
6957
|
+
font-weight: ${fontWeightBold};
|
|
6958
|
+
`;
|
|
6959
|
+
const typographyBody2Styles = css.partial`
|
|
6960
|
+
font-family: ${fontFamilyBase};
|
|
6961
|
+
font-size: ${fontSizeBase400};
|
|
6962
|
+
line-height: ${lineHeightBase400};
|
|
6963
|
+
font-weight: ${fontWeightRegular};
|
|
6964
|
+
`;
|
|
6965
|
+
const typographyCaption1Styles = css.partial`
|
|
6966
|
+
font-family: ${fontFamilyBase};
|
|
6967
|
+
font-size: ${fontSizeBase200};
|
|
6968
|
+
line-height: ${lineHeightBase200};
|
|
6969
|
+
font-weight: ${fontWeightRegular};
|
|
6970
|
+
`;
|
|
6971
|
+
css.partial`
|
|
6972
|
+
font-family: ${fontFamilyBase};
|
|
6973
|
+
font-size: ${fontSizeBase200};
|
|
6974
|
+
line-height: ${lineHeightBase200};
|
|
6975
|
+
font-weight: ${fontWeightSemibold};
|
|
6976
|
+
`;
|
|
6977
|
+
css.partial`
|
|
6978
|
+
font-family: ${fontFamilyBase};
|
|
6979
|
+
font-size: ${fontSizeBase200};
|
|
6980
|
+
line-height: ${lineHeightBase200};
|
|
6981
|
+
font-weight: ${fontWeightBold};
|
|
6982
|
+
`;
|
|
6983
|
+
css.partial`
|
|
6984
|
+
font-family: ${fontFamilyBase};
|
|
6985
|
+
font-size: ${fontSizeBase100};
|
|
6986
|
+
line-height: ${lineHeightBase100};
|
|
6987
|
+
font-weight: ${fontWeightRegular};
|
|
6988
|
+
`;
|
|
6989
|
+
css.partial`
|
|
6990
|
+
font-family: ${fontFamilyBase};
|
|
6991
|
+
font-size: ${fontSizeBase100};
|
|
6992
|
+
line-height: ${lineHeightBase100};
|
|
6993
|
+
font-weight: ${fontWeightSemibold};
|
|
6994
|
+
`;
|
|
6995
|
+
const typographySubtitle1Styles = css.partial`
|
|
6996
|
+
font-family: ${fontFamilyBase};
|
|
6997
|
+
font-size: ${fontSizeBase500};
|
|
6998
|
+
line-height: ${lineHeightBase500};
|
|
6999
|
+
font-weight: ${fontWeightSemibold};
|
|
7000
|
+
`;
|
|
7001
|
+
css.partial`
|
|
7002
|
+
font-family: ${fontFamilyBase};
|
|
7003
|
+
font-size: ${fontSizeBase400};
|
|
7004
|
+
line-height: ${lineHeightBase400};
|
|
7005
|
+
font-weight: ${fontWeightSemibold};
|
|
7006
|
+
`;
|
|
7007
|
+
css.partial`
|
|
7008
|
+
font-family: ${fontFamilyBase};
|
|
7009
|
+
font-size: ${fontSizeBase400};
|
|
7010
|
+
line-height: ${lineHeightBase400};
|
|
7011
|
+
font-weight: ${fontWeightBold};
|
|
7012
|
+
`;
|
|
7013
|
+
css.partial`
|
|
7014
|
+
font-family: ${fontFamilyBase};
|
|
7015
|
+
font-size: ${fontSizeHero800};
|
|
7016
|
+
line-height: ${lineHeightHero800};
|
|
7017
|
+
font-weight: ${fontWeightSemibold};
|
|
7018
|
+
`;
|
|
7019
|
+
css.partial`
|
|
7020
|
+
font-family: ${fontFamilyBase};
|
|
7021
|
+
font-size: ${fontSizeHero700};
|
|
7022
|
+
line-height: ${lineHeightHero700};
|
|
7023
|
+
font-weight: ${fontWeightSemibold};
|
|
7024
|
+
`;
|
|
7025
|
+
css.partial`
|
|
7026
|
+
font-family: ${fontFamilyBase};
|
|
7027
|
+
font-size: ${fontSizeBase600};
|
|
7028
|
+
line-height: ${lineHeightBase600};
|
|
7029
|
+
font-weight: ${fontWeightSemibold};
|
|
7030
|
+
`;
|
|
7031
|
+
css.partial`
|
|
7032
|
+
font-family: ${fontFamilyBase};
|
|
7033
|
+
font-size: ${fontSizeHero900};
|
|
7034
|
+
line-height: ${lineHeightHero900};
|
|
7035
|
+
font-weight: ${fontWeightSemibold};
|
|
7036
|
+
`;
|
|
7037
|
+
css.partial`
|
|
7038
|
+
font-family: ${fontFamilyBase};
|
|
7039
|
+
font-size: ${fontSizeHero1000};
|
|
7040
|
+
line-height: ${lineHeightHero1000};
|
|
7041
|
+
font-weight: ${fontWeightSemibold};
|
|
7042
|
+
`;
|
|
7043
|
+
|
|
7247
7044
|
const styles$r = css`
|
|
7248
7045
|
${display("grid")}
|
|
7249
7046
|
: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}`;
|
|
@@ -7254,26 +7051,45 @@ function drawerBodyTemplate() {
|
|
|
7254
7051
|
const template$s = drawerBodyTemplate();
|
|
7255
7052
|
|
|
7256
7053
|
const definition$s = DrawerBody.compose({
|
|
7257
|
-
name:
|
|
7054
|
+
name: tagName$s,
|
|
7258
7055
|
template: template$s,
|
|
7259
7056
|
styles: styles$r
|
|
7260
7057
|
});
|
|
7261
7058
|
|
|
7262
7059
|
definition$s.define(FluentDesignSystem.registry);
|
|
7263
7060
|
|
|
7264
|
-
|
|
7061
|
+
const DropdownAppearance = {
|
|
7062
|
+
filledDarker: "filled-darker",
|
|
7063
|
+
filledLighter: "filled-lighter",
|
|
7064
|
+
outline: "outline",
|
|
7065
|
+
transparent: "transparent"
|
|
7066
|
+
};
|
|
7067
|
+
const DropdownType = {
|
|
7068
|
+
combobox: "combobox",
|
|
7069
|
+
dropdown: "dropdown",
|
|
7070
|
+
select: "select"
|
|
7071
|
+
};
|
|
7072
|
+
const tagName$r = `${FluentDesignSystem.prefix}-dropdown`;
|
|
7073
|
+
|
|
7074
|
+
function isListbox(element, tagName2 = "-listbox") {
|
|
7265
7075
|
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
7266
7076
|
return false;
|
|
7267
7077
|
}
|
|
7268
|
-
return element.tagName.toLowerCase().endsWith(
|
|
7078
|
+
return element.tagName.toLowerCase().endsWith(tagName2);
|
|
7269
7079
|
}
|
|
7080
|
+
const tagName$q = `${FluentDesignSystem.prefix}-listbox`;
|
|
7270
7081
|
|
|
7271
|
-
function isDropdownOption(value,
|
|
7082
|
+
function isDropdownOption(value, tagName2 = "-option") {
|
|
7272
7083
|
if (value?.nodeType !== Node.ELEMENT_NODE) {
|
|
7273
7084
|
return false;
|
|
7274
7085
|
}
|
|
7275
|
-
return value.tagName.toLowerCase().endsWith(
|
|
7086
|
+
return value.tagName.toLowerCase().endsWith(tagName2);
|
|
7276
7087
|
}
|
|
7088
|
+
const tagName$p = `${FluentDesignSystem.prefix}-option`;
|
|
7089
|
+
|
|
7090
|
+
const getDirection = rootNode => {
|
|
7091
|
+
return rootNode.closest("[dir]")?.dir === "rtl" ? Direction.rtl : Direction.ltr;
|
|
7092
|
+
};
|
|
7277
7093
|
|
|
7278
7094
|
function getLanguage(rootNode) {
|
|
7279
7095
|
return rootNode.closest("[lang]")?.lang ?? "en";
|
|
@@ -7285,18 +7101,6 @@ function uniqueId(prefix = "id-") {
|
|
|
7285
7101
|
return document.getElementById(str) ? uniqueId(prefix) : str;
|
|
7286
7102
|
}
|
|
7287
7103
|
|
|
7288
|
-
const DropdownAppearance = {
|
|
7289
|
-
filledDarker: "filled-darker",
|
|
7290
|
-
filledLighter: "filled-lighter",
|
|
7291
|
-
outline: "outline",
|
|
7292
|
-
transparent: "transparent"
|
|
7293
|
-
};
|
|
7294
|
-
const DropdownType = {
|
|
7295
|
-
combobox: "combobox",
|
|
7296
|
-
dropdown: "dropdown",
|
|
7297
|
-
select: "select"
|
|
7298
|
-
};
|
|
7299
|
-
|
|
7300
7104
|
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>`;
|
|
7301
7105
|
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")} />`;
|
|
7302
7106
|
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>`;
|
|
@@ -8111,7 +7915,7 @@ const styles$q = css`
|
|
|
8111
7915
|
: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(:not([slot]):not([popover])),::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}`;
|
|
8112
7916
|
|
|
8113
7917
|
const definition$r = Dropdown.compose({
|
|
8114
|
-
name:
|
|
7918
|
+
name: tagName$r,
|
|
8115
7919
|
template: template$r,
|
|
8116
7920
|
styles: styles$q
|
|
8117
7921
|
});
|
|
@@ -8136,6 +7940,7 @@ const ValidationFlags = {
|
|
|
8136
7940
|
valueMissing: "value-missing",
|
|
8137
7941
|
valid: "valid"
|
|
8138
7942
|
};
|
|
7943
|
+
const tagName$o = `${FluentDesignSystem.prefix}-field`;
|
|
8139
7944
|
|
|
8140
7945
|
var __defProp$v = Object.defineProperty;
|
|
8141
7946
|
var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
|
|
@@ -8355,7 +8160,7 @@ const template$q = html`<template @click="${(x, c) => x.clickHandler(c.event)}"
|
|
|
8355
8160
|
})}></slot></template>`;
|
|
8356
8161
|
|
|
8357
8162
|
const definition$q = Field.compose({
|
|
8358
|
-
name:
|
|
8163
|
+
name: tagName$o,
|
|
8359
8164
|
template: template$q,
|
|
8360
8165
|
styles: styles$p,
|
|
8361
8166
|
shadowOptions: {
|
|
@@ -8365,6 +8170,8 @@ const definition$q = Field.compose({
|
|
|
8365
8170
|
|
|
8366
8171
|
definition$q.define(FluentDesignSystem.registry);
|
|
8367
8172
|
|
|
8173
|
+
const tagName$n = `${FluentDesignSystem.prefix}-image`;
|
|
8174
|
+
|
|
8368
8175
|
var __defProp$t = Object.defineProperty;
|
|
8369
8176
|
var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
|
|
8370
8177
|
var __decorateClass$t = (decorators, target, key, kind) => {
|
|
@@ -8392,13 +8199,15 @@ const styles$o = css`
|
|
|
8392
8199
|
:host{contain:content}:host ::slotted(img){box-sizing:border-box;min-height:8px;min-width:8px;display:inline-block}:host([block]) ::slotted(img){width:100%;height:auto}:host([bordered]) ::slotted(img){border:${strokeWidthThin} solid ${colorNeutralStroke2}}:host([fit='none']) ::slotted(img){object-fit:none;object-position:top left;height:100%;width:100%}:host([fit='center']) ::slotted(img){object-fit:none;object-position:center;height:100%;width:100%}:host([fit='contain']) ::slotted(img){object-fit:contain;object-position:center;height:100%;width:100%}:host([fit='cover']) ::slotted(img){object-fit:cover;object-position:center;height:100%;width:100%}:host([shadow]) ::slotted(img){box-shadow:${shadow4}}:host([shape='circular']) ::slotted(img){border-radius:${borderRadiusCircular}}:host([shape='rounded']) ::slotted(img){border-radius:${borderRadiusMedium}}`;
|
|
8393
8200
|
|
|
8394
8201
|
const definition$p = Image.compose({
|
|
8395
|
-
name:
|
|
8202
|
+
name: tagName$n,
|
|
8396
8203
|
template: template$p,
|
|
8397
8204
|
styles: styles$o
|
|
8398
8205
|
});
|
|
8399
8206
|
|
|
8400
8207
|
definition$p.define(FluentDesignSystem.registry);
|
|
8401
8208
|
|
|
8209
|
+
const tagName$m = `${FluentDesignSystem.prefix}-label`;
|
|
8210
|
+
|
|
8402
8211
|
var __defProp$s = Object.defineProperty;
|
|
8403
8212
|
var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
|
|
8404
8213
|
var __decorateClass$s = (decorators, target, key, kind) => {
|
|
@@ -8434,13 +8243,15 @@ function labelTemplate() {
|
|
|
8434
8243
|
const template$o = labelTemplate();
|
|
8435
8244
|
|
|
8436
8245
|
const definition$o = Label.compose({
|
|
8437
|
-
name:
|
|
8246
|
+
name: tagName$m,
|
|
8438
8247
|
template: template$o,
|
|
8439
8248
|
styles: styles$n
|
|
8440
8249
|
});
|
|
8441
8250
|
|
|
8442
8251
|
definition$o.define(FluentDesignSystem.registry);
|
|
8443
8252
|
|
|
8253
|
+
const tagName$l = `${FluentDesignSystem.prefix}-link`;
|
|
8254
|
+
|
|
8444
8255
|
var __defProp$r = Object.defineProperty;
|
|
8445
8256
|
var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
|
|
8446
8257
|
var __decorateClass$r = (decorators, target, key, kind) => {
|
|
@@ -8463,8 +8274,7 @@ __decorateClass$r([attr({
|
|
|
8463
8274
|
const styles$m = css`
|
|
8464
8275
|
${display("inline")}
|
|
8465
8276
|
|
|
8466
|
-
:host{position:relative;box-sizing:border-box;background-color:transparent;color:${colorBrandForegroundLink};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};overflow:inherit;text-align:start;text-decoration:none;text-decoration-thickness:${strokeWidthThin};text-overflow:inherit;user-select:text}:host(:is(:hover,:focus-visible)){outline:none;text-decoration-line:underline}@media (hover:hover){:host(:hover){color:${colorBrandForegroundLinkHover}}:host(:active){color:${colorBrandForegroundLinkPressed}}:host([appearance='subtle']:hover){color:${colorNeutralForeground2LinkHover}}:host([appearance='subtle']:active){color:${colorNeutralForeground2LinkPressed}}}:host([appearance='subtle']){color:${colorNeutralForeground2Link}}:host-context(:is(h1,h2,h3,h4,h5,h6,p,fluent-text)),:host([inline]){font:inherit;text-decoration:underline}:host(:not([href])){color:inherit;text-decoration:none}::slotted(a){position:absolute;inset:0}
|
|
8467
|
-
:host{color:LinkText}`));
|
|
8277
|
+
:host{position:relative;box-sizing:border-box;background-color:transparent;color:${colorBrandForegroundLink};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};overflow:inherit;text-align:start;text-decoration:none;text-decoration-thickness:${strokeWidthThin};text-overflow:inherit;user-select:text}:host(:is(:hover,:focus-visible)){outline:none;text-decoration-line:underline}@media (hover:hover){:host(:hover){color:${colorBrandForegroundLinkHover}}:host(:active){color:${colorBrandForegroundLinkPressed}}:host([appearance='subtle']:hover){color:${colorNeutralForeground2LinkHover}}:host([appearance='subtle']:active){color:${colorNeutralForeground2LinkPressed}}}:host([appearance='subtle']){color:${colorNeutralForeground2Link}}:host-context(:is(h1,h2,h3,h4,h5,h6,p,fluent-text)),:host([inline]){font:inherit;text-decoration:underline}:host(:not([href])){color:inherit;text-decoration:none}::slotted(a){position:absolute;inset:0}@media (forced-colors:active){:host{color:LinkText}}`;
|
|
8468
8278
|
|
|
8469
8279
|
function anchorTemplate() {
|
|
8470
8280
|
return html`<template tabindex="0" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot></slot></template>`;
|
|
@@ -8472,7 +8282,7 @@ function anchorTemplate() {
|
|
|
8472
8282
|
const template$n = anchorTemplate();
|
|
8473
8283
|
|
|
8474
8284
|
const definition$n = Link.compose({
|
|
8475
|
-
name:
|
|
8285
|
+
name: tagName$l,
|
|
8476
8286
|
template: template$n,
|
|
8477
8287
|
styles: styles$m
|
|
8478
8288
|
});
|
|
@@ -8666,13 +8476,15 @@ function listboxTemplate() {
|
|
|
8666
8476
|
const template$m = listboxTemplate();
|
|
8667
8477
|
|
|
8668
8478
|
const definition$m = Listbox.compose({
|
|
8669
|
-
name:
|
|
8479
|
+
name: tagName$q,
|
|
8670
8480
|
template: template$m,
|
|
8671
8481
|
styles: styles$l
|
|
8672
8482
|
});
|
|
8673
8483
|
|
|
8674
8484
|
definition$m.define(FluentDesignSystem.registry);
|
|
8675
8485
|
|
|
8486
|
+
const tagName$k = `${FluentDesignSystem.prefix}-menu-button`;
|
|
8487
|
+
|
|
8676
8488
|
class MenuButton extends Button {}
|
|
8677
8489
|
|
|
8678
8490
|
const template$l = buttonTemplate$1({
|
|
@@ -8685,7 +8497,7 @@ const template$l = buttonTemplate$1({
|
|
|
8685
8497
|
});
|
|
8686
8498
|
|
|
8687
8499
|
const definition$l = MenuButton.compose({
|
|
8688
|
-
name:
|
|
8500
|
+
name: tagName$k,
|
|
8689
8501
|
template: template$l,
|
|
8690
8502
|
styles: styles$C
|
|
8691
8503
|
});
|
|
@@ -8711,12 +8523,13 @@ const MenuItemRole = {
|
|
|
8711
8523
|
[MenuItemRole.menuitemcheckbox]: "menuitemcheckbox",
|
|
8712
8524
|
[MenuItemRole.menuitemradio]: "menuitemradio"
|
|
8713
8525
|
});
|
|
8714
|
-
function isMenuItem(element,
|
|
8526
|
+
function isMenuItem(element, tagName2 = "-menu-item") {
|
|
8715
8527
|
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
8716
8528
|
return false;
|
|
8717
8529
|
}
|
|
8718
|
-
return element.tagName.toLowerCase().endsWith(
|
|
8530
|
+
return element.tagName.toLowerCase().endsWith(tagName2);
|
|
8719
8531
|
}
|
|
8532
|
+
const tagName$j = `${FluentDesignSystem.prefix}-menu-item`;
|
|
8720
8533
|
|
|
8721
8534
|
var __defProp$p = Object.defineProperty;
|
|
8722
8535
|
var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
|
|
@@ -8798,16 +8611,25 @@ class MenuItem extends FASTElement {
|
|
|
8798
8611
|
* Setup required ARIA on open/close
|
|
8799
8612
|
* @internal
|
|
8800
8613
|
*/
|
|
8801
|
-
this.
|
|
8802
|
-
if (e instanceof ToggleEvent
|
|
8803
|
-
|
|
8614
|
+
this.handleToggle = e => {
|
|
8615
|
+
if (!(e instanceof ToggleEvent)) {
|
|
8616
|
+
return;
|
|
8617
|
+
}
|
|
8618
|
+
if (e.newState === "open") {
|
|
8804
8619
|
this.elementInternals.ariaExpanded = "true";
|
|
8805
8620
|
this.setSubmenuPosition();
|
|
8806
8621
|
}
|
|
8807
|
-
if (e
|
|
8622
|
+
if (e.newState === "closed") {
|
|
8808
8623
|
this.elementInternals.ariaExpanded = "false";
|
|
8809
|
-
this.setAttribute("tabindex", "0");
|
|
8810
8624
|
}
|
|
8625
|
+
this.submenu?.setAttribute("focusgroup", e.newState === "open" ? "menu" : "none");
|
|
8626
|
+
};
|
|
8627
|
+
/** @internal */
|
|
8628
|
+
this.handleSubmenuFocusOut = e => {
|
|
8629
|
+
if (e.relatedTarget && this.submenu?.contains(e.relatedTarget)) {
|
|
8630
|
+
return;
|
|
8631
|
+
}
|
|
8632
|
+
this.submenu?.togglePopover(false);
|
|
8811
8633
|
};
|
|
8812
8634
|
/**
|
|
8813
8635
|
* @internal
|
|
@@ -8894,11 +8716,14 @@ class MenuItem extends FASTElement {
|
|
|
8894
8716
|
* @internal
|
|
8895
8717
|
*/
|
|
8896
8718
|
slottedSubmenuChanged(prev, next) {
|
|
8897
|
-
this.submenu?.removeEventListener("toggle", this.
|
|
8719
|
+
this.submenu?.removeEventListener("toggle", this.handleToggle);
|
|
8720
|
+
this.submenu?.removeEventListener("focusout", this.handleSubmenuFocusOut);
|
|
8898
8721
|
if (next.length) {
|
|
8899
8722
|
this.submenu = next[0];
|
|
8900
8723
|
this.submenu.toggleAttribute("popover", true);
|
|
8901
|
-
this.submenu.
|
|
8724
|
+
this.submenu.setAttribute("focusgroup", "none");
|
|
8725
|
+
this.submenu.addEventListener("toggle", this.handleToggle);
|
|
8726
|
+
this.submenu.addEventListener("focusout", this.handleSubmenuFocusOut);
|
|
8902
8727
|
this.elementInternals.ariaHasPopup = "menu";
|
|
8903
8728
|
toggleState(this.elementInternals, "submenu", true);
|
|
8904
8729
|
} else {
|
|
@@ -8929,28 +8754,512 @@ applyMixins(MenuItem, StartEnd);
|
|
|
8929
8754
|
const styles$k = css`
|
|
8930
8755
|
${display("grid")}
|
|
8931
8756
|
|
|
8932
|
-
: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}}}
|
|
8933
|
-
|
|
8757
|
+
: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}}}@media (forced-colors:active){:host(${disabledState}),:host(${disabledState}) ::slotted([slot='start']),:host(${disabledState}) ::slotted([slot='end']){color:GrayText}}`;
|
|
8758
|
+
|
|
8759
|
+
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>`);
|
|
8760
|
+
const chevronRight16Filled = html.partial(`<svg class="submenu-glyph" fill="currentColor" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M5.74 3.2a.75.75 0 00-.04 1.06L9.23 8 5.7 11.74a.75.75 0 101.1 1.02l4-4.25a.75.75 0 000-1.02l-4-4.25a.75.75 0 00-1.06-.04z" fill="currentColor"></path></svg>`);
|
|
8761
|
+
function menuItemTemplate(options = {}) {
|
|
8762
|
+
return html`<template tabindex="0" @keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}" @click="${(x, c) => x.handleMenuItemClick(c.event)}" @mouseover="${(x, c) => x.handleMouseOver(c.event)}" @mouseout="${(x, c) => x.handleMouseOut(c.event)}" @toggle="${(x, c) => x.handleToggle(c.event)}"><slot name="indicator">${staticallyCompose(options.indicator)}</slot>${startSlotTemplate(options)}<div part="content" class="content"><slot></slot></div>${endSlotTemplate(options)}<slot name="submenu-glyph">${staticallyCompose(options.submenuGlyph)}</slot><slot name="submenu" ${slotted({
|
|
8763
|
+
property: "slottedSubmenu"
|
|
8764
|
+
})}></slot></template>`;
|
|
8765
|
+
}
|
|
8766
|
+
const template$k = menuItemTemplate({
|
|
8767
|
+
indicator: Checkmark16Filled,
|
|
8768
|
+
submenuGlyph: chevronRight16Filled
|
|
8769
|
+
});
|
|
8770
|
+
|
|
8771
|
+
const definition$k = MenuItem.compose({
|
|
8772
|
+
name: tagName$j,
|
|
8773
|
+
template: template$k,
|
|
8774
|
+
styles: styles$k
|
|
8775
|
+
});
|
|
8776
|
+
|
|
8777
|
+
definition$k.define(FluentDesignSystem.registry);
|
|
8778
|
+
|
|
8779
|
+
const tagName$i = `${FluentDesignSystem.prefix}-menu-list`;
|
|
8780
|
+
|
|
8781
|
+
//#region src/constants.js
|
|
8782
|
+
/** @enum {string} */
|
|
8783
|
+
var DatasetName = {
|
|
8784
|
+
INFERRED_ROLE: "data-fg-ir",
|
|
8785
|
+
ITEM: "data-fg-item",
|
|
8786
|
+
AUTHOR_TABINDEX: "data-fg-ati",
|
|
8787
|
+
SEGMENT: "data-fg-seg",
|
|
8788
|
+
SEGMENT_START: "data-fg-segs"
|
|
8789
|
+
};
|
|
8790
|
+
/** @enum {string} */
|
|
8791
|
+
var BehaviorToken = {
|
|
8792
|
+
TOOLBAR: "toolbar",
|
|
8793
|
+
TABLIST: "tablist",
|
|
8794
|
+
RADIOGROUP: "radiogroup",
|
|
8795
|
+
LISTBOX: "listbox",
|
|
8796
|
+
MENU: "menu",
|
|
8797
|
+
MENUBAR: "menubar",
|
|
8798
|
+
NONE: "none"
|
|
8799
|
+
};
|
|
8800
|
+
|
|
8801
|
+
//#region src/shadow-utils/index-shadowless.js
|
|
8802
|
+
function nodeContains(node, otherNode) {
|
|
8803
|
+
return node.contains(otherNode);
|
|
8804
|
+
}
|
|
8805
|
+
|
|
8806
|
+
/**
|
|
8807
|
+
* Whether the current user agent supports focusgroup.
|
|
8808
|
+
*
|
|
8809
|
+
* @returns {boolean}
|
|
8810
|
+
*/
|
|
8811
|
+
function supportsFocusGroup() {
|
|
8812
|
+
return "focusgroup" in (globalThis?.HTMLElement?.prototype ?? {});
|
|
8813
|
+
}
|
|
8814
|
+
/**
|
|
8815
|
+
* Gets the navigation direction (“forward” or “backward”) based on:
|
|
8816
|
+
*
|
|
8817
|
+
* - The key that the user just pressed
|
|
8818
|
+
* - The owner element’s writing mode and direction
|
|
8819
|
+
* - The current focus group’s directional limit (“inline”, “block”, none)
|
|
8820
|
+
*
|
|
8821
|
+
* @param {KeyboardEvent} event - The keyboard event object.
|
|
8822
|
+
* @param {HTMLElement} owner - The owner element.
|
|
8823
|
+
* @param {("inline" | "block" | undefined)} axis - The directional limitation.
|
|
8824
|
+
* @returns {("forward" | "backward" | "start" | "end" | null)} Returns `null`
|
|
8825
|
+
* if there shouldn’t be navigation, e.g. when directional limit applies.
|
|
8826
|
+
*/
|
|
8827
|
+
function getNavigationDirection(event, owner, axis) {
|
|
8828
|
+
const FORWARD = "forward";
|
|
8829
|
+
const BACKWARD = "backward";
|
|
8830
|
+
const BLOCK = "block";
|
|
8831
|
+
const INLINE = "inline";
|
|
8832
|
+
if (isKeyConflictElement(event.composedPath()[0])) return event.key === "Tab" ? event.shiftKey ? BACKWARD : FORWARD : null;
|
|
8833
|
+
if (event.shiftKey || event.ctrlKey || event.metaKey) return null;
|
|
8834
|
+
const {
|
|
8835
|
+
writingMode,
|
|
8836
|
+
direction
|
|
8837
|
+
} = window.getComputedStyle(owner);
|
|
8838
|
+
const isVertical = !writingMode.startsWith("horizontal-");
|
|
8839
|
+
const isRtl = direction === "rtl";
|
|
8840
|
+
const horizontal = isVertical ? BLOCK : INLINE;
|
|
8841
|
+
const vertical = isVertical ? INLINE : BLOCK;
|
|
8842
|
+
const isHorizontalReversed = isVertical ? writingMode.endsWith("-rl") !== isRtl : isRtl;
|
|
8843
|
+
const isVerticalReversed = isVertical && isRtl;
|
|
8844
|
+
const action = {
|
|
8845
|
+
ArrowUp: {
|
|
8846
|
+
axis: vertical,
|
|
8847
|
+
dir: isVerticalReversed ? FORWARD : BACKWARD
|
|
8848
|
+
},
|
|
8849
|
+
ArrowDown: {
|
|
8850
|
+
axis: vertical,
|
|
8851
|
+
dir: isVerticalReversed ? BACKWARD : FORWARD
|
|
8852
|
+
},
|
|
8853
|
+
ArrowLeft: {
|
|
8854
|
+
axis: horizontal,
|
|
8855
|
+
dir: isHorizontalReversed ? FORWARD : BACKWARD
|
|
8856
|
+
},
|
|
8857
|
+
ArrowRight: {
|
|
8858
|
+
axis: horizontal,
|
|
8859
|
+
dir: isHorizontalReversed ? BACKWARD : FORWARD
|
|
8860
|
+
},
|
|
8861
|
+
Home: {
|
|
8862
|
+
dir: "start"
|
|
8863
|
+
},
|
|
8864
|
+
End: {
|
|
8865
|
+
dir: "end"
|
|
8866
|
+
}
|
|
8867
|
+
}[event.key];
|
|
8868
|
+
if (!action || axis && action.axis && action.axis !== axis) return null;
|
|
8869
|
+
return action.dir;
|
|
8870
|
+
}
|
|
8871
|
+
/**
|
|
8872
|
+
* Whether a given element has keyboard conflicts with navigation keys, in which
|
|
8873
|
+
* case they should be considered as segmentors.
|
|
8874
|
+
*
|
|
8875
|
+
* @param {HTMLElement} element
|
|
8876
|
+
* @returns {boolean}
|
|
8877
|
+
*/
|
|
8878
|
+
function isKeyConflictElement(el) {
|
|
8879
|
+
return el?.nodeType === Node.ELEMENT_NODE && (["INPUT", "TEXTAREA", "SELECT"].includes(el.nodeName) && !["checkbox", "radio"].includes(el.getAttribute("type")) || el.isContentEditable || ["AUDIO", "VIDEO"].includes(el.nodeName) && el.hasAttribute("controls") || ["IFRAME", "OBJECT"].includes(el.nodeName));
|
|
8880
|
+
}
|
|
8881
|
+
|
|
8882
|
+
//#region src/global-state.js
|
|
8883
|
+
/**
|
|
8884
|
+
* @type {{ o: Set<MutationObserver>, m?: Map<HTMLElement, *>, g?: MutationObserver, b: boolean }}
|
|
8885
|
+
* @global
|
|
8886
|
+
*/
|
|
8887
|
+
globalThis.__FOCUSGROUP_POLYFILL__ ??= {
|
|
8888
|
+
o: /* @__PURE__ */new Set(),
|
|
8889
|
+
b: false
|
|
8890
|
+
};
|
|
8891
|
+
var state = globalThis.__FOCUSGROUP_POLYFILL__;
|
|
8892
|
+
|
|
8893
|
+
//#region src/observer-registry.js
|
|
8894
|
+
/** @type {Set<MutationObserver>} */
|
|
8895
|
+
var observers = state.o;
|
|
8896
|
+
/**
|
|
8897
|
+
* Flushes all globally registered focusgroup MutationObservers by calling
|
|
8898
|
+
* `takeRecords()` on each, discarding any pending mutation records that were
|
|
8899
|
+
* caused by polyfill-managed attribute writes. This prevents infinite
|
|
8900
|
+
* cross-group loops between nested focusgroups whose subtrees overlap.
|
|
8901
|
+
*/
|
|
8902
|
+
function flushAllObservers() {
|
|
8903
|
+
for (const observer of observers) observer.takeRecords();
|
|
8904
|
+
}
|
|
8905
|
+
|
|
8906
|
+
//#region src/focusgroup.js
|
|
8907
|
+
/**
|
|
8908
|
+
* @import {
|
|
8909
|
+
* FocusGroupItemCollection,
|
|
8910
|
+
* FocusGroupOptions,
|
|
8911
|
+
* FocusGroupUpdateInfo,
|
|
8912
|
+
* } from "./focusgroup-items.js"
|
|
8913
|
+
* @import {FocusGroupDefinition} from "./utils.js"
|
|
8914
|
+
*/
|
|
8915
|
+
var FocusGroup = class {
|
|
8916
|
+
/**
|
|
8917
|
+
* The focus group owner element.
|
|
8918
|
+
* @type {HTMLElement!}
|
|
8919
|
+
*/
|
|
8920
|
+
#owner;
|
|
8921
|
+
/**
|
|
8922
|
+
* The items collection — exposes the focus group's items and answers
|
|
8923
|
+
* queries about them. Reconciliation is triggered externally via
|
|
8924
|
+
* `FocusGroup#update()`.
|
|
8925
|
+
* @type {FocusGroupItemCollection}
|
|
8926
|
+
*/
|
|
8927
|
+
#items;
|
|
8928
|
+
/**
|
|
8929
|
+
* The focus group behavior.
|
|
8930
|
+
* @type {BehaviorToken!}
|
|
8931
|
+
*/
|
|
8932
|
+
#behavior = BehaviorToken.NONE;
|
|
8933
|
+
/**
|
|
8934
|
+
* The focus group navigation axis limitation.
|
|
8935
|
+
* @type {("inline" | "block" | undefined)}
|
|
8936
|
+
*/
|
|
8937
|
+
#axis = void 0;
|
|
8938
|
+
/**
|
|
8939
|
+
* Whether the focus group wraps. Defaults to `false`.
|
|
8940
|
+
* @type {boolean}
|
|
8941
|
+
*/
|
|
8942
|
+
#wrap = false;
|
|
8943
|
+
/**
|
|
8944
|
+
* Whether the focus group remembers the previously focused element.
|
|
8945
|
+
* Defaults to `true`.
|
|
8946
|
+
* @type {boolean}
|
|
8947
|
+
*/
|
|
8948
|
+
#memory = true;
|
|
8949
|
+
/**
|
|
8950
|
+
* The focus group start element (initial tab stop after decoration).
|
|
8951
|
+
* @type {HTMLElement}
|
|
8952
|
+
*/
|
|
8953
|
+
#start;
|
|
8954
|
+
/**
|
|
8955
|
+
* The current item — the most recently focused item within the group.
|
|
8956
|
+
* Serves as the keyboard-navigation cursor while focus is inside, and (in
|
|
8957
|
+
* memory mode) as the tab stop to restore on re-entry. Updated by
|
|
8958
|
+
* `#handleFocusin`, plus directly by `#handleKeydown` for shadow-internal
|
|
8959
|
+
* navigation (where focus events don't cross the shadow boundary).
|
|
8960
|
+
* Cleared in nomemory mode on focusout and when validation fails after
|
|
8961
|
+
* re-decoration.
|
|
8962
|
+
* @type {HTMLElement|null}
|
|
8963
|
+
*/
|
|
8964
|
+
#current = null;
|
|
8965
|
+
/**
|
|
8966
|
+
* Whether the owner currently has `tabindex=0` set as a Tab-entry proxy so
|
|
8967
|
+
* sequential focus navigation can reach a tab stop inside a shadow root.
|
|
8968
|
+
* @type {boolean}
|
|
8969
|
+
*/
|
|
8970
|
+
#ownerIsProxy = false;
|
|
8971
|
+
/**
|
|
8972
|
+
* The owner's original `tabindex` attribute value (or `null` if it had no
|
|
8973
|
+
* `tabindex`), saved before the polyfill sets `tabindex=0` for proxy duty.
|
|
8974
|
+
* @type {string|null}
|
|
8975
|
+
*/
|
|
8976
|
+
#ownerTabindexBeforeProxy = null;
|
|
8977
|
+
/**
|
|
8978
|
+
* The abort controller for when `disconnect()` is called.
|
|
8979
|
+
* @type {AbortController}
|
|
8980
|
+
*/
|
|
8981
|
+
#abort = new AbortController();
|
|
8982
|
+
/**
|
|
8983
|
+
* Optional owner-decoration hook injected via `options.decorateOwner`.
|
|
8984
|
+
* Called with `(owner, behavior)` on decoration and `(owner, null)` on
|
|
8985
|
+
* undecoration. When absent, no owner decoration happens.
|
|
8986
|
+
* @type {((element: HTMLElement, behavior: BehaviorToken|null) => void) | undefined}
|
|
8987
|
+
*/
|
|
8988
|
+
#decorateOwner;
|
|
8989
|
+
/**
|
|
8990
|
+
* Optional item-decoration hook injected via `options.decorateItem`.
|
|
8991
|
+
* Called with `(item, behavior)` on decoration and `(item, null)` on
|
|
8992
|
+
* undecoration. When absent, no item decoration happens.
|
|
8993
|
+
* @type {((element: HTMLElement, behavior: BehaviorToken|null) => void) | undefined}
|
|
8994
|
+
*/
|
|
8995
|
+
#decorateItem;
|
|
8996
|
+
/**
|
|
8997
|
+
* @param {HTMLElement!} owner - The focus group owner element.
|
|
8998
|
+
* @param {FocusGroupItemCollection} items - The items collection providing
|
|
8999
|
+
* item discovery and queries.
|
|
9000
|
+
* @param {FocusGroupOptions} [options]
|
|
9001
|
+
*/
|
|
9002
|
+
constructor(owner, items, options = {}) {
|
|
9003
|
+
if (supportsFocusGroup() || !owner) return;
|
|
9004
|
+
this.#owner = owner;
|
|
9005
|
+
this.#items = items;
|
|
9006
|
+
this.#decorateOwner = options.decorateOwner;
|
|
9007
|
+
this.#decorateItem = options.decorateItem;
|
|
9008
|
+
this.#updateDefinition(options.definition);
|
|
9009
|
+
this.#decorateOwner?.(this.#owner, this.#behavior);
|
|
9010
|
+
this.#decorateItems();
|
|
9011
|
+
const opts = {
|
|
9012
|
+
signal: this.#abort.signal
|
|
9013
|
+
};
|
|
9014
|
+
this.#owner.addEventListener("keydown", this.#handleKeydown.bind(this), opts);
|
|
9015
|
+
this.#owner.addEventListener("focusin", this.#handleFocusin.bind(this), opts);
|
|
9016
|
+
this.#owner.addEventListener("focusout", this.#handleFocusout.bind(this), opts);
|
|
9017
|
+
}
|
|
9018
|
+
/**
|
|
9019
|
+
* Tears down the focus group: disables the owner proxy, removes all event
|
|
9020
|
+
* listeners (via the abort signal), then disconnects the items collection
|
|
9021
|
+
* if it supports it.
|
|
9022
|
+
*
|
|
9023
|
+
* Ordering matters: owner-proxy teardown can trigger `flushAllObservers()`,
|
|
9024
|
+
* which expects the items' observer to still be in the global registry.
|
|
9025
|
+
* The items' own `disconnect()` is therefore called last.
|
|
9026
|
+
*
|
|
9027
|
+
* NOTE: This method does not undecorate the elements. Call it only after
|
|
9028
|
+
* the focusgroup owner has been removed from the DOM.
|
|
9029
|
+
*/
|
|
9030
|
+
disconnect() {
|
|
9031
|
+
this.#disableFocusabilityProxy();
|
|
9032
|
+
this.#abort.abort();
|
|
9033
|
+
this.#items?.disconnect?.();
|
|
9034
|
+
this.#owner = null;
|
|
9035
|
+
}
|
|
9036
|
+
/**
|
|
9037
|
+
* Reconciles decoration state in response to relevant changes. Call this
|
|
9038
|
+
* whenever the focus group should refresh — e.g. items were added or
|
|
9039
|
+
* removed, the owner's `focusgroup` attribute changed, or an author set
|
|
9040
|
+
* `tabindex` on a decorated item.
|
|
9041
|
+
*
|
|
9042
|
+
* The polyfill's default `TreeWalkerItemCollection` calls this from a
|
|
9043
|
+
* `MutationObserver`. App-supplied collections (or app code that knows
|
|
9044
|
+
* when its model changed) can call it directly.
|
|
9045
|
+
*
|
|
9046
|
+
* @param {FocusGroupUpdateInfo} [info]
|
|
9047
|
+
*/
|
|
9048
|
+
update(info = {}) {
|
|
9049
|
+
if (!this.#owner) return;
|
|
9050
|
+
if (info.definition !== void 0) {
|
|
9051
|
+
this.#updateDefinition(info.definition);
|
|
9052
|
+
this.#decorateOwner?.(this.#owner, this.#behavior);
|
|
9053
|
+
}
|
|
9054
|
+
if (info.authorTabindexChanges) for (const el of info.authorTabindexChanges) el.setAttribute(DatasetName.AUTHOR_TABINDEX, el.getAttribute("tabindex") ?? "none");
|
|
9055
|
+
this.#undecorateItems();
|
|
9056
|
+
this.#decorateItems();
|
|
9057
|
+
}
|
|
9058
|
+
/** @param {FocusGroupDefinition} [def] */
|
|
9059
|
+
#updateDefinition(def) {
|
|
9060
|
+
this.#behavior = def?.behavior ?? BehaviorToken.NONE;
|
|
9061
|
+
this.#wrap = def?.wrap ?? false;
|
|
9062
|
+
this.#axis = def?.axis;
|
|
9063
|
+
this.#memory = def?.memory ?? true;
|
|
9064
|
+
if (!this.#memory) this.#current = null;
|
|
9065
|
+
}
|
|
9066
|
+
#decorateItems() {
|
|
9067
|
+
if (this.#behavior === BehaviorToken.NONE) {
|
|
9068
|
+
this.#undecorateItems();
|
|
9069
|
+
return;
|
|
9070
|
+
}
|
|
9071
|
+
this.#items.decorate?.();
|
|
9072
|
+
for (const {
|
|
9073
|
+
element,
|
|
9074
|
+
segmentBoundary
|
|
9075
|
+
} of this.#items.items()) {
|
|
9076
|
+
this.#decorateItem?.(element, this.#behavior);
|
|
9077
|
+
element.setAttribute(DatasetName.AUTHOR_TABINDEX, element.getAttribute("tabindex") ?? "none");
|
|
9078
|
+
element.tabIndex = segmentBoundary ? 0 : -1;
|
|
9079
|
+
}
|
|
9080
|
+
if (!this.#current?.isConnected || !(this.#items.isItem?.(this.#current) ?? this.#items.contains(this.#current))) this.#current = null;
|
|
9081
|
+
const startItem = this.#current ?? this.#items.start ?? this.#items.first?.() ?? null;
|
|
9082
|
+
if (startItem) {
|
|
9083
|
+
startItem.tabIndex = 0;
|
|
9084
|
+
this.#start = startItem;
|
|
9085
|
+
this.#disableFocusabilityProxy();
|
|
9086
|
+
this.#enableFocusabilityProxy(startItem);
|
|
9087
|
+
}
|
|
9088
|
+
this.#items.flush?.();
|
|
9089
|
+
}
|
|
9090
|
+
#undecorateItems() {
|
|
9091
|
+
this.#disableFocusabilityProxy();
|
|
9092
|
+
let undecorated = false;
|
|
9093
|
+
for (const {
|
|
9094
|
+
element
|
|
9095
|
+
} of this.#items.items()) {
|
|
9096
|
+
undecorated = true;
|
|
9097
|
+
this.#decorateItem?.(element, null);
|
|
9098
|
+
const authorTabIndex = element.getAttribute(DatasetName.AUTHOR_TABINDEX);
|
|
9099
|
+
if (authorTabIndex) {
|
|
9100
|
+
if (authorTabIndex === "none") element.removeAttribute("tabindex");else element.setAttribute("tabindex", authorTabIndex);
|
|
9101
|
+
element.removeAttribute(DatasetName.AUTHOR_TABINDEX);
|
|
9102
|
+
}
|
|
9103
|
+
}
|
|
9104
|
+
this.#items.undecorate?.();
|
|
9105
|
+
if (undecorated) this.#items.flush?.();
|
|
9106
|
+
}
|
|
9107
|
+
/** @param {KeyboardEvent} evt */
|
|
9108
|
+
#handleKeydown(evt) {
|
|
9109
|
+
const current = evt.composedPath()[0];
|
|
9110
|
+
if (evt.defaultPrevented || current === this.#owner) return;
|
|
9111
|
+
if (!this.#items.contains(current)) return;
|
|
9112
|
+
evt.stopPropagation();
|
|
9113
|
+
let target;
|
|
9114
|
+
switch (getNavigationDirection(evt, current, this.#axis)) {
|
|
9115
|
+
case "start":
|
|
9116
|
+
target = this.#items.first();
|
|
9117
|
+
break;
|
|
9118
|
+
case "end":
|
|
9119
|
+
target = this.#items.last();
|
|
9120
|
+
break;
|
|
9121
|
+
case "forward":
|
|
9122
|
+
target = this.#items.next(current);
|
|
9123
|
+
if (!target && this.#wrap) target = this.#items.first();
|
|
9124
|
+
break;
|
|
9125
|
+
case "backward":
|
|
9126
|
+
target = this.#items.previous(current);
|
|
9127
|
+
if (!target && this.#wrap) target = this.#items.last();
|
|
9128
|
+
break;
|
|
9129
|
+
}
|
|
9130
|
+
if (target && target !== current) {
|
|
9131
|
+
this.#advanceFocus(current, target, true);
|
|
9132
|
+
this.#current = target;
|
|
9133
|
+
evt.preventDefault();
|
|
9134
|
+
}
|
|
9135
|
+
}
|
|
9136
|
+
/** @param {FocusEvent} evt */
|
|
9137
|
+
#handleFocusin(evt) {
|
|
9138
|
+
const target = evt.composedPath()[0];
|
|
9139
|
+
if (target === this.#owner && this.#ownerIsProxy && (!evt.relatedTarget || !nodeContains(this.#owner, evt.relatedTarget))) {
|
|
9140
|
+
const tabStop = this.#current || this.#start;
|
|
9141
|
+
this.#disableFocusabilityProxy();
|
|
9142
|
+
if (tabStop) tabStop.focus();
|
|
9143
|
+
evt.stopPropagation();
|
|
9144
|
+
return;
|
|
9145
|
+
}
|
|
9146
|
+
if (!this.#items.contains(target)) return;
|
|
9147
|
+
if (this.#ownerIsProxy) this.#disableFocusabilityProxy();
|
|
9148
|
+
const prev = this.#current;
|
|
9149
|
+
this.#current = target;
|
|
9150
|
+
if (prev === target) return;
|
|
9151
|
+
if (target.tabIndex < 0) {
|
|
9152
|
+
const transferFrom = prev ?? this.#start;
|
|
9153
|
+
if (transferFrom) this.#advanceFocus(transferFrom, target);
|
|
9154
|
+
}
|
|
9155
|
+
}
|
|
9156
|
+
/** @param {FocusEvent} evt */
|
|
9157
|
+
#handleFocusout(evt) {
|
|
9158
|
+
if (!evt.relatedTarget || !nodeContains(this.#owner, evt.relatedTarget)) {
|
|
9159
|
+
const tabStop = this.#memory ? this.#current || this.#start : this.#start;
|
|
9160
|
+
if (tabStop) this.#enableFocusabilityProxy(tabStop);
|
|
9161
|
+
}
|
|
9162
|
+
if (evt.relatedTarget && this.#owner.contains(evt.relatedTarget) || this.#memory || !this.#start) return;
|
|
9163
|
+
if (!this.#memory && this.#start) {
|
|
9164
|
+
const prev = this.#current;
|
|
9165
|
+
this.#current = null;
|
|
9166
|
+
const nextStart = this.#items.start ?? this.#items.first?.() ?? null;
|
|
9167
|
+
if (prev !== this.#start || nextStart !== this.#start) {
|
|
9168
|
+
for (const {
|
|
9169
|
+
element,
|
|
9170
|
+
segmentBoundary
|
|
9171
|
+
} of this.#items.items()) element.tabIndex = segmentBoundary ? 0 : -1;
|
|
9172
|
+
if (nextStart) {
|
|
9173
|
+
nextStart.tabIndex = 0;
|
|
9174
|
+
this.#start = nextStart;
|
|
9175
|
+
}
|
|
9176
|
+
this.#items.flush?.();
|
|
9177
|
+
}
|
|
9178
|
+
}
|
|
9179
|
+
const tabStop = this.#memory ? this.#current || this.#start : this.#start;
|
|
9180
|
+
if (tabStop) this.#enableFocusabilityProxy(tabStop);
|
|
9181
|
+
}
|
|
9182
|
+
/**
|
|
9183
|
+
* If the tab stop is inside a shadow DOM, sets `tabindex=0` on the
|
|
9184
|
+
* focusgroup owner so the browser's Tab navigation can land on it, at
|
|
9185
|
+
* which point `#handleFocusin` will redirect focus to the real tab stop.
|
|
9186
|
+
* @param {HTMLElement} tabStop - The actual focusable tab stop element.
|
|
9187
|
+
*/
|
|
9188
|
+
#enableFocusabilityProxy(tabStop) {
|
|
9189
|
+
const rootNode = (tabStop.assignedSlot ?? tabStop).getRootNode();
|
|
9190
|
+
const hasFocusableHost = rootNode instanceof ShadowRoot && rootNode.host.hasAttribute(DatasetName.AUTHOR_TABINDEX);
|
|
9191
|
+
if (this.#ownerIsProxy || !hasFocusableHost) return;
|
|
9192
|
+
this.#ownerTabindexBeforeProxy = this.#owner.getAttribute("tabindex");
|
|
9193
|
+
this.#owner.tabIndex = 0;
|
|
9194
|
+
this.#ownerIsProxy = true;
|
|
9195
|
+
flushAllObservers();
|
|
9196
|
+
}
|
|
9197
|
+
/** Undoes `#enableFocusabilityProxy`. */
|
|
9198
|
+
#disableFocusabilityProxy() {
|
|
9199
|
+
if (!this.#ownerIsProxy) return;
|
|
9200
|
+
if (this.#ownerTabindexBeforeProxy !== null) this.#owner.setAttribute("tabindex", this.#ownerTabindexBeforeProxy);else this.#owner.removeAttribute("tabindex");
|
|
9201
|
+
this.#ownerIsProxy = false;
|
|
9202
|
+
this.#ownerTabindexBeforeProxy = null;
|
|
9203
|
+
this.#items.flush?.();
|
|
9204
|
+
flushAllObservers();
|
|
9205
|
+
}
|
|
9206
|
+
/**
|
|
9207
|
+
* Advances the focusgroup's active tab stop from one item to another. Sets
|
|
9208
|
+
* the target's `tabindex` to `0` and optionally calls `focus()` on it. The
|
|
9209
|
+
* previous item's `tabindex` is set to `-1` unless it belongs to a different
|
|
9210
|
+
* segment (in which case it remains `0` as a segment tab stop). Also disables
|
|
9211
|
+
* the owner proxy.
|
|
9212
|
+
*
|
|
9213
|
+
* @param {HTMLElement} prev - The currently focused item.
|
|
9214
|
+
* @param {HTMLElement} next - The item to receive focus.
|
|
9215
|
+
* @param {boolean} [shouldCallFocus=false] - Whether to programmatically
|
|
9216
|
+
* call `focus()` on the target element.
|
|
9217
|
+
*/
|
|
9218
|
+
#advanceFocus(prev, next, shouldCallFocus = false) {
|
|
9219
|
+
next.tabIndex = 0;
|
|
9220
|
+
if (shouldCallFocus) next.focus();
|
|
9221
|
+
prev.tabIndex = this.#items.sameSegment?.(prev, next) ?? true ? -1 : 0;
|
|
9222
|
+
this.#disableFocusabilityProxy();
|
|
9223
|
+
flushAllObservers();
|
|
9224
|
+
}
|
|
9225
|
+
};
|
|
8934
9226
|
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
9227
|
+
class ArrayItemCollection {
|
|
9228
|
+
constructor(getItems, getStart) {
|
|
9229
|
+
this.getItems = getItems;
|
|
9230
|
+
this.getStart = getStart;
|
|
9231
|
+
}
|
|
9232
|
+
get start() {
|
|
9233
|
+
return this.getStart?.() ?? null;
|
|
9234
|
+
}
|
|
9235
|
+
first() {
|
|
9236
|
+
return this.getItems()[0] ?? null;
|
|
9237
|
+
}
|
|
9238
|
+
last() {
|
|
9239
|
+
const items = this.getItems();
|
|
9240
|
+
return items[items.length - 1] ?? null;
|
|
9241
|
+
}
|
|
9242
|
+
next(current) {
|
|
9243
|
+
const items = this.getItems();
|
|
9244
|
+
const i = items.indexOf(current);
|
|
9245
|
+
return i === -1 ? null : items[i + 1] ?? null;
|
|
9246
|
+
}
|
|
9247
|
+
previous(current) {
|
|
9248
|
+
const items = this.getItems();
|
|
9249
|
+
const i = items.indexOf(current);
|
|
9250
|
+
return i <= 0 ? null : items[i - 1] ?? null;
|
|
9251
|
+
}
|
|
9252
|
+
*items() {
|
|
9253
|
+
for (const element of this.getItems()) {
|
|
9254
|
+
yield {
|
|
9255
|
+
element
|
|
9256
|
+
};
|
|
9257
|
+
}
|
|
9258
|
+
}
|
|
9259
|
+
contains(element) {
|
|
9260
|
+
return this.getItems().includes(element);
|
|
9261
|
+
}
|
|
8941
9262
|
}
|
|
8942
|
-
const template$k = menuItemTemplate({
|
|
8943
|
-
indicator: Checkmark16Filled,
|
|
8944
|
-
submenuGlyph: chevronRight16Filled
|
|
8945
|
-
});
|
|
8946
|
-
|
|
8947
|
-
const definition$k = MenuItem.compose({
|
|
8948
|
-
name: `${FluentDesignSystem.prefix}-menu-item`,
|
|
8949
|
-
template: template$k,
|
|
8950
|
-
styles: styles$k
|
|
8951
|
-
});
|
|
8952
|
-
|
|
8953
|
-
definition$k.define(FluentDesignSystem.registry);
|
|
8954
9263
|
|
|
8955
9264
|
var __defProp$o = Object.defineProperty;
|
|
8956
9265
|
var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
|
|
@@ -8969,52 +9278,27 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
|
|
|
8969
9278
|
* @internal
|
|
8970
9279
|
*/
|
|
8971
9280
|
this.elementInternals = this.attachInternals();
|
|
8972
|
-
/**
|
|
8973
|
-
* The index of the focusable element in the items array
|
|
8974
|
-
* defaults to -1
|
|
8975
|
-
*/
|
|
8976
|
-
this.focusIndex = -1;
|
|
8977
9281
|
/**
|
|
8978
9282
|
* @internal
|
|
8979
9283
|
*/
|
|
8980
9284
|
this.isNestedMenu = () => {
|
|
8981
9285
|
return this.parentElement !== null && isHTMLElement(this.parentElement) && this.parentElement.getAttribute("role") === "menuitem";
|
|
8982
9286
|
};
|
|
8983
|
-
/**
|
|
8984
|
-
* if focus is moving out of the menu, reset to a stable initial state
|
|
8985
|
-
* @internal
|
|
8986
|
-
*/
|
|
8987
|
-
this.handleFocusOut = e => {
|
|
8988
|
-
if (!this.contains(e.relatedTarget) && this.menuItems !== void 0) {
|
|
8989
|
-
const focusIndex = this.menuItems.findIndex(this.isFocusableElement);
|
|
8990
|
-
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
8991
|
-
this.menuItems[focusIndex].setAttribute("tabindex", "0");
|
|
8992
|
-
this.focusIndex = focusIndex;
|
|
8993
|
-
}
|
|
8994
|
-
};
|
|
8995
|
-
this.handleItemFocus = e => {
|
|
8996
|
-
const targetItem = e.target;
|
|
8997
|
-
if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) {
|
|
8998
|
-
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
8999
|
-
this.focusIndex = this.menuItems.indexOf(targetItem);
|
|
9000
|
-
targetItem.setAttribute("tabindex", "0");
|
|
9001
|
-
}
|
|
9002
|
-
};
|
|
9003
9287
|
/**
|
|
9004
9288
|
* Handle change from child MenuItem element and set radio group behavior
|
|
9005
9289
|
*/
|
|
9006
9290
|
this.changedMenuItemHandler = e => {
|
|
9007
|
-
if (this.
|
|
9291
|
+
if (this.menuChildren === void 0) {
|
|
9008
9292
|
return;
|
|
9009
9293
|
}
|
|
9010
9294
|
const changedMenuItem = e.target;
|
|
9011
|
-
const changeItemIndex = this.
|
|
9295
|
+
const changeItemIndex = this.menuChildren.indexOf(changedMenuItem);
|
|
9012
9296
|
if (changeItemIndex === -1) {
|
|
9013
9297
|
return;
|
|
9014
9298
|
}
|
|
9015
9299
|
if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) {
|
|
9016
9300
|
for (let i = changeItemIndex - 1; i >= 0; --i) {
|
|
9017
|
-
const item = this.
|
|
9301
|
+
const item = this.menuChildren[i];
|
|
9018
9302
|
const role = item.role;
|
|
9019
9303
|
if (role === MenuItemRole.menuitemradio) {
|
|
9020
9304
|
item.checked = false;
|
|
@@ -9023,9 +9307,9 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
|
|
|
9023
9307
|
break;
|
|
9024
9308
|
}
|
|
9025
9309
|
}
|
|
9026
|
-
const maxIndex = this.
|
|
9310
|
+
const maxIndex = this.menuChildren.length - 1;
|
|
9027
9311
|
for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {
|
|
9028
|
-
const item = this.
|
|
9312
|
+
const item = this.menuChildren[i];
|
|
9029
9313
|
const role = item.role;
|
|
9030
9314
|
if (role === MenuItemRole.menuitemradio) {
|
|
9031
9315
|
item.checked = false;
|
|
@@ -9036,22 +9320,10 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
|
|
|
9036
9320
|
}
|
|
9037
9321
|
}
|
|
9038
9322
|
};
|
|
9039
|
-
/**
|
|
9040
|
-
* check if the item is a menu item
|
|
9041
|
-
*/
|
|
9042
|
-
this.isMenuItemElement = el => {
|
|
9043
|
-
return isMenuItem(el) || isHTMLElement(el) && !!el.role && el.role in _BaseMenuList.focusableElementRoles;
|
|
9044
|
-
};
|
|
9045
|
-
/**
|
|
9046
|
-
* check if the item is focusable
|
|
9047
|
-
*/
|
|
9048
|
-
this.isFocusableElement = el => {
|
|
9049
|
-
return this.isMenuItemElement(el);
|
|
9050
|
-
};
|
|
9051
9323
|
this.elementInternals.role = "menu";
|
|
9052
9324
|
}
|
|
9053
9325
|
itemsChanged(oldValue, newValue) {
|
|
9054
|
-
if (this.$fastController.isConnected && this.
|
|
9326
|
+
if (this.$fastController.isConnected && this.menuChildren !== void 0) {
|
|
9055
9327
|
this.setItems();
|
|
9056
9328
|
}
|
|
9057
9329
|
}
|
|
@@ -9070,8 +9342,7 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
|
|
|
9070
9342
|
*/
|
|
9071
9343
|
disconnectedCallback() {
|
|
9072
9344
|
super.disconnectedCallback();
|
|
9073
|
-
this.
|
|
9074
|
-
this.menuItems = void 0;
|
|
9345
|
+
this.menuChildren = void 0;
|
|
9075
9346
|
this.removeEventListener("change", this.changedMenuItemHandler);
|
|
9076
9347
|
}
|
|
9077
9348
|
/**
|
|
@@ -9080,37 +9351,7 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
|
|
|
9080
9351
|
* @public
|
|
9081
9352
|
*/
|
|
9082
9353
|
focus() {
|
|
9083
|
-
this.
|
|
9084
|
-
}
|
|
9085
|
-
/**
|
|
9086
|
-
* @internal
|
|
9087
|
-
*/
|
|
9088
|
-
handleMenuKeyDown(e) {
|
|
9089
|
-
if (e.defaultPrevented || this.menuItems === void 0) {
|
|
9090
|
-
return;
|
|
9091
|
-
}
|
|
9092
|
-
switch (e.key) {
|
|
9093
|
-
case keyArrowDown:
|
|
9094
|
-
this.setFocus(this.focusIndex + 1, 1);
|
|
9095
|
-
return;
|
|
9096
|
-
case keyArrowUp:
|
|
9097
|
-
this.setFocus(this.focusIndex - 1, -1);
|
|
9098
|
-
return;
|
|
9099
|
-
case keyEnd:
|
|
9100
|
-
this.setFocus(this.menuItems.length - 1, -1);
|
|
9101
|
-
return;
|
|
9102
|
-
case keyHome:
|
|
9103
|
-
this.setFocus(0, 1);
|
|
9104
|
-
return;
|
|
9105
|
-
default:
|
|
9106
|
-
return true;
|
|
9107
|
-
}
|
|
9108
|
-
}
|
|
9109
|
-
removeItemListeners(items = this.items) {
|
|
9110
|
-
items.forEach(item => {
|
|
9111
|
-
item.removeEventListener("focus", this.handleItemFocus);
|
|
9112
|
-
Observable.getNotifier(item).unsubscribe(this, "hidden");
|
|
9113
|
-
});
|
|
9354
|
+
this.menuItems?.find(item => !item.disabled)?.focus();
|
|
9114
9355
|
}
|
|
9115
9356
|
static elementIndent(el) {
|
|
9116
9357
|
const role = el.role;
|
|
@@ -9122,24 +9363,13 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
|
|
|
9122
9363
|
}
|
|
9123
9364
|
setItems() {
|
|
9124
9365
|
const children = Array.from(this.children);
|
|
9125
|
-
this.
|
|
9126
|
-
|
|
9127
|
-
const
|
|
9128
|
-
this.menuItems = newItems;
|
|
9129
|
-
const menuItems = this.menuItems.filter(this.isMenuItemElement);
|
|
9130
|
-
if (menuItems.length) {
|
|
9131
|
-
this.focusIndex = 0;
|
|
9132
|
-
}
|
|
9133
|
-
menuItems.forEach((item, index) => {
|
|
9134
|
-
item.setAttribute("tabindex", index === 0 ? "0" : "-1");
|
|
9135
|
-
item.addEventListener("focus", this.handleItemFocus);
|
|
9136
|
-
});
|
|
9137
|
-
const filteredMenuListItems = this.menuItems?.filter(this.isMenuItemElement);
|
|
9138
|
-
const indent = filteredMenuListItems?.reduce((accum, current) => {
|
|
9366
|
+
this.menuChildren = children.filter(child => !child.hasAttribute("hidden"));
|
|
9367
|
+
this.menuItems = this.menuChildren?.filter(this.isMenuItemElement);
|
|
9368
|
+
const indent = this.menuItems?.reduce((accum, current) => {
|
|
9139
9369
|
const elementValue = _BaseMenuList.elementIndent(current);
|
|
9140
9370
|
return Math.max(accum, elementValue);
|
|
9141
9371
|
}, 0);
|
|
9142
|
-
|
|
9372
|
+
this.menuItems?.forEach(item => {
|
|
9143
9373
|
item.dataset.indent = `${indent}`;
|
|
9144
9374
|
});
|
|
9145
9375
|
}
|
|
@@ -9151,30 +9381,38 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
|
|
|
9151
9381
|
this.setItems();
|
|
9152
9382
|
}
|
|
9153
9383
|
}
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
const child = this.menuItems[focusIndex];
|
|
9160
|
-
if (this.isFocusableElement(child)) {
|
|
9161
|
-
if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) {
|
|
9162
|
-
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
9163
|
-
}
|
|
9164
|
-
this.focusIndex = focusIndex;
|
|
9165
|
-
child.setAttribute("tabindex", "0");
|
|
9166
|
-
child.focus();
|
|
9167
|
-
break;
|
|
9168
|
-
}
|
|
9169
|
-
focusIndex += adjustment;
|
|
9170
|
-
}
|
|
9384
|
+
/**
|
|
9385
|
+
* check if the item is a menu item
|
|
9386
|
+
*/
|
|
9387
|
+
isMenuItemElement(el) {
|
|
9388
|
+
return isMenuItem(el) || isHTMLElement(el) && !!el.role && el.role in _BaseMenuList.focusableElementRoles;
|
|
9171
9389
|
}
|
|
9172
9390
|
};
|
|
9173
9391
|
_BaseMenuList.focusableElementRoles = MenuItemRole;
|
|
9174
9392
|
__decorateClass$o([observable], _BaseMenuList.prototype, "items", 2);
|
|
9175
9393
|
let BaseMenuList = _BaseMenuList;
|
|
9176
9394
|
|
|
9177
|
-
class MenuList extends BaseMenuList {
|
|
9395
|
+
class MenuList extends BaseMenuList {
|
|
9396
|
+
disconnectedCallback() {
|
|
9397
|
+
this.fg?.disconnect();
|
|
9398
|
+
super.disconnectedCallback();
|
|
9399
|
+
}
|
|
9400
|
+
setItems() {
|
|
9401
|
+
super.setItems();
|
|
9402
|
+
this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.menuItems?.filter(i => !i.hidden) ?? []));
|
|
9403
|
+
if (!this.fg) {
|
|
9404
|
+
this.fg = new FocusGroup(this, this.fgItems, {
|
|
9405
|
+
definition: {
|
|
9406
|
+
behavior: "menu",
|
|
9407
|
+
axis: "block",
|
|
9408
|
+
wrap: true
|
|
9409
|
+
}
|
|
9410
|
+
});
|
|
9411
|
+
} else {
|
|
9412
|
+
this.fg.update();
|
|
9413
|
+
}
|
|
9414
|
+
}
|
|
9415
|
+
}
|
|
9178
9416
|
|
|
9179
9417
|
const styles$j = css`
|
|
9180
9418
|
${display("flex")}
|
|
@@ -9182,18 +9420,20 @@ const styles$j = css`
|
|
|
9182
9420
|
:host{flex-direction:column;height:fit-content;max-width:300px;min-width:160px;width:auto;background-color:${colorNeutralBackground1};border:1px solid ${colorTransparentStroke};border-radius:${borderRadiusMedium};box-shadow:${shadow16};padding:4px;row-gap:2px}`;
|
|
9183
9421
|
|
|
9184
9422
|
function menuTemplate$1() {
|
|
9185
|
-
return html`<template slot="${x => x.slot ? x.slot : x.isNestedMenu() ? "submenu" : void 0}"
|
|
9423
|
+
return html`<template focusgroup="menu" slot="${x => x.slot ? x.slot : x.isNestedMenu() ? "submenu" : void 0}"><slot ${slotted("items")}></slot></template>`;
|
|
9186
9424
|
}
|
|
9187
9425
|
const template$j = menuTemplate$1();
|
|
9188
9426
|
|
|
9189
9427
|
const definition$j = MenuList.compose({
|
|
9190
|
-
name:
|
|
9428
|
+
name: tagName$i,
|
|
9191
9429
|
template: template$j,
|
|
9192
9430
|
styles: styles$j
|
|
9193
9431
|
});
|
|
9194
9432
|
|
|
9195
9433
|
definition$j.define(FluentDesignSystem.registry);
|
|
9196
9434
|
|
|
9435
|
+
const tagName$h = `${FluentDesignSystem.prefix}-menu`;
|
|
9436
|
+
|
|
9197
9437
|
var __defProp$n = Object.defineProperty;
|
|
9198
9438
|
var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
|
|
9199
9439
|
var __decorateClass$n = (decorators, target, key, kind) => {
|
|
@@ -9251,9 +9491,10 @@ class Menu extends FASTElement {
|
|
|
9251
9491
|
*/
|
|
9252
9492
|
this.toggleHandler = e => {
|
|
9253
9493
|
if (e.type === "toggle" && e.newState) {
|
|
9254
|
-
const
|
|
9255
|
-
this._trigger?.setAttribute("aria-expanded", `${
|
|
9256
|
-
this.
|
|
9494
|
+
const open = e.newState === "open";
|
|
9495
|
+
this._trigger?.setAttribute("aria-expanded", `${open}`);
|
|
9496
|
+
this._menuList?.setAttribute("focusgroup", open ? "menu" : "none");
|
|
9497
|
+
this._open = open;
|
|
9257
9498
|
if (this._open) {
|
|
9258
9499
|
this.focusMenuList();
|
|
9259
9500
|
}
|
|
@@ -9549,13 +9790,15 @@ function menuTemplate() {
|
|
|
9549
9790
|
const template$i = menuTemplate();
|
|
9550
9791
|
|
|
9551
9792
|
const definition$i = Menu.compose({
|
|
9552
|
-
name:
|
|
9793
|
+
name: tagName$h,
|
|
9553
9794
|
template: template$i,
|
|
9554
9795
|
styles: styles$i
|
|
9555
9796
|
});
|
|
9556
9797
|
|
|
9557
9798
|
definition$i.define(FluentDesignSystem.registry);
|
|
9558
9799
|
|
|
9800
|
+
const tagName$g = `${FluentDesignSystem.prefix}-message-bar`;
|
|
9801
|
+
|
|
9559
9802
|
var __defProp$m = Object.defineProperty;
|
|
9560
9803
|
var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
|
|
9561
9804
|
var __decorateClass$m = (decorators, target, key, kind) => {
|
|
@@ -9598,7 +9841,7 @@ function messageBarTemplate() {
|
|
|
9598
9841
|
const template$h = messageBarTemplate();
|
|
9599
9842
|
|
|
9600
9843
|
const definition$h = MessageBar.compose({
|
|
9601
|
-
name:
|
|
9844
|
+
name: tagName$g,
|
|
9602
9845
|
template: template$h,
|
|
9603
9846
|
styles: styles$h,
|
|
9604
9847
|
shadowOptions: {
|
|
@@ -9891,7 +10134,7 @@ const template$g = dropdownOptionTemplate({
|
|
|
9891
10134
|
});
|
|
9892
10135
|
|
|
9893
10136
|
const definition$g = DropdownOption.compose({
|
|
9894
|
-
name:
|
|
10137
|
+
name: tagName$p,
|
|
9895
10138
|
template: template$g,
|
|
9896
10139
|
styles: styles$g
|
|
9897
10140
|
});
|
|
@@ -9903,6 +10146,7 @@ const ProgressBarValidationState = {
|
|
|
9903
10146
|
warning: "warning",
|
|
9904
10147
|
error: "error"
|
|
9905
10148
|
};
|
|
10149
|
+
const tagName$f = `${FluentDesignSystem.prefix}-progress-bar`;
|
|
9906
10150
|
|
|
9907
10151
|
var __defProp$k = Object.defineProperty;
|
|
9908
10152
|
var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
|
|
@@ -10031,8 +10275,7 @@ const styles$f = css`
|
|
|
10031
10275
|
|
|
10032
10276
|
: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(
|
|
10033
10277
|
to right,${colorNeutralBackground6} 0%,${colorTransparentBackground} 50%,${colorNeutralBackground6} 100%
|
|
10034
|
-
);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%}}
|
|
10035
|
-
:host{background-color:CanvasText}.indicator,:host(:is([validation-state='success'],[validation-state='warning'],[validation-state='error'])) .indicator{background-color:Highlight}`));
|
|
10278
|
+
);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%}}@media (forced-colors:active){:host{background-color:CanvasText}.indicator,:host(:is([validation-state='success'],[validation-state='warning'],[validation-state='error'])) .indicator{background-color:Highlight}}`;
|
|
10036
10279
|
|
|
10037
10280
|
function progressTemplate() {
|
|
10038
10281
|
return html`<div class="indicator" part="indicator" ${ref("indicator")}></div>`;
|
|
@@ -10040,26 +10283,20 @@ function progressTemplate() {
|
|
|
10040
10283
|
const template$f = progressTemplate();
|
|
10041
10284
|
|
|
10042
10285
|
const definition$f = ProgressBar.compose({
|
|
10043
|
-
name:
|
|
10286
|
+
name: tagName$f,
|
|
10044
10287
|
template: template$f,
|
|
10045
10288
|
styles: styles$f
|
|
10046
10289
|
});
|
|
10047
10290
|
|
|
10048
10291
|
definition$f.define(FluentDesignSystem.registry);
|
|
10049
10292
|
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
}
|
|
10293
|
+
const RadioGroupOrientation = Orientation;
|
|
10294
|
+
const tagName$e = `${FluentDesignSystem.prefix}-radio-group`;
|
|
10053
10295
|
|
|
10054
|
-
function
|
|
10055
|
-
|
|
10056
|
-
if (rootNode instanceof ShadowRoot) {
|
|
10057
|
-
return rootNode.activeElement;
|
|
10058
|
-
}
|
|
10059
|
-
return document.activeElement;
|
|
10296
|
+
function isRadio(element, tagName2 = "-radio") {
|
|
10297
|
+
return isCustomElement(tagName2)(element);
|
|
10060
10298
|
}
|
|
10061
|
-
|
|
10062
|
-
const RadioGroupOrientation = Orientation;
|
|
10299
|
+
const tagName$d = `${FluentDesignSystem.prefix}-radio`;
|
|
10063
10300
|
|
|
10064
10301
|
var __defProp$i = Object.defineProperty;
|
|
10065
10302
|
var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
|
|
@@ -10072,6 +10309,7 @@ var __decorateClass$i = (decorators, target, key, kind) => {
|
|
|
10072
10309
|
class BaseRadioGroup extends FASTElement {
|
|
10073
10310
|
constructor() {
|
|
10074
10311
|
super();
|
|
10312
|
+
this.isNavigating = false;
|
|
10075
10313
|
/**
|
|
10076
10314
|
* Indicates that the value has been changed by the user.
|
|
10077
10315
|
*/
|
|
@@ -10111,7 +10349,6 @@ class BaseRadioGroup extends FASTElement {
|
|
|
10111
10349
|
this.radios?.forEach(radio => {
|
|
10112
10350
|
radio.disabled = !!radio.disabledAttribute || !!this.disabled;
|
|
10113
10351
|
});
|
|
10114
|
-
this.restrictFocus();
|
|
10115
10352
|
}
|
|
10116
10353
|
}
|
|
10117
10354
|
/**
|
|
@@ -10170,18 +10407,13 @@ class BaseRadioGroup extends FASTElement {
|
|
|
10170
10407
|
}
|
|
10171
10408
|
radio.name = this.name ?? radio.name;
|
|
10172
10409
|
radio.disabled = !!this.disabled || !!radio.disabledAttribute;
|
|
10410
|
+
radio.toggleAttribute("focusgroupstart", radio.checked && !radio.disabled);
|
|
10173
10411
|
});
|
|
10174
10412
|
if (!this.dirtyState && this.initialValue) {
|
|
10175
10413
|
this.value = this.initialValue;
|
|
10176
10414
|
}
|
|
10177
10415
|
if (!this.value ||
|
|
10178
10416
|
// This logic covers the case when the RadioGroup doesn't have a `value`
|
|
10179
|
-
// attribute, but does have a checked child Radio. Without this condition,
|
|
10180
|
-
// the checked Radio's value will be assigned to `this.value`, and
|
|
10181
|
-
// `checkedIndex` will be the checked Radio's index, but `this.checkedIndex`
|
|
10182
|
-
// will remain `undefined`, which would cause the RadioGroup to add
|
|
10183
|
-
// `tabindex=-1` to the checked Radio, and effectively makes the whole
|
|
10184
|
-
// RadioGroup unfocusable.
|
|
10185
10417
|
this.value && typeof this.checkedIndex !== "number" && checkedIndex >= 0) {
|
|
10186
10418
|
this.checkedIndex = checkedIndex;
|
|
10187
10419
|
}
|
|
@@ -10189,9 +10421,6 @@ class BaseRadioGroup extends FASTElement {
|
|
|
10189
10421
|
if (radioIds) {
|
|
10190
10422
|
this.setAttribute("aria-owns", radioIds);
|
|
10191
10423
|
}
|
|
10192
|
-
Updates.enqueue(() => {
|
|
10193
|
-
this.restrictFocus();
|
|
10194
|
-
});
|
|
10195
10424
|
}
|
|
10196
10425
|
/**
|
|
10197
10426
|
*
|
|
@@ -10341,6 +10570,12 @@ class BaseRadioGroup extends FASTElement {
|
|
|
10341
10570
|
focus() {
|
|
10342
10571
|
this.enabledRadios[Math.max(0, this.checkedIndex)]?.focus();
|
|
10343
10572
|
}
|
|
10573
|
+
formResetCallback() {
|
|
10574
|
+
this.dirtyState = false;
|
|
10575
|
+
this.checkedIndex = -1;
|
|
10576
|
+
this.setFormValue(this.value);
|
|
10577
|
+
this.setValidity();
|
|
10578
|
+
}
|
|
10344
10579
|
/**
|
|
10345
10580
|
* Enables tabbing through the radio group when the group receives focus.
|
|
10346
10581
|
*
|
|
@@ -10348,37 +10583,20 @@ class BaseRadioGroup extends FASTElement {
|
|
|
10348
10583
|
* @internal
|
|
10349
10584
|
*/
|
|
10350
10585
|
focusinHandler(e) {
|
|
10351
|
-
if (!this.disabled) {
|
|
10352
|
-
this.
|
|
10353
|
-
radio.
|
|
10586
|
+
if (!this.disabled && (this.isNavigating || this.value)) {
|
|
10587
|
+
this.radios?.forEach(radio => {
|
|
10588
|
+
if (radio.disabled && radio.checked) {
|
|
10589
|
+
radio.checked = false;
|
|
10590
|
+
}
|
|
10354
10591
|
});
|
|
10592
|
+
const index = this.enabledRadios.indexOf(e.target);
|
|
10593
|
+
if (index > -1) {
|
|
10594
|
+
this.checkRadio(index, true);
|
|
10595
|
+
}
|
|
10596
|
+
this.isNavigating = false;
|
|
10355
10597
|
}
|
|
10356
10598
|
return true;
|
|
10357
10599
|
}
|
|
10358
|
-
/**
|
|
10359
|
-
* Sets the tabindex of the radios based on the checked state when the radio group loses focus.
|
|
10360
|
-
*
|
|
10361
|
-
* @param e - the focusout event
|
|
10362
|
-
* @internal
|
|
10363
|
-
*/
|
|
10364
|
-
focusoutHandler(e) {
|
|
10365
|
-
if (this.radios?.includes(e.relatedTarget) && this.radios?.some(x => x.checked)) {
|
|
10366
|
-
this.restrictFocus();
|
|
10367
|
-
}
|
|
10368
|
-
return true;
|
|
10369
|
-
}
|
|
10370
|
-
formResetCallback() {
|
|
10371
|
-
this.dirtyState = false;
|
|
10372
|
-
this.checkedIndex = -1;
|
|
10373
|
-
this.setFormValue(this.value);
|
|
10374
|
-
this.setValidity();
|
|
10375
|
-
}
|
|
10376
|
-
getEnabledIndexInBounds(index, upperBound = this.enabledRadios.length) {
|
|
10377
|
-
if (upperBound === 0) {
|
|
10378
|
-
return -1;
|
|
10379
|
-
}
|
|
10380
|
-
return (index + upperBound) % upperBound;
|
|
10381
|
-
}
|
|
10382
10600
|
/**
|
|
10383
10601
|
* Handles keydown events for the radio group.
|
|
10384
10602
|
*
|
|
@@ -10386,47 +10604,20 @@ class BaseRadioGroup extends FASTElement {
|
|
|
10386
10604
|
* @internal
|
|
10387
10605
|
*/
|
|
10388
10606
|
keydownHandler(e) {
|
|
10389
|
-
const isRtl = getDirection(this) === "rtl";
|
|
10390
|
-
const checkedIndex = this.enabledRadios.findIndex(x => x === getRootActiveElement(this)) ?? this.checkedIndex;
|
|
10391
|
-
let increment = 0;
|
|
10392
10607
|
switch (e.key) {
|
|
10393
|
-
case
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
case
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
{
|
|
10405
|
-
increment = isRtl ? -1 : 1;
|
|
10406
|
-
break;
|
|
10407
|
-
}
|
|
10408
|
-
case "ArrowDown":
|
|
10409
|
-
{
|
|
10410
|
-
increment = 1;
|
|
10411
|
-
break;
|
|
10412
|
-
}
|
|
10413
|
-
case "Tab":
|
|
10414
|
-
{
|
|
10415
|
-
this.restrictFocus();
|
|
10416
|
-
break;
|
|
10417
|
-
}
|
|
10418
|
-
case " ":
|
|
10419
|
-
{
|
|
10420
|
-
this.checkRadio();
|
|
10421
|
-
break;
|
|
10422
|
-
}
|
|
10423
|
-
}
|
|
10424
|
-
if (!increment) {
|
|
10425
|
-
return true;
|
|
10608
|
+
case keyArrowUp:
|
|
10609
|
+
case keyArrowDown:
|
|
10610
|
+
case keyArrowLeft:
|
|
10611
|
+
case keyArrowRight:
|
|
10612
|
+
case keyHome:
|
|
10613
|
+
case keyEnd:
|
|
10614
|
+
this.isNavigating = true;
|
|
10615
|
+
break;
|
|
10616
|
+
case keySpace:
|
|
10617
|
+
this.checkRadio();
|
|
10618
|
+
break;
|
|
10426
10619
|
}
|
|
10427
|
-
|
|
10428
|
-
this.checkRadio(this.getEnabledIndexInBounds(nextIndex), true);
|
|
10429
|
-
this.enabledRadios[this.checkedIndex]?.focus();
|
|
10620
|
+
return true;
|
|
10430
10621
|
}
|
|
10431
10622
|
/**
|
|
10432
10623
|
*
|
|
@@ -10447,22 +10638,6 @@ class BaseRadioGroup extends FASTElement {
|
|
|
10447
10638
|
reportValidity() {
|
|
10448
10639
|
return this.elementInternals.reportValidity();
|
|
10449
10640
|
}
|
|
10450
|
-
/**
|
|
10451
|
-
* Resets the `tabIndex` for all child radios when the radio group loses focus.
|
|
10452
|
-
*
|
|
10453
|
-
* @internal
|
|
10454
|
-
*/
|
|
10455
|
-
restrictFocus() {
|
|
10456
|
-
let activeIndex = Math.max(this.checkedIndex, 0);
|
|
10457
|
-
const focusedRadioIndex = this.enabledRadios.indexOf(getRootActiveElement(this));
|
|
10458
|
-
if (focusedRadioIndex !== -1) {
|
|
10459
|
-
activeIndex = focusedRadioIndex;
|
|
10460
|
-
}
|
|
10461
|
-
activeIndex = this.getEnabledIndexInBounds(activeIndex);
|
|
10462
|
-
this.enabledRadios.forEach((item, index) => {
|
|
10463
|
-
item.tabIndex = index === activeIndex ? 0 : -1;
|
|
10464
|
-
});
|
|
10465
|
-
}
|
|
10466
10641
|
/**
|
|
10467
10642
|
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
|
|
10468
10643
|
*
|
|
@@ -10543,7 +10718,27 @@ __decorateClass$i([attr({
|
|
|
10543
10718
|
})], BaseRadioGroup.prototype, "required", 2);
|
|
10544
10719
|
__decorateClass$i([observable], BaseRadioGroup.prototype, "slottedRadios", 2);
|
|
10545
10720
|
|
|
10546
|
-
class RadioGroup extends BaseRadioGroup {
|
|
10721
|
+
class RadioGroup extends BaseRadioGroup {
|
|
10722
|
+
disconnectedCallback() {
|
|
10723
|
+
this.fg?.disconnect();
|
|
10724
|
+
super.disconnectedCallback();
|
|
10725
|
+
}
|
|
10726
|
+
radiosChanged(prev, next) {
|
|
10727
|
+
super.radiosChanged(prev, next);
|
|
10728
|
+
this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.enabledRadios?.filter(r => !r.hidden) ?? [], () => this.enabledRadios?.find(r => r.checked) ?? null));
|
|
10729
|
+
if (!this.fg) {
|
|
10730
|
+
this.fg = new FocusGroup(this, this.fgItems, {
|
|
10731
|
+
definition: {
|
|
10732
|
+
behavior: "radiogroup",
|
|
10733
|
+
axis: void 0,
|
|
10734
|
+
wrap: true
|
|
10735
|
+
}
|
|
10736
|
+
});
|
|
10737
|
+
} else {
|
|
10738
|
+
this.fg.update();
|
|
10739
|
+
}
|
|
10740
|
+
}
|
|
10741
|
+
}
|
|
10547
10742
|
|
|
10548
10743
|
const styles$e = css`
|
|
10549
10744
|
${display("flex")}
|
|
@@ -10551,12 +10746,12 @@ const styles$e = css`
|
|
|
10551
10746
|
: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}}`;
|
|
10552
10747
|
|
|
10553
10748
|
function radioGroupTemplate() {
|
|
10554
|
-
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)}" @
|
|
10749
|
+
return html`<template focusgroup="radiogroup wrap" @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)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><slot ${slotted("slottedRadios")}></slot></template>`;
|
|
10555
10750
|
}
|
|
10556
10751
|
const template$e = radioGroupTemplate();
|
|
10557
10752
|
|
|
10558
10753
|
const definition$e = RadioGroup.compose({
|
|
10559
|
-
name:
|
|
10754
|
+
name: tagName$e,
|
|
10560
10755
|
template: template$e,
|
|
10561
10756
|
styles: styles$e
|
|
10562
10757
|
});
|
|
@@ -10588,7 +10783,7 @@ class Radio extends BaseCheckbox {
|
|
|
10588
10783
|
* @internal
|
|
10589
10784
|
* @override
|
|
10590
10785
|
* @remarks
|
|
10591
|
-
* To make a group of radio controls required, see
|
|
10786
|
+
* To make a group of radio controls required, see `RadioGroup.required`.
|
|
10592
10787
|
*/
|
|
10593
10788
|
requiredChanged() {
|
|
10594
10789
|
return;
|
|
@@ -10632,8 +10827,7 @@ class Radio extends BaseCheckbox {
|
|
|
10632
10827
|
const styles$d = css`
|
|
10633
10828
|
${display("inline-flex")}
|
|
10634
10829
|
|
|
10635
|
-
: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}}
|
|
10636
|
-
: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}`));
|
|
10830
|
+
: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}}@media (forced-colors:active){: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}}`;
|
|
10637
10831
|
|
|
10638
10832
|
const checkedIndicator = html.partial(/* html */
|
|
10639
10833
|
`
|
|
@@ -10647,13 +10841,15 @@ const template$d = radioTemplate({
|
|
|
10647
10841
|
});
|
|
10648
10842
|
|
|
10649
10843
|
const definition$d = Radio.compose({
|
|
10650
|
-
name:
|
|
10844
|
+
name: tagName$d,
|
|
10651
10845
|
template: template$d,
|
|
10652
10846
|
styles: styles$d
|
|
10653
10847
|
});
|
|
10654
10848
|
|
|
10655
10849
|
definition$d.define(FluentDesignSystem.registry);
|
|
10656
10850
|
|
|
10851
|
+
const tagName$c = `${FluentDesignSystem.prefix}-rating-display`;
|
|
10852
|
+
|
|
10657
10853
|
var __defProp$h = Object.defineProperty;
|
|
10658
10854
|
var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
|
|
10659
10855
|
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
@@ -10813,17 +11009,33 @@ const styles$c = css`
|
|
|
10813
11009
|
var(--_mask-inline-size) * var(--_value) - var(--_icon-gradient-stop-visual-adjustment)
|
|
10814
11010
|
);background-image:linear-gradient(
|
|
10815
11011
|
var(--_icon-gradient-degree),var(--_icon-color-value) var(--_icon-gradient-stop),var(--_icon-color-empty) calc(var(--_icon-gradient-stop) + 0.5px)
|
|
10816
|
-
);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}}
|
|
10817
|
-
.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)}`));
|
|
11012
|
+
);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}}@media (forced-colors:active){.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)}}`;
|
|
10818
11013
|
|
|
10819
11014
|
const definition$c = RatingDisplay.compose({
|
|
10820
|
-
name:
|
|
11015
|
+
name: tagName$c,
|
|
10821
11016
|
template: template$c,
|
|
10822
11017
|
styles: styles$c
|
|
10823
11018
|
});
|
|
10824
11019
|
|
|
10825
11020
|
definition$c.define(FluentDesignSystem.registry);
|
|
10826
11021
|
|
|
11022
|
+
const SliderOrientation = Orientation;
|
|
11023
|
+
const SliderMode = {
|
|
11024
|
+
singleValue: "single-value"
|
|
11025
|
+
};
|
|
11026
|
+
const tagName$b = `${FluentDesignSystem.prefix}-slider`;
|
|
11027
|
+
|
|
11028
|
+
const numberLikeStringConverter = {
|
|
11029
|
+
fromView(value) {
|
|
11030
|
+
const valueAsNumber = parseFloat(value);
|
|
11031
|
+
return Number.isNaN(valueAsNumber) ? "" : valueAsNumber.toString();
|
|
11032
|
+
},
|
|
11033
|
+
toView(value) {
|
|
11034
|
+
const valueAsNumber = parseFloat(value);
|
|
11035
|
+
return Number.isNaN(valueAsNumber) ? void 0 : valueAsNumber.toString();
|
|
11036
|
+
}
|
|
11037
|
+
};
|
|
11038
|
+
|
|
10827
11039
|
function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
|
|
10828
11040
|
let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition));
|
|
10829
11041
|
if (direction === Direction.rtl) {
|
|
@@ -10832,11 +11044,6 @@ function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
|
|
|
10832
11044
|
return pct;
|
|
10833
11045
|
}
|
|
10834
11046
|
|
|
10835
|
-
const SliderOrientation = Orientation;
|
|
10836
|
-
const SliderMode = {
|
|
10837
|
-
singleValue: "single-value"
|
|
10838
|
-
};
|
|
10839
|
-
|
|
10840
11047
|
var __defProp$f = Object.defineProperty;
|
|
10841
11048
|
var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
|
|
10842
11049
|
var __decorateClass$f = (decorators, target, key, kind) => {
|
|
@@ -11414,8 +11621,7 @@ const styles$b = css`
|
|
|
11414
11621
|
var(--slider-direction),var(--rail-color) 0%,var(--rail-color) 50%,var(--track-color) 50.1%,var(--track-color) 100%
|
|
11415
11622
|
);border-radius:var(--border-radius);content:'';grid-row:1 / -1;grid-column:1 / -1}.track{position:relative;background-color:var(--track-color);grid-row:2 / 2;grid-column:2 / 2;forced-color-adjust:none;overflow:hidden}:host([orientation='vertical'])::after,:host([orientation='vertical']) .track{height:100%;width:var(--track-size)}.track::before{content:'';position:absolute;height:100%;border-radius:inherit;inset-inline-start:0;width:var(--slider-progress)}:host(:dir(rtl)) .track::before{width:calc(100% - var(--slider-progress))}:host([orientation='vertical']) .track::before{width:100%;bottom:0;height:var(--slider-progress)}:host([step]) .track::after{content:'';position:absolute;border-radius:inherit;inset:var(--step-marker-inset);background-image:repeating-linear-gradient(
|
|
11416
11623
|
var(--slider-direction),#0000 0%,#0000 calc(var(--step-rate) - 1px),${colorNeutralBackground1} calc(var(--step-rate) - 1px),${colorNeutralBackground1} var(--step-rate)
|
|
11417
|
-
)}.thumb-container{position:absolute;grid-row:2 / 2;grid-column:2 / 2;transform:translateX(-50%);left:var(--slider-thumb)}:host([orientation='vertical']) .thumb-container{transform:translateY(50%);left:unset;bottom:var(--slider-thumb)}:host(:not(:active)) :is(.thumb-container,.track::before){transition:all 0.2s ease}.thumb{width:var(--thumb-size);height:var(--thumb-size);border-radius:${borderRadiusCircular};box-shadow:0 0 0 calc(var(--thumb-size) * 0.2) ${colorNeutralBackground1} inset;border:calc(var(--thumb-size) * 0.05) solid ${colorNeutralStroke1};box-sizing:border-box}.thumb,.track::before{background-color:var(--rail-color)}
|
|
11418
|
-
.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}`));
|
|
11624
|
+
)}.thumb-container{position:absolute;grid-row:2 / 2;grid-column:2 / 2;transform:translateX(-50%);left:var(--slider-thumb)}:host([orientation='vertical']) .thumb-container{transform:translateY(50%);left:unset;bottom:var(--slider-thumb)}:host(:not(:active)) :is(.thumb-container,.track::before){transition:all 0.2s ease}.thumb{width:var(--thumb-size);height:var(--thumb-size);border-radius:${borderRadiusCircular};box-shadow:0 0 0 calc(var(--thumb-size) * 0.2) ${colorNeutralBackground1} inset;border:calc(var(--thumb-size) * 0.05) solid ${colorNeutralStroke1};box-sizing:border-box}.thumb,.track::before{background-color:var(--rail-color)}@media (forced-colors:active){.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}}`;
|
|
11419
11625
|
|
|
11420
11626
|
function sliderTemplate(options = {}) {
|
|
11421
11627
|
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>`;
|
|
@@ -11425,13 +11631,15 @@ const template$b = sliderTemplate({
|
|
|
11425
11631
|
});
|
|
11426
11632
|
|
|
11427
11633
|
const definition$b = Slider.compose({
|
|
11428
|
-
name:
|
|
11634
|
+
name: tagName$b,
|
|
11429
11635
|
template: template$b,
|
|
11430
11636
|
styles: styles$b
|
|
11431
11637
|
});
|
|
11432
11638
|
|
|
11433
11639
|
definition$b.define(FluentDesignSystem.registry);
|
|
11434
11640
|
|
|
11641
|
+
const tagName$a = `${FluentDesignSystem.prefix}-spinner`;
|
|
11642
|
+
|
|
11435
11643
|
class BaseSpinner extends FASTElement {
|
|
11436
11644
|
constructor() {
|
|
11437
11645
|
super();
|
|
@@ -11460,19 +11668,20 @@ __decorateClass$e([attr], Spinner.prototype, "appearance", 2);
|
|
|
11460
11668
|
const styles$a = css`
|
|
11461
11669
|
${display("inline-flex")}
|
|
11462
11670
|
|
|
11463
|
-
:host{--duration:1.5s;--indicatorSize:${strokeWidthThicker};--size:32px;height:var(--size);width:var(--size);contain:strict;content-visibility:auto}:host([size='tiny']){--indicatorSize:${strokeWidthThick};--size:20px}:host([size='extra-small']){--indicatorSize:${strokeWidthThick};--size:24px}:host([size='small']){--indicatorSize:${strokeWidthThick};--size:28px}:host([size='large']){--indicatorSize:${strokeWidthThicker};--size:36px}:host([size='extra-large']){--indicatorSize:${strokeWidthThicker};--size:40px}:host([size='huge']){--indicatorSize:${strokeWidthThickest};--size:44px}.progress,.background,.spinner,.start,.end,.indicator{position:absolute;inset:0}.progress,.spinner,.indicator{animation:none var(--duration) infinite ${curveEasyEase}}.progress{animation-timing-function:linear;animation-name:spin-linear}.background{border:var(--indicatorSize) solid ${colorBrandStroke2};border-radius:50%}:host([appearance='inverted']) .background{border-color:rgba(255,255,255,0.2)}.spinner{animation-name:spin-swing}.start{overflow:hidden;right:50%}.end{overflow:hidden;left:50%}.indicator{color:${colorBrandStroke1};box-sizing:border-box;border-radius:50%;border:var(--indicatorSize) solid transparent;border-block-start-color:currentcolor;border-right-color:currentcolor}:host([appearance='inverted']) .indicator{color:${colorNeutralStrokeOnBrand2}}.start .indicator{rotate:135deg;inset:0 -100% 0 0;animation-name:spin-start}.end .indicator{rotate:135deg;inset:0 0 0 -100%;animation-name:spin-end}@keyframes spin-linear{100%{transform:rotate(360deg)}}@keyframes spin-swing{0%{transform:rotate(-135deg)}50%{transform:rotate(0deg)}100%{transform:rotate(225deg)}}@keyframes spin-start{0%,100%{transform:rotate(0deg)}50%{transform:rotate(-80deg)}}@keyframes spin-end{0%,100%{transform:rotate(0deg)}50%{transform:rotate(70deg)}}
|
|
11464
|
-
.background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-right-color:Highlight}`));
|
|
11671
|
+
:host{--duration:1.5s;--indicatorSize:${strokeWidthThicker};--size:32px;height:var(--size);width:var(--size);contain:strict;content-visibility:auto}:host([size='tiny']){--indicatorSize:${strokeWidthThick};--size:20px}:host([size='extra-small']){--indicatorSize:${strokeWidthThick};--size:24px}:host([size='small']){--indicatorSize:${strokeWidthThick};--size:28px}:host([size='large']){--indicatorSize:${strokeWidthThicker};--size:36px}:host([size='extra-large']){--indicatorSize:${strokeWidthThicker};--size:40px}:host([size='huge']){--indicatorSize:${strokeWidthThickest};--size:44px}.progress,.background,.spinner,.start,.end,.indicator{position:absolute;inset:0}.progress,.spinner,.indicator{animation:none var(--duration) infinite ${curveEasyEase}}.progress{animation-timing-function:linear;animation-name:spin-linear}.background{border:var(--indicatorSize) solid ${colorBrandStroke2};border-radius:50%}:host([appearance='inverted']) .background{border-color:rgba(255,255,255,0.2)}.spinner{animation-name:spin-swing}.start{overflow:hidden;right:50%}.end{overflow:hidden;left:50%}.indicator{color:${colorBrandStroke1};box-sizing:border-box;border-radius:50%;border:var(--indicatorSize) solid transparent;border-block-start-color:currentcolor;border-right-color:currentcolor}:host([appearance='inverted']) .indicator{color:${colorNeutralStrokeOnBrand2}}.start .indicator{rotate:135deg;inset:0 -100% 0 0;animation-name:spin-start}.end .indicator{rotate:135deg;inset:0 0 0 -100%;animation-name:spin-end}@keyframes spin-linear{100%{transform:rotate(360deg)}}@keyframes spin-swing{0%{transform:rotate(-135deg)}50%{transform:rotate(0deg)}100%{transform:rotate(225deg)}}@keyframes spin-start{0%,100%{transform:rotate(0deg)}50%{transform:rotate(-80deg)}}@keyframes spin-end{0%,100%{transform:rotate(0deg)}50%{transform:rotate(70deg)}}@media (forced-colors:active){.background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-right-color:Highlight}}`;
|
|
11465
11672
|
|
|
11466
11673
|
const template$a = html`<slot name="indicator"><div class="background"></div><div class="progress"><div class="spinner"><div class="start"><div class="indicator"></div></div><div class="end"><div class="indicator"></div></div></div></div></slot>`;
|
|
11467
11674
|
|
|
11468
11675
|
const definition$a = Spinner.compose({
|
|
11469
|
-
name:
|
|
11676
|
+
name: tagName$a,
|
|
11470
11677
|
template: template$a,
|
|
11471
11678
|
styles: styles$a
|
|
11472
11679
|
});
|
|
11473
11680
|
|
|
11474
11681
|
definition$a.define(FluentDesignSystem.registry);
|
|
11475
11682
|
|
|
11683
|
+
const tagName$9 = `${FluentDesignSystem.prefix}-switch`;
|
|
11684
|
+
|
|
11476
11685
|
class Switch extends BaseCheckbox {
|
|
11477
11686
|
constructor() {
|
|
11478
11687
|
super();
|
|
@@ -11490,17 +11699,24 @@ const template$9 = switchTemplate({
|
|
|
11490
11699
|
const styles$9 = css`
|
|
11491
11700
|
${display("inline-flex")}
|
|
11492
11701
|
|
|
11493
|
-
: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}}
|
|
11494
|
-
: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}`));
|
|
11702
|
+
: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}}@media (forced-colors:active){: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}}`;
|
|
11495
11703
|
|
|
11496
11704
|
const definition$9 = Switch.compose({
|
|
11497
|
-
name:
|
|
11705
|
+
name: tagName$9,
|
|
11498
11706
|
template: template$9,
|
|
11499
11707
|
styles: styles$9
|
|
11500
11708
|
});
|
|
11501
11709
|
|
|
11502
11710
|
definition$9.define(FluentDesignSystem.registry);
|
|
11503
11711
|
|
|
11712
|
+
function isTab(element, tagName2 = "-tab") {
|
|
11713
|
+
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
11714
|
+
return false;
|
|
11715
|
+
}
|
|
11716
|
+
return element.tagName.toLowerCase().endsWith(tagName2);
|
|
11717
|
+
}
|
|
11718
|
+
const tagName$8 = `${FluentDesignSystem.prefix}-tab`;
|
|
11719
|
+
|
|
11504
11720
|
var __defProp$d = Object.defineProperty;
|
|
11505
11721
|
var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
|
|
11506
11722
|
var __decorateClass$d = (decorators, target, key, kind) => {
|
|
@@ -11520,12 +11736,13 @@ class Tab extends FASTElement {
|
|
|
11520
11736
|
this.elementInternals = this.attachInternals();
|
|
11521
11737
|
this.elementInternals.role = "tab";
|
|
11522
11738
|
}
|
|
11739
|
+
disabledChanged(prev, next) {
|
|
11740
|
+
this.setDisabledSideEffect(next);
|
|
11741
|
+
}
|
|
11523
11742
|
connectedCallback() {
|
|
11524
11743
|
super.connectedCallback();
|
|
11525
11744
|
this.slot || (this.slot = "tab");
|
|
11526
|
-
|
|
11527
|
-
this.setAttribute("aria-disabled", "true");
|
|
11528
|
-
}
|
|
11745
|
+
this.setDisabledSideEffect(this.disabled);
|
|
11529
11746
|
if (this.styles) {
|
|
11530
11747
|
this.$fastController.removeStyles(this.styles);
|
|
11531
11748
|
}
|
|
@@ -11533,6 +11750,14 @@ class Tab extends FASTElement {
|
|
|
11533
11750
|
:host{--textContent:'${this.textContent}'}`;
|
|
11534
11751
|
this.$fastController.addStyles(this.styles);
|
|
11535
11752
|
}
|
|
11753
|
+
setDisabledSideEffect(disabled) {
|
|
11754
|
+
if (disabled) {
|
|
11755
|
+
this.setAttribute("aria-disabled", "true");
|
|
11756
|
+
} else {
|
|
11757
|
+
this.removeAttribute("aria-disabled");
|
|
11758
|
+
}
|
|
11759
|
+
this.tabIndex = disabled && this.getAttribute("aria-selected") !== "true" ? -1 : 0;
|
|
11760
|
+
}
|
|
11536
11761
|
}
|
|
11537
11762
|
__decorateClass$d([attr({
|
|
11538
11763
|
mode: "boolean"
|
|
@@ -11540,46 +11765,29 @@ __decorateClass$d([attr({
|
|
|
11540
11765
|
applyMixins(Tab, StartEnd);
|
|
11541
11766
|
|
|
11542
11767
|
function tabTemplate(options = {}) {
|
|
11543
|
-
return html`<template slot="tab" role="tab"
|
|
11768
|
+
return html`<template slot="tab" role="tab">${startSlotTemplate(options)}<span class="tab-content"><slot></slot></span>${endSlotTemplate(options)}</template>`;
|
|
11544
11769
|
}
|
|
11545
11770
|
const template$8 = tabTemplate({});
|
|
11546
11771
|
|
|
11547
11772
|
const styles$8 = css`
|
|
11548
11773
|
${display("inline-flex")}
|
|
11549
11774
|
|
|
11550
|
-
: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}
|
|
11551
|
-
:host([aria-selected='true'])::after{background-color:Highlight}`));
|
|
11775
|
+
: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}@supports (anchor-name:--a) and (text-size-adjust:auto){:host([aria-selected='true'])::after{background-color:transparent}:host([aria-selected='true']:hover)::after{background-color:${colorNeutralStroke1Hover}}}: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};pointer-events:none}: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}@media (forced-colors:active){:host([aria-selected='true'])::after{background-color:Highlight}}`;
|
|
11552
11776
|
|
|
11553
11777
|
const definition$8 = Tab.compose({
|
|
11554
|
-
name:
|
|
11778
|
+
name: tagName$8,
|
|
11555
11779
|
template: template$8,
|
|
11556
11780
|
styles: styles$8
|
|
11557
11781
|
});
|
|
11558
11782
|
|
|
11559
11783
|
definition$8.define(FluentDesignSystem.registry);
|
|
11560
11784
|
|
|
11561
|
-
function isTab(element, tagName = "-tab") {
|
|
11562
|
-
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
11563
|
-
return false;
|
|
11564
|
-
}
|
|
11565
|
-
return element.tagName.toLowerCase().endsWith(tagName);
|
|
11566
|
-
}
|
|
11567
|
-
|
|
11568
|
-
const isARIADisabledElement = el => {
|
|
11569
|
-
return el.getAttribute("aria-disabled") === "true" || el.elementInternals?.ariaDisabled === "true";
|
|
11570
|
-
};
|
|
11571
|
-
const isHiddenElement = el => {
|
|
11572
|
-
return el.hasAttribute("hidden");
|
|
11573
|
-
};
|
|
11574
|
-
const isFocusableElement = el => {
|
|
11575
|
-
return !isARIADisabledElement(el) && !isHiddenElement(el);
|
|
11576
|
-
};
|
|
11577
|
-
|
|
11578
11785
|
const TablistAppearance = {
|
|
11579
11786
|
subtle: "subtle",
|
|
11580
11787
|
transparent: "transparent"
|
|
11581
11788
|
};
|
|
11582
11789
|
const TablistOrientation = Orientation;
|
|
11790
|
+
const tagName$7 = `${FluentDesignSystem.prefix}-tablist`;
|
|
11583
11791
|
|
|
11584
11792
|
var __defProp$c = Object.defineProperty;
|
|
11585
11793
|
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
@@ -11600,84 +11808,23 @@ class BaseTablist extends FASTElement {
|
|
|
11600
11808
|
this.elementInternals = this.attachInternals();
|
|
11601
11809
|
this.disabled = false;
|
|
11602
11810
|
this.orientation = TablistOrientation.horizontal;
|
|
11603
|
-
this.
|
|
11604
|
-
this.activeTabIndex = 0;
|
|
11811
|
+
this.tabs = [];
|
|
11605
11812
|
this.tabPanelMap = /* @__PURE__ */new WeakMap();
|
|
11606
|
-
this.change = () => {
|
|
11607
|
-
this.$emit("change", this.activetab);
|
|
11608
|
-
};
|
|
11609
|
-
this.handleTabClick = event => {
|
|
11610
|
-
const selectedTab = event.currentTarget;
|
|
11611
|
-
if (selectedTab.disabled || this.disabled) {
|
|
11612
|
-
return;
|
|
11613
|
-
}
|
|
11614
|
-
if (selectedTab.nodeType === Node.ELEMENT_NODE && isFocusableElement(selectedTab)) {
|
|
11615
|
-
this.prevActiveTabIndex = this.activeTabIndex;
|
|
11616
|
-
this.activeTabIndex = this.tabs.indexOf(selectedTab);
|
|
11617
|
-
this.setComponent();
|
|
11618
|
-
}
|
|
11619
|
-
};
|
|
11620
|
-
this.handleTabKeyDown = event => {
|
|
11621
|
-
if (this.disabled) {
|
|
11622
|
-
return;
|
|
11623
|
-
}
|
|
11624
|
-
const dir = getDirection(this);
|
|
11625
|
-
switch (event.key) {
|
|
11626
|
-
case keyArrowLeft:
|
|
11627
|
-
if (!this.isHorizontal()) {
|
|
11628
|
-
return;
|
|
11629
|
-
}
|
|
11630
|
-
event.preventDefault();
|
|
11631
|
-
this.adjust(dir === "ltr" ? -1 : 1);
|
|
11632
|
-
break;
|
|
11633
|
-
case keyArrowRight:
|
|
11634
|
-
if (!this.isHorizontal()) {
|
|
11635
|
-
return;
|
|
11636
|
-
}
|
|
11637
|
-
event.preventDefault();
|
|
11638
|
-
this.adjust(dir === "ltr" ? 1 : -1);
|
|
11639
|
-
break;
|
|
11640
|
-
case keyArrowUp:
|
|
11641
|
-
if (this.isHorizontal()) {
|
|
11642
|
-
return;
|
|
11643
|
-
}
|
|
11644
|
-
event.preventDefault();
|
|
11645
|
-
this.adjust(-1);
|
|
11646
|
-
break;
|
|
11647
|
-
case keyArrowDown:
|
|
11648
|
-
if (this.isHorizontal()) {
|
|
11649
|
-
return;
|
|
11650
|
-
}
|
|
11651
|
-
event.preventDefault();
|
|
11652
|
-
this.adjust(1);
|
|
11653
|
-
break;
|
|
11654
|
-
case keyHome:
|
|
11655
|
-
event.preventDefault();
|
|
11656
|
-
this.adjust(-this.activeTabIndex);
|
|
11657
|
-
break;
|
|
11658
|
-
case keyEnd:
|
|
11659
|
-
event.preventDefault();
|
|
11660
|
-
this.adjust(this.tabs.filter(t => isFocusableElement(t)).length - this.activeTabIndex - 1);
|
|
11661
|
-
break;
|
|
11662
|
-
}
|
|
11813
|
+
this.change = () => {
|
|
11814
|
+
this.$emit("change", this.activetab);
|
|
11663
11815
|
};
|
|
11664
11816
|
this.elementInternals.role = "tablist";
|
|
11665
11817
|
this.elementInternals.ariaOrientation = this.orientation ?? TablistOrientation.horizontal;
|
|
11666
11818
|
}
|
|
11667
|
-
/**
|
|
11668
|
-
* Handles disabled changes
|
|
11669
|
-
* @param prev - previous value
|
|
11670
|
-
* @param next - next value
|
|
11671
|
-
*
|
|
11672
|
-
* @internal
|
|
11673
|
-
*/
|
|
11819
|
+
/** @internal */
|
|
11674
11820
|
disabledChanged(prev, next) {
|
|
11675
|
-
|
|
11676
|
-
|
|
11821
|
+
if (this.elementInternals) {
|
|
11822
|
+
toggleState(this.elementInternals, "disabled", next);
|
|
11823
|
+
}
|
|
11824
|
+
this.setTabs({
|
|
11825
|
+
forceDisabled: true
|
|
11826
|
+
});
|
|
11677
11827
|
}
|
|
11678
|
-
/**
|
|
11679
|
-
* @internal
|
|
11680
|
-
*/
|
|
11681
11828
|
orientationChanged(prev, next) {
|
|
11682
11829
|
if (this.elementInternals) {
|
|
11683
11830
|
this.elementInternals.ariaOrientation = next ?? TablistOrientation.horizontal;
|
|
@@ -11685,54 +11832,56 @@ class BaseTablist extends FASTElement {
|
|
|
11685
11832
|
}
|
|
11686
11833
|
this.setTabs();
|
|
11687
11834
|
}
|
|
11688
|
-
/**
|
|
11689
|
-
* @internal
|
|
11690
|
-
*/
|
|
11835
|
+
/** @internal */
|
|
11691
11836
|
activeidChanged(oldValue, newValue) {
|
|
11692
11837
|
if (this.tabs?.length > 0) {
|
|
11693
|
-
this.
|
|
11694
|
-
this.setTabs();
|
|
11695
|
-
if (oldValue) {
|
|
11696
|
-
const prevActiveTab = this.tabs[this.prevActiveTabIndex];
|
|
11697
|
-
const prevActivePanel = this.tabPanelMap.get(prevActiveTab);
|
|
11698
|
-
if (prevActivePanel) {
|
|
11699
|
-
prevActivePanel.hidden = true;
|
|
11700
|
-
}
|
|
11701
|
-
}
|
|
11702
|
-
if (newValue && this.activetab) {
|
|
11703
|
-
const activePanel = this.tabPanelMap.get(this.activetab);
|
|
11704
|
-
if (activePanel) {
|
|
11705
|
-
activePanel.hidden = false;
|
|
11706
|
-
}
|
|
11707
|
-
}
|
|
11708
|
-
if (oldValue !== newValue) {
|
|
11709
|
-
this.change();
|
|
11710
|
-
}
|
|
11838
|
+
this.changeTab(oldValue, newValue);
|
|
11711
11839
|
}
|
|
11712
11840
|
}
|
|
11713
|
-
/**
|
|
11714
|
-
* Updates the tabs property when content in the tabs slot changes.
|
|
11715
|
-
* @internal
|
|
11716
|
-
*/
|
|
11841
|
+
/** @internal */
|
|
11717
11842
|
slottedTabsChanged(prev, next) {
|
|
11718
11843
|
this.tabs = next?.filter(tab => isTab(tab)) ?? [];
|
|
11719
11844
|
}
|
|
11720
|
-
/**
|
|
11721
|
-
* @internal
|
|
11722
|
-
*/
|
|
11845
|
+
/** @internal */
|
|
11723
11846
|
tabsChanged(prev, next) {
|
|
11724
|
-
if (
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
tab.removeEventListener("keydown", this.handleTabKeyDown);
|
|
11847
|
+
if (this.tabs?.length > 0) {
|
|
11848
|
+
this.setTabs({
|
|
11849
|
+
connectToPanel: true
|
|
11728
11850
|
});
|
|
11729
11851
|
}
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
|
|
11852
|
+
}
|
|
11853
|
+
/**
|
|
11854
|
+
* Function that is invoked whenever the selected tab or the tab collection changes.
|
|
11855
|
+
*/
|
|
11856
|
+
setTabs({
|
|
11857
|
+
connectToPanel = false,
|
|
11858
|
+
forceDisabled = false
|
|
11859
|
+
} = {}) {
|
|
11860
|
+
if (!this.tabs) {
|
|
11861
|
+
return;
|
|
11862
|
+
}
|
|
11863
|
+
const hasStartSlot = this.tabs.some(tab => !!tab.querySelector("[slot='start']"));
|
|
11864
|
+
const rootNode = this.getRootNode();
|
|
11865
|
+
let firstEnabledTabId = "";
|
|
11866
|
+
for (const tab of this.tabs) {
|
|
11867
|
+
if (tab.slot !== "tab") {
|
|
11868
|
+
continue;
|
|
11869
|
+
}
|
|
11870
|
+
tab.id || (tab.id = uniqueId$1("tab-"));
|
|
11871
|
+
if (forceDisabled) {
|
|
11872
|
+
tab.disabled = this.disabled;
|
|
11873
|
+
} else {
|
|
11874
|
+
tab.disabled = tab.disabled || this.disabled;
|
|
11875
|
+
}
|
|
11876
|
+
if (!firstEnabledTabId && !tab.disabled) {
|
|
11877
|
+
firstEnabledTabId = tab.id;
|
|
11878
|
+
}
|
|
11879
|
+
const isSelected = this.activeid === tab.id;
|
|
11880
|
+
tab.toggleAttribute("focusgroupstart", isSelected);
|
|
11881
|
+
tab.setAttribute("aria-selected", isSelected.toString());
|
|
11882
|
+
tab.toggleAttribute("data-hasIndent", hasStartSlot && this.orientation === TablistOrientation.vertical);
|
|
11883
|
+
if (connectToPanel) {
|
|
11734
11884
|
const ariaControls = tab.getAttribute("aria-controls") ?? "";
|
|
11735
|
-
const rootNode = this.getRootNode();
|
|
11736
11885
|
const panel = rootNode.getElementById(ariaControls);
|
|
11737
11886
|
if (ariaControls && panel) {
|
|
11738
11887
|
panel.role ?? (panel.role = "tabpanel");
|
|
@@ -11741,84 +11890,43 @@ class BaseTablist extends FASTElement {
|
|
|
11741
11890
|
}
|
|
11742
11891
|
}
|
|
11743
11892
|
}
|
|
11893
|
+
if (!this.disabled) {
|
|
11894
|
+
if (this.activeid) {
|
|
11895
|
+
this.changeTab(void 0, this.activeid);
|
|
11896
|
+
} else if (firstEnabledTabId) {
|
|
11897
|
+
this.activeid = firstEnabledTabId;
|
|
11898
|
+
}
|
|
11899
|
+
}
|
|
11744
11900
|
}
|
|
11745
|
-
|
|
11746
|
-
|
|
11747
|
-
|
|
11748
|
-
|
|
11749
|
-
|
|
11750
|
-
return 0;
|
|
11901
|
+
/** @internal */
|
|
11902
|
+
handleFocusIn(event) {
|
|
11903
|
+
const target = event.target;
|
|
11904
|
+
if (!isTab(target) || target.disabled) {
|
|
11905
|
+
return;
|
|
11751
11906
|
}
|
|
11907
|
+
this.activeid = target.id;
|
|
11752
11908
|
}
|
|
11753
|
-
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
if (!tab.disabled) {
|
|
11766
|
-
this.disabled ? tab.setAttribute("aria-disabled", "true") : tab.removeAttribute("aria-disabled");
|
|
11767
|
-
}
|
|
11768
|
-
tab.setAttribute("id", tabId);
|
|
11769
|
-
tab.setAttribute("aria-selected", isActiveTab ? "true" : "false");
|
|
11770
|
-
tab.addEventListener("click", this.handleTabClick);
|
|
11771
|
-
tab.addEventListener("keydown", this.handleTabKeyDown);
|
|
11772
|
-
tab.setAttribute("tabindex", isActiveTab && !this.disabled ? "0" : "-1");
|
|
11773
|
-
if (isActiveTab) {
|
|
11774
|
-
this.activetab = tab;
|
|
11775
|
-
this.activeid = tabId;
|
|
11776
|
-
}
|
|
11777
|
-
if (hasStartSlot && this.orientation === TablistOrientation.vertical) {
|
|
11778
|
-
tab.setAttribute("data-hasIndent", "");
|
|
11779
|
-
}
|
|
11909
|
+
changeTab(oldId, newId) {
|
|
11910
|
+
const rootNode = this.getRootNode();
|
|
11911
|
+
const prevTab = oldId ? rootNode.getElementById(oldId) : null;
|
|
11912
|
+
const nextTab = rootNode.getElementById(newId);
|
|
11913
|
+
if (!isTab(nextTab) || !this.contains(nextTab)) {
|
|
11914
|
+
return;
|
|
11915
|
+
}
|
|
11916
|
+
if (prevTab) {
|
|
11917
|
+
prevTab.setAttribute("aria-selected", "false");
|
|
11918
|
+
const prevPanel = this.tabPanelMap.get(prevTab);
|
|
11919
|
+
if (prevPanel) {
|
|
11920
|
+
prevPanel.hidden = true;
|
|
11780
11921
|
}
|
|
11781
|
-
});
|
|
11782
|
-
}
|
|
11783
|
-
getTabIds() {
|
|
11784
|
-
return this.tabs?.map(tab => {
|
|
11785
|
-
return tab.getAttribute("id") ?? `tab-${uniqueId$1()}`;
|
|
11786
|
-
}) ?? [];
|
|
11787
|
-
}
|
|
11788
|
-
setComponent() {
|
|
11789
|
-
if (this.activeTabIndex !== this.prevActiveTabIndex) {
|
|
11790
|
-
this.activeid = this.tabIds[this.activeTabIndex];
|
|
11791
|
-
this.focusTab();
|
|
11792
11922
|
}
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
* @remarks
|
|
11801
|
-
* This method allows the active index to be adjusted by numerical increments
|
|
11802
|
-
*/
|
|
11803
|
-
adjust(adjustment) {
|
|
11804
|
-
const focusableTabs = this.tabs.filter(t => isFocusableElement(t));
|
|
11805
|
-
const currentActiveTabIndex = focusableTabs.indexOf(this.activetab);
|
|
11806
|
-
const nextTabIndex = wrapInBounds(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment);
|
|
11807
|
-
const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]);
|
|
11808
|
-
if (nextIndex > -1) {
|
|
11809
|
-
this.activateTabByIndex(this.tabs, nextIndex);
|
|
11810
|
-
}
|
|
11811
|
-
}
|
|
11812
|
-
activateTabByIndex(group, index) {
|
|
11813
|
-
const tab = group[index];
|
|
11814
|
-
this.activetab = tab;
|
|
11815
|
-
this.prevActiveTabIndex = this.activeTabIndex;
|
|
11816
|
-
this.activeTabIndex = index;
|
|
11817
|
-
tab.focus();
|
|
11818
|
-
this.setComponent();
|
|
11819
|
-
}
|
|
11820
|
-
focusTab() {
|
|
11821
|
-
this.tabs[this.activeTabIndex].focus();
|
|
11923
|
+
nextTab.setAttribute("aria-selected", "true");
|
|
11924
|
+
const nextPanel = this.tabPanelMap.get(nextTab);
|
|
11925
|
+
if (nextPanel) {
|
|
11926
|
+
nextPanel.hidden = false;
|
|
11927
|
+
}
|
|
11928
|
+
this.activetab = nextTab;
|
|
11929
|
+
this.change();
|
|
11822
11930
|
}
|
|
11823
11931
|
/**
|
|
11824
11932
|
* @internal
|
|
@@ -11826,7 +11934,6 @@ class BaseTablist extends FASTElement {
|
|
|
11826
11934
|
connectedCallback() {
|
|
11827
11935
|
super.connectedCallback();
|
|
11828
11936
|
waitForConnectedDescendants(this, () => {
|
|
11829
|
-
this.tabIds = this.getTabIds();
|
|
11830
11937
|
this.setTabs();
|
|
11831
11938
|
}, {
|
|
11832
11939
|
shallow: true
|
|
@@ -11852,154 +11959,41 @@ var __decorateClass$b = (decorators, target, key, kind) => {
|
|
|
11852
11959
|
class Tablist extends BaseTablist {
|
|
11853
11960
|
constructor() {
|
|
11854
11961
|
super(...arguments);
|
|
11855
|
-
/**
|
|
11856
|
-
* activeTabData
|
|
11857
|
-
* The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
|
|
11858
|
-
*/
|
|
11859
|
-
this.activeTabData = {
|
|
11860
|
-
x: 0,
|
|
11861
|
-
y: 0,
|
|
11862
|
-
height: 0,
|
|
11863
|
-
width: 0
|
|
11864
|
-
};
|
|
11865
|
-
/**
|
|
11866
|
-
* previousActiveTabData
|
|
11867
|
-
* The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
|
|
11868
|
-
*/
|
|
11869
|
-
this.previousActiveTabData = {
|
|
11870
|
-
x: 0,
|
|
11871
|
-
y: 0,
|
|
11872
|
-
height: 0,
|
|
11873
|
-
width: 0
|
|
11874
|
-
};
|
|
11875
|
-
/**
|
|
11876
|
-
* activeTabOffset
|
|
11877
|
-
* Used to position the active indicator for animations of the active indicator on active tab changes.
|
|
11878
|
-
*/
|
|
11879
|
-
this.activeTabOffset = 0;
|
|
11880
|
-
/**
|
|
11881
|
-
* activeTabScale
|
|
11882
|
-
* Used to scale the tab active indicator up or down as animations of the active indicator occur.
|
|
11883
|
-
*/
|
|
11884
|
-
this.activeTabScale = 1;
|
|
11885
11962
|
this.appearance = TablistAppearance.transparent;
|
|
11886
11963
|
}
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
* Recalculates the active tab offset and scale.
|
|
11891
|
-
* These values will be applied to css variables that control the tab active indicator position animations
|
|
11892
|
-
*/
|
|
11893
|
-
calculateAnimationProperties(tab) {
|
|
11894
|
-
this.activeTabOffset = this.getTabPosition(tab);
|
|
11895
|
-
this.activeTabScale = this.getTabScale(tab);
|
|
11896
|
-
}
|
|
11897
|
-
/**
|
|
11898
|
-
* getSelectedTabPosition - gets the x or y coordinates of the tab
|
|
11899
|
-
*/
|
|
11900
|
-
getTabPosition(tab) {
|
|
11901
|
-
if (this.orientation === TablistOrientation.horizontal) {
|
|
11902
|
-
return this.previousActiveTabData.x - (tab.getBoundingClientRect().x - this.getBoundingClientRect().x);
|
|
11903
|
-
} else return this.previousActiveTabData.y - (tab.getBoundingClientRect().y - this.getBoundingClientRect().y);
|
|
11904
|
-
}
|
|
11905
|
-
/**
|
|
11906
|
-
* getSelectedTabScale - gets the scale of the tab
|
|
11907
|
-
*/
|
|
11908
|
-
getTabScale(tab) {
|
|
11909
|
-
if (this.orientation === TablistOrientation.horizontal) {
|
|
11910
|
-
return this.previousActiveTabData.width / tab.getBoundingClientRect().width;
|
|
11911
|
-
} else return this.previousActiveTabData.height / tab.getBoundingClientRect().height;
|
|
11912
|
-
}
|
|
11913
|
-
/**
|
|
11914
|
-
* Calculates and applies updated values to CSS variables.
|
|
11915
|
-
*
|
|
11916
|
-
* @param tab - the tab element to apply the updated values to
|
|
11917
|
-
* @internal
|
|
11918
|
-
*/
|
|
11919
|
-
applyUpdatedCSSValues(tab) {
|
|
11920
|
-
this.calculateAnimationProperties(tab);
|
|
11921
|
-
this.setAnimationVars();
|
|
11922
|
-
}
|
|
11923
|
-
/**
|
|
11924
|
-
* Runs through all the operations required for setting the tab active indicator to its starting location, ending
|
|
11925
|
-
* location, and applying the animated css class to the tab.
|
|
11926
|
-
*
|
|
11927
|
-
* @param tab - the tab element to apply the updated values to
|
|
11928
|
-
* @internal
|
|
11929
|
-
*/
|
|
11930
|
-
animationLoop(tab) {
|
|
11931
|
-
tab.setAttribute("data-animate", "false");
|
|
11932
|
-
this.applyUpdatedCSSValues(tab);
|
|
11933
|
-
this.previousActiveTabData = this.activeTabData;
|
|
11934
|
-
this.applyUpdatedCSSValues(tab);
|
|
11935
|
-
tab.setAttribute("data-animate", "true");
|
|
11936
|
-
}
|
|
11937
|
-
/**
|
|
11938
|
-
* Sets the data from the active tab onto the class. used for making all the animation calculations for the active
|
|
11939
|
-
* tab indicator.
|
|
11940
|
-
*
|
|
11941
|
-
* @internal
|
|
11942
|
-
*/
|
|
11943
|
-
setTabData() {
|
|
11944
|
-
if (this.tabs && this.tabs.length > 0) {
|
|
11945
|
-
const tabs = this.tabs;
|
|
11946
|
-
const activeTab = this.activetab || tabs[0];
|
|
11947
|
-
const activeRect = activeTab?.getBoundingClientRect();
|
|
11948
|
-
const parentRect = this.getBoundingClientRect();
|
|
11949
|
-
this.activeTabData = {
|
|
11950
|
-
x: activeRect.x - parentRect.x,
|
|
11951
|
-
y: activeRect.y - parentRect.y,
|
|
11952
|
-
height: activeRect.height,
|
|
11953
|
-
width: activeRect.width
|
|
11954
|
-
};
|
|
11955
|
-
if (this.previousActiveTabData?.x !== this.activeTabData?.x && this.previousActiveTabData?.y !== this.activeTabData?.y) {
|
|
11956
|
-
this.previousActiveTabData = this.activeTabData;
|
|
11957
|
-
}
|
|
11958
|
-
}
|
|
11959
|
-
}
|
|
11960
|
-
/**
|
|
11961
|
-
* Sets the css variables for the active tab indicator.
|
|
11962
|
-
* @internal
|
|
11963
|
-
*/
|
|
11964
|
-
setAnimationVars() {
|
|
11965
|
-
this.style.setProperty("--tabIndicatorOffset", `${this.activeTabOffset}px`);
|
|
11966
|
-
this.style.setProperty("--tabIndicatorScale", `${this.activeTabScale}`);
|
|
11967
|
-
}
|
|
11968
|
-
/**
|
|
11969
|
-
* Initiates the active tab indicator animation loop when activeid changes.
|
|
11970
|
-
* @param oldValue - the previous tabId
|
|
11971
|
-
* @param newValue - the new tabId
|
|
11972
|
-
*/
|
|
11973
|
-
activeidChanged(oldValue, newValue) {
|
|
11974
|
-
super.activeidChanged(oldValue, newValue);
|
|
11975
|
-
this.setTabData();
|
|
11976
|
-
if (this.activetab) {
|
|
11977
|
-
this.animationLoop(this.activetab);
|
|
11978
|
-
}
|
|
11964
|
+
disconnectedCallback() {
|
|
11965
|
+
this.fg?.disconnect();
|
|
11966
|
+
super.disconnectedCallback();
|
|
11979
11967
|
}
|
|
11980
|
-
/**
|
|
11981
|
-
* Initiates the active tab indicator animation loop when tabs change.
|
|
11982
|
-
*/
|
|
11983
11968
|
tabsChanged(prev, next) {
|
|
11984
11969
|
super.tabsChanged(prev, next);
|
|
11985
|
-
this.
|
|
11986
|
-
if (this.
|
|
11987
|
-
this.
|
|
11970
|
+
this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.tabs?.filter(t => (t.getAttribute("aria-selected") === "true" || !t.disabled) && !t.hidden) ?? [], () => this.activetab ?? null));
|
|
11971
|
+
if (!this.fg) {
|
|
11972
|
+
this.fg = new FocusGroup(this, this.fgItems, {
|
|
11973
|
+
definition: {
|
|
11974
|
+
behavior: "tablist",
|
|
11975
|
+
axis: void 0,
|
|
11976
|
+
memory: false,
|
|
11977
|
+
wrap: true
|
|
11978
|
+
}
|
|
11979
|
+
});
|
|
11980
|
+
} else {
|
|
11981
|
+
this.fg.update();
|
|
11988
11982
|
}
|
|
11989
11983
|
}
|
|
11990
11984
|
}
|
|
11991
11985
|
__decorateClass$b([attr], Tablist.prototype, "appearance", 2);
|
|
11992
11986
|
__decorateClass$b([attr], Tablist.prototype, "size", 2);
|
|
11993
11987
|
|
|
11994
|
-
const template$7 = html`<template role="tablist"><slot name="tab" ${slotted("slottedTabs")}></slot></template>`;
|
|
11988
|
+
const template$7 = html`<template role="tablist" focusgroup="tablist inline block" @focusin="${(x, c) => x.handleFocusIn(c.event)}"><slot name="tab" ${slotted("slottedTabs")}></slot></template>`;
|
|
11995
11989
|
|
|
11996
11990
|
const styles$7 = css`
|
|
11997
11991
|
${display("flex")}
|
|
11998
11992
|
|
|
11999
|
-
:host{--tabPaddingInline
|
|
11993
|
+
:host{--tabPaddingInline:${spacingHorizontalMNudge};--tabPaddingBlock:${spacingHorizontalM};--tabIndicatorInsetInline:var(--tabPaddingInline);--tabIndicatorInsetBlock:0;box-sizing:border-box;color:${colorNeutralForeground2};flex-direction:row;position:relative}:host([size='small']){--tabPaddingBlock:${spacingVerticalSNudge};--tabPaddingInline:${spacingHorizontalSNudge}}:host([size='large']){--tabPaddingBlock:${spacingVerticalL};--tabPaddingInline:${spacingHorizontalMNudge}}:host([orientation='vertical']){--tabPaddingBlock:${spacingVerticalS};--tabIndicatorInsetBlock:${spacingVerticalS};flex-direction:column}:host([orientation='vertical'][size='small']){--tabPaddingBlock:${spacingVerticalXXS};--tabIndicatorInsetBlock:${spacingVerticalSNudge}}:host([orientation='vertical'][size='large']){--tabPaddingBlock:${spacingVerticalS};--tabIndicatorInsetBlock:${spacingVerticalMNudge}}::slotted([slot='tab']){padding-inline:var(--tabPaddingInline);padding-block:var(--tabPaddingBlock)}:host([orientation='vertical']) ::slotted([role='tab']){justify-content:flex-start}:host ::slotted([slot='tab'])::after{height:${strokeWidthThicker};margin-block-start:auto}:host([orientation='vertical']) ::slotted([slot='tab'])::after{width:${strokeWidthThicker};height:unset;margin-block-start:unset}: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([size='small']) ::slotted([slot='tab']){font-size:${fontSizeBase300};line-height:${lineHeightBase300}}:host([size='large']) ::slotted([slot='tab']){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([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([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}}@supports (anchor-name:--a) and (text-size-adjust:auto){::slotted([slot='tab'][aria-selected='true']){anchor-name:--tab}:host::after{background-color:${colorCompoundBrandStroke};content:'';inline-size:100%;inset:auto auto anchor(end) anchor(center);position:absolute;position-anchor:--tab;transform:translateX(-50%);transition-property:inset-inline,width;transition-duration:${durationSlow};transition-timing-function:${curveDecelerateMax};z-index:3;border-radius:${borderRadiusCircular};width:calc(anchor-size() - var(--tabIndicatorInsetInline) * 2);height:${strokeWidthThicker}}:host([orientation='vertical'])::after{inset:anchor(center) anchor(end) auto 0;transform:translateY(-50%);transition-property:inset-block,height;width:${strokeWidthThicker};height:calc(anchor-size() - var(--tabIndicatorInsetBlock) * 2)}:host(:dir(rtl)[orientation='vertical'])::after{inset:anchor(center) anchor(start) auto 0}:host([disabled])::after{background-color:${colorNeutralForegroundDisabled}}}`;
|
|
12000
11994
|
|
|
12001
11995
|
const definition$7 = Tablist.compose({
|
|
12002
|
-
name:
|
|
11996
|
+
name: tagName$7,
|
|
12003
11997
|
template: template$7,
|
|
12004
11998
|
styles: styles$7
|
|
12005
11999
|
});
|
|
@@ -12017,6 +12011,9 @@ const TextAreaResize = {
|
|
|
12017
12011
|
horizontal: "horizontal",
|
|
12018
12012
|
vertical: "vertical"
|
|
12019
12013
|
};
|
|
12014
|
+
const tagName$6 = `${FluentDesignSystem.prefix}-textarea`;
|
|
12015
|
+
|
|
12016
|
+
const whitespaceFilter = value => value.nodeType !== Node.TEXT_NODE || !!value.nodeValue?.trim().length;
|
|
12020
12017
|
|
|
12021
12018
|
var __defProp$a = Object.defineProperty;
|
|
12022
12019
|
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
@@ -12507,8 +12504,7 @@ __decorateClass$9([attr], TextArea.prototype, "size", 2);
|
|
|
12507
12504
|
const styles$6 = css`
|
|
12508
12505
|
${display("inline-block")}
|
|
12509
12506
|
|
|
12510
|
-
:host{--font-size:${fontSizeBase300};--line-height:${lineHeightBase300};--padding-inline:${spacingHorizontalMNudge};--padding-block:${spacingVerticalSNudge};--min-block-size:52px;--block-size:var(--min-block-size);--inline-size:18rem;--border-width:${strokeWidthThin};--control-padding-inline:${spacingHorizontalXXS};--color:${colorNeutralForeground1};--background-color:${colorNeutralBackground1};--border-color:${colorNeutralStroke1};--border-block-end-color:${colorNeutralStrokeAccessible};--placeholder-color:${colorNeutralForeground4};--focus-indicator-color:${colorCompoundBrandStroke};--box-shadow:none;--contain-size:size;--resize:none;color:var(--color);font-family:${fontFamilyBase};font-size:var(--font-size);font-weight:${fontWeightRegular};line-height:var(--line-height);position:relative}:host(:hover){--border-color:${colorNeutralStroke1Hover};--border-block-end-color:${colorNeutralStrokeAccessibleHover}}:host(:active){--border-color:${colorNeutralStroke1Pressed};--border-block-end-color:${colorNeutralStrokeAccessiblePressed}}:host(:focus-within){outline:none}:host([block]:not([hidden])){display:block}:host([size='small']){--font-size:${fontSizeBase200};--line-height:${lineHeightBase200};--min-block-size:40px;--padding-block:${spacingVerticalXS};--padding-inline:${spacingHorizontalSNudge};--control-padding-inline:${spacingHorizontalXXS}}:host([size='large']){--font-size:${fontSizeBase400};--line-height:${lineHeightBase400};--min-block-size:64px;--padding-block:${spacingVerticalS};--padding-inline:${spacingHorizontalM};--control-padding-inline:${spacingHorizontalSNudge}}:host([resize='both']:not(:disabled)){--resize:both}:host([resize='horizontal']:not(:disabled)){--resize:horizontal}:host([resize='vertical']:not(:disabled)){--resize:vertical}:host([auto-resize]){--block-size:auto;--contain-size:inline-size}:host([appearance='filled-darker']){--background-color:${colorNeutralBackground3};--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-lighter']){--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-darker'][display-shadow]),:host([appearance='filled-lighter'][display-shadow]){--box-shadow:${shadow2}}:host(${userInvalidState}){--border-color:${colorPaletteRedBorder2};--border-block-end-color:${colorPaletteRedBorder2}}:host(:disabled){--color:${colorNeutralForegroundDisabled};--background-color:${colorTransparentBackground};--border-color:${colorNeutralStrokeDisabled};--border-block-end-color:var(--border-color);--box-shadow:none;--placeholder-color:${colorNeutralForegroundDisabled};cursor:no-drop;user-select:none}.root{background-color:var(--background-color);border:var(--border-width) solid var(--border-color);border-block-end-color:var(--border-block-end-color);border-radius:${borderRadiusMedium};box-sizing:border-box;box-shadow:var(--box-shadow);contain:paint layout style var(--contain-size);display:grid;grid-template:1fr / 1fr;inline-size:var(--inline-size);min-block-size:var(--min-block-size);block-size:var(--block-size);overflow:hidden;padding:var(--padding-block) var(--padding-inline);position:relative;resize:var(--resize)}:host([block]) .root{inline-size:auto}.root::after{border-bottom:2px solid var(--focus-indicator-color);border-radius:0 0 ${borderRadiusMedium} ${borderRadiusMedium};box-sizing:border-box;clip-path:inset(calc(100% - 2px) 1px 0px);content:'';height:max(2px,${borderRadiusMedium});inset:auto -1px 0;position:absolute;transform:scaleX(0);transition-delay:${curveAccelerateMid};transition-duration:${durationUltraFast};transition-property:transform}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${durationNormal};transition-delay:${curveDecelerateMid}}:host([readonly]) .root::after,:host(:disabled) .root::after{content:none}label{color:var(--color);display:flex;inline-size:fit-content;padding-block-end:${spacingVerticalXS};padding-inline-end:${spacingHorizontalXS}}:host(:empty) label,label[hidden]{display:none}.auto-sizer,.control{box-sizing:border-box;font:inherit;grid-column:1 / -1;grid-row:1 / -1;letter-space:inherit;padding:0 var(--control-padding-inline)}.auto-sizer{display:none;padding-block-end:2px;pointer-events:none;visibility:hidden;white-space:pre-wrap}:host([auto-resize]) .auto-sizer{display:block}.control{appearance:none;background-color:transparent;border:0;color:inherit;field-sizing:content;max-block-size:100%;outline:0;resize:none;text-align:inherit}.control:disabled{cursor:inherit}.control::placeholder{color:var(--placeholder-color)}::selection{color:${colorNeutralForegroundInverted};background-color:${colorNeutralBackgroundInverted}}
|
|
12511
|
-
: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}`));
|
|
12507
|
+
:host{--font-size:${fontSizeBase300};--line-height:${lineHeightBase300};--padding-inline:${spacingHorizontalMNudge};--padding-block:${spacingVerticalSNudge};--min-block-size:52px;--block-size:var(--min-block-size);--inline-size:18rem;--border-width:${strokeWidthThin};--control-padding-inline:${spacingHorizontalXXS};--color:${colorNeutralForeground1};--background-color:${colorNeutralBackground1};--border-color:${colorNeutralStroke1};--border-block-end-color:${colorNeutralStrokeAccessible};--placeholder-color:${colorNeutralForeground4};--focus-indicator-color:${colorCompoundBrandStroke};--box-shadow:none;--contain-size:size;--resize:none;color:var(--color);font-family:${fontFamilyBase};font-size:var(--font-size);font-weight:${fontWeightRegular};line-height:var(--line-height);position:relative}:host(:hover){--border-color:${colorNeutralStroke1Hover};--border-block-end-color:${colorNeutralStrokeAccessibleHover}}:host(:active){--border-color:${colorNeutralStroke1Pressed};--border-block-end-color:${colorNeutralStrokeAccessiblePressed}}:host(:focus-within){outline:none}:host([block]:not([hidden])){display:block}:host([size='small']){--font-size:${fontSizeBase200};--line-height:${lineHeightBase200};--min-block-size:40px;--padding-block:${spacingVerticalXS};--padding-inline:${spacingHorizontalSNudge};--control-padding-inline:${spacingHorizontalXXS}}:host([size='large']){--font-size:${fontSizeBase400};--line-height:${lineHeightBase400};--min-block-size:64px;--padding-block:${spacingVerticalS};--padding-inline:${spacingHorizontalM};--control-padding-inline:${spacingHorizontalSNudge}}:host([resize='both']:not(:disabled)){--resize:both}:host([resize='horizontal']:not(:disabled)){--resize:horizontal}:host([resize='vertical']:not(:disabled)){--resize:vertical}:host([auto-resize]){--block-size:auto;--contain-size:inline-size}:host([appearance='filled-darker']){--background-color:${colorNeutralBackground3};--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-lighter']){--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-darker'][display-shadow]),:host([appearance='filled-lighter'][display-shadow]){--box-shadow:${shadow2}}:host(${userInvalidState}){--border-color:${colorPaletteRedBorder2};--border-block-end-color:${colorPaletteRedBorder2}}:host(:disabled){--color:${colorNeutralForegroundDisabled};--background-color:${colorTransparentBackground};--border-color:${colorNeutralStrokeDisabled};--border-block-end-color:var(--border-color);--box-shadow:none;--placeholder-color:${colorNeutralForegroundDisabled};cursor:no-drop;user-select:none}.root{background-color:var(--background-color);border:var(--border-width) solid var(--border-color);border-block-end-color:var(--border-block-end-color);border-radius:${borderRadiusMedium};box-sizing:border-box;box-shadow:var(--box-shadow);contain:paint layout style var(--contain-size);display:grid;grid-template:1fr / 1fr;inline-size:var(--inline-size);min-block-size:var(--min-block-size);block-size:var(--block-size);overflow:hidden;padding:var(--padding-block) var(--padding-inline);position:relative;resize:var(--resize)}:host([block]) .root{inline-size:auto}.root::after{border-bottom:2px solid var(--focus-indicator-color);border-radius:0 0 ${borderRadiusMedium} ${borderRadiusMedium};box-sizing:border-box;clip-path:inset(calc(100% - 2px) 1px 0px);content:'';height:max(2px,${borderRadiusMedium});inset:auto -1px 0;position:absolute;transform:scaleX(0);transition-delay:${curveAccelerateMid};transition-duration:${durationUltraFast};transition-property:transform}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${durationNormal};transition-delay:${curveDecelerateMid}}:host([readonly]) .root::after,:host(:disabled) .root::after{content:none}label{color:var(--color);display:flex;inline-size:fit-content;padding-block-end:${spacingVerticalXS};padding-inline-end:${spacingHorizontalXS}}:host(:empty) label,label[hidden]{display:none}.auto-sizer,.control{box-sizing:border-box;font:inherit;grid-column:1 / -1;grid-row:1 / -1;letter-space:inherit;padding:0 var(--control-padding-inline)}.auto-sizer{display:none;padding-block-end:2px;pointer-events:none;visibility:hidden;white-space:pre-wrap}:host([auto-resize]) .auto-sizer{display:block}.control{appearance:none;background-color:transparent;border:0;color:inherit;field-sizing:content;max-block-size:100%;outline:0;resize:none;text-align:inherit}.control:disabled{cursor:inherit}.control::placeholder{color:var(--placeholder-color)}::selection{color:${colorNeutralForegroundInverted};background-color:${colorNeutralBackgroundInverted}}@media (forced-colors:active){: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}}`;
|
|
12512
12508
|
|
|
12513
12509
|
function textAreaTemplate() {
|
|
12514
12510
|
return html`<template><label ${ref("labelEl")} for="control" part="label"><slot name="label" ${slotted("labelSlottedNodes")}></slot></label><div class="root" part="root" ${ref("rootEl")}><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>`;
|
|
@@ -12516,7 +12512,7 @@ function textAreaTemplate() {
|
|
|
12516
12512
|
const template$6 = textAreaTemplate();
|
|
12517
12513
|
|
|
12518
12514
|
const definition$6 = TextArea.compose({
|
|
12519
|
-
name:
|
|
12515
|
+
name: tagName$6,
|
|
12520
12516
|
template: template$6,
|
|
12521
12517
|
styles: styles$6,
|
|
12522
12518
|
shadowOptions: {
|
|
@@ -12534,6 +12530,7 @@ const TextInputType = {
|
|
|
12534
12530
|
url: "url"
|
|
12535
12531
|
};
|
|
12536
12532
|
const ImplicitSubmissionBlockingTypes = ["date", "datetime-local", "email", "month", "number", "password", "search", "tel", "text", "time", "url", "week"];
|
|
12533
|
+
const tagName$5 = `${FluentDesignSystem.prefix}-text-input`;
|
|
12537
12534
|
|
|
12538
12535
|
var __defProp$8 = Object.defineProperty;
|
|
12539
12536
|
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
@@ -12957,7 +12954,7 @@ function textInputTemplate(options = {}) {
|
|
|
12957
12954
|
const template$5 = textInputTemplate();
|
|
12958
12955
|
|
|
12959
12956
|
const definition$5 = TextInput.compose({
|
|
12960
|
-
name:
|
|
12957
|
+
name: tagName$5,
|
|
12961
12958
|
template: template$5,
|
|
12962
12959
|
styles: styles$5,
|
|
12963
12960
|
shadowOptions: {
|
|
@@ -12967,6 +12964,8 @@ const definition$5 = TextInput.compose({
|
|
|
12967
12964
|
|
|
12968
12965
|
definition$5.define(FluentDesignSystem.registry);
|
|
12969
12966
|
|
|
12967
|
+
const tagName$4 = `${FluentDesignSystem.prefix}-text`;
|
|
12968
|
+
|
|
12970
12969
|
var __defProp$6 = Object.defineProperty;
|
|
12971
12970
|
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
12972
12971
|
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
@@ -13023,13 +13022,15 @@ const styles$4 = css`
|
|
|
13023
13022
|
const template$4 = html`<slot></slot>`;
|
|
13024
13023
|
|
|
13025
13024
|
const definition$4 = Text.compose({
|
|
13026
|
-
name:
|
|
13025
|
+
name: tagName$4,
|
|
13027
13026
|
template: template$4,
|
|
13028
13027
|
styles: styles$4
|
|
13029
13028
|
});
|
|
13030
13029
|
|
|
13031
13030
|
definition$4.define(FluentDesignSystem.registry);
|
|
13032
13031
|
|
|
13032
|
+
const tagName$3 = `${FluentDesignSystem.prefix}-toggle-button`;
|
|
13033
|
+
|
|
13033
13034
|
var __defProp$5 = Object.defineProperty;
|
|
13034
13035
|
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
13035
13036
|
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
@@ -13092,21 +13093,36 @@ __decorateClass$5([attr({
|
|
|
13092
13093
|
const styles$3 = css`
|
|
13093
13094
|
${styles$C}
|
|
13094
13095
|
|
|
13095
|
-
:host(${pressedState}){border-color:${colorNeutralStroke1};background-color:${colorNeutralBackground1Selected};color:${colorNeutralForeground1};border-width:${strokeWidthThin}}:host(${pressedState}:hover){border-color:${colorNeutralStroke1Hover};background-color:${colorNeutralBackground1Hover}}:host(${pressedState}:active){border-color:${colorNeutralStroke1Pressed};background-color:${colorNeutralBackground1Pressed}}:host(${pressedState}[appearance='primary']:not(:focus-visible)){border-color:transparent}:host(${pressedState}[appearance='primary']){background-color:${colorBrandBackgroundSelected};color:${colorNeutralForegroundOnBrand}}:host(${pressedState}[appearance='primary']:hover){background-color:${colorBrandBackgroundHover}}:host(${pressedState}[appearance='primary']:active){background-color:${colorBrandBackgroundPressed}}:host(${pressedState}[appearance='subtle']){border-color:transparent;background-color:${colorSubtleBackgroundSelected};color:${colorNeutralForeground2Selected}}:host(${pressedState}[appearance='subtle']:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground2Hover}}:host(${pressedState}[appearance='subtle']:active){background-color:${colorSubtleBackgroundPressed};color:${colorNeutralForeground2Pressed}}:host(${pressedState}[appearance='outline']),:host(${pressedState}[appearance='transparent']){background-color:${colorTransparentBackgroundSelected}}:host(${pressedState}[appearance='outline']:hover),:host(${pressedState}[appearance='transparent']:hover){background-color:${colorTransparentBackgroundHover}}:host(${pressedState}[appearance='outline']:active),:host(${pressedState}[appearance='transparent']:active){background-color:${colorTransparentBackgroundPressed}}:host(${pressedState}[appearance='transparent']){border-color:transparent;color:${colorNeutralForeground2BrandSelected}}:host(${pressedState}[appearance='transparent']:hover){color:${colorNeutralForeground2BrandHover}}:host(${pressedState}[appearance='transparent']:active){color:${colorNeutralForeground2BrandPressed}}
|
|
13096
|
-
:host(${pressedState}),:host(
|
|
13096
|
+
:host(${pressedState}){border-color:${colorNeutralStroke1};background-color:${colorNeutralBackground1Selected};color:${colorNeutralForeground1};border-width:${strokeWidthThin}}:host(${pressedState}:hover){border-color:${colorNeutralStroke1Hover};background-color:${colorNeutralBackground1Hover}}:host(${pressedState}:active){border-color:${colorNeutralStroke1Pressed};background-color:${colorNeutralBackground1Pressed}}:host(${pressedState}[appearance='primary']:not(:focus-visible)){border-color:transparent}:host(${pressedState}[appearance='primary']){background-color:${colorBrandBackgroundSelected};color:${colorNeutralForegroundOnBrand}}:host(${pressedState}[appearance='primary']:hover){background-color:${colorBrandBackgroundHover}}:host(${pressedState}[appearance='primary']:active){background-color:${colorBrandBackgroundPressed}}:host(${pressedState}[appearance='subtle']){border-color:transparent;background-color:${colorSubtleBackgroundSelected};color:${colorNeutralForeground2Selected}}:host(${pressedState}[appearance='subtle']:hover){background-color:${colorSubtleBackgroundHover};color:${colorNeutralForeground2Hover}}:host(${pressedState}[appearance='subtle']:active){background-color:${colorSubtleBackgroundPressed};color:${colorNeutralForeground2Pressed}}:host(${pressedState}[appearance='outline']),:host(${pressedState}[appearance='transparent']){background-color:${colorTransparentBackgroundSelected}}:host(${pressedState}[appearance='outline']:hover),:host(${pressedState}[appearance='transparent']:hover){background-color:${colorTransparentBackgroundHover}}:host(${pressedState}[appearance='outline']:active),:host(${pressedState}[appearance='transparent']:active){background-color:${colorTransparentBackgroundPressed}}:host(${pressedState}[appearance='transparent']){border-color:transparent;color:${colorNeutralForeground2BrandSelected}}:host(${pressedState}[appearance='transparent']:hover){color:${colorNeutralForeground2BrandHover}}:host(${pressedState}[appearance='transparent']:active){color:${colorNeutralForeground2BrandPressed}}@media (forced-colors:active){:host(${pressedState}),:host(
|
|
13097
13097
|
${pressedState}:is([appearance='primary'],[appearance='subtle'],[appearance='outline'],[appearance='transparent'])
|
|
13098
|
-
){background:SelectedItem;color:SelectedItemText}
|
|
13098
|
+
){background:SelectedItem;color:SelectedItemText}}`;
|
|
13099
13099
|
|
|
13100
13100
|
const template$3 = buttonTemplate$1();
|
|
13101
13101
|
|
|
13102
13102
|
const definition$3 = ToggleButton.compose({
|
|
13103
|
-
name:
|
|
13103
|
+
name: tagName$3,
|
|
13104
13104
|
template: template$3,
|
|
13105
13105
|
styles: styles$3
|
|
13106
13106
|
});
|
|
13107
13107
|
|
|
13108
13108
|
definition$3.define(FluentDesignSystem.registry);
|
|
13109
13109
|
|
|
13110
|
+
const TooltipPositioningOption = {
|
|
13111
|
+
"above-start": "block-start span-inline-end",
|
|
13112
|
+
above: "block-start",
|
|
13113
|
+
"above-end": "block-start span-inline-start",
|
|
13114
|
+
"below-start": "block-end span-inline-end",
|
|
13115
|
+
below: "block-end",
|
|
13116
|
+
"below-end": "block-end span-inline-start",
|
|
13117
|
+
"before-top": "inline-start span-block-end",
|
|
13118
|
+
before: "inline-start",
|
|
13119
|
+
"before-bottom": "inline-start span-block-start",
|
|
13120
|
+
"after-top": "inline-end span-block-end",
|
|
13121
|
+
after: "inline-end",
|
|
13122
|
+
"after-bottom": "inline-end span-block-start"
|
|
13123
|
+
};
|
|
13124
|
+
const tagName$2 = `${FluentDesignSystem.prefix}-tooltip`;
|
|
13125
|
+
|
|
13110
13126
|
var __defProp$4 = Object.defineProperty;
|
|
13111
13127
|
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
13112
13128
|
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
@@ -13200,7 +13216,7 @@ class Tooltip extends FASTElement {
|
|
|
13200
13216
|
}
|
|
13201
13217
|
/**
|
|
13202
13218
|
* Shows the tooltip
|
|
13203
|
-
* @param delay Number of milliseconds to delay showing the tooltip
|
|
13219
|
+
* @param delay - Number of milliseconds to delay showing the tooltip
|
|
13204
13220
|
* @internal
|
|
13205
13221
|
*/
|
|
13206
13222
|
showTooltip(delay = this.defaultDelay) {
|
|
@@ -13211,7 +13227,7 @@ class Tooltip extends FASTElement {
|
|
|
13211
13227
|
}
|
|
13212
13228
|
/**
|
|
13213
13229
|
* Hide the tooltip
|
|
13214
|
-
* @param delay Number of milliseconds to delay hiding the tooltip
|
|
13230
|
+
* @param delay - Number of milliseconds to delay hiding the tooltip
|
|
13215
13231
|
* @internal
|
|
13216
13232
|
*/
|
|
13217
13233
|
hideTooltip(delay = this.defaultDelay) {
|
|
@@ -13285,21 +13301,6 @@ __decorateClass$4([attr({
|
|
|
13285
13301
|
__decorateClass$4([attr], Tooltip.prototype, "positioning", 2);
|
|
13286
13302
|
__decorateClass$4([attr], Tooltip.prototype, "anchor", 2);
|
|
13287
13303
|
|
|
13288
|
-
const TooltipPositioningOption = {
|
|
13289
|
-
"above-start": "block-start span-inline-end",
|
|
13290
|
-
above: "block-start",
|
|
13291
|
-
"above-end": "block-start span-inline-start",
|
|
13292
|
-
"below-start": "block-end span-inline-end",
|
|
13293
|
-
below: "block-end",
|
|
13294
|
-
"below-end": "block-end span-inline-start",
|
|
13295
|
-
"before-top": "inline-start span-block-end",
|
|
13296
|
-
before: "inline-start",
|
|
13297
|
-
"before-bottom": "inline-start span-block-start",
|
|
13298
|
-
"after-top": "inline-end span-block-end",
|
|
13299
|
-
after: "inline-end",
|
|
13300
|
-
"after-bottom": "inline-end span-block-start"
|
|
13301
|
-
};
|
|
13302
|
-
|
|
13303
13304
|
const styles$2 = css`
|
|
13304
13305
|
${display("inline-flex")}
|
|
13305
13306
|
|
|
@@ -13308,13 +13309,15 @@ const styles$2 = css`
|
|
|
13308
13309
|
const template$2 = html`<template popover aria-hidden="true"><slot></slot></template>`;
|
|
13309
13310
|
|
|
13310
13311
|
const definition$2 = Tooltip.compose({
|
|
13311
|
-
name:
|
|
13312
|
+
name: tagName$2,
|
|
13312
13313
|
template: template$2,
|
|
13313
13314
|
styles: styles$2
|
|
13314
13315
|
});
|
|
13315
13316
|
|
|
13316
13317
|
definition$2.define(FluentDesignSystem.registry);
|
|
13317
13318
|
|
|
13319
|
+
const tagName$1 = `${FluentDesignSystem.prefix}-tree`;
|
|
13320
|
+
|
|
13318
13321
|
const TreeItemAppearance = {
|
|
13319
13322
|
subtle: "subtle",
|
|
13320
13323
|
subtleAlpha: "subtle-alpha",
|
|
@@ -13324,12 +13327,13 @@ const TreeItemSize = {
|
|
|
13324
13327
|
small: "small",
|
|
13325
13328
|
medium: "medium"
|
|
13326
13329
|
};
|
|
13327
|
-
function isTreeItem(element,
|
|
13330
|
+
function isTreeItem(element, tagName2 = "-tree-item") {
|
|
13328
13331
|
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
13329
13332
|
return false;
|
|
13330
13333
|
}
|
|
13331
|
-
return element.tagName.toLowerCase().endsWith(
|
|
13334
|
+
return element.tagName.toLowerCase().endsWith(tagName2);
|
|
13332
13335
|
}
|
|
13336
|
+
const tagName = `${FluentDesignSystem.prefix}-tree-item`;
|
|
13333
13337
|
|
|
13334
13338
|
var __defProp$3 = Object.defineProperty;
|
|
13335
13339
|
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
@@ -13343,12 +13347,6 @@ class BaseTree extends FASTElement {
|
|
|
13343
13347
|
constructor() {
|
|
13344
13348
|
super();
|
|
13345
13349
|
this.currentSelected = null;
|
|
13346
|
-
/**
|
|
13347
|
-
* The tree item that is designated to be in the tab queue.
|
|
13348
|
-
*
|
|
13349
|
-
* @internal
|
|
13350
|
-
*/
|
|
13351
|
-
this.currentFocused = null;
|
|
13352
13350
|
/**
|
|
13353
13351
|
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
13354
13352
|
*
|
|
@@ -13366,10 +13364,6 @@ class BaseTree extends FASTElement {
|
|
|
13366
13364
|
defaultSlotChanged() {
|
|
13367
13365
|
this.handleDefaultSlotChange();
|
|
13368
13366
|
}
|
|
13369
|
-
connectedCallback() {
|
|
13370
|
-
super.connectedCallback();
|
|
13371
|
-
this.tabIndex = Number(this.getAttribute("tabindex") ?? 0) < 0 ? -1 : 0;
|
|
13372
|
-
}
|
|
13373
13367
|
/** @internal */
|
|
13374
13368
|
childTreeItemsChanged() {
|
|
13375
13369
|
this.updateCurrentSelected();
|
|
@@ -13380,9 +13374,6 @@ class BaseTree extends FASTElement {
|
|
|
13380
13374
|
updateCurrentSelected() {
|
|
13381
13375
|
const selectedItem = this.querySelector(`[selected]`);
|
|
13382
13376
|
this.currentSelected = selectedItem;
|
|
13383
|
-
if (this.currentFocused === null || !this.contains(this.currentFocused)) {
|
|
13384
|
-
this.currentFocused = this.getValidFocusableItem();
|
|
13385
|
-
}
|
|
13386
13377
|
}
|
|
13387
13378
|
/**
|
|
13388
13379
|
* KeyDown handler
|
|
@@ -13397,22 +13388,7 @@ class BaseTree extends FASTElement {
|
|
|
13397
13388
|
if (!isTreeItem(item) || this.childTreeItems.length < 1) {
|
|
13398
13389
|
return true;
|
|
13399
13390
|
}
|
|
13400
|
-
const elements = this.getVisibleNodes();
|
|
13401
13391
|
switch (e.key) {
|
|
13402
|
-
case keyHome:
|
|
13403
|
-
{
|
|
13404
|
-
if (elements.length) {
|
|
13405
|
-
elements[0].focus();
|
|
13406
|
-
}
|
|
13407
|
-
return;
|
|
13408
|
-
}
|
|
13409
|
-
case keyEnd:
|
|
13410
|
-
{
|
|
13411
|
-
if (elements.length) {
|
|
13412
|
-
elements[elements.length - 1].focus();
|
|
13413
|
-
}
|
|
13414
|
-
return;
|
|
13415
|
-
}
|
|
13416
13392
|
case keyArrowLeft:
|
|
13417
13393
|
{
|
|
13418
13394
|
if (item?.childTreeItems?.length && item.expanded) {
|
|
@@ -13427,22 +13403,10 @@ class BaseTree extends FASTElement {
|
|
|
13427
13403
|
if (item?.childTreeItems?.length) {
|
|
13428
13404
|
if (!item.expanded) {
|
|
13429
13405
|
item.expanded = true;
|
|
13430
|
-
} else {
|
|
13431
|
-
this.focusNextNode(1, item);
|
|
13432
13406
|
}
|
|
13433
13407
|
}
|
|
13434
13408
|
return;
|
|
13435
13409
|
}
|
|
13436
|
-
case keyArrowDown:
|
|
13437
|
-
{
|
|
13438
|
-
this.focusNextNode(1, item);
|
|
13439
|
-
return;
|
|
13440
|
-
}
|
|
13441
|
-
case keyArrowUp:
|
|
13442
|
-
{
|
|
13443
|
-
this.focusNextNode(-1, item);
|
|
13444
|
-
return;
|
|
13445
|
-
}
|
|
13446
13410
|
case keyEnter:
|
|
13447
13411
|
{
|
|
13448
13412
|
this.clickHandler(e);
|
|
@@ -13456,38 +13420,6 @@ class BaseTree extends FASTElement {
|
|
|
13456
13420
|
}
|
|
13457
13421
|
return true;
|
|
13458
13422
|
}
|
|
13459
|
-
/**
|
|
13460
|
-
* Handle focus events
|
|
13461
|
-
*
|
|
13462
|
-
* @internal
|
|
13463
|
-
*/
|
|
13464
|
-
focusHandler(e) {
|
|
13465
|
-
if (this.childTreeItems.length < 1) {
|
|
13466
|
-
return;
|
|
13467
|
-
}
|
|
13468
|
-
if (e.target === this) {
|
|
13469
|
-
this.currentFocused = this.getValidFocusableItem();
|
|
13470
|
-
if (this.currentFocused && this.currentFocused.tabIndex < 0) {
|
|
13471
|
-
this.currentFocused.tabIndex = 0;
|
|
13472
|
-
}
|
|
13473
|
-
this.currentFocused?.focus();
|
|
13474
|
-
return;
|
|
13475
|
-
}
|
|
13476
|
-
if (this.contains(e.target)) {
|
|
13477
|
-
this.setAttribute("tabindex", "-1");
|
|
13478
|
-
this.currentFocused = e.target;
|
|
13479
|
-
}
|
|
13480
|
-
}
|
|
13481
|
-
/**
|
|
13482
|
-
* Handle blur events
|
|
13483
|
-
*
|
|
13484
|
-
* @internal
|
|
13485
|
-
*/
|
|
13486
|
-
blurHandler(e) {
|
|
13487
|
-
if (e.target instanceof HTMLElement && (e.relatedTarget === null || !this.contains(e.relatedTarget))) {
|
|
13488
|
-
this.setAttribute("tabindex", "0");
|
|
13489
|
-
}
|
|
13490
|
-
}
|
|
13491
13423
|
/**
|
|
13492
13424
|
* Handles click events bubbling up
|
|
13493
13425
|
*
|
|
@@ -13527,40 +13459,28 @@ class BaseTree extends FASTElement {
|
|
|
13527
13459
|
this.currentSelected = null;
|
|
13528
13460
|
}
|
|
13529
13461
|
}
|
|
13530
|
-
/**
|
|
13531
|
-
* checks if there are any nested tree items
|
|
13532
|
-
*/
|
|
13533
|
-
getValidFocusableItem() {
|
|
13534
|
-
const elements = this.getVisibleNodes();
|
|
13535
|
-
let focusIndex = elements.findIndex(el => el.selected);
|
|
13536
|
-
if (focusIndex === -1) {
|
|
13537
|
-
focusIndex = elements.findIndex(el => isTreeItem(el));
|
|
13538
|
-
}
|
|
13539
|
-
if (focusIndex !== -1) {
|
|
13540
|
-
return elements[focusIndex];
|
|
13541
|
-
}
|
|
13542
|
-
return null;
|
|
13543
|
-
}
|
|
13544
|
-
getVisibleNodes() {
|
|
13545
|
-
return Array.from(this.querySelectorAll("*")).filter(node => isTreeItem(node) && node.offsetParent !== null);
|
|
13546
|
-
}
|
|
13547
|
-
/**
|
|
13548
|
-
* Move focus to a tree item based on its offset from the provided item
|
|
13549
|
-
*/
|
|
13550
|
-
focusNextNode(delta, item) {
|
|
13551
|
-
const visibleNodes = this.getVisibleNodes();
|
|
13552
|
-
if (!visibleNodes.length) {
|
|
13553
|
-
return;
|
|
13554
|
-
}
|
|
13555
|
-
const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta];
|
|
13556
|
-
if (isHTMLElement(focusItem)) {
|
|
13557
|
-
focusItem.focus();
|
|
13558
|
-
}
|
|
13559
|
-
}
|
|
13560
13462
|
/** @internal */
|
|
13561
13463
|
handleDefaultSlotChange() {
|
|
13562
13464
|
this.childTreeItems = this.defaultSlot.assignedElements().filter(el => isTreeItem(el));
|
|
13563
13465
|
}
|
|
13466
|
+
/**
|
|
13467
|
+
* All descendant tree items in DOM order, recursively flattened from
|
|
13468
|
+
* `childTreeItems`.
|
|
13469
|
+
*/
|
|
13470
|
+
get descendantTreeItems() {
|
|
13471
|
+
const result = [];
|
|
13472
|
+
const visit = items => {
|
|
13473
|
+
if (!items) {
|
|
13474
|
+
return;
|
|
13475
|
+
}
|
|
13476
|
+
for (const item of items) {
|
|
13477
|
+
result.push(item);
|
|
13478
|
+
visit(item.childTreeItems);
|
|
13479
|
+
}
|
|
13480
|
+
};
|
|
13481
|
+
visit(this.childTreeItems);
|
|
13482
|
+
return result;
|
|
13483
|
+
}
|
|
13564
13484
|
}
|
|
13565
13485
|
__decorateClass$3([observable], BaseTree.prototype, "currentSelected", 2);
|
|
13566
13486
|
__decorateClass$3([observable], BaseTree.prototype, "defaultSlot", 2);
|
|
@@ -13593,6 +13513,22 @@ class Tree extends BaseTree {
|
|
|
13593
13513
|
childTreeItemsChanged() {
|
|
13594
13514
|
super.childTreeItemsChanged();
|
|
13595
13515
|
this.updateSizeAndAppearance();
|
|
13516
|
+
this.fgItems ?? (this.fgItems = new ArrayItemCollection(() => this.descendantTreeItems.filter(i => !i.isHidden), () => this.currentSelected ?? null));
|
|
13517
|
+
if (!this.fg) {
|
|
13518
|
+
this.fg = new FocusGroup(this, this.fgItems, {
|
|
13519
|
+
definition: {
|
|
13520
|
+
behavior: "menu",
|
|
13521
|
+
axis: "block",
|
|
13522
|
+
memory: false
|
|
13523
|
+
}
|
|
13524
|
+
});
|
|
13525
|
+
} else {
|
|
13526
|
+
this.fg.update();
|
|
13527
|
+
}
|
|
13528
|
+
}
|
|
13529
|
+
disconnectedCallback() {
|
|
13530
|
+
this.fg?.disconnect();
|
|
13531
|
+
super.disconnectedCallback();
|
|
13596
13532
|
}
|
|
13597
13533
|
/**
|
|
13598
13534
|
* 1. Update the child items' size based on the tree's size
|
|
@@ -13607,6 +13543,10 @@ class Tree extends BaseTree {
|
|
|
13607
13543
|
item.appearance = this.appearance;
|
|
13608
13544
|
});
|
|
13609
13545
|
}
|
|
13546
|
+
/** @internal */
|
|
13547
|
+
itemToggleHandler() {
|
|
13548
|
+
this.fg?.update();
|
|
13549
|
+
}
|
|
13610
13550
|
}
|
|
13611
13551
|
__decorateClass$2([attr], Tree.prototype, "size", 2);
|
|
13612
13552
|
__decorateClass$2([attr], Tree.prototype, "appearance", 2);
|
|
@@ -13616,10 +13556,10 @@ const styles$1 = css`
|
|
|
13616
13556
|
|
|
13617
13557
|
:host{outline:none}`;
|
|
13618
13558
|
|
|
13619
|
-
const template$1 = html`<template
|
|
13559
|
+
const template$1 = html`<template focusgroup="menu nowrap nomemory" @click="${(x, c) => x.clickHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}" @change="${(x, c) => x.changeHandler(c.event)}" @toggle="${(x, c) => x.itemToggleHandler()}"><slot ${ref("defaultSlot")} @slotchange="${x => x.handleDefaultSlotChange()}"></slot></template>`;
|
|
13620
13560
|
|
|
13621
13561
|
const definition$1 = Tree.compose({
|
|
13622
|
-
name:
|
|
13562
|
+
name: tagName$1,
|
|
13623
13563
|
template: template$1,
|
|
13624
13564
|
styles: styles$1
|
|
13625
13565
|
});
|
|
@@ -13672,6 +13612,20 @@ class BaseTreeItem extends FASTElement {
|
|
|
13672
13612
|
toggleState(this.elementInternals, "expanded", next);
|
|
13673
13613
|
if (this.childTreeItems && this.childTreeItems.length > 0) {
|
|
13674
13614
|
this.elementInternals.ariaExpanded = next ? "true" : "false";
|
|
13615
|
+
requestAnimationFrame(() => {
|
|
13616
|
+
const walker = document.createTreeWalker(this, NodeFilter.SHOW_ELEMENT, node => isTreeItem(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP);
|
|
13617
|
+
while (walker.nextNode()) {
|
|
13618
|
+
const item = walker.currentNode;
|
|
13619
|
+
if (next) {
|
|
13620
|
+
item.removeAttribute("focusgroup");
|
|
13621
|
+
} else {
|
|
13622
|
+
if (item.selected) {
|
|
13623
|
+
item.selected = false;
|
|
13624
|
+
}
|
|
13625
|
+
item.setAttribute("focusgroup", "none");
|
|
13626
|
+
}
|
|
13627
|
+
}
|
|
13628
|
+
});
|
|
13675
13629
|
}
|
|
13676
13630
|
}
|
|
13677
13631
|
/**
|
|
@@ -13682,7 +13636,6 @@ class BaseTreeItem extends FASTElement {
|
|
|
13682
13636
|
* @internal
|
|
13683
13637
|
*/
|
|
13684
13638
|
selectedChanged(prev, next) {
|
|
13685
|
-
this.updateTabindexBySelected();
|
|
13686
13639
|
this.$emit("change");
|
|
13687
13640
|
toggleState(this.elementInternals, "selected", next);
|
|
13688
13641
|
this.elementInternals.ariaSelected = next ? "true" : "false";
|
|
@@ -13704,12 +13657,6 @@ class BaseTreeItem extends FASTElement {
|
|
|
13704
13657
|
this.empty = this.childTreeItems?.length === 0;
|
|
13705
13658
|
this.updateChildTreeItems();
|
|
13706
13659
|
}
|
|
13707
|
-
connectedCallback() {
|
|
13708
|
-
super.connectedCallback();
|
|
13709
|
-
Updates.enqueue(() => {
|
|
13710
|
-
this.updateTabindexBySelected();
|
|
13711
|
-
});
|
|
13712
|
-
}
|
|
13713
13660
|
/**
|
|
13714
13661
|
* Updates the childrens indent
|
|
13715
13662
|
*
|
|
@@ -13744,14 +13691,25 @@ class BaseTreeItem extends FASTElement {
|
|
|
13744
13691
|
}
|
|
13745
13692
|
}
|
|
13746
13693
|
/**
|
|
13747
|
-
* Whether the tree is nested
|
|
13694
|
+
* Whether the tree item is nested
|
|
13748
13695
|
* @internal
|
|
13749
13696
|
*/
|
|
13750
13697
|
get isNestedItem() {
|
|
13751
13698
|
return isTreeItem(this.parentElement);
|
|
13752
13699
|
}
|
|
13753
|
-
|
|
13754
|
-
|
|
13700
|
+
/**
|
|
13701
|
+
* Whether the tree item is nested in a collapsed tree item.
|
|
13702
|
+
* @internal
|
|
13703
|
+
*/
|
|
13704
|
+
get isHidden() {
|
|
13705
|
+
let parent = this.parentElement;
|
|
13706
|
+
while (isTreeItem(parent)) {
|
|
13707
|
+
if (!parent.expanded) {
|
|
13708
|
+
return true;
|
|
13709
|
+
}
|
|
13710
|
+
parent = parent.parentElement;
|
|
13711
|
+
}
|
|
13712
|
+
return false;
|
|
13755
13713
|
}
|
|
13756
13714
|
/** @internal */
|
|
13757
13715
|
handleItemSlotChange() {
|
|
@@ -13837,10 +13795,10 @@ const styles = css`
|
|
|
13837
13795
|
${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)}`;
|
|
13838
13796
|
|
|
13839
13797
|
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>`;
|
|
13840
|
-
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>`;
|
|
13798
|
+
const template = html`<template slot="${x => x.isNestedItem ? "item" : void 0}" tabindex="0" ?focusgroupstart="${x => x.selected}"><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>`;
|
|
13841
13799
|
|
|
13842
13800
|
const definition = TreeItem.compose({
|
|
13843
|
-
name:
|
|
13801
|
+
name: tagName,
|
|
13844
13802
|
template: template,
|
|
13845
13803
|
styles: styles
|
|
13846
13804
|
});
|