@nldd/design-system 0.8.70 → 0.8.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/custom-elements.json +2990 -577
- package/dist/assets/styles/style-resets.d.ts +1 -1
- package/dist/assets/styles/style-resets.js +1 -1
- package/dist/components/actions/button/button.d.ts +10 -5
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.i18n.d.ts +1 -1
- package/dist/components/actions/button/button.i18n.js +1 -1
- package/dist/components/actions/button/button.i18n.js.map +1 -1
- package/dist/components/actions/button/button.js +19 -4
- 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 +13 -3
- package/dist/components/actions/button/button.styles.js.map +1 -1
- package/dist/components/actions/button/button.template.js +1 -1
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/button-bar/button-bar.d.ts.map +1 -1
- package/dist/components/actions/button-bar/button-bar.js +6 -0
- package/dist/components/actions/button-bar/button-bar.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +26 -39
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.i18n.d.ts +1 -1
- package/dist/components/actions/icon-button/icon-button.i18n.js +1 -1
- package/dist/components/actions/icon-button/icon-button.i18n.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +25 -38
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.js +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +47 -52
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +55 -54
- 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 +7 -1
- package/dist/components/actions/menu/menu.styles.js.map +1 -1
- package/dist/components/actions/menu/menu.template.js +1 -1
- package/dist/components/actions/menu/menu.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +10 -4
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +30 -11
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +3 -3
- package/dist/components/components.js +65 -62
- package/dist/components/content/avatar/avatar.d.ts +44 -12
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.i18n.d.ts +5 -0
- package/dist/components/content/avatar/avatar.i18n.d.ts.map +1 -0
- package/dist/components/content/avatar/avatar.i18n.js +4 -0
- package/dist/components/content/avatar/avatar.i18n.js.map +1 -0
- package/dist/components/content/avatar/avatar.js +87 -13
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar/avatar.styles.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.styles.js +44 -9
- package/dist/components/content/avatar/avatar.styles.js.map +1 -1
- package/dist/components/content/avatar/avatar.template.d.ts +2 -1
- package/dist/components/content/avatar/avatar.template.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.template.js +53 -23
- package/dist/components/content/avatar/avatar.template.js.map +1 -1
- package/dist/components/content/byline/byline.d.ts +6 -6
- package/dist/components/content/byline/byline.js +6 -6
- package/dist/components/content/code-viewer/code-viewer.js +2 -2
- package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js +5 -4
- package/dist/components/content/code-viewer/code-viewer.styles.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 -5
- 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 +9 -2
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/icon/icon.d.ts +14 -16
- package/dist/components/content/icon/icon.d.ts.map +1 -1
- package/dist/components/content/icon/icon.js +13 -15
- package/dist/components/content/icon/icon.js.map +1 -1
- package/dist/components/content/icon/icon.styles.d.ts.map +1 -1
- package/dist/components/content/icon/icon.styles.js +7 -4
- package/dist/components/content/icon/icon.styles.js.map +1 -1
- package/dist/components/content/image/image.d.ts +9 -9
- package/dist/components/content/image/image.js +9 -9
- package/dist/components/content/image/image.styles.js +2 -2
- package/dist/components/content/image/image.template.js +2 -2
- package/dist/components/content/image/image.template.js.map +1 -1
- package/dist/components/content/image/lqip-encoder.js +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js +2 -2
- package/dist/components/content/rich-text/rich-text.d.ts +4 -4
- package/dist/components/content/rich-text/rich-text.js +4 -4
- package/dist/components/content/token/token.d.ts +7 -7
- package/dist/components/content/token/token.js +7 -7
- package/dist/components/content/tooltip/tooltip.d.ts +4 -14
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +4 -14
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/forms/form/form.d.ts +10 -19
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +10 -19
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-actions/form-actions.d.ts +2 -6
- package/dist/components/forms/form-actions/form-actions.d.ts.map +1 -1
- package/dist/components/forms/form-actions/form-actions.js +2 -6
- package/dist/components/forms/form-actions/form-actions.js.map +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +7 -14
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +7 -14
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.js +15 -2
- package/dist/components/forms/form-field/form-field.styles.js.map +1 -1
- package/dist/components/forms/form-section/form-section.d.ts +2 -3
- package/dist/components/forms/form-section/form-section.d.ts.map +1 -1
- package/dist/components/forms/form-section/form-section.js +2 -3
- package/dist/components/forms/form-section/form-section.js.map +1 -1
- package/dist/components/{index-BP0XMTYa.js → index-B9_6JE9f.js} +1 -1
- package/dist/components/{index-Dgxr-sEe.js → index-Bt_KkJKU.js} +1 -1
- package/dist/components/{index-BuLJAwiB.js → index-CSxjYgj9.js} +4217 -2494
- package/dist/components/{index-sa60dMt-.js → index-CqbiWdc5.js} +1 -1
- package/dist/components/{index-CTUlN5qN.js → index-CvGdvr33.js} +1 -1
- package/dist/components/{index-DS-RnHMu.js → index-i1n9W3UN.js} +1 -1
- package/dist/components/{index-Bh_hMHn8.js → index-ipWLrQY3.js} +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.d.ts +11 -11
- package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.js +11 -15
- package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.styles.js +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts +20 -6
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.js +29 -7
- package/dist/components/inputs/checkbox-field/checkbox-field.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.d.ts +19 -18
- package/dist/components/inputs/code-editor/code-editor.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.js +23 -23
- package/dist/components/inputs/code-editor/code-editor.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js +2 -2
- package/dist/components/inputs/combo-box/combo-box.d.ts +26 -29
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +74 -39
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.styles.js +7 -7
- package/dist/components/inputs/date-field/date-field.d.ts +25 -24
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.js +26 -29
- package/dist/components/inputs/date-field/date-field.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.styles.js +5 -5
- package/dist/components/inputs/date-picker/date-picker.d.ts +16 -13
- package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.js +35 -15
- package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.styles.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.styles.js +21 -29
- package/dist/components/inputs/date-picker/date-picker.styles.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts +4 -4
- package/dist/components/inputs/dropdown/dropdown.js +4 -4
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts +21 -21
- 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 +23 -26
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js +5 -5
- package/dist/components/inputs/number-field/number-field.d.ts +17 -20
- package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.js +20 -23
- package/dist/components/inputs/number-field/number-field.js.map +1 -1
- package/dist/components/inputs/number-field/number-field.styles.js +4 -4
- package/dist/components/inputs/password-field/password-field.d.ts +25 -24
- package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.js +27 -29
- package/dist/components/inputs/password-field/password-field.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.styles.js +7 -7
- package/dist/components/inputs/radio-button/radio-button.d.ts +10 -10
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +9 -14
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.js +2 -2
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts +24 -6
- 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 +32 -7
- 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 +3 -3
- 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 +17 -10
- package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts +15 -17
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +19 -22
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.styles.js +5 -5
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +27 -29
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +47 -57
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.styles.js +4 -4
- package/dist/components/inputs/stepper/stepper.d.ts +14 -14
- package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.js +13 -18
- package/dist/components/inputs/stepper/stepper.js.map +1 -1
- package/dist/components/inputs/switch/switch.d.ts +12 -13
- package/dist/components/inputs/switch/switch.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.js +13 -18
- package/dist/components/inputs/switch/switch.js.map +1 -1
- package/dist/components/inputs/switch/switch.styles.js +6 -6
- package/dist/components/inputs/switch-field/switch-field.d.ts +4 -4
- package/dist/components/inputs/switch-field/switch-field.js +4 -4
- package/dist/components/inputs/text-editor/text-editor.caret.d.ts +1 -1
- package/dist/components/inputs/text-editor/text-editor.caret.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.commands.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.d.ts +21 -21
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +27 -27
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.js +4 -4
- package/dist/components/inputs/text-editor/text-editor.markdown.js +7 -7
- package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.ordered-list.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.js +14 -14
- package/dist/components/inputs/text-field/text-field.d.ts +20 -19
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.js +22 -24
- package/dist/components/inputs/text-field/text-field.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.styles.js +3 -3
- package/dist/components/inputs/toggle-button/toggle-button.d.ts +14 -13
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +18 -18
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts +7 -7
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js +25 -17
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.d.ts +24 -29
- package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.i18n.d.ts +1 -1
- package/dist/components/inputs/token-field/token-field.i18n.js +1 -1
- package/dist/components/inputs/token-field/token-field.i18n.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.js +35 -39
- package/dist/components/inputs/token-field/token-field.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.styles.js +4 -4
- package/dist/components/inputs/token-field/token-field.template.js +1 -1
- package/dist/components/inputs/token-field/token-field.template.js.map +1 -1
- package/dist/components/layout/app-view/app-view.d.ts +16 -4
- package/dist/components/layout/app-view/app-view.d.ts.map +1 -1
- package/dist/components/layout/app-view/app-view.js +18 -13
- package/dist/components/layout/app-view/app-view.js.map +1 -1
- package/dist/components/layout/box/box.d.ts +1 -1
- package/dist/components/layout/box/box.js +1 -1
- package/dist/components/layout/box/box.styles.d.ts.map +1 -1
- package/dist/components/layout/box/box.styles.js +8 -18
- package/dist/components/layout/box/box.styles.js.map +1 -1
- package/dist/components/layout/card/card.d.ts +26 -9
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.i18n.d.ts +1 -1
- package/dist/components/layout/card/card.i18n.js +1 -1
- package/dist/components/layout/card/card.i18n.js.map +1 -1
- package/dist/components/layout/card/card.js +51 -14
- package/dist/components/layout/card/card.js.map +1 -1
- package/dist/components/layout/card/card.styles.d.ts.map +1 -1
- package/dist/components/layout/card/card.styles.js +41 -4
- package/dist/components/layout/card/card.styles.js.map +1 -1
- package/dist/components/layout/card/card.template.d.ts.map +1 -1
- package/dist/components/layout/card/card.template.js +14 -6
- package/dist/components/layout/card/card.template.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +3 -10
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +3 -10
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/collection/collection.styles.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.styles.js +21 -3
- package/dist/components/layout/collection/collection.styles.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +41 -41
- package/dist/components/layout/container/container.js +41 -41
- package/dist/components/layout/page/page.d.ts +1 -1
- package/dist/components/layout/page/page.js +2 -2
- package/dist/components/layout/page-footer/page-footer.d.ts +10 -12
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +11 -13
- 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 +8 -1
- package/dist/components/layout/page-footer/page-footer.styles.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.template.js +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +1 -3
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +1 -3
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +1 -3
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js +1 -3
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +1 -3
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +1 -3
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +20 -18
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +26 -20
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +20 -2
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +1 -3
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.js +1 -3
- package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +1 -3
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +1 -3
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts +18 -47
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +18 -47
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +9 -17
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +39 -27
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +4 -4
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +4 -4
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +17 -17
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +17 -17
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.d.ts +2 -2
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js +2 -2
- package/dist/components/layout/window/window.d.ts +26 -20
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +58 -30
- package/dist/components/layout/window/window.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/cell/cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.styles.js +1 -0
- package/dist/components/lists-and-tables/cells/cell/cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.js +1 -0
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.d.ts +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.i18n.d.ts +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.i18n.js +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.i18n.js.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js +2 -2
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.styles.js +1 -0
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js +1 -0
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +1 -0
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.d.ts +43 -9
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.js +69 -9
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.styles.js +100 -43
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.template.js +19 -7
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +1 -0
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +77 -31
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.i18n.d.ts +4 -4
- package/dist/components/lists-and-tables/list/list.i18n.js +4 -4
- package/dist/components/lists-and-tables/list/list.i18n.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +202 -70
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.styles.js +29 -22
- package/dist/components/lists-and-tables/list/list.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.template.js +4 -3
- package/dist/components/lists-and-tables/list/list.template.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +189 -18
- 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.i18n.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.js +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +467 -45
- 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 +133 -101
- package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.js +51 -24
- package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-action/list-item-action.d.ts +108 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.d.ts.map +1 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.js +228 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.js.map +1 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.styles.d.ts +2 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.styles.d.ts.map +1 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.styles.js +145 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.styles.js.map +1 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.template.d.ts +3 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.template.d.ts.map +1 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.template.js +35 -0
- package/dist/components/lists-and-tables/list-item-action/list-item-action.template.js.map +1 -0
- package/dist/components/lists-and-tables/table/table.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.js +4 -2
- package/dist/components/lists-and-tables/table/table.styles.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +5 -7
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js +5 -7
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.template.js +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +15 -16
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.d.ts +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.js +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +14 -15
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +2 -2
- package/dist/components/navigation/link/link.i18n.d.ts +1 -1
- package/dist/components/navigation/link/link.i18n.js +1 -1
- package/dist/components/navigation/link/link.i18n.js.map +1 -1
- package/dist/components/navigation/link/link.template.js +1 -1
- package/dist/components/navigation/link/link.template.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +1 -1
- package/dist/components/navigation/pagination/pagination.i18n.d.ts +1 -1
- package/dist/components/navigation/pagination/pagination.i18n.js +1 -1
- package/dist/components/navigation/pagination/pagination.i18n.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.styles.js +5 -5
- package/dist/components/navigation/pagination/pagination.template.js +1 -1
- package/dist/components/navigation/pagination/pagination.template.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +11 -11
- package/dist/components/navigation/tab-bar/tab-bar.js +11 -11
- package/dist/components/navigation/tab-bar/tab-bar.styles.js +7 -7
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +11 -11
- 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 +11 -12
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +9 -4
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +5 -5
- package/dist/components/navigation/top-title-bar/top-title-bar.js +6 -6
- 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 +3 -3
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.i18n.d.ts +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.i18n.js +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.i18n.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +4 -4
- 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.js +6 -6
- package/dist/components/status-and-feedback/badge/badge.d.ts +2 -2
- package/dist/components/status-and-feedback/badge/badge.i18n.d.ts +1 -1
- package/dist/components/status-and-feedback/badge/badge.i18n.js +1 -1
- package/dist/components/status-and-feedback/badge/badge.i18n.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.js +1 -1
- package/dist/components/status-and-feedback/badge/badge.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.d.ts +9 -9
- package/dist/components/status-and-feedback/banner/banner.js +9 -9
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts +6 -6
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +6 -6
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts +7 -7
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js +8 -8
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.js +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +22 -8
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +63 -27
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.js +1 -0
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts +13 -13
- package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.d.ts +2 -2
- package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.js +2 -2
- package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js +14 -14
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.js +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts +15 -15
- package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.d.ts +2 -2
- package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.js +2 -2
- package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js +20 -20
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js +3 -3
- package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js +4 -4
- package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +4 -4
- package/dist/components/status-and-feedback/status-bar/status-bar.js +4 -4
- package/dist/components/status-and-feedback/step-indicator/step-indicator.d.ts +124 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.d.ts.map +1 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.i18n.d.ts +9 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.i18n.d.ts.map +1 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.i18n.js +8 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.i18n.js.map +1 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.js +210 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.js.map +1 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.styles.d.ts +3 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.styles.d.ts.map +1 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.styles.js +294 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.styles.js.map +1 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.template.d.ts +5 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.template.d.ts.map +1 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.template.js +69 -0
- package/dist/components/status-and-feedback/step-indicator/step-indicator.template.js.map +1 -0
- package/dist/css/form.css +16 -7
- package/dist/css/settings.css +68 -73
- package/dist/types/vue.d.ts +186 -42
- package/dist/utilities/autofocus.d.ts +19 -0
- package/dist/utilities/autofocus.d.ts.map +1 -0
- package/dist/utilities/autofocus.js +35 -0
- package/dist/utilities/autofocus.js.map +1 -0
- package/dist/utilities/codemirror/theme.js +2 -2
- package/dist/utilities/codemirror/theme.js.map +1 -1
- package/dist/utilities/color-scheme-repaint.d.ts +2 -2
- package/dist/utilities/color-scheme-repaint.js +2 -2
- package/dist/utilities/form-associated-mixin.d.ts +33 -0
- package/dist/utilities/form-associated-mixin.d.ts.map +1 -0
- package/dist/utilities/form-associated-mixin.js +52 -0
- package/dist/utilities/form-associated-mixin.js.map +1 -0
- package/dist/utilities/input-modality.d.ts +3 -1
- package/dist/utilities/input-modality.d.ts.map +1 -1
- package/dist/utilities/input-modality.js +12 -1
- package/dist/utilities/input-modality.js.map +1 -1
- package/dist/utilities/page-section-mixin.d.ts +1 -1
- package/dist/utilities/page-section-mixin.js +2 -2
- package/dist/utilities/popup-anchor-controller.d.ts +2 -2
- package/package.json +9 -1
|
@@ -4,6 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var NLDDListItem_1;
|
|
7
8
|
import { LitElement } from 'lit';
|
|
8
9
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
9
10
|
import { reflectNonDefault } from '../../../utilities/reflect-non-default.js';
|
|
@@ -12,11 +13,54 @@ import { template } from './list-item.template.js';
|
|
|
12
13
|
import { isPointerMode } from '../../../utilities/input-modality.js';
|
|
13
14
|
import { withTranslations } from '../../../utilities/with-translations.js';
|
|
14
15
|
import { nlddListItemTranslations } from './list-item.i18n.js';
|
|
15
|
-
import '../cells/spacer-cell/spacer-cell.js';
|
|
16
16
|
/**
|
|
17
|
-
* A row within an `nldd-list
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* A row within an `nldd-list`. Renders as a link when `href` is set, as a
|
|
18
|
+
* checkbox when `checkbox` is set, as a button when `button` is set, or as a
|
|
19
|
+
* plain container otherwise. All cells and action segmented actions share one flat
|
|
20
|
+
* slot, in source order.
|
|
21
|
+
*
|
|
22
|
+
* ## Geometry
|
|
23
|
+
* Two rules govern every row:
|
|
24
|
+
* 1. State fills always paint the WIDENED row geometry — the row box extended
|
|
25
|
+
* by the indicator inline inset on both sides — whether or not the row is
|
|
26
|
+
* interactive. Paint never differs between a selected plain row and a
|
|
27
|
+
* selected interactive row.
|
|
28
|
+
* 2. The widened strip belongs to the ROW, never to a segment. A row with any
|
|
29
|
+
* action (its own `href`/`button`/`checkbox`, or a slotted segment) pulls
|
|
30
|
+
* itself outward (`is-interactive` host class → negative inline margin)
|
|
31
|
+
* and pads the row block back by the same amount, so content stays on the
|
|
32
|
+
* grid. A row-wide action owns that padding itself, making the whole
|
|
33
|
+
* widened box one hit area; slotted segmented actions stay in the grid, so their
|
|
34
|
+
* footprint is position-independent and tree columns line up at any depth.
|
|
35
|
+
*
|
|
36
|
+
* ## Divider
|
|
37
|
+
* The divider spans the content width by default. Mark a cell with
|
|
38
|
+
* `divider-start` and/or `divider-end` to run it from that cell's start edge
|
|
39
|
+
* to that cell's end edge instead (e.g. starting after an avatar). Multiple
|
|
40
|
+
* markers resolve as the union: first `divider-start` through last
|
|
41
|
+
* `divider-end`. A start past the last end is an authoring error — the item
|
|
42
|
+
* DEV-warns and falls back to the full content width.
|
|
43
|
+
*
|
|
44
|
+
* ## Disclosure
|
|
45
|
+
* A branch row can disclose its children in two ways: a dedicated
|
|
46
|
+
* `nldd-list-item-action[disclosure]` segment (only the chevron is clickable),
|
|
47
|
+
* or the row itself as the control (`button` + `expanded`, the whole row
|
|
48
|
+
* toggles). In the second case, mark the chevron's `nldd-icon-cell` with
|
|
49
|
+
* `disclosure` and the row turns it with `expanded` — the same affordance,
|
|
50
|
+
* without having to trade a clickable row for a turning chevron.
|
|
51
|
+
*
|
|
52
|
+
* `checkbox` makes the WHOLE row the control: the inner action becomes a
|
|
53
|
+
* `role="checkbox"` button carrying `aria-checked`, it toggles `checked` on
|
|
54
|
+
* activation and fires `change`. Slot a visual `nldd-checkbox` (or any glyph)
|
|
55
|
+
* before the text and mark it `aria-hidden` + non-focusable — the row already
|
|
56
|
+
* conveys role and state, and a second focusable control would double the tab
|
|
57
|
+
* stops. Do NOT nest a real `<input type="checkbox">` in the action: interactive
|
|
58
|
+
* content inside a `<button>` is invalid HTML and AT announces the button, not
|
|
59
|
+
* the checked state. A `<label>` variant is not offered for the same reason it
|
|
60
|
+
* cannot work — label-to-input association walks the DOM tree, and a slotted
|
|
61
|
+
* input is not a descendant of a label in the shadow root.
|
|
62
|
+
*
|
|
63
|
+
* When it renders as a link, `target` and `rel`
|
|
20
64
|
* are forwarded to the inner `<a>` (e.g. `target="_blank" rel="noopener noreferrer"`). With
|
|
21
65
|
* `target="_blank"` the item also injects a visually hidden "opens in new tab"
|
|
22
66
|
* announcement for assistive technology (WCAG 2.1 SC 3.2.2).
|
|
@@ -24,36 +68,43 @@ import '../cells/spacer-cell/spacer-cell.js';
|
|
|
24
68
|
* The item synchronises its ARIA with its parent `nldd-list`'s `type`:
|
|
25
69
|
* - `list` parent → `role="listitem"`
|
|
26
70
|
* - `navigation` parent → `role="listitem"` + `aria-current="page"` on the
|
|
27
|
-
*
|
|
71
|
+
* inner `<a>` / `<button>` when `selected`
|
|
28
72
|
* - `listbox` parent → `role="option"` + `aria-selected` reflecting `selected`.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
73
|
+
* The list points its search input's `aria-activedescendant`
|
|
74
|
+
* at the active option via `_highlighted` (separate from `selected`).
|
|
31
75
|
*
|
|
32
76
|
* @element nldd-list-item
|
|
33
77
|
*
|
|
34
|
-
* @attr {'sm'|'md'} size - Row size (default: 'md')
|
|
78
|
+
* @attr {'sm'|'md'} size - Row size (default: 'md'). Pushed onto the cells whose `size` means the same scale (nldd-text-cell, nldd-drag-handle-cell), so it is written once per row instead of once per cell. A size set on the cell itself wins. Cells where `size` means something else — pixels on nldd-icon-cell / nldd-spacer-cell, a heading scale on nldd-title-cell — are left alone.
|
|
35
79
|
* @attr {boolean} selected - Marks the item as selected. Selection is consumer-managed; the list never sets it. In a `navigation` parent it puts `aria-current="page"` on the inner action, in a `listbox` parent it drives `aria-selected`.
|
|
36
80
|
* @attr {boolean} button - Renders the item as a `<button>`; ignored when `href` is set (a link wins)
|
|
81
|
+
* @attr {boolean} checkbox - Makes the whole row a `role="checkbox"` control; ignored when `href` is set
|
|
82
|
+
* @attr {boolean} checked - Checked state of a `checkbox` row; the item toggles it on activation
|
|
83
|
+
* @attr {boolean} expanded - Disclosure state. Drives the `children` group's visibility AND supplies `aria-expanded` — to the row's own control when the row is interactive, or to the segmented action marked `disclosure`. Written once either way; the item DEV-warns when there is nowhere for it to live.
|
|
37
84
|
* @attr {string} href - Renders the item as an `<a>` with this URL. Takes precedence over `button`; without either the item is a plain container with no action.
|
|
38
85
|
* @attr {string} target - Link target forwarded to the `<a>` (e.g. '_blank'); only applies with `href`. With '_blank' a visually hidden "opens in new tab" announcement is added for assistive technology.
|
|
39
86
|
* @attr {string} rel - Link rel forwarded to the `<a>` (e.g. 'noopener noreferrer'); only applies with `href`
|
|
40
87
|
* @attr {boolean} reorderable - Set by the parent `nldd-list` when its own `reorderable` is on (with `type="list"`); consumers do not set this. Serves as a CSS hook for drag handle visibility.
|
|
41
88
|
*
|
|
42
|
-
* @slot
|
|
43
|
-
* @slot
|
|
44
|
-
*
|
|
89
|
+
* @slot - Cells and segmented actions, in source order
|
|
90
|
+
* @slot children - Child rows of a branch in an `nldd-list type="tree"`. Rendered as a `role="group"` below the row, hidden while `expanded` is false. The nesting IS the hierarchy, so aria-level / -posinset / -setsize are derived, not authored. The group has no styling of its own: repeat a spacer-cell per level to indent, or show depth some other way.
|
|
91
|
+
*
|
|
92
|
+
* @fires change - On a `checkbox` row after it toggles; detail: { checked: boolean }
|
|
45
93
|
*/
|
|
46
|
-
let NLDDListItem = class NLDDListItem extends withTranslations(LitElement, nlddListItemTranslations) {
|
|
94
|
+
let NLDDListItem = NLDDListItem_1 = class NLDDListItem extends withTranslations(LitElement, nlddListItemTranslations) {
|
|
47
95
|
constructor() {
|
|
48
96
|
super(...arguments);
|
|
49
97
|
this.size = 'md';
|
|
50
98
|
this.selected = false;
|
|
51
99
|
/** When set, renders the item as a button; ignored when href is set. */
|
|
52
100
|
this.button = false;
|
|
101
|
+
/** When set, the whole row is the checkbox control. Ignored when href is set. */
|
|
102
|
+
this.checkbox = false;
|
|
103
|
+
/** Checked state of a `checkbox` row. Toggled by the item on activation. */
|
|
104
|
+
this.checked = false;
|
|
53
105
|
/** Set by the parent nldd-list when reorderable is enabled. Used as a CSS hook for drag handle visibility. */
|
|
54
106
|
this.reorderable = false;
|
|
55
|
-
this.
|
|
56
|
-
this._showEnd = false;
|
|
107
|
+
this._showChildren = false;
|
|
57
108
|
this._parentType = 'list';
|
|
58
109
|
/** Set by the parent nldd-list when `arrow-navigation` (roving tabindex) is on.
|
|
59
110
|
* Switches the inner action from a normal tab stop to a roving one. */
|
|
@@ -68,10 +119,27 @@ let NLDDListItem = class NLDDListItem extends withTranslations(LitElement, nlddL
|
|
|
68
119
|
* `_active`, which would clash with the pressed / `:active` feedback). */
|
|
69
120
|
this._highlighted = false;
|
|
70
121
|
this._isBoxed = false;
|
|
71
|
-
this.
|
|
122
|
+
this._hasCheckedSegment = false;
|
|
123
|
+
this._lightDomObserver = null;
|
|
124
|
+
/** Watches the row and its divider-marker cells for size changes; marker
|
|
125
|
+
* insets are measured, so any reflow can move them. */
|
|
126
|
+
this._dividerMarkerObserver = null;
|
|
127
|
+
this._observedMarkerTargets = [];
|
|
128
|
+
this._warnedDegenerateDivider = false;
|
|
129
|
+
/** Remembers the size a cell was authored with, so a later push can restore it. */
|
|
130
|
+
this._ownCellSize = new WeakMap();
|
|
131
|
+
this._handleClick = (e) => {
|
|
72
132
|
// Safari and Firefox on Mac don't focus buttons on click. Force focus
|
|
73
133
|
// so :has(.list-item__action:focus) and :focus-within CSS work reliably.
|
|
74
134
|
this._action?.focus();
|
|
135
|
+
if (this.checkbox && !this.href && e.composedPath().includes(this._action)) {
|
|
136
|
+
this.checked = !this.checked;
|
|
137
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
138
|
+
detail: { checked: this.checked },
|
|
139
|
+
bubbles: true,
|
|
140
|
+
composed: true,
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
75
143
|
};
|
|
76
144
|
this._handleFocusIn = () => {
|
|
77
145
|
// Safari treats programmatic focus (forced on click for Safari/Firefox)
|
|
@@ -88,6 +156,11 @@ let NLDDListItem = class NLDDListItem extends withTranslations(LitElement, nlddL
|
|
|
88
156
|
// Primary button / touch / pen only (mouse right-click has button > 0).
|
|
89
157
|
if (e.button > 0)
|
|
90
158
|
return;
|
|
159
|
+
// A branch's child rows are light-DOM children, so their pointer events
|
|
160
|
+
// bubble through this row. Without this check, pressing a nested row
|
|
161
|
+
// flashes the press state of every ancestor row above it.
|
|
162
|
+
if (this._isFromNestedRow(e))
|
|
163
|
+
return;
|
|
91
164
|
this._action?.classList.add('is-pressed');
|
|
92
165
|
};
|
|
93
166
|
this._clearPressed = () => {
|
|
@@ -96,6 +169,8 @@ let NLDDListItem = class NLDDListItem extends withTranslations(LitElement, nlddL
|
|
|
96
169
|
}
|
|
97
170
|
connectedCallback() {
|
|
98
171
|
super.connectedCallback();
|
|
172
|
+
// Before the children upgrade — see _captureAuthoredCellSizes.
|
|
173
|
+
this._captureAuthoredCellSizes();
|
|
99
174
|
// Skip setup for drag clones — they are visual-only copies inside nldd-list's shadow root
|
|
100
175
|
if (this.hasAttribute('data-nldd-clone'))
|
|
101
176
|
return;
|
|
@@ -112,6 +187,18 @@ let NLDDListItem = class NLDDListItem extends withTranslations(LitElement, nlddL
|
|
|
112
187
|
this.addEventListener('pointerdown', this._onPointerDown);
|
|
113
188
|
this.addEventListener('pointerup', this._clearPressed);
|
|
114
189
|
this.addEventListener('pointercancel', this._clearPressed);
|
|
190
|
+
// Light-DOM state the row derives styling from: a checked checkbox-
|
|
191
|
+
// segment (row-wide selected fill), which segmented actions own a row edge, and
|
|
192
|
+
// the divider markers. Attribute observation, not events: consumers
|
|
193
|
+
// also set these programmatically via setAttribute.
|
|
194
|
+
this._lightDomObserver = new MutationObserver(() => this._onLightDomChange());
|
|
195
|
+
this._lightDomObserver.observe(this, {
|
|
196
|
+
subtree: true,
|
|
197
|
+
childList: true,
|
|
198
|
+
attributes: true,
|
|
199
|
+
attributeFilter: ['checked', 'divider-start', 'divider-end'],
|
|
200
|
+
});
|
|
201
|
+
this._onLightDomChange();
|
|
115
202
|
}
|
|
116
203
|
disconnectedCallback() {
|
|
117
204
|
super.disconnectedCallback();
|
|
@@ -121,23 +208,146 @@ let NLDDListItem = class NLDDListItem extends withTranslations(LitElement, nlddL
|
|
|
121
208
|
this.removeEventListener('pointerdown', this._onPointerDown);
|
|
122
209
|
this.removeEventListener('pointerup', this._clearPressed);
|
|
123
210
|
this.removeEventListener('pointercancel', this._clearPressed);
|
|
211
|
+
this._lightDomObserver?.disconnect();
|
|
212
|
+
this._lightDomObserver = null;
|
|
213
|
+
this._dividerMarkerObserver?.disconnect();
|
|
214
|
+
this._dividerMarkerObserver = null;
|
|
215
|
+
}
|
|
216
|
+
_onLightDomChange() {
|
|
217
|
+
this._updateCheckedSegment();
|
|
218
|
+
this._updateInteractive();
|
|
219
|
+
this._measureDividerMarkers();
|
|
220
|
+
}
|
|
221
|
+
/** A checked checkbox-segment reads as "this row is selected", so the fill
|
|
222
|
+
* covers the whole row — including a disclosure segment — instead of
|
|
223
|
+
* stopping at the segmented action boundary. Scoped to own descendants: a checked
|
|
224
|
+
* row in a nested branch must not light up its ancestors. */
|
|
225
|
+
_updateCheckedSegment() {
|
|
226
|
+
this._hasCheckedSegment =
|
|
227
|
+
this._ownDescendants('nldd-list-item-action[checkbox][checked]').length > 0;
|
|
228
|
+
}
|
|
229
|
+
/** A row with any action — its own href/button/checkbox or a slotted
|
|
230
|
+
* segment — carries the widened geometry: negative host margin plus the
|
|
231
|
+
* compensating row padding (see the geometry rules in the class doc).
|
|
232
|
+
*
|
|
233
|
+
* An action segment at a row edge owns the padding for that side itself,
|
|
234
|
+
* so the row drops its own there and the segmented action lands on the row's edge.
|
|
235
|
+
* Stamped as classes because the CSS cannot ask: `:has()` is not allowed
|
|
236
|
+
* inside `:host()`, and the row's own padding is what has to change — a
|
|
237
|
+
* `::slotted()` rule could only reach the segmented action. */
|
|
238
|
+
_updateInteractive() {
|
|
239
|
+
const interactive = !!this.href || this.button || this.checkbox ||
|
|
240
|
+
this._ownDescendants('nldd-list-item-action').length > 0;
|
|
241
|
+
this.classList.toggle('is-interactive', interactive);
|
|
242
|
+
// The row's own children, not the branch's child rows: those go to the
|
|
243
|
+
// `children` slot and render BELOW the row, so on a branch row the last
|
|
244
|
+
// element child is a nested row rather than the row's trailing segment.
|
|
245
|
+
const ownChildren = Array.from(this.children)
|
|
246
|
+
.filter(el => el.getAttribute('slot') !== 'children');
|
|
247
|
+
const isSegment = (el) => el?.tagName.toLowerCase() === 'nldd-list-item-action';
|
|
248
|
+
this.classList.toggle('has-leading-action', isSegment(ownChildren[0]));
|
|
249
|
+
this.classList.toggle('has-trailing-action', isSegment(ownChildren[ownChildren.length - 1]));
|
|
124
250
|
}
|
|
125
251
|
firstUpdated() {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
this._observeStartSlot();
|
|
130
|
-
this._observeEndSlot();
|
|
252
|
+
// Clones are visual-only copies inside nldd-list's shadow root: their
|
|
253
|
+
// classes and stamped attributes came along with cloneNode, so no sync.
|
|
254
|
+
if (this.hasAttribute('data-nldd-clone'))
|
|
131
255
|
return;
|
|
132
|
-
}
|
|
133
256
|
this._syncWithList();
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
257
|
+
this._observeChildrenSlot();
|
|
258
|
+
this._updateChildren();
|
|
259
|
+
this._relayExpanded();
|
|
260
|
+
// First measurement after the first render: the marker offsets need
|
|
261
|
+
// laid-out boxes.
|
|
262
|
+
this._measureDividerMarkers();
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* The row's own descendants for `selector` — everything down to and inside
|
|
266
|
+
* its action segmented actions, but NOT inside a nested row. In a tree the child rows
|
|
267
|
+
* are DOM children of this row, so a plain querySelectorAll would push this
|
|
268
|
+
* row's state into theirs (a parent's `expanded` turning every nested
|
|
269
|
+
* chevron, its `size` overwriting theirs). A `:scope >` child selector is
|
|
270
|
+
* too strict the other way: cells legitimately sit one level deeper, inside
|
|
271
|
+
* an nldd-list-item-action.
|
|
272
|
+
*/
|
|
273
|
+
_ownDescendants(selector) {
|
|
274
|
+
return Array.from(this.querySelectorAll(selector))
|
|
275
|
+
.filter(el => el.closest('nldd-list-item') === this);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Records the authored `size` before the cells upgrade. Custom elements
|
|
279
|
+
* upgrade in document order, so the item's connectedCallback runs before its
|
|
280
|
+
* children's — the only moment an authored `size="md"` is still readable.
|
|
281
|
+
* After upgrade `reflectNonDefault` strips it, making it indistinguishable
|
|
282
|
+
* from no attribute at all.
|
|
283
|
+
*/
|
|
284
|
+
_captureAuthoredCellSizes() {
|
|
285
|
+
this._ownDescendants(NLDDListItem_1.SIZED_CELLS).forEach(cell => {
|
|
286
|
+
if (!this._ownCellSize.has(cell)) {
|
|
287
|
+
this._ownCellSize.set(cell, cell.getAttribute('size'));
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Pushes the row's size onto its sized cells so `size="sm"` is written once
|
|
293
|
+
* instead of on the row and on every cell. An explicit size on the cell wins
|
|
294
|
+
* and survives later pushes.
|
|
295
|
+
*/
|
|
296
|
+
_propagateSize() {
|
|
297
|
+
this._captureAuthoredCellSizes();
|
|
298
|
+
this._ownDescendants(NLDDListItem_1.SIZED_CELLS).forEach(cell => {
|
|
299
|
+
const own = this._ownCellSize.get(cell);
|
|
300
|
+
if (own !== null && own !== undefined)
|
|
301
|
+
return;
|
|
302
|
+
cell.setAttribute('size', this.size);
|
|
303
|
+
});
|
|
136
304
|
}
|
|
137
305
|
updated(changed) {
|
|
138
|
-
if (changed.has('selected') || changed.has('button') || changed.has('href') || changed.has('_parentType')) {
|
|
306
|
+
if (changed.has('selected') || changed.has('button') || changed.has('checkbox') || changed.has('href') || changed.has('_parentType')) {
|
|
139
307
|
this._updateAriaState();
|
|
140
308
|
}
|
|
309
|
+
if (changed.has('button') || changed.has('checkbox') || changed.has('href')) {
|
|
310
|
+
this._updateInteractive();
|
|
311
|
+
}
|
|
312
|
+
if (changed.has('expanded')) {
|
|
313
|
+
this._relayExpanded();
|
|
314
|
+
this._warnOnStrayExpanded();
|
|
315
|
+
}
|
|
316
|
+
if (changed.has('_arrowNavigation') || changed.has('_rovingActive')) {
|
|
317
|
+
this._syncRovingTabStops();
|
|
318
|
+
}
|
|
319
|
+
this._propagateSize();
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* A row WITH children is a branch, and a branch is either open or closed —
|
|
323
|
+
* there is no third state. So an absent `expanded` reads as collapsed there,
|
|
324
|
+
* and aria-expanded is always emitted. On a row without children an absent
|
|
325
|
+
* attribute keeps its other meaning: this row discloses nothing, emit no
|
|
326
|
+
* aria-expanded at all. Without this split, `?expanded=\${false}` (which
|
|
327
|
+
* removes the attribute) would leave a branch that never collapses.
|
|
328
|
+
*/
|
|
329
|
+
get _resolvedExpanded() {
|
|
330
|
+
if (this._showChildren)
|
|
331
|
+
return this.expanded === true;
|
|
332
|
+
return this.expanded;
|
|
333
|
+
}
|
|
334
|
+
/** Segments marked `disclosure` announce the row's expanded state, so the
|
|
335
|
+
* consumer writes it once — here, where it also drives the children group. */
|
|
336
|
+
_relayExpanded() {
|
|
337
|
+
this._ownDescendants('nldd-list-item-action[disclosure]')
|
|
338
|
+
.forEach(action => { action._rowExpanded = this._resolvedExpanded; });
|
|
339
|
+
}
|
|
340
|
+
/** `expanded` needs a control to sit on; a plain container has none. */
|
|
341
|
+
_warnOnStrayExpanded() {
|
|
342
|
+
if (!import.meta.env?.DEV)
|
|
343
|
+
return;
|
|
344
|
+
if (this.expanded === undefined)
|
|
345
|
+
return;
|
|
346
|
+
if (this.href || this.button || this.checkbox)
|
|
347
|
+
return;
|
|
348
|
+
if (this._ownDescendants('nldd-list-item-action[disclosure]').length > 0)
|
|
349
|
+
return;
|
|
350
|
+
console.warn('nldd-list-item: `expanded` needs somewhere to live — make the row interactive (href, button or checkbox), or mark the segmented action that does the disclosing with `disclosure`.');
|
|
141
351
|
}
|
|
142
352
|
/** True when the item is an option in a `type="listbox"` parent. */
|
|
143
353
|
get _isListboxOption() {
|
|
@@ -164,18 +374,38 @@ let NLDDListItem = class NLDDListItem extends withTranslations(LitElement, nlddL
|
|
|
164
374
|
}
|
|
165
375
|
_applyVariant(variant) {
|
|
166
376
|
this._isBoxed = variant === 'box';
|
|
377
|
+
this._relayToChildren(item => item._applyVariant(variant));
|
|
167
378
|
this.classList.toggle('is-boxed', this._isBoxed);
|
|
168
|
-
this._updateVisibility();
|
|
169
379
|
}
|
|
170
380
|
_applyParentType(type) {
|
|
171
381
|
this._parentType = type;
|
|
382
|
+
this._relayToChildren(item => item._applyParentType(type));
|
|
383
|
+
// Segment actions need the list type too: in a listbox they degrade to a
|
|
384
|
+
// plain container, since an `option` may not hold interactive descendants.
|
|
385
|
+
// Own segmented actions only — nested rows get the relay above and push their own.
|
|
386
|
+
this._ownDescendants('nldd-list-item-action')
|
|
387
|
+
.forEach(action => action._applyParentType?.(type));
|
|
388
|
+
}
|
|
389
|
+
/** Nested rows sit in this item's `children` slot, not the list's, so a plain
|
|
390
|
+
* `querySelector` from the list walks past them. */
|
|
391
|
+
get childRows() {
|
|
392
|
+
return Array.from(this.children)
|
|
393
|
+
.filter(el => el.getAttribute('slot') === 'children' && el.tagName.toLowerCase() === 'nldd-list-item');
|
|
394
|
+
}
|
|
395
|
+
/** Every push the item receives is relayed one level down. */
|
|
396
|
+
_relayToChildren(fn) {
|
|
397
|
+
this.childRows.forEach(fn);
|
|
172
398
|
}
|
|
173
399
|
_updateAriaState() {
|
|
174
400
|
// In a listbox parent the item is an `option`, not a `listitem`, and
|
|
175
401
|
// carries aria-selected so AT announces selection state. The active
|
|
176
402
|
// option (the input's aria-activedescendant) is conveyed via `_highlighted`
|
|
177
403
|
// (a highlight class), kept separate from selection.
|
|
178
|
-
if (this.
|
|
404
|
+
if (this._parentType === 'tree') {
|
|
405
|
+
this.setAttribute('role', 'treeitem');
|
|
406
|
+
this.removeAttribute('aria-selected');
|
|
407
|
+
}
|
|
408
|
+
else if (this._isListboxOption) {
|
|
179
409
|
this.setAttribute('role', 'option');
|
|
180
410
|
this.setAttribute('aria-selected', String(this.selected));
|
|
181
411
|
}
|
|
@@ -192,30 +422,207 @@ let NLDDListItem = class NLDDListItem extends withTranslations(LitElement, nlddL
|
|
|
192
422
|
action?.removeAttribute('aria-current');
|
|
193
423
|
}
|
|
194
424
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
425
|
+
/**
|
|
426
|
+
* Measures the divider markers and writes the result as `--_divider-inset-
|
|
427
|
+
* start/-end` on the host. No markers → the vars are cleared and CSS falls
|
|
428
|
+
* back to the content width. Union semantics: the divider runs from the
|
|
429
|
+
* FIRST `divider-start` to the LAST `divider-end`; a side without markers
|
|
430
|
+
* keeps its default. Insets are measured against the row block (the widened
|
|
431
|
+
* box on interactive rows), so the values compose with the edge geometry.
|
|
432
|
+
*/
|
|
433
|
+
_measureDividerMarkers() {
|
|
434
|
+
if (this.hasAttribute('data-nldd-clone'))
|
|
435
|
+
return;
|
|
436
|
+
const starts = this._ownDescendants('[divider-start]');
|
|
437
|
+
const ends = this._ownDescendants('[divider-end]');
|
|
438
|
+
// Re-target the resize observer ONLY when the marker set changed: every
|
|
439
|
+
// observe() fires an initial notification, so retargeting on each
|
|
440
|
+
// measurement would loop the observer on itself.
|
|
441
|
+
const targets = starts.length || ends.length ? [this, ...starts, ...ends] : [];
|
|
442
|
+
const sameTargets = targets.length === this._observedMarkerTargets.length
|
|
443
|
+
&& targets.every((target, i) => target === this._observedMarkerTargets[i]);
|
|
444
|
+
if (!sameTargets) {
|
|
445
|
+
this._dividerMarkerObserver?.disconnect();
|
|
446
|
+
this._observedMarkerTargets = targets;
|
|
447
|
+
if (targets.length) {
|
|
448
|
+
this._dividerMarkerObserver ?? (this._dividerMarkerObserver = new ResizeObserver(() => this._measureDividerMarkers()));
|
|
449
|
+
targets.forEach(target => this._dividerMarkerObserver.observe(target));
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
this._dividerMarkerObserver = null;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
if (targets.length === 0) {
|
|
456
|
+
this.style.removeProperty('--_divider-inset-start');
|
|
457
|
+
this.style.removeProperty('--_divider-inset-end');
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
const block = this.shadowRoot?.querySelector('.list-item');
|
|
461
|
+
if (!block)
|
|
462
|
+
return;
|
|
463
|
+
const blockRect = block.getBoundingClientRect();
|
|
464
|
+
if (blockRect.width === 0)
|
|
465
|
+
return;
|
|
466
|
+
const rtl = getComputedStyle(this).direction === 'rtl';
|
|
467
|
+
const startInsetOf = (rect) => rtl ? blockRect.right - rect.right : rect.left - blockRect.left;
|
|
468
|
+
const endInsetOf = (rect) => rtl ? rect.left - blockRect.left : blockRect.right - rect.right;
|
|
469
|
+
// Union: smallest start inset (= first marker) and smallest end inset
|
|
470
|
+
// (= last marker) win.
|
|
471
|
+
const insetStart = starts.length
|
|
472
|
+
? Math.min(...starts.map(el => startInsetOf(el.getBoundingClientRect())))
|
|
473
|
+
: null;
|
|
474
|
+
const insetEnd = ends.length
|
|
475
|
+
? Math.min(...ends.map(el => endInsetOf(el.getBoundingClientRect())))
|
|
476
|
+
: null;
|
|
477
|
+
if (insetStart !== null && insetEnd !== null
|
|
478
|
+
&& blockRect.width - insetStart - insetEnd <= 0) {
|
|
479
|
+
// A start past the last end: authoring error, fall back to full width.
|
|
480
|
+
if (import.meta.env?.DEV && !this._warnedDegenerateDivider) {
|
|
481
|
+
this._warnedDegenerateDivider = true;
|
|
482
|
+
console.warn('nldd-list-item: divider-start ligt voorbij de laatste divider-end; de divider valt terug op de volle contentbreedte.');
|
|
483
|
+
}
|
|
484
|
+
this.style.removeProperty('--_divider-inset-start');
|
|
485
|
+
this.style.removeProperty('--_divider-inset-end');
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
if (insetStart !== null)
|
|
489
|
+
this.style.setProperty('--_divider-inset-start', `${insetStart}px`);
|
|
490
|
+
else
|
|
491
|
+
this.style.removeProperty('--_divider-inset-start');
|
|
492
|
+
if (insetEnd !== null)
|
|
493
|
+
this.style.setProperty('--_divider-inset-end', `${insetEnd}px`);
|
|
494
|
+
else
|
|
495
|
+
this.style.removeProperty('--_divider-inset-end');
|
|
496
|
+
}
|
|
497
|
+
_observeChildrenSlot() {
|
|
498
|
+
const slot = this.shadowRoot?.querySelector('slot[name="children"]');
|
|
499
|
+
slot?.addEventListener('slotchange', () => this._updateChildren());
|
|
200
500
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
501
|
+
/** Renders the group only when there is something in it — an empty
|
|
502
|
+
* `role="group"` would be an empty branch in the accessibility tree. */
|
|
503
|
+
_updateChildren() {
|
|
504
|
+
const slot = this.shadowRoot?.querySelector('slot[name="children"]');
|
|
505
|
+
const rows = (slot?.assignedElements() ?? []).filter(el => el.tagName.toLowerCase() === 'nldd-list-item');
|
|
506
|
+
const had = this._showChildren;
|
|
507
|
+
this._showChildren = rows.length > 0;
|
|
508
|
+
if (this._showChildren !== had)
|
|
509
|
+
this._relayExpanded();
|
|
510
|
+
if (this._showChildren) {
|
|
511
|
+
// Nested rows are not in the list's own slot, so the list's pushes never
|
|
512
|
+
// reach them. Relay what we were given, and they relay it downwards.
|
|
513
|
+
rows.forEach(row => {
|
|
514
|
+
const item = row;
|
|
515
|
+
item._applyVariant?.(this._isBoxed ? 'box' : 'simple');
|
|
516
|
+
item._applyParentType?.(this._parentType);
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
if (!import.meta.env?.DEV)
|
|
520
|
+
return;
|
|
521
|
+
if (this._showChildren && this._parentType !== 'tree') {
|
|
522
|
+
console.warn('nldd-list-item: `slot="children"` nests rows, which only carries meaning in an nldd-list with type="tree". Elsewhere the group has no owning tree and assistive technology cannot read the hierarchy.');
|
|
523
|
+
}
|
|
524
|
+
if (this._showChildren && this.expanded === undefined) {
|
|
525
|
+
console.warn('nldd-list-item: a row with children needs `expanded` — without it there is no aria-expanded, so the branch reads as a leaf and the group can never be announced as collapsed.');
|
|
526
|
+
}
|
|
204
527
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
528
|
+
/** Whether the event started in a row nested inside this one. Only the part
|
|
529
|
+
* of the path BELOW this row counts — everything above it is this row's own
|
|
530
|
+
* ancestry, which is where the event is heading, not where it came from. */
|
|
531
|
+
_isFromNestedRow(e) {
|
|
532
|
+
const path = e.composedPath();
|
|
533
|
+
const self = path.indexOf(this);
|
|
534
|
+
return path
|
|
535
|
+
.slice(0, self === -1 ? path.length : self)
|
|
536
|
+
.some(el => el instanceof Element && el.localName === 'nldd-list-item');
|
|
208
537
|
}
|
|
209
538
|
/**
|
|
210
539
|
* Delegates focus to the inner `.list-item__action` (the button or anchor),
|
|
211
540
|
* so consumers can call `listItemEl.focus()` without reaching into shadow DOM.
|
|
212
541
|
*/
|
|
213
542
|
focus(options) {
|
|
214
|
-
|
|
543
|
+
// A tree row without a control of its own (only segmented actions, or
|
|
544
|
+
// none at all) takes focus on the host: that is where role="treeitem"
|
|
545
|
+
// sits, so assistive technology announces the row rather than a button
|
|
546
|
+
// inside it. _syncRovingTabStops gives the host the tabindex for it.
|
|
547
|
+
if (this._action) {
|
|
548
|
+
this._action.focus(options);
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
super.focus(options);
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* The roving tab stop, spread over the row and the controls inside it: the
|
|
555
|
+
* current row is reachable with Tab, everything else only with the arrow
|
|
556
|
+
* keys. Within the current row Tab then walks its segmented actions, so a row
|
|
557
|
+
* that holds a checkbox and a chevron stays fully operable.
|
|
558
|
+
*
|
|
559
|
+
* A row that is not the current one carries NO tabindex at all rather than
|
|
560
|
+
* -1. A shadow host with a tabindex is a focus scope of its own, and Chromium
|
|
561
|
+
* walks straight past such a scope when tabbing BACKWARDS if the host itself
|
|
562
|
+
* isn't tabbable — so a `-1` on a branch made every row inside it
|
|
563
|
+
* unreachable with Shift+Tab, while forward navigation still found them.
|
|
564
|
+
*
|
|
565
|
+
* @internal Also called by the list right after it moves the roving, so the
|
|
566
|
+
* tab stop is in the DOM before focus is handed over.
|
|
567
|
+
*/
|
|
568
|
+
_syncRovingTabStops() {
|
|
569
|
+
const ownActions = Array.from(this.children).filter((el) => el.getAttribute('slot') !== 'children'
|
|
570
|
+
&& el.tagName.toLowerCase() === 'nldd-list-item-action');
|
|
571
|
+
if (!this._arrowNavigation) {
|
|
572
|
+
this.removeAttribute('tabindex');
|
|
573
|
+
ownActions.forEach((action) => { action._tabbable = undefined; });
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
// Only a row without its own control needs the host as focus target; with
|
|
577
|
+
// a control the tabindex sits on that control (see render()).
|
|
578
|
+
if (this._action || !this._rovingActive) {
|
|
579
|
+
this.removeAttribute('tabindex');
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
this.setAttribute('tabindex', '0');
|
|
583
|
+
}
|
|
584
|
+
ownActions.forEach((action) => { action._tabbable = this._rovingActive; });
|
|
585
|
+
}
|
|
586
|
+
/** The control that opens and closes this row: the segmented action marked
|
|
587
|
+
* `disclosure`, or the row itself when it is a button. Never a link — Left
|
|
588
|
+
* and Right may not navigate away. */
|
|
589
|
+
get _disclosureControl() {
|
|
590
|
+
const action = Array.from(this.children).find((el) => el.getAttribute('slot') !== 'children'
|
|
591
|
+
&& el.tagName.toLowerCase() === 'nldd-list-item-action'
|
|
592
|
+
&& el.hasAttribute('disclosure'));
|
|
593
|
+
if (action)
|
|
594
|
+
return action;
|
|
595
|
+
if (this.button && !this.href)
|
|
596
|
+
return this._action;
|
|
597
|
+
return undefined;
|
|
598
|
+
}
|
|
599
|
+
/** Activates whatever opens this row, so the consumer's own click handler runs
|
|
600
|
+
* and stays the only place `expanded` is written. Returns false when the row
|
|
601
|
+
* has nothing to activate. */
|
|
602
|
+
_activateDisclosure() {
|
|
603
|
+
const control = this._disclosureControl;
|
|
604
|
+
if (!control)
|
|
605
|
+
return false;
|
|
606
|
+
// The click lands on a segmented action, and that action pulls focus into
|
|
607
|
+
// its own control — with the pointer-focus flag set, since a click is what
|
|
608
|
+
// it sees. Focus belongs to the row: that is the roving tab stop, and the
|
|
609
|
+
// keyboard user has to keep seeing where they are.
|
|
610
|
+
const hadFocus = this.matches(':focus-within');
|
|
611
|
+
control.click();
|
|
612
|
+
if (hadFocus)
|
|
613
|
+
this.focus();
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
616
|
+
/** The branch this row hangs under, or undefined for a top-level row. */
|
|
617
|
+
get parentRow() {
|
|
618
|
+
const parent = this.parentElement;
|
|
619
|
+
if (!parent || parent.tagName.toLowerCase() !== 'nldd-list-item')
|
|
620
|
+
return undefined;
|
|
621
|
+
return parent;
|
|
215
622
|
}
|
|
216
623
|
render() {
|
|
217
624
|
const opensInNewTabLabel = this.href && this.target === '_blank'
|
|
218
|
-
? this._t('components.list-item.opens-in-new-tab-
|
|
625
|
+
? this._t('components.list-item.opens-in-new-tab-label')
|
|
219
626
|
: undefined;
|
|
220
627
|
// Listbox options are never separate tab stops — only the list's own
|
|
221
628
|
// search input is in the tab order, and active moves via
|
|
@@ -230,10 +637,16 @@ let NLDDListItem = class NLDDListItem extends withTranslations(LitElement, nlddL
|
|
|
230
637
|
: this._arrowNavigation
|
|
231
638
|
? (this._rovingActive ? '0' : '-1')
|
|
232
639
|
: undefined;
|
|
233
|
-
return template(this.button, this.href, this.target, this.rel, this.
|
|
640
|
+
return template(this.button, this.href, this.target, this.rel, opensInNewTabLabel, actionTabindex, this._highlighted, this.checkbox, this.checked, this._resolvedExpanded, this._showChildren, this._hasCheckedSegment);
|
|
234
641
|
}
|
|
235
642
|
};
|
|
236
643
|
NLDDListItem.styles = [listItemStyles];
|
|
644
|
+
/**
|
|
645
|
+
* Cells whose `size` means the sm/md scale. NOT every cell: `size` on
|
|
646
|
+
* nldd-icon-cell and nldd-spacer-cell is a pixel value and on nldd-title-cell
|
|
647
|
+
* a 1-6 heading scale, so pushing 'sm' there would corrupt them.
|
|
648
|
+
*/
|
|
649
|
+
NLDDListItem.SIZED_CELLS = 'nldd-text-cell, nldd-drag-handle-cell';
|
|
237
650
|
__decorate([
|
|
238
651
|
property({ reflect: true, converter: reflectNonDefault('md') })
|
|
239
652
|
], NLDDListItem.prototype, "size", void 0);
|
|
@@ -243,6 +656,15 @@ __decorate([
|
|
|
243
656
|
__decorate([
|
|
244
657
|
property({ type: Boolean, reflect: true })
|
|
245
658
|
], NLDDListItem.prototype, "button", void 0);
|
|
659
|
+
__decorate([
|
|
660
|
+
property({ type: Boolean, reflect: true })
|
|
661
|
+
], NLDDListItem.prototype, "checkbox", void 0);
|
|
662
|
+
__decorate([
|
|
663
|
+
property({ type: Boolean, reflect: true })
|
|
664
|
+
], NLDDListItem.prototype, "checked", void 0);
|
|
665
|
+
__decorate([
|
|
666
|
+
property({ type: Boolean, reflect: true })
|
|
667
|
+
], NLDDListItem.prototype, "expanded", void 0);
|
|
246
668
|
__decorate([
|
|
247
669
|
property({ reflect: true })
|
|
248
670
|
], NLDDListItem.prototype, "href", void 0);
|
|
@@ -257,10 +679,7 @@ __decorate([
|
|
|
257
679
|
], NLDDListItem.prototype, "reorderable", void 0);
|
|
258
680
|
__decorate([
|
|
259
681
|
state()
|
|
260
|
-
], NLDDListItem.prototype, "
|
|
261
|
-
__decorate([
|
|
262
|
-
state()
|
|
263
|
-
], NLDDListItem.prototype, "_showEnd", void 0);
|
|
682
|
+
], NLDDListItem.prototype, "_showChildren", void 0);
|
|
264
683
|
__decorate([
|
|
265
684
|
state()
|
|
266
685
|
], NLDDListItem.prototype, "_parentType", void 0);
|
|
@@ -276,7 +695,10 @@ __decorate([
|
|
|
276
695
|
__decorate([
|
|
277
696
|
query('.list-item__action')
|
|
278
697
|
], NLDDListItem.prototype, "_action", void 0);
|
|
279
|
-
|
|
698
|
+
__decorate([
|
|
699
|
+
state()
|
|
700
|
+
], NLDDListItem.prototype, "_hasCheckedSegment", void 0);
|
|
701
|
+
NLDDListItem = NLDDListItem_1 = __decorate([
|
|
280
702
|
customElement('nldd-list-item')
|
|
281
703
|
], NLDDListItem);
|
|
282
704
|
export { NLDDListItem };
|