@nldd/design-system 0.8.91 → 0.8.93
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/NOTICES.md +9 -27
- package/README.md +39 -26
- package/custom-elements.json +1936 -1460
- package/dist/components/actions/button/button.d.ts +22 -5
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +48 -12
- 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 +3 -1
- 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 +5 -4
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/button-group/button-group.d.ts +48 -3
- package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.js +104 -11
- package/dist/components/actions/button-group/button-group.js.map +1 -1
- package/dist/components/actions/button-group/button-group.styles.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.styles.js +64 -4
- package/dist/components/actions/button-group/button-group.styles.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +7 -6
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +7 -12
- package/dist/components/actions/icon-button/icon-button.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 +9 -5
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +29 -29
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +53 -53
- 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 +4 -0
- 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 +8 -2
- package/dist/components/actions/menu/menu.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +24 -10
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +57 -26
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +7 -7
- package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.js +5 -3
- package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
- package/dist/components/components.js +2060 -1065
- package/dist/components/content/avatar/avatar.d.ts +25 -10
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +25 -18
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar/avatar.template.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.template.js +7 -3
- package/dist/components/content/avatar/avatar.template.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts +1 -1
- package/dist/components/content/avatar-group/avatar-group.js +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.js +6 -2
- package/dist/components/content/avatar-group/avatar-group.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 +12 -2
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/icon/icon.d.ts +20 -8
- package/dist/components/content/icon/icon.d.ts.map +1 -1
- package/dist/components/content/icon/icon.js +32 -12
- package/dist/components/content/icon/icon.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts +1 -1
- package/dist/components/content/identity/identity.js +1 -1
- package/dist/components/content/identity/identity.template.d.ts.map +1 -1
- package/dist/components/content/identity/identity.template.js +4 -1
- package/dist/components/content/identity/identity.template.js.map +1 -1
- package/dist/components/content/image/image.template.d.ts.map +1 -1
- package/dist/components/content/image/image.template.js +7 -2
- package/dist/components/content/image/image.template.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +18 -9
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +24 -15
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/tag/tag.d.ts +2 -2
- package/dist/components/content/tag/tag.d.ts.map +1 -1
- package/dist/components/content/tag/tag.js +5 -5
- package/dist/components/content/tag/tag.js.map +1 -1
- package/dist/components/content/tag/tag.template.js +2 -2
- package/dist/components/content/title/title.d.ts +30 -6
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +72 -8
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/content/title/title.styles.d.ts.map +1 -1
- package/dist/components/content/title/title.styles.js +41 -4
- package/dist/components/content/title/title.styles.js.map +1 -1
- package/dist/components/content/title/title.template.d.ts +2 -1
- package/dist/components/content/title/title.template.d.ts.map +1 -1
- package/dist/components/content/title/title.template.js +33 -5
- package/dist/components/content/title/title.template.js.map +1 -1
- package/dist/components/content/token/token.d.ts +15 -5
- package/dist/components/content/token/token.d.ts.map +1 -1
- package/dist/components/content/token/token.i18n.d.ts +7 -0
- package/dist/components/content/token/token.i18n.d.ts.map +1 -0
- package/dist/components/content/token/token.i18n.js +6 -0
- package/dist/components/content/token/token.i18n.js.map +1 -0
- package/dist/components/content/token/token.js +55 -14
- package/dist/components/content/token/token.js.map +1 -1
- package/dist/components/content/token/token.template.js +4 -4
- package/dist/components/content/token/token.template.js.map +1 -1
- package/dist/components/{dist-CENYEz7C.js → dist-B5ie2Bo9.js} +1 -1
- package/dist/components/{dist-D_ckX1sK.js → dist-BUu-NW5O.js} +1 -1
- package/dist/components/{dist-Y54Lma86.js → dist-CGOykrJw.js} +2 -2
- package/dist/components/{dist-CYLM5ciE.js → dist-CQzaKTa8.js} +1 -1
- package/dist/components/{dist-yyE8P2O6.js → dist-CSYXsT7W.js} +2 -2
- package/dist/components/{dist-BLaE_n_F.js → dist-CoUVHSu-.js} +1 -1
- package/dist/components/{dist-DHA-0RyT.js → dist-Dn3c5gfb.js} +7 -1
- package/dist/components/{dist-BeymuiGt.js → dist-Dxn9Up8K.js} +3 -3
- package/dist/components/{dist-Dh_b9r4M.js → dist-M6GKopqu.js} +1 -1
- package/dist/components/{dist-TCqV9dho.js → dist-OlffRM7-.js} +1 -1
- package/dist/components/{dist-DkZlotgT.js → dist-RPaf2J9c.js} +2 -2
- package/dist/components/forms/form/form.d.ts +18 -7
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +18 -7
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-actions/form-actions.d.ts +1 -1
- package/dist/components/forms/form-actions/form-actions.js +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +12 -1
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +12 -1
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/forms/form-section/form-section.d.ts +3 -3
- package/dist/components/forms/form-section/form-section.js +8 -8
- package/dist/components/forms/form-section/form-section.js.map +1 -1
- package/dist/components/forms/validation-list/validation-list.d.ts +7 -4
- package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.js +7 -4
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/{icon-C_zwJZ_g.js → icon-DWNVcttg.js} +4 -4
- package/dist/components/{icon-button-CEz4MB9H.js → icon-button-hO6k8W63.js} +20 -20
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/inputs/checkbox/checkbox.template.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.template.js +11 -5
- package/dist/components/inputs/checkbox/checkbox.template.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts +4 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +4 -1
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.template.js +2 -2
- package/dist/components/inputs/date-field/date-field.d.ts +1 -1
- package/dist/components/inputs/date-field/date-field.js +1 -1
- package/dist/components/inputs/date-field/date-field.template.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.template.js +5 -3
- package/dist/components/inputs/date-field/date-field.template.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.d.ts +1 -1
- package/dist/components/inputs/date-picker/date-picker.js +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.js +1 -1
- package/dist/components/inputs/dropdown/dropdown.template.js +3 -3
- package/dist/components/inputs/file-field/file-field.template.js +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.template.js +2 -2
- package/dist/components/inputs/number-field/number-field.styles.js +4 -4
- package/dist/components/inputs/password-field/password-field.template.js +2 -2
- package/dist/components/inputs/radio-button/radio-button.styles.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.js +0 -10
- package/dist/components/inputs/radio-button/radio-button.styles.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.template.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.template.js +6 -4
- package/dist/components/inputs/radio-button/radio-button.template.js.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.styles.js +0 -10
- package/dist/components/inputs/radio-button-field/radio-button-field.styles.js.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.template.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.template.js +4 -3
- package/dist/components/inputs/radio-button-field/radio-button-field.template.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts +24 -24
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +40 -40
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.template.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.template.js +4 -2
- package/dist/components/inputs/search-field/search-field.template.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +3 -0
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +6 -0
- 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 +0 -10
- package/dist/components/inputs/segmented-control/segmented-control.styles.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.template.js +5 -5
- package/dist/components/inputs/segmented-control/segmented-control.template.js.map +1 -1
- package/dist/components/inputs/switch/switch.template.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js +78 -2
- package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.template.js +2 -2
- package/dist/components/inputs/time-field/time-field.d.ts +1 -1
- package/dist/components/inputs/time-field/time-field.js +1 -1
- package/dist/components/inputs/time-field/time-field.template.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.template.js +5 -3
- package/dist/components/inputs/time-field/time-field.template.js.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.d.ts +1 -1
- package/dist/components/inputs/time-picker/time-picker.js +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 +0 -9
- package/dist/components/inputs/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.template.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.template.js +7 -6
- package/dist/components/inputs/toggle-button/toggle-button.template.js.map +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.styles.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.styles.js +2 -1
- package/dist/components/inputs/token-field/token-field.styles.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.template.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.template.js +6 -4
- package/dist/components/inputs/token-field/token-field.template.js.map +1 -1
- package/dist/components/layout/app-view/app-view.d.ts +8 -0
- package/dist/components/layout/app-view/app-view.d.ts.map +1 -1
- package/dist/components/layout/app-view/app-view.js +8 -0
- package/dist/components/layout/app-view/app-view.js.map +1 -1
- package/dist/components/layout/card/card.d.ts +5 -8
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.js +8 -19
- package/dist/components/layout/card/card.js.map +1 -1
- package/dist/components/layout/card/card.template.d.ts.map +1 -1
- package/dist/components/layout/card/card.template.js +6 -3
- package/dist/components/layout/card/card.template.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +11 -6
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +19 -14
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/collection/collection.template.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.template.js +4 -1
- package/dist/components/layout/collection/collection.template.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +13 -8
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +19 -14
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +52 -2
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +94 -3
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page/page.template.d.ts +6 -0
- package/dist/components/layout/page/page.template.d.ts.map +1 -1
- package/dist/components/layout/page/page.template.js +21 -6
- package/dist/components/layout/page/page.template.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts +2 -2
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +4 -4
- package/dist/components/layout/page-footer/page-footer.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.template.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.template.js +16 -4
- package/dist/components/layout/page-footer/page-footer.template.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +4 -6
- 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 +4 -5
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.template.js +8 -2
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +13 -15
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +20 -21
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.template.js +6 -2
- package/dist/components/layout/page-sections/hero/hero.template.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +6 -8
- 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 +6 -7
- 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-half-one-half-section/one-half-one-half-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.template.js +8 -2
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +6 -8
- 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 +6 -7
- 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/one-third-two-thirds-section/one-third-two-thirds-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.template.js +8 -2
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/page-section-controls.d.ts +139 -44
- package/dist/components/layout/page-sections/page-section-controls.d.ts.map +1 -1
- package/dist/components/layout/page-sections/page-section-controls.js +44 -47
- package/dist/components/layout/page-sections/page-section-controls.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +11 -12
- 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 +19 -19
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js +8 -2
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +14 -8
- 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 +14 -7
- package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.template.js +8 -2
- package/dist/components/layout/page-sections/simple-section/simple-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +6 -8
- 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 +6 -7
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.js +8 -2
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.template.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts +12 -8
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +38 -18
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +26 -11
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +59 -20
- 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 +8 -4
- package/dist/components/layout/sheet/sheet.styles.js.map +1 -1
- package/dist/components/layout/sheet/sheet.template.js +1 -1
- package/dist/components/layout/sheet/sheet.template.js.map +1 -1
- package/dist/components/layout/spacer/spacer.d.ts +15 -2
- package/dist/components/layout/spacer/spacer.d.ts.map +1 -1
- package/dist/components/layout/spacer/spacer.js +15 -2
- package/dist/components/layout/spacer/spacer.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +4 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +4 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +11 -6
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +17 -12
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js +4 -0
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +3 -1
- 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 +3 -1
- 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/split-view-pane/split-view-pane.d.ts +4 -4
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.d.ts.map +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js +8 -8
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +30 -18
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +66 -31
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.d.ts +4 -2
- package/dist/components/lists-and-tables/cells/cell/cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.js +7 -5
- package/dist/components/lists-and-tables/cells/cell/cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.template.js +88 -16
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts +4 -2
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js +7 -5
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.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 +23 -0
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.template.js +11 -2
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +2 -2
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +5 -5
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.template.js +8 -2
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.d.ts +5 -5
- 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 +8 -8
- 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.template.js +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +3 -3
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +6 -6
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.template.js +8 -2
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +3 -3
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +6 -6
- 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 +4 -0
- 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 +25 -8
- 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 +61 -38
- 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 +106 -37
- 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 +4 -14
- 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.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.js +2 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +36 -11
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +46 -19
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js +4 -14
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +13 -3
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +2 -2
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +5 -5
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.template.js +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +6 -6
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +9 -3
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +1 -3
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.js +1 -11
- package/dist/components/navigation/link/link.js.map +1 -1
- package/dist/components/navigation/link/link.template.d.ts.map +1 -1
- package/dist/components/navigation/link/link.template.js +4 -3
- package/dist/components/navigation/link/link.template.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js +4 -4
- package/dist/components/navigation/pagination/pagination.styles.js +4 -4
- package/dist/components/navigation/pagination/pagination.template.js +1 -1
- package/dist/components/navigation/skip-link/skip-link.styles.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.styles.js +10 -4
- package/dist/components/navigation/skip-link/skip-link.styles.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js +2 -2
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.template.js +4 -2
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.template.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +6 -2
- 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 +7 -2
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.styles.js +2 -2
- package/dist/components/navigation/top-title-bar/top-title-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.template.js +18 -3
- package/dist/components/navigation/top-title-bar/top-title-bar.template.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js +4 -4
- package/dist/components/status-and-feedback/badge/badge.d.ts +1 -1
- package/dist/components/status-and-feedback/badge/badge.js +1 -1
- package/dist/components/status-and-feedback/badge/badge.template.js +1 -1
- package/dist/components/status-and-feedback/banner/banner.template.js +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +14 -5
- 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 +43 -13
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.js +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 +4 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts +8 -8
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +13 -13
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.template.js +5 -2
- package/dist/components/status-and-feedback/notification/notification.template.js.map +1 -1
- package/dist/components/status-and-feedback/notification/{notification-region.d.ts → notifications-area.d.ts} +3 -3
- package/dist/components/status-and-feedback/notification/notifications-area.d.ts.map +1 -0
- package/dist/components/status-and-feedback/notification/{notification-region.js → notifications-area.js} +137 -140
- package/dist/components/status-and-feedback/notification/notifications-area.js.map +1 -0
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js +4 -0
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.js +2 -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.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js +106 -18
- 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 +2 -4
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.js +2 -8
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.styles.js +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.template.js +3 -2
- package/dist/components/status-and-feedback/status-bar/status-bar.template.js.map +1 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.d.ts +4 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.js +4 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.template.js +2 -2
- package/dist/components/{with-translations-CqUV9S5g.js → with-translations-BAKFoEKy.js} +22 -1
- package/dist/css/form-section.css +4 -4
- package/dist/css/form.css +4 -0
- package/dist/css/fouc.css +1 -1
- package/dist/css/rich-text.css +26 -11
- package/dist/css/rijksoverheid-fonts.css +1 -1
- package/dist/css/variables.css +4 -15
- package/dist/favicon.svg +3 -8
- package/dist/nldd.min.js +1336 -898
- package/dist/touch-icon.png +0 -0
- package/dist/types/vue.d.ts +325 -278
- package/dist/utilities/form-associated-mixin.d.ts +2 -0
- package/dist/utilities/form-associated-mixin.d.ts.map +1 -1
- package/dist/utilities/form-associated-mixin.js +15 -1
- package/dist/utilities/form-associated-mixin.js.map +1 -1
- package/dist/utilities/link-rel.d.ts +13 -0
- package/dist/utilities/link-rel.d.ts.map +1 -0
- package/dist/utilities/link-rel.js +21 -0
- package/dist/utilities/link-rel.js.map +1 -0
- package/dist/utilities/page-section-mixin.d.ts +3 -8
- package/dist/utilities/page-section-mixin.d.ts.map +1 -1
- package/dist/utilities/page-section-mixin.js +4 -84
- package/dist/utilities/page-section-mixin.js.map +1 -1
- package/dist/utilities/title-bar-label-controller.d.ts +25 -0
- package/dist/utilities/title-bar-label-controller.d.ts.map +1 -0
- package/dist/utilities/title-bar-label-controller.js +52 -0
- package/dist/utilities/title-bar-label-controller.js.map +1 -0
- package/package.json +9 -7
- package/dist/components/status-and-feedback/notification/notification-region.d.ts.map +0 -1
- package/dist/components/status-and-feedback/notification/notification-region.js.map +0 -1
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* @attr {string} popovertarget - ID of a popover element this button invokes; forwarded to the inner button. Use the popoverTargetElement property instead when the popover lives in another tree.
|
|
12
12
|
* @attr {boolean} expandable - Whether the button has a icon to indicate it opens a menu or popover
|
|
13
13
|
* @attr {boolean} expanded - Whether the popover/menu controlled by this button is currently open. Forwarded as aria-expanded on the inner button; toggles the is-expanded visual state.
|
|
14
|
-
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state.
|
|
14
|
+
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state. An nldd-menu or nldd-popover in the `popup` slot, or anchored to this button, sets it itself from the first render; set it only for another kind of popup.
|
|
15
|
+
* @attr {string} form - Id of the form this button submits or resets, for a button that sits outside it. Takes an `nldd-form` as well as a plain `<form>`. Without it the button acts on the form it stands in. The id is looked up in the button's own root, as the platform does it: a button inside a shadow tree does not reach a form in the document around it. An id that finds nothing, or an `nldd-form` that has not rendered its form yet, says so in development rather than letting the click do nothing.
|
|
15
16
|
* @attr {string} width - Width mode: 'full' (stretches to container) or any CSS length (e.g. '240px')
|
|
16
17
|
* @attr {string} max-width - Caps the width at this CSS length (e.g. '320px'). Combines with `width="full"`: the button follows its container up to the cap. A label that doesn't fit is truncated with an ellipsis — a cap only means something if the content respects it.
|
|
17
18
|
* @attr {string} text - Button text
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
* @attr {string} accessible-label - Accessible label for the button, overrides text for screen readers
|
|
25
26
|
* @attr {string} href - When set, renders an <a> element instead of <button>
|
|
26
27
|
* @attr {string} target - Link target (e.g. '_blank'); only used when href is set. With '_blank' the button adds a visually hidden "opens in new tab" announcement for screen readers (WCAG 2.1 SC 3.2.2).
|
|
27
|
-
* @attr {string} rel - Link rel attribute;
|
|
28
|
+
* @attr {string} rel - Link rel attribute, used with href; with target '_blank', 'noopener noreferrer' is added to whatever you set
|
|
28
29
|
* @attr {object} translations - Override translation keys (e.g. the "opens in new tab" announcement); unset keys fall back to Dutch.
|
|
29
30
|
*
|
|
30
31
|
* @slot text - Slot for custom button content (e.g. text with inline markup). Used when the text attribute is empty or not set (an empty string counts as "not set", since the attribute and the unset property are indistinguishable). Provide accessible-label when the slotted content isn't plain text.
|
|
@@ -124,18 +125,34 @@ export declare class NLDDButton extends NLDDButton_base {
|
|
|
124
125
|
target: string | undefined;
|
|
125
126
|
/**
|
|
126
127
|
* Link rel attribute. Only used when href is set.
|
|
127
|
-
*
|
|
128
|
+
* With target '_blank', 'noopener noreferrer' is added to it.
|
|
128
129
|
*/
|
|
129
130
|
rel: string | undefined;
|
|
130
131
|
private _warnedA11y;
|
|
132
|
+
private _warnedFormId;
|
|
131
133
|
/** Shared wiring for an overlay slotted into `popup`: anchors it to this
|
|
132
134
|
* button and turns clicks into open/close. Not private: the template module
|
|
133
135
|
* binds its handlers. */
|
|
134
136
|
_popup: PopupAnchorController;
|
|
135
137
|
updated(changedProperties: Map<string, unknown>): void;
|
|
136
138
|
private _handleClick;
|
|
137
|
-
/**
|
|
138
|
-
|
|
139
|
+
/**
|
|
140
|
+
* The form this button acts on: the one it sits in, or the one its `form`
|
|
141
|
+
* attribute names.
|
|
142
|
+
*
|
|
143
|
+
* The platform resolves that attribute itself, but only to a real `<form>`.
|
|
144
|
+
* An `nldd-form` renders its form in the light DOM without handing it the id
|
|
145
|
+
* the consumer wrote, so an id pointing at the component finds an element
|
|
146
|
+
* that is not a form, and the button ends up with no form owner at all. That
|
|
147
|
+
* is the whole reason a save button in a page footer, outside the form it
|
|
148
|
+
* belongs to, used to do nothing.
|
|
149
|
+
*
|
|
150
|
+
* The id is looked up in the button's own root, the same scope the platform
|
|
151
|
+
* searches: a button inside a shadow tree reaches the forms in that tree, not
|
|
152
|
+
* one in the document around it. Put the two in the same tree, or hand the
|
|
153
|
+
* button its form another way.
|
|
154
|
+
*/
|
|
155
|
+
private _ownerForm;
|
|
139
156
|
/**
|
|
140
157
|
* Delegates focus to the inner `<button>` (or `<a>` when `href` is set), so
|
|
141
158
|
* consumers can call `buttonEl.focus()` without reaching into shadow DOM.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAOjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,8BAA8B,CAAC;AACtC,OAAO,sEAAsE,CAAC;AAG9E,KAAK,OAAO,GACT,SAAS,GACT,WAAW,GACX,aAAa,GACb,eAAe,GACf,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,GACd,qBAAqB,GACrB,iBAAiB,GACjB,sBAAsB,GACtB,gBAAgB,GAChB,gBAAgB,CAAC;AACpB,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACtC,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAChD,KAAK,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;;;;;;;AAEjE,qBACa,UAAW,SAAQ,eAAiE;IAChG,OAAgB,MAAM,0BAAgB;IAKtC,MAAM,CAAC,cAAc,UAAQ;IAC7B,OAAO,CAAC,UAAU,CAA0B;IAG5C,OAAO,EAAE,OAAO,CAAoB;IAGpC,IAAI,EAAE,IAAI,CAAQ;IAElB,mGAAmG;IAEnG,mBAAmB,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAM;I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Ae,IAAI,OAAO,GAAG,IAAI;IAIjC,MAAM;CAKf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;CACD"}
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* @attr {string} popovertarget - ID of a popover element this button invokes; forwarded to the inner button. Use the popoverTargetElement property instead when the popover lives in another tree.
|
|
12
12
|
* @attr {boolean} expandable - Whether the button has a icon to indicate it opens a menu or popover
|
|
13
13
|
* @attr {boolean} expanded - Whether the popover/menu controlled by this button is currently open. Forwarded as aria-expanded on the inner button; toggles the is-expanded visual state.
|
|
14
|
-
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state.
|
|
14
|
+
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state. An nldd-menu or nldd-popover in the `popup` slot, or anchored to this button, sets it itself from the first render; set it only for another kind of popup.
|
|
15
|
+
* @attr {string} form - Id of the form this button submits or resets, for a button that sits outside it. Takes an `nldd-form` as well as a plain `<form>`. Without it the button acts on the form it stands in. The id is looked up in the button's own root, as the platform does it: a button inside a shadow tree does not reach a form in the document around it. An id that finds nothing, or an `nldd-form` that has not rendered its form yet, says so in development rather than letting the click do nothing.
|
|
15
16
|
* @attr {string} width - Width mode: 'full' (stretches to container) or any CSS length (e.g. '240px')
|
|
16
17
|
* @attr {string} max-width - Caps the width at this CSS length (e.g. '320px'). Combines with `width="full"`: the button follows its container up to the cap. A label that doesn't fit is truncated with an ellipsis — a cap only means something if the content respects it.
|
|
17
18
|
* @attr {string} text - Button text
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
* @attr {string} accessible-label - Accessible label for the button, overrides text for screen readers
|
|
25
26
|
* @attr {string} href - When set, renders an <a> element instead of <button>
|
|
26
27
|
* @attr {string} target - Link target (e.g. '_blank'); only used when href is set. With '_blank' the button adds a visually hidden "opens in new tab" announcement for screen readers (WCAG 2.1 SC 3.2.2).
|
|
27
|
-
* @attr {string} rel - Link rel attribute;
|
|
28
|
+
* @attr {string} rel - Link rel attribute, used with href; with target '_blank', 'noopener noreferrer' is added to whatever you set
|
|
28
29
|
* @attr {object} translations - Override translation keys (e.g. the "opens in new tab" announcement); unset keys fall back to Dutch.
|
|
29
30
|
*
|
|
30
31
|
* @slot text - Slot for custom button content (e.g. text with inline markup). Used when the text attribute is empty or not set (an empty string counts as "not set", since the attribute and the unset property are indistinguishable). Provide accessible-label when the slotted content isn't plain text.
|
|
@@ -121,10 +122,11 @@ let NLDDButton = class NLDDButton extends DescribedBy(withTranslations(LitElemen
|
|
|
121
122
|
this.target = undefined;
|
|
122
123
|
/**
|
|
123
124
|
* Link rel attribute. Only used when href is set.
|
|
124
|
-
*
|
|
125
|
+
* With target '_blank', 'noopener noreferrer' is added to it.
|
|
125
126
|
*/
|
|
126
127
|
this.rel = undefined;
|
|
127
128
|
this._warnedA11y = false;
|
|
129
|
+
this._warnedFormId = null;
|
|
128
130
|
/** Shared wiring for an overlay slotted into `popup`: anchors it to this
|
|
129
131
|
* button and turns clicks into open/close. Not private: the template module
|
|
130
132
|
* binds its handlers. */
|
|
@@ -194,18 +196,52 @@ let NLDDButton = class NLDDButton extends DescribedBy(withTranslations(LitElemen
|
|
|
194
196
|
// or separate forms.
|
|
195
197
|
if (this.href)
|
|
196
198
|
return;
|
|
199
|
+
const form = this._ownerForm();
|
|
197
200
|
if (this.type === 'submit')
|
|
198
|
-
|
|
201
|
+
form?.requestSubmit();
|
|
199
202
|
else if (this.type === 'reset')
|
|
200
|
-
|
|
203
|
+
form?.reset();
|
|
201
204
|
}
|
|
202
|
-
/**
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
/**
|
|
206
|
+
* The form this button acts on: the one it sits in, or the one its `form`
|
|
207
|
+
* attribute names.
|
|
208
|
+
*
|
|
209
|
+
* The platform resolves that attribute itself, but only to a real `<form>`.
|
|
210
|
+
* An `nldd-form` renders its form in the light DOM without handing it the id
|
|
211
|
+
* the consumer wrote, so an id pointing at the component finds an element
|
|
212
|
+
* that is not a form, and the button ends up with no form owner at all. That
|
|
213
|
+
* is the whole reason a save button in a page footer, outside the form it
|
|
214
|
+
* belongs to, used to do nothing.
|
|
215
|
+
*
|
|
216
|
+
* The id is looked up in the button's own root, the same scope the platform
|
|
217
|
+
* searches: a button inside a shadow tree reaches the forms in that tree, not
|
|
218
|
+
* one in the document around it. Put the two in the same tree, or hand the
|
|
219
|
+
* button its form another way.
|
|
220
|
+
*/
|
|
221
|
+
_ownerForm() {
|
|
222
|
+
const id = this.getAttribute('form');
|
|
223
|
+
if (!id)
|
|
224
|
+
return this._internals.form;
|
|
225
|
+
const root = this.getRootNode();
|
|
226
|
+
const target = 'getElementById' in root ? root.getElementById(id) : null;
|
|
227
|
+
if (target instanceof HTMLFormElement)
|
|
228
|
+
return target;
|
|
229
|
+
const rendered = target?.form;
|
|
230
|
+
if (rendered instanceof HTMLFormElement)
|
|
231
|
+
return rendered;
|
|
232
|
+
// Nothing to submit is the silent failure this attribute exists to end:
|
|
233
|
+
// the click does nothing and no error says why. Say it once per button,
|
|
234
|
+
// naming what the id found, since a typo and an nldd-form that has not
|
|
235
|
+
// rendered yet look identical from the outside.
|
|
236
|
+
// Keyed on the id, not a flag: fix a typo and point at another form that
|
|
237
|
+
// does not exist either, and that one has to be said as well.
|
|
238
|
+
if (import.meta.env?.DEV && this._warnedFormId !== id) {
|
|
239
|
+
this._warnedFormId = id;
|
|
240
|
+
console.warn(target
|
|
241
|
+
? `<nldd-button form="${id}">: that id is an <${target.tagName.toLowerCase()}> without a form, so this button submits nothing. An nldd-form only has one once it has rendered.`
|
|
242
|
+
: `<nldd-button form="${id}">: nothing in this root has that id, so this button submits nothing.`);
|
|
243
|
+
}
|
|
244
|
+
return null;
|
|
209
245
|
}
|
|
210
246
|
/**
|
|
211
247
|
* Delegates focus to the inner `<button>` (or `<a>` when `href` is set), so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,8BAA8B,CAAC;AACtC,OAAO,sEAAsE,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAoBhE,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,WAAW,CAAC,gBAAgB,CAAC,UAAU,EAAE,sBAAsB,CAAC,CAAC;IAA1F;;QAOE,eAAU,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAG5C,YAAO,GAAY,gBAAgB,CAAC;QAGpC,SAAI,GAAS,IAAI,CAAC;QAElB,mGAAmG;QAEnG,wBAAmB,GAAqC,EAAE,CAAC;QAE3D,mEAAmE;QAEnE,UAAK,GA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AAOvC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACS;AApIxB,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA0QtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,yBAonBxB,CAAC"}
|
|
@@ -10,7 +10,9 @@ export const buttonStyles = css `
|
|
|
10
10
|
|
|
11
11
|
:host {
|
|
12
12
|
--_corner-radius: var(--semantics-controls-md-corner-radius);
|
|
13
|
-
|
|
13
|
+
/* A parent that stacks its buttons says so through the context variable;
|
|
14
|
+
the button's own width attribute overrides it with an inline style. */
|
|
15
|
+
--_width: var(--context-button-width, auto);
|
|
14
16
|
--_min-size: var(--semantics-controls-md-min-size);
|
|
15
17
|
--_block-padding: var(--semantics-controls-md-block-padding);
|
|
16
18
|
--_inline-padding: var(--semantics-buttons-md-inline-padding);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkC3B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAklBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.template.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"button.template.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/button.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,UAAU,eAAe;IACxB,WAAW,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACrC;AA+BD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,wCAiHlE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { html, nothing } from 'lit';
|
|
2
|
+
import { linkRel } from '../../../utilities/link-rel.js';
|
|
2
3
|
function renderContent(component) {
|
|
3
4
|
// `button__text` falls back to the slot on falsy `text`. The property
|
|
4
5
|
// defaults to '', so `text=""` and an absent attribute are indistinguishable
|
|
@@ -7,7 +8,7 @@ function renderContent(component) {
|
|
|
7
8
|
<span class="button__content">
|
|
8
9
|
${component.startIcon ? html `
|
|
9
10
|
<span class="button__start-icon">
|
|
10
|
-
<nldd-icon
|
|
11
|
+
<nldd-icon icon=${component.startIcon}></nldd-icon>
|
|
11
12
|
</span>
|
|
12
13
|
` : html `<slot name="start-icon"></slot>`}
|
|
13
14
|
<span class="button__text-area">
|
|
@@ -16,13 +17,13 @@ function renderContent(component) {
|
|
|
16
17
|
</span>
|
|
17
18
|
${component.endIcon ? html `
|
|
18
19
|
<span class="button__end-icon">
|
|
19
|
-
<nldd-icon
|
|
20
|
+
<nldd-icon icon=${component.endIcon}></nldd-icon>
|
|
20
21
|
</span>
|
|
21
22
|
` : html `<slot name="end-icon"></slot>`}
|
|
22
23
|
</span>
|
|
23
24
|
${component.expandable ? html `
|
|
24
25
|
<nldd-icon class="button__disclosure-icon"
|
|
25
|
-
|
|
26
|
+
icon="chevron-down-small"
|
|
26
27
|
></nldd-icon>
|
|
27
28
|
` : nothing}
|
|
28
29
|
`;
|
|
@@ -84,7 +85,7 @@ export function template(helpers) {
|
|
|
84
85
|
// _handleClick.
|
|
85
86
|
const popupSlot = html `<slot name="popup" @slotchange=${this._popup.handleSlotChange}></slot>`;
|
|
86
87
|
if (this.href) {
|
|
87
|
-
const resolvedRel = this.
|
|
88
|
+
const resolvedRel = linkRel(this.rel, this.target);
|
|
88
89
|
return html `
|
|
89
90
|
<a class=${buttonClass}
|
|
90
91
|
href=${this.href}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.template.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"button.template.js","sourceRoot":"","sources":["../../../../src/components/actions/button/button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAMzD,SAAS,aAAa,CAAC,SAAqB;IAC3C,sEAAsE;IACtE,6EAA6E;IAC7E,mEAAmE;IACnE,OAAO,IAAI,CAAA;;KAEP,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;;uBAER,SAAS,CAAC,SAAS;;IAEtC,CAAC,CAAC,CAAC,IAAI,CAAA,iCAAiC;;iCAEX,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,2BAA2B;MAC5F,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAA,yCAAyC,SAAS,CAAC,cAAc,SAAS,CAAC,CAAC,CAAC,OAAO;;KAEpH,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;;uBAEN,SAAS,CAAC,OAAO;;IAEpC,CAAC,CAAC,CAAC,IAAI,CAAA,+BAA+B;;IAEtC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAA;;;;GAI5B,CAAC,CAAC,CAAC,OAAO;EACX,CAAC;AACH,CAAC;AAED,MAAM,UAAU,QAAQ,CAAmB,OAAwB;IAClE,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAEpC,MAAM,WAAW,GAAG,CAAC,QAAQ;QAC5B,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAA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,iBAAiB;aACnC,OAAO,CAAC,WAAW;;MAE1B,OAAO;MACP,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAA,+CAA+C,iBAAiB,SAAS,CAAC,CAAC,CAAC,OAAO;;KAElH,gBAAgB;KAChB,SAAS;GACX,CAAC;IACH,CAAC;IAED,uEAAuE;IACvE,2EAA2E;IAC3E,wEAAwE;IACxE,yEAAyE;IACzE,wEAAwE;IACxE,OAAO,IAAI,CAAA;kBACM,WAAW;UACnB,IAAI,CAAC,IAAI;eACJ,IAAI,CAAC,QAAQ;mBACT,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;gBACnC,SAAS;mBACN,IAAI,CAAC,SAAS,IAAI,OAAO;mBACzB,YAAY;eAChB,QAAQ;cACT,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;mBACtB,IAAI,CAAC,aAAa,IAAI,OAAO;2BACrB,IAAI,CAAC,oBAAoB;0BAC1B,IAAI,CAAC,mBAAmB;kBAChC,IAAI,CAAC,MAAM,CAAC,iBAAiB;YACnC,OAAO,CAAC,WAAW;;KAE1B,OAAO;;IAER,gBAAgB;IAChB,SAAS;EACX,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Nederlandse Digitale Dienst Button Group Component (Lit + TypeScript)
|
|
3
3
|
*
|
|
4
|
-
* A container for grouping related buttons together,
|
|
4
|
+
* A container for grouping related buttons together, in a row or stacked.
|
|
5
|
+
*
|
|
6
|
+
* `auto`, the default, is a row on a container wide enough for one and a stack
|
|
7
|
+
* over the full width below the sm breakpoint, where two labels beside each
|
|
8
|
+
* other leave no room for either. The group is its own container, so it follows
|
|
9
|
+
* the width it was given rather than the width of the window: the same group is
|
|
10
|
+
* a row in a page and a stack in a sheet beside it.
|
|
11
|
+
*
|
|
12
|
+
* Being a container has one consequence to know: the width has to come from the
|
|
13
|
+
* parent, since a container may not size itself from what is inside it. In a
|
|
14
|
+
* parent that shrink-wraps its content (an inline-flex box, a float, a table
|
|
15
|
+
* cell, a flex item at `width: auto`) the group measures zero and its buttons
|
|
16
|
+
* are invisible. It says so once in development. Give the group or that parent
|
|
17
|
+
* a width.
|
|
18
|
+
*
|
|
19
|
+
* A stack fills the width with its buttons, except an `nldd-icon-button`, which
|
|
20
|
+
* keeps its own size: a bar with a single glyph in the middle is not a bigger
|
|
21
|
+
* target, only a wider one.
|
|
5
22
|
*
|
|
6
23
|
* @element nldd-button-group
|
|
7
24
|
* @attr {string} size - Button group size: 'sm' | 'md' (default: 'md')
|
|
8
|
-
* @attr {string} orientation - Layout direction: 'horizontal' | 'vertical' (default: '
|
|
25
|
+
* @attr {string} orientation - Layout direction: 'auto' | 'horizontal' | 'vertical' (default: 'auto')
|
|
9
26
|
*
|
|
10
27
|
* @slot - Default slot for buttons (max 3)
|
|
11
28
|
*
|
|
@@ -13,14 +30,42 @@
|
|
|
13
30
|
*/
|
|
14
31
|
import { LitElement } from 'lit';
|
|
15
32
|
type Size = 'sm' | 'md';
|
|
16
|
-
type Orientation = 'horizontal' | 'vertical';
|
|
33
|
+
type Orientation = 'auto' | 'horizontal' | 'vertical';
|
|
17
34
|
export declare class NLDDButtonGroup extends LitElement {
|
|
18
35
|
static styles: import("lit").CSSResult;
|
|
19
36
|
size: Size;
|
|
20
37
|
orientation: Orientation;
|
|
21
38
|
private _slot;
|
|
39
|
+
/** DEV only: watches for the collapse below, then lets itself go. */
|
|
40
|
+
private _collapseObserver;
|
|
41
|
+
/** Timer holding a zero-width reading before it counts as a verdict. */
|
|
42
|
+
private _collapseVerdict;
|
|
22
43
|
handleSlotChange(): void;
|
|
23
44
|
updated(changedProperties: Map<string, unknown>): void;
|
|
45
|
+
connectedCallback(): void;
|
|
46
|
+
disconnectedCallback(): void;
|
|
47
|
+
/**
|
|
48
|
+
* The group is an inline-size container while `orientation` is `auto`, so its
|
|
49
|
+
* width has to come from its parent: a container may not size itself from its
|
|
50
|
+
* own contents. In a parent that shrink-wraps (inline-flex, a float, a table
|
|
51
|
+
* cell, a flex item at `width: auto`) there is nothing to take, the group
|
|
52
|
+
* measures zero and the buttons disappear without an error.
|
|
53
|
+
*
|
|
54
|
+
* Watched rather than sampled: a group can be in a closed sheet or behind
|
|
55
|
+
* `display: none` on its first frame, and a parent can get its width a tick
|
|
56
|
+
* later, so one look would call both of those a collapse or miss the real
|
|
57
|
+
* one. The observer waits for the group to be displayed, says it once and
|
|
58
|
+
* stops watching either way. It starts again when the group is reconnected
|
|
59
|
+
* somewhere else or when `orientation` turns to `auto`, since both change
|
|
60
|
+
* the answer.
|
|
61
|
+
*
|
|
62
|
+
* A zero reading waits before it counts: a parent can hand over its width a
|
|
63
|
+
* frame or two after the first paint, and that looks exactly like a collapse
|
|
64
|
+
* until it does. Only a zero that is still zero when the timer runs out gets
|
|
65
|
+
* said out loud.
|
|
66
|
+
*/
|
|
67
|
+
private _watchForCollapse;
|
|
68
|
+
private _stopWatchingForCollapse;
|
|
24
69
|
render(): import("lit-html").TemplateResult<1>;
|
|
25
70
|
}
|
|
26
71
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMjC,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACxB,KAAK,WAAW,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;AAEtD,qBACa,eAAgB,SAAQ,UAAU;IAC9C,OAAgB,MAAM,0BAAqB;IAG3C,IAAI,EAAE,IAAI,CAAQ;IAGlB,WAAW,EAAE,WAAW,CAAU;IAGlC,OAAO,CAAC,KAAK,CAAmB;IAEhC,qEAAqE;IACrE,OAAO,CAAC,iBAAiB,CAA+B;IACxD,wEAAwE;IACxE,OAAO,CAAC,gBAAgB,CAAK;IAE7B,gBAAgB;IAeP,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAO/C,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAKrC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,iBAAiB;IAgCzB,OAAO,CAAC,wBAAwB;IAOvB,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD"}
|
|
@@ -7,11 +7,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
/**
|
|
8
8
|
* Nederlandse Digitale Dienst Button Group Component (Lit + TypeScript)
|
|
9
9
|
*
|
|
10
|
-
* A container for grouping related buttons together,
|
|
10
|
+
* A container for grouping related buttons together, in a row or stacked.
|
|
11
|
+
*
|
|
12
|
+
* `auto`, the default, is a row on a container wide enough for one and a stack
|
|
13
|
+
* over the full width below the sm breakpoint, where two labels beside each
|
|
14
|
+
* other leave no room for either. The group is its own container, so it follows
|
|
15
|
+
* the width it was given rather than the width of the window: the same group is
|
|
16
|
+
* a row in a page and a stack in a sheet beside it.
|
|
17
|
+
*
|
|
18
|
+
* Being a container has one consequence to know: the width has to come from the
|
|
19
|
+
* parent, since a container may not size itself from what is inside it. In a
|
|
20
|
+
* parent that shrink-wraps its content (an inline-flex box, a float, a table
|
|
21
|
+
* cell, a flex item at `width: auto`) the group measures zero and its buttons
|
|
22
|
+
* are invisible. It says so once in development. Give the group or that parent
|
|
23
|
+
* a width.
|
|
24
|
+
*
|
|
25
|
+
* A stack fills the width with its buttons, except an `nldd-icon-button`, which
|
|
26
|
+
* keeps its own size: a bar with a single glyph in the middle is not a bigger
|
|
27
|
+
* target, only a wider one.
|
|
11
28
|
*
|
|
12
29
|
* @element nldd-button-group
|
|
13
30
|
* @attr {string} size - Button group size: 'sm' | 'md' (default: 'md')
|
|
14
|
-
* @attr {string} orientation - Layout direction: 'horizontal' | 'vertical' (default: '
|
|
31
|
+
* @attr {string} orientation - Layout direction: 'auto' | 'horizontal' | 'vertical' (default: 'auto')
|
|
15
32
|
*
|
|
16
33
|
* @slot - Default slot for buttons (max 3)
|
|
17
34
|
*
|
|
@@ -26,7 +43,11 @@ let NLDDButtonGroup = class NLDDButtonGroup extends LitElement {
|
|
|
26
43
|
constructor() {
|
|
27
44
|
super(...arguments);
|
|
28
45
|
this.size = 'md';
|
|
29
|
-
this.orientation = '
|
|
46
|
+
this.orientation = 'auto';
|
|
47
|
+
/** DEV only: watches for the collapse below, then lets itself go. */
|
|
48
|
+
this._collapseObserver = null;
|
|
49
|
+
/** Timer holding a zero-width reading before it counts as a verdict. */
|
|
50
|
+
this._collapseVerdict = 0;
|
|
30
51
|
}
|
|
31
52
|
handleSlotChange() {
|
|
32
53
|
const assigned = this._slot
|
|
@@ -38,19 +59,91 @@ let NLDDButtonGroup = class NLDDButtonGroup extends LitElement {
|
|
|
38
59
|
if (import.meta.env?.DEV)
|
|
39
60
|
console.warn('nldd-button-group: Only 3 buttons are allowed. Extra buttons will be hidden.');
|
|
40
61
|
}
|
|
41
|
-
if (this.orientation === 'vertical') {
|
|
42
|
-
el.setAttribute('width', 'full');
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
el.removeAttribute('width');
|
|
46
|
-
}
|
|
47
62
|
el.setAttribute('size', this.size);
|
|
48
63
|
});
|
|
49
64
|
}
|
|
50
65
|
updated(changedProperties) {
|
|
51
|
-
if (changedProperties.has('
|
|
66
|
+
if (changedProperties.has('size'))
|
|
52
67
|
this.handleSlotChange();
|
|
68
|
+
// Switching to auto makes the group a container after the fact, so the
|
|
69
|
+
// question it can then fail is only worth asking from here on.
|
|
70
|
+
if (changedProperties.has('orientation'))
|
|
71
|
+
this._watchForCollapse();
|
|
72
|
+
}
|
|
73
|
+
connectedCallback() {
|
|
74
|
+
super.connectedCallback();
|
|
75
|
+
// Also on reconnect: a group that moves takes a new parent with it, and
|
|
76
|
+
// that parent decides whether there is a width to take.
|
|
77
|
+
this._watchForCollapse();
|
|
78
|
+
}
|
|
79
|
+
disconnectedCallback() {
|
|
80
|
+
super.disconnectedCallback();
|
|
81
|
+
this._stopWatchingForCollapse();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The group is an inline-size container while `orientation` is `auto`, so its
|
|
85
|
+
* width has to come from its parent: a container may not size itself from its
|
|
86
|
+
* own contents. In a parent that shrink-wraps (inline-flex, a float, a table
|
|
87
|
+
* cell, a flex item at `width: auto`) there is nothing to take, the group
|
|
88
|
+
* measures zero and the buttons disappear without an error.
|
|
89
|
+
*
|
|
90
|
+
* Watched rather than sampled: a group can be in a closed sheet or behind
|
|
91
|
+
* `display: none` on its first frame, and a parent can get its width a tick
|
|
92
|
+
* later, so one look would call both of those a collapse or miss the real
|
|
93
|
+
* one. The observer waits for the group to be displayed, says it once and
|
|
94
|
+
* stops watching either way. It starts again when the group is reconnected
|
|
95
|
+
* somewhere else or when `orientation` turns to `auto`, since both change
|
|
96
|
+
* the answer.
|
|
97
|
+
*
|
|
98
|
+
* A zero reading waits before it counts: a parent can hand over its width a
|
|
99
|
+
* frame or two after the first paint, and that looks exactly like a collapse
|
|
100
|
+
* until it does. Only a zero that is still zero when the timer runs out gets
|
|
101
|
+
* said out loud.
|
|
102
|
+
*/
|
|
103
|
+
_watchForCollapse() {
|
|
104
|
+
if (!import.meta.env?.DEV)
|
|
105
|
+
return;
|
|
106
|
+
if (this.orientation !== 'auto') {
|
|
107
|
+
this._stopWatchingForCollapse();
|
|
108
|
+
return;
|
|
53
109
|
}
|
|
110
|
+
if (this._collapseObserver)
|
|
111
|
+
return;
|
|
112
|
+
this._collapseObserver = new ResizeObserver(() => {
|
|
113
|
+
// No box at all (display:none, a closed sheet): nothing to judge yet.
|
|
114
|
+
// Client rects rather than offsetParent: that is null for a fixed
|
|
115
|
+
// element too, and a fixed group can collapse like any other.
|
|
116
|
+
if (!this.isConnected || this.getClientRects().length === 0)
|
|
117
|
+
return;
|
|
118
|
+
if (!this._slot?.assignedElements({ flatten: true }).length)
|
|
119
|
+
return;
|
|
120
|
+
if (this.getBoundingClientRect().width > 0) {
|
|
121
|
+
// It got a width, from the start or a tick late. Nothing to say.
|
|
122
|
+
this._stopWatchingForCollapse();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
// Zero, but not yet a verdict: a parent can hand over its width a
|
|
126
|
+
// frame or two later, and that is the same zero. Give it a moment and
|
|
127
|
+
// keep watching, so a width that arrives cancels this.
|
|
128
|
+
if (this._collapseVerdict !== 0)
|
|
129
|
+
return;
|
|
130
|
+
this._collapseVerdict = window.setTimeout(() => {
|
|
131
|
+
if (!this.isConnected || this.getClientRects().length === 0)
|
|
132
|
+
return;
|
|
133
|
+
if (this.getBoundingClientRect().width > 0)
|
|
134
|
+
return;
|
|
135
|
+
console.warn('nldd-button-group: the group is 0 wide, so its buttons are invisible. It takes its width from its parent (it is a container query while orientation is auto), and a parent that sizes itself from its content leaves nothing to take. Give the group or that parent a width.');
|
|
136
|
+
this._stopWatchingForCollapse();
|
|
137
|
+
}, 250);
|
|
138
|
+
});
|
|
139
|
+
this._collapseObserver.observe(this);
|
|
140
|
+
}
|
|
141
|
+
_stopWatchingForCollapse() {
|
|
142
|
+
this._collapseObserver?.disconnect();
|
|
143
|
+
this._collapseObserver = null;
|
|
144
|
+
if (this._collapseVerdict)
|
|
145
|
+
clearTimeout(this._collapseVerdict);
|
|
146
|
+
this._collapseVerdict = 0;
|
|
54
147
|
}
|
|
55
148
|
render() {
|
|
56
149
|
return template.call(this);
|
|
@@ -61,7 +154,7 @@ __decorate([
|
|
|
61
154
|
property({ reflect: true, converter: reflectNonDefault('md') })
|
|
62
155
|
], NLDDButtonGroup.prototype, "size", void 0);
|
|
63
156
|
__decorate([
|
|
64
|
-
property({ reflect: true, converter: reflectNonDefault('
|
|
157
|
+
property({ reflect: true, converter: reflectNonDefault('auto') })
|
|
65
158
|
], NLDDButtonGroup.prototype, "orientation", void 0);
|
|
66
159
|
__decorate([
|
|
67
160
|
query('slot')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.js","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"button-group.js","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAM/C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAIN,SAAI,GAAS,IAAI,CAAC;QAGlB,gBAAW,GAAgB,MAAM,CAAC;QAKlC,qEAAqE;QAC7D,sBAAiB,GAA0B,IAAI,CAAC;QACxD,wEAAwE;QAChE,qBAAgB,GAAG,CAAC,CAAC;IAkG9B,CAAC;IAhGA,gBAAgB;QACf,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK;aACzB,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;aACnC,MAAM,CAAC,CAAC,EAAE,EAAqB,EAAE,CAAC,EAAE,YAAY,WAAW,CAAC,CAAC;QAE/D,QAAQ,CAAC,OAAO,CAAC,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AM;QACd,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;;AA/Ge,sBAAM,GAAG,iBAAiB,AAApB,CAAqB;AAG3C;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAO,IAAI,CAAC,EAAE,CAAC;6CACpD;AAGlB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAc,MAAM,CAAC,EAAE,CAAC;oDAC7C;AAG1B;IADP,KAAK,CAAC,MAAM,CAAC;8CACkB;AAVpB,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAiH3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-group.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button-group/button-group.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,yBA6G7B,CAAC"}
|