@nldd/design-system 0.13.1 → 0.14.0
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 +18 -1
- package/README.md +36 -26
- package/custom-elements.json +2508 -179
- package/dist/components/actions/button/button.d.ts +0 -2
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +17 -33
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.template.js +2 -2
- package/dist/components/actions/button-bar/button-bar.d.ts +0 -2
- package/dist/components/actions/button-bar/button-bar.d.ts.map +1 -1
- package/dist/components/actions/button-bar/button-bar.js +2 -12
- package/dist/components/actions/button-bar/button-bar.js.map +1 -1
- package/dist/components/actions/button-group/button-group.d.ts +22 -7
- package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.js +41 -23
- 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 +43 -18
- package/dist/components/actions/button-group/button-group.styles.js.map +1 -1
- package/dist/components/actions/button-group/button-group.template.js +1 -1
- package/dist/components/actions/button-group/button-group.template.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +0 -1
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +4 -11
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +2 -2
- package/dist/components/actions/menu/menu-divider.d.ts +1 -0
- package/dist/components/actions/menu/menu-divider.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-divider.js +1 -0
- package/dist/components/actions/menu/menu-divider.js.map +1 -1
- package/dist/components/actions/menu/menu-group.d.ts +1 -0
- package/dist/components/actions/menu/menu-group.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-group.js +1 -0
- package/dist/components/actions/menu/menu-group.js.map +1 -1
- package/dist/components/actions/menu/menu-item.d.ts +1 -0
- package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-item.js +4 -7
- package/dist/components/actions/menu/menu-item.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +15 -4
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +44 -17
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.js +2 -1
- package/dist/components/actions/split-button/split-button.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar-item.d.ts +0 -2
- package/dist/components/actions/toolbar/toolbar-item.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar-item.js +2 -20
- package/dist/components/actions/toolbar/toolbar-item.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar-title.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar-title.js +2 -1
- package/dist/components/actions/toolbar/toolbar-title.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +2 -1
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/button.i18n-DiDGynnq.js +8 -0
- package/dist/components/components.js +2761 -780
- package/dist/components/content/avatar/avatar.d.ts +0 -2
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +2 -27
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts +0 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.js +2 -24
- package/dist/components/content/avatar-group/avatar-group.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.styles.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.styles.js +12 -1
- package/dist/components/content/avatar-group/avatar-group.styles.js.map +1 -1
- package/dist/components/content/blockquote/blockquote.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.js +2 -1
- package/dist/components/content/blockquote/blockquote.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts +1 -0
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.diff.d.ts +2 -0
- package/dist/components/content/code-viewer/code-viewer.diff.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.diff.js +1 -4
- package/dist/components/content/code-viewer/code-viewer.diff.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +13 -11
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +10 -5
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.d.ts.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.js +4 -0
- package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
- package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
- package/dist/components/content/icon/icon-registry.js +4 -2
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/icon/icon.d.ts +3 -0
- package/dist/components/content/icon/icon.d.ts.map +1 -1
- package/dist/components/content/icon/icon.js +19 -15
- package/dist/components/content/icon/icon.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts.map +1 -1
- package/dist/components/content/identity/identity.js +2 -1
- package/dist/components/content/identity/identity.js.map +1 -1
- package/dist/components/content/image/image.d.ts +5 -11
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +14 -31
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/image/lqip-encoder-element.d.ts.map +1 -1
- package/dist/components/content/image/lqip-encoder-element.js +2 -1
- package/dist/components/content/image/lqip-encoder-element.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js +2 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +2 -1
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- 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/text/text.d.ts +1 -1
- package/dist/components/content/text/text.d.ts.map +1 -1
- package/dist/components/content/text/text.js +3 -2
- package/dist/components/content/text/text.js.map +1 -1
- package/dist/components/content/text/text.styles.d.ts.map +1 -1
- package/dist/components/content/text/text.styles.js +104 -1
- package/dist/components/content/text/text.styles.js.map +1 -1
- package/dist/components/content/title/title.d.ts +1 -5
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +15 -27
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/content/token/token.d.ts.map +1 -1
- package/dist/components/content/token/token.js +2 -1
- package/dist/components/content/token/token.js.map +1 -1
- package/dist/components/content/token/token.styles.d.ts.map +1 -1
- package/dist/components/content/token/token.styles.js +2 -1
- package/dist/components/content/token/token.styles.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +2 -1
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.js +7 -7
- package/dist/components/content/visually-hidden/visually-hidden.js +1 -1
- package/dist/components/content/visually-hidden/visually-hidden.js.map +1 -1
- package/dist/components/{decorate-Cz9-peTN.js → decorate-x12uDAK4.js} +9 -1
- package/dist/components/dev-checks-BgrW077W.js +2503 -0
- package/dist/components/element-state-BnarBv0M.js +42 -0
- package/dist/components/forms/form/form.d.ts +1 -96
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +1 -0
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-actions/form-actions.d.ts.map +1 -1
- package/dist/components/forms/form-actions/form-actions.js +2 -1
- package/dist/components/forms/form-actions/form-actions.js.map +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +10 -7
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +27 -32
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/forms/form-section/form-section.d.ts +1 -67
- package/dist/components/forms/form-section/form-section.d.ts.map +1 -1
- package/dist/components/forms/form-section/form-section.js +2 -16
- package/dist/components/forms/form-section/form-section.js.map +1 -1
- package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.js +7 -6
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/{icon-DZ1UXCzO.js → icon-IgCyk9ui.js} +29 -10
- package/dist/components/{icon-button-984CwkU1.js → icon-button-B5tH4b3c.js} +15 -24
- package/dist/components/icon-button.i18n-1_N-wN6x.js +10 -0
- 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.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.js +2 -1
- package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.js +2 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.js +2 -1
- package/dist/components/inputs/code-editor/code-editor.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +4 -5
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.js +2 -1
- package/dist/components/inputs/date-field/date-field.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.js +2 -1
- package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +5 -4
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts +12 -0
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.i18n.d.ts +1 -0
- package/dist/components/inputs/file-field/file-field.i18n.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.i18n.js +1 -0
- package/dist/components/inputs/file-field/file-field.i18n.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.js +30 -10
- package/dist/components/inputs/file-field/file-field.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.js +91 -8
- package/dist/components/inputs/file-field/file-field.styles.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.d.ts +1 -0
- package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.js +51 -21
- package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
- 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 +2 -4
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js.map +1 -1
- package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.js +2 -4
- package/dist/components/inputs/number-field/number-field.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.js +2 -1
- package/dist/components/inputs/password-field/password-field.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +2 -1
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.js +2 -1
- 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 +0 -1
- 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 +2 -6
- package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +2 -1
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +0 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +2 -11
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/slider/slider.d.ts +161 -0
- package/dist/components/inputs/slider/slider.d.ts.map +1 -0
- package/dist/components/inputs/slider/slider.i18n.d.ts +6 -0
- package/dist/components/inputs/slider/slider.i18n.d.ts.map +1 -0
- package/dist/components/inputs/slider/slider.i18n.js +5 -0
- package/dist/components/inputs/slider/slider.i18n.js.map +1 -0
- package/dist/components/inputs/slider/slider.js +437 -0
- package/dist/components/inputs/slider/slider.js.map +1 -0
- package/dist/components/inputs/slider/slider.styles.d.ts +2 -0
- package/dist/components/inputs/slider/slider.styles.d.ts.map +1 -0
- package/dist/components/inputs/slider/slider.styles.js +360 -0
- package/dist/components/inputs/slider/slider.styles.js.map +1 -0
- package/dist/components/inputs/slider/slider.template.d.ts +5 -0
- package/dist/components/inputs/slider/slider.template.d.ts.map +1 -0
- package/dist/components/inputs/slider/slider.template.js +99 -0
- package/dist/components/inputs/slider/slider.template.js.map +1 -0
- package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.js +2 -1
- package/dist/components/inputs/stepper/stepper.js.map +1 -1
- package/dist/components/inputs/switch/switch.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.js +2 -4
- package/dist/components/inputs/switch/switch.js.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.d.ts.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.js +2 -1
- package/dist/components/inputs/switch-field/switch-field.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +7 -3
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +2 -0
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js +14 -2
- package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.d.ts +1 -5
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.js +6 -23
- package/dist/components/inputs/text-field/text-field.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.js +2 -1
- package/dist/components/inputs/time-field/time-field.js.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.js +2 -1
- package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts +0 -2
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +2 -23
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts +0 -2
- 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 +2 -12
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.js +2 -1
- package/dist/components/inputs/token-field/token-field.js.map +1 -1
- package/dist/components/just-in-time-education.i18n-BJ5ovWVB.js +370 -0
- package/dist/components/layout/box/box.d.ts.map +1 -1
- package/dist/components/layout/box/box.js +2 -1
- package/dist/components/layout/box/box.js.map +1 -1
- package/dist/components/layout/card/card.d.ts +0 -1
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.js +2 -15
- package/dist/components/layout/card/card.js.map +1 -1
- package/dist/components/layout/card/card.template.js +2 -2
- package/dist/components/layout/collection/collection.d.ts +0 -2
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +8 -24
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +6 -3
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +17 -23
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/divider/divider.js +1 -1
- package/dist/components/layout/divider/divider.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +2 -3
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +9 -12
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +6 -7
- package/dist/components/layout/page-footer/page-footer.js.map +1 -1
- 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 +2 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts +0 -1
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.js +9 -28
- package/dist/components/layout/page-sections/hero/hero-corner.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +1 -4
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +7 -29
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- 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 +2 -1
- 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.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +2 -1
- 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.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +2 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- 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 +2 -1
- 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.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +2 -1
- 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 +0 -2
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +6 -25
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +0 -2
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +9 -20
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/shell/shell.d.ts.map +1 -1
- package/dist/components/layout/shell/shell.js +2 -1
- package/dist/components/layout/shell/shell.js.map +1 -1
- package/dist/components/layout/spacer/spacer.d.ts.map +1 -1
- package/dist/components/layout/spacer/spacer.js +2 -1
- package/dist/components/layout/spacer/spacer.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +6 -6
- 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 +9 -12
- 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.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +2 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -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 +2 -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-divider/split-view-divider.d.ts.map +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.js +2 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.js.map +1 -1
- 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 +2 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js +2 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js.map +1 -1
- package/dist/components/layout/task-board/task-board-column.d.ts +80 -0
- package/dist/components/layout/task-board/task-board-column.d.ts.map +1 -0
- package/dist/components/layout/task-board/task-board-column.js +205 -0
- package/dist/components/layout/task-board/task-board-column.js.map +1 -0
- package/dist/components/layout/task-board/task-board-column.template.d.ts +3 -0
- package/dist/components/layout/task-board/task-board-column.template.d.ts.map +1 -0
- package/dist/components/layout/task-board/task-board-column.template.js +45 -0
- package/dist/components/layout/task-board/task-board-column.template.js.map +1 -0
- package/dist/components/layout/task-board/task-board.d.ts +169 -0
- package/dist/components/layout/task-board/task-board.d.ts.map +1 -0
- package/dist/components/layout/task-board/task-board.i18n.d.ts +11 -0
- package/dist/components/layout/task-board/task-board.i18n.d.ts.map +1 -0
- package/dist/components/layout/task-board/task-board.i18n.js +10 -0
- package/dist/components/layout/task-board/task-board.i18n.js.map +1 -0
- package/dist/components/layout/task-board/task-board.js +702 -0
- package/dist/components/layout/task-board/task-board.js.map +1 -0
- package/dist/components/layout/task-board/task-board.styles.d.ts +3 -0
- package/dist/components/layout/task-board/task-board.styles.d.ts.map +1 -0
- package/dist/components/layout/task-board/task-board.styles.js +259 -0
- package/dist/components/layout/task-board/task-board.styles.js.map +1 -0
- package/dist/components/layout/task-board/task-board.template.d.ts +3 -0
- package/dist/components/layout/task-board/task-board.template.d.ts.map +1 -0
- package/dist/components/layout/task-board/task-board.template.js +25 -0
- package/dist/components/layout/task-board/task-board.template.js.map +1 -0
- package/dist/components/layout/window/window.d.ts +0 -1
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +4 -6
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/list-item.i18n-89uqlBMK.js +8 -0
- package/dist/components/list.i18n-nFB6dZpc.js +13 -0
- package/dist/components/lists-and-tables/cells/cell/cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.js +2 -1
- package/dist/components/lists-and-tables/cells/cell/cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.js +2 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js +2 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts +1 -0
- 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 +3 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.js +2 -1
- package/dist/components/lists-and-tables/cells/spacer-cell/spacer-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts +0 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js +5 -15
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js.map +1 -1
- 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 +2 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js.map +1 -1
- 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 +2 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +5 -23
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +53 -98
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +10 -15
- 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 +40 -87
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +2 -2
- 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 +6 -11
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +0 -13
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +6 -41
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js +2 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
- 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.js +2 -4
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +5 -0
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.js +21 -1
- package/dist/components/navigation/link/link.js.map +1 -1
- package/dist/components/navigation/link/link.template.d.ts +1 -0
- package/dist/components/navigation/link/link.template.d.ts.map +1 -1
- package/dist/components/navigation/link/link.template.js +18 -16
- package/dist/components/navigation/link/link.template.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.d.ts +4 -0
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +13 -10
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +2 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.d.ts.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +2 -1
- package/dist/components/navigation/pagination/pagination.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.js +6 -8
- package/dist/components/navigation/skip-link/skip-link.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +5 -15
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +0 -1
- 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 +6 -6
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +7 -6
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/nl.generated-Ny3Kwppu.js +61 -0
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +2 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.js +3 -6
- package/dist/components/status-and-feedback/badge/badge.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.d.ts.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.js +2 -1
- package/dist/components/status-and-feedback/banner/banner.js.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +2 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js +2 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +0 -3
- 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 +2 -14
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +3 -7
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js +4 -5
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js +2 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +1 -1
- 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 +8 -7
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +0 -7
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.js +2 -24
- package/dist/components/status-and-feedback/step-bar/step-bar.js.map +1 -1
- package/dist/components/{visibility-mixin-C-K7ho5Q.js → visibility-mixin-DcwzF0_a.js} +1 -7
- package/dist/components/{with-translations-DRuOq3QK.js → with-translations-DLzmBSkU.js} +26 -5
- package/dist/css/{global-system-font.css → global-open-font.css} +2 -0
- package/dist/css/global.css +1 -0
- package/dist/css/inter-font.css +47 -0
- package/dist/css/jetbrains-mono-font.css +22 -0
- package/dist/css/rijksoverheid-fonts.css +4 -21
- package/dist/css/themes/bruin.css +1 -0
- package/dist/css/themes/donkerblauw.css +1 -0
- package/dist/css/themes/donkerbruin.css +1 -0
- package/dist/css/themes/donkergeel.css +1 -0
- package/dist/css/themes/donkergroen.css +1 -0
- package/dist/css/themes/geel.css +1 -0
- package/dist/css/themes/groen.css +1 -0
- package/dist/css/themes/hemelblauw.css +1 -0
- package/dist/css/themes/lichtblauw.css +1 -0
- package/dist/css/themes/mintgroen.css +1 -0
- package/dist/css/themes/mosgroen.css +1 -0
- package/dist/css/themes/oranje.css +1 -0
- package/dist/css/themes/paars.css +1 -0
- package/dist/css/themes/robijnrood.css +1 -0
- package/dist/css/themes/rood.css +1 -0
- package/dist/css/themes/roze.css +1 -0
- package/dist/css/themes/violet.css +1 -0
- package/dist/css/themes.css +17 -0
- package/dist/css/tokens.css +1 -0
- package/dist/css/variables.css +27 -5
- package/dist/fonts/Inter-Latin-Italic[wght].woff2 +0 -0
- package/dist/fonts/Inter-LatinExt-Italic[wght].woff2 +0 -0
- package/dist/fonts/Inter-LatinExt[wght].woff2 +0 -0
- package/dist/fonts/Inter-Latin[wght].woff2 +0 -0
- package/dist/nldd.min.js +1856 -895
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +10 -0
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +10 -0
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/nl.generated.js +4 -0
- package/dist/translations/nl.generated.js.map +1 -1
- package/dist/types/vue.d.ts +183 -9
- package/dist/utilities/codemirror/codemirror-input.d.ts +0 -2
- package/dist/utilities/codemirror/codemirror-input.d.ts.map +1 -1
- package/dist/utilities/codemirror/codemirror-input.js +0 -14
- package/dist/utilities/codemirror/codemirror-input.js.map +1 -1
- package/dist/utilities/custom-element.d.ts +7 -0
- package/dist/utilities/custom-element.d.ts.map +1 -0
- package/dist/utilities/custom-element.js +7 -0
- package/dist/utilities/custom-element.js.map +1 -0
- package/dist/utilities/dev-checks-trigger.d.ts +2 -0
- package/dist/utilities/dev-checks-trigger.d.ts.map +1 -0
- package/dist/utilities/dev-checks-trigger.js +10 -0
- package/dist/utilities/dev-checks-trigger.js.map +1 -0
- package/dist/utilities/dev-checks.d.ts +40 -0
- package/dist/utilities/dev-checks.d.ts.map +1 -0
- package/dist/utilities/dev-checks.js +115 -0
- package/dist/utilities/dev-checks.js.map +1 -0
- package/dist/utilities/dev-rules.generated.d.ts +3 -0
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -0
- package/dist/utilities/dev-rules.generated.js +2472 -0
- package/dist/utilities/dev-rules.generated.js.map +1 -0
- package/dist/utilities/element-state.d.ts +19 -0
- package/dist/utilities/element-state.d.ts.map +1 -0
- package/dist/utilities/element-state.js +49 -0
- package/dist/utilities/element-state.js.map +1 -0
- package/dist/utilities/form-associated-mixin.d.ts.map +1 -1
- package/dist/utilities/form-associated-mixin.js +2 -1
- package/dist/utilities/form-associated-mixin.js.map +1 -1
- package/dist/utilities/link-hint.d.ts +2 -21
- package/dist/utilities/link-hint.d.ts.map +1 -1
- package/dist/utilities/link-hint.js +22 -8
- package/dist/utilities/link-hint.js.map +1 -1
- package/dist/utilities/spacing-scale.d.ts +4 -5
- package/dist/utilities/spacing-scale.d.ts.map +1 -1
- package/dist/utilities/spacing-scale.js +4 -23
- package/dist/utilities/spacing-scale.js.map +1 -1
- package/dist/utilities/tab-order.d.ts +11 -0
- package/dist/utilities/tab-order.d.ts.map +1 -0
- package/dist/utilities/tab-order.js +55 -0
- package/dist/utilities/tab-order.js.map +1 -0
- package/dist/utilities/translations.d.ts.map +1 -1
- package/dist/utilities/translations.js +3 -15
- package/dist/utilities/translations.js.map +1 -1
- package/dist/utilities/visibility-mixin.d.ts +7 -0
- package/dist/utilities/visibility-mixin.d.ts.map +1 -1
- package/dist/utilities/visibility-mixin.js +0 -10
- package/dist/utilities/visibility-mixin.js.map +1 -1
- package/lint/cli.js +18 -0
- package/lint/data.generated.json +1 -0
- package/lint/engine.js +191 -0
- package/lint/fix.js +293 -0
- package/lint/format.js +133 -0
- package/lint/frontends.js +483 -0
- package/lint/linter.js +262 -0
- package/lint/main.js +279 -0
- package/lint/project.js +143 -0
- package/lint/rule-data.js +83 -0
- package/lint/rule-index.js +20 -0
- package/lint/rule.schema.json +65 -0
- package/lint/tree.js +131 -0
- package/package.json +32 -6
|
@@ -0,0 +1,702 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Nederlandse Digitale Dienst Task Board Component (Lit + TypeScript)
|
|
9
|
+
*
|
|
10
|
+
* Columns side by side, with items you move between them: a kanban board, or
|
|
11
|
+
* any board where an item's column is one of its values, such as a status or a
|
|
12
|
+
* team. Put `nldd-task-board-column`s in it, and the items in those, usually an
|
|
13
|
+
* `nldd-card` each. The board scrolls sideways once its columns do not fit, and
|
|
14
|
+
* a column scrolls on its own once its items do not fit the height you give the
|
|
15
|
+
* board.
|
|
16
|
+
*
|
|
17
|
+
* An item moves in three ways, and all three fire the same `nldd-move`:
|
|
18
|
+
*
|
|
19
|
+
* - **Dragging.** Pick up the whole item and drop it in a column. A press that
|
|
20
|
+
* does not move is still a click, so an item that is a link or a button keeps
|
|
21
|
+
* working. Released outside the board, the item goes back to its place, which
|
|
22
|
+
* a note above it says once it stays out a moment. On a touch screen you hold the item a moment before it lifts, so a
|
|
23
|
+
* swipe still scrolls.
|
|
24
|
+
* - **Keyboard.** With focus on an item, or on something inside it, Alt with
|
|
25
|
+
* the up or down arrow moves it within its column, and Alt with the left or
|
|
26
|
+
* right arrow to the column beside it.
|
|
27
|
+
* - **`moveItem()`.** WCAG 2.5.7 asks for a way that does not drag. Give each
|
|
28
|
+
* item a menu "Verplaatsen naar" with the other columns (`columns` lists them)
|
|
29
|
+
* and call `moveItem()` from it. The menu is yours; the board only moves.
|
|
30
|
+
*
|
|
31
|
+
* With `readonly` nothing moves: no dragging and no Alt with the arrows, while
|
|
32
|
+
* the items still work, so a card still opens. Use it for someone who may only
|
|
33
|
+
* look, or a board that is closed. `moveItem()` still moves, so your app can
|
|
34
|
+
* still show a move someone else made. An attempt to move an item, dragging it
|
|
35
|
+
* past a click or Alt with an arrow, shows "Dit bord is alleen-lezen" at the
|
|
36
|
+
* item, says it to a screen reader and fires `nldd-move-denied`, so your app
|
|
37
|
+
* can say why in an `nldd-notification`. Say it above the board too: only
|
|
38
|
+
* your app knows the reason, and then nobody has to try.
|
|
39
|
+
*
|
|
40
|
+
* The board moves nothing itself. `nldd-move` says which item goes where, and
|
|
41
|
+
* your app moves it in its data, or in the DOM, in the handler: the app owns the
|
|
42
|
+
* order, so a framework that renders the columns never fights the board over
|
|
43
|
+
* them. `toIndex` is the place the item takes in `toColumn`, counted without
|
|
44
|
+
* the item itself, so `splice(fromIndex, 1)` on the one list and
|
|
45
|
+
* `splice(toIndex, 0, item)` on the other is the whole move. Move it
|
|
46
|
+
* synchronously in the handler: the board puts focus back on the item right
|
|
47
|
+
* after, and a screen reader hears where it landed.
|
|
48
|
+
*
|
|
49
|
+
* @element nldd-task-board
|
|
50
|
+
* @attr {string} accessible-label - Accessible name of the board (default: "Takenbord")
|
|
51
|
+
* @attr {string} height - Fixed height as a CSS length (e.g. '480px'): every column takes it, and scrolls its items once they do not fit. To fill a page or a pane, set the height in your layout instead (flex, or `height: 100%`)
|
|
52
|
+
* @attr {boolean} readonly - Items cannot be dragged or moved with the keyboard; they still work, and `moveItem()` still moves
|
|
53
|
+
* @attr {object} translations - Override translation keys; unset keys fall back to Dutch
|
|
54
|
+
*
|
|
55
|
+
* @slot - The columns: `nldd-task-board-column`
|
|
56
|
+
*
|
|
57
|
+
* @fires nldd-move - An item moves: `{ item, fromColumn, fromIndex, toColumn, toIndex }`, where a column is its `value` (or its `text` without one)
|
|
58
|
+
* @fires nldd-move-denied - An item a `readonly` board does not move was dragged or moved with the keyboard: `{ item }`
|
|
59
|
+
*
|
|
60
|
+
* @method moveItem(item, toColumn, toIndex?) - Moves an item to a column, given as its `value` or as the element, at `toIndex` or at the end; fires `nldd-move` and says where it landed. Returns whether it moved.
|
|
61
|
+
*/
|
|
62
|
+
import { LitElement } from 'lit';
|
|
63
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
64
|
+
import { customElement } from '../../../utilities/custom-element.js';
|
|
65
|
+
import { withTranslations } from '../../../utilities/with-translations.js';
|
|
66
|
+
import { nlddTaskBoardTranslations } from './task-board.i18n.js';
|
|
67
|
+
import { taskBoardStyles } from './task-board.styles.js';
|
|
68
|
+
import { taskBoardTemplate } from './task-board.template.js';
|
|
69
|
+
import { NLDDTaskBoardColumn } from './task-board-column.js';
|
|
70
|
+
import { setState } from '../../../utilities/element-state.js';
|
|
71
|
+
export { NLDDTaskBoardColumn };
|
|
72
|
+
/** How far a mouse or pen moves before a press becomes a drag, in pixels. */
|
|
73
|
+
const DRAG_THRESHOLD = 4;
|
|
74
|
+
/** How far a finger may wander while it holds an item, and how long it holds. */
|
|
75
|
+
const TOUCH_SLOP = 8;
|
|
76
|
+
const TOUCH_HOLD_MS = 300;
|
|
77
|
+
/** How close to an edge the pointer scrolls the board or a column, and how fast. */
|
|
78
|
+
const SCROLL_EDGE = 48;
|
|
79
|
+
const SCROLL_SPEED = 12;
|
|
80
|
+
/** How long the note at an item a readonly board did not move stays. */
|
|
81
|
+
const DENIED_MS = 1500;
|
|
82
|
+
/** How long the pointer stays outside the board before the copy says it goes back. */
|
|
83
|
+
const RETURN_NOTE_DELAY_MS = 300;
|
|
84
|
+
let NLDDTaskBoard = class NLDDTaskBoard extends withTranslations(LitElement, nlddTaskBoardTranslations) {
|
|
85
|
+
constructor() {
|
|
86
|
+
super(...arguments);
|
|
87
|
+
this.accessibleLabel = '';
|
|
88
|
+
this.height = '';
|
|
89
|
+
this.readonly = false;
|
|
90
|
+
/** @internal Whether there is more to scroll to on that side, for the fades. */
|
|
91
|
+
this._canScrollLeft = false;
|
|
92
|
+
this._canScrollRight = false;
|
|
93
|
+
/** @internal While an item is dragged. */
|
|
94
|
+
this._dragging = false;
|
|
95
|
+
this._scrollObserver = null;
|
|
96
|
+
this._press = null;
|
|
97
|
+
this._drag = null;
|
|
98
|
+
/** The layer that shows the grabbing cursor wherever the pointer is. */
|
|
99
|
+
this._grabbing = null;
|
|
100
|
+
/** The note at an item a readonly board did not move, and its own cursor layer. */
|
|
101
|
+
this._deniedNote = null;
|
|
102
|
+
this._deniedCursor = null;
|
|
103
|
+
this._deniedTimer = 0;
|
|
104
|
+
/** @internal Which sides have more to scroll to, by the physical side, so a
|
|
105
|
+
* right-to-left page fades the right one first. */
|
|
106
|
+
this._updateScroll = () => {
|
|
107
|
+
const el = this._scroller;
|
|
108
|
+
if (!el)
|
|
109
|
+
return;
|
|
110
|
+
const max = el.scrollWidth - el.clientWidth;
|
|
111
|
+
const position = Math.abs(el.scrollLeft);
|
|
112
|
+
const rtl = getComputedStyle(this).direction === 'rtl';
|
|
113
|
+
const before = position > 1;
|
|
114
|
+
const after = position < max - 1;
|
|
115
|
+
this._canScrollLeft = rtl ? after : before;
|
|
116
|
+
this._canScrollRight = rtl ? before : after;
|
|
117
|
+
};
|
|
118
|
+
// — Keyboard ————————————————————————————————————————————————————————
|
|
119
|
+
this._onKeyDown = (event) => {
|
|
120
|
+
if (this._drag || !event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
121
|
+
return;
|
|
122
|
+
if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key))
|
|
123
|
+
return;
|
|
124
|
+
const origin = event.composedPath()[0];
|
|
125
|
+
if (origin instanceof HTMLElement && (origin.isContentEditable || origin.matches('input, textarea, select')))
|
|
126
|
+
return;
|
|
127
|
+
const item = this._itemFrom(event);
|
|
128
|
+
const from = item && this._columnOf(item);
|
|
129
|
+
if (!item || !from)
|
|
130
|
+
return;
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
if (this.readonly) {
|
|
133
|
+
this._deny(item);
|
|
134
|
+
this._deniedTimer = window.setTimeout(() => this._hideDenied(), DENIED_MS);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const columns = this.columns;
|
|
138
|
+
const fromIndex = from.items.indexOf(item);
|
|
139
|
+
const rtl = getComputedStyle(this).direction === 'rtl';
|
|
140
|
+
const step = { ArrowUp: 0, ArrowDown: 0, ArrowLeft: rtl ? 1 : -1, ArrowRight: rtl ? -1 : 1 }[event.key] ?? 0;
|
|
141
|
+
if (step === 0) {
|
|
142
|
+
const toIndex = fromIndex + (event.key === 'ArrowUp' ? -1 : 1);
|
|
143
|
+
if (toIndex < 0 || toIndex > from.items.length - 1) {
|
|
144
|
+
this._announce(this._t('components.task-board.edge-text'));
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
this._move(item, from, fromIndex, from, toIndex);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const to = columns[columns.indexOf(from) + step];
|
|
151
|
+
if (!to) {
|
|
152
|
+
this._announce(this._t('components.task-board.edge-text'));
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this._move(item, from, fromIndex, to, Math.min(fromIndex, to.items.length));
|
|
156
|
+
};
|
|
157
|
+
// — Pointer —————————————————————————————————————————————————————————
|
|
158
|
+
this._onPointerDown = (event) => {
|
|
159
|
+
if (this._press || this._drag || !event.isPrimary || event.button !== 0)
|
|
160
|
+
return;
|
|
161
|
+
const origin = event.composedPath()[0];
|
|
162
|
+
if (origin instanceof HTMLElement && (origin.isContentEditable || origin.matches('input, textarea, select')))
|
|
163
|
+
return;
|
|
164
|
+
const item = this._itemFrom(event);
|
|
165
|
+
if (!item)
|
|
166
|
+
return;
|
|
167
|
+
this._press = {
|
|
168
|
+
item,
|
|
169
|
+
pointerId: event.pointerId,
|
|
170
|
+
pointerType: event.pointerType,
|
|
171
|
+
startX: event.clientX,
|
|
172
|
+
startY: event.clientY,
|
|
173
|
+
timer: event.pointerType === 'touch'
|
|
174
|
+
? window.setTimeout(() => this._startDrag(this._press.startX, this._press.startY), TOUCH_HOLD_MS)
|
|
175
|
+
: 0,
|
|
176
|
+
};
|
|
177
|
+
window.addEventListener('pointermove', this._onPointerMove);
|
|
178
|
+
window.addEventListener('pointerup', this._onPointerUp);
|
|
179
|
+
window.addEventListener('pointercancel', this._onPointerCancel);
|
|
180
|
+
// A mouse that moves with its button down selects text before it reaches
|
|
181
|
+
// the drag threshold, and that selection would run over the dragged copy.
|
|
182
|
+
window.addEventListener('selectstart', this._preventSelect);
|
|
183
|
+
};
|
|
184
|
+
this._preventSelect = (event) => {
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
};
|
|
187
|
+
this._onPointerMove = (event) => {
|
|
188
|
+
const press = this._press;
|
|
189
|
+
if (press && event.pointerId === press.pointerId && !this._drag && !press.denied) {
|
|
190
|
+
const distance = Math.hypot(event.clientX - press.startX, event.clientY - press.startY);
|
|
191
|
+
if (press.pointerType === 'touch') {
|
|
192
|
+
// A finger that moves before the hold is up is scrolling.
|
|
193
|
+
if (distance > TOUCH_SLOP)
|
|
194
|
+
this._endPress();
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (distance > DRAG_THRESHOLD)
|
|
198
|
+
this._startDrag(event.clientX, event.clientY);
|
|
199
|
+
}
|
|
200
|
+
const drag = this._drag;
|
|
201
|
+
if (!drag)
|
|
202
|
+
return;
|
|
203
|
+
drag.x = event.clientX;
|
|
204
|
+
drag.y = event.clientY;
|
|
205
|
+
this._follow();
|
|
206
|
+
};
|
|
207
|
+
this._onPointerUp = (event) => {
|
|
208
|
+
const dragged = !!this._drag;
|
|
209
|
+
const denied = this._press?.pointerId === event.pointerId && !!this._press.denied;
|
|
210
|
+
if (dragged)
|
|
211
|
+
this._drop();
|
|
212
|
+
if (dragged || denied)
|
|
213
|
+
this._swallowNextClick();
|
|
214
|
+
if (this._press?.pointerId === event.pointerId)
|
|
215
|
+
this._endPress();
|
|
216
|
+
};
|
|
217
|
+
this._onPointerCancel = () => {
|
|
218
|
+
if (this._drag)
|
|
219
|
+
this._cancelDrag();
|
|
220
|
+
this._endPress();
|
|
221
|
+
};
|
|
222
|
+
this._swallowClick = (event) => {
|
|
223
|
+
event.preventDefault();
|
|
224
|
+
event.stopPropagation();
|
|
225
|
+
};
|
|
226
|
+
/** While a finger holds an item, the page must not scroll under it. */
|
|
227
|
+
this._holdTouch = (event) => {
|
|
228
|
+
event.preventDefault();
|
|
229
|
+
};
|
|
230
|
+
this._preventContextMenu = (event) => {
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
};
|
|
233
|
+
/** Escape drops nothing, wherever focus is while dragging. */
|
|
234
|
+
this._onDragKeyDown = (event) => {
|
|
235
|
+
if (event.key !== 'Escape')
|
|
236
|
+
return;
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
event.stopPropagation();
|
|
239
|
+
this._cancelDrag();
|
|
240
|
+
};
|
|
241
|
+
/** Scrolls the board sideways, and the column under the pointer, while the
|
|
242
|
+
* pointer is near an edge. */
|
|
243
|
+
this._scrollLoop = () => {
|
|
244
|
+
const drag = this._drag;
|
|
245
|
+
if (!drag)
|
|
246
|
+
return;
|
|
247
|
+
const board = this._scroller.getBoundingClientRect();
|
|
248
|
+
const dx = drag.x < board.left + SCROLL_EDGE ? -SCROLL_SPEED : drag.x > board.right - SCROLL_EDGE ? SCROLL_SPEED : 0;
|
|
249
|
+
if (dx)
|
|
250
|
+
this._scroller.scrollBy({ left: dx, behavior: 'instant' });
|
|
251
|
+
const main = drag.target?._main;
|
|
252
|
+
if (main) {
|
|
253
|
+
const rect = main.getBoundingClientRect();
|
|
254
|
+
const dy = drag.y < rect.top + SCROLL_EDGE ? -SCROLL_SPEED : drag.y > rect.bottom - SCROLL_EDGE ? SCROLL_SPEED : 0;
|
|
255
|
+
if (dy)
|
|
256
|
+
main.scrollTop += dy;
|
|
257
|
+
}
|
|
258
|
+
if (dx || main)
|
|
259
|
+
this._follow();
|
|
260
|
+
drag.frame = requestAnimationFrame(this._scrollLoop);
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
/** The columns, in order. */
|
|
264
|
+
get columns() {
|
|
265
|
+
return Array.from(this.children).filter((el) => el instanceof NLDDTaskBoardColumn && !el.hidden);
|
|
266
|
+
}
|
|
267
|
+
connectedCallback() {
|
|
268
|
+
super.connectedCallback();
|
|
269
|
+
this.addEventListener('pointerdown', this._onPointerDown);
|
|
270
|
+
this.addEventListener('keydown', this._onKeyDown);
|
|
271
|
+
}
|
|
272
|
+
disconnectedCallback() {
|
|
273
|
+
super.disconnectedCallback();
|
|
274
|
+
this.removeEventListener('pointerdown', this._onPointerDown);
|
|
275
|
+
this.removeEventListener('keydown', this._onKeyDown);
|
|
276
|
+
this._scrollObserver?.disconnect();
|
|
277
|
+
this._scrollObserver = null;
|
|
278
|
+
this._endPress();
|
|
279
|
+
this._endDrag();
|
|
280
|
+
this._hideDenied();
|
|
281
|
+
}
|
|
282
|
+
updated(changed) {
|
|
283
|
+
if (changed.has('height')) {
|
|
284
|
+
const height = this.height;
|
|
285
|
+
if (height && CSS.supports('height', height))
|
|
286
|
+
this.style.setProperty('--_task-board-height', height);
|
|
287
|
+
else
|
|
288
|
+
this.style.removeProperty('--_task-board-height');
|
|
289
|
+
}
|
|
290
|
+
if (changed.has('readonly')) {
|
|
291
|
+
this._endPress();
|
|
292
|
+
this._cancelDrag();
|
|
293
|
+
this._hideDenied();
|
|
294
|
+
}
|
|
295
|
+
if (!this._scrollObserver && this._scroller) {
|
|
296
|
+
this._scrollObserver = new ResizeObserver(() => this._updateScroll());
|
|
297
|
+
this._scrollObserver.observe(this._scroller);
|
|
298
|
+
for (const column of this.columns)
|
|
299
|
+
this._scrollObserver.observe(column);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
moveItem(item, toColumn, toIndex) {
|
|
303
|
+
const from = this._columnOf(item);
|
|
304
|
+
const to = typeof toColumn === 'string'
|
|
305
|
+
? this.columns.find((column) => this._columnKey(column) === toColumn)
|
|
306
|
+
: toColumn;
|
|
307
|
+
if (!from || !to || !this.columns.includes(to)) {
|
|
308
|
+
setState(this, 'invalid-move', true);
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
const fromIndex = from.items.indexOf(item);
|
|
312
|
+
const room = to.items.filter((el) => el !== item).length;
|
|
313
|
+
const index = Math.max(0, Math.min(toIndex ?? room, room));
|
|
314
|
+
if (from === to && index === fromIndex) {
|
|
315
|
+
this._announce(this._t('components.task-board.no-change-text'));
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
return this._move(item, from, fromIndex, to, index);
|
|
319
|
+
}
|
|
320
|
+
/** Fires nldd-move, says where the item landed and puts focus back on what
|
|
321
|
+
* had it, once the app has moved the item in the handler. */
|
|
322
|
+
_move(item, from, fromIndex, to, toIndex) {
|
|
323
|
+
const focused = this._deepActiveElement();
|
|
324
|
+
const hadFocus = !!focused && this._holds(item, focused);
|
|
325
|
+
this.dispatchEvent(new CustomEvent('nldd-move', {
|
|
326
|
+
detail: { item, fromColumn: this._columnKey(from), fromIndex, toColumn: this._columnKey(to), toIndex },
|
|
327
|
+
bubbles: true,
|
|
328
|
+
composed: true,
|
|
329
|
+
}));
|
|
330
|
+
const total = to.items.filter((el) => el !== item).length + 1;
|
|
331
|
+
this._announce(this._t('components.task-board.moved-text', { column: to.label, position: toIndex + 1, total }));
|
|
332
|
+
if (hadFocus) {
|
|
333
|
+
// The app moved the item in the handler, which takes focus off it.
|
|
334
|
+
requestAnimationFrame(() => {
|
|
335
|
+
if (focused.isConnected)
|
|
336
|
+
focused.focus();
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
return true;
|
|
340
|
+
}
|
|
341
|
+
_columnKey(column) {
|
|
342
|
+
return column.value || column.text;
|
|
343
|
+
}
|
|
344
|
+
/** The column an element sits in as an item, if it is one in this board. */
|
|
345
|
+
_columnOf(item) {
|
|
346
|
+
const parent = item.parentElement;
|
|
347
|
+
return parent instanceof NLDDTaskBoardColumn && parent.parentElement === this && !item.slot ? parent : null;
|
|
348
|
+
}
|
|
349
|
+
/** The item an event happened in: the child of a column it came through. */
|
|
350
|
+
_itemFrom(event) {
|
|
351
|
+
for (const node of event.composedPath()) {
|
|
352
|
+
if (node instanceof HTMLElement && this._columnOf(node))
|
|
353
|
+
return node;
|
|
354
|
+
if (node === this)
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
/** Whether `node` is in `item`, also inside the shadow root of an item such
|
|
360
|
+
* as an nldd-card, where its own button takes the focus. */
|
|
361
|
+
_holds(item, node) {
|
|
362
|
+
let current = node;
|
|
363
|
+
while (current) {
|
|
364
|
+
if (current === item)
|
|
365
|
+
return true;
|
|
366
|
+
current = current.parentNode ?? (current instanceof ShadowRoot ? current.host : null);
|
|
367
|
+
}
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
_deepActiveElement() {
|
|
371
|
+
let active = document.activeElement;
|
|
372
|
+
while (active?.shadowRoot?.activeElement)
|
|
373
|
+
active = active.shadowRoot.activeElement;
|
|
374
|
+
return active instanceof HTMLElement ? active : null;
|
|
375
|
+
}
|
|
376
|
+
_announce(message) {
|
|
377
|
+
const region = this.shadowRoot?.querySelector('.task-board__announcer');
|
|
378
|
+
if (!region)
|
|
379
|
+
return;
|
|
380
|
+
region.textContent = '';
|
|
381
|
+
// Two frames, so a screen reader registers the change even for the same text.
|
|
382
|
+
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
383
|
+
region.textContent = message;
|
|
384
|
+
}));
|
|
385
|
+
}
|
|
386
|
+
/** The release ends a drag, or an attempt at one, not a click on the item. */
|
|
387
|
+
_swallowNextClick() {
|
|
388
|
+
window.addEventListener('click', this._swallowClick, { capture: true, once: true });
|
|
389
|
+
setTimeout(() => window.removeEventListener('click', this._swallowClick, { capture: true }), 0);
|
|
390
|
+
}
|
|
391
|
+
_endPress() {
|
|
392
|
+
if (this._press?.timer)
|
|
393
|
+
clearTimeout(this._press.timer);
|
|
394
|
+
if (this._press?.denied) {
|
|
395
|
+
this._deniedCursor?.remove();
|
|
396
|
+
this._deniedCursor = null;
|
|
397
|
+
this._deniedTimer = window.setTimeout(() => this._hideDenied(), DENIED_MS);
|
|
398
|
+
}
|
|
399
|
+
this._press = null;
|
|
400
|
+
if (!this._drag)
|
|
401
|
+
this._stopListening();
|
|
402
|
+
}
|
|
403
|
+
_stopListening() {
|
|
404
|
+
window.removeEventListener('selectstart', this._preventSelect);
|
|
405
|
+
window.removeEventListener('pointermove', this._onPointerMove);
|
|
406
|
+
window.removeEventListener('pointerup', this._onPointerUp);
|
|
407
|
+
window.removeEventListener('pointercancel', this._onPointerCancel);
|
|
408
|
+
}
|
|
409
|
+
_startDrag(x, y) {
|
|
410
|
+
const press = this._press;
|
|
411
|
+
const from = press && this._columnOf(press.item);
|
|
412
|
+
if (!press || !from)
|
|
413
|
+
return;
|
|
414
|
+
if (this.readonly) {
|
|
415
|
+
press.denied = true;
|
|
416
|
+
this._deny(press.item);
|
|
417
|
+
this._deniedCursor = this._cursorLayer('not-allowed');
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
const item = press.item;
|
|
421
|
+
const rect = item.getBoundingClientRect();
|
|
422
|
+
const ghost = item.cloneNode(true);
|
|
423
|
+
ghost.removeAttribute('id');
|
|
424
|
+
// A copy carries the state attributes of the item, such as the focus ring
|
|
425
|
+
// and the pressed fill an nldd-card draws from them; the ghost is its rest.
|
|
426
|
+
for (const name of ghost.getAttributeNames()) {
|
|
427
|
+
if (/focus|press|hover|active/i.test(name))
|
|
428
|
+
ghost.removeAttribute(name);
|
|
429
|
+
}
|
|
430
|
+
ghost.setAttribute('aria-hidden', 'true');
|
|
431
|
+
ghost.inert = true;
|
|
432
|
+
Object.assign(ghost.style, {
|
|
433
|
+
position: 'fixed',
|
|
434
|
+
top: '0',
|
|
435
|
+
left: '0',
|
|
436
|
+
zIndex: '2147483647',
|
|
437
|
+
width: `${rect.width}px`,
|
|
438
|
+
height: `${rect.height}px`,
|
|
439
|
+
margin: '0',
|
|
440
|
+
boxSizing: 'border-box',
|
|
441
|
+
pointerEvents: 'none',
|
|
442
|
+
userSelect: 'none',
|
|
443
|
+
boxShadow: 'var(--semantics-overlays-box-shadow)',
|
|
444
|
+
borderRadius: this._cornerRadius(item),
|
|
445
|
+
});
|
|
446
|
+
document.body.append(ghost);
|
|
447
|
+
item.setAttribute('data-task-board-dragging', '');
|
|
448
|
+
document.getSelection()?.removeAllRanges();
|
|
449
|
+
document.documentElement.style.setProperty('user-select', 'none');
|
|
450
|
+
document.documentElement.style.setProperty('-webkit-user-select', 'none');
|
|
451
|
+
window.addEventListener('touchmove', this._holdTouch, { passive: false });
|
|
452
|
+
window.addEventListener('contextmenu', this._preventContextMenu);
|
|
453
|
+
window.addEventListener('keydown', this._onDragKeyDown, true);
|
|
454
|
+
for (const column of this.columns)
|
|
455
|
+
column._dropState = 'available';
|
|
456
|
+
from._placeholder = item;
|
|
457
|
+
this._grabbing = this._cursorLayer('grabbing');
|
|
458
|
+
this._dragging = true;
|
|
459
|
+
this._drag = {
|
|
460
|
+
item,
|
|
461
|
+
from,
|
|
462
|
+
fromIndex: from.items.indexOf(item),
|
|
463
|
+
ghost,
|
|
464
|
+
offsetX: press.startX - rect.left,
|
|
465
|
+
offsetY: press.startY - rect.top,
|
|
466
|
+
x,
|
|
467
|
+
y,
|
|
468
|
+
target: null,
|
|
469
|
+
index: 0,
|
|
470
|
+
frame: requestAnimationFrame(this._scrollLoop),
|
|
471
|
+
note: null,
|
|
472
|
+
noteTimer: 0,
|
|
473
|
+
};
|
|
474
|
+
this._follow();
|
|
475
|
+
}
|
|
476
|
+
/** The rounding of what an item draws: its own, or that of the first element
|
|
477
|
+
* in its shadow root, where an nldd-card draws its surface. */
|
|
478
|
+
_cornerRadius(item) {
|
|
479
|
+
const own = getComputedStyle(item).borderRadius;
|
|
480
|
+
const surface = item.shadowRoot?.firstElementChild;
|
|
481
|
+
if (parseFloat(own) > 0 || !surface)
|
|
482
|
+
return own;
|
|
483
|
+
return getComputedStyle(surface).borderRadius;
|
|
484
|
+
}
|
|
485
|
+
/** Moves the ghost with the pointer and shows where it would land. */
|
|
486
|
+
_follow() {
|
|
487
|
+
const drag = this._drag;
|
|
488
|
+
if (!drag)
|
|
489
|
+
return;
|
|
490
|
+
drag.ghost.style.transform = `translate(${drag.x - drag.offsetX}px, ${drag.y - drag.offsetY}px) rotate(2deg)`;
|
|
491
|
+
const columns = this.columns;
|
|
492
|
+
let target = null;
|
|
493
|
+
let nearest = Infinity;
|
|
494
|
+
// Outside the board nothing takes the item: a release there puts it back.
|
|
495
|
+
const board = this._scroller.getBoundingClientRect();
|
|
496
|
+
const inside = drag.x >= board.left && drag.x <= board.right && drag.y >= board.top && drag.y <= board.bottom;
|
|
497
|
+
for (const column of inside ? columns : []) {
|
|
498
|
+
const rect = column.getBoundingClientRect();
|
|
499
|
+
const distance = drag.x < rect.left ? rect.left - drag.x : drag.x > rect.right ? drag.x - rect.right : 0;
|
|
500
|
+
if (distance < nearest) {
|
|
501
|
+
nearest = distance;
|
|
502
|
+
target = column;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
// A place among all the column's items, the dragged one included, so the
|
|
506
|
+
// line shows above or below its own place as the pointer crosses its middle.
|
|
507
|
+
const items = target ? target.items : [];
|
|
508
|
+
let index = items.findIndex((el) => {
|
|
509
|
+
const rect = el.getBoundingClientRect();
|
|
510
|
+
return drag.y < rect.top + rect.height / 2;
|
|
511
|
+
});
|
|
512
|
+
if (index === -1)
|
|
513
|
+
index = items.length;
|
|
514
|
+
if (drag.target && drag.target !== target) {
|
|
515
|
+
drag.target._dropIndex = null;
|
|
516
|
+
drag.target._dropState = 'available';
|
|
517
|
+
}
|
|
518
|
+
drag.target = target;
|
|
519
|
+
drag.index = index;
|
|
520
|
+
// Outside the board, or just above or below its own place, a release puts
|
|
521
|
+
// the item back where it was: the placeholder says so, not a line.
|
|
522
|
+
const returning = !target || (target === drag.from && (index === drag.fromIndex || index === drag.fromIndex + 1));
|
|
523
|
+
drag.from._returning = returning;
|
|
524
|
+
if (target) {
|
|
525
|
+
target._dropIndex = returning ? null : index;
|
|
526
|
+
target._dropState = 'over';
|
|
527
|
+
}
|
|
528
|
+
this._followReturnNote(inside);
|
|
529
|
+
}
|
|
530
|
+
/** Outside the board, after a moment, a note above the copy says a release
|
|
531
|
+
* puts the item back; the placeholder that says so may be out of view. */
|
|
532
|
+
_followReturnNote(inside) {
|
|
533
|
+
const drag = this._drag;
|
|
534
|
+
if (!drag)
|
|
535
|
+
return;
|
|
536
|
+
if (inside) {
|
|
537
|
+
clearTimeout(drag.noteTimer);
|
|
538
|
+
drag.noteTimer = 0;
|
|
539
|
+
drag.note?.remove();
|
|
540
|
+
drag.note = null;
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
if (!drag.note && !drag.noteTimer) {
|
|
544
|
+
drag.noteTimer = window.setTimeout(() => {
|
|
545
|
+
if (this._drag !== drag)
|
|
546
|
+
return;
|
|
547
|
+
drag.note = this._note(this._t('components.task-board.drag-return-text'));
|
|
548
|
+
this._followReturnNote(false);
|
|
549
|
+
}, RETURN_NOTE_DELAY_MS);
|
|
550
|
+
}
|
|
551
|
+
if (!drag.note)
|
|
552
|
+
return;
|
|
553
|
+
const x = drag.x - drag.offsetX + drag.ghost.offsetWidth / 2;
|
|
554
|
+
const y = drag.y - drag.offsetY;
|
|
555
|
+
drag.note.style.transform = `translate(${x}px, ${y}px) translate(-50%, calc(-100% - var(--primitives-space-8)))`;
|
|
556
|
+
}
|
|
557
|
+
_drop() {
|
|
558
|
+
const drag = this._drag;
|
|
559
|
+
if (!drag)
|
|
560
|
+
return;
|
|
561
|
+
const { item, from, fromIndex, target, index } = drag;
|
|
562
|
+
this._endDrag();
|
|
563
|
+
if (!target) {
|
|
564
|
+
this._announce(this._t('components.task-board.drag-canceled-text'));
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
// Just above or just below its own place is where it already is.
|
|
568
|
+
if (target === from && (index === fromIndex || index === fromIndex + 1)) {
|
|
569
|
+
this._announce(this._t('components.task-board.no-change-text'));
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
this._move(item, from, fromIndex, target, target === from && index > fromIndex ? index - 1 : index);
|
|
573
|
+
}
|
|
574
|
+
_cancelDrag() {
|
|
575
|
+
if (!this._drag)
|
|
576
|
+
return;
|
|
577
|
+
this._endDrag();
|
|
578
|
+
this._announce(this._t('components.task-board.drag-canceled-text'));
|
|
579
|
+
}
|
|
580
|
+
_endDrag() {
|
|
581
|
+
const drag = this._drag;
|
|
582
|
+
if (!drag)
|
|
583
|
+
return;
|
|
584
|
+
cancelAnimationFrame(drag.frame);
|
|
585
|
+
clearTimeout(drag.noteTimer);
|
|
586
|
+
drag.note?.remove();
|
|
587
|
+
drag.ghost.remove();
|
|
588
|
+
drag.item.removeAttribute('data-task-board-dragging');
|
|
589
|
+
if (drag.target)
|
|
590
|
+
drag.target._dropIndex = null;
|
|
591
|
+
for (const column of this.columns)
|
|
592
|
+
column._dropState = null;
|
|
593
|
+
drag.from._placeholder = null;
|
|
594
|
+
drag.from._returning = false;
|
|
595
|
+
this._grabbing?.remove();
|
|
596
|
+
this._grabbing = null;
|
|
597
|
+
document.documentElement.style.removeProperty('user-select');
|
|
598
|
+
document.documentElement.style.removeProperty('-webkit-user-select');
|
|
599
|
+
window.removeEventListener('touchmove', this._holdTouch);
|
|
600
|
+
window.removeEventListener('contextmenu', this._preventContextMenu);
|
|
601
|
+
window.removeEventListener('keydown', this._onDragKeyDown, true);
|
|
602
|
+
this._dragging = false;
|
|
603
|
+
this._drag = null;
|
|
604
|
+
if (!this._press)
|
|
605
|
+
this._stopListening();
|
|
606
|
+
}
|
|
607
|
+
/** A style in the document does not reach into shadow roots, where a
|
|
608
|
+
* button or a link sets its own cursor. A layer over the whole viewport
|
|
609
|
+
* does: the pointer is always over it. */
|
|
610
|
+
_cursorLayer(cursor) {
|
|
611
|
+
const layer = document.createElement('div');
|
|
612
|
+
layer.setAttribute('aria-hidden', 'true');
|
|
613
|
+
Object.assign(layer.style, {
|
|
614
|
+
position: 'fixed',
|
|
615
|
+
inset: '0',
|
|
616
|
+
zIndex: '2147483646',
|
|
617
|
+
cursor,
|
|
618
|
+
});
|
|
619
|
+
document.body.append(layer);
|
|
620
|
+
return layer;
|
|
621
|
+
}
|
|
622
|
+
// — Readonly ————————————————————————————————————————————————————————
|
|
623
|
+
/** Says at the item, and to a screen reader, that the board moves nothing,
|
|
624
|
+
* and tells the app. */
|
|
625
|
+
_deny(item) {
|
|
626
|
+
this._hideDenied();
|
|
627
|
+
const text = this._t('components.task-board.readonly-text');
|
|
628
|
+
this._announce(text);
|
|
629
|
+
const rect = item.getBoundingClientRect();
|
|
630
|
+
const below = rect.top < SCROLL_EDGE;
|
|
631
|
+
const note = this._note(text);
|
|
632
|
+
Object.assign(note.style, {
|
|
633
|
+
top: `${below ? rect.bottom : rect.top}px`,
|
|
634
|
+
left: `${rect.left + rect.width / 2}px`,
|
|
635
|
+
transform: `translate(-50%, ${below ? 'var(--primitives-space-8)' : 'calc(-100% - var(--primitives-space-8))'})`,
|
|
636
|
+
maxWidth: `${rect.width}px`,
|
|
637
|
+
});
|
|
638
|
+
this._deniedNote = note;
|
|
639
|
+
this.dispatchEvent(new CustomEvent('nldd-move-denied', { detail: { item }, bubbles: true, composed: true }));
|
|
640
|
+
}
|
|
641
|
+
/** A note in the look of a tooltip, over everything, for the eye only: what
|
|
642
|
+
* it says, the board also says to a screen reader or in its own way. */
|
|
643
|
+
_note(text) {
|
|
644
|
+
const note = document.createElement('div');
|
|
645
|
+
note.setAttribute('aria-hidden', 'true');
|
|
646
|
+
note.textContent = text;
|
|
647
|
+
Object.assign(note.style, {
|
|
648
|
+
position: 'fixed',
|
|
649
|
+
top: '0',
|
|
650
|
+
left: '0',
|
|
651
|
+
zIndex: '2147483647',
|
|
652
|
+
boxSizing: 'border-box',
|
|
653
|
+
width: 'max-content',
|
|
654
|
+
padding: 'var(--semantics-tooltips-padding-block) var(--semantics-tooltips-padding-inline)',
|
|
655
|
+
borderRadius: 'var(--semantics-tooltips-corner-radius)',
|
|
656
|
+
boxShadow: 'var(--semantics-tooltips-box-shadow)',
|
|
657
|
+
backgroundColor: 'var(--semantics-tooltips-background-color)',
|
|
658
|
+
color: 'var(--semantics-tooltips-content-color)',
|
|
659
|
+
font: 'var(--semantics-tooltips-font)',
|
|
660
|
+
pointerEvents: 'none',
|
|
661
|
+
});
|
|
662
|
+
document.body.append(note);
|
|
663
|
+
return note;
|
|
664
|
+
}
|
|
665
|
+
_hideDenied() {
|
|
666
|
+
clearTimeout(this._deniedTimer);
|
|
667
|
+
this._deniedNote?.remove();
|
|
668
|
+
this._deniedNote = null;
|
|
669
|
+
this._deniedCursor?.remove();
|
|
670
|
+
this._deniedCursor = null;
|
|
671
|
+
}
|
|
672
|
+
render() {
|
|
673
|
+
return taskBoardTemplate(this);
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
NLDDTaskBoard.styles = taskBoardStyles;
|
|
677
|
+
__decorate([
|
|
678
|
+
property({ type: String, attribute: 'accessible-label' })
|
|
679
|
+
], NLDDTaskBoard.prototype, "accessibleLabel", void 0);
|
|
680
|
+
__decorate([
|
|
681
|
+
property({ type: String, reflect: true })
|
|
682
|
+
], NLDDTaskBoard.prototype, "height", void 0);
|
|
683
|
+
__decorate([
|
|
684
|
+
property({ type: Boolean, reflect: true })
|
|
685
|
+
], NLDDTaskBoard.prototype, "readonly", void 0);
|
|
686
|
+
__decorate([
|
|
687
|
+
query('.task-board')
|
|
688
|
+
], NLDDTaskBoard.prototype, "_scroller", void 0);
|
|
689
|
+
__decorate([
|
|
690
|
+
state()
|
|
691
|
+
], NLDDTaskBoard.prototype, "_canScrollLeft", void 0);
|
|
692
|
+
__decorate([
|
|
693
|
+
state()
|
|
694
|
+
], NLDDTaskBoard.prototype, "_canScrollRight", void 0);
|
|
695
|
+
__decorate([
|
|
696
|
+
state()
|
|
697
|
+
], NLDDTaskBoard.prototype, "_dragging", void 0);
|
|
698
|
+
NLDDTaskBoard = __decorate([
|
|
699
|
+
customElement('nldd-task-board')
|
|
700
|
+
], NLDDTaskBoard);
|
|
701
|
+
export { NLDDTaskBoard };
|
|
702
|
+
//# sourceMappingURL=task-board.js.map
|