@carbon/web-components 2.47.0 → 2.48.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/custom-elements.json +963 -145
- package/es/components/accordion/accordion-item.d.ts +28 -12
- package/es/components/accordion/accordion-item.js +7 -5
- package/es/components/accordion/accordion-item.js.map +1 -1
- package/es/components/accordion/accordion-skeleton.d.ts +1 -1
- package/es/components/accordion/accordion-skeleton.js +7 -5
- package/es/components/accordion/accordion-skeleton.js.map +1 -1
- package/es/components/accordion/accordion.d.ts +1 -1
- package/es/components/accordion/accordion.js +7 -5
- package/es/components/accordion/accordion.js.map +1 -1
- package/es/components/ai-label/ai-label.d.ts +1 -1
- package/es/components/ai-label/ai-label.js +6 -5
- package/es/components/ai-label/ai-label.js.map +1 -1
- package/es/components/button/button.d.ts +56 -22
- package/es/components/checkbox/checkbox-group.d.ts +2 -0
- package/es/components/checkbox/checkbox.d.ts +57 -23
- package/es/components/checkbox/checkbox.js +7 -5
- package/es/components/checkbox/checkbox.js.map +1 -1
- package/es/components/code-snippet/code-snippet.d.ts +29 -11
- package/es/components/code-snippet/code-snippet.js +15 -14
- package/es/components/code-snippet/code-snippet.js.map +1 -1
- package/es/components/combo-box/combo-box.scss.js +1 -1
- package/es/components/combo-button/combo-button.d.ts +27 -11
- package/es/components/content-switcher/content-switcher-item.d.ts +29 -11
- package/es/components/copy-button/copy-button.d.ts +27 -11
- package/es/components/data-table/table-expanded-row.d.ts +28 -12
- package/es/components/data-table/table-expanded-row.js +7 -5
- package/es/components/data-table/table-expanded-row.js.map +1 -1
- package/es/components/data-table/table-header-cell.d.ts +29 -11
- package/es/components/data-table/table-row.d.ts +54 -22
- package/es/components/data-table/table-toolbar-search.d.ts +29 -11
- package/es/components/data-table/table.d.ts +28 -12
- package/es/components/data-table/table.js +9 -8
- package/es/components/data-table/table.js.map +1 -1
- package/es/components/date-picker/date-picker-input.d.ts +29 -11
- package/es/components/date-picker/date-picker.d.ts +54 -22
- package/es/components/dropdown/dropdown.d.ts +110 -44
- package/es/components/dropdown/dropdown.js +8 -6
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/file-uploader/file-uploader-button.d.ts +27 -11
- package/es/components/file-uploader/file-uploader-drop-container.d.ts +27 -11
- package/es/components/floating-menu/floating-menu.d.ts +56 -22
- package/es/components/fluid-select/fluid-select.d.ts +5 -0
- package/es/components/fluid-select/fluid-select.js +50 -1
- package/es/components/fluid-select/fluid-select.js.map +1 -1
- package/es/components/fluid-textarea/fluid-textarea-skeleton.d.ts +3 -3
- package/es/components/fluid-textarea/fluid-textarea-skeleton.js +3 -3
- package/es/components/fluid-textarea/fluid-textarea-skeleton.js.map +1 -1
- package/es/components/fluid-time-picker/fluid-time-picker-select.d.ts +21 -0
- package/es/components/fluid-time-picker/fluid-time-picker-select.js +53 -0
- package/es/components/fluid-time-picker/fluid-time-picker-select.js.map +1 -0
- package/es/components/fluid-time-picker/fluid-time-picker-skeleton.d.ts +23 -0
- package/es/components/fluid-time-picker/fluid-time-picker-skeleton.js +63 -0
- package/es/components/fluid-time-picker/fluid-time-picker-skeleton.js.map +1 -0
- package/es/components/fluid-time-picker/fluid-time-picker.d.ts +32 -0
- package/es/components/fluid-time-picker/fluid-time-picker.js +239 -0
- package/es/components/fluid-time-picker/fluid-time-picker.js.map +1 -0
- package/es/components/fluid-time-picker/fluid-time-picker.scss.js +13 -0
- package/es/components/fluid-time-picker/fluid-time-picker.scss.js.map +1 -0
- package/es/components/fluid-time-picker/index.d.ts +9 -0
- package/es/components/fluid-time-picker/index.js +11 -0
- package/es/components/fluid-time-picker/index.js.map +1 -0
- package/es/components/grid/column.d.ts +3 -1
- package/es/components/grid/column.js +6 -0
- package/es/components/grid/column.js.map +1 -1
- package/es/components/icon-button/icon-button.d.ts +1 -1
- package/es/components/icon-button/icon-button.js +6 -5
- package/es/components/icon-button/icon-button.js.map +1 -1
- package/es/components/link/link.d.ts +29 -11
- package/es/components/menu/menu-item-selectable.d.ts +5 -3
- package/es/components/menu/menu-item-selectable.js +3 -3
- package/es/components/menu/menu-item-selectable.js.map +1 -1
- package/es/components/menu/menu-item.d.ts +68 -23
- package/es/components/menu/menu-item.js +37 -2
- package/es/components/menu/menu-item.js.map +1 -1
- package/es/components/menu/menu.d.ts +27 -11
- package/es/components/menu-button/menu-button.d.ts +27 -11
- package/es/components/modal/modal-close-button.d.ts +29 -11
- package/es/components/modal/modal.d.ts +27 -11
- package/es/components/modal/modal.js +6 -4
- package/es/components/modal/modal.js.map +1 -1
- package/es/components/multi-select/multi-select.js +12 -8
- package/es/components/multi-select/multi-select.js.map +1 -1
- package/es/components/notification/actionable-notification.d.ts +27 -11
- package/es/components/notification/actionable-notification.scss.js +1 -1
- package/es/components/notification/inline-notification.d.ts +27 -11
- package/es/components/notification/inline-notification.scss.js +1 -1
- package/es/components/notification/toast-notification.scss.js +1 -1
- package/es/components/number-input/number-input.d.ts +2 -0
- package/es/components/overflow-menu/overflow-menu-item.d.ts +29 -11
- package/es/components/overflow-menu/overflow-menu.d.ts +54 -22
- package/es/components/pagination/pagination.d.ts +56 -22
- package/es/components/pagination-nav/defs.d.ts +61 -0
- package/es/components/pagination-nav/defs.js +74 -0
- package/es/components/pagination-nav/defs.js.map +1 -0
- package/es/components/pagination-nav/index.d.ts +7 -0
- package/es/components/pagination-nav/index.js +9 -0
- package/es/components/pagination-nav/index.js.map +1 -0
- package/es/components/pagination-nav/pagination-nav.d.ts +109 -0
- package/es/components/pagination-nav/pagination-nav.js +427 -0
- package/es/components/pagination-nav/pagination-nav.js.map +1 -0
- package/es/components/pagination-nav/pagination-nav.scss.js +13 -0
- package/es/components/pagination-nav/pagination-nav.scss.js.map +1 -0
- package/es/components/password-input/password-input.d.ts +2 -0
- package/es/components/popover/popover.d.ts +27 -11
- package/es/components/popover/popover.js +1 -1
- package/es/components/popover/popover.js.map +1 -1
- package/es/components/progress-indicator/progress-step.d.ts +29 -11
- package/es/components/radio-button/radio-button-group.d.ts +54 -22
- package/es/components/radio-button/radio-button.d.ts +57 -23
- package/es/components/radio-button/radio-button.js +7 -5
- package/es/components/radio-button/radio-button.js.map +1 -1
- package/es/components/search/search.d.ts +83 -33
- package/es/components/select/select.d.ts +29 -11
- package/es/components/side-panel/side-panel.d.ts +27 -11
- package/es/components/skip-to-content/skip-to-content.d.ts +29 -11
- package/es/components/slider/slider-input.d.ts +29 -11
- package/es/components/slider/slider.d.ts +84 -34
- package/es/components/slider/slider.js +9 -7
- package/es/components/slider/slider.js.map +1 -1
- package/es/components/slug/slug.d.ts +1 -1
- package/es/components/slug/slug.js +6 -4
- package/es/components/slug/slug.js.map +1 -1
- package/es/components/structured-list/structured-list-row.d.ts +27 -11
- package/es/components/structured-list/structured-list.d.ts +30 -12
- package/es/components/structured-list/structured-list.js +7 -5
- package/es/components/structured-list/structured-list.js.map +1 -1
- package/es/components/tabs/tabs.d.ts +27 -11
- package/es/components/tag/dismissible-tag.d.ts +54 -22
- package/es/components/tag/operational-tag.d.ts +54 -22
- package/es/components/tag/selectable-tag.d.ts +54 -22
- package/es/components/tag/tag.d.ts +54 -22
- package/es/components/tearsheet/tearsheet.d.ts +27 -11
- package/es/components/text-input/text-input.d.ts +56 -22
- package/es/components/textarea/textarea.d.ts +2 -0
- package/es/components/tile/expandable-tile.d.ts +54 -22
- package/es/components/tile/selectable-tile.d.ts +56 -22
- package/es/components/tile/tile-group.d.ts +27 -11
- package/es/components/time-picker/time-picker-select.d.ts +29 -11
- package/es/components/time-picker/time-picker.d.ts +56 -22
- package/es/components/toggle/toggle.d.ts +27 -11
- package/es/components/toggle-tip/toggletip.d.ts +57 -23
- package/es/components/toggle-tip/toggletip.js +7 -5
- package/es/components/toggle-tip/toggletip.js.map +1 -1
- package/es/components/tooltip/tooltip.d.ts +28 -12
- package/es/components/tooltip/tooltip.js +7 -5
- package/es/components/tooltip/tooltip.js.map +1 -1
- package/es/components/tree-view/tree-view.d.ts +28 -12
- package/es/components/tree-view/tree-view.js +7 -5
- package/es/components/tree-view/tree-view.js.map +1 -1
- package/es/components/ui-shell/header-global-action.d.ts +2 -0
- package/es/components/ui-shell/header-menu-button.d.ts +29 -11
- package/es/components/ui-shell/header-menu.d.ts +56 -22
- package/es/components/ui-shell/header-name.d.ts +29 -11
- package/es/components/ui-shell/header-nav-item.d.ts +29 -11
- package/es/components/ui-shell/header-panel.d.ts +2 -0
- package/es/components/ui-shell/side-nav-link.d.ts +29 -11
- package/es/components/ui-shell/side-nav-menu-item.d.ts +29 -11
- package/es/components/ui-shell/side-nav-menu.d.ts +29 -11
- package/es/components/ui-shell/side-nav.d.ts +27 -11
- package/es/components/ui-shell/switcher-item.d.ts +29 -11
- package/es/components/ui-shell/switcher.d.ts +2 -0
- package/es/globals/mixins/focus.d.ts +27 -11
- package/es/globals/mixins/form.d.ts +27 -11
- package/es/globals/mixins/host-listener.d.ts +27 -11
- package/es/globals/mixins/validity.d.ts +27 -11
- package/es-custom/components/accordion/accordion-item.d.ts +28 -12
- package/es-custom/components/accordion/accordion-item.js +7 -5
- package/es-custom/components/accordion/accordion-item.js.map +1 -1
- package/es-custom/components/accordion/accordion-skeleton.d.ts +1 -1
- package/es-custom/components/accordion/accordion-skeleton.js +7 -5
- package/es-custom/components/accordion/accordion-skeleton.js.map +1 -1
- package/es-custom/components/accordion/accordion.d.ts +1 -1
- package/es-custom/components/accordion/accordion.js +7 -5
- package/es-custom/components/accordion/accordion.js.map +1 -1
- package/es-custom/components/ai-label/ai-label.d.ts +1 -1
- package/es-custom/components/ai-label/ai-label.js +6 -5
- package/es-custom/components/ai-label/ai-label.js.map +1 -1
- package/es-custom/components/button/button.d.ts +56 -22
- package/es-custom/components/checkbox/checkbox-group.d.ts +2 -0
- package/es-custom/components/checkbox/checkbox.d.ts +57 -23
- package/es-custom/components/checkbox/checkbox.js +7 -5
- package/es-custom/components/checkbox/checkbox.js.map +1 -1
- package/es-custom/components/code-snippet/code-snippet.d.ts +29 -11
- package/es-custom/components/code-snippet/code-snippet.js +15 -14
- package/es-custom/components/code-snippet/code-snippet.js.map +1 -1
- package/es-custom/components/combo-box/combo-box.scss.js +1 -1
- package/es-custom/components/combo-button/combo-button.d.ts +27 -11
- package/es-custom/components/content-switcher/content-switcher-item.d.ts +29 -11
- package/es-custom/components/copy-button/copy-button.d.ts +27 -11
- package/es-custom/components/data-table/table-expanded-row.d.ts +28 -12
- package/es-custom/components/data-table/table-expanded-row.js +7 -5
- package/es-custom/components/data-table/table-expanded-row.js.map +1 -1
- package/es-custom/components/data-table/table-header-cell.d.ts +29 -11
- package/es-custom/components/data-table/table-row.d.ts +54 -22
- package/es-custom/components/data-table/table-toolbar-search.d.ts +29 -11
- package/es-custom/components/data-table/table.d.ts +28 -12
- package/es-custom/components/data-table/table.js +9 -8
- package/es-custom/components/data-table/table.js.map +1 -1
- package/es-custom/components/date-picker/date-picker-input.d.ts +29 -11
- package/es-custom/components/date-picker/date-picker.d.ts +54 -22
- package/es-custom/components/dropdown/dropdown.d.ts +110 -44
- package/es-custom/components/dropdown/dropdown.js +8 -6
- package/es-custom/components/dropdown/dropdown.js.map +1 -1
- package/es-custom/components/file-uploader/file-uploader-button.d.ts +27 -11
- package/es-custom/components/file-uploader/file-uploader-drop-container.d.ts +27 -11
- package/es-custom/components/floating-menu/floating-menu.d.ts +56 -22
- package/es-custom/components/fluid-select/fluid-select.d.ts +5 -0
- package/es-custom/components/fluid-select/fluid-select.js +50 -1
- package/es-custom/components/fluid-select/fluid-select.js.map +1 -1
- package/es-custom/components/fluid-textarea/fluid-textarea-skeleton.d.ts +3 -3
- package/es-custom/components/fluid-textarea/fluid-textarea-skeleton.js +3 -3
- package/es-custom/components/fluid-textarea/fluid-textarea-skeleton.js.map +1 -1
- package/es-custom/components/fluid-time-picker/fluid-time-picker-select.d.ts +21 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker-select.js +53 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker-select.js.map +1 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker-skeleton.d.ts +23 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker-skeleton.js +63 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker-skeleton.js.map +1 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker.d.ts +32 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker.js +239 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker.js.map +1 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker.scss.js +13 -0
- package/es-custom/components/fluid-time-picker/fluid-time-picker.scss.js.map +1 -0
- package/es-custom/components/fluid-time-picker/index.d.ts +9 -0
- package/es-custom/components/fluid-time-picker/index.js +11 -0
- package/es-custom/components/fluid-time-picker/index.js.map +1 -0
- package/es-custom/components/grid/column.d.ts +3 -1
- package/es-custom/components/grid/column.js +6 -0
- package/es-custom/components/grid/column.js.map +1 -1
- package/es-custom/components/icon-button/icon-button.d.ts +1 -1
- package/es-custom/components/icon-button/icon-button.js +6 -5
- package/es-custom/components/icon-button/icon-button.js.map +1 -1
- package/es-custom/components/link/link.d.ts +29 -11
- package/es-custom/components/menu/menu-item-selectable.d.ts +5 -3
- package/es-custom/components/menu/menu-item-selectable.js +3 -3
- package/es-custom/components/menu/menu-item-selectable.js.map +1 -1
- package/es-custom/components/menu/menu-item.d.ts +68 -23
- package/es-custom/components/menu/menu-item.js +37 -2
- package/es-custom/components/menu/menu-item.js.map +1 -1
- package/es-custom/components/menu/menu.d.ts +27 -11
- package/es-custom/components/menu-button/menu-button.d.ts +27 -11
- package/es-custom/components/modal/modal-close-button.d.ts +29 -11
- package/es-custom/components/modal/modal.d.ts +27 -11
- package/es-custom/components/modal/modal.js +6 -4
- package/es-custom/components/modal/modal.js.map +1 -1
- package/es-custom/components/multi-select/multi-select.js +12 -8
- package/es-custom/components/multi-select/multi-select.js.map +1 -1
- package/es-custom/components/notification/actionable-notification.d.ts +27 -11
- package/es-custom/components/notification/actionable-notification.scss.js +1 -1
- package/es-custom/components/notification/inline-notification.d.ts +27 -11
- package/es-custom/components/notification/inline-notification.scss.js +1 -1
- package/es-custom/components/notification/toast-notification.scss.js +1 -1
- package/es-custom/components/number-input/number-input.d.ts +2 -0
- package/es-custom/components/overflow-menu/overflow-menu-item.d.ts +29 -11
- package/es-custom/components/overflow-menu/overflow-menu.d.ts +54 -22
- package/es-custom/components/pagination/pagination.d.ts +56 -22
- package/es-custom/components/pagination-nav/defs.d.ts +61 -0
- package/es-custom/components/pagination-nav/defs.js +74 -0
- package/es-custom/components/pagination-nav/defs.js.map +1 -0
- package/es-custom/components/pagination-nav/index.d.ts +7 -0
- package/es-custom/components/pagination-nav/index.js +9 -0
- package/es-custom/components/pagination-nav/index.js.map +1 -0
- package/es-custom/components/pagination-nav/pagination-nav.d.ts +109 -0
- package/es-custom/components/pagination-nav/pagination-nav.js +427 -0
- package/es-custom/components/pagination-nav/pagination-nav.js.map +1 -0
- package/es-custom/components/pagination-nav/pagination-nav.scss.js +13 -0
- package/es-custom/components/pagination-nav/pagination-nav.scss.js.map +1 -0
- package/es-custom/components/password-input/password-input.d.ts +2 -0
- package/es-custom/components/popover/popover.d.ts +27 -11
- package/es-custom/components/popover/popover.js +1 -1
- package/es-custom/components/popover/popover.js.map +1 -1
- package/es-custom/components/progress-indicator/progress-step.d.ts +29 -11
- package/es-custom/components/radio-button/radio-button-group.d.ts +54 -22
- package/es-custom/components/radio-button/radio-button.d.ts +57 -23
- package/es-custom/components/radio-button/radio-button.js +7 -5
- package/es-custom/components/radio-button/radio-button.js.map +1 -1
- package/es-custom/components/search/search.d.ts +83 -33
- package/es-custom/components/select/select.d.ts +29 -11
- package/es-custom/components/side-panel/side-panel.d.ts +27 -11
- package/es-custom/components/skip-to-content/skip-to-content.d.ts +29 -11
- package/es-custom/components/slider/slider-input.d.ts +29 -11
- package/es-custom/components/slider/slider.d.ts +84 -34
- package/es-custom/components/slider/slider.js +9 -7
- package/es-custom/components/slider/slider.js.map +1 -1
- package/es-custom/components/slug/slug.d.ts +1 -1
- package/es-custom/components/slug/slug.js +6 -4
- package/es-custom/components/slug/slug.js.map +1 -1
- package/es-custom/components/structured-list/structured-list-row.d.ts +27 -11
- package/es-custom/components/structured-list/structured-list.d.ts +30 -12
- package/es-custom/components/structured-list/structured-list.js +7 -5
- package/es-custom/components/structured-list/structured-list.js.map +1 -1
- package/es-custom/components/tabs/tabs.d.ts +27 -11
- package/es-custom/components/tag/dismissible-tag.d.ts +54 -22
- package/es-custom/components/tag/operational-tag.d.ts +54 -22
- package/es-custom/components/tag/selectable-tag.d.ts +54 -22
- package/es-custom/components/tag/tag.d.ts +54 -22
- package/es-custom/components/tearsheet/tearsheet.d.ts +27 -11
- package/es-custom/components/text-input/text-input.d.ts +56 -22
- package/es-custom/components/textarea/textarea.d.ts +2 -0
- package/es-custom/components/tile/expandable-tile.d.ts +54 -22
- package/es-custom/components/tile/selectable-tile.d.ts +56 -22
- package/es-custom/components/tile/tile-group.d.ts +27 -11
- package/es-custom/components/time-picker/time-picker-select.d.ts +29 -11
- package/es-custom/components/time-picker/time-picker.d.ts +56 -22
- package/es-custom/components/toggle/toggle.d.ts +27 -11
- package/es-custom/components/toggle-tip/toggletip.d.ts +57 -23
- package/es-custom/components/toggle-tip/toggletip.js +7 -5
- package/es-custom/components/toggle-tip/toggletip.js.map +1 -1
- package/es-custom/components/tooltip/tooltip.d.ts +28 -12
- package/es-custom/components/tooltip/tooltip.js +7 -5
- package/es-custom/components/tooltip/tooltip.js.map +1 -1
- package/es-custom/components/tree-view/tree-view.d.ts +28 -12
- package/es-custom/components/tree-view/tree-view.js +7 -5
- package/es-custom/components/tree-view/tree-view.js.map +1 -1
- package/es-custom/components/ui-shell/header-global-action.d.ts +2 -0
- package/es-custom/components/ui-shell/header-menu-button.d.ts +29 -11
- package/es-custom/components/ui-shell/header-menu.d.ts +56 -22
- package/es-custom/components/ui-shell/header-name.d.ts +29 -11
- package/es-custom/components/ui-shell/header-nav-item.d.ts +29 -11
- package/es-custom/components/ui-shell/header-panel.d.ts +2 -0
- package/es-custom/components/ui-shell/side-nav-link.d.ts +29 -11
- package/es-custom/components/ui-shell/side-nav-menu-item.d.ts +29 -11
- package/es-custom/components/ui-shell/side-nav-menu.d.ts +29 -11
- package/es-custom/components/ui-shell/side-nav.d.ts +27 -11
- package/es-custom/components/ui-shell/switcher-item.d.ts +29 -11
- package/es-custom/components/ui-shell/switcher.d.ts +2 -0
- package/es-custom/globals/mixins/focus.d.ts +27 -11
- package/es-custom/globals/mixins/form.d.ts +27 -11
- package/es-custom/globals/mixins/host-listener.d.ts +27 -11
- package/es-custom/globals/mixins/validity.d.ts +27 -11
- package/lib/components/accordion/accordion-item.d.ts +28 -12
- package/lib/components/accordion/accordion-skeleton.d.ts +1 -1
- package/lib/components/accordion/accordion.d.ts +1 -1
- package/lib/components/ai-label/ai-label.d.ts +1 -1
- package/lib/components/button/button.d.ts +56 -22
- package/lib/components/checkbox/checkbox-group.d.ts +2 -0
- package/lib/components/checkbox/checkbox.d.ts +57 -23
- package/lib/components/code-snippet/code-snippet.d.ts +29 -11
- package/lib/components/combo-button/combo-button.d.ts +27 -11
- package/lib/components/content-switcher/content-switcher-item.d.ts +29 -11
- package/lib/components/copy-button/copy-button.d.ts +27 -11
- package/lib/components/data-table/table-expanded-row.d.ts +28 -12
- package/lib/components/data-table/table-header-cell.d.ts +29 -11
- package/lib/components/data-table/table-row.d.ts +54 -22
- package/lib/components/data-table/table-toolbar-search.d.ts +29 -11
- package/lib/components/data-table/table.d.ts +28 -12
- package/lib/components/date-picker/date-picker-input.d.ts +29 -11
- package/lib/components/date-picker/date-picker.d.ts +54 -22
- package/lib/components/dropdown/dropdown.d.ts +110 -44
- package/lib/components/file-uploader/file-uploader-button.d.ts +27 -11
- package/lib/components/file-uploader/file-uploader-drop-container.d.ts +27 -11
- package/lib/components/floating-menu/floating-menu.d.ts +56 -22
- package/lib/components/fluid-select/fluid-select.d.ts +5 -0
- package/lib/components/fluid-textarea/fluid-textarea-skeleton.d.ts +3 -3
- package/lib/components/fluid-time-picker/fluid-time-picker-select.d.ts +21 -0
- package/lib/components/fluid-time-picker/fluid-time-picker-skeleton.d.ts +23 -0
- package/lib/components/fluid-time-picker/fluid-time-picker.d.ts +32 -0
- package/lib/components/fluid-time-picker/index.d.ts +9 -0
- package/lib/components/grid/column.d.ts +3 -1
- package/lib/components/icon-button/icon-button.d.ts +1 -1
- package/lib/components/link/link.d.ts +29 -11
- package/lib/components/menu/menu-item-selectable.d.ts +5 -3
- package/lib/components/menu/menu-item.d.ts +68 -23
- package/lib/components/menu/menu.d.ts +27 -11
- package/lib/components/menu-button/menu-button.d.ts +27 -11
- package/lib/components/modal/modal-close-button.d.ts +29 -11
- package/lib/components/modal/modal.d.ts +27 -11
- package/lib/components/notification/actionable-notification.d.ts +27 -11
- package/lib/components/notification/inline-notification.d.ts +27 -11
- package/lib/components/number-input/number-input.d.ts +2 -0
- package/lib/components/overflow-menu/overflow-menu-item.d.ts +29 -11
- package/lib/components/overflow-menu/overflow-menu.d.ts +54 -22
- package/lib/components/pagination/pagination.d.ts +56 -22
- package/lib/components/pagination-nav/defs.d.ts +61 -0
- package/lib/components/pagination-nav/defs.js +74 -0
- package/lib/components/pagination-nav/defs.js.map +1 -0
- package/lib/components/pagination-nav/index.d.ts +7 -0
- package/lib/components/pagination-nav/pagination-nav.d.ts +109 -0
- package/lib/components/password-input/password-input.d.ts +2 -0
- package/lib/components/popover/popover.d.ts +27 -11
- package/lib/components/progress-indicator/progress-step.d.ts +29 -11
- package/lib/components/radio-button/radio-button-group.d.ts +54 -22
- package/lib/components/radio-button/radio-button.d.ts +57 -23
- package/lib/components/search/search.d.ts +83 -33
- package/lib/components/select/select.d.ts +29 -11
- package/lib/components/side-panel/side-panel.d.ts +27 -11
- package/lib/components/skip-to-content/skip-to-content.d.ts +29 -11
- package/lib/components/slider/slider-input.d.ts +29 -11
- package/lib/components/slider/slider.d.ts +84 -34
- package/lib/components/slug/slug.d.ts +1 -1
- package/lib/components/structured-list/structured-list-row.d.ts +27 -11
- package/lib/components/structured-list/structured-list.d.ts +30 -12
- package/lib/components/tabs/tabs.d.ts +27 -11
- package/lib/components/tag/dismissible-tag.d.ts +54 -22
- package/lib/components/tag/operational-tag.d.ts +54 -22
- package/lib/components/tag/selectable-tag.d.ts +54 -22
- package/lib/components/tag/tag.d.ts +54 -22
- package/lib/components/tearsheet/tearsheet.d.ts +27 -11
- package/lib/components/text-input/text-input.d.ts +56 -22
- package/lib/components/textarea/textarea.d.ts +2 -0
- package/lib/components/tile/expandable-tile.d.ts +54 -22
- package/lib/components/tile/selectable-tile.d.ts +56 -22
- package/lib/components/tile/tile-group.d.ts +27 -11
- package/lib/components/time-picker/time-picker-select.d.ts +29 -11
- package/lib/components/time-picker/time-picker.d.ts +56 -22
- package/lib/components/toggle/toggle.d.ts +27 -11
- package/lib/components/toggle-tip/toggletip.d.ts +57 -23
- package/lib/components/tooltip/tooltip.d.ts +28 -12
- package/lib/components/tree-view/tree-view.d.ts +28 -12
- package/lib/components/ui-shell/header-global-action.d.ts +2 -0
- package/lib/components/ui-shell/header-menu-button.d.ts +29 -11
- package/lib/components/ui-shell/header-menu.d.ts +56 -22
- package/lib/components/ui-shell/header-name.d.ts +29 -11
- package/lib/components/ui-shell/header-nav-item.d.ts +29 -11
- package/lib/components/ui-shell/header-panel.d.ts +2 -0
- package/lib/components/ui-shell/side-nav-link.d.ts +29 -11
- package/lib/components/ui-shell/side-nav-menu-item.d.ts +29 -11
- package/lib/components/ui-shell/side-nav-menu.d.ts +29 -11
- package/lib/components/ui-shell/side-nav.d.ts +27 -11
- package/lib/components/ui-shell/switcher-item.d.ts +29 -11
- package/lib/components/ui-shell/switcher.d.ts +2 -0
- package/lib/globals/mixins/focus.d.ts +27 -11
- package/lib/globals/mixins/form.d.ts +27 -11
- package/lib/globals/mixins/host-listener.d.ts +27 -11
- package/lib/globals/mixins/validity.d.ts +27 -11
- package/package.json +7 -7
- package/scss/components/combo-box/combo-box.scss +1 -1
- package/scss/components/fluid-time-picker/fluid-time-picker.scss +198 -0
- package/scss/components/pagination-nav/pagination-nav.scss +29 -0
- package/telemetry.yml +16 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { adoptStyles } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport CDSPopover from '../popover/popover';\nimport '../popover/popover-content';\nimport styles from './tooltip.scss?lit';\nimport popoverStyles from '../popover/popover.scss?lit';\nimport CDSTooltipContent from './tooltip-content';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\n/**\n * Trigger button of tooltip.\n *\n * @element cds-tooltip\n */\n@customElement(`${prefix}-tooltip`)\nclass CDSTooltip extends HostListenerMixin(CDSPopover) {\n /**\n * Specify how the trigger should align with the tooltip\n */\n @property({ reflect: true, type: String })\n align = 'top';\n\n /**\n * Specify whether a auto align functionality should be applied\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * `true` if this tooltip is in a data table row\n */\n @property({ type: Boolean, reflect: true, attribute: 'data-table' })\n dataTable = false;\n\n /**\n * Specify whether the tooltip should be closed when clicked\n */\n @property({ reflect: true, type: Boolean })\n closeOnActivation = false;\n\n /**\n * Specify whether the tooltip should be open when it first renders\n */\n @property({ reflect: true, type: Boolean })\n defaultOpen = false;\n\n /**\n * Specify the duration in milliseconds to delay before displaying the tooltip\n */\n @property({ attribute: 'enter-delay-ms', type: Number })\n enterDelayMs = 100;\n\n /**\n * Specify the duration in milliseconds to delay before hiding the tooltip\n */\n @property({ attribute: 'leave-delay-ms', type: Number })\n leaveDelayMs = 300;\n\n /**\n * Only open tooltip on keyboard interactions, this is used for interactive tags\n * (ie. operational-tag, selectable-tag)\n */\n @property({ attribute: 'keyboard-only', type: Boolean })\n keyboardOnly = false;\n\n /**\n * Specify the size of the tooltip\n */\n @property({ reflect: true })\n size = false;\n\n /**\n * Specify the timeout reference for the tooltip\n */\n @property({ reflect: true })\n timeoutId = 0;\n\n /**\n * Specify whether the tooltip should be open when it first renders\n */\n @property({ reflect: true, attribute: 'toolbar-action', type: Boolean })\n toolbarAction = false;\n\n /**\n * Track if last interaction was a keyboard interaction\n */\n private lastInteractionWasKeyboard = false;\n\n /**\n * Handles opening of tooltip\n */\n private _showTooltip = async () => {\n window.clearTimeout(this.timeoutId);\n this.timeoutId = window.setTimeout(async () => {\n this.open = true;\n const { open, updateComplete } = this;\n if (open) {\n await updateComplete;\n const { selectorTooltipContent } = this\n .constructor as typeof CDSTooltip;\n (this.querySelector(selectorTooltipContent) as HTMLElement)?.focus();\n }\n }, this.enterDelayMs);\n };\n\n /**\n * Handles `mouseover` event on this element.\n */\n private _handleHover = (event) => {\n if (this.keyboardOnly) {\n if (event instanceof FocusEvent && this.lastInteractionWasKeyboard) {\n this._showTooltip();\n }\n } else {\n this._showTooltip();\n }\n };\n\n /**\n * Handles `mouseleave` event on this element.\n */\n private _handleHoverOut = async () => {\n window.clearTimeout(this.timeoutId);\n this.timeoutId = window.setTimeout(async () => {\n const { open } = this;\n if (open) {\n this.open = false;\n }\n }, this.leaveDelayMs);\n };\n\n /**\n * Handles `click` event on this element.\n */\n @HostListener('click')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleClick = async () => {\n this.lastInteractionWasKeyboard = false;\n if (this.closeOnActivation) {\n this._handleHoverOut();\n }\n };\n\n /**\n * Handles `keydown` event on this element.\n */\n @HostListener('keydown')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeydown = async (event) => {\n // needed for interactive tags for when the tag is focused from tabbing into it\n // tooltip is expected to open only from keyboard interaction\n if (event.key === 'Tab') {\n this.lastInteractionWasKeyboard = true;\n }\n if (event.key === ' ' || event.key === 'Enter' || event.key === 'Escape') {\n this.lastInteractionWasKeyboard = true;\n if (this.closeOnActivation) {\n this._handleHoverOut();\n }\n }\n };\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const component = (target as HTMLSlotElement).assignedNodes().filter(\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim() // eslint-disable-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n );\n if (!component[0]) {\n return;\n }\n\n (component[0] as HTMLElement).addEventListener('focus', this._handleHover);\n (component[0] as HTMLElement).addEventListener(\n 'focusout',\n this._handleHoverOut\n );\n\n if (!this.keyboardOnly) {\n (component[0] as HTMLElement).addEventListener(\n 'mouseover',\n this._handleHover\n );\n (component[0] as HTMLElement).addEventListener(\n 'mouseleave',\n this._handleHoverOut\n );\n }\n this.requestUpdate();\n }\n\n connectedCallback() {\n if (!this.hasAttribute('highContrast')) {\n this.setAttribute('highContrast', '');\n }\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n window.addEventListener('keydown', this._handleKeydown, true);\n super.connectedCallback();\n\n adoptStyles(this.renderRoot as ShadowRoot, [popoverStyles, styles]);\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this._handleKeydown, true);\n super.disconnectedCallback();\n }\n\n updated(changedProperties) {\n const { selectorTooltipContent } = this.constructor as typeof CDSTooltip;\n const toolTipContent = this.querySelector(selectorTooltipContent);\n\n if (changedProperties.has('defaultOpen')) {\n this.open = this.defaultOpen;\n }\n\n if (changedProperties.has('open')) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452\n this.open\n ? toolTipContent?.setAttribute('open', '')\n : toolTipContent?.removeAttribute('open');\n }\n\n ['align', 'caret', 'autoalign', 'dropShadow'].forEach((name) => {\n if (changedProperties.has(name)) {\n const { [name as keyof CDSTooltip]: value } = this;\n (toolTipContent as CDSTooltipContent)[name] = value;\n }\n });\n\n if (this.hasAttribute('highcontrast')) {\n toolTipContent?.setAttribute('highcontrast', '');\n }\n\n this.shadowRoot\n ?.querySelector(`.${prefix}--popover-container`)\n ?.classList.add(`${prefix}--tooltip`);\n\n super.updated(changedProperties);\n }\n\n /**\n * A selector that will return the CDSTooltipContent.\n */\n static get selectorTooltipContent() {\n return `${prefix}-tooltip-content`;\n }\n}\n\nexport default CDSTooltip;\n"],"names":["styles","customElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAcH;;;;AAIG;AAEH,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,iBAAiB,CAAC,UAAU,CAAC,CAAA;AAAtD,IAAA,WAAA,GAAA;;AACE;;AAEG;QAEH,IAAA,CAAA,KAAK,GAAG,KAAK;AAEb;;AAEG;QAEH,IAAA,CAAA,SAAS,GAAG,KAAK;AAEjB;;AAEG;QAEH,IAAA,CAAA,SAAS,GAAG,KAAK;AAEjB;;AAEG;QAEH,IAAA,CAAA,iBAAiB,GAAG,KAAK;AAEzB;;AAEG;QAEH,IAAA,CAAA,WAAW,GAAG,KAAK;AAEnB;;AAEG;QAEH,IAAA,CAAA,YAAY,GAAG,GAAG;AAElB;;AAEG;QAEH,IAAA,CAAA,YAAY,GAAG,GAAG;AAElB;;;AAGG;QAEH,IAAA,CAAA,YAAY,GAAG,KAAK;AAEpB;;AAEG;QAEH,IAAA,CAAA,IAAI,GAAG,KAAK;AAEZ;;AAEG;QAEH,IAAA,CAAA,SAAS,GAAG,CAAC;AAEb;;AAEG;QAEH,IAAA,CAAA,aAAa,GAAG,KAAK;AAErB;;AAEG;QACK,IAAA,CAAA,0BAA0B,GAAG,KAAK;AAE1C;;AAEG;QACK,IAAA,CAAA,YAAY,GAAG,YAAW;AAChC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UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;AACb,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAMd,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,EAAE;AACjD,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAwDd,UAAA,CAAA;IAHP,YAAY,CAAC,OAAO;;;AAQnB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAQM,UAAA,CAAA;IAHP,YAAY,CAAC,SAAS;;;AAerB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AAnJE,UAAU,GAAA,UAAA,CAAA;AADf,IAAAC,aAAa,CAAC,CAAA,EAAG,MAAM,CAAA,QAAA,CAAU;AAC5B,CAAA,EAAA,UAAU,CA4Of;AAED,mBAAe,UAAU;;;;"}
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { adoptStyles } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport CDSPopover from '../popover/popover';\nimport '../popover/popover-content';\nimport styles from './tooltip.scss?lit';\nimport popoverStyles from '../popover/popover.scss?lit';\nimport CDSTooltipContent from './tooltip-content';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\n/**\n * Trigger button of tooltip.\n *\n * @element cds-tooltip\n */\n@customElement(`${prefix}-tooltip`)\nclass CDSTooltip extends HostListenerMixin(CDSPopover) {\n /**\n * Specify how the trigger should align with the tooltip\n */\n @property({ reflect: true, type: String })\n align = 'top';\n\n /**\n * Specify whether a auto align functionality should be applied\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * `true` if this tooltip is in a data table row\n */\n @property({ type: Boolean, reflect: true, attribute: 'data-table' })\n dataTable = false;\n\n /**\n * Specify whether the tooltip should be closed when clicked\n */\n @property({ reflect: true, type: Boolean })\n closeOnActivation = false;\n\n /**\n * Specify whether the tooltip should be open when it first renders\n */\n @property({ reflect: true, type: Boolean })\n defaultOpen = false;\n\n /**\n * Specify the duration in milliseconds to delay before displaying the tooltip\n */\n @property({ attribute: 'enter-delay-ms', type: Number })\n enterDelayMs = 100;\n\n /**\n * Specify the duration in milliseconds to delay before hiding the tooltip\n */\n @property({ attribute: 'leave-delay-ms', type: Number })\n leaveDelayMs = 300;\n\n /**\n * Only open tooltip on keyboard interactions, this is used for interactive tags\n * (ie. operational-tag, selectable-tag)\n */\n @property({ attribute: 'keyboard-only', type: Boolean })\n keyboardOnly = false;\n\n /**\n * Specify the size of the tooltip\n */\n @property({ reflect: true })\n size = false;\n\n /**\n * Specify the timeout reference for the tooltip\n */\n @property({ reflect: true })\n timeoutId = 0;\n\n /**\n * Specify whether the tooltip should be open when it first renders\n */\n @property({ reflect: true, attribute: 'toolbar-action', type: Boolean })\n toolbarAction = false;\n\n /**\n * Track if last interaction was a keyboard interaction\n */\n private lastInteractionWasKeyboard = false;\n\n /**\n * Handles opening of tooltip\n */\n private _showTooltip = async () => {\n window.clearTimeout(this.timeoutId);\n this.timeoutId = window.setTimeout(async () => {\n this.open = true;\n const { open, updateComplete } = this;\n if (open) {\n await updateComplete;\n const { selectorTooltipContent } = this\n .constructor as typeof CDSTooltip;\n (this.querySelector(selectorTooltipContent) as HTMLElement)?.focus();\n }\n }, this.enterDelayMs);\n };\n\n /**\n * Handles `mouseover` event on this element.\n */\n private _handleHover = (event) => {\n if (this.keyboardOnly) {\n if (event instanceof FocusEvent && this.lastInteractionWasKeyboard) {\n this._showTooltip();\n }\n } else {\n this._showTooltip();\n }\n };\n\n /**\n * Handles `mouseleave` event on this element.\n */\n private _handleHoverOut = async () => {\n window.clearTimeout(this.timeoutId);\n this.timeoutId = window.setTimeout(async () => {\n const { open } = this;\n if (open) {\n this.open = false;\n }\n }, this.leaveDelayMs);\n };\n\n /**\n * Handles `click` event on this element.\n */\n @HostListener('click')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleClick = async () => {\n this.lastInteractionWasKeyboard = false;\n if (this.closeOnActivation) {\n this._handleHoverOut();\n }\n };\n\n /**\n * Handles `keydown` event on this element.\n */\n @HostListener('keydown')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeydown = async (event) => {\n // needed for interactive tags for when the tag is focused from tabbing into it\n // tooltip is expected to open only from keyboard interaction\n if (event.key === 'Tab') {\n this.lastInteractionWasKeyboard = true;\n }\n if (event.key === ' ' || event.key === 'Enter' || event.key === 'Escape') {\n this.lastInteractionWasKeyboard = true;\n if (this.closeOnActivation) {\n this._handleHoverOut();\n }\n }\n };\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const component = (target as HTMLSlotElement).assignedNodes().filter(\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim() // eslint-disable-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n );\n if (!component[0]) {\n return;\n }\n\n (component[0] as HTMLElement).addEventListener('focus', this._handleHover);\n (component[0] as HTMLElement).addEventListener(\n 'focusout',\n this._handleHoverOut\n );\n\n if (!this.keyboardOnly) {\n (component[0] as HTMLElement).addEventListener(\n 'mouseover',\n this._handleHover\n );\n (component[0] as HTMLElement).addEventListener(\n 'mouseleave',\n this._handleHoverOut\n );\n }\n this.requestUpdate();\n }\n\n connectedCallback() {\n if (!this.hasAttribute('highContrast')) {\n this.setAttribute('highContrast', '');\n }\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n window.addEventListener('keydown', this._handleKeydown, true);\n super.connectedCallback();\n\n adoptStyles(this.renderRoot as ShadowRoot, [popoverStyles, styles]);\n }\n\n disconnectedCallback() {\n window.removeEventListener('keydown', this._handleKeydown, true);\n super.disconnectedCallback();\n }\n\n updated(changedProperties) {\n const { selectorTooltipContent } = this.constructor as typeof CDSTooltip;\n const toolTipContent = this.querySelector(selectorTooltipContent);\n\n if (changedProperties.has('defaultOpen')) {\n this.open = this.defaultOpen;\n }\n\n if (changedProperties.has('open')) {\n if (this.open) {\n toolTipContent?.setAttribute('open', '');\n } else {\n toolTipContent?.removeAttribute('open');\n }\n }\n\n ['align', 'caret', 'autoalign', 'dropShadow'].forEach((name) => {\n if (changedProperties.has(name)) {\n const { [name as keyof CDSTooltip]: value } = this;\n (toolTipContent as CDSTooltipContent)[name] = value;\n }\n });\n\n if (this.hasAttribute('highcontrast')) {\n toolTipContent?.setAttribute('highcontrast', '');\n }\n\n this.shadowRoot\n ?.querySelector(`.${prefix}--popover-container`)\n ?.classList.add(`${prefix}--tooltip`);\n\n super.updated(changedProperties);\n }\n\n /**\n * A selector that will return the CDSTooltipContent.\n */\n static get selectorTooltipContent() {\n return `${prefix}-tooltip-content`;\n }\n}\n\nexport default CDSTooltip;\n"],"names":["styles","customElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAcH;;;;AAIG;AAEH,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,iBAAiB,CAAC,UAAU,CAAC,CAAA;AAAtD,IAAA,WAAA,GAAA;;AACE;;AAEG;QAEH,IAAA,CAAA,KAAK,GAAG,KAAK;AAEb;;AAEG;QAEH,IAAA,CAAA,SAAS,GAAG,KAAK;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5B,CAAA,EAAA,UAAU,CA6Of;AAED,mBAAe,UAAU;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2025,
|
|
2
|
+
* Copyright IBM Corp. 2025, 2026
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -15,6 +15,7 @@ declare const CDSTreeView_base: {
|
|
|
15
15
|
accessKey: string;
|
|
16
16
|
readonly accessKeyLabel: string;
|
|
17
17
|
autocapitalize: string;
|
|
18
|
+
autocorrect: boolean;
|
|
18
19
|
dir: string;
|
|
19
20
|
draggable: boolean;
|
|
20
21
|
hidden: boolean;
|
|
@@ -36,13 +37,14 @@ declare const CDSTreeView_base: {
|
|
|
36
37
|
click(): void;
|
|
37
38
|
hidePopover(): void;
|
|
38
39
|
showPopover(): void;
|
|
39
|
-
togglePopover(
|
|
40
|
+
togglePopover(options?: boolean): boolean;
|
|
40
41
|
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
41
42
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
42
43
|
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
43
44
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
44
45
|
readonly attributes: NamedNodeMap;
|
|
45
|
-
|
|
46
|
+
get classList(): DOMTokenList;
|
|
47
|
+
set classList(value: string);
|
|
46
48
|
className: string;
|
|
47
49
|
readonly clientHeight: number;
|
|
48
50
|
readonly clientLeft: number;
|
|
@@ -57,7 +59,8 @@ declare const CDSTreeView_base: {
|
|
|
57
59
|
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
|
|
58
60
|
outerHTML: string;
|
|
59
61
|
readonly ownerDocument: Document;
|
|
60
|
-
|
|
62
|
+
get part(): DOMTokenList;
|
|
63
|
+
set part(value: string);
|
|
61
64
|
readonly prefix: string | null;
|
|
62
65
|
readonly scrollHeight: number;
|
|
63
66
|
scrollLeft: number;
|
|
@@ -120,6 +123,8 @@ declare const CDSTreeView_base: {
|
|
|
120
123
|
setPointerCapture(pointerId: number): void;
|
|
121
124
|
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
|
|
122
125
|
webkitMatchesSelector(selectors: string): boolean;
|
|
126
|
+
get textContent(): string;
|
|
127
|
+
set textContent(value: string | null);
|
|
123
128
|
readonly baseURI: string;
|
|
124
129
|
readonly childNodes: NodeListOf<ChildNode>;
|
|
125
130
|
readonly firstChild: ChildNode | null;
|
|
@@ -132,9 +137,8 @@ declare const CDSTreeView_base: {
|
|
|
132
137
|
readonly parentElement: HTMLElement | null;
|
|
133
138
|
readonly parentNode: ParentNode | null;
|
|
134
139
|
readonly previousSibling: ChildNode | null;
|
|
135
|
-
textContent: string | null;
|
|
136
140
|
appendChild<T extends Node>(node: T): T;
|
|
137
|
-
cloneNode(
|
|
141
|
+
cloneNode(subtree?: boolean): Node;
|
|
138
142
|
compareDocumentPosition(other: Node): number;
|
|
139
143
|
contains(other: Node | null): boolean;
|
|
140
144
|
getRootNode(options?: GetRootNodeOptions): Node;
|
|
@@ -167,6 +171,7 @@ declare const CDSTreeView_base: {
|
|
|
167
171
|
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
|
|
168
172
|
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
|
|
169
173
|
dispatchEvent(event: Event): boolean;
|
|
174
|
+
ariaActiveDescendantElement: Element | null;
|
|
170
175
|
ariaAtomic: string | null;
|
|
171
176
|
ariaAutoComplete: string | null;
|
|
172
177
|
ariaBrailleLabel: string | null;
|
|
@@ -177,25 +182,33 @@ declare const CDSTreeView_base: {
|
|
|
177
182
|
ariaColIndex: string | null;
|
|
178
183
|
ariaColIndexText: string | null;
|
|
179
184
|
ariaColSpan: string | null;
|
|
185
|
+
ariaControlsElements: ReadonlyArray<Element> | null;
|
|
180
186
|
ariaCurrent: string | null;
|
|
187
|
+
ariaDescribedByElements: ReadonlyArray<Element> | null;
|
|
181
188
|
ariaDescription: string | null;
|
|
189
|
+
ariaDetailsElements: ReadonlyArray<Element> | null;
|
|
182
190
|
ariaDisabled: string | null;
|
|
191
|
+
ariaErrorMessageElements: ReadonlyArray<Element> | null;
|
|
183
192
|
ariaExpanded: string | null;
|
|
193
|
+
ariaFlowToElements: ReadonlyArray<Element> | null;
|
|
184
194
|
ariaHasPopup: string | null;
|
|
185
195
|
ariaHidden: string | null;
|
|
186
196
|
ariaInvalid: string | null;
|
|
187
197
|
ariaKeyShortcuts: string | null;
|
|
188
198
|
ariaLabel: string | null;
|
|
199
|
+
ariaLabelledByElements: ReadonlyArray<Element> | null;
|
|
189
200
|
ariaLevel: string | null;
|
|
190
201
|
ariaLive: string | null;
|
|
191
202
|
ariaModal: string | null;
|
|
192
203
|
ariaMultiLine: string | null;
|
|
193
204
|
ariaMultiSelectable: string | null;
|
|
194
205
|
ariaOrientation: string | null;
|
|
206
|
+
ariaOwnsElements: ReadonlyArray<Element> | null;
|
|
195
207
|
ariaPlaceholder: string | null;
|
|
196
208
|
ariaPosInSet: string | null;
|
|
197
209
|
ariaPressed: string | null;
|
|
198
210
|
ariaReadOnly: string | null;
|
|
211
|
+
ariaRelevant: string | null;
|
|
199
212
|
ariaRequired: string | null;
|
|
200
213
|
ariaRoleDescription: string | null;
|
|
201
214
|
ariaRowCount: string | null;
|
|
@@ -237,7 +250,8 @@ declare const CDSTreeView_base: {
|
|
|
237
250
|
replaceChildren(...nodes: (Node | string)[]): void;
|
|
238
251
|
readonly assignedSlot: HTMLSlotElement | null;
|
|
239
252
|
readonly attributeStyleMap: StylePropertyMap;
|
|
240
|
-
|
|
253
|
+
get style(): CSSStyleDeclaration;
|
|
254
|
+
set style(cssText: string);
|
|
241
255
|
contentEditable: string;
|
|
242
256
|
enterKeyHint: string;
|
|
243
257
|
inputMode: string;
|
|
@@ -247,18 +261,19 @@ declare const CDSTreeView_base: {
|
|
|
247
261
|
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
248
262
|
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
249
263
|
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
250
|
-
onauxclick: ((this: GlobalEventHandlers, ev:
|
|
264
|
+
onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
251
265
|
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
|
|
252
|
-
|
|
266
|
+
onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
267
|
+
onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
253
268
|
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
254
269
|
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
255
270
|
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
256
271
|
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
257
272
|
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
258
|
-
onclick: ((this: GlobalEventHandlers, ev:
|
|
273
|
+
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
259
274
|
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
260
275
|
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
261
|
-
oncontextmenu: ((this: GlobalEventHandlers, ev:
|
|
276
|
+
oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
262
277
|
oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
263
278
|
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
264
279
|
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
@@ -306,6 +321,7 @@ declare const CDSTreeView_base: {
|
|
|
306
321
|
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
307
322
|
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
308
323
|
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
324
|
+
onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
309
325
|
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
310
326
|
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
|
|
311
327
|
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
@@ -324,7 +340,7 @@ declare const CDSTreeView_base: {
|
|
|
324
340
|
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
|
|
325
341
|
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
326
342
|
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
327
|
-
ontoggle: ((this: GlobalEventHandlers, ev:
|
|
343
|
+
ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
328
344
|
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
329
345
|
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
330
346
|
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
@@ -17,7 +17,7 @@ import styles from './tree-view.scss.js';
|
|
|
17
17
|
import { carbonElement } from '../../globals/decorators/carbon-element.js';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Copyright IBM Corp. 2025,
|
|
20
|
+
* Copyright IBM Corp. 2025, 2026
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
23
23
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -51,10 +51,12 @@ let CDSTreeView = CDSTreeView_1 = class CDSTreeView extends HostListenerMixin(Li
|
|
|
51
51
|
node.selected = isTarget;
|
|
52
52
|
node.active = isTarget;
|
|
53
53
|
if (!isTarget) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
if (isLink) {
|
|
55
|
+
element.setAttribute('tabindex', '-1');
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
element.removeAttribute('tabindex');
|
|
59
|
+
}
|
|
58
60
|
}
|
|
59
61
|
else
|
|
60
62
|
element.setAttribute('tabindex', '0');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-view.js","sources":["../../../src/components/tree-view/tree-view.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2025, 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { TREE_SIZE } from './defs';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport styles from './tree-view.scss?lit';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport CDSTreeNode from './tree-node';\n\nexport { TREE_SIZE };\n/**\n * Tree view.\n *\n * @element cds-tree-view\n */\n@customElement(`${prefix}-tree-view`)\nclass CDSTreeView extends HostListenerMixin(LitElement) {\n /**\n * Specify whether or not the label should be hidden\n */\n @property({ type: Boolean, attribute: 'hide-label' })\n hideLabel = false;\n\n /**\n * Provide the label text that will be read by a screen reader\n */\n @property()\n label!: string;\n\n /**\n * Specify the size of the tree from a list of available sizes.\n */\n @property({ reflect: true })\n size = TREE_SIZE.SMALL;\n\n @HostListener('click')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _click = ({ target }) => {\n if ((target as CDSTreeNode).disabled) return;\n\n const nodes = this.querySelectorAll(CDSTreeView.selectorTreeNode);\n nodes.forEach((node) => {\n const isTarget = node === target;\n const isLink = (node as CDSTreeNode).hasAttribute('href');\n const element = isLink ? node.shadowRoot?.querySelector('a') : node;\n (node as CDSTreeNode).selected = isTarget;\n (node as CDSTreeNode).active = isTarget;\n if (!isTarget) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452\n isLink\n ? (element as CDSTreeNode).setAttribute('tabindex', '-1')\n : (element as CDSTreeNode).removeAttribute('tabindex');\n } else (element as CDSTreeNode).setAttribute('tabindex', '0');\n });\n };\n\n @HostListener('keydown')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeyDown = (event: KeyboardEvent) => {\n const { key } = event;\n const nodes = Array.from(\n this.querySelectorAll(CDSTreeView.selectorTreeNode)\n ).filter(\n (node) => node.checkVisibility() && !node.hasAttribute('disabled')\n );\n\n const allNodes = Array.from(\n this.querySelectorAll(CDSTreeView.selectorTreeNode)\n ).filter((node) => !node.hasAttribute('disabled'));\n\n const withLinks = (nodes[0] as CDSTreeNode).href;\n\n const currentIndex = nodes.findIndex((node) =>\n withLinks\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n node.shadowRoot?.querySelector('a')!.getAttribute('tabindex') === '0'\n : node.getAttribute('tabindex') === '0'\n );\n\n let nextIndex = currentIndex;\n\n switch (key) {\n case 'ArrowDown':\n nextIndex = Math.min(currentIndex + 1, nodes.length - 1);\n break;\n case 'ArrowUp':\n nextIndex = Math.max(currentIndex - 1, 0);\n break;\n case 'Home':\n nextIndex = 0;\n break;\n case 'End':\n nextIndex = nodes.length - 1;\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n allNodes.forEach((node) => {\n (node as CDSTreeNode).selected = false;\n (node as CDSTreeNode).active = false;\n });\n (nodes[currentIndex] as CDSTreeNode).selected = true;\n (nodes[currentIndex] as CDSTreeNode).active = true;\n break;\n case 'ArrowRight':\n if ((nodes[currentIndex] as CDSTreeNode).hasAttribute('parent')) {\n (nodes[currentIndex] as CDSTreeNode).isExpanded = true;\n nodes[currentIndex].setAttribute('aria-expanded', 'true');\n }\n break;\n case 'ArrowLeft':\n if (!nodes[currentIndex].hasAttribute('parent')) {\n const temp = nodes.findIndex(\n (node) => node === nodes[currentIndex].parentElement\n );\n nextIndex = temp === -1 ? currentIndex : temp;\n } else {\n (nodes[currentIndex] as CDSTreeNode).isExpanded = false;\n nodes[currentIndex].setAttribute('aria-expanded', 'false');\n }\n break;\n }\n\n if (nextIndex !== currentIndex) {\n nodes.forEach((node) => {\n if (!withLinks) {\n node.removeAttribute('tabindex');\n } else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n node.shadowRoot?.querySelector('a')!.setAttribute('tabindex', '-1');\n }\n });\n const element = withLinks\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n (nodes[nextIndex] as CDSTreeNode).shadowRoot!.querySelector('a')\n : nodes[nextIndex];\n (element as CDSTreeNode).setAttribute('tabindex', '0');\n (element as CDSTreeNode).focus();\n event.preventDefault();\n }\n };\n\n private async _setInitialFocus() {\n await this.updateComplete;\n\n const nodes = this.querySelectorAll(CDSTreeView.selectorTreeNode);\n if (nodes.length > 0) {\n const selectedNode =\n Array.from(nodes).find((node) => (node as CDSTreeNode).selected) ||\n nodes[0];\n const element = (selectedNode as CDSTreeNode).href\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n (selectedNode as CDSTreeNode).shadowRoot!.querySelector('a')\n : selectedNode;\n (element as CDSTreeNode).setAttribute('tabindex', '0');\n }\n }\n connectedCallback() {\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'tree');\n }\n\n if (!this.hasAttribute('aria-label')) {\n this.setAttribute('aria-label', this.label);\n }\n }\n\n updated(changedProperties) {\n this._setInitialFocus();\n\n if (changedProperties.has('size')) {\n const items = this.querySelectorAll(CDSTreeView.selectorTreeNode);\n items.forEach((item) => {\n (item as CDSTreeNode).setAttribute('size', this.size);\n });\n }\n }\n\n render() {\n const { hideLabel, label, size } = this;\n const labelId = 'tree-view__label';\n const treeClasses = classMap({\n [`${prefix}--tree`]: true,\n [`${prefix}--tree--${size}`]: size,\n });\n return html`\n ${\n !hideLabel\n ? html`<label id=${labelId} class=${`${prefix}--label`}\n >${label}\n </label>`\n : null\n }\n <ul\n aria-label=${hideLabel ? label : undefined}\n aria-labelledby=${!hideLabel ? labelId : undefined}\n class=${treeClasses}\n role=\"tree\">\n <slot><slot>\n </ul>\n `;\n }\n\n static get selectorTreeNode() {\n return `${prefix}-tree-node`;\n }\n\n static styles = styles;\n}\n\nexport default CDSTreeView;\n"],"names":["customElement"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;AAKG;;AAcH;;;;AAIG;AAEH,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,iBAAiB,CAAC,UAAU,CAAC,CAAA;AAAvD,IAAA,WAAA,GAAA;;AACE;;AAEG;QAEH,IAAA,CAAA,SAAS,GAAG,KAAK;AAQjB;;AAEG;AAEH,QAAA,IAAA,CAAA,IAAI,GAAG,SAAS,CAAC,KAAK;AAKd,QAAA,IAAA,CAAA,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,KAAI;YAC9B,IAAK,MAAsB,CAAC,QAAQ;gBAAE;YA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A,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;AACJ,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAKf,UAAA,CAAA;IAHP,YAAY,CAAC,OAAO;;;AAoBnB,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAKM,UAAA,CAAA;IAHP,YAAY,CAAC,SAAS;;;AAqFrB,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AA9HE,WAAW,GAAA,aAAA,GAAA,UAAA,CAAA;AADhB,IAAAA,aAAa,CAAC,CAAA,EAAG,MAAM,CAAA,UAAA,CAAY;AAC9B,CAAA,EAAA,WAAW,CAoMhB;AAED,oBAAe,WAAW;;;;"}
|
|
1
|
+
{"version":3,"file":"tree-view.js","sources":["../../../src/components/tree-view/tree-view.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2025, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { TREE_SIZE } from './defs';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport styles from './tree-view.scss?lit';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport CDSTreeNode from './tree-node';\n\nexport { TREE_SIZE };\n/**\n * Tree view.\n *\n * @element cds-tree-view\n */\n@customElement(`${prefix}-tree-view`)\nclass CDSTreeView extends HostListenerMixin(LitElement) {\n /**\n * Specify whether or not the label should be hidden\n */\n @property({ type: Boolean, attribute: 'hide-label' })\n hideLabel = false;\n\n /**\n * Provide the label text that will be read by a screen reader\n */\n @property()\n label!: string;\n\n /**\n * Specify the size of the tree from a list of available sizes.\n */\n @property({ reflect: true })\n size = TREE_SIZE.SMALL;\n\n @HostListener('click')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _click = ({ target }) => {\n if ((target as CDSTreeNode).disabled) return;\n\n const nodes = this.querySelectorAll(CDSTreeView.selectorTreeNode);\n nodes.forEach((node) => {\n const isTarget = node === target;\n const isLink = (node as CDSTreeNode).hasAttribute('href');\n const element = isLink ? node.shadowRoot?.querySelector('a') : node;\n (node as CDSTreeNode).selected = isTarget;\n (node as CDSTreeNode).active = isTarget;\n if (!isTarget) {\n if (isLink) {\n (element as CDSTreeNode).setAttribute('tabindex', '-1');\n } else {\n (element as CDSTreeNode).removeAttribute('tabindex');\n }\n } else (element as CDSTreeNode).setAttribute('tabindex', '0');\n });\n };\n\n @HostListener('keydown')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeyDown = (event: KeyboardEvent) => {\n const { key } = event;\n const nodes = Array.from(\n this.querySelectorAll(CDSTreeView.selectorTreeNode)\n ).filter(\n (node) => node.checkVisibility() && !node.hasAttribute('disabled')\n );\n\n const allNodes = Array.from(\n this.querySelectorAll(CDSTreeView.selectorTreeNode)\n ).filter((node) => !node.hasAttribute('disabled'));\n\n const withLinks = (nodes[0] as CDSTreeNode).href;\n\n const currentIndex = nodes.findIndex((node) =>\n withLinks\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n node.shadowRoot?.querySelector('a')!.getAttribute('tabindex') === '0'\n : node.getAttribute('tabindex') === '0'\n );\n\n let nextIndex = currentIndex;\n\n switch (key) {\n case 'ArrowDown':\n nextIndex = Math.min(currentIndex + 1, nodes.length - 1);\n break;\n case 'ArrowUp':\n nextIndex = Math.max(currentIndex - 1, 0);\n break;\n case 'Home':\n nextIndex = 0;\n break;\n case 'End':\n nextIndex = nodes.length - 1;\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n allNodes.forEach((node) => {\n (node as CDSTreeNode).selected = false;\n (node as CDSTreeNode).active = false;\n });\n (nodes[currentIndex] as CDSTreeNode).selected = true;\n (nodes[currentIndex] as CDSTreeNode).active = true;\n break;\n case 'ArrowRight':\n if ((nodes[currentIndex] as CDSTreeNode).hasAttribute('parent')) {\n (nodes[currentIndex] as CDSTreeNode).isExpanded = true;\n nodes[currentIndex].setAttribute('aria-expanded', 'true');\n }\n break;\n case 'ArrowLeft':\n if (!nodes[currentIndex].hasAttribute('parent')) {\n const temp = nodes.findIndex(\n (node) => node === nodes[currentIndex].parentElement\n );\n nextIndex = temp === -1 ? currentIndex : temp;\n } else {\n (nodes[currentIndex] as CDSTreeNode).isExpanded = false;\n nodes[currentIndex].setAttribute('aria-expanded', 'false');\n }\n break;\n }\n\n if (nextIndex !== currentIndex) {\n nodes.forEach((node) => {\n if (!withLinks) {\n node.removeAttribute('tabindex');\n } else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n node.shadowRoot?.querySelector('a')!.setAttribute('tabindex', '-1');\n }\n });\n const element = withLinks\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n (nodes[nextIndex] as CDSTreeNode).shadowRoot!.querySelector('a')\n : nodes[nextIndex];\n (element as CDSTreeNode).setAttribute('tabindex', '0');\n (element as CDSTreeNode).focus();\n event.preventDefault();\n }\n };\n\n private async _setInitialFocus() {\n await this.updateComplete;\n\n const nodes = this.querySelectorAll(CDSTreeView.selectorTreeNode);\n if (nodes.length > 0) {\n const selectedNode =\n Array.from(nodes).find((node) => (node as CDSTreeNode).selected) ||\n nodes[0];\n const element = (selectedNode as CDSTreeNode).href\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n (selectedNode as CDSTreeNode).shadowRoot!.querySelector('a')\n : selectedNode;\n (element as CDSTreeNode).setAttribute('tabindex', '0');\n }\n }\n connectedCallback() {\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'tree');\n }\n\n if (!this.hasAttribute('aria-label')) {\n this.setAttribute('aria-label', this.label);\n }\n }\n\n updated(changedProperties) {\n this._setInitialFocus();\n\n if (changedProperties.has('size')) {\n const items = this.querySelectorAll(CDSTreeView.selectorTreeNode);\n items.forEach((item) => {\n (item as CDSTreeNode).setAttribute('size', this.size);\n });\n }\n }\n\n render() {\n const { hideLabel, label, size } = this;\n const labelId = 'tree-view__label';\n const treeClasses = classMap({\n [`${prefix}--tree`]: true,\n [`${prefix}--tree--${size}`]: size,\n });\n return html`\n ${\n !hideLabel\n ? html`<label id=${labelId} class=${`${prefix}--label`}\n >${label}\n </label>`\n : null\n }\n <ul\n aria-label=${hideLabel ? label : undefined}\n aria-labelledby=${!hideLabel ? labelId : undefined}\n class=${treeClasses}\n role=\"tree\">\n <slot><slot>\n </ul>\n `;\n }\n\n static get selectorTreeNode() {\n return `${prefix}-tree-node`;\n }\n\n static styles = styles;\n}\n\nexport default CDSTreeView;\n"],"names":["customElement"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;AAKG;;AAcH;;;;AAIG;AAEH,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,iBAAiB,CAAC,UAAU,CAAC,CAAA;AAAvD,IAAA,WAAA,GAAA;;AACE;;AAEG;QAEH,IAAA,CAAA,SAAS,GAAG,KAAK;AAQjB;;AAEG;AAEH,QAAA,IAAA,CAAA,IAAI,GAAG,SAAS,CAAC,KAAK;AAKd,QAAA,IAAA,CAAA,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,KAAI;YAC9B,IAAK,MAAsB,CAAC,QAAQ;gBAAE;YAEtC,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAW,CAAC,gBAAgB,CAAC;AACjE,YA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I,EAAE;AACJ,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAKf,UAAA,CAAA;IAHP,YAAY,CAAC,OAAO;;;AAqBnB,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAKM,UAAA,CAAA;IAHP,YAAY,CAAC,SAAS;;;AAqFrB,CAAA,EAAA,WAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,MAAA,CAAA;AA/HE,WAAW,GAAA,aAAA,GAAA,UAAA,CAAA;AADhB,IAAAA,aAAa,CAAC,CAAA,EAAG,MAAM,CAAA,UAAA,CAAY;AAC9B,CAAA,EAAA,WAAW,CAqMhB;AAED,oBAAe,WAAW;;;;"}
|
|
@@ -41,6 +41,8 @@ declare class CDSHeaderGlobalAction extends CDSButton {
|
|
|
41
41
|
shouldUpdate(changedProperties: any): boolean;
|
|
42
42
|
static shadowRootOptions: {
|
|
43
43
|
delegatesFocus: boolean;
|
|
44
|
+
clonable?: boolean;
|
|
45
|
+
customElementRegistry?: CustomElementRegistry;
|
|
44
46
|
mode: ShadowRootMode;
|
|
45
47
|
serializable?: boolean;
|
|
46
48
|
slotAssignment?: SlotAssignmentMode;
|
|
@@ -12,6 +12,7 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
12
12
|
accessKey: string;
|
|
13
13
|
readonly accessKeyLabel: string;
|
|
14
14
|
autocapitalize: string;
|
|
15
|
+
autocorrect: boolean;
|
|
15
16
|
dir: string;
|
|
16
17
|
draggable: boolean;
|
|
17
18
|
hidden: boolean;
|
|
@@ -33,13 +34,14 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
33
34
|
click(): void;
|
|
34
35
|
hidePopover(): void;
|
|
35
36
|
showPopover(): void;
|
|
36
|
-
togglePopover(
|
|
37
|
+
togglePopover(options?: boolean): boolean;
|
|
37
38
|
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
38
39
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
39
40
|
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
40
41
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
41
42
|
readonly attributes: NamedNodeMap;
|
|
42
|
-
|
|
43
|
+
get classList(): DOMTokenList;
|
|
44
|
+
set classList(value: string);
|
|
43
45
|
className: string;
|
|
44
46
|
readonly clientHeight: number;
|
|
45
47
|
readonly clientLeft: number;
|
|
@@ -54,7 +56,8 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
54
56
|
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
|
|
55
57
|
outerHTML: string;
|
|
56
58
|
readonly ownerDocument: Document;
|
|
57
|
-
|
|
59
|
+
get part(): DOMTokenList;
|
|
60
|
+
set part(value: string);
|
|
58
61
|
readonly prefix: string | null;
|
|
59
62
|
readonly scrollHeight: number;
|
|
60
63
|
scrollLeft: number;
|
|
@@ -117,6 +120,8 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
117
120
|
setPointerCapture(pointerId: number): void;
|
|
118
121
|
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
|
|
119
122
|
webkitMatchesSelector(selectors: string): boolean;
|
|
123
|
+
get textContent(): string;
|
|
124
|
+
set textContent(value: string | null);
|
|
120
125
|
readonly baseURI: string;
|
|
121
126
|
readonly childNodes: NodeListOf<ChildNode>;
|
|
122
127
|
readonly firstChild: ChildNode | null;
|
|
@@ -129,9 +134,8 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
129
134
|
readonly parentElement: HTMLElement | null;
|
|
130
135
|
readonly parentNode: ParentNode | null;
|
|
131
136
|
readonly previousSibling: ChildNode | null;
|
|
132
|
-
textContent: string | null;
|
|
133
137
|
appendChild<T extends Node>(node: T): T;
|
|
134
|
-
cloneNode(
|
|
138
|
+
cloneNode(subtree?: boolean): Node;
|
|
135
139
|
compareDocumentPosition(other: Node): number;
|
|
136
140
|
contains(other: Node | null): boolean;
|
|
137
141
|
getRootNode(options?: GetRootNodeOptions): Node;
|
|
@@ -164,6 +168,7 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
164
168
|
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
|
|
165
169
|
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
|
|
166
170
|
dispatchEvent(event: Event): boolean;
|
|
171
|
+
ariaActiveDescendantElement: Element | null;
|
|
167
172
|
ariaAtomic: string | null;
|
|
168
173
|
ariaAutoComplete: string | null;
|
|
169
174
|
ariaBrailleLabel: string | null;
|
|
@@ -174,25 +179,33 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
174
179
|
ariaColIndex: string | null;
|
|
175
180
|
ariaColIndexText: string | null;
|
|
176
181
|
ariaColSpan: string | null;
|
|
182
|
+
ariaControlsElements: ReadonlyArray<Element> | null;
|
|
177
183
|
ariaCurrent: string | null;
|
|
184
|
+
ariaDescribedByElements: ReadonlyArray<Element> | null;
|
|
178
185
|
ariaDescription: string | null;
|
|
186
|
+
ariaDetailsElements: ReadonlyArray<Element> | null;
|
|
179
187
|
ariaDisabled: string | null;
|
|
188
|
+
ariaErrorMessageElements: ReadonlyArray<Element> | null;
|
|
180
189
|
ariaExpanded: string | null;
|
|
190
|
+
ariaFlowToElements: ReadonlyArray<Element> | null;
|
|
181
191
|
ariaHasPopup: string | null;
|
|
182
192
|
ariaHidden: string | null;
|
|
183
193
|
ariaInvalid: string | null;
|
|
184
194
|
ariaKeyShortcuts: string | null;
|
|
185
195
|
ariaLabel: string | null;
|
|
196
|
+
ariaLabelledByElements: ReadonlyArray<Element> | null;
|
|
186
197
|
ariaLevel: string | null;
|
|
187
198
|
ariaLive: string | null;
|
|
188
199
|
ariaModal: string | null;
|
|
189
200
|
ariaMultiLine: string | null;
|
|
190
201
|
ariaMultiSelectable: string | null;
|
|
191
202
|
ariaOrientation: string | null;
|
|
203
|
+
ariaOwnsElements: ReadonlyArray<Element> | null;
|
|
192
204
|
ariaPlaceholder: string | null;
|
|
193
205
|
ariaPosInSet: string | null;
|
|
194
206
|
ariaPressed: string | null;
|
|
195
207
|
ariaReadOnly: string | null;
|
|
208
|
+
ariaRelevant: string | null;
|
|
196
209
|
ariaRequired: string | null;
|
|
197
210
|
ariaRoleDescription: string | null;
|
|
198
211
|
ariaRowCount: string | null;
|
|
@@ -234,7 +247,8 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
234
247
|
replaceChildren(...nodes: (Node | string)[]): void;
|
|
235
248
|
readonly assignedSlot: HTMLSlotElement | null;
|
|
236
249
|
readonly attributeStyleMap: StylePropertyMap;
|
|
237
|
-
|
|
250
|
+
get style(): CSSStyleDeclaration;
|
|
251
|
+
set style(cssText: string);
|
|
238
252
|
contentEditable: string;
|
|
239
253
|
enterKeyHint: string;
|
|
240
254
|
inputMode: string;
|
|
@@ -244,18 +258,19 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
244
258
|
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
245
259
|
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
246
260
|
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
247
|
-
onauxclick: ((this: GlobalEventHandlers, ev:
|
|
261
|
+
onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
248
262
|
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
|
|
249
|
-
|
|
263
|
+
onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
264
|
+
onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
250
265
|
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
251
266
|
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
252
267
|
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
253
268
|
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
254
269
|
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
255
|
-
onclick: ((this: GlobalEventHandlers, ev:
|
|
270
|
+
onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
256
271
|
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
257
272
|
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
258
|
-
oncontextmenu: ((this: GlobalEventHandlers, ev:
|
|
273
|
+
oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
259
274
|
oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
260
275
|
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
261
276
|
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
@@ -303,6 +318,7 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
303
318
|
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
304
319
|
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
305
320
|
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
321
|
+
onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
306
322
|
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
307
323
|
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
|
|
308
324
|
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
@@ -321,7 +337,7 @@ declare const CDSHeaderMenuButton_base: {
|
|
|
321
337
|
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
|
|
322
338
|
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
323
339
|
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
324
|
-
ontoggle: ((this: GlobalEventHandlers, ev:
|
|
340
|
+
ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
|
|
325
341
|
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
326
342
|
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
327
343
|
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
@@ -385,6 +401,8 @@ declare class CDSHeaderMenuButton extends CDSHeaderMenuButton_base {
|
|
|
385
401
|
static get eventToggle(): string;
|
|
386
402
|
static shadowRootOptions: {
|
|
387
403
|
delegatesFocus: boolean;
|
|
404
|
+
clonable?: boolean;
|
|
405
|
+
customElementRegistry?: CustomElementRegistry;
|
|
388
406
|
mode: ShadowRootMode;
|
|
389
407
|
serializable?: boolean;
|
|
390
408
|
slotAssignment?: SlotAssignmentMode;
|