@nldd/design-system 0.8.68 → 0.8.70
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/custom-elements.json +29536 -0
- package/dist/components/actions/button/button.d.ts +8 -0
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +14 -0
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.styles.d.ts.map +1 -1
- package/dist/components/actions/button/button.styles.js +109 -108
- package/dist/components/actions/button/button.styles.js.map +1 -1
- package/dist/components/actions/button/button.template.d.ts.map +1 -1
- package/dist/components/actions/button/button.template.js +9 -0
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +11 -0
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +17 -0
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.js +55 -54
- package/dist/components/actions/icon-button/icon-button.styles.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +7 -1
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +19 -0
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +53 -2
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/menu/menu.styles.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.styles.js +51 -23
- package/dist/components/actions/menu/menu.styles.js.map +1 -1
- package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.template.js +58 -33
- package/dist/components/actions/menu/menu.template.js.map +1 -1
- package/dist/components/actions/split-button/split-button.d.ts +16 -18
- package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.js +28 -54
- package/dist/components/actions/split-button/split-button.js.map +1 -1
- package/dist/components/actions/split-button/split-button.template.js +1 -1
- package/dist/components/actions/split-button/split-button.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +14 -0
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +45 -2
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +16 -2
- package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
- package/dist/components/components.js +106 -102
- package/dist/components/content/avatar/avatar.d.ts +96 -0
- package/dist/components/content/avatar/avatar.d.ts.map +1 -0
- package/dist/components/content/avatar/avatar.js +210 -0
- package/dist/components/content/avatar/avatar.js.map +1 -0
- package/dist/components/content/avatar/avatar.styles.d.ts +2 -0
- package/dist/components/content/avatar/avatar.styles.d.ts.map +1 -0
- package/dist/components/content/avatar/avatar.styles.js +127 -0
- package/dist/components/content/avatar/avatar.styles.js.map +1 -0
- package/dist/components/content/avatar/avatar.template.d.ts +3 -0
- package/dist/components/content/avatar/avatar.template.d.ts.map +1 -0
- package/dist/components/content/avatar/avatar.template.js +36 -0
- package/dist/components/content/avatar/avatar.template.js.map +1 -0
- package/dist/components/content/byline/byline.d.ts +1 -0
- package/dist/components/content/byline/byline.d.ts.map +1 -1
- package/dist/components/content/byline/byline.js +1 -0
- package/dist/components/content/byline/byline.js.map +1 -1
- package/dist/components/content/byline/byline.styles.d.ts.map +1 -1
- package/dist/components/content/byline/byline.styles.js +15 -5
- package/dist/components/content/byline/byline.styles.js.map +1 -1
- package/dist/components/content/byline/byline.template.js +11 -11
- package/dist/components/content/byline/byline.template.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +2 -0
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +19 -0
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
- package/dist/components/content/icon/icon-registry.js +34 -4
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/image/image.d.ts +2 -0
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +2 -0
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/image/lqip-encoder-element.d.ts.map +1 -1
- package/dist/components/content/image/lqip-encoder-element.js +2 -1
- package/dist/components/content/image/lqip-encoder-element.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts +4 -0
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js +4 -0
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +7 -0
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +10 -0
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/tag/tag.styles.js +23 -23
- package/dist/components/content/token/token.styles.d.ts.map +1 -1
- package/dist/components/content/token/token.styles.js +2 -1
- package/dist/components/content/token/token.styles.js.map +1 -1
- package/dist/components/{index-DWwviobk.js → index-BP0XMTYa.js} +1 -1
- package/dist/components/{index-Bfw_pYWB.js → index-Bh_hMHn8.js} +1 -1
- package/dist/components/{index-DjsXjoZJ.js → index-BuLJAwiB.js} +8816 -6015
- package/dist/components/{index-CKnwqp_9.js → index-CTUlN5qN.js} +1 -1
- package/dist/components/{index-Bqf6o41r.js → index-DS-RnHMu.js} +1 -1
- package/dist/components/{index-CXT1jMFt.js → index-Dgxr-sEe.js} +1 -1
- package/dist/components/{index-DO7aT0MT.js → index-sa60dMt-.js} +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.styles.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.styles.js +1 -0
- package/dist/components/inputs/checkbox/checkbox.styles.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.d.ts +226 -0
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -0
- package/dist/components/inputs/date-field/date-field.i18n.d.ts +11 -0
- package/dist/components/inputs/date-field/date-field.i18n.d.ts.map +1 -0
- package/dist/components/inputs/date-field/date-field.i18n.js +17 -0
- package/dist/components/inputs/date-field/date-field.i18n.js.map +1 -0
- package/dist/components/inputs/date-field/date-field.js +589 -0
- package/dist/components/inputs/date-field/date-field.js.map +1 -0
- package/dist/components/inputs/date-field/date-field.styles.d.ts +2 -0
- package/dist/components/inputs/date-field/date-field.styles.d.ts.map +1 -0
- package/dist/components/inputs/date-field/date-field.styles.js +246 -0
- package/dist/components/inputs/date-field/date-field.styles.js.map +1 -0
- package/dist/components/inputs/date-field/date-field.template.d.ts +17 -0
- package/dist/components/inputs/date-field/date-field.template.d.ts.map +1 -0
- package/dist/components/inputs/date-field/date-field.template.js +141 -0
- package/dist/components/inputs/date-field/date-field.template.js.map +1 -0
- package/dist/components/inputs/date-picker/date-picker.d.ts +268 -0
- package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -0
- package/dist/components/inputs/date-picker/date-picker.i18n.d.ts +64 -0
- package/dist/components/inputs/date-picker/date-picker.i18n.d.ts.map +1 -0
- package/dist/components/inputs/date-picker/date-picker.i18n.js +81 -0
- package/dist/components/inputs/date-picker/date-picker.i18n.js.map +1 -0
- package/dist/components/inputs/date-picker/date-picker.js +748 -0
- package/dist/components/inputs/date-picker/date-picker.js.map +1 -0
- package/dist/components/inputs/date-picker/date-picker.styles.d.ts +2 -0
- package/dist/components/inputs/date-picker/date-picker.styles.d.ts.map +1 -0
- package/dist/components/inputs/date-picker/date-picker.styles.js +353 -0
- package/dist/components/inputs/date-picker/date-picker.styles.js.map +1 -0
- package/dist/components/inputs/date-picker/date-picker.template.d.ts +8 -0
- package/dist/components/inputs/date-picker/date-picker.template.d.ts.map +1 -0
- package/dist/components/inputs/date-picker/date-picker.template.js +223 -0
- package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -0
- package/dist/components/inputs/dropdown/dropdown.styles.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.styles.js +7 -6
- package/dist/components/inputs/dropdown/dropdown.styles.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts +1 -0
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js +1 -0
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.d.ts +1 -0
- package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.js +1 -0
- package/dist/components/inputs/password-field/password-field.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.d.ts +3 -0
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +3 -0
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.js +1 -0
- package/dist/components/inputs/radio-button/radio-button.styles.js.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts +2 -0
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.js +2 -0
- package/dist/components/inputs/radio-button-field/radio-button-field.js.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts +1 -0
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.js +1 -0
- package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +10 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +11 -2
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.styles.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.styles.js +7 -6
- package/dist/components/inputs/segmented-control/segmented-control.styles.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.d.ts +1 -0
- package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.js +1 -0
- package/dist/components/inputs/stepper/stepper.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.styles.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.styles.js +1 -0
- package/dist/components/inputs/stepper/stepper.styles.js.map +1 -1
- package/dist/components/inputs/switch/switch.d.ts +2 -0
- package/dist/components/inputs/switch/switch.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.js +2 -0
- package/dist/components/inputs/switch/switch.js.map +1 -1
- package/dist/components/inputs/switch/switch.styles.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.styles.js +1 -0
- package/dist/components/inputs/switch/switch.styles.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.d.ts +8 -0
- package/dist/components/inputs/text-editor/text-editor.links.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.js +48 -7
- package/dist/components/inputs/text-editor/text-editor.links.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.js +11 -0
- package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.js +14 -3
- package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.d.ts +1 -0
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.js +1 -0
- package/dist/components/inputs/text-field/text-field.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.styles.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.styles.js +7 -6
- package/dist/components/inputs/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +26 -3
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +26 -3
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts +9 -1
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +23 -1
- package/dist/components/layout/page-footer/page-footer.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.styles.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.styles.js +9 -0
- package/dist/components/layout/page-footer/page-footer.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.js +19 -19
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +2 -2
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +2 -2
- package/dist/components/layout/popover/popover.d.ts +17 -0
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +114 -7
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +18 -0
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +38 -3
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.js +6 -1
- package/dist/components/layout/sheet/sheet.styles.js.map +1 -1
- package/dist/components/layout/sheet/sheet.template.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.template.js +2 -0
- package/dist/components/layout/sheet/sheet.template.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +1 -0
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +5 -0
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.js +27 -0
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts +2 -0
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js +3 -0
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.js +24 -0
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +9 -0
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +19 -0
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/layout/window/window.styles.d.ts.map +1 -1
- package/dist/components/layout/window/window.styles.js +5 -1
- package/dist/components/layout/window/window.styles.js.map +1 -1
- package/dist/components/layout/window/window.template.d.ts.map +1 -1
- package/dist/components/layout/window/window.template.js +1 -0
- package/dist/components/layout/window/window.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.js +2 -2
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.d.ts +1 -0
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js +1 -0
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js +6 -6
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +11 -11
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +11 -11
- package/dist/components/lists-and-tables/list/list.d.ts +14 -0
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +14 -0
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +10 -0
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +10 -0
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.js +14 -7
- package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.js +2 -1
- package/dist/components/lists-and-tables/table/table.styles.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js +15 -14
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.styles.js +1 -0
- package/dist/components/navigation/menu-bar/menu-bar.styles.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +1 -0
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +1 -0
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js +1 -0
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.d.ts +1 -0
- package/dist/components/navigation/pagination/pagination.d.ts.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +1 -0
- package/dist/components/navigation/pagination/pagination.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
- package/dist/components/navigation/pagination/pagination.styles.js +10 -9
- package/dist/components/navigation/pagination/pagination.styles.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +2 -0
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +2 -0
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.styles.js +7 -6
- package/dist/components/navigation/tab-bar/tab-bar.styles.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +22 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +22 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +10 -0
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +27 -2
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +14 -2
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +14 -2
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js +3 -2
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.styles.js +23 -23
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts +3 -2
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +2 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js +8 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js +2 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.js +16 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.js.map +1 -1
- package/dist/css/rich-text.css +19 -0
- package/dist/css/settings.css +253 -246
- package/dist/types/vue.d.ts +3277 -0
- package/dist/utilities/popup-anchor-controller.d.ts +63 -0
- package/dist/utilities/popup-anchor-controller.d.ts.map +1 -0
- package/dist/utilities/popup-anchor-controller.js +63 -0
- package/dist/utilities/popup-anchor-controller.js.map +1 -0
- package/dist/utilities/resolve-date-bound.d.ts +21 -0
- package/dist/utilities/resolve-date-bound.d.ts.map +1 -0
- package/dist/utilities/resolve-date-bound.js +75 -0
- package/dist/utilities/resolve-date-bound.js.map +1 -0
- package/package.json +35 -7
|
@@ -10,53 +10,78 @@ const itemRoleMap = {
|
|
|
10
10
|
radio: { menu: 'menuitemradio', listbox: 'option' },
|
|
11
11
|
};
|
|
12
12
|
export function menuTemplate(isEmpty, variant) {
|
|
13
|
-
//
|
|
14
|
-
// nldd-
|
|
15
|
-
// the
|
|
16
|
-
|
|
13
|
+
// role="menu"/"listbox" is now STATIC on .menu__list, which only ever owns
|
|
14
|
+
// nldd-menu-item children. The empty-state and the drill-in back button live
|
|
15
|
+
// in .menu__main as siblings of the list (outside the role), so an empty or
|
|
16
|
+
// filtered menu never needs to drop the role to stay ARIA-valid.
|
|
17
|
+
const menuRole = menuRoleMap[variant];
|
|
17
18
|
// Back button shows when this menu is itself a submenu and we're rendering
|
|
18
19
|
// in drill-in mode (touch / narrow viewport). The label is the parent
|
|
19
20
|
// item's text — gives the user context about which level they're in.
|
|
20
21
|
const showBack = this._isSubmenu && this._drillInMode && this._parentItem !== null;
|
|
22
|
+
// Header/footer are ROOT-ONLY: never rendered in a submenu (identity and
|
|
23
|
+
// account-level actions belong to the root menu, not a nested level). The
|
|
24
|
+
// slot is only in the DOM on the root, so submenu-slotted header/footer
|
|
25
|
+
// content is simply not projected.
|
|
26
|
+
const isRoot = !this._isSubmenu;
|
|
21
27
|
return html `
|
|
22
28
|
<div class="menu"
|
|
23
|
-
role=${menuRole}
|
|
24
29
|
tabindex="-1"
|
|
25
30
|
@touchstart=${this._handleMenuTouchStart}
|
|
26
31
|
@touchmove=${this._handleMenuTouchMove}
|
|
27
32
|
@touchend=${this._handleMenuTouchEnd}
|
|
28
33
|
@touchcancel=${this._handleMenuTouchEnd}
|
|
29
34
|
>
|
|
30
|
-
${
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
aria-label=${this._resolvedBackLabel}
|
|
34
|
-
@click=${this._handleBack}
|
|
35
|
-
@mouseenter=${this._handleBackMouseenter}
|
|
35
|
+
${isRoot ? html `
|
|
36
|
+
<div class="menu__header"
|
|
37
|
+
?hidden=${!this._hasHeader}
|
|
36
38
|
>
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
icon="chevron-left"
|
|
40
|
-
></nldd-icon-cell>
|
|
41
|
-
<nldd-spacer-cell size="6"></nldd-spacer-cell>
|
|
42
|
-
<nldd-text-cell text=${this._parentItem.text}></nldd-text-cell>
|
|
43
|
-
</button>
|
|
44
|
-
<!-- Pure visual divider; role="none" keeps strict ARIA validators
|
|
45
|
-
quiet (a focusable role="separator" inside a menu would need
|
|
46
|
-
aria-valuenow et al.; this one is decorative). -->
|
|
47
|
-
<div class="menu__back-button-divider"
|
|
48
|
-
role="none"
|
|
49
|
-
></div>
|
|
39
|
+
<slot name="header" @slotchange=${this._onHeaderSlotChange}></slot>
|
|
40
|
+
</div>
|
|
50
41
|
` : nothing}
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
<div class="menu__main">
|
|
43
|
+
${showBack ? html `
|
|
44
|
+
<button class="menu__back-button"
|
|
45
|
+
type="button"
|
|
46
|
+
aria-label=${this._resolvedBackLabel}
|
|
47
|
+
@click=${this._handleBack}
|
|
48
|
+
@mouseenter=${this._handleBackMouseenter}
|
|
49
|
+
>
|
|
50
|
+
<nldd-icon-cell
|
|
51
|
+
size="20"
|
|
52
|
+
icon="chevron-left"
|
|
53
|
+
></nldd-icon-cell>
|
|
54
|
+
<nldd-spacer-cell size="6"></nldd-spacer-cell>
|
|
55
|
+
<nldd-text-cell text=${this._parentItem.text}></nldd-text-cell>
|
|
56
|
+
</button>
|
|
57
|
+
<!-- Pure visual divider; role="none" keeps strict ARIA validators
|
|
58
|
+
quiet (a focusable role="separator" inside a menu would need
|
|
59
|
+
aria-valuenow et al.; this one is decorative). -->
|
|
60
|
+
<div class="menu__back-button-divider"
|
|
61
|
+
role="none"
|
|
62
|
+
></div>
|
|
63
|
+
` : nothing}
|
|
64
|
+
<div class="menu__list"
|
|
65
|
+
role=${menuRole}
|
|
66
|
+
>
|
|
67
|
+
<slot></slot>
|
|
68
|
+
</div>
|
|
69
|
+
${isEmpty ? html `
|
|
70
|
+
<div class="menu__empty">
|
|
71
|
+
<slot name="empty">
|
|
72
|
+
<nldd-inline-dialog
|
|
73
|
+
text=${this._resolvedEmptyText}
|
|
74
|
+
supporting-text=${this.emptySupportingText || nothing}
|
|
75
|
+
></nldd-inline-dialog>
|
|
76
|
+
</slot>
|
|
77
|
+
</div>
|
|
78
|
+
` : nothing}
|
|
79
|
+
</div>
|
|
80
|
+
${isRoot ? html `
|
|
81
|
+
<div class="menu__footer"
|
|
82
|
+
?hidden=${!this._hasFooter}
|
|
83
|
+
>
|
|
84
|
+
<slot name="footer" @slotchange=${this._onFooterSlotChange}></slot>
|
|
60
85
|
</div>
|
|
61
86
|
` : nothing}
|
|
62
87
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.template.js","sourceRoot":"","sources":["../../../../src/components/actions/menu/menu.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,MAAM,WAAW,GAAG;IACnB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACT,CAAC;AAEX,MAAM,WAAW,GAAG;IACnB,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE;IAC/C,QAAQ,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,QAAQ,EAAE;IACzD,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE;CAC1C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I,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO;oBAC9C,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO;oBACvD,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;oBAC7B,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO;oBAChD,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;4BACxD,IAAI,CAAC,UAAU;aAC9B,IAAI,CAAC,YAAY;MACxB,OAAO;GACV;;;;;;;;;;;;EAYD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB;IAClC,OAAO,IAAI,CAAA;;SAEH,CAAC;AACV,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,SAAwB;IACzD,0EAA0E;IAC1E,wEAAwE;IACxE,uEAAuE;IACvE,mDAAmD;IACnD,OAAO,IAAI,CAAA;;QAEJ,SAAS,CAAC,QAAQ;;KAErB,SAAS,CAAC,IAAI;;;qBAGE,SAAS,CAAC,QAAQ;;;;EAIrC,CAAC;AACH,CAAC"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Nederlandse Digitale Dienst Split Button Component (Lit + TypeScript)
|
|
3
3
|
*
|
|
4
4
|
* A split button combines a primary action button with a dropdown trigger.
|
|
5
|
-
* The main button performs the default action, while the icon button opens a
|
|
5
|
+
* The main button performs the default action, while the icon button opens a
|
|
6
|
+
* menu or popover.
|
|
6
7
|
*
|
|
7
8
|
* Provide the dropdown by slotting an `nldd-menu` (with its `nldd-menu-item` /
|
|
8
|
-
* `nldd-menu-divider` children) directly:
|
|
9
|
+
* `nldd-menu-divider` children) or an `nldd-popover` directly:
|
|
9
10
|
*
|
|
10
11
|
* ```html
|
|
11
12
|
* <nldd-split-button text="Opslaan">
|
|
@@ -15,11 +16,10 @@
|
|
|
15
16
|
* </nldd-split-button>
|
|
16
17
|
* ```
|
|
17
18
|
*
|
|
18
|
-
* The slotted
|
|
19
|
-
* their references and the full
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* manages their own popover.
|
|
19
|
+
* The slotted overlay stays in the light DOM — no item-moving — so consumers
|
|
20
|
+
* keep their references and the full overlay API. The split-button anchors it
|
|
21
|
+
* to the chevron and opens it on click. When no overlay is slotted, the chevron
|
|
22
|
+
* dispatches `menu-click` and the consumer manages their own popover.
|
|
23
23
|
*
|
|
24
24
|
* @element nldd-split-button
|
|
25
25
|
* @attr {string} size - Button size: 'xs' | 'sm' | 'md' | 'lg' (default: 'md')
|
|
@@ -30,16 +30,18 @@
|
|
|
30
30
|
* @attr {string} icon - Icon name shown before the text on the primary action button
|
|
31
31
|
* @attr {object} translations - Translations; unset keys fall back to Dutch
|
|
32
32
|
*
|
|
33
|
-
* @slot - A single `nldd-menu` that the chevron opens.
|
|
33
|
+
* @slot - A single `nldd-menu` or `nldd-popover` that the chevron opens.
|
|
34
34
|
*
|
|
35
35
|
* @fires action-click - Fired when the main button is clicked
|
|
36
|
-
* @fires menu-click - Fired when the dropdown trigger is clicked and no
|
|
36
|
+
* @fires menu-click - Fired when the dropdown trigger is clicked and no overlay is slotted
|
|
37
37
|
*/
|
|
38
38
|
import { LitElement } from 'lit';
|
|
39
39
|
import type { NLDDSplitButtonTranslations } from './split-button.i18n.js';
|
|
40
40
|
import './../button/button.js';
|
|
41
41
|
import './../icon-button/icon-button.js';
|
|
42
42
|
import '../../actions/menu/menu.js';
|
|
43
|
+
import { PopupAnchorController } from '../../../utilities/popup-anchor-controller.js';
|
|
44
|
+
/** A floating overlay the split-button chevron anchors and toggles. */
|
|
43
45
|
export type Size = 'xs' | 'sm' | 'md' | 'lg';
|
|
44
46
|
export declare class NLDDSplitButton extends LitElement {
|
|
45
47
|
static styles: import("lit").CSSResult;
|
|
@@ -55,18 +57,14 @@ export declare class NLDDSplitButton extends LitElement {
|
|
|
55
57
|
translations: Partial<NLDDSplitButtonTranslations>;
|
|
56
58
|
private _popupButtonWrapper?;
|
|
57
59
|
_menuIsOpen: boolean;
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
/** Shared wiring for the consumer-slotted overlay. Anchors to the chevron's
|
|
61
|
+
* wrapper rather than the host, and keeps `_menuIsOpen` (the chevron's
|
|
62
|
+
* expanded visual) in step via `toggle`. Not private: the template module
|
|
63
|
+
* binds its slotchange handler. */
|
|
64
|
+
_popup: PopupAnchorController;
|
|
61
65
|
_t(key: keyof NLDDSplitButtonTranslations): string;
|
|
62
66
|
firstUpdated(): void;
|
|
63
67
|
disconnectedCallback(): void;
|
|
64
|
-
/**
|
|
65
|
-
* Wires the slotted `nldd-menu` to the chevron: anchors it to the popup
|
|
66
|
-
* button and tracks its open state. Re-runs whenever the slotted content
|
|
67
|
-
* changes (menu added, removed or replaced).
|
|
68
|
-
*/
|
|
69
|
-
_handleSlotChange(event: Event): void;
|
|
70
68
|
private _handleMenuToggle;
|
|
71
69
|
_handleActionClick(e: MouseEvent): void;
|
|
72
70
|
_handleMenuClick(e: MouseEvent): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/split-button/split-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMjC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iCAAiC,CAAC;AACzC,OAAO,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/split-button/split-button.ts"],"names":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C;CACD"}
|
|
@@ -8,10 +8,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
* Nederlandse Digitale Dienst Split Button Component (Lit + TypeScript)
|
|
9
9
|
*
|
|
10
10
|
* A split button combines a primary action button with a dropdown trigger.
|
|
11
|
-
* The main button performs the default action, while the icon button opens a
|
|
11
|
+
* The main button performs the default action, while the icon button opens a
|
|
12
|
+
* menu or popover.
|
|
12
13
|
*
|
|
13
14
|
* Provide the dropdown by slotting an `nldd-menu` (with its `nldd-menu-item` /
|
|
14
|
-
* `nldd-menu-divider` children) directly:
|
|
15
|
+
* `nldd-menu-divider` children) or an `nldd-popover` directly:
|
|
15
16
|
*
|
|
16
17
|
* ```html
|
|
17
18
|
* <nldd-split-button text="Opslaan">
|
|
@@ -21,11 +22,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
21
22
|
* </nldd-split-button>
|
|
22
23
|
* ```
|
|
23
24
|
*
|
|
24
|
-
* The slotted
|
|
25
|
-
* their references and the full
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* manages their own popover.
|
|
25
|
+
* The slotted overlay stays in the light DOM — no item-moving — so consumers
|
|
26
|
+
* keep their references and the full overlay API. The split-button anchors it
|
|
27
|
+
* to the chevron and opens it on click. When no overlay is slotted, the chevron
|
|
28
|
+
* dispatches `menu-click` and the consumer manages their own popover.
|
|
29
29
|
*
|
|
30
30
|
* @element nldd-split-button
|
|
31
31
|
* @attr {string} size - Button size: 'xs' | 'sm' | 'md' | 'lg' (default: 'md')
|
|
@@ -36,10 +36,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
36
36
|
* @attr {string} icon - Icon name shown before the text on the primary action button
|
|
37
37
|
* @attr {object} translations - Translations; unset keys fall back to Dutch
|
|
38
38
|
*
|
|
39
|
-
* @slot - A single `nldd-menu` that the chevron opens.
|
|
39
|
+
* @slot - A single `nldd-menu` or `nldd-popover` that the chevron opens.
|
|
40
40
|
*
|
|
41
41
|
* @fires action-click - Fired when the main button is clicked
|
|
42
|
-
* @fires menu-click - Fired when the dropdown trigger is clicked and no
|
|
42
|
+
* @fires menu-click - Fired when the dropdown trigger is clicked and no overlay is slotted
|
|
43
43
|
*/
|
|
44
44
|
import { LitElement } from 'lit';
|
|
45
45
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
@@ -50,6 +50,7 @@ import { nlddSplitButtonTranslations } from './split-button.i18n.js';
|
|
|
50
50
|
import './../button/button.js';
|
|
51
51
|
import './../icon-button/icon-button.js';
|
|
52
52
|
import '../../actions/menu/menu.js';
|
|
53
|
+
import { PopupAnchorController } from '../../../utilities/popup-anchor-controller.js';
|
|
53
54
|
let NLDDSplitButton = class NLDDSplitButton extends LitElement {
|
|
54
55
|
constructor() {
|
|
55
56
|
super(...arguments);
|
|
@@ -64,9 +65,18 @@ let NLDDSplitButton = class NLDDSplitButton extends LitElement {
|
|
|
64
65
|
this.icon = '';
|
|
65
66
|
this.translations = {};
|
|
66
67
|
this._menuIsOpen = false;
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
/** Shared wiring for the consumer-slotted overlay. Anchors to the chevron's
|
|
69
|
+
* wrapper rather than the host, and keeps `_menuIsOpen` (the chevron's
|
|
70
|
+
* expanded visual) in step via `toggle`. Not private: the template module
|
|
71
|
+
* binds its slotchange handler. */
|
|
72
|
+
this._popup = new PopupAnchorController(this, {
|
|
73
|
+
anchorFor: () => this._popupButtonWrapper ?? null,
|
|
74
|
+
onChange: (overlay, previous) => {
|
|
75
|
+
previous?.removeEventListener('toggle', this._handleMenuToggle);
|
|
76
|
+
this._menuIsOpen = false;
|
|
77
|
+
overlay?.addEventListener('toggle', this._handleMenuToggle);
|
|
78
|
+
},
|
|
79
|
+
});
|
|
70
80
|
this._handleMenuToggle = (event) => {
|
|
71
81
|
this._menuIsOpen = event.newState === 'open';
|
|
72
82
|
};
|
|
@@ -77,44 +87,14 @@ let NLDDSplitButton = class NLDDSplitButton extends LitElement {
|
|
|
77
87
|
}
|
|
78
88
|
// — Lifecycle ————————————————————————————————————————————————————————————
|
|
79
89
|
firstUpdated() {
|
|
80
|
-
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
// touch and pen — `mousedown` alone would skip touch on mobile, where
|
|
85
|
-
// no mousedown precedes the synthetic click.
|
|
86
|
-
this._popupButtonWrapper?.addEventListener('pointerdown', () => {
|
|
87
|
-
this._menuWasOpenOnPointerdown = this._menu?.matches(':popover-open') ?? false;
|
|
88
|
-
});
|
|
89
|
-
// If the menu was slotted declaratively, _handleSlotChange may have run
|
|
90
|
-
// before @query resolved _popupButtonWrapper and couldn't anchor it. The
|
|
91
|
-
// wrapper exists now — anchor a menu that's still waiting for it.
|
|
92
|
-
if (this._menu && this._popupButtonWrapper) {
|
|
93
|
-
this._menu.anchorElement = this._popupButtonWrapper;
|
|
94
|
-
}
|
|
90
|
+
this._popupButtonWrapper?.addEventListener('pointerdown', this._popup.handlePointerdown);
|
|
91
|
+
// A declaratively-slotted overlay is adopted before @query resolves the
|
|
92
|
+
// wrapper, so it couldn't be anchored yet. The wrapper exists now.
|
|
93
|
+
this._popup.anchor();
|
|
95
94
|
}
|
|
96
95
|
disconnectedCallback() {
|
|
97
96
|
super.disconnectedCallback();
|
|
98
|
-
this.
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Wires the slotted `nldd-menu` to the chevron: anchors it to the popup
|
|
102
|
-
* button and tracks its open state. Re-runs whenever the slotted content
|
|
103
|
-
* changes (menu added, removed or replaced).
|
|
104
|
-
*/
|
|
105
|
-
_handleSlotChange(event) {
|
|
106
|
-
const slot = event.target;
|
|
107
|
-
const menu = slot.assignedElements().find((el) => el.matches('nldd-menu')) ?? null;
|
|
108
|
-
if (menu === this._menu)
|
|
109
|
-
return;
|
|
110
|
-
this._menu?.removeEventListener('toggle', this._handleMenuToggle);
|
|
111
|
-
this._menu = menu;
|
|
112
|
-
this._menuIsOpen = false;
|
|
113
|
-
if (menu) {
|
|
114
|
-
if (this._popupButtonWrapper)
|
|
115
|
-
menu.anchorElement = this._popupButtonWrapper;
|
|
116
|
-
menu.addEventListener('toggle', this._handleMenuToggle);
|
|
117
|
-
}
|
|
97
|
+
this._popup.overlay?.removeEventListener('toggle', this._handleMenuToggle);
|
|
118
98
|
}
|
|
119
99
|
_handleActionClick(e) {
|
|
120
100
|
if (this.disabled)
|
|
@@ -126,14 +106,8 @@ let NLDDSplitButton = class NLDDSplitButton extends LitElement {
|
|
|
126
106
|
if (this.disabled)
|
|
127
107
|
return;
|
|
128
108
|
e.stopPropagation();
|
|
129
|
-
if (this.
|
|
130
|
-
const wasOpen = this._menuWasOpenOnPointerdown;
|
|
131
|
-
this._menuWasOpenOnPointerdown = false;
|
|
132
|
-
if (wasOpen)
|
|
133
|
-
return; // light-dismiss already closed it
|
|
134
|
-
this._menu.showPopover();
|
|
109
|
+
if (this._popup.handleClick(e))
|
|
135
110
|
return;
|
|
136
|
-
}
|
|
137
111
|
this.dispatchEvent(new CustomEvent('menu-click', { bubbles: true, composed: true }));
|
|
138
112
|
}
|
|
139
113
|
// willUpdate (not updated) so the host width is resolved before the first
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.js","sourceRoot":"","sources":["../../../../src/components/actions/split-button/split-button.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,2BAA2B,E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,EAAE,SAAS,EAAE,iBAAiB,CAAO,IAAI,CAAC,EAAE,CAAC;6CACpD;AAGlB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,gBAAgB,CAAC,EAAE,CAAC;gDACjD;AAGnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAC1B;AAIjB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;8CAC3D;AAIX;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;6CAC5D;AAIV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACjB;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAC6B;AAKhD;IADP,KAAK,CAAC,6BAA6B,CAAC;4DACQ;AAG7C;IADC,KAAK,EAAE;oDACY;AAjCR,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA4G3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.template.js","sourceRoot":"","sources":["../../../../src/components/actions/split-button/split-button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGpC,MAAM,UAAU,QAAQ;IACvB,OAAO,IAAI,CAAA;;;cAGE,IAAI,CAAC,OAAO;WACf,IAAI,CAAC,IAAI;WACT,IAAI,CAAC,IAAI;iBACH,IAAI,CAAC,IAAI,IAAI,OAAO;;;;gBAIrB,IAAI,CAAC,QAAQ;aAChB,IAAI,CAAC,kBAAkB;;;;;eAKrB,IAAI,CAAC,OAAO;YACf,IAAI,CAAC,IAAI;;YAET,IAAI,CAAC,EAAE,CAAC,qCAAqC,CAAC;;;;iBAIzC,IAAI,CAAC,QAAQ;iBACb,IAAI,CAAC,WAAW;;cAEnB,IAAI,CAAC,gBAAgB;;;;sBAIb,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"split-button.template.js","sourceRoot":"","sources":["../../../../src/components/actions/split-button/split-button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGpC,MAAM,UAAU,QAAQ;IACvB,OAAO,IAAI,CAAA;;;cAGE,IAAI,CAAC,OAAO;WACf,IAAI,CAAC,IAAI;WACT,IAAI,CAAC,IAAI;iBACH,IAAI,CAAC,IAAI,IAAI,OAAO;;;;gBAIrB,IAAI,CAAC,QAAQ;aAChB,IAAI,CAAC,kBAAkB;;;;;eAKrB,IAAI,CAAC,OAAO;YACf,IAAI,CAAC,IAAI;;YAET,IAAI,CAAC,EAAE,CAAC,qCAAqC,CAAC;;;;iBAIzC,IAAI,CAAC,QAAQ;iBACb,IAAI,CAAC,WAAW;;cAEnB,IAAI,CAAC,gBAAgB;;;;sBAIb,IAAI,CAAC,MAAM,CAAC,gBAAgB;EAChD,CAAC;AACH,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @attr {string} size - Toolbar size, propagated to all child controls: 'sm' | 'md' | 'lg' (default: 'md'). At 'lg' the overflow button (and lg-capable children like nldd-icon-button) stack their label below the icon.
|
|
6
6
|
* @attr {boolean} show-item-labels - When true, shows a text label below each toolbar item and the overflow button
|
|
7
7
|
* @attr {string} label - Accessible label for the toolbar. Only needed when multiple toolbars appear on the same page
|
|
8
|
+
* @attr {object} translations - Override translation keys (e.g. the overflow button label); unset keys fall back to Dutch.
|
|
8
9
|
*
|
|
9
10
|
* @slot start - nldd-toolbar-item and nldd-toolbar-title elements placed at the start
|
|
10
11
|
* @slot center - nldd-toolbar-item and nldd-toolbar-title elements placed at the center
|
|
@@ -19,6 +20,8 @@
|
|
|
19
20
|
* @attr {string} max-width - Maximum (fluid) width as a CSS length (e.g. '480px'). Setting it also makes the item fluid.
|
|
20
21
|
* @attr {string} label - Text label shown below the item when the toolbar has show-item-labels.
|
|
21
22
|
* @attr {number} priority - Overflow order: items with a lower priority move into the overflow menu first (default 0). Items sharing a priority overflow together, regardless of position.
|
|
23
|
+
* @attr {'sm'|'md'|'lg'} size - Set by nldd-toolbar, not a consumer attribute: mirrors the toolbar's size (default: 'md') onto the item host, so size-dependent styling can key off it.
|
|
24
|
+
* @attr {boolean} show-item-labels - Set by nldd-toolbar, not a consumer attribute: mirrors the toolbar's show-item-labels, so the item renders its label below the control.
|
|
22
25
|
* @attr {boolean} fluid - Set by nldd-toolbar, not a consumer attribute: marks an item that grows or shrinks to fill space. Toggled synchronously during measurement, so it can appear or disappear between layout frames — do not style against it. It is not reflected as a JS property — read it with hasAttribute('fluid').
|
|
23
26
|
* @attr {boolean} solo-fluid - Set by nldd-toolbar, not a consumer attribute: the sole fluid item, allowed to shrink below its content. Same synchronous-toggle and property-read caveats as fluid.
|
|
24
27
|
* @attr {boolean} hidden - Set by nldd-toolbar, not a consumer attribute, when the item moves into the overflow menu. Same synchronous-toggle caveat.
|
|
@@ -35,6 +38,7 @@
|
|
|
35
38
|
* @attr {string} width - Preferred (fluid) width as a CSS length or percentage; the title grows toward it and shrinks to min-width.
|
|
36
39
|
* @attr {string} min-width - Minimum width as a CSS length (default: '0', so the title shrink-wraps its content and the next element sits against it).
|
|
37
40
|
* @attr {string} max-width - Maximum width as a CSS length (default: '240px'); the title text truncates with an ellipsis beyond it. The cap is lifted while the title is the sole toolbar element (it then stretches to fill the row).
|
|
41
|
+
* @attr {'sm'|'md'|'lg'} size - Set by nldd-toolbar, not a consumer attribute: mirrors the toolbar's size (default: 'md'), which sets the title group height and, at 'sm', the title and supporting-text fonts.
|
|
38
42
|
*
|
|
39
43
|
* @slot action - Optional trailing control (e.g. an xs nldd-icon-button), shown inline after the title and tuned to sit against it. Empty by default.
|
|
40
44
|
*/
|
|
@@ -84,6 +88,12 @@ export declare class NLDDToolbar extends LitElement {
|
|
|
84
88
|
private _overflowIds;
|
|
85
89
|
private _leftSpacerZero;
|
|
86
90
|
private _rightSpacerZero;
|
|
91
|
+
/** True when nothing is *rendered* in the start/end areas (they may hold
|
|
92
|
+
* consumer-hidden `display:none` children), so the center content is the
|
|
93
|
+
* only visible group. Drives the centered `.toolbar__center-fill` layout —
|
|
94
|
+
* a hidden back button no longer strands a centered title at the left.
|
|
95
|
+
* Computed from real rendering, not mere child presence. */
|
|
96
|
+
private _centerOnly;
|
|
87
97
|
private _pinnedOverflowItems;
|
|
88
98
|
private _childIds;
|
|
89
99
|
private _idCounter;
|
|
@@ -135,6 +145,10 @@ export declare class NLDDToolbar extends LitElement {
|
|
|
135
145
|
private _computeAreaWidth;
|
|
136
146
|
private _computeSpacerZeros;
|
|
137
147
|
private _updateAreaVars;
|
|
148
|
+
/** Whether any child in the list is actually rendered. getClientRects() is
|
|
149
|
+
* empty for a `display:none` element (consumer-hidden or toolbar-hidden via
|
|
150
|
+
* `[hidden]`), so this counts real on-screen presence, not mere DOM presence. */
|
|
151
|
+
private _hasRenderedChild;
|
|
138
152
|
private _measureAndUpdate;
|
|
139
153
|
private _measureOverflow;
|
|
140
154
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/toolbar/toolbar.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/toolbar/toolbar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAIjC,OAAO,EAAuD,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE/G,OAAO,KAAK,EAAE,uBAAuB,EA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;IAmBb,MAAM;CAuBf;AAID,oFAAoF;AACpF,KAAK,YAAY,GAAG,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAC5D,iFAAiF;AACjF,KAAK,cAAc,GAAG,YAAY,EAAE,EAAE,CAAC;AAEvC;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,YAAY,EAAE,GACnB,cAAc,CAkBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,WAAW,CAAC;QAC5B,mBAAmB,EAAE,eAAe,CAAC;QACrC,oBAAoB,EAAE,gBAAgB,CAAC;KACvC;CACD"}
|
|
@@ -11,6 +11,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
11
11
|
* @attr {string} size - Toolbar size, propagated to all child controls: 'sm' | 'md' | 'lg' (default: 'md'). At 'lg' the overflow button (and lg-capable children like nldd-icon-button) stack their label below the icon.
|
|
12
12
|
* @attr {boolean} show-item-labels - When true, shows a text label below each toolbar item and the overflow button
|
|
13
13
|
* @attr {string} label - Accessible label for the toolbar. Only needed when multiple toolbars appear on the same page
|
|
14
|
+
* @attr {object} translations - Override translation keys (e.g. the overflow button label); unset keys fall back to Dutch.
|
|
14
15
|
*
|
|
15
16
|
* @slot start - nldd-toolbar-item and nldd-toolbar-title elements placed at the start
|
|
16
17
|
* @slot center - nldd-toolbar-item and nldd-toolbar-title elements placed at the center
|
|
@@ -25,6 +26,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
25
26
|
* @attr {string} max-width - Maximum (fluid) width as a CSS length (e.g. '480px'). Setting it also makes the item fluid.
|
|
26
27
|
* @attr {string} label - Text label shown below the item when the toolbar has show-item-labels.
|
|
27
28
|
* @attr {number} priority - Overflow order: items with a lower priority move into the overflow menu first (default 0). Items sharing a priority overflow together, regardless of position.
|
|
29
|
+
* @attr {'sm'|'md'|'lg'} size - Set by nldd-toolbar, not a consumer attribute: mirrors the toolbar's size (default: 'md') onto the item host, so size-dependent styling can key off it.
|
|
30
|
+
* @attr {boolean} show-item-labels - Set by nldd-toolbar, not a consumer attribute: mirrors the toolbar's show-item-labels, so the item renders its label below the control.
|
|
28
31
|
* @attr {boolean} fluid - Set by nldd-toolbar, not a consumer attribute: marks an item that grows or shrinks to fill space. Toggled synchronously during measurement, so it can appear or disappear between layout frames — do not style against it. It is not reflected as a JS property — read it with hasAttribute('fluid').
|
|
29
32
|
* @attr {boolean} solo-fluid - Set by nldd-toolbar, not a consumer attribute: the sole fluid item, allowed to shrink below its content. Same synchronous-toggle and property-read caveats as fluid.
|
|
30
33
|
* @attr {boolean} hidden - Set by nldd-toolbar, not a consumer attribute, when the item moves into the overflow menu. Same synchronous-toggle caveat.
|
|
@@ -41,6 +44,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
41
44
|
* @attr {string} width - Preferred (fluid) width as a CSS length or percentage; the title grows toward it and shrinks to min-width.
|
|
42
45
|
* @attr {string} min-width - Minimum width as a CSS length (default: '0', so the title shrink-wraps its content and the next element sits against it).
|
|
43
46
|
* @attr {string} max-width - Maximum width as a CSS length (default: '240px'); the title text truncates with an ellipsis beyond it. The cap is lifted while the title is the sole toolbar element (it then stretches to fill the row).
|
|
47
|
+
* @attr {'sm'|'md'|'lg'} size - Set by nldd-toolbar, not a consumer attribute: mirrors the toolbar's size (default: 'md'), which sets the title group height and, at 'sm', the title and supporting-text fonts.
|
|
44
48
|
*
|
|
45
49
|
* @slot action - Optional trailing control (e.g. an xs nldd-icon-button), shown inline after the title and tuned to sit against it. Empty by default.
|
|
46
50
|
*/
|
|
@@ -191,6 +195,12 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
191
195
|
this._overflowIds = new Set();
|
|
192
196
|
this._leftSpacerZero = false;
|
|
193
197
|
this._rightSpacerZero = false;
|
|
198
|
+
/** True when nothing is *rendered* in the start/end areas (they may hold
|
|
199
|
+
* consumer-hidden `display:none` children), so the center content is the
|
|
200
|
+
* only visible group. Drives the centered `.toolbar__center-fill` layout —
|
|
201
|
+
* a hidden back button no longer strands a centered title at the left.
|
|
202
|
+
* Computed from real rendering, not mere child presence. */
|
|
203
|
+
this._centerOnly = false;
|
|
194
204
|
this._pinnedOverflowItems = [];
|
|
195
205
|
this._childIds = new WeakMap();
|
|
196
206
|
this._idCounter = 0;
|
|
@@ -529,11 +539,36 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
529
539
|
this.style.setProperty('--_start-width', `${startWidth}px`);
|
|
530
540
|
this.style.setProperty('--_center-width', `${centerWidth}px`);
|
|
531
541
|
this.style.setProperty('--_end-width', `${endWidth}px`);
|
|
542
|
+
// The spacer basis subtracts a gap to account for the flex gap between a
|
|
543
|
+
// side area and its spacer. That gap only exists when the area is
|
|
544
|
+
// non-empty; with an empty start (or end) the spacer is the first (or
|
|
545
|
+
// last) item and there is no such gap, so drop the subtraction to 0 —
|
|
546
|
+
// otherwise the centre is pulled off-centre by one gap once the opposite
|
|
547
|
+
// side gains items.
|
|
548
|
+
this.style.setProperty('--_left-spacer-gap', startWidth > 0 ? `${itemGap}px` : '0px');
|
|
549
|
+
this.style.setProperty('--_right-spacer-gap', endWidth > 0 ? `${itemGap}px` : '0px');
|
|
532
550
|
const { leftZero, rightZero } = this._computeSpacerZeros(hostWidth, itemGap, overflowButtonWidth, startWidth, centerWidth, endWidth);
|
|
533
551
|
if (leftZero !== this._leftSpacerZero)
|
|
534
552
|
this._leftSpacerZero = leftZero;
|
|
535
553
|
if (rightZero !== this._rightSpacerZero)
|
|
536
554
|
this._rightSpacerZero = rightZero;
|
|
555
|
+
// Route to the centered center-fill layout whenever nothing is actually
|
|
556
|
+
// rendered in start/end — measured by real rendering, not child presence,
|
|
557
|
+
// so a consumer-hidden (display:none) back button doesn't strand a centered
|
|
558
|
+
// title at the left (it would otherwise keep centerOnly false and fall into
|
|
559
|
+
// the spacer path, where startWidth===0 && endWidth===0 suppresses both
|
|
560
|
+
// balancing spacers).
|
|
561
|
+
const centerOnly = !this._hasRenderedChild(this._startChildren)
|
|
562
|
+
&& !this._hasRenderedChild(this._endChildren)
|
|
563
|
+
&& this._centerChildren.length > 0;
|
|
564
|
+
if (centerOnly !== this._centerOnly)
|
|
565
|
+
this._centerOnly = centerOnly;
|
|
566
|
+
}
|
|
567
|
+
/** Whether any child in the list is actually rendered. getClientRects() is
|
|
568
|
+
* empty for a `display:none` element (consumer-hidden or toolbar-hidden via
|
|
569
|
+
* `[hidden]`), so this counts real on-screen presence, not mere DOM presence. */
|
|
570
|
+
_hasRenderedChild(children) {
|
|
571
|
+
return children.some(c => c.element.getClientRects().length > 0);
|
|
537
572
|
}
|
|
538
573
|
_measureAndUpdate() {
|
|
539
574
|
if (this._isMeasuring)
|
|
@@ -637,7 +672,12 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
637
672
|
* promotion is skipped there (matching the previous template behaviour).
|
|
638
673
|
*/
|
|
639
674
|
_promoteSoloFluid(itemsEl, itemChildren, titleChildren, centerOnly) {
|
|
640
|
-
|
|
675
|
+
// Real rendering, not the `hidden` property: a consumer-hidden
|
|
676
|
+
// (display:none) start/end item must not count as a "remaining visible"
|
|
677
|
+
// item, or it blocks promoting a lone title to solo-fluid (which is what
|
|
678
|
+
// lets align="center" actually centre it). Toolbar-hidden items are
|
|
679
|
+
// display:none too, so this stays equivalent for the overflow flow.
|
|
680
|
+
const remainingVisible = itemChildren.filter(c => c.element.getClientRects().length > 0);
|
|
641
681
|
if (!centerOnly && remainingVisible.length === 1 && remainingVisible[0].element.hasAttribute('fluid')) {
|
|
642
682
|
const host = remainingVisible[0].element;
|
|
643
683
|
host.removeAttribute('fluid');
|
|
@@ -726,7 +766,7 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
726
766
|
const visibleNonDivider = allChildren.filter(c => !this._overflowIds.has(c.id));
|
|
727
767
|
const isSoloFluid = visibleNonDivider.length === 1 && (visibleNonDivider[0].type === 'title' ||
|
|
728
768
|
(visibleNonDivider[0].type === 'item' && visibleNonDivider[0].isFluid));
|
|
729
|
-
return template(this, this._centerChildren.length > 0, this._leftSpacerZero, this._rightSpacerZero, isSoloFluid, this._pinnedOverflowItems.length > 0 || this._overflowIds.size > 0, this._menuOpen, this.label, this.
|
|
769
|
+
return template(this, this._centerChildren.length > 0, this._leftSpacerZero, this._rightSpacerZero, isSoloFluid, this._pinnedOverflowItems.length > 0 || this._overflowIds.size > 0, this._menuOpen, this.label, this._centerOnly, (key) => this._t(key));
|
|
730
770
|
}
|
|
731
771
|
};
|
|
732
772
|
NLDDToolbar.styles = toolbarStyles;
|
|
@@ -763,6 +803,9 @@ __decorate([
|
|
|
763
803
|
__decorate([
|
|
764
804
|
state()
|
|
765
805
|
], NLDDToolbar.prototype, "_rightSpacerZero", void 0);
|
|
806
|
+
__decorate([
|
|
807
|
+
state()
|
|
808
|
+
], NLDDToolbar.prototype, "_centerOnly", void 0);
|
|
766
809
|
__decorate([
|
|
767
810
|
state()
|
|
768
811
|
], NLDDToolbar.prototype, "_pinnedOverflowItems", void 0);
|