@carbon/web-components 2.0.0-beta.2 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/custom-elements.json +4026 -1801
- package/es/components/breadcrumb/breadcrumb.css.js +1 -1
- package/es/components/breadcrumb/breadcrumb.rtl.css.js +1 -1
- package/es/components/button/button.css.js +1 -1
- package/es/components/button/button.d.ts +12 -4
- package/es/components/button/button.d.ts.map +1 -1
- package/es/components/button/button.js +57 -19
- package/es/components/button/button.js.map +1 -1
- package/es/components/button/button.rtl.css.js +1 -1
- package/es/components/checkbox/checkbox.css.js +1 -1
- package/es/components/checkbox/checkbox.d.ts +9 -0
- package/es/components/checkbox/checkbox.d.ts.map +1 -1
- package/es/components/checkbox/checkbox.js +32 -1
- package/es/components/checkbox/checkbox.js.map +1 -1
- package/es/components/checkbox/checkbox.rtl.css.js +1 -1
- package/es/components/code-snippet/code-snippet-skeleton.d.ts +2 -2
- package/es/components/code-snippet/code-snippet-skeleton.d.ts.map +1 -1
- package/es/components/code-snippet/code-snippet-skeleton.js +4 -4
- package/es/components/code-snippet/code-snippet-skeleton.js.map +1 -1
- package/es/components/code-snippet/code-snippet.css.js +1 -1
- package/es/components/code-snippet/code-snippet.d.ts +75 -29
- package/es/components/code-snippet/code-snippet.d.ts.map +1 -1
- package/es/components/code-snippet/code-snippet.js +370 -164
- package/es/components/code-snippet/code-snippet.js.map +1 -1
- package/es/components/code-snippet/code-snippet.rtl.css.js +1 -1
- package/es/components/copy/copy.d.ts +1 -2
- package/es/components/copy/copy.d.ts.map +1 -1
- package/es/components/copy/copy.js +6 -13
- package/es/components/copy/copy.js.map +1 -1
- package/es/components/copy-button/copy-button.css.js +1 -1
- package/es/components/copy-button/copy-button.d.ts +8 -0
- package/es/components/copy-button/copy-button.d.ts.map +1 -1
- package/es/components/copy-button/copy-button.js +38 -2
- package/es/components/copy-button/copy-button.js.map +1 -1
- package/es/components/copy-button/copy-button.rtl.css.js +1 -1
- package/es/components/data-table/data-table.css.js +1 -1
- package/es/components/data-table/data-table.rtl.css.js +1 -1
- package/es/components/data-table/defs.d.ts +0 -13
- package/es/components/data-table/defs.d.ts.map +1 -1
- package/es/components/data-table/defs.js +0 -9
- package/es/components/data-table/defs.js.map +1 -1
- package/es/components/data-table/index.d.ts +6 -5
- package/es/components/data-table/index.d.ts.map +1 -1
- package/es/components/data-table/index.js +6 -5
- package/es/components/data-table/index.js.map +1 -1
- package/es/components/data-table/table-batch-actions.d.ts +7 -2
- package/es/components/data-table/table-batch-actions.d.ts.map +1 -1
- package/es/components/data-table/table-batch-actions.js +25 -6
- package/es/components/data-table/table-batch-actions.js.map +1 -1
- package/es/components/data-table/table-body.d.ts +8 -4
- package/es/components/data-table/table-body.d.ts.map +1 -1
- package/es/components/data-table/table-body.js +21 -14
- package/es/components/data-table/table-body.js.map +1 -1
- package/es/components/data-table/table-cell-content.d.ts +21 -0
- package/es/components/data-table/table-cell-content.d.ts.map +1 -0
- package/es/components/data-table/table-cell-content.js +53 -0
- package/es/components/data-table/table-cell-content.js.map +1 -0
- package/es/components/data-table/table-cell.d.ts +15 -2
- package/es/components/data-table/table-cell.d.ts.map +1 -1
- package/es/components/data-table/table-cell.js +43 -8
- package/es/components/data-table/table-cell.js.map +1 -1
- package/es/components/data-table/table-expanded-row.d.ts +336 -2
- package/es/components/data-table/table-expanded-row.d.ts.map +1 -1
- package/es/components/data-table/table-expanded-row.js +69 -16
- package/es/components/data-table/table-expanded-row.js.map +1 -1
- package/es/components/data-table/table-head.d.ts +7 -2
- package/es/components/data-table/table-head.d.ts.map +1 -1
- package/es/components/data-table/table-head.js +15 -6
- package/es/components/data-table/table-head.js.map +1 -1
- package/es/components/data-table/table-header-cell.d.ts +21 -3
- package/es/components/data-table/table-header-cell.d.ts.map +1 -1
- package/es/components/data-table/table-header-cell.js +67 -10
- package/es/components/data-table/table-header-cell.js.map +1 -1
- package/es/components/data-table/table-header-description.d.ts +21 -0
- package/es/components/data-table/table-header-description.d.ts.map +1 -0
- package/es/components/data-table/table-header-description.js +53 -0
- package/es/components/data-table/table-header-description.js.map +1 -0
- package/es/components/data-table/table-header-row.d.ts +3 -3
- package/es/components/data-table/table-header-row.d.ts.map +1 -1
- package/es/components/data-table/table-header-row.js +6 -6
- package/es/components/data-table/table-header-row.js.map +1 -1
- package/es/components/data-table/table-header-title.d.ts +21 -0
- package/es/components/data-table/table-header-title.d.ts.map +1 -0
- package/es/components/data-table/table-header-title.js +53 -0
- package/es/components/data-table/table-header-title.js.map +1 -0
- package/es/components/data-table/table-row.d.ts +413 -5
- package/es/components/data-table/table-row.d.ts.map +1 -1
- package/es/components/data-table/table-row.js +386 -45
- package/es/components/data-table/table-row.js.map +1 -1
- package/es/components/data-table/table-skeleton.d.ts +59 -0
- package/es/components/data-table/table-skeleton.d.ts.map +1 -0
- package/es/components/data-table/table-skeleton.js +259 -0
- package/es/components/data-table/table-skeleton.js.map +1 -0
- package/es/components/data-table/table-toolbar-content.d.ts +6 -2
- package/es/components/data-table/table-toolbar-content.d.ts.map +1 -1
- package/es/components/data-table/table-toolbar-content.js +21 -4
- package/es/components/data-table/table-toolbar-content.js.map +1 -1
- package/es/components/data-table/table-toolbar-search.d.ts +7 -3
- package/es/components/data-table/table-toolbar-search.d.ts.map +1 -1
- package/es/components/data-table/table-toolbar-search.js +25 -8
- package/es/components/data-table/table-toolbar-search.js.map +1 -1
- package/es/components/data-table/table-toolbar.d.ts +19 -2
- package/es/components/data-table/table-toolbar.d.ts.map +1 -1
- package/es/components/data-table/table-toolbar.js +68 -13
- package/es/components/data-table/table-toolbar.js.map +1 -1
- package/es/components/data-table/table.d.ts +556 -6
- package/es/components/data-table/table.d.ts.map +1 -1
- package/es/components/data-table/table.js +1012 -15
- package/es/components/data-table/table.js.map +1 -1
- package/es/components/dropdown/defs.d.ts +6 -6
- package/es/components/dropdown/defs.d.ts.map +1 -1
- package/es/components/dropdown/defs.js +2 -2
- package/es/components/dropdown/defs.js.map +1 -1
- package/es/components/dropdown/dropdown-item.d.ts.map +1 -1
- package/es/components/dropdown/dropdown-item.js +1 -1
- package/es/components/dropdown/dropdown-item.js.map +1 -1
- package/es/components/dropdown/dropdown.d.ts +9 -2
- package/es/components/dropdown/dropdown.d.ts.map +1 -1
- package/es/components/dropdown/dropdown.js +83 -62
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/file-uploader/demo-file-uploader.d.ts +1 -1
- package/es/components/file-uploader/demo-file-uploader.d.ts.map +1 -1
- package/es/components/file-uploader/demo-file-uploader.js +38 -4
- package/es/components/file-uploader/demo-file-uploader.js.map +1 -1
- package/es/components/floating-menu/defs.d.ts +1 -39
- package/es/components/floating-menu/defs.d.ts.map +1 -1
- package/es/components/floating-menu/defs.js +2 -23
- package/es/components/floating-menu/defs.js.map +1 -1
- package/es/components/floating-menu/floating-menu-trigger.d.ts +3 -3
- package/es/components/floating-menu/floating-menu-trigger.d.ts.map +1 -1
- package/es/components/floating-menu/floating-menu.d.ts +11 -13
- package/es/components/floating-menu/floating-menu.d.ts.map +1 -1
- package/es/components/floating-menu/floating-menu.js +44 -54
- package/es/components/floating-menu/floating-menu.js.map +1 -1
- package/es/components/form/form-item.d.ts +2 -2
- package/es/components/form/form-item.d.ts.map +1 -1
- package/es/components/form/form-item.js +4 -4
- package/es/components/form/form-item.js.map +1 -1
- package/es/components/form-group/form-group.css.js +12 -0
- package/es/components/form-group/form-group.d.ts +44 -0
- package/es/components/form-group/form-group.d.ts.map +1 -0
- package/es/components/form-group/form-group.js +141 -0
- package/es/components/form-group/form-group.js.map +1 -0
- package/es/components/form-group/form-group.rtl.css.js +12 -0
- package/es/components/form-group/index.d.ts +11 -0
- package/es/components/form-group/index.d.ts.map +1 -0
- package/es/components/form-group/index.js +11 -0
- package/es/components/form-group/index.js.map +1 -0
- package/es/components/icon-button/icon-button.css.js +1 -1
- package/es/components/icon-button/icon-button.d.ts +1 -1
- package/es/components/icon-button/icon-button.d.ts.map +1 -1
- package/es/components/icon-button/icon-button.js +5 -3
- package/es/components/icon-button/icon-button.js.map +1 -1
- package/es/components/icon-button/icon-button.rtl.css.js +1 -1
- package/es/components/list/list.css.js +1 -1
- package/es/components/list/list.rtl.css.js +1 -1
- package/es/components/modal/defs.d.ts +3 -3
- package/es/components/modal/defs.d.ts.map +1 -1
- package/es/components/modal/defs.js +2 -2
- package/es/components/modal/defs.js.map +1 -1
- package/es/components/modal/index.d.ts +2 -1
- package/es/components/modal/index.d.ts.map +1 -1
- package/es/components/modal/index.js +2 -1
- package/es/components/modal/index.js.map +1 -1
- package/es/components/modal/modal-body-content.d.ts +21 -0
- package/es/components/modal/modal-body-content.d.ts.map +1 -0
- package/es/components/modal/modal-body-content.js +53 -0
- package/es/components/modal/modal-body-content.js.map +1 -0
- package/es/components/modal/modal-body.d.ts +2 -2
- package/es/components/modal/modal-body.d.ts.map +1 -1
- package/es/components/modal/modal-body.js +4 -4
- package/es/components/modal/modal-body.js.map +1 -1
- package/es/components/modal/modal-close-button.d.ts +5 -5
- package/es/components/modal/modal-close-button.d.ts.map +1 -1
- package/es/components/modal/modal-close-button.js +9 -9
- package/es/components/modal/modal-close-button.js.map +1 -1
- package/es/components/modal/modal-footer.d.ts +3 -3
- package/es/components/modal/modal-footer.d.ts.map +1 -1
- package/es/components/modal/modal-footer.js +13 -21
- package/es/components/modal/modal-footer.js.map +1 -1
- package/es/components/modal/modal-header.d.ts +2 -2
- package/es/components/modal/modal-header.d.ts.map +1 -1
- package/es/components/modal/modal-header.js +4 -4
- package/es/components/modal/modal-header.js.map +1 -1
- package/es/components/modal/modal-heading.d.ts +2 -2
- package/es/components/modal/modal-heading.d.ts.map +1 -1
- package/es/components/modal/modal-heading.js +4 -4
- package/es/components/modal/modal-heading.js.map +1 -1
- package/es/components/modal/modal-label.d.ts +2 -2
- package/es/components/modal/modal-label.d.ts.map +1 -1
- package/es/components/modal/modal-label.js +4 -4
- package/es/components/modal/modal-label.js.map +1 -1
- package/es/components/modal/modal.css.js +1 -1
- package/es/components/modal/modal.d.ts +33 -3
- package/es/components/modal/modal.d.ts.map +1 -1
- package/es/components/modal/modal.js +121 -14
- package/es/components/modal/modal.js.map +1 -1
- package/es/components/modal/modal.rtl.css.js +1 -1
- package/es/components/multi-select/defs.d.ts +27 -0
- package/es/components/multi-select/defs.d.ts.map +1 -0
- package/es/components/multi-select/defs.js +19 -0
- package/es/components/multi-select/defs.js.map +1 -0
- package/es/components/multi-select/multi-select-item.d.ts.map +1 -1
- package/es/components/multi-select/multi-select-item.js +9 -14
- package/es/components/multi-select/multi-select-item.js.map +1 -1
- package/es/components/multi-select/multi-select.css.js +1 -1
- package/es/components/multi-select/multi-select.d.ts +44 -5
- package/es/components/multi-select/multi-select.d.ts.map +1 -1
- package/es/components/multi-select/multi-select.js +250 -32
- package/es/components/multi-select/multi-select.js.map +1 -1
- package/es/components/multi-select/multi-select.rtl.css.js +1 -1
- package/es/components/number-input/number-input.css.js +1 -1
- package/es/components/number-input/number-input.d.ts.map +1 -1
- package/es/components/number-input/number-input.js +1 -1
- package/es/components/number-input/number-input.js.map +1 -1
- package/es/components/number-input/number-input.rtl.css.js +1 -1
- package/es/components/overflow-menu/defs.d.ts +4 -9
- package/es/components/overflow-menu/defs.d.ts.map +1 -1
- package/es/components/overflow-menu/defs.js +1 -4
- package/es/components/overflow-menu/defs.js.map +1 -1
- package/es/components/overflow-menu/overflow-menu-body.d.ts +16 -15
- package/es/components/overflow-menu/overflow-menu-body.d.ts.map +1 -1
- package/es/components/overflow-menu/overflow-menu-body.js +49 -28
- package/es/components/overflow-menu/overflow-menu-body.js.map +1 -1
- package/es/components/overflow-menu/overflow-menu-item.d.ts +12 -3
- package/es/components/overflow-menu/overflow-menu-item.d.ts.map +1 -1
- package/es/components/overflow-menu/overflow-menu-item.js +44 -12
- package/es/components/overflow-menu/overflow-menu-item.js.map +1 -1
- package/es/components/overflow-menu/overflow-menu.css.js +1 -1
- package/es/components/overflow-menu/overflow-menu.d.ts +22 -10
- package/es/components/overflow-menu/overflow-menu.d.ts.map +1 -1
- package/es/components/overflow-menu/overflow-menu.js +89 -40
- package/es/components/overflow-menu/overflow-menu.js.map +1 -1
- package/es/components/overflow-menu/overflow-menu.rtl.css.js +1 -1
- package/es/components/pagination/defs.d.ts +27 -0
- package/es/components/pagination/defs.d.ts.map +1 -0
- package/es/components/pagination/defs.js +19 -0
- package/es/components/pagination/defs.js.map +1 -0
- package/es/components/pagination/index.d.ts +1 -3
- package/es/components/pagination/index.d.ts.map +1 -1
- package/es/components/pagination/index.js +1 -3
- package/es/components/pagination/index.js.map +1 -1
- package/es/components/pagination/pagination.css.js +1 -1
- package/es/components/pagination/pagination.d.ts +55 -20
- package/es/components/pagination/pagination.d.ts.map +1 -1
- package/es/components/pagination/pagination.js +303 -123
- package/es/components/pagination/pagination.js.map +1 -1
- package/es/components/pagination/pagination.rtl.css.js +1 -1
- package/es/components/progress-indicator/progress-indicator-skeleton.d.ts +1 -2
- package/es/components/progress-indicator/progress-indicator-skeleton.d.ts.map +1 -1
- package/es/components/progress-indicator/progress-indicator-skeleton.js +5 -5
- package/es/components/progress-indicator/progress-indicator-skeleton.js.map +1 -1
- package/es/components/progress-indicator/progress-indicator.css.js +1 -1
- package/es/components/progress-indicator/progress-indicator.d.ts +8 -3
- package/es/components/progress-indicator/progress-indicator.d.ts.map +1 -1
- package/es/components/progress-indicator/progress-indicator.js +35 -8
- package/es/components/progress-indicator/progress-indicator.js.map +1 -1
- package/es/components/progress-indicator/progress-indicator.rtl.css.js +1 -1
- package/es/components/progress-indicator/progress-step-skeleton.d.ts +2 -2
- package/es/components/progress-indicator/progress-step-skeleton.d.ts.map +1 -1
- package/es/components/progress-indicator/progress-step-skeleton.js +12 -12
- package/es/components/progress-indicator/progress-step-skeleton.js.map +1 -1
- package/es/components/progress-indicator/progress-step.d.ts +11 -3
- package/es/components/progress-indicator/progress-step.d.ts.map +1 -1
- package/es/components/progress-indicator/progress-step.js +65 -24
- package/es/components/progress-indicator/progress-step.js.map +1 -1
- package/es/components/radio-button/radio-button.css.js +1 -1
- package/es/components/radio-button/radio-button.d.ts +4 -0
- package/es/components/radio-button/radio-button.d.ts.map +1 -1
- package/es/components/radio-button/radio-button.js +22 -0
- package/es/components/radio-button/radio-button.js.map +1 -1
- package/es/components/radio-button/radio-button.rtl.css.js +1 -1
- package/es/components/select/select.css.js +1 -1
- package/es/components/select/select.d.ts.map +1 -1
- package/es/components/select/select.js +3 -1
- package/es/components/select/select.js.map +1 -1
- package/es/components/select/select.rtl.css.js +1 -1
- package/es/components/slider/slider.css.js +1 -1
- package/es/components/slider/slider.rtl.css.js +1 -1
- package/es/components/stack/defs.d.ts +29 -0
- package/es/components/stack/defs.d.ts.map +1 -0
- package/es/components/stack/defs.js +31 -0
- package/es/components/stack/defs.js.map +1 -0
- package/es/components/stack/index.d.ts +11 -0
- package/es/components/stack/index.d.ts.map +1 -0
- package/es/components/stack/index.js +11 -0
- package/es/components/stack/index.js.map +1 -0
- package/es/components/stack/stack.css.js +12 -0
- package/es/components/stack/stack.d.ts +46 -0
- package/es/components/stack/stack.d.ts.map +1 -0
- package/es/components/stack/stack.js +116 -0
- package/es/components/stack/stack.js.map +1 -0
- package/es/components/stack/stack.rtl.css.js +12 -0
- package/es/components/structured-list/structured-list.css.js +1 -1
- package/es/components/structured-list/structured-list.d.ts +9 -0
- package/es/components/structured-list/structured-list.d.ts.map +1 -1
- package/es/components/structured-list/structured-list.js +47 -1
- package/es/components/structured-list/structured-list.js.map +1 -1
- package/es/components/structured-list/structured-list.rtl.css.js +1 -1
- package/es/components/tabs/tabs.css.js +1 -1
- package/es/components/tabs/tabs.rtl.css.js +1 -1
- package/es/components/text-input/defs.d.ts +38 -0
- package/es/components/text-input/defs.d.ts.map +1 -1
- package/es/components/text-input/defs.js +24 -3
- package/es/components/text-input/defs.js.map +1 -1
- package/es/components/text-input/text-input.d.ts +4 -5
- package/es/components/text-input/text-input.d.ts.map +1 -1
- package/es/components/text-input/text-input.js +5 -6
- package/es/components/text-input/text-input.js.map +1 -1
- package/es/components/textarea/textarea.d.ts.map +1 -1
- package/es/components/textarea/textarea.js +1 -1
- package/es/components/textarea/textarea.js.map +1 -1
- package/es/components/tile/expandable-tile.d.ts +1 -3
- package/es/components/tile/expandable-tile.d.ts.map +1 -1
- package/es/components/tile/expandable-tile.js +1 -1
- package/es/components/tile/expandable-tile.js.map +1 -1
- package/es/components/tile/radio-tile.d.ts.map +1 -1
- package/es/components/tile/radio-tile.js +2 -2
- package/es/components/tile/radio-tile.js.map +1 -1
- package/es/components/toggle-tip/toggletip.d.ts +1 -1
- package/es/components/toggle-tip/toggletip.d.ts.map +1 -1
- package/es/components/toggle-tip/toggletip.js +28 -3
- package/es/components/toggle-tip/toggletip.js.map +1 -1
- package/es/components/tooltip/tooltip.css.js +1 -1
- package/es/components/tooltip/tooltip.d.ts +12 -1
- package/es/components/tooltip/tooltip.d.ts.map +1 -1
- package/es/components/tooltip/tooltip.js +47 -1
- package/es/components/tooltip/tooltip.js.map +1 -1
- package/es/components/tooltip/tooltip.rtl.css.js +1 -1
- package/es/components/ui-shell/header-global-action.d.ts +31 -0
- package/es/components/ui-shell/header-global-action.d.ts.map +1 -0
- package/es/components/ui-shell/header-global-action.js +88 -0
- package/es/components/ui-shell/header-global-action.js.map +1 -0
- package/es/components/ui-shell/header-menu-button.d.ts +6 -6
- package/es/components/ui-shell/header-menu-button.d.ts.map +1 -1
- package/es/components/ui-shell/header-menu-button.js +10 -10
- package/es/components/ui-shell/header-menu-button.js.map +1 -1
- package/es/components/ui-shell/header-menu-item.d.ts +3 -3
- package/es/components/ui-shell/header-menu-item.d.ts.map +1 -1
- package/es/components/ui-shell/header-menu-item.js +6 -6
- package/es/components/ui-shell/header-menu-item.js.map +1 -1
- package/es/components/ui-shell/header-menu.d.ts +11 -3
- package/es/components/ui-shell/header-menu.d.ts.map +1 -1
- package/es/components/ui-shell/header-menu.js +47 -7
- package/es/components/ui-shell/header-menu.js.map +1 -1
- package/es/components/ui-shell/header-name.d.ts +3 -3
- package/es/components/ui-shell/header-name.d.ts.map +1 -1
- package/es/components/ui-shell/header-name.js +4 -4
- package/es/components/ui-shell/header-name.js.map +1 -1
- package/es/components/ui-shell/header-nav-item.d.ts +11 -3
- package/es/components/ui-shell/header-nav-item.d.ts.map +1 -1
- package/es/components/ui-shell/header-nav-item.js +39 -6
- package/es/components/ui-shell/header-nav-item.js.map +1 -1
- package/es/components/ui-shell/header-nav.d.ts +2 -2
- package/es/components/ui-shell/header-nav.d.ts.map +1 -1
- package/es/components/ui-shell/header-nav.js +5 -5
- package/es/components/ui-shell/header-nav.js.map +1 -1
- package/es/components/ui-shell/header-panel.d.ts +30 -0
- package/es/components/ui-shell/header-panel.d.ts.map +1 -0
- package/es/components/ui-shell/header-panel.js +72 -0
- package/es/components/ui-shell/header-panel.js.map +1 -0
- package/es/components/ui-shell/header-side-nav-items.d.ts +27 -0
- package/es/components/ui-shell/header-side-nav-items.d.ts.map +1 -0
- package/es/components/ui-shell/header-side-nav-items.js +80 -0
- package/es/components/ui-shell/header-side-nav-items.js.map +1 -0
- package/es/components/ui-shell/header.css.js +1 -1
- package/es/components/ui-shell/header.d.ts +2 -2
- package/es/components/ui-shell/header.d.ts.map +1 -1
- package/es/components/ui-shell/header.js +5 -5
- package/es/components/ui-shell/header.js.map +1 -1
- package/es/components/ui-shell/header.rtl.css.js +1 -1
- package/es/components/ui-shell/index.d.ts +5 -0
- package/es/components/ui-shell/index.d.ts.map +1 -1
- package/es/components/ui-shell/index.js +5 -0
- package/es/components/ui-shell/index.js.map +1 -1
- package/es/components/ui-shell/side-nav-divider.d.ts +2 -2
- package/es/components/ui-shell/side-nav-divider.d.ts.map +1 -1
- package/es/components/ui-shell/side-nav-divider.js +5 -5
- package/es/components/ui-shell/side-nav-divider.js.map +1 -1
- package/es/components/ui-shell/side-nav-items.d.ts +2 -2
- package/es/components/ui-shell/side-nav-items.d.ts.map +1 -1
- package/es/components/ui-shell/side-nav-items.js +6 -6
- package/es/components/ui-shell/side-nav-items.js.map +1 -1
- package/es/components/ui-shell/side-nav-link.d.ts +7 -3
- package/es/components/ui-shell/side-nav-link.d.ts.map +1 -1
- package/es/components/ui-shell/side-nav-link.js +18 -5
- package/es/components/ui-shell/side-nav-link.js.map +1 -1
- package/es/components/ui-shell/side-nav-menu-item.d.ts +3 -3
- package/es/components/ui-shell/side-nav-menu-item.d.ts.map +1 -1
- package/es/components/ui-shell/side-nav-menu-item.js +4 -4
- package/es/components/ui-shell/side-nav-menu-item.js.map +1 -1
- package/es/components/ui-shell/side-nav-menu.d.ts +7 -3
- package/es/components/ui-shell/side-nav-menu.d.ts.map +1 -1
- package/es/components/ui-shell/side-nav-menu.js +18 -5
- package/es/components/ui-shell/side-nav-menu.js.map +1 -1
- package/es/components/ui-shell/side-nav.css.js +1 -1
- package/es/components/ui-shell/side-nav.d.ts +35 -13
- package/es/components/ui-shell/side-nav.d.ts.map +1 -1
- package/es/components/ui-shell/side-nav.js +142 -48
- package/es/components/ui-shell/side-nav.js.map +1 -1
- package/es/components/ui-shell/side-nav.rtl.css.js +1 -1
- package/es/components/ui-shell/switcher-divider.d.ts +21 -0
- package/es/components/ui-shell/switcher-divider.d.ts.map +1 -0
- package/es/components/ui-shell/switcher-divider.js +56 -0
- package/es/components/ui-shell/switcher-divider.js.map +1 -0
- package/es/components/{pagination/page-sizes-select.d.ts → ui-shell/switcher-item.d.ts} +18 -22
- package/es/components/ui-shell/switcher-item.d.ts.map +1 -0
- package/es/components/ui-shell/switcher-item.js +162 -0
- package/es/components/ui-shell/switcher-item.js.map +1 -0
- package/es/components/ui-shell/switcher.d.ts +35 -0
- package/es/components/ui-shell/switcher.d.ts.map +1 -0
- package/es/components/ui-shell/switcher.js +95 -0
- package/es/components/ui-shell/switcher.js.map +1 -0
- package/es/components-react/code-snippet/code-snippet-skeleton.d.ts +2 -2
- package/es/components-react/code-snippet/code-snippet.d.ts +2 -2
- package/es/components-react/data-table/table-batch-actions.d.ts +2 -2
- package/es/components-react/data-table/table-body.d.ts +2 -2
- package/es/components-react/{pagination/pages-select.d.ts → data-table/table-cell-content.d.ts} +2 -6
- package/es/components-react/{pagination/pages-select.js → data-table/table-cell-content.js} +4 -10
- package/es/components-react/data-table/table-cell.d.ts +2 -2
- package/es/components-react/data-table/table-expanded-row.d.ts +2 -2
- package/es/components-react/data-table/table-head.d.ts +2 -2
- package/es/components-react/data-table/table-header-cell.d.ts +2 -2
- package/es/components-react/{pagination/page-sizes-select.d.ts → data-table/table-header-description.d.ts} +2 -6
- package/es/components-react/{pagination/page-sizes-select.js → data-table/table-header-description.js} +4 -10
- package/es/components-react/data-table/table-header-row.d.ts +2 -2
- package/es/components-react/data-table/table-header-title.d.ts +15 -0
- package/es/components-react/data-table/{table-header-cell-skeleton.js → table-header-title.js} +4 -6
- package/es/components-react/data-table/table-row.d.ts +19 -2
- package/es/components-react/data-table/table-row.js +16 -0
- package/es/components-react/data-table/table-skeleton.d.ts +15 -0
- package/es/components-react/data-table/table-skeleton.js +21 -0
- package/es/components-react/data-table/table-toolbar-content.d.ts +2 -2
- package/es/components-react/data-table/table-toolbar-search.d.ts +2 -2
- package/es/components-react/data-table/table-toolbar.d.ts +2 -2
- package/es/components-react/data-table/table.d.ts +44 -2
- package/es/components-react/data-table/table.js +45 -3
- package/es/components-react/file-uploader/demo-file-uploader.d.ts +0 -49
- package/es/components-react/file-uploader/demo-file-uploader.js +3 -51
- package/es/components-react/floating-menu/floating-menu.d.ts +2 -2
- package/es/components-react/floating-menu/floating-menu.js +0 -2
- package/es/components-react/form/form-item.d.ts +2 -2
- package/es/components-react/form-group/form-group.d.ts +15 -0
- package/es/components-react/form-group/form-group.js +21 -0
- package/es/components-react/form-group/index.d.ts +14 -0
- package/es/components-react/form-group/index.js +8 -0
- package/es/components-react/modal/modal-body-content.d.ts +15 -0
- package/es/components-react/modal/modal-body-content.js +21 -0
- package/es/components-react/modal/modal-body.d.ts +2 -2
- package/es/components-react/modal/modal-close-button.d.ts +2 -2
- package/es/components-react/modal/modal-footer.d.ts +2 -2
- package/es/components-react/modal/modal-header.d.ts +2 -2
- package/es/components-react/modal/modal-heading.d.ts +2 -2
- package/es/components-react/modal/modal-label.d.ts +2 -2
- package/es/components-react/modal/modal.d.ts +2 -2
- package/es/components-react/multi-select/defs.d.ts +14 -0
- package/es/components-react/multi-select/defs.js +9 -0
- package/es/components-react/multi-select/multi-select.js +6 -1
- package/es/components-react/overflow-menu/overflow-menu-body.d.ts +2 -2
- package/es/components-react/overflow-menu/overflow-menu-item.d.ts +2 -2
- package/es/components-react/overflow-menu/overflow-menu.d.ts +4 -5
- package/es/components-react/overflow-menu/overflow-menu.js +5 -3
- package/es/components-react/pagination/defs.d.ts +14 -0
- package/es/components-react/pagination/defs.js +9 -0
- package/es/components-react/pagination/pagination.d.ts +3 -7
- package/es/components-react/pagination/pagination.js +3 -7
- package/es/components-react/progress-indicator/progress-indicator-skeleton.d.ts +2 -3
- package/es/components-react/progress-indicator/progress-indicator.d.ts +2 -3
- package/es/components-react/progress-indicator/progress-step-skeleton.d.ts +2 -3
- package/es/components-react/progress-indicator/progress-step.d.ts +2 -3
- package/es/components-react/stack/defs.d.ts +14 -0
- package/es/components-react/stack/defs.js +9 -0
- package/es/components-react/stack/index.d.ts +14 -0
- package/es/components-react/stack/index.js +8 -0
- package/es/components-react/stack/stack.d.ts +15 -0
- package/es/components-react/stack/stack.js +22 -0
- package/es/components-react/text-input/text-input.js +7 -1
- package/es/components-react/toggle-tip/toggletip.d.ts +0 -5
- package/es/components-react/toggle-tip/toggletip.js +3 -13
- package/es/components-react/{data-table/table-cell-skeleton.d.ts → ui-shell/header-global-action.d.ts} +3 -3
- package/es/components-react/{data-table/table-cell-skeleton.js → ui-shell/header-global-action.js} +4 -4
- package/es/components-react/ui-shell/header-menu-button.d.ts +2 -2
- package/es/components-react/ui-shell/header-menu-item.d.ts +2 -2
- package/es/components-react/ui-shell/header-menu.d.ts +2 -2
- package/es/components-react/ui-shell/header-name.d.ts +2 -2
- package/es/components-react/ui-shell/header-nav-item.d.ts +2 -2
- package/es/components-react/ui-shell/header-nav.d.ts +2 -2
- package/es/components-react/ui-shell/header-panel.d.ts +15 -0
- package/es/components-react/ui-shell/header-panel.js +21 -0
- package/es/components-react/ui-shell/header-side-nav-items.d.ts +15 -0
- package/es/components-react/ui-shell/header-side-nav-items.js +21 -0
- package/es/components-react/ui-shell/header.d.ts +2 -2
- package/es/components-react/ui-shell/side-nav-divider.d.ts +2 -2
- package/es/components-react/ui-shell/side-nav-items.d.ts +2 -2
- package/es/components-react/ui-shell/side-nav-link.d.ts +2 -2
- package/es/components-react/ui-shell/side-nav-menu-item.d.ts +2 -2
- package/es/components-react/ui-shell/side-nav-menu.d.ts +2 -2
- package/es/components-react/ui-shell/side-nav.d.ts +2 -2
- package/es/components-react/ui-shell/switcher-divider.d.ts +15 -0
- package/es/components-react/ui-shell/switcher-divider.js +21 -0
- package/es/components-react/ui-shell/switcher-item.d.ts +15 -0
- package/es/components-react/ui-shell/switcher-item.js +21 -0
- package/es/components-react/ui-shell/switcher.d.ts +15 -0
- package/es/components-react/ui-shell/switcher.js +21 -0
- package/es/icons/arrow--down/16.js +1 -1
- package/es/icons/arrow--down/32.js +1 -1
- package/es/icons/arrows--vertical/16.js +1 -1
- package/es/icons/arrows--vertical/32.js +1 -1
- package/es/icons/overflow-menu--vertical/16.js +1 -1
- package/es/index.d.ts +12 -2
- package/es/index.d.ts.map +1 -1
- package/es/index.js +12 -2
- package/es/index.js.map +1 -1
- package/lib/components/data-table/defs.js +1 -10
- package/lib/components/data-table/defs.js.map +1 -1
- package/lib/components/dropdown/defs.js +2 -2
- package/lib/components/dropdown/defs.js.map +1 -1
- package/lib/components/floating-menu/defs.js +3 -24
- package/lib/components/floating-menu/defs.js.map +1 -1
- package/lib/components/modal/defs.js +2 -2
- package/lib/components/modal/defs.js.map +1 -1
- package/lib/components/multi-select/defs.js +25 -0
- package/lib/components/multi-select/defs.js.map +1 -0
- package/lib/components/overflow-menu/defs.js +2 -11
- package/lib/components/overflow-menu/defs.js.map +1 -1
- package/lib/components/pagination/defs.js +25 -0
- package/lib/components/pagination/defs.js.map +1 -0
- package/lib/components/stack/defs.js +36 -0
- package/lib/components/stack/defs.js.map +1 -0
- package/lib/components/text-input/defs.js +25 -4
- package/lib/components/text-input/defs.js.map +1 -1
- package/lib/components-react-node/{pagination/pages-select.js → data-table/table-cell-content.js} +3 -9
- package/lib/components-react-node/{pagination/page-sizes-select.js → data-table/table-header-description.js} +3 -9
- package/lib/components-react-node/data-table/{table-cell-skeleton.js → table-header-title.js} +3 -4
- package/lib/components-react-node/data-table/table-row.js +16 -0
- package/lib/components-react-node/data-table/{table-header-cell-skeleton.js → table-skeleton.js} +3 -4
- package/lib/components-react-node/data-table/table.js +44 -8
- package/lib/components-react-node/file-uploader/demo-file-uploader.js +3 -89
- package/lib/components-react-node/floating-menu/floating-menu.js +0 -12
- package/lib/components-react-node/form-group/form-group.js +36 -0
- package/lib/components-react-node/form-group/index.js +9 -0
- package/lib/components-react-node/modal/modal-body-content.js +36 -0
- package/lib/components-react-node/multi-select/defs.js +24 -0
- package/lib/components-react-node/multi-select/multi-select.js +13 -0
- package/lib/components-react-node/overflow-menu/overflow-menu.js +3 -8
- package/lib/components-react-node/pagination/defs.js +24 -0
- package/lib/components-react-node/pagination/pagination.js +3 -7
- package/lib/components-react-node/stack/defs.js +24 -0
- package/lib/components-react-node/stack/index.js +9 -0
- package/lib/components-react-node/stack/stack.js +49 -0
- package/lib/components-react-node/text-input/text-input.js +12 -0
- package/lib/components-react-node/toggle-tip/toggletip.js +3 -51
- package/lib/components-react-node/ui-shell/header-global-action.js +37 -0
- package/lib/components-react-node/ui-shell/header-panel.js +36 -0
- package/lib/components-react-node/ui-shell/header-side-nav-items.js +36 -0
- package/lib/components-react-node/ui-shell/switcher-divider.js +36 -0
- package/lib/components-react-node/ui-shell/switcher-item.js +36 -0
- package/lib/components-react-node/ui-shell/switcher.js +36 -0
- package/package.json +6 -7
- package/scss/components/button/button.scss +48 -1
- package/scss/components/checkbox/checkbox.scss +16 -0
- package/scss/components/code-snippet/code-snippet.scss +82 -101
- package/scss/components/copy-button/copy-button.scss +17 -0
- package/scss/components/data-table/_table-action.scss +50 -32
- package/scss/components/data-table/_table-core.scss +253 -29
- package/scss/components/data-table/_table-expandable.scss +25 -32
- package/scss/components/data-table/_table-selection.scss +36 -20
- package/scss/components/data-table/_table-sizes.scss +162 -20
- package/scss/components/data-table/_table-sort.scss +5 -21
- package/scss/components/data-table/data-table.scss +4 -3
- package/scss/components/form-group/form-group.scss +23 -0
- package/scss/components/modal/modal.scss +61 -87
- package/scss/components/multi-select/multi-select.scss +54 -19
- package/scss/components/overflow-menu/overflow-menu.scss +21 -9
- package/scss/components/pagination/pagination.scss +0 -66
- package/scss/components/progress-indicator/progress-indicator.scss +11 -10
- package/scss/components/radio-button/radio-button.scss +11 -1
- package/scss/components/select/select.scss +28 -1
- package/scss/components/stack/stack.scss +33 -0
- package/scss/components/structured-list/structured-list.scss +90 -20
- package/scss/components/tooltip/tooltip.scss +26 -0
- package/scss/components/ui-shell/header.scss +69 -0
- package/scss/components/ui-shell/side-nav.scss +27 -49
- package/es/components/data-table/table-cell-skeleton.d.ts +0 -20
- package/es/components/data-table/table-cell-skeleton.d.ts.map +0 -1
- package/es/components/data-table/table-cell-skeleton.js +0 -42
- package/es/components/data-table/table-cell-skeleton.js.map +0 -1
- package/es/components/data-table/table-expand-row.d.ts +0 -371
- package/es/components/data-table/table-expand-row.d.ts.map +0 -1
- package/es/components/data-table/table-expand-row.js +0 -192
- package/es/components/data-table/table-expand-row.js.map +0 -1
- package/es/components/data-table/table-header-cell-skeleton.d.ts +0 -19
- package/es/components/data-table/table-header-cell-skeleton.d.ts.map +0 -1
- package/es/components/data-table/table-header-cell-skeleton.js +0 -33
- package/es/components/data-table/table-header-cell-skeleton.js.map +0 -1
- package/es/components/data-table/table-header-expand-row.d.ts +0 -33
- package/es/components/data-table/table-header-expand-row.d.ts.map +0 -1
- package/es/components/data-table/table-header-expand-row.js +0 -68
- package/es/components/data-table/table-header-expand-row.js.map +0 -1
- package/es/components/pagination/page-sizes-select.d.ts.map +0 -1
- package/es/components/pagination/page-sizes-select.js +0 -172
- package/es/components/pagination/page-sizes-select.js.map +0 -1
- package/es/components/pagination/pages-select.d.ts +0 -362
- package/es/components/pagination/pages-select.d.ts.map +0 -1
- package/es/components/pagination/pages-select.js +0 -185
- package/es/components/pagination/pages-select.js.map +0 -1
- package/es/components-react/data-table/table-expand-row.d.ts +0 -24
- package/es/components-react/data-table/table-expand-row.js +0 -33
- package/es/components-react/data-table/table-header-cell-skeleton.d.ts +0 -14
- package/es/components-react/data-table/table-header-expand-row.d.ts +0 -29
- package/es/components-react/data-table/table-header-expand-row.js +0 -37
- package/lib/components-react-node/data-table/table-expand-row.js +0 -47
- package/lib/components-react-node/data-table/table-header-expand-row.js +0 -51
- package/scss/components/data-table/_table-skeleton.scss +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","names":["LitElement","html","property","customElement","prefix","forEach","TABLE_COLOR_SCHEME","TABLE_SIZE","styles","BXTable","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","reflect","key","value","LG","type","Boolean","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","updated","changedProperties","has","querySelectorAll","selectorRowsWithHeader","elem","size","render","_t","_","static"],"sources":["components/data-table/table.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\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 { LitElement, html } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { forEach } from '../../globals/internal/collection-helpers';\nimport { TABLE_COLOR_SCHEME, TABLE_SIZE } from './defs';\nimport styles from './data-table.scss';\n\nexport { TABLE_COLOR_SCHEME, TABLE_SIZE };\n\n/**\n * Data table.\n *\n * @element cds-table\n */\n@customElement(`${prefix}-table`)\nclass BXTable extends LitElement {\n /**\n * The table size.\n */\n @property({ reflect: true })\n size = TABLE_SIZE.LG;\n\n /**\n * `true` if this table should support sorting.\n */\n @property({ type: Boolean, reflect: true })\n sort = false;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'table');\n }\n super.connectedCallback();\n }\n\n updated(changedProperties) {\n if (changedProperties.has('size')) {\n // Propagate `size` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof BXTable).selectorRowsWithHeader\n ),\n (elem) => {\n elem.setAttribute('size', this.size);\n }\n );\n }\n }\n\n render() {\n return html` <slot></slot> `;\n }\n\n /**\n * The CSS selector to find the rows, including header rows.\n */\n static get selectorRowsWithHeader() {\n return `${prefix}-table-header-row,${prefix}-table-row`;\n }\n\n static styles = styles;\n}\n\nexport default BXTable;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,aAAa,QAAQ,mBAAmB;AAC3D,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,OAAO,QAAQ,2CAA2C;AACnE,SAASC,kBAAkB,EAAEC,UAAU,QAAQ,QAAQ;AACvD,OAAOC,MAAM,MAAM,uBAAmB;AAEtC,SAASF,kBAAkB,EAAEC,UAAU;;AAEvC;AACA;AACA;AACA;AACA;AAJA,IAMME,OAAO,GAAAC,SAAA,EADZP,aAAa,CAAE,GAAEC,MAAO,QAAO,CAAC,aAAAO,WAAA,EAAAC,WAAA;EAAjC,MACMH,OAAO,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA8CjC;EAAC;IAAAI,CAAA,EA9CKN,OAAO;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIVhB,QAAQ,C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;MACzD;IAAC;MAAAa,IAAA;MAAAyB,MAAA;MAAAtB,GAAA;MAAAC,MAAA;QAAA,OAEeb,MAAM;MAAA;IAAA;EAAA;AAAA,GA7CFR,UAAU;AAgDhC,eAAeS,OAAO"}
|
|
1
|
+
{"version":3,"file":"table.js","names":["LitElement","html","property","customElement","state","prefix","forEach","TABLE_SIZE","TABLE_SORT_DIRECTION","styles","HostListener","HostListenerMixin","CDSTable","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","key","value","ASCENDING","DESCENDING","decorators","type","Boolean","reflect","attribute","customSortRow","lhs","rhs","collator","compare","rowText","searchString","toLowerCase","indexOf","LG","_handleSlotChange","target","hasContent","assignedNodes","some","node","nodeType","Node","TEXT_NODE","textContent","trim","withHeader","_handleFilterRows","unfilteredRows","_tableRows","elem","_elem$textContent","filtered","filterRows","_searchValue","push","expandable","nextElementSibling","init","bubbles","cancelable","composed","detail","dispatchEvent","CustomEvent","eventTableFiltered","_handleDownload","data","elementsToArray","elements","Array","from","element","headerCells","querySelectorAll","selectorHeaderCell","rows","_selectedRows","headerTitleArray","row","rowData","cells","selectorTableRowCells","cellText","index","headerTitle","blob","Blob","JSON","stringify","href","URL","createObjectURL","event","expanded","_tableHeaderRow","e","sortDirection","contains","columns","children","columnIndex","setAttribute","sort","a","b","cellA","cellB","collationFactors","originalRows","expandedRows","_tableExpandedRows","mapping","reduce","acc","sortId","getAttribute","sortedWithExpanded","_tableBody","insertBefore","sortedHeader","eventTableSorted","_tableHeaderRow$shado","selected","_tableBatchActions","tableBatchActions","_tableToolbarContent","tableToolbarContent","tableHeaderRow","selectedRows","radio","removeAttribute","shadowRoot","querySelector","checked","includes","filter","_this$_selectedRows","active","length","selectedRowsCount","hasBatchActions","totalRows","hasAttribute","headerCheckbox","allRowsSelected","indeterminate","selectedRow","eventTableRowSelect","tableRows","selectorTableExpandedRows","matches","eventTableRowSelectAll","_tableHeaderRow$shado2","click","connectedCallback","_get","_getPrototypeOf","prototype","call","firstUpdated","selectorTableBatchActions","_tableToolbar","selectorTableToolbar","selectorTableToolbarContent","selectorTableBody","selectorRowsWithHeader","selectorTableRow","_downloadButton","selectorToolbarDownload","onclick","bind","headerCount","updated","changedProperties","has","batchExpansion","isSortable","isSelectable","isExpandable","Intl","Collator","locale","selectorTableCellOverflowMenu","cell","parentNode","overflowMenuOnHover","size","_this$_tableToolbar","selectorAllRows","tableBody","useZebraStyles","render","_t","_","_t2","_t3","static","eventBeforeSort","eventSearchInput","eventBeforeChangeSelectionAll","eventBeforeChangeSelection","eventClickCancel","eventExpandoToggle","selectorTableToolbarSearch","selectorTableHead","selectorTableCells"],"sources":["components/data-table/table.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\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 { LitElement, html } from 'lit';\nimport { property, customElement, state } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { forEach } from '../../globals/internal/collection-helpers';\nimport { TABLE_SIZE, TABLE_SORT_DIRECTION } from './defs';\nimport styles from './data-table.scss';\n\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport {\n CDSRadioButton,\n CDSTableBatchActions,\n CDSTableCell,\n CDSTableHeaderCell,\n CDSTableHeaderRow,\n CDSTableRow,\n CDSTableToolbarSearch,\n} from '../..';\nimport CDSTableExpandedRow from './table-expanded-row';\n\nexport { TABLE_SIZE };\n\n/**\n * Data table.\n *\n * @element cds-table\n */\n@customElement(`${prefix}-table`)\nclass CDSTable extends HostListenerMixin(LitElement) {\n /**\n * The map of how sorting direction affects sorting order.\n */\n private collationFactors = {\n [TABLE_SORT_DIRECTION.ASCENDING]: 1,\n [TABLE_SORT_DIRECTION.DESCENDING]: -1,\n };\n\n /**\n * Reference to download button\n */\n @state()\n private _downloadButton;\n\n /**\n * Current search value for filtering\n */\n @state()\n private _searchValue = '';\n\n /**\n * Table header row within component\n */\n @state()\n private _tableHeaderRow;\n\n /**\n * Table body\n */\n @state()\n private _tableBody;\n\n /**\n * Table expanded row within component\n */\n @state()\n private _tableExpandedRows;\n\n /**\n * Table rows within component\n */\n @state()\n private _tableRows;\n\n /**\n * Reference to the component containing batch actions\n */\n @state()\n private _tableBatchActions;\n\n /**\n * Reference to the table toolbar\n */\n @state()\n private _tableToolbar;\n\n /**\n * Reference to the table toolbar content\n */\n @state()\n private _tableToolbarContent;\n\n @state()\n private _selectedRows: CDSTableRow[] = [];\n\n /**\n * `true` if this table should support batch expansion\n */\n @property({ type: Boolean, reflect: true, attribute: 'batch-expansion' })\n batchExpansion = false;\n\n /**\n * The g11n collator to use.\n */\n @property({ attribute: false })\n collator;\n\n /**\n * @param lhs A value.\n * @param rhs Another value.\n * @param collator A custom collator.\n * @returns\n * `0` if the given two values are equal\n * A negative value to sort `lhs` to an index lower than `rhs`\n * A positive value to sort `rhs` to an index lower than `lhs`\n */\n // eslint-disable-next-line class-methods-use-this\n customSortRow(lhs, rhs, collator) {\n if (typeof lhs === 'number' && typeof rhs === 'number') {\n return lhs - rhs;\n }\n return collator.compare(lhs, rhs);\n }\n\n /**\n * Specify whether the rows should be able to be expandable\n */\n @property({ type: Boolean, reflect: true })\n expandable = false;\n\n /**\n * The method used when filtering the table with the search bar.\n * Can be replaced with custom method.\n *\n * @param row A table row.\n * @param searchString A search string.\n * @returns `false` if the given table row matches the given search string.\n */\n @property()\n filterRows = (rowText: string, searchString: string) =>\n rowText.toLowerCase().indexOf(searchString) < 0;\n\n /**\n * The total headers\n */\n @property()\n headerCount = 0;\n\n /**\n * `true` if this table contains selectable rows\n */\n @property({ type: Boolean, reflect: true, attribute: 'is-selectable' })\n isSelectable = false;\n\n /**\n * `true` if this table should support sorting.\n */\n @property({ type: Boolean, reflect: true, attribute: 'is-sortable' })\n isSortable = false;\n\n /**\n * The table size.\n */\n @property({ reflect: true })\n locale = 'en';\n\n /**\n * Specify whether the overflow menu (if it exists) should be shown always, or only on hover\n */\n @property({\n type: Boolean,\n reflect: true,\n attribute: 'overflow-menu-on-hover',\n })\n overflowMenuOnHover = false;\n\n /**\n * Specify whether the control should be a radio button or inline checkbox\n */\n @property({ type: Boolean, reflect: true })\n radio = false;\n\n /**\n * The table size.\n */\n @property({ reflect: true })\n size = TABLE_SIZE.LG;\n\n /**\n * TODO: Uncomment when Carbon fully implements sticky header\n * Specify whether the header should be sticky.\n * Still experimental: may not work with every combination of table props\n */\n // @property({ type: Boolean, attribute: 'sticky-header', reflect: true })\n // stickyHeader = false;\n\n /**\n * If true, will use a width of 'auto' instead of 100%\n */\n @property({ type: Boolean, attribute: 'use-static-width', reflect: true })\n useStaticWidth = false;\n\n /**\n * true to add useZebraStyles striping.\n */\n @property({ type: Boolean, attribute: 'use-zebra-styles', reflect: true })\n useZebraStyles = false;\n\n @property({ type: Boolean, attribute: 'with-header', reflect: true })\n withHeader;\n\n private _handleSlotChange({ target }: Event) {\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .some(\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n this.withHeader = hasContent;\n }\n\n private _handleFilterRows() {\n const unfilteredRows = [] as any;\n forEach(this._tableRows, (elem) => {\n const rowText = elem.textContent?.trim();\n const filtered = this.filterRows(rowText as string, this._searchValue);\n (elem as any).filtered = filtered;\n\n if (!filtered) {\n unfilteredRows.push(elem);\n }\n\n if (this.expandable) {\n (elem as any).nextElementSibling.filtered = filtered;\n }\n });\n\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n unfilteredRows,\n },\n };\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof CDSTable).eventTableFiltered,\n init\n )\n );\n }\n\n /**\n * Download manager for selected rows.\n */\n private _handleDownload({ target }) {\n const data = [] as any;\n\n const elementsToArray = (elements) =>\n Array.from(elements, (element) => (element as any).textContent);\n\n const headerCells = this.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorHeaderCell\n );\n const rows = this._selectedRows;\n const headerTitleArray = elementsToArray(headerCells);\n\n rows.forEach((row) => {\n const rowData = {};\n const cells = elementsToArray(\n row.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorTableRowCells\n )\n );\n\n cells.forEach((cellText, index) => {\n const headerTitle = headerTitleArray[index];\n rowData[headerTitle] = cellText;\n });\n\n data.push(rowData);\n });\n\n const blob = new Blob([JSON.stringify(data)], { type: 'application/json' });\n\n target.href = URL.createObjectURL(blob);\n }\n\n /**\n * Handles batch expansion\n */\n @HostListener('eventExpandoToggle')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleBatchExpansion = async (event: CustomEvent) => {\n const { detail, target } = event;\n const { expanded } = detail;\n\n if ((target as CDSTableHeaderRow) === this._tableHeaderRow) {\n this._tableRows.forEach((e) => ((e as CDSTableRow).expanded = expanded));\n }\n };\n\n /**\n * Handles sorting the table depending on the column selected\n */\n @HostListener('eventBeforeSort')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleSort = async (event: CustomEvent) => {\n const { detail, target } = event;\n const { sortDirection } = detail;\n\n if (!this.contains(target as any)) {\n return;\n }\n\n const rows = [...this._tableRows];\n const columns = [...this._tableHeaderRow.children];\n const columnIndex = columns.indexOf(target);\n\n columns.forEach(\n (e) => e !== target && e.setAttribute('sort-direction', 'none')\n );\n\n // regular row sorting\n rows.sort((a, b) => {\n const cellA = a.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorTableRowCells\n )[columnIndex].textContent;\n const cellB = b.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorTableRowCells\n )[columnIndex].textContent;\n return (\n this.collationFactors[sortDirection] *\n this.customSortRow(cellA, cellB, this.collator)\n );\n });\n\n // take into account the expanded rows, mapping each expandable row to its original for proper reinsertion\n if (this.expandable) {\n const originalRows = [...this._tableRows];\n const expandedRows = [...this._tableExpandedRows];\n\n const mapping = originalRows.reduce((acc, element, index) => {\n const sortId = element.getAttribute('sort-id');\n acc[sortId] = expandedRows[index];\n return acc;\n }, {});\n\n const sortedWithExpanded = [] as any;\n\n rows.forEach((e) => {\n const sortId = e.getAttribute('sort-id');\n sortedWithExpanded.push(e);\n sortedWithExpanded.push(mapping[sortId]);\n });\n\n sortedWithExpanded.forEach((e) => {\n this._tableBody.insertBefore(e, null);\n });\n } else {\n rows.forEach((e) => {\n this._tableBody.insertBefore(e, null);\n });\n }\n\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n sortedHeader: columns[columnIndex],\n },\n };\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof CDSTable).eventTableSorted,\n init\n )\n );\n\n this._handleFilterRows();\n };\n\n /**\n * Handles search input within the toolbar actions\n */\n @HostListener('eventSearchInput')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleSearchInput = async (event: CustomEvent) => {\n const { detail, target } = event;\n\n if (this.contains(target as CDSTableToolbarSearch)) {\n const { value } = detail;\n this._searchValue = value;\n this._handleFilterRows();\n }\n };\n\n /**\n * Handles row selection\n */\n @HostListener('eventBeforeChangeSelection')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleRowSelect = async (event: CustomEvent) => {\n const { detail, target } = event;\n const { selected } = detail;\n const {\n _tableBatchActions: tableBatchActions,\n _tableToolbarContent: tableToolbarContent,\n _tableHeaderRow: tableHeaderRow,\n _selectedRows: selectedRows,\n } = this;\n\n if (!this.contains(target as CDSTableRow)) {\n return;\n }\n\n if (this.radio) {\n this._tableRows.forEach((e) => {\n if (e !== target) {\n e.removeAttribute('selected');\n e.shadowRoot!.querySelector(`${prefix}-radio-button`).checked = false;\n }\n });\n this._selectedRows.push(...[target as CDSTableRow]);\n } else {\n if (selectedRows.includes(target as CDSTableRow)) {\n this._selectedRows = selectedRows.filter((e) => e !== target);\n } else {\n selectedRows.push(target as CDSTableRow);\n }\n\n if (tableBatchActions) {\n tableBatchActions.active = this._selectedRows?.length;\n tableBatchActions.selectedRowsCount += selected ? 1 : -1;\n }\n\n if (tableToolbarContent) {\n tableToolbarContent.hasBatchActions = this._selectedRows.length;\n }\n }\n\n const totalRows = [...this._tableRows].filter(\n (elem) => !elem.hasAttribute('filtered')\n ).length;\n\n // selected header checkbox upon all rows being selected\n const headerCheckbox = tableHeaderRow.shadowRoot\n ?.querySelector(`${prefix}-checkbox`)\n .shadowRoot.querySelector(`.${prefix}--checkbox`);\n const allRowsSelected = this._selectedRows.length === totalRows;\n headerCheckbox.checked = !this._selectedRows.length ? false : true;\n headerCheckbox.indeterminate =\n !allRowsSelected && this._selectedRows.length > 0;\n\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n selectedRow: target,\n selectedRows: selectedRows,\n },\n };\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof CDSTable).eventTableRowSelect,\n init\n )\n );\n };\n\n /**\n * Handles header row selection, selecting/unselecting all rows\n */\n @HostListener('eventBeforeChangeSelectionAll')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleAllRowsSelect = async (event: CustomEvent) => {\n const { detail, target } = event;\n const { selected } = detail;\n const {\n _tableBatchActions: tableBatchActions,\n _tableToolbarContent: tableToolbarContent,\n _tableRows: tableRows,\n } = this;\n\n if (!this.contains(target as CDSTableRow)) {\n return;\n }\n\n let totalRows = 0;\n forEach(tableRows, (elem) => {\n if (!(elem as CDSTableRow).filtered) {\n (elem as CDSTableRow).selected = selected;\n this.radio\n ? ((\n (elem as CDSTableRow).shadowRoot!.querySelector(\n `${prefix}-radio-button`\n ) as CDSRadioButton\n ).checked = selected)\n : null;\n this._selectedRows.push(elem as CDSTableRow);\n totalRows++;\n\n const { selectorTableExpandedRows } = this\n .constructor as typeof CDSTable;\n const { nextElementSibling } = elem;\n\n // selecting the expanded row as well\n if (nextElementSibling?.matches(selectorTableExpandedRows)) {\n (elem.nextElementSibling as CDSTableExpandedRow).selected = selected;\n }\n }\n });\n\n if (!selected) {\n this._selectedRows = [];\n }\n\n if (tableBatchActions) {\n tableBatchActions.selectedRowsCount = selected ? totalRows : 0;\n tableBatchActions.active = selected;\n }\n\n if (tableToolbarContent) {\n tableToolbarContent.hasBatchActions = selected;\n }\n\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n selectedRows: this._selectedRows,\n },\n };\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof CDSTable).eventTableRowSelectAll,\n init\n )\n );\n };\n\n /**\n * Handles cancel button within the toolbar actions\n */\n @HostListener('eventClickCancel')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleCancelSelection = async (event: CustomEvent) => {\n const { target } = event;\n const { _tableHeaderRow: tableHeaderRow } = this;\n\n if (this.contains(target as CDSTableBatchActions)) {\n tableHeaderRow.shadowRoot\n ?.querySelector(`${prefix}-checkbox`)\n .shadowRoot.querySelector(`.${prefix}--checkbox`)\n .click();\n }\n };\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'table');\n }\n super.connectedCallback();\n }\n\n firstUpdated() {\n this._tableBatchActions = this.querySelector(\n (this.constructor as typeof CDSTable).selectorTableBatchActions\n );\n this._tableToolbar = this.querySelector(\n (this.constructor as typeof CDSTable).selectorTableToolbar\n );\n this._tableToolbarContent = this.querySelector(\n (this.constructor as typeof CDSTable).selectorTableToolbarContent\n );\n this._tableBody = this.querySelector(\n (this.constructor as typeof CDSTable).selectorTableBody\n );\n this._tableHeaderRow = this.querySelector(\n (this.constructor as typeof CDSTable).selectorRowsWithHeader\n );\n this._tableExpandedRows = this.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorTableExpandedRows\n );\n\n this._tableRows = this.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorTableRow\n );\n\n this._downloadButton = this.querySelector(\n (this.constructor as typeof CDSTable).selectorToolbarDownload\n );\n if (this._downloadButton) {\n this._downloadButton.onclick = this._handleDownload.bind(this);\n }\n this.headerCount = this._tableHeaderRow.children.length;\n }\n\n updated(changedProperties) {\n if (changedProperties.has('expandable')) {\n this._tableRows.forEach((e, index) => {\n e.expandable = this.expandable;\n e.setAttribute('sort-id', index);\n });\n this._tableHeaderRow.expandable = this.expandable;\n this._tableHeaderRow.batchExpansion = this.batchExpansion;\n this.headerCount += this.expandable ? 1 : -1;\n }\n\n if (changedProperties.has('headerCount')) {\n this._tableExpandedRows.forEach((e) => {\n e.setAttribute('colspan', this.headerCount);\n });\n }\n\n if (changedProperties.has('isSelectable')) {\n this.headerCount++;\n }\n\n if (changedProperties.has('isSortable')) {\n const headerCells = this.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorHeaderCell\n );\n headerCells.forEach((e) => {\n (e as CDSTableHeaderCell).isSortable = this.isSortable;\n (e as CDSTableHeaderCell).removeAttribute('sort-direction');\n (e as CDSTableHeaderCell).isSelectable = this.isSelectable;\n (e as CDSTableHeaderCell).isExpandable = this.expandable;\n });\n }\n\n if (changedProperties.has('locale')) {\n this.collator = new Intl.Collator(this.locale);\n }\n\n if (\n changedProperties.has('overflowMenuOnHover') ||\n changedProperties.has('size')\n ) {\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorTableCellOverflowMenu\n ),\n (elem) => {\n const cell = elem.parentNode as CDSTableCell;\n const row = cell.parentNode as CDSTableRow;\n cell.overflowMenuOnHover = this.overflowMenuOnHover;\n row.overflowMenuOnHover = this.overflowMenuOnHover;\n cell.setAttribute('size', this.size);\n elem.setAttribute('size', this.size);\n elem.setAttribute('data-table', '');\n }\n );\n }\n\n if (changedProperties.has('radio')) {\n // Propagate `size` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorTableRow\n ),\n (elem) => {\n (elem as CDSTableRow).radio = this.radio;\n }\n );\n }\n\n if (changedProperties.has('size')) {\n // Propagate `size` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSTable).selectorAllRows\n ),\n (elem) => {\n elem.setAttribute('size', this.size);\n }\n );\n this._tableToolbar?.setAttribute('size', this.size);\n }\n\n // TODO: Uncomment when Carbon fully implements Sticky header feature\n // if (changedProperties.has('stickyHeader')) {\n // const tableBody = this.querySelector(\n // (this.constructor as typeof CDSTable).selectorTableBody\n // );\n // const tableHead = this.querySelector(\n // (this.constructor as typeof CDSTable).selectorTableHead\n // );\n // (tableBody as any).stickyHeader = this.stickyHeader;\n // (tableHead as any).stickyHeader = this.stickyHeader;\n // forEach(\n // this.querySelectorAll(\n // (this.constructor as typeof CDSTable).selectorRowsWithHeader\n // ),\n // (elem) => {\n // (elem as any).stickyHeader = this.stickyHeader;\n // }\n // );\n // forEach(\n // this.querySelectorAll(\n // (this.constructor as typeof CDSTable).selectorTableCells\n // ),\n // (elem) => {\n // (elem as any).stickyHeader = this.stickyHeader;\n // }\n // );\n // }\n\n if (changedProperties.has('useZebraStyles')) {\n const tableBody = this.querySelector(\n (this.constructor as typeof CDSTable).selectorTableBody\n );\n (tableBody as any).useZebraStyles = this.useZebraStyles;\n }\n }\n\n /* eslint-disable no-constant-condition */\n render() {\n return html`\n <div ?hidden=\"${!this.withHeader}\" class=\"${prefix}--data-table-header\">\n <slot @slotchange=\"${this._handleSlotChange}\" name=\"title\"></slot>\n <slot @slotchange=\"${this._handleSlotChange}\" name=\"description\"></slot>\n </div>\n <slot name=\"toolbar\"></slot>\n\n ${false // TODO: replace with this.stickyHeader when feature is fully implemented\n ? html` <div class=\"${prefix}--data-table_inner-container\">\n <div class=\"${prefix}--data-table-content\">\n <slot></slot>\n </div>\n </div>`\n : html`<slot></slot>`}\n `;\n }\n /* eslint-enable no-constant-condition */\n\n /**\n * The name of the custom event fired before a new sort direction is set upon a user gesture.\n * Cancellation of this event stops the user-initiated change in sort direction.\n */\n static get eventBeforeSort() {\n return `${prefix}-table-header-cell-sort`;\n }\n\n /**\n * The name of the custom event fired during search bar input\n */\n static get eventSearchInput() {\n return `${prefix}-search-input`;\n }\n\n /**\n * The name of the custom event fired before header row is selected/unselected upon a user gesture.\n */\n static get eventBeforeChangeSelectionAll() {\n return `${prefix}-table-change-selection-all`;\n }\n\n /**\n * The name of the custom event fired before a row is selected/unselected upon a user gesture.\n */\n static get eventBeforeChangeSelection() {\n return `${prefix}-table-row-change-selection`;\n }\n\n /**\n * The name of the custom event fired after the Cancel button is clicked.\n */\n static get eventClickCancel() {\n return `${prefix}-table-batch-actions-cancel-clicked`;\n }\n\n /**\n * The name of the custom event fired after the expanded state a row is toggled upon a user gesture.\n */\n static get eventExpandoToggle() {\n return `${prefix}-table-row-expando-toggled`;\n }\n\n /**\n * The name of the custom event fired after a row has been selected\n */\n static get eventTableRowSelect() {\n return `${prefix}-table-row-selected`;\n }\n\n /**\n * The name of the custom event fired after all rows have been selected\n */\n static get eventTableRowSelectAll() {\n return `${prefix}-table-row-all-selected`;\n }\n\n /**\n * The name of the custom event fired after the table has been sorted\n */\n static get eventTableSorted() {\n return `${prefix}-table-sorted`;\n }\n\n /**\n * The name of the custom event fired after the table has been filtered containing remaining rows.\n */\n static get eventTableFiltered() {\n return `${prefix}-table-filtered`;\n }\n\n /**\n * The CSS selector to find the overflow menu on the table cell\n */\n static get selectorTableCellOverflowMenu() {\n return `${prefix}-table-cell ${prefix}-overflow-menu`;\n }\n\n /**\n * The CSS selector to find the download button\n */\n static get selectorToolbarDownload() {\n return `${prefix}-button[download]`;\n }\n\n /**\n * The CSS selector to find the table batch actions\n */\n static get selectorTableBatchActions() {\n return `${prefix}-table-batch-actions`;\n }\n\n /**\n * The CSS selector to find the table toolbar\n */\n static get selectorTableToolbar() {\n return `${prefix}-table-toolbar`;\n }\n\n /**\n * The CSS selector to find the table toolbar content\n */\n static get selectorTableToolbarContent() {\n return `${prefix}-table-toolbar-content`;\n }\n\n /**\n * The CSS selector to find the table toolbar search\n */\n static get selectorTableToolbarSearch() {\n return `${prefix}-table-toolbar-search`;\n }\n\n /**\n * The CSS selector to find the table head\n */\n static get selectorTableHead() {\n return `${prefix}-table-head`;\n }\n\n /**\n * The CSS selector to find the table body\n */\n static get selectorTableBody() {\n return `${prefix}-table-body`;\n }\n\n /**\n * The CSS selector to find the table expanded rows\n */\n static get selectorTableExpandedRows() {\n return `${prefix}-table-expanded-row`;\n }\n\n /**\n * The CSS selector to find the table rows\n */\n static get selectorTableRow() {\n return `${prefix}-table-row`;\n }\n\n /**\n * The CSS selector to find the rows cells.\n */\n static get selectorTableRowCells() {\n return `${prefix}-table-cell`;\n }\n\n /**\n * The CSS selector to find the rows cells, including header cells.\n */\n static get selectorTableCells() {\n return `${prefix}-table-cell, ${prefix}-table-header-cell`;\n }\n\n /**\n * The CSS selector to find the header cell\n */\n static get selectorHeaderCell() {\n return `${prefix}-table-header-cell`;\n }\n\n /**\n * The CSS selector to find the rows, including header rows.\n */\n static get selectorRowsWithHeader() {\n return `${prefix}-table-header-row,${prefix}-table-row`;\n }\n\n /**\n * The CSS selector to find all rows\n */\n static get selectorAllRows() {\n return `${prefix}-table-header-row,${prefix}-table-row,${prefix}-table-expanded-row`;\n }\n\n static styles = styles;\n}\n\nexport default CDSTable;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,aAAa,EAAEC,KAAK,QAAQ,mBAAmB;AAClE,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,OAAO,QAAQ,2CAA2C;AACnE,SAASC,UAAU,EAAEC,oBAAoB,QAAQ,QAAQ;AACzD,OAAOC,MAAM,MAAM,uBAAmB;AAEtC,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAOC,iBAAiB,MAAM,oCAAoC;AAYlE,SAASJ,UAAU;;AAEnB;AACA;AACA;AACA;AACA;AAJA,IAMMK,QAAQ,GAAAC,SAAA,EADbV,aAAa,CAAE,GAAEE,MAAO,QAAO,CAAC,aAAAS,WAAA,EAAAC,kBAAA;EAAjC,MACMH,QAAQ,SAA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F;AACA;IAFE;MAAAe,IAAA;MAAAsL,MAAA;MAAArL,GAAA;MAAAC,KAAA,EAGA,SAAAqJ,uBAAA,EAAoC;QAClC,OAAQ,GAAEtK,MAAO,qBAAoBA,MAAO,YAAW;MACzD;;MAEA;AACF;AACA;IAFE;MAAAe,IAAA;MAAAsL,MAAA;MAAArL,GAAA;MAAAC,KAAA,EAGA,SAAA4K,gBAAA,EAA6B;QAC3B,OAAQ,GAAE7L,MAAO,qBAAoBA,MAAO,cAAaA,MAAO,qBAAoB;MACtF;IAAC;MAAAe,IAAA;MAAAsL,MAAA;MAAArL,GAAA;MAAAC,MAAA;QAAA,OAEeb,MAAM;MAAA;IAAA;EAAA;AAAA,GAt3BDE,iBAAiB,CAACX,UAAU,CAAC;AAy3BpD,eAAeY,QAAQ"}
|
|
@@ -41,14 +41,14 @@ export declare enum DROPDOWN_KEYBOARD_ACTION {
|
|
|
41
41
|
* Dropdown size.
|
|
42
42
|
*/
|
|
43
43
|
export declare enum DROPDOWN_SIZE {
|
|
44
|
-
/**
|
|
45
|
-
* Regular size.
|
|
46
|
-
*/
|
|
47
|
-
REGULAR = "",
|
|
48
44
|
/**
|
|
49
45
|
* Small size.
|
|
50
46
|
*/
|
|
51
47
|
SMALL = "sm",
|
|
48
|
+
/**
|
|
49
|
+
* Medium size.
|
|
50
|
+
*/
|
|
51
|
+
MEDIUM = "md",
|
|
52
52
|
/**
|
|
53
53
|
* Large size.
|
|
54
54
|
*/
|
|
@@ -59,9 +59,9 @@ export declare enum DROPDOWN_SIZE {
|
|
|
59
59
|
*/
|
|
60
60
|
export declare enum DROPDOWN_TYPE {
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
62
|
+
* Default type.
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
DEFAULT = "",
|
|
65
65
|
/**
|
|
66
66
|
* Inline type.
|
|
67
67
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/dropdown/defs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,yBAAyB,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;CAKhC,CAAC;AAEF;;GAEG;AACH,oBAAY,wBAAwB;IAClC;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,UAAU,eAAe;IAEzB;;OAEG;IACH,UAAU,eAAe;CAC1B;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB;;OAEG;IACH,OAAO
|
|
1
|
+
{"version":3,"sources":["components/dropdown/defs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,yBAAyB,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;CAKhC,CAAC;AAEF;;GAEG;AACH,oBAAY,wBAAwB;IAClC;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,UAAU,eAAe;IAEzB;;OAEG;IACH,UAAU,eAAe;CAC1B;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB;;OAEG;IACH,KAAK,OAAO;IAEZ;;OAEG;IACH,MAAM,OAAO;IAEb;;OAEG;IACH,KAAK,OAAO;CACb;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB;;OAEG;IACH,OAAO,KAAK;IAEZ;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC5B;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,MAAM,WAAW;CAClB","file":"defs.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2023\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\nexport { FORM_ELEMENT_COLOR_SCHEME as DROPDOWN_COLOR_SCHEME } from '../../globals/shared-enums';\n\n/**\n * Navigation direction, associated with key symbols.\n */\nexport const NAVIGATION_DIRECTION = {\n Up: -1,\n ArrowUp: -1,\n Down: 1,\n ArrowDown: 1,\n};\n\n/**\n * The keyboard action categories for dropdown.\n */\nexport enum DROPDOWN_KEYBOARD_ACTION {\n /**\n * Not doing any action.\n */\n NONE = 'none',\n\n /**\n * Keyboard action to close menu.\n */\n CLOSING = 'closing',\n\n /**\n * Keyboard action to navigate back/forward.\n */\n NAVIGATING = 'navigating',\n\n /**\n * Keyboard action to open/close menu on the trigger button or select/deselect a menu item.\n */\n TRIGGERING = 'triggering',\n}\n\n/**\n * Dropdown size.\n */\nexport enum DROPDOWN_SIZE {\n /**\n * Small size.\n */\n SMALL = 'sm',\n\n /**\n * Medium size.\n */\n MEDIUM = 'md',\n\n /**\n * Large size.\n */\n LARGE = 'lg',\n}\n\n/**\n * Dropdown types.\n */\nexport enum DROPDOWN_TYPE {\n /**\n * Default type.\n */\n DEFAULT = '',\n\n /**\n * Inline type.\n */\n INLINE = 'inline',\n}\n\n/**\n * Dropdown direction.\n */\nexport enum DROPDOWN_DIRECTION {\n /**\n * Top.\n */\n TOP = 'top',\n\n /**\n * Bottom.\n */\n BOTTOM = 'bottom',\n}\n"]}
|
|
@@ -39,8 +39,8 @@ export let DROPDOWN_SIZE;
|
|
|
39
39
|
* Dropdown types.
|
|
40
40
|
*/
|
|
41
41
|
(function (DROPDOWN_SIZE) {
|
|
42
|
-
DROPDOWN_SIZE["REGULAR"] = "";
|
|
43
42
|
DROPDOWN_SIZE["SMALL"] = "sm";
|
|
43
|
+
DROPDOWN_SIZE["MEDIUM"] = "md";
|
|
44
44
|
DROPDOWN_SIZE["LARGE"] = "lg";
|
|
45
45
|
})(DROPDOWN_SIZE || (DROPDOWN_SIZE = {}));
|
|
46
46
|
export let DROPDOWN_TYPE;
|
|
@@ -49,7 +49,7 @@ export let DROPDOWN_TYPE;
|
|
|
49
49
|
* Dropdown direction.
|
|
50
50
|
*/
|
|
51
51
|
(function (DROPDOWN_TYPE) {
|
|
52
|
-
DROPDOWN_TYPE["
|
|
52
|
+
DROPDOWN_TYPE["DEFAULT"] = "";
|
|
53
53
|
DROPDOWN_TYPE["INLINE"] = "inline";
|
|
54
54
|
})(DROPDOWN_TYPE || (DROPDOWN_TYPE = {}));
|
|
55
55
|
export let DROPDOWN_DIRECTION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defs.js","names":["FORM_ELEMENT_COLOR_SCHEME","DROPDOWN_COLOR_SCHEME","NAVIGATION_DIRECTION","Up","ArrowUp","Down","ArrowDown","DROPDOWN_KEYBOARD_ACTION","DROPDOWN_SIZE","DROPDOWN_TYPE","DROPDOWN_DIRECTION"],"sources":["components/dropdown/defs.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2023\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\nexport { FORM_ELEMENT_COLOR_SCHEME as DROPDOWN_COLOR_SCHEME } from '../../globals/shared-enums';\n\n/**\n * Navigation direction, associated with key symbols.\n */\nexport const NAVIGATION_DIRECTION = {\n Up: -1,\n ArrowUp: -1,\n Down: 1,\n ArrowDown: 1,\n};\n\n/**\n * The keyboard action categories for dropdown.\n */\nexport enum DROPDOWN_KEYBOARD_ACTION {\n /**\n * Not doing any action.\n */\n NONE = 'none',\n\n /**\n * Keyboard action to close menu.\n */\n CLOSING = 'closing',\n\n /**\n * Keyboard action to navigate back/forward.\n */\n NAVIGATING = 'navigating',\n\n /**\n * Keyboard action to open/close menu on the trigger button or select/deselect a menu item.\n */\n TRIGGERING = 'triggering',\n}\n\n/**\n * Dropdown size.\n */\nexport enum DROPDOWN_SIZE {\n /**\n *
|
|
1
|
+
{"version":3,"file":"defs.js","names":["FORM_ELEMENT_COLOR_SCHEME","DROPDOWN_COLOR_SCHEME","NAVIGATION_DIRECTION","Up","ArrowUp","Down","ArrowDown","DROPDOWN_KEYBOARD_ACTION","DROPDOWN_SIZE","DROPDOWN_TYPE","DROPDOWN_DIRECTION"],"sources":["components/dropdown/defs.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2023\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\nexport { FORM_ELEMENT_COLOR_SCHEME as DROPDOWN_COLOR_SCHEME } from '../../globals/shared-enums';\n\n/**\n * Navigation direction, associated with key symbols.\n */\nexport const NAVIGATION_DIRECTION = {\n Up: -1,\n ArrowUp: -1,\n Down: 1,\n ArrowDown: 1,\n};\n\n/**\n * The keyboard action categories for dropdown.\n */\nexport enum DROPDOWN_KEYBOARD_ACTION {\n /**\n * Not doing any action.\n */\n NONE = 'none',\n\n /**\n * Keyboard action to close menu.\n */\n CLOSING = 'closing',\n\n /**\n * Keyboard action to navigate back/forward.\n */\n NAVIGATING = 'navigating',\n\n /**\n * Keyboard action to open/close menu on the trigger button or select/deselect a menu item.\n */\n TRIGGERING = 'triggering',\n}\n\n/**\n * Dropdown size.\n */\nexport enum DROPDOWN_SIZE {\n /**\n * Small size.\n */\n SMALL = 'sm',\n\n /**\n * Medium size.\n */\n MEDIUM = 'md',\n\n /**\n * Large size.\n */\n LARGE = 'lg',\n}\n\n/**\n * Dropdown types.\n */\nexport enum DROPDOWN_TYPE {\n /**\n * Default type.\n */\n DEFAULT = '',\n\n /**\n * Inline type.\n */\n INLINE = 'inline',\n}\n\n/**\n * Dropdown direction.\n */\nexport enum DROPDOWN_DIRECTION {\n /**\n * Top.\n */\n TOP = 'top',\n\n /**\n * Bottom.\n */\n BOTTOM = 'bottom',\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,yBAAyB,IAAIC,qBAAqB,QAAQ,4BAA4B;;AAE/F;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAG;EAClCC,EAAE,EAAE,CAAC,CAAC;EACNC,OAAO,EAAE,CAAC,CAAC;EACXC,IAAI,EAAE,CAAC;EACPC,SAAS,EAAE;AACb,CAAC;;AAED;AACA;AACA;AACA,WAAYC,wBAAwB;;AAsBpC;AACA;AACA;AAFA,WAtBYA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;AAAA,GAAxBA,wBAAwB,KAAxBA,wBAAwB;AAyBpC,WAAYC,aAAa;;AAiBzB;AACA;AACA;AAFA,WAjBYA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa;AAoBzB,WAAYC,aAAa;;AAYzB;AACA;AACA;AAFA,WAZYA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa;AAezB,WAAYC,kBAAkB;AAU7B,WAVWA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;AAAA,GAAlBA,kBAAkB,KAAlBA,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/dropdown/dropdown-item.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;GAKG;AACH,cACM,eAAgB,SAAQ,UAAU;IACtC;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;;;;OAKG;IAEH,WAAW,UAAS;IAEpB;;;;OAIG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,IAAI,
|
|
1
|
+
{"version":3,"sources":["components/dropdown/dropdown-item.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;GAKG;AACH,cACM,eAAgB,SAAQ,UAAU;IACtC;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;;;;OAKG;IAEH,WAAW,UAAS;IAEpB;;;;OAIG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,IAAI,gBAAwB;IAE5B;;OAEG;IAEH,KAAK,SAAM;IAEX,MAAM;IAeN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,eAAe,CAAC","file":"dropdown-item.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\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 { LitElement, html } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport Checkmark16 from '@carbon/icons/lib/checkmark/16';\nimport { prefix } from '../../globals/settings';\nimport { DROPDOWN_SIZE } from './dropdown';\nimport styles from './dropdown.scss';\n\n/**\n * Dropdown item.\n *\n * @element cds-dropdown-item\n * @csspart selected-icon The selected icon.\n */\n@customElement(`${prefix}-dropdown-item`)\nclass CDSDropdownItem extends LitElement {\n /**\n * `true` if this dropdown item should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if this dropdown item should be highlighted.\n * If `true`, parent `<dropdown>` selects/deselects this dropdown item upon keyboard interaction.\n *\n * @private\n */\n @property({ type: Boolean, reflect: true })\n highlighted = false;\n\n /**\n * `true` if this dropdown item should be selected.\n *\n * @private\n */\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n /**\n * Dropdown size.\n */\n @property({ reflect: true })\n size = DROPDOWN_SIZE.MEDIUM;\n\n /**\n * The `value` attribute that is set to the parent `<cds-dropdown>` when this dropdown item is selected.\n */\n @property()\n value = '';\n\n render() {\n const { selected } = this;\n return html`\n <div class=\"${prefix}--list-box__menu-item__option\">\n <slot></slot>\n ${!selected\n ? undefined\n : Checkmark16({\n part: 'selected-icon',\n class: `${prefix}--list-box__menu-item__selected-icon`,\n })}\n </div>\n `;\n }\n\n static styles = styles;\n}\n\nexport default CDSDropdownItem;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-item.js","names":["LitElement","html","property","customElement","Checkmark16","prefix","DROPDOWN_SIZE","styles","CDSDropdownItem","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","reflect","key","value","
|
|
1
|
+
{"version":3,"file":"dropdown-item.js","names":["LitElement","html","property","customElement","Checkmark16","prefix","DROPDOWN_SIZE","styles","CDSDropdownItem","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","reflect","key","value","MEDIUM","render","selected","_t","_","undefined","part","class","static"],"sources":["components/dropdown/dropdown-item.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\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 { LitElement, html } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport Checkmark16 from '@carbon/icons/lib/checkmark/16';\nimport { prefix } from '../../globals/settings';\nimport { DROPDOWN_SIZE } from './dropdown';\nimport styles from './dropdown.scss';\n\n/**\n * Dropdown item.\n *\n * @element cds-dropdown-item\n * @csspart selected-icon The selected icon.\n */\n@customElement(`${prefix}-dropdown-item`)\nclass CDSDropdownItem extends LitElement {\n /**\n * `true` if this dropdown item should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if this dropdown item should be highlighted.\n * If `true`, parent `<dropdown>` selects/deselects this dropdown item upon keyboard interaction.\n *\n * @private\n */\n @property({ type: Boolean, reflect: true })\n highlighted = false;\n\n /**\n * `true` if this dropdown item should be selected.\n *\n * @private\n */\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n /**\n * Dropdown size.\n */\n @property({ reflect: true })\n size = DROPDOWN_SIZE.MEDIUM;\n\n /**\n * The `value` attribute that is set to the parent `<cds-dropdown>` when this dropdown item is selected.\n */\n @property()\n value = '';\n\n render() {\n const { selected } = this;\n return html`\n <div class=\"${prefix}--list-box__menu-item__option\">\n <slot></slot>\n ${!selected\n ? undefined\n : Checkmark16({\n part: 'selected-icon',\n class: `${prefix}--list-box__menu-item__selected-icon`,\n })}\n </div>\n `;\n }\n\n static styles = styles;\n}\n\nexport default CDSDropdownItem;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,aAAa,QAAQ,mBAAmB;AAC3D,OAAOC,WAAW,MAAM,0BAAgC;AACxD,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,aAAa,QAAQ,YAAY;AAC1C,OAAOC,MAAM,MAAM,qBAAiB;;AAEpC;AACA;AACA;AACA;AACA;AACA,GALA;AACA;AACA;AACA;AACA;AACA;AALA,IAOMC,eAAe,GAAAC,SAAA,EADpBN,aAAa,CAAE,GAAEE,MAAO,gBAAe,CAAC,aAAAK,WAAA,EAAAC,WAAA;EAAzC,MACMH,eAAe,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAoDzC;EAAC;IAAAI,CAAA,EApDKN,eAAe;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIlBf,QAAQ,CAAC;QAAEgB,IAAI,EAAEC,OAAO;QAAEC,OAAO,EAAE;MAAK,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAChC,KAAK;MAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAQff,QAAQ,CAAC;QAAEgB,IAAI,EAAEC,OAAO;QAAEC,OAAO,EAAE;MAAK,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAC7B,KAAK;MAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAOlBf,QAAQ,CAAC;QAAEgB,IAAI,EAAEC,OAAO;QAAEC,OAAO,EAAE;MAAK,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAChC,KAAK;MAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAKff,QAAQ,CAAC;QAAEkB,OAAO,EAAE;MAAK,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OACrBhB,aAAa,CAACiB,MAAM;MAAA;IAAA;MAAAP,IAAA;MAAAC,UAAA,GAK1Bf,QAAQ,EAAE;MAAAmB,GAAA;MAAAC,MAAA;QAAA,OACH,EAAE;MAAA;IAAA;MAAAN,IAAA;MAAAK,GAAA;MAAAC,KAAA;MAjCV;AACF;AACA;;MAIE;AACF;AACA;AACA;AACA;AACA;;MAIE;AACF;AACA;AACA;AACA;;MAIE;AACF;AACA;;MAIE;AACF;AACA;;MAIE,SAAAE,OAAA,EAAS;QACP,MAAM;UAAEC;QAAS,CAAC,GAAG,IAAI;QACzB,OAAOxB,IAAI,CAAAyB,EAAA,KAAAA,EAAA,GAAAC,CAAC;AAChB,oBAAkB,CAAS;AAC3B;AACA,UAAQ,CAKO;AACf;AACA,KAAI,GATgBtB,MAAM,EAEhB,CAACoB,QAAQ,GACPG,SAAS,GACTxB,WAAW,CAAC;UACVyB,IAAI,EAAE,eAAe;UACrBC,KAAK,EAAG,GAAEzB,MAAO;QACnB,CAAC,CAAC;MAGZ;IAAC;MAAAW,IAAA;MAAAe,MAAA;MAAAV,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GAnDMP,UAAU;AAsDxC,eAAeQ,eAAe"}
|
|
@@ -1367,6 +1367,10 @@ declare class CDSDropdown extends CDSDropdown_base {
|
|
|
1367
1367
|
* @returns The main content of the trigger button.
|
|
1368
1368
|
*/
|
|
1369
1369
|
protected _renderLabel(): TemplateResult;
|
|
1370
|
+
/**
|
|
1371
|
+
* @returns The title label.
|
|
1372
|
+
*/
|
|
1373
|
+
protected _renderTitleLabel(): TemplateResult;
|
|
1370
1374
|
/**
|
|
1371
1375
|
* @returns The content following the trigger button.
|
|
1372
1376
|
*/
|
|
@@ -1385,7 +1389,7 @@ declare class CDSDropdown extends CDSDropdown_base {
|
|
|
1385
1389
|
/**
|
|
1386
1390
|
* Specify the direction of the dropdown. Can be either top or bottom.
|
|
1387
1391
|
*/
|
|
1388
|
-
direction:
|
|
1392
|
+
direction: DROPDOWN_DIRECTION;
|
|
1389
1393
|
/**
|
|
1390
1394
|
* `true` if this dropdown should be disabled.
|
|
1391
1395
|
*/
|
|
@@ -1475,7 +1479,10 @@ declare class CDSDropdown extends CDSDropdown_base {
|
|
|
1475
1479
|
*/
|
|
1476
1480
|
warnText: string;
|
|
1477
1481
|
shouldUpdate(changedProperties: any): boolean;
|
|
1478
|
-
|
|
1482
|
+
/**
|
|
1483
|
+
* The CSS class list for dropdown listbox
|
|
1484
|
+
*/
|
|
1485
|
+
protected get _classes(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/class-map").ClassMapDirective>;
|
|
1479
1486
|
render(): TemplateResult<1>;
|
|
1480
1487
|
/**
|
|
1481
1488
|
* Symbols of keys that triggers opening/closing menu and selecting/deselecting menu item.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/dropdown/dropdown.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,UAAU,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAgBvD,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,oBAAoB,EACrB,MAAM,QAAQ,CAAC;AAChB,OAAO,eAAe,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,oBAAoB,GACrB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IACH,MAAM,KAAK,YAAY,WAEtB;IAED;;OAEG;IACH,MAAM,KAAK,oBAAoB,WAE9B;IAED;;;OAGG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED;;;OAGG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED,MAAM,CAAC,iBAAiB;;;;MAGtB;IACF,MAAM,CAAC,MAAM,MAAU;IAEvB;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM;CAY7B;AAED,eAAe,WAAW,CAAC","file":"dropdown.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\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 { ifDefined } from 'lit/directives/if-defined.js';\nimport { LitElement, html, TemplateResult } from 'lit';\nimport { property, customElement, query } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport ChevronDown16 from '@carbon/icons/lib/chevron--down/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport WarningAltFilled16 from '@carbon/icons/lib/warning--alt--filled/16';\nimport FocusMixin from '../../globals/mixins/focus';\nimport FormMixin from '../../globals/mixins/form';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport HostListener from '../../globals/decorators/host-listener';\nimport {\n find,\n forEach,\n indexOf,\n} from '../../globals/internal/collection-helpers';\nimport {\n DROPDOWN_DIRECTION,\n DROPDOWN_KEYBOARD_ACTION,\n DROPDOWN_SIZE,\n DROPDOWN_TYPE,\n NAVIGATION_DIRECTION,\n} from './defs';\nimport CDSDropdownItem from './dropdown-item';\nimport styles from './dropdown.scss';\n\nexport {\n DROPDOWN_KEYBOARD_ACTION,\n DROPDOWN_DIRECTION,\n DROPDOWN_SIZE,\n DROPDOWN_TYPE,\n NAVIGATION_DIRECTION,\n};\n\n/**\n * Dropdown.\n *\n * @element cds-dropdown\n * @csspart label-text The label text.\n * @csspart helper-text The helper text.\n * @csspart trigger-button The trigger button.\n * @csspart menu-body The menu body.\n * @csspart validity-message The validity message.\n * @fires cds-dropdown-beingselected\n * The custom event fired before a dropdown item is selected upon a user gesture.\n * Cancellation of this event stops changing the user-initiated selection.\n * @fires cds-dropdown-beingtoggled\n * The custom event fired before the open state of this dropdown is toggled upon a user gesture.\n * Cancellation of this event stops the user-initiated toggling.\n * @fires cds-dropdown-selected - The custom event fired after a dropdown item is selected upon a user gesture.\n * @fires cds-dropdown-toggled - The custom event fired after the open state of this dropdown is toggled upon a user gesture.\n */\n@customElement(`${prefix}-dropdown`)\nclass CDSDropdown extends ValidityMixin(\n HostListenerMixin(FormMixin(FocusMixin(LitElement)))\n) {\n /**\n * The latest status of this dropdown, for screen reader to accounce.\n */\n protected _assistiveStatusText?: string;\n\n /**\n * The content of the selected item.\n */\n protected _selectedItemContent: DocumentFragment | null = null;\n\n /**\n * `true` if the trigger button should be focusable.\n * Derived class can set `false` to this if the trigger button contains another primary focusable element (e.g. `<input>`).\n */\n protected _shouldTriggerBeFocusable = true;\n\n /**\n * The list box `<div>` node.\n */\n @query(`.${prefix}--list-box`)\n protected _listBoxNode!: HTMLDivElement;\n\n /**\n * The `<slot>` element for the helper text in the shadow DOM.\n */\n @query('slot[name=\"helper-text\"]')\n protected _slotHelperTextNode!: HTMLSlotElement;\n\n /**\n * The `<slot>` element for the title text in the shadow DOM.\n */\n @query('slot[name=\"title-text\"]')\n protected _slotTitleTextNode!: HTMLSlotElement;\n\n /**\n * @param itemToSelect A dropdown item. Absense of this argument means clearing selection.\n * @returns `true` if the selection of this dropdown should change if the given item is selected upon user interaction.\n */\n protected _selectionShouldChange(itemToSelect?: CDSDropdownItem) {\n return !itemToSelect || itemToSelect.value !== this.value;\n }\n\n /**\n * A callback that runs after change in dropdown selection upon user interaction is confirmed.\n *\n * @param itemToSelect\n * A dropdown item.\n * Absense of this argument means clearing selection, which may be handled by a derived class.\n */\n protected _selectionDidChange(itemToSelect?: CDSDropdownItem) {\n if (itemToSelect) {\n this.value = itemToSelect.value;\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSDropdown).selectorItemSelected\n ),\n (item) => {\n (item as CDSDropdownItem).selected = false;\n }\n );\n itemToSelect.selected = true;\n this._assistiveStatusText = this.selectedItemAssistiveText;\n this._handleUserInitiatedToggle(false);\n }\n }\n\n /**\n * Handles `click` event on the top-level element in the shadow DOM.\n *\n * @param event The event.\n */\n protected _handleClickInner(event: MouseEvent) {\n if (this.readOnly) {\n return;\n }\n\n if (this.shadowRoot!.contains(event.target as Node)) {\n this._handleUserInitiatedToggle();\n } else {\n const item = (event.target as Element).closest(\n (this.constructor as typeof CDSDropdown).selectorItem\n ) as CDSDropdownItem;\n if (this.contains(item)) {\n this._handleUserInitiatedSelectItem(item);\n }\n }\n }\n\n /**\n * Handler for the `keydown` event on the top-level element in the shadow DOM.\n */\n protected _handleKeydownInner(event: KeyboardEvent) {\n const { key } = event;\n const action = (this.constructor as typeof CDSDropdown).getAction(key);\n if (!this.open) {\n switch (action) {\n case DROPDOWN_KEYBOARD_ACTION.NAVIGATING:\n this._handleUserInitiatedToggle(true);\n // If this menu gets open with an arrow key, reset the highlight\n this._clearHighlight();\n break;\n default:\n break;\n }\n } else {\n switch (action) {\n case DROPDOWN_KEYBOARD_ACTION.CLOSING:\n this._handleUserInitiatedToggle(false);\n break;\n case DROPDOWN_KEYBOARD_ACTION.NAVIGATING:\n this._navigate(NAVIGATION_DIRECTION[key]);\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Handler for the `keypress` event on the top-level element in the shadow DOM.\n */\n protected _handleKeypressInner(event: KeyboardEvent) {\n const { key } = event;\n const action = (this.constructor as typeof CDSDropdown).getAction(key);\n if (!this.open) {\n switch (action) {\n case DROPDOWN_KEYBOARD_ACTION.TRIGGERING:\n this._handleUserInitiatedToggle(true);\n break;\n default:\n break;\n }\n } else {\n switch (action) {\n case DROPDOWN_KEYBOARD_ACTION.TRIGGERING:\n {\n const constructor = this.constructor as typeof CDSDropdown;\n const highlightedItem = this.querySelector(\n constructor.selectorItemHighlighted\n ) as CDSDropdownItem;\n if (highlightedItem) {\n this._handleUserInitiatedSelectItem(highlightedItem);\n } else {\n this._handleUserInitiatedToggle(false);\n }\n }\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Handles `blur` event handler on the document this element is in.\n *\n * @param event The event.\n */\n @HostListener('focusout')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n protected _handleFocusOut(event: FocusEvent) {\n if (!this.contains(event.relatedTarget as Node)) {\n this._handleUserInitiatedToggle(false);\n }\n }\n\n /**\n * Handles `slotchange` event for the `<slot>` for helper text.\n */\n protected _handleSlotchangeHelperText() {\n this.requestUpdate();\n }\n\n /**\n * Handles `slotchange` event for the `<slot>` for label text.\n */\n protected _handleSlotchangeLabelText() {\n this.requestUpdate();\n }\n\n /**\n * Handles user-initiated selection of a dropdown item.\n *\n * @param [item] The dropdown item user wants to select. Absense of this argument means clearing selection.\n */\n protected _handleUserInitiatedSelectItem(item?: CDSDropdownItem) {\n if (item?.hasAttribute('disabled')) {\n return;\n }\n\n if (this._selectionShouldChange(item)) {\n const init = {\n bubbles: true,\n composed: true,\n detail: {\n item,\n },\n };\n const constructor = this.constructor as typeof CDSDropdown;\n const beforeSelectEvent = new CustomEvent(constructor.eventBeforeSelect, {\n ...init,\n cancelable: true,\n });\n if (this.dispatchEvent(beforeSelectEvent)) {\n this._selectionDidChange(item);\n const afterSelectEvent = new CustomEvent(constructor.eventSelect, init);\n this.dispatchEvent(afterSelectEvent);\n }\n }\n }\n\n /**\n * Handles user-initiated toggling the open state.\n *\n * @param [force] If specified, forces the open state to the given one.\n */\n protected _handleUserInitiatedToggle(force: boolean = !this.open) {\n const { eventBeforeToggle, eventToggle } = this\n .constructor as typeof CDSDropdown;\n\n const { disabled } = this;\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n open: force,\n },\n };\n if (!disabled) {\n if (this.dispatchEvent(new CustomEvent(eventBeforeToggle, init))) {\n this.open = force;\n if (this.open) {\n this._assistiveStatusText = this.selectingItemsAssistiveText;\n } else {\n const {\n selectedItemAssistiveText,\n label,\n _assistiveStatusText: assistiveStatusText,\n _selectedItemContent: selectedItemContent,\n } = this;\n const selectedItemText =\n (selectedItemContent && selectedItemContent.textContent) || label;\n if (\n selectedItemText &&\n assistiveStatusText !== selectedItemAssistiveText\n ) {\n this._assistiveStatusText = selectedItemText;\n }\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSDropdown).selectorItemHighlighted\n ),\n (item) => {\n (item as CDSDropdownItem).highlighted = false;\n }\n );\n }\n this.requestUpdate();\n this.dispatchEvent(new CustomEvent(eventToggle, init));\n }\n }\n }\n\n /**\n * Clears the selection of dropdown items.\n */\n protected _clearHighlight() {\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSDropdown).selectorItem\n ),\n (item) => {\n (item as CDSDropdownItem).highlighted = false;\n }\n );\n }\n\n /**\n * Navigate through dropdown items.\n *\n * @param direction `-1` to navigate backward, `1` to navigate forward.\n */\n protected _navigate(direction: number) {\n const constructor = this.constructor as typeof CDSDropdown;\n const items = this.querySelectorAll(constructor.selectorItem);\n const highlightedItem = this.querySelector(\n constructor.selectorItemHighlighted\n );\n const highlightedIndex = indexOf(items, highlightedItem!);\n let nextIndex = highlightedIndex + direction;\n\n if (items[nextIndex]?.hasAttribute('disabled')) {\n nextIndex += direction;\n }\n if (nextIndex < 0) {\n nextIndex = items.length - 1;\n }\n if (nextIndex >= items.length) {\n nextIndex = 0;\n }\n forEach(items, (item, i) => {\n (item as CDSDropdownItem).highlighted = i === nextIndex;\n });\n\n const nextItem = items[nextIndex];\n // Using `{ block: 'nearest' }` to prevent scrolling unless scrolling is absolutely necessary.\n // `scrollIntoViewOptions` seems to work in latest Safari despite of MDN/caniuse table.\n // IE falls back to the old behavior.\n nextItem.scrollIntoView({ block: 'nearest' });\n\n const nextItemText = nextItem.textContent;\n if (nextItemText) {\n this._assistiveStatusText = nextItemText;\n }\n this.requestUpdate();\n }\n\n /* eslint-disable class-methods-use-this */\n /**\n * @returns The content preceding the trigger button.\n */\n protected _renderPrecedingLabel(): TemplateResult | void {\n return undefined;\n }\n /* eslint-enable class-methods-use-this */\n\n /**\n * @returns The main content of the trigger button.\n */\n protected _renderLabel(): TemplateResult {\n const { label, _selectedItemContent: selectedItemContent } = this;\n return html`\n <span id=\"trigger-label\" class=\"${prefix}--list-box__label\"\n >${selectedItemContent || label}</span\n >\n `;\n }\n\n /* eslint-disable class-methods-use-this */\n /**\n * @returns The content following the trigger button.\n */\n protected _renderFollowingLabel(): TemplateResult | void {\n return undefined;\n }\n /* eslint-enable class-methods-use-this */\n\n /**\n * Handles event to include selected value on the parent form.\n *\n * @param event The event.\n */\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * 'aria-label' of the ListBox component.\n * Specify a label to be read by screen readers on the container node\n */\n @property({ type: String, reflect: true, attribute: 'aria-label' })\n ariaLabel = '';\n\n /**\n * Specify the direction of the dropdown. Can be either top or bottom.\n */\n @property({ type: Boolean, reflect: true })\n direction = false;\n\n /**\n * `true` if this dropdown should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Specify whether the title text should be hidden or not\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-label' })\n hideLabel = false;\n\n /**\n * `true` to show the UI of the invalid state.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * Message which is displayed if the value is invalid.\n */\n @property({ attribute: 'invalid-text' })\n invalidText = '';\n\n /**\n * Provide the title text that will be read by a screen reader when visiting this control\n */\n @property({ attribute: 'title-text' })\n titleText = '';\n\n /**\n * Name for the dropdown in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * `true` if this dropdown should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Whether or not the Dropdown is readonly\n */\n @property({ type: Boolean, reflect: true, attribute: 'read-only' })\n readOnly = false;\n\n /**\n * `true` if the value is required.\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * An assistive text for screen reader to announce, telling the open state.\n */\n @property({ attribute: 'selecting-items-assistive-text' })\n selectingItemsAssistiveText =\n 'Selecting items. Use up and down arrow keys to navigate.';\n\n /**\n * An assistive text for screen reader to announce, telling that an item is selected.\n */\n @property({ attribute: 'selected-item-assistive-text' })\n selectedItemAssistiveText = 'Selected an item.';\n\n /**\n * Dropdown size.\n */\n @property({ reflect: true })\n size = DROPDOWN_SIZE.REGULAR;\n\n /**\n * The `aria-label` attribute for the UI indicating the closed state.\n */\n @property({ attribute: 'toggle-label-closed' })\n toggleLabelClosed = '';\n\n /**\n * The `aria-label` attribute for the UI indicating the open state.\n */\n @property({ attribute: 'toggle-label-open' })\n toggleLabelOpen = '';\n\n /**\n * Generic label that will be used as the textual representation of what this field is for\n */\n @property({ attribute: 'label' })\n label = '';\n\n /**\n * `true` if this dropdown should use the inline UI variant.\n */\n @property({ reflect: true })\n type = DROPDOWN_TYPE.REGULAR;\n\n /**\n * The validity message.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the selected item.\n */\n @property({ reflect: true })\n value = '';\n\n /**\n * Specify whether the control is currently in warning state\n */\n @property({ type: Boolean, reflect: true })\n warn = false;\n\n /**\n * Provide the text that is displayed when the control is in warning state\n */\n @property({ attribute: 'warn-text' })\n warnText = '';\n\n shouldUpdate(changedProperties) {\n const { selectorItem } = this.constructor as typeof CDSDropdown;\n if (changedProperties.has('size')) {\n forEach(this.querySelectorAll(selectorItem), (elem) => {\n (elem as CDSDropdownItem).size = this.size;\n });\n }\n if (changedProperties.has('value')) {\n // `<cds-multi-select>` updates selection beforehand\n // because our rendering logic for `<cds-multi-select>` looks for selected items via `qSA()`\n forEach(this.querySelectorAll(selectorItem), (elem) => {\n (elem as CDSDropdownItem).selected =\n (elem as CDSDropdownItem).value === this.value;\n });\n const item = find(\n this.querySelectorAll(selectorItem),\n (elem) => (elem as CDSDropdownItem).value === this.value\n );\n if (item) {\n const range = this.ownerDocument!.createRange();\n range.selectNodeContents(item);\n this._selectedItemContent = range.cloneContents();\n } else {\n this._selectedItemContent = null;\n }\n }\n return true;\n }\n\n updated(changedProperties) {\n const { helperText, type } = this;\n const inline = type === DROPDOWN_TYPE.INLINE;\n const { selectorItem } = this.constructor as typeof CDSDropdown;\n if (changedProperties.has('disabled') && this.disabled) {\n const { disabled } = this;\n // Propagate `disabled` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(this.querySelectorAll(selectorItem), (elem) => {\n (elem as CDSDropdownItem).disabled = disabled;\n });\n }\n if (\n (changedProperties.has('helperText') || changedProperties.has('type')) &&\n helperText &&\n inline\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n 'Found `helperText` property/attribute usage in inline mode, that is not supported, at:',\n this\n );\n }\n }\n\n render() {\n const {\n ariaLabel,\n disabled,\n helperText,\n hideLabel,\n invalid,\n invalidText,\n open,\n toggleLabelClosed,\n toggleLabelOpen,\n size,\n titleText,\n type,\n warn,\n warnText,\n _assistiveStatusText: assistiveStatusText,\n _shouldTriggerBeFocusable: shouldTriggerBeFocusable,\n _handleClickInner: handleClickInner,\n _handleKeydownInner: handleKeydownInner,\n _handleKeypressInner: handleKeypressInner,\n _handleSlotchangeHelperText: handleSlotchangeHelperText,\n _handleSlotchangeLabelText: handleSlotchangeLabelText,\n _slotHelperTextNode: slotHelperTextNode,\n _slotTitleTextNode: slotTitleTextNode,\n } = this;\n const inline = type === DROPDOWN_TYPE.INLINE;\n const selectedItemsCount = this.querySelectorAll(\n (this.constructor as typeof CDSDropdown).selectorItemSelected\n ).length;\n const classes = classMap({\n [`${prefix}--dropdown`]: true,\n [`${prefix}--list-box`]: true,\n [`${prefix}--list-box--disabled`]: disabled,\n [`${prefix}--list-box--inline`]: inline,\n [`${prefix}--list-box--expanded`]: open,\n [`${prefix}--list-box--${size}`]: size,\n [`${prefix}--dropdown--invalid`]: invalid,\n [`${prefix}--dropdown--warn`]: warn,\n [`${prefix}--dropdown--inline`]: inline,\n [`${prefix}--dropdown--selected`]: selectedItemsCount > 0,\n });\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: disabled,\n [`${prefix}--visually-hidden`]: hideLabel,\n });\n const helperClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: disabled,\n });\n const iconContainerClasses = classMap({\n [`${prefix}--list-box__menu-icon`]: true,\n [`${prefix}--list-box__menu-icon--open`]: open,\n });\n const toggleLabel =\n (open ? toggleLabelOpen : toggleLabelClosed) || undefined;\n const hasHelperText =\n helperText ||\n (slotHelperTextNode && slotHelperTextNode.assignedNodes().length > 0);\n const hasTitleText =\n titleText ||\n (slotTitleTextNode && slotTitleTextNode.assignedNodes().length > 0);\n const validityIcon = !invalid\n ? undefined\n : WarningFilled16({\n class: `${prefix}--list-box__invalid-icon`,\n 'aria-label': toggleLabel,\n });\n const warningIcon =\n !warn || (invalid && warn)\n ? undefined\n : WarningAltFilled16({\n class: `${prefix}--list-box__invalid-icon ${prefix}--list-box__invalid-icon--warning`,\n 'aria-label': toggleLabel,\n });\n const helperMessage = invalid ? invalidText : warn ? warnText : helperText;\n const menuBody = !open\n ? undefined\n : html`\n <div\n aria-label=\"${ariaLabel}\"\n id=\"menu-body\"\n part=\"menu-body\"\n class=\"${prefix}--list-box__menu\"\n role=\"listbox\"\n tabindex=\"-1\">\n <slot></slot>\n </div>\n `;\n return html`\n <label\n part=\"title-text\"\n class=\"${labelClasses}\"\n ?hidden=\"${!hasTitleText}\">\n <slot name=\"title-text\" @slotchange=\"${handleSlotchangeLabelText}\"\n >${titleText}</slot\n >\n </label>\n <div\n role=\"listbox\"\n class=\"${classes}\"\n ?data-invalid=${invalid}\n @click=${handleClickInner}\n @keydown=${handleKeydownInner}\n @keypress=${handleKeypressInner}>\n <div\n part=\"trigger-button\"\n role=\"${ifDefined(!shouldTriggerBeFocusable ? undefined : 'button')}\"\n class=\"${prefix}--list-box__field\"\n tabindex=\"${ifDefined(!shouldTriggerBeFocusable ? undefined : '0')}\"\n aria-labelledby=\"trigger-label\"\n aria-expanded=\"${String(open)}\"\n aria-haspopup=\"listbox\"\n aria-owns=\"menu-body\"\n aria-controls=\"menu-body\">\n ${this._renderPrecedingLabel()}${this._renderLabel()}${validityIcon}${warningIcon}${this._renderFollowingLabel()}\n <div id=\"trigger-caret\" class=\"${iconContainerClasses}\">\n ${ChevronDown16({ 'aria-label': toggleLabel })}\n </div>\n </div>\n ${menuBody}\n </div>\n <div\n part=\"helper-text\"\n class=\"${helperClasses}\"\n ?hidden=\"${(inline && !warn && !invalid) || !hasHelperText}\">\n <slot name=\"helper-text\" @slotchange=\"${handleSlotchangeHelperText}\"\n >${helperMessage}</slot\n >\n </div>\n <div\n class=\"${prefix}--assistive-text\"\n role=\"status\"\n aria-live=\"assertive\"\n aria-relevant=\"additions text\">\n ${assistiveStatusText}\n </div>\n `;\n }\n\n /**\n * Symbols of keys that triggers opening/closing menu and selecting/deselecting menu item.\n */\n static TRIGGER_KEYS = new Set([' ', 'Enter']);\n\n /**\n * A selector that will return highlighted items.\n */\n static get selectorItemHighlighted() {\n return `${prefix}-dropdown-item[highlighted]`;\n }\n\n /**\n * A selector that will return dropdown items.\n */\n static get selectorItem() {\n return `${prefix}-dropdown-item`;\n }\n\n /**\n * A selector that will return selected items.\n */\n static get selectorItemSelected() {\n return `${prefix}-dropdown-item[selected]`;\n }\n\n /**\n * The name of the custom event fired before a dropdown item is selected upon a user gesture.\n * Cancellation of this event stops changing the user-initiated selection.\n */\n static get eventBeforeSelect() {\n return `${prefix}-dropdown-beingselected`;\n }\n\n /**\n * The name of the custom event fired after a a dropdown item is selected upon a user gesture.\n */\n static get eventSelect() {\n return `${prefix}-dropdown-selected`;\n }\n\n /**\n * The name of the custom event fired before this dropdown item is being toggled upon a user gesture.\n * Cancellation of this event stops the user-initiated action of toggling this dropdown item.\n */\n static get eventBeforeToggle() {\n return `${prefix}-dropdown-beingtoggled`;\n }\n\n /**\n * The name of the custom event fired after this dropdown item is toggled upon a user gesture.\n */\n static get eventToggle() {\n return `${prefix}-dropdown-toggled`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n\n /**\n * @returns A action for dropdown for the given key symbol.\n */\n static getAction(key: string) {\n if (key === 'Escape') {\n return DROPDOWN_KEYBOARD_ACTION.CLOSING;\n }\n if (key in NAVIGATION_DIRECTION) {\n return DROPDOWN_KEYBOARD_ACTION.NAVIGATING;\n }\n if (this.TRIGGER_KEYS.has(key)) {\n return DROPDOWN_KEYBOARD_ACTION.TRIGGERING;\n }\n return DROPDOWN_KEYBOARD_ACTION.NONE;\n }\n}\n\nexport default CDSDropdown;\n"]}
|
|
1
|
+
{"version":3,"sources":["components/dropdown/dropdown.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,UAAU,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAgBvD,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,oBAAoB,EACrB,MAAM,QAAQ,CAAC;AAChB,OAAO,eAAe,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,oBAAoB,GACrB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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d,YAAY,CAAC,iBAAiB,KAAA;IAwC9B;;OAEG;IACH,SAAS,KAAK,QAAQ,mHAoBrB;IAED,MAAM;IA4GN;;OAEG;IACH,MAAM,CAAC,YAAY,cAA2B;IAE9C;;OAEG;IACH,MAAM,KAAK,uBAAuB,WAEjC;IAED;;OAEG;IACH,MAAM,KAAK,YAAY,WAEtB;IAED;;OAEG;IACH,MAAM,KAAK,oBAAoB,WAE9B;IAED;;;OAGG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED;;;OAGG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED,MAAM,CAAC,iBAAiB;;;;MAGtB;IACF,MAAM,CAAC,MAAM,MAAU;IAEvB;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM;CAY7B;AAED,eAAe,WAAW,CAAC","file":"dropdown.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\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 { ifDefined } from 'lit/directives/if-defined.js';\nimport { LitElement, html, TemplateResult } from 'lit';\nimport { property, customElement, query } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport ChevronDown16 from '@carbon/icons/lib/chevron--down/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport WarningAltFilled16 from '@carbon/icons/lib/warning--alt--filled/16';\nimport FocusMixin from '../../globals/mixins/focus';\nimport FormMixin from '../../globals/mixins/form';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport HostListener from '../../globals/decorators/host-listener';\nimport {\n find,\n forEach,\n indexOf,\n} from '../../globals/internal/collection-helpers';\nimport {\n DROPDOWN_DIRECTION,\n DROPDOWN_KEYBOARD_ACTION,\n DROPDOWN_SIZE,\n DROPDOWN_TYPE,\n NAVIGATION_DIRECTION,\n} from './defs';\nimport CDSDropdownItem from './dropdown-item';\nimport styles from './dropdown.scss';\n\nexport {\n DROPDOWN_KEYBOARD_ACTION,\n DROPDOWN_DIRECTION,\n DROPDOWN_SIZE,\n DROPDOWN_TYPE,\n NAVIGATION_DIRECTION,\n};\n\n/**\n * Dropdown.\n *\n * @element cds-dropdown\n * @csspart label-text The label text.\n * @csspart helper-text The helper text.\n * @csspart trigger-button The trigger button.\n * @csspart menu-body The menu body.\n * @csspart validity-message The validity message.\n * @fires cds-dropdown-beingselected\n * The custom event fired before a dropdown item is selected upon a user gesture.\n * Cancellation of this event stops changing the user-initiated selection.\n * @fires cds-dropdown-beingtoggled\n * The custom event fired before the open state of this dropdown is toggled upon a user gesture.\n * Cancellation of this event stops the user-initiated toggling.\n * @fires cds-dropdown-selected - The custom event fired after a dropdown item is selected upon a user gesture.\n * @fires cds-dropdown-toggled - The custom event fired after the open state of this dropdown is toggled upon a user gesture.\n */\n@customElement(`${prefix}-dropdown`)\nclass CDSDropdown extends ValidityMixin(\n HostListenerMixin(FormMixin(FocusMixin(LitElement)))\n) {\n /**\n * The latest status of this dropdown, for screen reader to accounce.\n */\n protected _assistiveStatusText?: string;\n\n /**\n * The content of the selected item.\n */\n protected _selectedItemContent: DocumentFragment | null = null;\n\n /**\n * `true` if the trigger button should be focusable.\n * Derived class can set `false` to this if the trigger button contains another primary focusable element (e.g. `<input>`).\n */\n protected _shouldTriggerBeFocusable = true;\n\n /**\n * The list box `<div>` node.\n */\n @query(`.${prefix}--list-box`)\n protected _listBoxNode!: HTMLDivElement;\n\n /**\n * The `<slot>` element for the helper text in the shadow DOM.\n */\n @query('slot[name=\"helper-text\"]')\n protected _slotHelperTextNode!: HTMLSlotElement;\n\n /**\n * The `<slot>` element for the title text in the shadow DOM.\n */\n @query('slot[name=\"title-text\"]')\n protected _slotTitleTextNode!: HTMLSlotElement;\n\n /**\n * @param itemToSelect A dropdown item. Absense of this argument means clearing selection.\n * @returns `true` if the selection of this dropdown should change if the given item is selected upon user interaction.\n */\n protected _selectionShouldChange(itemToSelect?: CDSDropdownItem) {\n return !itemToSelect || itemToSelect.value !== this.value;\n }\n\n /**\n * A callback that runs after change in dropdown selection upon user interaction is confirmed.\n *\n * @param itemToSelect\n * A dropdown item.\n * Absense of this argument means clearing selection, which may be handled by a derived class.\n */\n protected _selectionDidChange(itemToSelect?: CDSDropdownItem) {\n if (itemToSelect) {\n this.value = itemToSelect.value;\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSDropdown).selectorItemSelected\n ),\n (item) => {\n (item as CDSDropdownItem).selected = false;\n }\n );\n itemToSelect.selected = true;\n this._assistiveStatusText = this.selectedItemAssistiveText;\n this._handleUserInitiatedToggle(false);\n }\n }\n\n /**\n * Handles `click` event on the top-level element in the shadow DOM.\n *\n * @param event The event.\n */\n protected _handleClickInner(event: MouseEvent) {\n if (this.readOnly) {\n return;\n }\n\n if (this.shadowRoot!.contains(event.target as Node)) {\n this._handleUserInitiatedToggle();\n } else {\n const item = (event.target as Element).closest(\n (this.constructor as typeof CDSDropdown).selectorItem\n ) as CDSDropdownItem;\n if (this.contains(item)) {\n this._handleUserInitiatedSelectItem(item);\n }\n }\n }\n\n /**\n * Handler for the `keydown` event on the top-level element in the shadow DOM.\n */\n protected _handleKeydownInner(event: KeyboardEvent) {\n const { key } = event;\n const action = (this.constructor as typeof CDSDropdown).getAction(key);\n if (!this.open) {\n switch (action) {\n case DROPDOWN_KEYBOARD_ACTION.NAVIGATING:\n this._handleUserInitiatedToggle(true);\n // If this menu gets open with an arrow key, reset the highlight\n this._clearHighlight();\n break;\n default:\n break;\n }\n } else {\n switch (action) {\n case DROPDOWN_KEYBOARD_ACTION.CLOSING:\n this._handleUserInitiatedToggle(false);\n break;\n case DROPDOWN_KEYBOARD_ACTION.NAVIGATING:\n this._navigate(NAVIGATION_DIRECTION[key]);\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Handler for the `keypress` event on the top-level element in the shadow DOM.\n */\n protected _handleKeypressInner(event: KeyboardEvent) {\n const { key } = event;\n const action = (this.constructor as typeof CDSDropdown).getAction(key);\n if (!this.open) {\n switch (action) {\n case DROPDOWN_KEYBOARD_ACTION.TRIGGERING:\n this._handleUserInitiatedToggle(true);\n break;\n default:\n break;\n }\n } else {\n switch (action) {\n case DROPDOWN_KEYBOARD_ACTION.TRIGGERING:\n {\n const constructor = this.constructor as typeof CDSDropdown;\n const highlightedItem = this.querySelector(\n constructor.selectorItemHighlighted\n ) as CDSDropdownItem;\n if (highlightedItem) {\n this._handleUserInitiatedSelectItem(highlightedItem);\n } else {\n this._handleUserInitiatedToggle(false);\n }\n }\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Handles `blur` event handler on the document this element is in.\n *\n * @param event The event.\n */\n @HostListener('focusout')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n protected _handleFocusOut(event: FocusEvent) {\n if (!this.contains(event.relatedTarget as Node)) {\n this._handleUserInitiatedToggle(false);\n }\n }\n\n /**\n * Handles `slotchange` event for the `<slot>` for helper text.\n */\n protected _handleSlotchangeHelperText() {\n this.requestUpdate();\n }\n\n /**\n * Handles `slotchange` event for the `<slot>` for label text.\n */\n protected _handleSlotchangeLabelText() {\n this.requestUpdate();\n }\n\n /**\n * Handles user-initiated selection of a dropdown item.\n *\n * @param [item] The dropdown item user wants to select. Absense of this argument means clearing selection.\n */\n protected _handleUserInitiatedSelectItem(item?: CDSDropdownItem) {\n if (item?.hasAttribute('disabled')) {\n return;\n }\n\n if (this._selectionShouldChange(item)) {\n const init = {\n bubbles: true,\n composed: true,\n detail: {\n item,\n },\n };\n const constructor = this.constructor as typeof CDSDropdown;\n const beforeSelectEvent = new CustomEvent(constructor.eventBeforeSelect, {\n ...init,\n cancelable: true,\n });\n if (this.dispatchEvent(beforeSelectEvent)) {\n this._selectionDidChange(item);\n const afterSelectEvent = new CustomEvent(constructor.eventSelect, init);\n this.dispatchEvent(afterSelectEvent);\n }\n }\n }\n\n /**\n * Handles user-initiated toggling the open state.\n *\n * @param [force] If specified, forces the open state to the given one.\n */\n protected _handleUserInitiatedToggle(force: boolean = !this.open) {\n const { eventBeforeToggle, eventToggle } = this\n .constructor as typeof CDSDropdown;\n\n const { disabled } = this;\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n open: force,\n },\n };\n if (!disabled) {\n if (this.dispatchEvent(new CustomEvent(eventBeforeToggle, init))) {\n this.open = force;\n if (this.open) {\n this._assistiveStatusText = this.selectingItemsAssistiveText;\n } else {\n const {\n selectedItemAssistiveText,\n label,\n _assistiveStatusText: assistiveStatusText,\n _selectedItemContent: selectedItemContent,\n } = this;\n const selectedItemText =\n (selectedItemContent && selectedItemContent.textContent) || label;\n if (\n selectedItemText &&\n assistiveStatusText !== selectedItemAssistiveText\n ) {\n this._assistiveStatusText = selectedItemText;\n }\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSDropdown).selectorItemHighlighted\n ),\n (item) => {\n (item as CDSDropdownItem).highlighted = false;\n }\n );\n }\n this.requestUpdate();\n this.dispatchEvent(new CustomEvent(eventToggle, init));\n }\n }\n }\n\n /**\n * Clears the selection of dropdown items.\n */\n protected _clearHighlight() {\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSDropdown).selectorItem\n ),\n (item) => {\n (item as CDSDropdownItem).highlighted = false;\n }\n );\n }\n\n /**\n * Navigate through dropdown items.\n *\n * @param direction `-1` to navigate backward, `1` to navigate forward.\n */\n protected _navigate(direction: number) {\n const constructor = this.constructor as typeof CDSDropdown;\n const items = this.querySelectorAll(constructor.selectorItem);\n const highlightedItem = this.querySelector(\n constructor.selectorItemHighlighted\n );\n const highlightedIndex = indexOf(items, highlightedItem!);\n let nextIndex = highlightedIndex + direction;\n\n if (items[nextIndex]?.hasAttribute('disabled')) {\n nextIndex += direction;\n }\n if (nextIndex < 0) {\n nextIndex = items.length - 1;\n }\n if (nextIndex >= items.length) {\n nextIndex = 0;\n }\n forEach(items, (item, i) => {\n (item as CDSDropdownItem).highlighted = i === nextIndex;\n });\n\n const nextItem = items[nextIndex];\n // Using `{ block: 'nearest' }` to prevent scrolling unless scrolling is absolutely necessary.\n // `scrollIntoViewOptions` seems to work in latest Safari despite of MDN/caniuse table.\n // IE falls back to the old behavior.\n nextItem.scrollIntoView({ block: 'nearest' });\n\n const nextItemText = nextItem.textContent;\n if (nextItemText) {\n this._assistiveStatusText = nextItemText;\n }\n this.requestUpdate();\n }\n\n /* eslint-disable class-methods-use-this */\n /**\n * @returns The content preceding the trigger button.\n */\n protected _renderPrecedingLabel(): TemplateResult | void {\n return undefined;\n }\n /* eslint-enable class-methods-use-this */\n\n /**\n * @returns The main content of the trigger button.\n */\n protected _renderLabel(): TemplateResult {\n const { label, _selectedItemContent: selectedItemContent } = this;\n return html`\n <span id=\"trigger-label\" class=\"${prefix}--list-box__label\"\n >${selectedItemContent || label}</span\n >\n `;\n }\n\n /**\n * @returns The title label.\n */\n protected _renderTitleLabel(): TemplateResult {\n const {\n disabled,\n hideLabel,\n titleText,\n _slotTitleTextNode: slotTitleTextNode,\n _handleSlotchangeLabelText: handleSlotchangeLabelText,\n } = this;\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: disabled,\n [`${prefix}--visually-hidden`]: hideLabel,\n });\n\n const hasTitleText =\n titleText ||\n (slotTitleTextNode && slotTitleTextNode.assignedNodes().length > 0);\n\n return html`\n <label\n part=\"title-text\"\n class=\"${labelClasses}\"\n ?hidden=\"${!hasTitleText}\">\n <slot name=\"title-text\" @slotchange=\"${handleSlotchangeLabelText}\"\n >${titleText}</slot\n >\n </label>\n `;\n }\n\n /* eslint-disable class-methods-use-this */\n /**\n * @returns The content following the trigger button.\n */\n protected _renderFollowingLabel(): TemplateResult | void {\n return undefined;\n }\n /* eslint-enable class-methods-use-this */\n\n /**\n * Handles event to include selected value on the parent form.\n *\n * @param event The event.\n */\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * 'aria-label' of the ListBox component.\n * Specify a label to be read by screen readers on the container node\n */\n @property({ type: String, reflect: true, attribute: 'aria-label' })\n ariaLabel = '';\n\n /**\n * Specify the direction of the dropdown. Can be either top or bottom.\n */\n @property({ type: String, reflect: true })\n direction = DROPDOWN_DIRECTION.BOTTOM;\n\n /**\n * `true` if this dropdown should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Specify whether the title text should be hidden or not\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-label' })\n hideLabel = false;\n\n /**\n * `true` to show the UI of the invalid state.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * Message which is displayed if the value is invalid.\n */\n @property({ attribute: 'invalid-text' })\n invalidText = '';\n\n /**\n * Provide the title text that will be read by a screen reader when visiting this control\n */\n @property({ attribute: 'title-text' })\n titleText = '';\n\n /**\n * Name for the dropdown in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * `true` if this dropdown should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Whether or not the Dropdown is readonly\n */\n @property({ type: Boolean, reflect: true, attribute: 'read-only' })\n readOnly = false;\n\n /**\n * `true` if the value is required.\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * An assistive text for screen reader to announce, telling the open state.\n */\n @property({ attribute: 'selecting-items-assistive-text' })\n selectingItemsAssistiveText =\n 'Selecting items. Use up and down arrow keys to navigate.';\n\n /**\n * An assistive text for screen reader to announce, telling that an item is selected.\n */\n @property({ attribute: 'selected-item-assistive-text' })\n selectedItemAssistiveText = 'Selected an item.';\n\n /**\n * Dropdown size.\n */\n @property({ reflect: true })\n size = DROPDOWN_SIZE.MEDIUM;\n\n /**\n * The `aria-label` attribute for the UI indicating the closed state.\n */\n @property({ attribute: 'toggle-label-closed' })\n toggleLabelClosed = '';\n\n /**\n * The `aria-label` attribute for the UI indicating the open state.\n */\n @property({ attribute: 'toggle-label-open' })\n toggleLabelOpen = '';\n\n /**\n * Generic label that will be used as the textual representation of what this field is for\n */\n @property({ attribute: 'label' })\n label = '';\n\n /**\n * `true` if this dropdown should use the inline UI variant.\n */\n @property({ reflect: true })\n type = DROPDOWN_TYPE.DEFAULT;\n\n /**\n * The validity message.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the selected item.\n */\n @property({ reflect: true })\n value = '';\n\n /**\n * Specify whether the control is currently in warning state\n */\n @property({ type: Boolean, reflect: true })\n warn = false;\n\n /**\n * Provide the text that is displayed when the control is in warning state\n */\n @property({ attribute: 'warn-text' })\n warnText = '';\n\n shouldUpdate(changedProperties) {\n const { selectorItem } = this.constructor as typeof CDSDropdown;\n if (changedProperties.has('size')) {\n forEach(this.querySelectorAll(selectorItem), (elem) => {\n (elem as CDSDropdownItem).size = this.size;\n });\n }\n if (changedProperties.has('disabled') && this.disabled) {\n const { disabled } = this;\n // Propagate `disabled` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(this.querySelectorAll(selectorItem), (elem) => {\n if (disabled) {\n (elem as CDSDropdownItem).disabled = disabled;\n } else {\n (elem as CDSDropdownItem).removeAttribute('disabled');\n }\n });\n }\n if (changedProperties.has('value')) {\n // `<cds-multi-select>` updates selection beforehand\n // because our rendering logic for `<cds-multi-select>` looks for selected items via `qSA()`\n forEach(this.querySelectorAll(selectorItem), (elem) => {\n (elem as CDSDropdownItem).selected =\n (elem as CDSDropdownItem).value === this.value;\n });\n const item = find(\n this.querySelectorAll(selectorItem),\n (elem) => (elem as CDSDropdownItem).value === this.value\n );\n if (item) {\n const range = this.ownerDocument!.createRange();\n range.selectNodeContents(item);\n this._selectedItemContent = range.cloneContents();\n } else {\n this._selectedItemContent = null;\n }\n }\n return true;\n }\n\n /**\n * The CSS class list for dropdown listbox\n */\n protected get _classes() {\n const { disabled, size, type, invalid, open, warn } = this;\n const inline = type === DROPDOWN_TYPE.INLINE;\n\n const selectedItemsCount = this.querySelectorAll(\n (this.constructor as typeof CDSDropdown).selectorItemSelected\n ).length;\n\n return classMap({\n [`${prefix}--dropdown`]: true,\n [`${prefix}--list-box`]: true,\n [`${prefix}--list-box--disabled`]: disabled,\n [`${prefix}--list-box--inline`]: inline,\n [`${prefix}--list-box--expanded`]: open,\n [`${prefix}--list-box--${size}`]: size,\n [`${prefix}--dropdown--invalid`]: invalid,\n [`${prefix}--dropdown--warn`]: warn,\n [`${prefix}--dropdown--inline`]: inline,\n [`${prefix}--dropdown--selected`]: selectedItemsCount > 0,\n });\n }\n\n render() {\n const {\n ariaLabel,\n _classes: classes,\n disabled,\n helperText,\n invalid,\n invalidText,\n open,\n toggleLabelClosed,\n toggleLabelOpen,\n type,\n warn,\n warnText,\n _assistiveStatusText: assistiveStatusText,\n _shouldTriggerBeFocusable: shouldTriggerBeFocusable,\n _handleClickInner: handleClickInner,\n _handleKeydownInner: handleKeydownInner,\n _handleKeypressInner: handleKeypressInner,\n _handleSlotchangeHelperText: handleSlotchangeHelperText,\n _slotHelperTextNode: slotHelperTextNode,\n } = this;\n const inline = type === DROPDOWN_TYPE.INLINE;\n\n const helperClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: disabled,\n });\n const iconContainerClasses = classMap({\n [`${prefix}--list-box__menu-icon`]: true,\n [`${prefix}--list-box__menu-icon--open`]: open,\n });\n const toggleLabel =\n (open ? toggleLabelOpen : toggleLabelClosed) || undefined;\n const hasHelperText =\n helperText ||\n (slotHelperTextNode && slotHelperTextNode.assignedNodes().length > 0);\n const validityIcon = !invalid\n ? undefined\n : WarningFilled16({\n class: `${prefix}--list-box__invalid-icon`,\n 'aria-label': toggleLabel,\n });\n const warningIcon =\n !warn || (invalid && warn)\n ? undefined\n : WarningAltFilled16({\n class: `${prefix}--list-box__invalid-icon ${prefix}--list-box__invalid-icon--warning`,\n 'aria-label': toggleLabel,\n });\n const helperMessage = invalid ? invalidText : warn ? warnText : helperText;\n const menuBody = !open\n ? undefined\n : html`\n <div\n aria-label=\"${ariaLabel}\"\n id=\"menu-body\"\n part=\"menu-body\"\n class=\"${prefix}--list-box__menu\"\n role=\"listbox\"\n tabindex=\"-1\">\n <slot></slot>\n </div>\n `;\n return html`\n ${this._renderTitleLabel()}\n <div\n role=\"listbox\"\n class=\"${classes}\"\n ?data-invalid=${invalid}\n @click=${handleClickInner}\n @keydown=${handleKeydownInner}\n @keypress=${handleKeypressInner}>\n <div\n part=\"trigger-button\"\n role=\"${ifDefined(!shouldTriggerBeFocusable ? undefined : 'button')}\"\n class=\"${prefix}--list-box__field\"\n tabindex=\"${ifDefined(!shouldTriggerBeFocusable ? undefined : '0')}\"\n aria-labelledby=\"trigger-label\"\n aria-expanded=\"${String(open)}\"\n aria-haspopup=\"listbox\"\n aria-owns=\"menu-body\"\n aria-controls=\"menu-body\">\n ${this._renderPrecedingLabel()}${this._renderLabel()}${validityIcon}${warningIcon}${this._renderFollowingLabel()}\n <div id=\"trigger-caret\" class=\"${iconContainerClasses}\">\n ${ChevronDown16({ 'aria-label': toggleLabel })}\n </div>\n </div>\n ${menuBody}\n </div>\n <div\n part=\"helper-text\"\n class=\"${helperClasses}\"\n ?hidden=\"${(inline && !warn && !invalid) || !hasHelperText}\">\n <slot name=\"helper-text\" @slotchange=\"${handleSlotchangeHelperText}\"\n >${helperMessage}</slot\n >\n </div>\n <div\n class=\"${prefix}--assistive-text\"\n role=\"status\"\n aria-live=\"assertive\"\n aria-relevant=\"additions text\">\n ${assistiveStatusText}\n </div>\n `;\n }\n\n /**\n * Symbols of keys that triggers opening/closing menu and selecting/deselecting menu item.\n */\n static TRIGGER_KEYS = new Set([' ', 'Enter']);\n\n /**\n * A selector that will return highlighted items.\n */\n static get selectorItemHighlighted() {\n return `${prefix}-dropdown-item[highlighted]`;\n }\n\n /**\n * A selector that will return dropdown items.\n */\n static get selectorItem() {\n return `${prefix}-dropdown-item`;\n }\n\n /**\n * A selector that will return selected items.\n */\n static get selectorItemSelected() {\n return `${prefix}-dropdown-item[selected]`;\n }\n\n /**\n * The name of the custom event fired before a dropdown item is selected upon a user gesture.\n * Cancellation of this event stops changing the user-initiated selection.\n */\n static get eventBeforeSelect() {\n return `${prefix}-dropdown-beingselected`;\n }\n\n /**\n * The name of the custom event fired after a a dropdown item is selected upon a user gesture.\n */\n static get eventSelect() {\n return `${prefix}-dropdown-selected`;\n }\n\n /**\n * The name of the custom event fired before this dropdown item is being toggled upon a user gesture.\n * Cancellation of this event stops the user-initiated action of toggling this dropdown item.\n */\n static get eventBeforeToggle() {\n return `${prefix}-dropdown-beingtoggled`;\n }\n\n /**\n * The name of the custom event fired after this dropdown item is toggled upon a user gesture.\n */\n static get eventToggle() {\n return `${prefix}-dropdown-toggled`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n\n /**\n * @returns A action for dropdown for the given key symbol.\n */\n static getAction(key: string) {\n if (key === 'Escape') {\n return DROPDOWN_KEYBOARD_ACTION.CLOSING;\n }\n if (key in NAVIGATION_DIRECTION) {\n return DROPDOWN_KEYBOARD_ACTION.NAVIGATING;\n }\n if (this.TRIGGER_KEYS.has(key)) {\n return DROPDOWN_KEYBOARD_ACTION.TRIGGERING;\n }\n return DROPDOWN_KEYBOARD_ACTION.NONE;\n }\n}\n\nexport default CDSDropdown;\n"]}
|