@salesforce/design-system-react 11.0.0-alpha.9 → 11.0.0-rc.1
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 +20 -0
- package/dist/cjs/components/accordion/index.cjs.map +1 -1
- package/dist/cjs/components/accordion/panel.cjs.map +1 -1
- package/dist/cjs/components/alert/index.cjs +1 -1
- package/dist/cjs/components/alert/index.cjs.map +1 -1
- package/dist/cjs/components/builder-header/index.cjs +1 -1
- package/dist/cjs/components/builder-header/index.cjs.map +1 -1
- package/dist/cjs/components/builder-header/nav-dropdown.cjs +1 -1
- package/dist/cjs/components/builder-header/nav-dropdown.cjs.map +1 -1
- package/dist/cjs/components/builder-header/nav-link.cjs +1 -1
- package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
- package/dist/cjs/components/builder-header/nav.cjs +1 -1
- package/dist/cjs/components/builder-header/nav.cjs.map +1 -1
- package/dist/cjs/components/builder-header/toolbar.cjs +1 -1
- package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
- package/dist/cjs/components/builder-header/utilities.cjs +1 -1
- package/dist/cjs/components/builder-header/utilities.cjs.map +1 -1
- package/dist/cjs/components/button/check-props.cjs +2 -0
- package/dist/cjs/components/button/check-props.cjs.map +1 -0
- package/dist/cjs/components/button/component.cjs +2 -0
- package/dist/cjs/components/button/component.cjs.map +1 -0
- package/dist/cjs/components/button/index.cjs +1 -1
- package/dist/cjs/components/button/index.cjs.map +1 -1
- package/dist/cjs/components/button-group/index.cjs +1 -1
- package/dist/cjs/components/button-group/index.cjs.map +1 -1
- package/dist/cjs/components/button-stateful/check-props.cjs +1 -1
- package/dist/cjs/components/button-stateful/check-props.cjs.map +1 -1
- package/dist/cjs/components/button-stateful/index.cjs +1 -1
- package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
- package/dist/cjs/components/card/filter.cjs.map +1 -1
- package/dist/cjs/components/card/index.cjs +1 -1
- package/dist/cjs/components/card/index.cjs.map +1 -1
- package/dist/cjs/components/carousel/index.cjs +1 -1
- package/dist/cjs/components/carousel/index.cjs.map +1 -1
- package/dist/cjs/components/carousel/private/carousel-indicators.cjs.map +1 -1
- package/dist/cjs/components/carousel/private/carousel-item.cjs +1 -1
- package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
- package/dist/cjs/components/checkbox/check-props.cjs +1 -1
- package/dist/cjs/components/checkbox/check-props.cjs.map +1 -1
- package/dist/cjs/components/checkbox/index.cjs +1 -1
- package/dist/cjs/components/checkbox/index.cjs.map +1 -1
- package/dist/cjs/components/color-picker/check-props.cjs +1 -1
- package/dist/cjs/components/color-picker/check-props.cjs.map +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/color-picker-tabs.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/custom-color-form.cjs +1 -1
- package/dist/cjs/components/color-picker/private/custom-color-form.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/custom-color.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/hsv-color.cjs +1 -1
- package/dist/cjs/components/color-picker/private/hsv-color.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/swatch-option.cjs +1 -1
- package/dist/cjs/components/color-picker/private/swatch-option.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/swatch-picker.cjs +1 -1
- package/dist/cjs/components/color-picker/private/swatch-picker.cjs.map +1 -1
- package/dist/cjs/components/color-picker/private/swatch.cjs +1 -1
- package/dist/cjs/components/color-picker/private/swatch.cjs.map +1 -1
- package/dist/cjs/components/combobox/check-props.cjs +1 -1
- package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
- package/dist/cjs/components/combobox/combobox.cjs +1 -1
- package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
- package/dist/cjs/components/combobox/component.cjs +1 -1
- package/dist/cjs/components/combobox/component.cjs.map +1 -1
- package/dist/cjs/components/combobox/index.cjs +1 -1
- package/dist/cjs/components/combobox/index.cjs.map +1 -1
- package/dist/cjs/components/combobox/private/menu.cjs +1 -1
- package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
- package/dist/cjs/components/date-picker/check-props.cjs +1 -1
- package/dist/cjs/components/date-picker/check-props.cjs.map +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/cjs/components/date-picker/index.cjs.map +1 -1
- package/dist/cjs/components/date-picker/private/calendar-wrapper.cjs +1 -1
- package/dist/cjs/components/date-picker/private/calendar-wrapper.cjs.map +1 -1
- package/dist/cjs/components/date-picker/private/calendar.cjs.map +1 -1
- package/dist/cjs/components/date-picker/private/day.cjs +1 -1
- package/dist/cjs/components/date-picker/private/day.cjs.map +1 -1
- package/dist/cjs/components/date-picker/private/week.cjs.map +1 -1
- package/dist/cjs/components/date-picker/private/year-picklist.cjs.map +1 -1
- package/dist/cjs/components/docked-composer/index.cjs +1 -1
- package/dist/cjs/components/docked-composer/index.cjs.map +1 -1
- package/dist/cjs/components/dynamic-icon/index.cjs +1 -1
- package/dist/cjs/components/dynamic-icon/index.cjs.map +1 -1
- package/dist/cjs/components/expandable-section/index.cjs +1 -1
- package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
- package/dist/cjs/components/files/file.cjs +1 -8
- package/dist/cjs/components/files/file.cjs.map +1 -1
- package/dist/cjs/components/files/index.cjs +1 -1
- package/dist/cjs/components/files/index.cjs.map +1 -1
- package/dist/cjs/components/files/private/file-actions.cjs +1 -1
- package/dist/cjs/components/files/private/file-actions.cjs.map +1 -1
- package/dist/cjs/components/files/private/file-figure.cjs +1 -1
- package/dist/cjs/components/files/private/file-figure.cjs.map +1 -1
- package/dist/cjs/components/filter/filter.cjs +1 -1
- package/dist/cjs/components/filter/filter.cjs.map +1 -1
- package/dist/cjs/components/filter/private/error-id-context.cjs +2 -0
- package/dist/cjs/components/filter/private/error-id-context.cjs.map +1 -0
- package/dist/cjs/components/grid/index.cjs +1 -1
- package/dist/cjs/components/grid/index.cjs.map +1 -1
- package/dist/cjs/components/icon/button-icon/index.cjs +1 -1
- package/dist/cjs/components/icon/button-icon/index.cjs.map +1 -1
- package/dist/cjs/components/icon/check-props.cjs +2 -0
- package/dist/cjs/components/icon/check-props.cjs.map +1 -0
- package/dist/cjs/components/icon/component.cjs +2 -0
- package/dist/cjs/components/icon/component.cjs.map +1 -0
- package/dist/cjs/components/icon/index.cjs +1 -1
- package/dist/cjs/components/icon/index.cjs.map +1 -1
- package/dist/cjs/components/icon/input-icon/index.cjs +1 -1
- package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/input/check-props.cjs +1 -1
- package/dist/cjs/components/input/check-props.cjs.map +1 -1
- package/dist/cjs/components/input/index.cjs +1 -1
- package/dist/cjs/components/input/index.cjs.map +1 -1
- package/dist/cjs/components/input/private/inner-input.cjs +1 -1
- package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
- package/dist/cjs/components/input/search.cjs +1 -1
- package/dist/cjs/components/input/search.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/button-trigger.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/check-props.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/check-props.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
- package/dist/cjs/components/modal/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/check-props.cjs +1 -1
- package/dist/cjs/components/page-header/check-props.cjs.map +1 -1
- package/dist/cjs/components/page-header/control.cjs.map +1 -1
- package/dist/cjs/components/page-header/index.cjs +1 -1
- package/dist/cjs/components/page-header/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/base/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/base/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/controls.cjs +1 -1
- package/dist/cjs/components/page-header/private/controls.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/detail-block.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/detail-row.cjs +1 -1
- package/dist/cjs/components/page-header/private/detail-row.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/info.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/object-home/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/object-home/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/record-home/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/record-home/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/related-list/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/related-list/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/title.cjs +1 -1
- package/dist/cjs/components/page-header/private/title.cjs.map +1 -1
- package/dist/cjs/components/panel/filtering/check-props.cjs +1 -1
- package/dist/cjs/components/panel/filtering/check-props.cjs.map +1 -1
- package/dist/cjs/components/panel/filtering/group.cjs +1 -1
- package/dist/cjs/components/panel/filtering/group.cjs.map +1 -1
- package/dist/cjs/components/panel/filtering/list.cjs +1 -1
- package/dist/cjs/components/panel/filtering/list.cjs.map +1 -1
- package/dist/cjs/components/pill/index.cjs +1 -1
- package/dist/cjs/components/pill/index.cjs.map +1 -1
- package/dist/cjs/components/pill-container/index.cjs +1 -1
- package/dist/cjs/components/pill-container/index.cjs.map +1 -1
- package/dist/cjs/components/pill-container/private/selected-listbox.cjs.map +1 -1
- package/dist/cjs/components/popover/edit-dialog.cjs +1 -1
- package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
- package/dist/cjs/components/popover/index.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/check-props.cjs +1 -1
- package/dist/cjs/components/progress-indicator/check-props.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/index.cjs +1 -1
- package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/private/step-vertical.cjs +1 -1
- package/dist/cjs/components/progress-indicator/private/step-vertical.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/private/step.cjs +1 -1
- package/dist/cjs/components/progress-indicator/private/step.cjs.map +1 -1
- package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
- package/dist/cjs/components/radio/check-props.cjs +1 -1
- package/dist/cjs/components/radio/check-props.cjs.map +1 -1
- package/dist/cjs/components/radio/index.cjs +1 -1
- package/dist/cjs/components/radio/index.cjs.map +1 -1
- package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
- package/dist/cjs/components/radio-button-group/radio.cjs.map +1 -1
- package/dist/cjs/components/radio-group/index.cjs +1 -1
- package/dist/cjs/components/radio-group/index.cjs.map +1 -1
- package/dist/cjs/components/scoped-notification/check-props.cjs +2 -0
- package/dist/cjs/components/scoped-notification/check-props.cjs.map +1 -0
- package/dist/cjs/components/scoped-notification/component.cjs +2 -0
- package/dist/cjs/components/scoped-notification/component.cjs.map +1 -0
- package/dist/cjs/components/scoped-notification/index.cjs +1 -1
- package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/index.cjs +1 -1
- package/dist/cjs/components/setup-assistant/index.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/step.cjs +1 -1
- package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/cell.cjs +1 -1
- package/dist/cjs/components/simple-data-table/cell.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
- package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/column-check-props.cjs +1 -1
- package/dist/cjs/components/simple-data-table/column-check-props.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/column.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/interactive-element.cjs +1 -1
- package/dist/cjs/components/simple-data-table/interactive-element.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/cell-context.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/corner-style.cjs +2 -0
- package/dist/cjs/components/simple-data-table/private/corner-style.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/private/head.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/header-cell.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/link.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/link.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/row.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/private/table-context.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/table-context.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/row-actions.cjs +1 -1
- package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -1
- package/dist/cjs/components/slider/index.cjs.map +1 -1
- package/dist/cjs/components/spinner/check-props.cjs +1 -1
- package/dist/cjs/components/spinner/check-props.cjs.map +1 -1
- package/dist/cjs/components/spinner/index.cjs +1 -1
- package/dist/cjs/components/spinner/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/header.cjs.map +1 -1
- package/dist/cjs/components/split-view/listbox.cjs +1 -1
- package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
- package/dist/cjs/components/split-view/private/list-item-content.cjs.map +1 -1
- package/dist/cjs/components/split-view/private/list-item-with-content.cjs.map +1 -1
- package/dist/cjs/components/tabs/index.cjs +1 -1
- package/dist/cjs/components/tabs/index.cjs.map +1 -1
- package/dist/cjs/components/tabs/private/tab.cjs +1 -1
- package/dist/cjs/components/tabs/private/tab.cjs.map +1 -1
- package/dist/cjs/components/textarea/check-props.cjs +1 -1
- package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
- package/dist/cjs/components/textarea/index.cjs +1 -1
- package/dist/cjs/components/textarea/index.cjs.map +1 -1
- package/dist/cjs/components/toast/index.cjs +1 -1
- package/dist/cjs/components/toast/index.cjs.map +1 -1
- package/dist/cjs/components/tooltip/check-props.cjs +1 -1
- package/dist/cjs/components/tooltip/check-props.cjs.map +1 -1
- package/dist/cjs/components/tooltip/index.cjs +1 -3
- package/dist/cjs/components/tooltip/index.cjs.map +1 -1
- package/dist/cjs/components/tooltip/private/field-level-help-tooltip.cjs +1 -1
- package/dist/cjs/components/tooltip/private/field-level-help-tooltip.cjs.map +1 -1
- package/dist/cjs/components/tree/check-props.cjs +1 -1
- package/dist/cjs/components/tree/private/branch.cjs +1 -1
- package/dist/cjs/components/tree/private/branch.cjs.map +1 -1
- package/dist/cjs/components/tree/private/item.cjs +1 -1
- package/dist/cjs/components/tree/private/item.cjs.map +1 -1
- package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
- package/dist/cjs/components/tree/private/render-branch.cjs.map +1 -1
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/trial-bar/button.cjs +1 -1
- package/dist/cjs/components/trial-bar/button.cjs.map +1 -1
- package/dist/cjs/components/trial-bar/dropdown.cjs +1 -1
- package/dist/cjs/components/trial-bar/dropdown.cjs.map +1 -1
- package/dist/cjs/components/utilities/dialog/index.cjs +1 -1
- package/dist/cjs/components/utilities/dialog/index.cjs.map +1 -1
- package/dist/cjs/components/utilities/dialog/portal.cjs +1 -1
- package/dist/cjs/components/utilities/dialog/portal.cjs.map +1 -1
- package/dist/cjs/components/utilities/menu-list/index.cjs +1 -26
- package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
- package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
- package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
- package/dist/cjs/components/utilities/pill/index.cjs +1 -1
- package/dist/cjs/components/utilities/utility-icon/index.cjs +1 -1
- package/dist/cjs/components/utilities/utility-icon/index.cjs.map +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
- package/dist/cjs/components/vertical-navigation/private/item.cjs +1 -1
- package/dist/cjs/components/vertical-navigation/private/item.cjs.map +1 -1
- package/dist/cjs/components/visual-picker/check-props.cjs +2 -0
- package/dist/cjs/components/visual-picker/check-props.cjs.map +1 -0
- package/dist/cjs/components/visual-picker/index.cjs +1 -1
- package/dist/cjs/components/visual-picker/index.cjs.map +1 -1
- package/dist/cjs/components/visual-picker/link.cjs +1 -1
- package/dist/cjs/components/visual-picker/link.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/tile.cjs +1 -1
- package/dist/cjs/components/welcome-mat/tile.cjs.map +1 -1
- package/dist/cjs/utilities/color.cjs +1 -1
- package/dist/cjs/utilities/color.cjs.map +1 -1
- package/dist/cjs/utilities/constants.cjs +1 -1
- package/dist/cjs/utilities/constants.cjs.map +1 -1
- package/dist/cjs/utilities/dom-element-focus.cjs +1 -1
- package/dist/cjs/utilities/dom-element-focus.cjs.map +1 -1
- package/dist/cjs/utilities/event.cjs +1 -1
- package/dist/cjs/utilities/event.cjs.map +1 -1
- package/dist/cjs/utilities/execution-environment.cjs.map +1 -1
- package/dist/cjs/utilities/get-aria-props.cjs +1 -1
- package/dist/cjs/utilities/get-aria-props.cjs.map +1 -1
- package/dist/cjs/utilities/get-data-props.cjs +1 -1
- package/dist/cjs/utilities/get-data-props.cjs.map +1 -1
- package/dist/cjs/utilities/hooks/use-click-outside.cjs.map +1 -1
- package/dist/cjs/utilities/hooks/use-latest-ref.cjs +2 -0
- package/dist/cjs/utilities/hooks/use-latest-ref.cjs.map +1 -0
- package/dist/cjs/utilities/is-element-of-type.cjs +2 -0
- package/dist/cjs/utilities/is-element-of-type.cjs.map +1 -0
- package/dist/cjs/utilities/key-callbacks.cjs +1 -1
- package/dist/cjs/utilities/key-callbacks.cjs.map +1 -1
- package/dist/cjs/utilities/key-code.cjs +1 -1
- package/dist/cjs/utilities/key-code.cjs.map +1 -1
- package/dist/cjs/utilities/key-letter-menu-item-select.cjs +1 -1
- package/dist/cjs/utilities/key-letter-menu-item-select.cjs.map +1 -1
- package/dist/cjs/utilities/keyboard-navigable-dialog.cjs +1 -1
- package/dist/cjs/utilities/keyboard-navigable-dialog.cjs.map +1 -1
- package/dist/cjs/utilities/keyboard-navigate.cjs +1 -1
- package/dist/cjs/utilities/keyboard-navigate.cjs.map +1 -1
- package/dist/cjs/utilities/merge-props.cjs +2 -0
- package/dist/cjs/utilities/merge-props.cjs.map +1 -0
- package/dist/cjs/utilities/product-tokens/icon-backgrounds.cjs.map +1 -1
- package/dist/cjs/utilities/warning/children-as-trigger.cjs +2 -0
- package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -0
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
- package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
- package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs +1 -1
- package/dist/cjs/utilities/warning/has-children-without-display-name-of.cjs.map +1 -1
- package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs +1 -1
- package/dist/cjs/utilities/warning/if-one-then-both-required-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs +1 -1
- package/dist/cjs/utilities/warning/is-trigger-tabbable.cjs.map +1 -1
- package/dist/cjs/utilities/warning/low-priority-warning.cjs.map +1 -1
- package/dist/cjs/utilities/warning/one-of-required-property.cjs +1 -1
- package/dist/cjs/utilities/warning/one-of-required-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/only-one-of-properties.cjs +1 -1
- package/dist/cjs/utilities/warning/only-one-of-properties.cjs.map +1 -1
- package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs +1 -1
- package/dist/cjs/utilities/warning/render-function-return-contents-lack-display-name.cjs.map +1 -1
- package/dist/cjs/utilities/warning/required-property.cjs +1 -1
- package/dist/cjs/utilities/warning/required-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/sunset-property.cjs +1 -1
- package/dist/cjs/utilities/warning/sunset-property.cjs.map +1 -1
- package/dist/cjs/utilities/warning/warned-registry.cjs +2 -0
- package/dist/cjs/utilities/warning/warned-registry.cjs.map +1 -0
- package/dist/es/components/accordion/index.js.map +1 -1
- package/dist/es/components/accordion/panel.js.map +1 -1
- package/dist/es/components/alert/index.js +22 -23
- package/dist/es/components/alert/index.js.map +1 -1
- package/dist/es/components/builder-header/index.js +15 -22
- package/dist/es/components/builder-header/index.js.map +1 -1
- package/dist/es/components/builder-header/nav-dropdown.js +22 -23
- package/dist/es/components/builder-header/nav-dropdown.js.map +1 -1
- package/dist/es/components/builder-header/nav-link.js +4 -4
- package/dist/es/components/builder-header/nav-link.js.map +1 -1
- package/dist/es/components/builder-header/nav.js +10 -7
- package/dist/es/components/builder-header/nav.js.map +1 -1
- package/dist/es/components/builder-header/toolbar.js +20 -18
- package/dist/es/components/builder-header/toolbar.js.map +1 -1
- package/dist/es/components/builder-header/utilities.js +9 -6
- package/dist/es/components/builder-header/utilities.js.map +1 -1
- package/dist/es/components/button/check-props.js +14 -0
- package/dist/es/components/button/check-props.js.map +1 -0
- package/dist/es/components/button/component.js +31 -0
- package/dist/es/components/button/component.js.map +1 -0
- package/dist/es/components/button/index.js +91 -80
- package/dist/es/components/button/index.js.map +1 -1
- package/dist/es/components/button-group/index.js +24 -17
- package/dist/es/components/button-group/index.js.map +1 -1
- package/dist/es/components/button-stateful/check-props.js +1 -1
- package/dist/es/components/button-stateful/check-props.js.map +1 -1
- package/dist/es/components/button-stateful/index.js +96 -96
- package/dist/es/components/button-stateful/index.js.map +1 -1
- package/dist/es/components/card/filter.js.map +1 -1
- package/dist/es/components/card/index.js +39 -36
- package/dist/es/components/card/index.js.map +1 -1
- package/dist/es/components/carousel/index.js +156 -127
- package/dist/es/components/carousel/index.js.map +1 -1
- package/dist/es/components/carousel/private/carousel-indicators.js.map +1 -1
- package/dist/es/components/carousel/private/carousel-item.js +1 -1
- package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
- package/dist/es/components/checkbox/check-props.js +1 -1
- package/dist/es/components/checkbox/check-props.js.map +1 -1
- package/dist/es/components/checkbox/index.js +137 -134
- package/dist/es/components/checkbox/index.js.map +1 -1
- package/dist/es/components/color-picker/check-props.js +21 -13
- package/dist/es/components/color-picker/check-props.js.map +1 -1
- package/dist/es/components/color-picker/color-picker.js +184 -165
- package/dist/es/components/color-picker/color-picker.js.map +1 -1
- package/dist/es/components/color-picker/private/color-picker-tabs.js.map +1 -1
- package/dist/es/components/color-picker/private/custom-color-form.js +4 -4
- package/dist/es/components/color-picker/private/custom-color-form.js.map +1 -1
- package/dist/es/components/color-picker/private/custom-color.js.map +1 -1
- package/dist/es/components/color-picker/private/hsv-color.js +17 -21
- package/dist/es/components/color-picker/private/hsv-color.js.map +1 -1
- package/dist/es/components/color-picker/private/swatch-option.js +2 -2
- package/dist/es/components/color-picker/private/swatch-option.js.map +1 -1
- package/dist/es/components/color-picker/private/swatch-picker.js +7 -7
- package/dist/es/components/color-picker/private/swatch-picker.js.map +1 -1
- package/dist/es/components/color-picker/private/swatch.js +1 -1
- package/dist/es/components/color-picker/private/swatch.js.map +1 -1
- package/dist/es/components/combobox/check-props.js +21 -14
- package/dist/es/components/combobox/check-props.js.map +1 -1
- package/dist/es/components/combobox/combobox.js +597 -630
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/combobox/component.js +1 -1
- package/dist/es/components/combobox/component.js.map +1 -1
- package/dist/es/components/combobox/index.js +6 -19
- package/dist/es/components/combobox/index.js.map +1 -1
- package/dist/es/components/combobox/private/menu.js +11 -11
- package/dist/es/components/combobox/private/menu.js.map +1 -1
- package/dist/es/components/date-picker/check-props.js +1 -1
- package/dist/es/components/date-picker/check-props.js.map +1 -1
- package/dist/es/components/date-picker/date-picker.js +163 -168
- package/dist/es/components/date-picker/date-picker.js.map +1 -1
- package/dist/es/components/date-picker/index.js.map +1 -1
- package/dist/es/components/date-picker/private/calendar-wrapper.js +6 -6
- package/dist/es/components/date-picker/private/calendar-wrapper.js.map +1 -1
- package/dist/es/components/date-picker/private/calendar.js.map +1 -1
- package/dist/es/components/date-picker/private/day.js +11 -11
- package/dist/es/components/date-picker/private/day.js.map +1 -1
- package/dist/es/components/date-picker/private/week.js.map +1 -1
- package/dist/es/components/date-picker/private/year-picklist.js.map +1 -1
- package/dist/es/components/docked-composer/index.js +71 -43
- package/dist/es/components/docked-composer/index.js.map +1 -1
- package/dist/es/components/dynamic-icon/index.js +21 -16
- package/dist/es/components/dynamic-icon/index.js.map +1 -1
- package/dist/es/components/expandable-section/index.js +18 -18
- package/dist/es/components/expandable-section/index.js.map +1 -1
- package/dist/es/components/files/file.js +10 -12
- package/dist/es/components/files/file.js.map +1 -1
- package/dist/es/components/files/index.js +4 -8
- package/dist/es/components/files/index.js.map +1 -1
- package/dist/es/components/files/private/file-actions.js +25 -21
- package/dist/es/components/files/private/file-actions.js.map +1 -1
- package/dist/es/components/files/private/file-figure.js +1 -1
- package/dist/es/components/files/private/file-figure.js.map +1 -1
- package/dist/es/components/filter/filter.js +76 -70
- package/dist/es/components/filter/filter.js.map +1 -1
- package/dist/es/components/filter/private/error-id-context.js +7 -0
- package/dist/es/components/filter/private/error-id-context.js.map +1 -0
- package/dist/es/components/grid/index.js +1 -1
- package/dist/es/components/grid/index.js.map +1 -1
- package/dist/es/components/icon/button-icon/index.js +2 -3
- package/dist/es/components/icon/button-icon/index.js.map +1 -1
- package/dist/es/components/icon/check-props.js +17 -0
- package/dist/es/components/icon/check-props.js.map +1 -0
- package/dist/es/components/icon/component.js +31 -0
- package/dist/es/components/icon/component.js.map +1 -0
- package/dist/es/components/icon/index.js +45 -44
- package/dist/es/components/icon/index.js.map +1 -1
- package/dist/es/components/icon/input-icon/index.js +8 -8
- package/dist/es/components/icon/input-icon/index.js.map +1 -1
- package/dist/es/components/index.js +83 -84
- package/dist/es/components/input/check-props.js +7 -11
- package/dist/es/components/input/check-props.js.map +1 -1
- package/dist/es/components/input/index.js +113 -115
- package/dist/es/components/input/index.js.map +1 -1
- package/dist/es/components/input/private/inner-input.js +1 -1
- package/dist/es/components/input/private/inner-input.js.map +1 -1
- package/dist/es/components/input/search.js +3 -3
- package/dist/es/components/input/search.js.map +1 -1
- package/dist/es/components/menu-dropdown/button-trigger.js +58 -47
- package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
- package/dist/es/components/menu-dropdown/check-props.js +14 -11
- package/dist/es/components/menu-dropdown/check-props.js.map +1 -1
- package/dist/es/components/menu-dropdown/index.js.map +1 -1
- package/dist/es/components/menu-dropdown/menu-dropdown.js +256 -264
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/modal/index.js +6 -7
- package/dist/es/components/modal/index.js.map +1 -1
- package/dist/es/components/page-header/check-props.js +2 -2
- package/dist/es/components/page-header/check-props.js.map +1 -1
- package/dist/es/components/page-header/control.js.map +1 -1
- package/dist/es/components/page-header/index.js +33 -33
- package/dist/es/components/page-header/index.js.map +1 -1
- package/dist/es/components/page-header/private/base/index.js +24 -36
- package/dist/es/components/page-header/private/base/index.js.map +1 -1
- package/dist/es/components/page-header/private/controls.js +19 -25
- package/dist/es/components/page-header/private/controls.js.map +1 -1
- package/dist/es/components/page-header/private/detail-block.js.map +1 -1
- package/dist/es/components/page-header/private/detail-row.js +1 -1
- package/dist/es/components/page-header/private/detail-row.js.map +1 -1
- package/dist/es/components/page-header/private/info.js.map +1 -1
- package/dist/es/components/page-header/private/object-home/index.js +37 -50
- package/dist/es/components/page-header/private/object-home/index.js.map +1 -1
- package/dist/es/components/page-header/private/record-home/index.js +26 -38
- package/dist/es/components/page-header/private/record-home/index.js.map +1 -1
- package/dist/es/components/page-header/private/related-list/index.js +0 -2
- package/dist/es/components/page-header/private/related-list/index.js.map +1 -1
- package/dist/es/components/page-header/private/title.js +5 -4
- package/dist/es/components/page-header/private/title.js.map +1 -1
- package/dist/es/components/panel/filtering/check-props.js +2 -2
- package/dist/es/components/panel/filtering/check-props.js.map +1 -1
- package/dist/es/components/panel/filtering/group.js +5 -6
- package/dist/es/components/panel/filtering/group.js.map +1 -1
- package/dist/es/components/panel/filtering/list.js +19 -12
- package/dist/es/components/panel/filtering/list.js.map +1 -1
- package/dist/es/components/pill/index.js +9 -9
- package/dist/es/components/pill/index.js.map +1 -1
- package/dist/es/components/pill-container/index.js +11 -7
- package/dist/es/components/pill-container/index.js.map +1 -1
- package/dist/es/components/pill-container/private/selected-listbox.js.map +1 -1
- package/dist/es/components/popover/edit-dialog.js +9 -6
- package/dist/es/components/popover/edit-dialog.js.map +1 -1
- package/dist/es/components/popover/index.js.map +1 -1
- package/dist/es/components/popover/popover.js +231 -209
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/progress-indicator/check-props.js +8 -7
- package/dist/es/components/progress-indicator/check-props.js.map +1 -1
- package/dist/es/components/progress-indicator/index.js +73 -60
- package/dist/es/components/progress-indicator/index.js.map +1 -1
- package/dist/es/components/progress-indicator/private/step-vertical.js +2 -2
- package/dist/es/components/progress-indicator/private/step-vertical.js.map +1 -1
- package/dist/es/components/progress-indicator/private/step.js +2 -4
- package/dist/es/components/progress-indicator/private/step.js.map +1 -1
- package/dist/es/components/progress-ring/index.js.map +1 -1
- package/dist/es/components/radio/check-props.js +2 -2
- package/dist/es/components/radio/check-props.js.map +1 -1
- package/dist/es/components/radio/index.js +28 -23
- package/dist/es/components/radio/index.js.map +1 -1
- package/dist/es/components/radio-button-group/index.js.map +1 -1
- package/dist/es/components/radio-button-group/radio.js.map +1 -1
- package/dist/es/components/radio-group/index.js +2 -2
- package/dist/es/components/radio-group/index.js.map +1 -1
- package/dist/es/components/scoped-notification/check-props.js +13 -0
- package/dist/es/components/scoped-notification/check-props.js.map +1 -0
- package/dist/es/components/scoped-notification/component.js +31 -0
- package/dist/es/components/scoped-notification/component.js.map +1 -0
- package/dist/es/components/scoped-notification/index.js +31 -29
- package/dist/es/components/scoped-notification/index.js.map +1 -1
- package/dist/es/components/setup-assistant/index.js +22 -24
- package/dist/es/components/setup-assistant/index.js.map +1 -1
- package/dist/es/components/setup-assistant/step.js +43 -41
- package/dist/es/components/setup-assistant/step.js.map +1 -1
- package/dist/es/components/simple-data-table/cell.js +10 -7
- package/dist/es/components/simple-data-table/cell.js.map +1 -1
- package/dist/es/components/simple-data-table/check-props.js +1 -1
- package/dist/es/components/simple-data-table/check-props.js.map +1 -1
- package/dist/es/components/simple-data-table/column-check-props.js +16 -8
- package/dist/es/components/simple-data-table/column-check-props.js.map +1 -1
- package/dist/es/components/simple-data-table/column.js.map +1 -1
- package/dist/es/components/simple-data-table/index.js +163 -149
- package/dist/es/components/simple-data-table/index.js.map +1 -1
- package/dist/es/components/simple-data-table/interactive-element.js +36 -24
- package/dist/es/components/simple-data-table/interactive-element.js.map +1 -1
- package/dist/es/components/simple-data-table/private/cell-context.js.map +1 -1
- package/dist/es/components/simple-data-table/private/corner-style.js +9 -0
- package/dist/es/components/simple-data-table/private/corner-style.js.map +1 -0
- package/dist/es/components/simple-data-table/private/head.js +65 -42
- package/dist/es/components/simple-data-table/private/head.js.map +1 -1
- package/dist/es/components/simple-data-table/private/header-cell.js +5 -4
- package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
- package/dist/es/components/simple-data-table/private/link.js +13 -14
- package/dist/es/components/simple-data-table/private/link.js.map +1 -1
- package/dist/es/components/simple-data-table/private/row.js +98 -61
- package/dist/es/components/simple-data-table/private/row.js.map +1 -1
- package/dist/es/components/simple-data-table/private/table-context.js +1 -0
- package/dist/es/components/simple-data-table/private/table-context.js.map +1 -1
- package/dist/es/components/simple-data-table/row-actions.js +14 -10
- package/dist/es/components/simple-data-table/row-actions.js.map +1 -1
- package/dist/es/components/slider/index.js.map +1 -1
- package/dist/es/components/spinner/check-props.js +1 -1
- package/dist/es/components/spinner/check-props.js.map +1 -1
- package/dist/es/components/spinner/index.js +31 -28
- package/dist/es/components/spinner/index.js.map +1 -1
- package/dist/es/components/split-view/header.js.map +1 -1
- package/dist/es/components/split-view/listbox.js +8 -8
- package/dist/es/components/split-view/listbox.js.map +1 -1
- package/dist/es/components/split-view/private/list-item-content.js.map +1 -1
- package/dist/es/components/split-view/private/list-item-with-content.js.map +1 -1
- package/dist/es/components/tabs/index.js +3 -3
- package/dist/es/components/tabs/index.js.map +1 -1
- package/dist/es/components/tabs/private/tab.js +1 -1
- package/dist/es/components/tabs/private/tab.js.map +1 -1
- package/dist/es/components/textarea/check-props.js +1 -1
- package/dist/es/components/textarea/check-props.js.map +1 -1
- package/dist/es/components/textarea/index.js +4 -2
- package/dist/es/components/textarea/index.js.map +1 -1
- package/dist/es/components/toast/index.js +58 -58
- package/dist/es/components/toast/index.js.map +1 -1
- package/dist/es/components/tooltip/check-props.js +12 -9
- package/dist/es/components/tooltip/check-props.js.map +1 -1
- package/dist/es/components/tooltip/index.js +163 -138
- package/dist/es/components/tooltip/index.js.map +1 -1
- package/dist/es/components/tooltip/private/field-level-help-tooltip.js +10 -15
- package/dist/es/components/tooltip/private/field-level-help-tooltip.js.map +1 -1
- package/dist/es/components/tree/check-props.js +5 -5
- package/dist/es/components/tree/private/branch.js +56 -57
- package/dist/es/components/tree/private/branch.js.map +1 -1
- package/dist/es/components/tree/private/item.js +13 -13
- package/dist/es/components/tree/private/item.js.map +1 -1
- package/dist/es/components/tree/private/render-branch.js +48 -53
- package/dist/es/components/tree/private/render-branch.js.map +1 -1
- package/dist/es/components/tree/tree.js.map +1 -1
- package/dist/es/components/trial-bar/button.js +9 -7
- package/dist/es/components/trial-bar/button.js.map +1 -1
- package/dist/es/components/trial-bar/dropdown.js +17 -19
- package/dist/es/components/trial-bar/dropdown.js.map +1 -1
- package/dist/es/components/utilities/dialog/index.js +10 -9
- package/dist/es/components/utilities/dialog/index.js.map +1 -1
- package/dist/es/components/utilities/dialog/portal.js +5 -3
- package/dist/es/components/utilities/dialog/portal.js.map +1 -1
- package/dist/es/components/utilities/menu-list/index.js +6 -6
- package/dist/es/components/utilities/menu-list/index.js.map +1 -1
- package/dist/es/components/utilities/menu-list/item.js +51 -24
- package/dist/es/components/utilities/menu-list/item.js.map +1 -1
- package/dist/es/components/utilities/pill/index.js +14 -14
- package/dist/es/components/utilities/utility-icon/index.js +32 -52
- package/dist/es/components/utilities/utility-icon/index.js.map +1 -1
- package/dist/es/components/vertical-navigation/index.js.map +1 -1
- package/dist/es/components/vertical-navigation/private/item.js +25 -20
- package/dist/es/components/vertical-navigation/private/item.js.map +1 -1
- package/dist/es/components/visual-picker/check-props.js +11 -0
- package/dist/es/components/visual-picker/check-props.js.map +1 -0
- package/dist/es/components/visual-picker/index.js +17 -17
- package/dist/es/components/visual-picker/index.js.map +1 -1
- package/dist/es/components/visual-picker/link.js +15 -11
- package/dist/es/components/visual-picker/link.js.map +1 -1
- package/dist/es/components/welcome-mat/index.js +5 -5
- package/dist/es/components/welcome-mat/index.js.map +1 -1
- package/dist/es/components/welcome-mat/info-badge.js +6 -6
- package/dist/es/components/welcome-mat/info-badge.js.map +1 -1
- package/dist/es/components/welcome-mat/tile.js +7 -7
- package/dist/es/components/welcome-mat/tile.js.map +1 -1
- package/dist/es/utilities/color.js +1 -1
- package/dist/es/utilities/color.js.map +1 -1
- package/dist/es/utilities/constants.js +2 -2
- package/dist/es/utilities/constants.js.map +1 -1
- package/dist/es/utilities/dom-element-focus.js +4 -4
- package/dist/es/utilities/dom-element-focus.js.map +1 -1
- package/dist/es/utilities/event.js +4 -0
- package/dist/es/utilities/event.js.map +1 -1
- package/dist/es/utilities/execution-environment.js.map +1 -1
- package/dist/es/utilities/get-aria-props.js +1 -1
- package/dist/es/utilities/get-aria-props.js.map +1 -1
- package/dist/es/utilities/get-data-props.js +1 -1
- package/dist/es/utilities/get-data-props.js.map +1 -1
- package/dist/es/utilities/hooks/use-click-outside.js.map +1 -1
- package/dist/es/utilities/hooks/use-latest-ref.js +12 -0
- package/dist/es/utilities/hooks/use-latest-ref.js.map +1 -0
- package/dist/es/utilities/is-element-of-type.js +7 -0
- package/dist/es/utilities/is-element-of-type.js.map +1 -0
- package/dist/es/utilities/key-callbacks.js +1 -1
- package/dist/es/utilities/key-callbacks.js.map +1 -1
- package/dist/es/utilities/key-code.js +11 -11
- package/dist/es/utilities/key-code.js.map +1 -1
- package/dist/es/utilities/key-letter-menu-item-select.js +7 -7
- package/dist/es/utilities/key-letter-menu-item-select.js.map +1 -1
- package/dist/es/utilities/keyboard-navigable-dialog.js +10 -10
- package/dist/es/utilities/keyboard-navigable-dialog.js.map +1 -1
- package/dist/es/utilities/keyboard-navigate.js +15 -15
- package/dist/es/utilities/keyboard-navigate.js.map +1 -1
- package/dist/es/utilities/merge-props.js +34 -0
- package/dist/es/utilities/merge-props.js.map +1 -0
- package/dist/es/utilities/product-tokens/icon-backgrounds.js.map +1 -1
- package/dist/es/utilities/warning/children-as-trigger.js +16 -0
- package/dist/es/utilities/warning/children-as-trigger.js.map +1 -0
- package/dist/es/utilities/warning/deprecated-property-value.js +11 -10
- package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
- package/dist/es/utilities/warning/deprecated-property.js +8 -7
- package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
- package/dist/es/utilities/warning/has-children-without-display-name-of.js +11 -10
- package/dist/es/utilities/warning/has-children-without-display-name-of.js.map +1 -1
- package/dist/es/utilities/warning/if-one-then-both-required-property.js +10 -9
- package/dist/es/utilities/warning/if-one-then-both-required-property.js.map +1 -1
- package/dist/es/utilities/warning/is-trigger-tabbable.js +9 -8
- package/dist/es/utilities/warning/is-trigger-tabbable.js.map +1 -1
- package/dist/es/utilities/warning/low-priority-warning.js.map +1 -1
- package/dist/es/utilities/warning/one-of-required-property.js +11 -10
- package/dist/es/utilities/warning/one-of-required-property.js.map +1 -1
- package/dist/es/utilities/warning/only-one-of-properties.js +9 -8
- package/dist/es/utilities/warning/only-one-of-properties.js.map +1 -1
- package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js +14 -13
- package/dist/es/utilities/warning/render-function-return-contents-lack-display-name.js.map +1 -1
- package/dist/es/utilities/warning/required-property.js +8 -7
- package/dist/es/utilities/warning/required-property.js.map +1 -1
- package/dist/es/utilities/warning/sunset-property.js +8 -7
- package/dist/es/utilities/warning/sunset-property.js.map +1 -1
- package/dist/es/utilities/warning/warned-registry.js +10 -0
- package/dist/es/utilities/warning/warned-registry.js.map +1 -0
- package/dist/types/components/accordion/index.d.ts +5 -3
- package/dist/types/components/accordion/index.d.ts.map +1 -1
- package/dist/types/components/accordion/panel.d.ts +9 -19
- package/dist/types/components/accordion/panel.d.ts.map +1 -1
- package/dist/types/components/alert/index.d.ts +9 -5
- package/dist/types/components/alert/index.d.ts.map +1 -1
- package/dist/types/components/builder-header/index.d.ts +8 -3
- package/dist/types/components/builder-header/index.d.ts.map +1 -1
- package/dist/types/components/builder-header/nav-dropdown.d.ts +4 -2
- package/dist/types/components/builder-header/nav-dropdown.d.ts.map +1 -1
- package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
- package/dist/types/components/builder-header/nav.d.ts +6 -2
- package/dist/types/components/builder-header/nav.d.ts.map +1 -1
- package/dist/types/components/builder-header/toolbar.d.ts +4 -1
- package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
- package/dist/types/components/builder-header/utilities.d.ts +6 -2
- package/dist/types/components/builder-header/utilities.d.ts.map +1 -1
- package/dist/types/components/button/index.d.ts +49 -24
- package/dist/types/components/button/index.d.ts.map +1 -1
- package/dist/types/components/button-group/index.d.ts +14 -6
- package/dist/types/components/button-group/index.d.ts.map +1 -1
- package/dist/types/components/button-stateful/index.d.ts +11 -6
- package/dist/types/components/button-stateful/index.d.ts.map +1 -1
- package/dist/types/components/card/filter.d.ts +2 -2
- package/dist/types/components/card/filter.d.ts.map +1 -1
- package/dist/types/components/card/index.d.ts +10 -4
- package/dist/types/components/card/index.d.ts.map +1 -1
- package/dist/types/components/carousel/index.d.ts +11 -4
- package/dist/types/components/carousel/index.d.ts.map +1 -1
- package/dist/types/components/carousel/{private/carousel-item.d.ts → types.d.ts} +3 -9
- package/dist/types/components/carousel/types.d.ts.map +1 -0
- package/dist/types/components/checkbox/index.d.ts +92 -25
- package/dist/types/components/checkbox/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts +16 -20
- package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/types/components/color-picker/index.d.ts +1 -1
- package/dist/types/components/color-picker/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/types.d.ts +29 -7
- package/dist/types/components/color-picker/types.d.ts.map +1 -1
- package/dist/types/components/combobox/combobox.d.ts +30 -12
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/combobox/index.d.ts +2 -2
- package/dist/types/components/combobox/index.d.ts.map +1 -1
- package/dist/types/components/combobox/types.d.ts +89 -0
- package/dist/types/components/combobox/types.d.ts.map +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +9 -12
- package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/components/date-picker/index.d.ts +1 -1
- package/dist/types/components/date-picker/index.d.ts.map +1 -1
- package/dist/types/components/docked-composer/index.d.ts +8 -2
- package/dist/types/components/docked-composer/index.d.ts.map +1 -1
- package/dist/types/components/dynamic-icon/index.d.ts +42 -14
- package/dist/types/components/dynamic-icon/index.d.ts.map +1 -1
- package/dist/types/components/expandable-section/index.d.ts +33 -10
- package/dist/types/components/expandable-section/index.d.ts.map +1 -1
- package/dist/types/components/files/file.d.ts +21 -16
- package/dist/types/components/files/file.d.ts.map +1 -1
- package/dist/types/components/files/index.d.ts +8 -10
- package/dist/types/components/files/index.d.ts.map +1 -1
- package/dist/types/components/filter/filter.d.ts +9 -1
- package/dist/types/components/filter/filter.d.ts.map +1 -1
- package/dist/types/components/grid/index.d.ts +5 -3
- package/dist/types/components/grid/index.d.ts.map +1 -1
- package/dist/types/components/icon/button-icon/index.d.ts +2 -3
- package/dist/types/components/icon/button-icon/index.d.ts.map +1 -1
- package/dist/types/components/icon/index.d.ts +9 -2
- package/dist/types/components/icon/index.d.ts.map +1 -1
- package/dist/types/components/icon/input-icon/index.d.ts +26 -9
- package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -2
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/input/index.d.ts +66 -32
- package/dist/types/components/input/index.d.ts.map +1 -1
- package/dist/types/components/input/search.d.ts +2 -2
- package/dist/types/components/input/search.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/button-trigger.d.ts +27 -15
- package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/index.d.ts +2 -1
- package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +57 -19
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
- package/dist/types/components/modal/index.d.ts.map +1 -1
- package/dist/types/components/page-header/control.d.ts.map +1 -1
- package/dist/types/components/page-header/index.d.ts +81 -21
- package/dist/types/components/page-header/index.d.ts.map +1 -1
- package/dist/types/components/page-header/private/detail-block.d.ts +4 -25
- package/dist/types/components/page-header/private/detail-block.d.ts.map +1 -1
- package/dist/types/components/page-header/private/detail-row.d.ts +3 -14
- package/dist/types/components/page-header/private/detail-row.d.ts.map +1 -1
- package/dist/types/components/page-header/private/info.d.ts +1 -15
- package/dist/types/components/page-header/private/info.d.ts.map +1 -1
- package/dist/types/components/page-header/private/title.d.ts +2 -23
- package/dist/types/components/page-header/private/title.d.ts.map +1 -1
- package/dist/types/components/page-header/types.d.ts +73 -0
- package/dist/types/components/page-header/types.d.ts.map +1 -0
- package/dist/types/components/panel/filtering/group.d.ts +43 -21
- package/dist/types/components/panel/filtering/group.d.ts.map +1 -1
- package/dist/types/components/panel/filtering/list.d.ts +5 -3
- package/dist/types/components/panel/filtering/list.d.ts.map +1 -1
- package/dist/types/components/pill/index.d.ts +45 -16
- package/dist/types/components/pill/index.d.ts.map +1 -1
- package/dist/types/components/pill-container/index.d.ts +6 -6
- package/dist/types/components/pill-container/index.d.ts.map +1 -1
- package/dist/types/components/popover/edit-dialog.d.ts +14 -8
- package/dist/types/components/popover/edit-dialog.d.ts.map +1 -1
- package/dist/types/components/popover/index.d.ts.map +1 -1
- package/dist/types/components/popover/popover.d.ts +46 -18
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/index.d.ts +74 -29
- package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
- package/dist/types/components/progress-ring/index.d.ts +19 -6
- package/dist/types/components/progress-ring/index.d.ts.map +1 -1
- package/dist/types/components/radio/index.d.ts +53 -20
- package/dist/types/components/radio/index.d.ts.map +1 -1
- package/dist/types/components/radio-button-group/index.d.ts +5 -7
- package/dist/types/components/radio-button-group/index.d.ts.map +1 -1
- package/dist/types/components/radio-button-group/radio.d.ts +1 -3
- package/dist/types/components/radio-button-group/radio.d.ts.map +1 -1
- package/dist/types/components/radio-group/index.d.ts +24 -11
- package/dist/types/components/radio-group/index.d.ts.map +1 -1
- package/dist/types/components/radio-group/radio.d.ts +1 -3
- package/dist/types/components/radio-group/radio.d.ts.map +1 -1
- package/dist/types/components/scoped-notification/index.d.ts +6 -5
- package/dist/types/components/scoped-notification/index.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/index.d.ts +22 -15
- package/dist/types/components/setup-assistant/index.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/step.d.ts +6 -23
- package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/cell.d.ts +2 -2
- package/dist/types/components/simple-data-table/cell.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/column.d.ts +3 -55
- package/dist/types/components/simple-data-table/column.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/index.d.ts +6 -3
- package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/interactive-element.d.ts +14 -3
- package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/row-actions.d.ts +5 -29
- package/dist/types/components/simple-data-table/row-actions.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/types.d.ts +58 -52
- package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
- package/dist/types/components/slider/index.d.ts +2 -2
- package/dist/types/components/slider/index.d.ts.map +1 -1
- package/dist/types/components/spinner/index.d.ts +32 -5
- package/dist/types/components/spinner/index.d.ts.map +1 -1
- package/dist/types/components/split-view/header.d.ts +2 -6
- package/dist/types/components/split-view/header.d.ts.map +1 -1
- package/dist/types/components/split-view/listbox.d.ts +2 -1
- package/dist/types/components/split-view/listbox.d.ts.map +1 -1
- package/dist/types/components/split-view/private/list-item-with-content.d.ts.map +1 -1
- package/dist/types/components/split-view/types.d.ts +7 -0
- package/dist/types/components/split-view/types.d.ts.map +1 -0
- package/dist/types/components/tabs/index.d.ts +7 -17
- package/dist/types/components/tabs/index.d.ts.map +1 -1
- package/dist/types/components/textarea/index.d.ts +11 -26
- package/dist/types/components/textarea/index.d.ts.map +1 -1
- package/dist/types/components/toast/index.d.ts +17 -8
- package/dist/types/components/toast/index.d.ts.map +1 -1
- package/dist/types/components/tooltip/index.d.ts +38 -6
- package/dist/types/components/tooltip/index.d.ts.map +1 -1
- package/dist/types/components/tree/index.d.ts +1 -1
- package/dist/types/components/tree/index.d.ts.map +1 -1
- package/dist/types/components/tree/tree.d.ts +61 -14
- package/dist/types/components/tree/tree.d.ts.map +1 -1
- package/dist/types/components/trial-bar/button.d.ts +1 -1
- package/dist/types/components/trial-bar/button.d.ts.map +1 -1
- package/dist/types/components/trial-bar/dropdown.d.ts +2 -2
- package/dist/types/components/trial-bar/dropdown.d.ts.map +1 -1
- package/dist/types/components/utilities/dialog/portal.d.ts.map +1 -1
- package/dist/types/components/utilities/menu-list/index.d.ts +2 -2
- package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
- package/dist/types/components/utilities/menu-list/item.d.ts +14 -1
- package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
- package/dist/types/components/utilities/truncate/index.d.ts +2 -3
- package/dist/types/components/utilities/truncate/index.d.ts.map +1 -1
- package/dist/types/components/utilities/utility-icon/index.d.ts +1 -1
- package/dist/types/components/utilities/utility-icon/index.d.ts.map +1 -1
- package/dist/types/components/vertical-navigation/index.d.ts +4 -3
- package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
- package/dist/types/components/visual-picker/index.d.ts +35 -21
- package/dist/types/components/visual-picker/index.d.ts.map +1 -1
- package/dist/types/components/visual-picker/link.d.ts +3 -2
- package/dist/types/components/visual-picker/link.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/index.d.ts +12 -9
- package/dist/types/components/welcome-mat/index.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/info-badge.d.ts +2 -0
- package/dist/types/components/welcome-mat/info-badge.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/tile.d.ts +6 -16
- package/dist/types/components/welcome-mat/tile.d.ts.map +1 -1
- package/dist/types/types/common.d.ts +15 -1
- package/dist/types/types/common.d.ts.map +1 -1
- package/dist/types/types/components.d.ts.map +1 -1
- package/dist/types/utilities/constants.d.ts +0 -1
- package/dist/types/utilities/constants.d.ts.map +1 -1
- package/package.json +27 -11
- package/dist/cjs/components/illustration/check-props.cjs +0 -2
- package/dist/cjs/components/illustration/check-props.cjs.map +0 -1
- package/dist/cjs/components/illustration/index.cjs +0 -2
- package/dist/cjs/components/illustration/index.cjs.map +0 -1
- package/dist/cjs/components/illustration.cjs +0 -1
- package/dist/cjs/components/page-header/private/base.cjs +0 -1
- package/dist/cjs/components/page-header/private/object-home.cjs +0 -1
- package/dist/cjs/components/page-header/private/record-home.cjs +0 -1
- package/dist/cjs/components/page-header/private/related-list.cjs +0 -1
- package/dist/cjs/icons/action/index.cjs +0 -2
- package/dist/cjs/icons/action/index.cjs.map +0 -1
- package/dist/cjs/icons/custom/index.cjs +0 -2
- package/dist/cjs/icons/custom/index.cjs.map +0 -1
- package/dist/cjs/icons/doctype/index.cjs +0 -2
- package/dist/cjs/icons/doctype/index.cjs.map +0 -1
- package/dist/cjs/icons/standard/index.cjs +0 -2
- package/dist/cjs/icons/standard/index.cjs.map +0 -1
- package/dist/cjs/icons/utility/index.cjs +0 -2
- package/dist/cjs/icons/utility/index.cjs.map +0 -1
- package/dist/cjs/utilities/hooks/index.cjs +0 -1
- package/dist/cjs/utilities/hooks.cjs +0 -1
- package/dist/cjs/utilities/object.cjs +0 -2
- package/dist/cjs/utilities/object.cjs.map +0 -1
- package/dist/cjs/utilities/warning/component-is-deprecated.cjs +0 -2
- package/dist/cjs/utilities/warning/component-is-deprecated.cjs.map +0 -1
- package/dist/es/components/illustration/check-props.js +0 -11
- package/dist/es/components/illustration/check-props.js.map +0 -1
- package/dist/es/components/illustration/index.js +0 -73
- package/dist/es/components/illustration/index.js.map +0 -1
- package/dist/es/components/illustration.js +0 -2
- package/dist/es/components/page-header/private/base.js +0 -2
- package/dist/es/components/page-header/private/object-home.js +0 -2
- package/dist/es/components/page-header/private/record-home.js +0 -2
- package/dist/es/components/page-header/private/related-list.js +0 -2
- package/dist/es/icons/action/index.js +0 -6
- package/dist/es/icons/action/index.js.map +0 -1
- package/dist/es/icons/custom/index.js +0 -6
- package/dist/es/icons/custom/index.js.map +0 -1
- package/dist/es/icons/doctype/index.js +0 -6
- package/dist/es/icons/doctype/index.js.map +0 -1
- package/dist/es/icons/standard/index.js +0 -6
- package/dist/es/icons/standard/index.js.map +0 -1
- package/dist/es/icons/utility/index.js +0 -6
- package/dist/es/icons/utility/index.js.map +0 -1
- package/dist/es/utilities/hooks/index.js +0 -3
- package/dist/es/utilities/hooks.js +0 -1
- package/dist/es/utilities/object.js +0 -10
- package/dist/es/utilities/object.js.map +0 -1
- package/dist/es/utilities/warning/component-is-deprecated.js +0 -15
- package/dist/es/utilities/warning/component-is-deprecated.js.map +0 -1
- package/dist/types/components/alert/check-props.d.ts +0 -3
- package/dist/types/components/alert/check-props.d.ts.map +0 -1
- package/dist/types/components/builder-header/check-props.d.ts +0 -3
- package/dist/types/components/builder-header/check-props.d.ts.map +0 -1
- package/dist/types/components/button/check-props.d.ts +0 -3
- package/dist/types/components/button/check-props.d.ts.map +0 -1
- package/dist/types/components/button-stateful/check-props.d.ts +0 -3
- package/dist/types/components/button-stateful/check-props.d.ts.map +0 -1
- package/dist/types/components/card/private/body.d.ts +0 -22
- package/dist/types/components/card/private/body.d.ts.map +0 -1
- package/dist/types/components/card/private/footer.d.ts +0 -14
- package/dist/types/components/card/private/footer.d.ts.map +0 -1
- package/dist/types/components/card/private/header.d.ts +0 -48
- package/dist/types/components/card/private/header.d.ts.map +0 -1
- package/dist/types/components/carousel/check-props.d.ts +0 -3
- package/dist/types/components/carousel/check-props.d.ts.map +0 -1
- package/dist/types/components/carousel/private/auto-play-button.d.ts +0 -26
- package/dist/types/components/carousel/private/auto-play-button.d.ts.map +0 -1
- package/dist/types/components/carousel/private/carousel-indicators.d.ts +0 -65
- package/dist/types/components/carousel/private/carousel-indicators.d.ts.map +0 -1
- package/dist/types/components/carousel/private/carousel-item.d.ts.map +0 -1
- package/dist/types/components/carousel/private/previous-next-carousel-navigator.d.ts +0 -30
- package/dist/types/components/carousel/private/previous-next-carousel-navigator.d.ts.map +0 -1
- package/dist/types/components/checkbox/check-props.d.ts +0 -5
- package/dist/types/components/checkbox/check-props.d.ts.map +0 -1
- package/dist/types/components/color-picker/check-props.d.ts +0 -3
- package/dist/types/components/color-picker/check-props.d.ts.map +0 -1
- package/dist/types/components/color-picker/private/color-picker-tabs.d.ts +0 -14
- package/dist/types/components/color-picker/private/color-picker-tabs.d.ts.map +0 -1
- package/dist/types/components/color-picker/private/custom-color-form.d.ts +0 -28
- package/dist/types/components/color-picker/private/custom-color-form.d.ts.map +0 -1
- package/dist/types/components/color-picker/private/custom-color.d.ts +0 -49
- package/dist/types/components/color-picker/private/custom-color.d.ts.map +0 -1
- package/dist/types/components/color-picker/private/hsv-color.d.ts +0 -37
- package/dist/types/components/color-picker/private/hsv-color.d.ts.map +0 -1
- package/dist/types/components/color-picker/private/swatch-option.d.ts +0 -25
- package/dist/types/components/color-picker/private/swatch-option.d.ts.map +0 -1
- package/dist/types/components/color-picker/private/swatch-picker.d.ts +0 -65
- package/dist/types/components/color-picker/private/swatch-picker.d.ts.map +0 -1
- package/dist/types/components/color-picker/private/swatch.d.ts +0 -22
- package/dist/types/components/color-picker/private/swatch.d.ts.map +0 -1
- package/dist/types/components/combobox/check-props.d.ts +0 -3
- package/dist/types/components/combobox/check-props.d.ts.map +0 -1
- package/dist/types/components/combobox/private/menu.d.ts +0 -143
- package/dist/types/components/combobox/private/menu.d.ts.map +0 -1
- package/dist/types/components/date-picker/check-props.d.ts +0 -3
- package/dist/types/components/date-picker/check-props.d.ts.map +0 -1
- package/dist/types/components/date-picker/private/calendar-wrapper.d.ts +0 -80
- package/dist/types/components/date-picker/private/calendar-wrapper.d.ts.map +0 -1
- package/dist/types/components/date-picker/private/calendar.d.ts +0 -77
- package/dist/types/components/date-picker/private/calendar.d.ts.map +0 -1
- package/dist/types/components/date-picker/private/day.d.ts +0 -100
- package/dist/types/components/date-picker/private/day.d.ts.map +0 -1
- package/dist/types/components/date-picker/private/navigation.d.ts +0 -37
- package/dist/types/components/date-picker/private/navigation.d.ts.map +0 -1
- package/dist/types/components/date-picker/private/week.d.ts +0 -59
- package/dist/types/components/date-picker/private/week.d.ts.map +0 -1
- package/dist/types/components/date-picker/private/year-picklist.d.ts +0 -27
- package/dist/types/components/date-picker/private/year-picklist.d.ts.map +0 -1
- package/dist/types/components/files/private/file-actions.d.ts +0 -30
- package/dist/types/components/files/private/file-actions.d.ts.map +0 -1
- package/dist/types/components/files/private/file-figure.d.ts +0 -36
- package/dist/types/components/files/private/file-figure.d.ts.map +0 -1
- package/dist/types/components/forms/private/label.d.ts +0 -32
- package/dist/types/components/forms/private/label.d.ts.map +0 -1
- package/dist/types/components/icon/button-icon/check-props.d.ts +0 -3
- package/dist/types/components/icon/button-icon/check-props.d.ts.map +0 -1
- package/dist/types/components/icon/check-props.d.ts +0 -3
- package/dist/types/components/icon/check-props.d.ts.map +0 -1
- package/dist/types/components/illustration/check-props.d.ts +0 -3
- package/dist/types/components/illustration/check-props.d.ts.map +0 -1
- package/dist/types/components/illustration/index.d.ts +0 -42
- package/dist/types/components/illustration/index.d.ts.map +0 -1
- package/dist/types/components/illustration.d.ts +0 -2
- package/dist/types/components/input/check-props.d.ts +0 -3
- package/dist/types/components/input/check-props.d.ts.map +0 -1
- package/dist/types/components/input/private/inner-input.d.ts +0 -136
- package/dist/types/components/input/private/inner-input.d.ts.map +0 -1
- package/dist/types/components/menu-dropdown/check-props.d.ts +0 -3
- package/dist/types/components/menu-dropdown/check-props.d.ts.map +0 -1
- package/dist/types/components/modal/check-props.d.ts +0 -3
- package/dist/types/components/modal/check-props.d.ts.map +0 -1
- package/dist/types/components/page-header/check-props.d.ts +0 -3
- package/dist/types/components/page-header/check-props.d.ts.map +0 -1
- package/dist/types/components/page-header/private/base/index.d.ts +0 -9
- package/dist/types/components/page-header/private/base/index.d.ts.map +0 -1
- package/dist/types/components/page-header/private/base.d.ts +0 -2
- package/dist/types/components/page-header/private/controls.d.ts +0 -33
- package/dist/types/components/page-header/private/controls.d.ts.map +0 -1
- package/dist/types/components/page-header/private/label.d.ts +0 -22
- package/dist/types/components/page-header/private/label.d.ts.map +0 -1
- package/dist/types/components/page-header/private/object-home/index.d.ts +0 -9
- package/dist/types/components/page-header/private/object-home/index.d.ts.map +0 -1
- package/dist/types/components/page-header/private/object-home.d.ts +0 -2
- package/dist/types/components/page-header/private/record-home/index.d.ts +0 -9
- package/dist/types/components/page-header/private/record-home/index.d.ts.map +0 -1
- package/dist/types/components/page-header/private/record-home.d.ts +0 -2
- package/dist/types/components/page-header/private/related-list/index.d.ts +0 -9
- package/dist/types/components/page-header/private/related-list/index.d.ts.map +0 -1
- package/dist/types/components/page-header/private/related-list.d.ts +0 -2
- package/dist/types/components/page-header/private/types.d.ts +0 -49
- package/dist/types/components/page-header/private/types.d.ts.map +0 -1
- package/dist/types/components/panel/filtering/check-props.d.ts +0 -3
- package/dist/types/components/panel/filtering/check-props.d.ts.map +0 -1
- package/dist/types/components/panel/filtering/private/panel-footer.d.ts +0 -25
- package/dist/types/components/panel/filtering/private/panel-footer.d.ts.map +0 -1
- package/dist/types/components/panel/filtering/private/panel-header.d.ts +0 -47
- package/dist/types/components/panel/filtering/private/panel-header.d.ts.map +0 -1
- package/dist/types/components/pill-container/check-props.d.ts +0 -3
- package/dist/types/components/pill-container/check-props.d.ts.map +0 -1
- package/dist/types/components/pill-container/private/selected-listbox.d.ts +0 -83
- package/dist/types/components/pill-container/private/selected-listbox.d.ts.map +0 -1
- package/dist/types/components/popover/check-props.d.ts +0 -3
- package/dist/types/components/popover/check-props.d.ts.map +0 -1
- package/dist/types/components/progress-indicator/check-props.d.ts +0 -3
- package/dist/types/components/progress-indicator/check-props.d.ts.map +0 -1
- package/dist/types/components/progress-indicator/private/path.d.ts +0 -48
- package/dist/types/components/progress-indicator/private/path.d.ts.map +0 -1
- package/dist/types/components/progress-indicator/private/progress-bar.d.ts +0 -27
- package/dist/types/components/progress-indicator/private/progress-bar.d.ts.map +0 -1
- package/dist/types/components/progress-indicator/private/progress.d.ts +0 -45
- package/dist/types/components/progress-indicator/private/progress.d.ts.map +0 -1
- package/dist/types/components/progress-indicator/private/step-vertical.d.ts +0 -59
- package/dist/types/components/progress-indicator/private/step-vertical.d.ts.map +0 -1
- package/dist/types/components/progress-indicator/private/step.d.ts +0 -78
- package/dist/types/components/progress-indicator/private/step.d.ts.map +0 -1
- package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts +0 -41
- package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts.map +0 -1
- package/dist/types/components/progress-ring/private/ring-shape.d.ts +0 -34
- package/dist/types/components/progress-ring/private/ring-shape.d.ts.map +0 -1
- package/dist/types/components/radio/check-props.d.ts +0 -4
- package/dist/types/components/radio/check-props.d.ts.map +0 -1
- package/dist/types/components/radio-group/check-props.d.ts +0 -3
- package/dist/types/components/radio-group/check-props.d.ts.map +0 -1
- package/dist/types/components/scoped-notification/check-props.d.ts +0 -3
- package/dist/types/components/scoped-notification/check-props.d.ts.map +0 -1
- package/dist/types/components/setup-assistant/check-props.d.ts +0 -3
- package/dist/types/components/setup-assistant/check-props.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/check-props.d.ts +0 -3
- package/dist/types/components/simple-data-table/check-props.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/column-check-props.d.ts +0 -3
- package/dist/types/components/simple-data-table/column-check-props.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/private/cell-context.d.ts +0 -8
- package/dist/types/components/simple-data-table/private/cell-context.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/private/cell-fixed.d.ts +0 -10
- package/dist/types/components/simple-data-table/private/cell-fixed.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/private/context-helper.d.ts +0 -14
- package/dist/types/components/simple-data-table/private/context-helper.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/private/head.d.ts +0 -39
- package/dist/types/components/simple-data-table/private/head.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/private/header-cell.d.ts +0 -39
- package/dist/types/components/simple-data-table/private/header-cell.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/private/link.d.ts +0 -11
- package/dist/types/components/simple-data-table/private/link.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/private/row.d.ts +0 -44
- package/dist/types/components/simple-data-table/private/row.d.ts.map +0 -1
- package/dist/types/components/simple-data-table/private/table-context.d.ts +0 -20
- package/dist/types/components/simple-data-table/private/table-context.d.ts.map +0 -1
- package/dist/types/components/slider/check-props.d.ts +0 -3
- package/dist/types/components/slider/check-props.d.ts.map +0 -1
- package/dist/types/components/spinner/check-props.d.ts +0 -3
- package/dist/types/components/spinner/check-props.d.ts.map +0 -1
- package/dist/types/components/split-view/check-props.d.ts +0 -3
- package/dist/types/components/split-view/check-props.d.ts.map +0 -1
- package/dist/types/components/split-view/listbox-check-props.d.ts +0 -4
- package/dist/types/components/split-view/listbox-check-props.d.ts.map +0 -1
- package/dist/types/components/split-view/private/list-item-content.d.ts +0 -23
- package/dist/types/components/split-view/private/list-item-content.d.ts.map +0 -1
- package/dist/types/components/split-view/private/toggle-button.d.ts +0 -33
- package/dist/types/components/split-view/private/toggle-button.d.ts.map +0 -1
- package/dist/types/components/tabs/check-props.d.ts +0 -3
- package/dist/types/components/tabs/check-props.d.ts.map +0 -1
- package/dist/types/components/tabs/private/tab-panel.d.ts +0 -45
- package/dist/types/components/tabs/private/tab-panel.d.ts.map +0 -1
- package/dist/types/components/tabs/private/tab.d.ts +0 -59
- package/dist/types/components/tabs/private/tab.d.ts.map +0 -1
- package/dist/types/components/tabs/private/tabs-list.d.ts +0 -27
- package/dist/types/components/tabs/private/tabs-list.d.ts.map +0 -1
- package/dist/types/components/textarea/check-props.d.ts +0 -3
- package/dist/types/components/textarea/check-props.d.ts.map +0 -1
- package/dist/types/components/toast/check-props.d.ts +0 -3
- package/dist/types/components/toast/check-props.d.ts.map +0 -1
- package/dist/types/components/tooltip/check-props.d.ts +0 -3
- package/dist/types/components/tooltip/check-props.d.ts.map +0 -1
- package/dist/types/components/tooltip/private/field-level-help-tooltip.d.ts +0 -20
- package/dist/types/components/tooltip/private/field-level-help-tooltip.d.ts.map +0 -1
- package/dist/types/components/tree/check-props.d.ts +0 -4
- package/dist/types/components/tree/check-props.d.ts.map +0 -1
- package/dist/types/components/tree/private/branch.d.ts +0 -60
- package/dist/types/components/tree/private/branch.d.ts.map +0 -1
- package/dist/types/components/tree/private/item.d.ts +0 -46
- package/dist/types/components/tree/private/item.d.ts.map +0 -1
- package/dist/types/components/tree/private/render-branch.d.ts +0 -48
- package/dist/types/components/tree/private/render-branch.d.ts.map +0 -1
- package/dist/types/components/tree/private/render-initial-branch.d.ts +0 -14
- package/dist/types/components/tree/private/render-initial-branch.d.ts.map +0 -1
- package/dist/types/components/trial-bar/check-props.d.ts +0 -3
- package/dist/types/components/trial-bar/check-props.d.ts.map +0 -1
- package/dist/types/components/utilities/UNSAFE_direction/private/language-direction.d.ts +0 -53
- package/dist/types/components/utilities/UNSAFE_direction/private/language-direction.d.ts.map +0 -1
- package/dist/types/components/utilities/utility-icon/check-props.d.ts +0 -3
- package/dist/types/components/utilities/utility-icon/check-props.d.ts.map +0 -1
- package/dist/types/components/vertical-navigation/check-props.d.ts +0 -4
- package/dist/types/components/vertical-navigation/check-props.d.ts.map +0 -1
- package/dist/types/components/vertical-navigation/private/item.d.ts +0 -27
- package/dist/types/components/vertical-navigation/private/item.d.ts.map +0 -1
- package/dist/types/components/welcome-mat/check-props.d.ts +0 -3
- package/dist/types/components/welcome-mat/check-props.d.ts.map +0 -1
- package/dist/types/icons/action/index.d.ts +0 -3
- package/dist/types/icons/action/index.d.ts.map +0 -1
- package/dist/types/icons/custom/index.d.ts +0 -3
- package/dist/types/icons/custom/index.d.ts.map +0 -1
- package/dist/types/icons/doctype/index.d.ts +0 -3
- package/dist/types/icons/doctype/index.d.ts.map +0 -1
- package/dist/types/icons/standard/index.d.ts +0 -3
- package/dist/types/icons/standard/index.d.ts.map +0 -1
- package/dist/types/icons/utility/index.d.ts +0 -3
- package/dist/types/icons/utility/index.d.ts.map +0 -1
- package/dist/types/utilities/class-names.d.ts +0 -3
- package/dist/types/utilities/class-names.d.ts.map +0 -1
- package/dist/types/utilities/color.d.ts +0 -134
- package/dist/types/utilities/color.d.ts.map +0 -1
- package/dist/types/utilities/date.d.ts +0 -18
- package/dist/types/utilities/date.d.ts.map +0 -1
- package/dist/types/utilities/dialog-helpers.d.ts +0 -8
- package/dist/types/utilities/dialog-helpers.d.ts.map +0 -1
- package/dist/types/utilities/dom-element-focus.d.ts +0 -14
- package/dist/types/utilities/dom-element-focus.d.ts.map +0 -1
- package/dist/types/utilities/dom.d.ts +0 -11
- package/dist/types/utilities/dom.d.ts.map +0 -1
- package/dist/types/utilities/event.d.ts +0 -8
- package/dist/types/utilities/event.d.ts.map +0 -1
- package/dist/types/utilities/execution-environment.d.ts +0 -5
- package/dist/types/utilities/execution-environment.d.ts.map +0 -1
- package/dist/types/utilities/generate-id.d.ts +0 -7
- package/dist/types/utilities/generate-id.d.ts.map +0 -1
- package/dist/types/utilities/get-aria-props.d.ts +0 -2
- package/dist/types/utilities/get-aria-props.d.ts.map +0 -1
- package/dist/types/utilities/get-component-doc.d.ts +0 -3
- package/dist/types/utilities/get-component-doc.d.ts.map +0 -1
- package/dist/types/utilities/get-data-props.d.ts +0 -2
- package/dist/types/utilities/get-data-props.d.ts.map +0 -1
- package/dist/types/utilities/get-form-props.d.ts +0 -2
- package/dist/types/utilities/get-form-props.d.ts.map +0 -1
- package/dist/types/utilities/hooks/index.d.ts +0 -3
- package/dist/types/utilities/hooks/index.d.ts.map +0 -1
- package/dist/types/utilities/hooks/use-click-outside.d.ts +0 -32
- package/dist/types/utilities/hooks/use-click-outside.d.ts.map +0 -1
- package/dist/types/utilities/hooks/use-controllable-state.d.ts +0 -23
- package/dist/types/utilities/hooks/use-controllable-state.d.ts.map +0 -1
- package/dist/types/utilities/hooks.d.ts +0 -1
- package/dist/types/utilities/index.d.ts +0 -4
- package/dist/types/utilities/index.d.ts.map +0 -1
- package/dist/types/utilities/is-react-component.d.ts +0 -3
- package/dist/types/utilities/is-react-component.d.ts.map +0 -1
- package/dist/types/utilities/key-buffer.d.ts +0 -3
- package/dist/types/utilities/key-buffer.d.ts.map +0 -1
- package/dist/types/utilities/key-callbacks.d.ts +0 -7
- package/dist/types/utilities/key-callbacks.d.ts.map +0 -1
- package/dist/types/utilities/key-code.d.ts +0 -67
- package/dist/types/utilities/key-code.d.ts.map +0 -1
- package/dist/types/utilities/key-letter-menu-item-select.d.ts +0 -8
- package/dist/types/utilities/key-letter-menu-item-select.d.ts.map +0 -1
- package/dist/types/utilities/keyboard-navigable-dialog.d.ts +0 -11
- package/dist/types/utilities/keyboard-navigable-dialog.d.ts.map +0 -1
- package/dist/types/utilities/keyboard-navigate.d.ts +0 -15
- package/dist/types/utilities/keyboard-navigate.d.ts.map +0 -1
- package/dist/types/utilities/letter-key-code.d.ts +0 -5
- package/dist/types/utilities/letter-key-code.d.ts.map +0 -1
- package/dist/types/utilities/menu-item-select-scroll.d.ts +0 -8
- package/dist/types/utilities/menu-item-select-scroll.d.ts.map +0 -1
- package/dist/types/utilities/object.d.ts +0 -6
- package/dist/types/utilities/object.d.ts.map +0 -1
- package/dist/types/utilities/product-tokens/icon-backgrounds.d.ts +0 -12
- package/dist/types/utilities/product-tokens/icon-backgrounds.d.ts.map +0 -1
- package/dist/types/utilities/sample-data/global-navigation-bar/index.d.ts +0 -90
- package/dist/types/utilities/sample-data/global-navigation-bar/index.d.ts.map +0 -1
- package/dist/types/utilities/sample-data/global-navigation-bar.d.ts +0 -1
- package/dist/types/utilities/sample-data/tree/index.d.ts +0 -207
- package/dist/types/utilities/sample-data/tree/index.d.ts.map +0 -1
- package/dist/types/utilities/sample-data/tree/nodes-base.d.ts +0 -78
- package/dist/types/utilities/sample-data/tree/nodes-base.d.ts.map +0 -1
- package/dist/types/utilities/sample-data/tree/nodes-with-initial-state.d.ts +0 -102
- package/dist/types/utilities/sample-data/tree/nodes-with-initial-state.d.ts.map +0 -1
- package/dist/types/utilities/sample-data/tree/nodes-with-large-dataset.d.ts +0 -29
- package/dist/types/utilities/sample-data/tree/nodes-with-large-dataset.d.ts.map +0 -1
- package/dist/types/utilities/sample-data/tree.d.ts +0 -2
- package/dist/types/utilities/sample-data/vertical-navigation/index.d.ts +0 -23
- package/dist/types/utilities/sample-data/vertical-navigation/index.d.ts.map +0 -1
- package/dist/types/utilities/sample-data/vertical-navigation.d.ts +0 -1
- package/dist/types/utilities/tabbable.d.ts +0 -14
- package/dist/types/utilities/tabbable.d.ts.map +0 -1
- package/dist/types/utilities/warning/check-app-element-set.d.ts +0 -3
- package/dist/types/utilities/warning/check-app-element-set.d.ts.map +0 -1
- package/dist/types/utilities/warning/component-has-moved.d.ts +0 -8
- package/dist/types/utilities/warning/component-has-moved.d.ts.map +0 -1
- package/dist/types/utilities/warning/component-is-deprecated.d.ts +0 -6
- package/dist/types/utilities/warning/component-is-deprecated.d.ts.map +0 -1
- package/dist/types/utilities/warning/component-is-prototype.d.ts +0 -3
- package/dist/types/utilities/warning/component-is-prototype.d.ts.map +0 -1
- package/dist/types/utilities/warning/deprecated-property-value.d.ts +0 -3
- package/dist/types/utilities/warning/deprecated-property-value.d.ts.map +0 -1
- package/dist/types/utilities/warning/deprecated-property.d.ts +0 -3
- package/dist/types/utilities/warning/deprecated-property.d.ts.map +0 -1
- package/dist/types/utilities/warning/future-property.d.ts +0 -3
- package/dist/types/utilities/warning/future-property.d.ts.map +0 -1
- package/dist/types/utilities/warning/has-children-without-display-name-of.d.ts +0 -3
- package/dist/types/utilities/warning/has-children-without-display-name-of.d.ts.map +0 -1
- package/dist/types/utilities/warning/if-one-then-both-required-property.d.ts +0 -3
- package/dist/types/utilities/warning/if-one-then-both-required-property.d.ts.map +0 -1
- package/dist/types/utilities/warning/incompatible-props.d.ts +0 -3
- package/dist/types/utilities/warning/incompatible-props.d.ts.map +0 -1
- package/dist/types/utilities/warning/is-trigger-tabbable.d.ts +0 -3
- package/dist/types/utilities/warning/is-trigger-tabbable.d.ts.map +0 -1
- package/dist/types/utilities/warning/low-priority-warning.d.ts +0 -3
- package/dist/types/utilities/warning/low-priority-warning.d.ts.map +0 -1
- package/dist/types/utilities/warning/one-of-component.d.ts +0 -3
- package/dist/types/utilities/warning/one-of-component.d.ts.map +0 -1
- package/dist/types/utilities/warning/one-of-required-property.d.ts +0 -3
- package/dist/types/utilities/warning/one-of-required-property.d.ts.map +0 -1
- package/dist/types/utilities/warning/only-one-of-properties.d.ts +0 -3
- package/dist/types/utilities/warning/only-one-of-properties.d.ts.map +0 -1
- package/dist/types/utilities/warning/render-function-return-contents-lack-display-name.d.ts +0 -3
- package/dist/types/utilities/warning/render-function-return-contents-lack-display-name.d.ts.map +0 -1
- package/dist/types/utilities/warning/required-property.d.ts +0 -3
- package/dist/types/utilities/warning/required-property.d.ts.map +0 -1
- package/dist/types/utilities/warning/sunset-property.d.ts +0 -3
- package/dist/types/utilities/warning/sunset-property.d.ts.map +0 -1
- package/dist/types/utilities/warning/url-exists.d.ts +0 -3
- package/dist/types/utilities/warning/url-exists.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/slider/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport {\n\tforwardRef,\n\tuseId,\n\tuseCallback,\n\tuseEffect,\n\ttype ChangeEvent,\n\ttype
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/slider/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport {\n\tforwardRef,\n\tuseId,\n\tuseCallback,\n\tuseEffect,\n\ttype ChangeEvent,\n\ttype InputEvent,\n\ttype ReactNode,\n} from 'react';\nimport classNames from 'classnames';\nimport { SLIDER } from '../../utilities/constants';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Slider size options\n */\nexport type SliderSize = 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Assistive text for Slider\n */\nexport interface SliderAssistiveText {\n\t/** Text for disabled state */\n\tdisabled?: string;\n\t/** Visually hidden label */\n\tlabel?: string;\n}\n\n/**\n * Labels for Slider\n */\nexport interface SliderLabels {\n\t/** Error message shown below the slider while `hasError` is true */\n\terror?: ReactNode;\n\t/** Visible label */\n\tlabel?: ReactNode;\n}\n\nexport type SliderChangeHandler = (\n\tevent: ChangeEvent<HTMLInputElement>,\n\tdata: { value: number }\n) => void;\n\n/**\n * `onChange` is required unless the slider is `disabled`: Slider is\n * controlled, so without it the thumb won't move.\n */\nexport type SliderChangeProps =\n\t| {\n\t\t\t/**\n\t\t\t * Called when the value changes. Slider is controlled: update `value`\n\t\t\t * from `data.value`, or the thumb won't move. Required unless `disabled`\n\t\t\t * is set.\n\t\t\t */\n\t\t\tonChange: SliderChangeHandler;\n\t }\n\t| { disabled: true; onChange?: SliderChangeHandler };\n\ninterface SliderBaseProps {\n\t/** ARIA describedby attribute */\n\t'aria-describedby'?: string;\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `disabled`: Read after the range while the slider is disabled\n\t * * `label`: Visually hidden label. Use instead of `labels.label`.\n\t */\n\tassistiveText?: SliderAssistiveText;\n\t/** CSS classes for the root `.slds-form-element` div */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use `className`, which lands on the same element. */\n\tclassNameContainer?: string | string[] | Record<string, boolean>;\n\t/** Whether the slider is disabled */\n\tdisabled?: boolean;\n\t/** @deprecated Use `labels.error` and `hasError` instead. */\n\terrorText?: string;\n\t/** Puts the slider in an error state and shows `labels.error` */\n\thasError?: boolean;\n\t/** HTML id attribute */\n\tid?: string;\n\t/** @deprecated Use `labels.label` instead. */\n\tlabel?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `error`: Error message shown below the slider while `hasError` is true\n\t * * `label`: Visible label. Use `assistiveText.label` for a visually hidden label.\n\t */\n\tlabels?: SliderLabels;\n\t/** Maximum value (default: 100) */\n\tmax?: number;\n\t/** Minimum value (default: 0) */\n\tmin?: number;\n\t/** Form input name */\n\tname?: string;\n\t/** Called on input event */\n\tonInput?: (\n\t\tevent: InputEvent<HTMLInputElement>,\n\t\tdata: { value: number }\n\t) => void;\n\t/** Size of the slider */\n\tsize?: SliderSize;\n\t/** Step increment (default: 1) */\n\tstep?: number;\n\t/** The current value. Required: Slider is controlled. */\n\tvalue: number;\n\t/** Display vertically */\n\tvertical?: boolean;\n}\n\n/**\n * Props for the Slider component\n */\nexport type SliderProps = SliderBaseProps & SliderChangeProps;\n\n/**\n * Props removed in v11. They are ignored at runtime and warn in development.\n */\ninterface SliderRemovedProps {\n\t/** @removed Slider is controlled: pass `value` and update it in `onChange`. */\n\tdefaultValue?: unknown;\n}\n\nconst defaultAssistiveText: SliderAssistiveText = {\n\tdisabled: 'Disabled',\n};\n\n/**\n * The ability to style sliders with CSS varies across browsers.\n * Using this component ensures sliders look the same everywhere.\n */\nconst Slider = forwardRef<HTMLDivElement, SliderProps>((props, ref) => {\n\tconst {\n\t\t'aria-describedby': ariaDescribedBy,\n\t\tassistiveText: propAssistiveText,\n\t\tclassName,\n\t\tclassNameContainer,\n\t\tdefaultValue,\n\t\tdisabled,\n\t\terrorText,\n\t\thasError: hasErrorProp,\n\t\tid: propId,\n\t\tlabel: labelProp,\n\t\tlabels,\n\t\tmax = 100,\n\t\tmin = 0,\n\t\tname,\n\t\tonChange,\n\t\tonInput,\n\t\tsize,\n\t\tstep = 1,\n\t\tvalue,\n\t\tvertical,\n\t\t...rest\n\t} = props as SliderProps & SliderRemovedProps;\n\n\tconst generatedId = useId();\n\tconst generatedErrorId = useId();\n\n\tconst id = propId || generatedId;\n\t// `errorText` is deprecated: it sets both the error state and the message\n\tconst hasError = hasErrorProp ?? !!errorText;\n\tconst errorMessage = hasError ? (labels?.error ?? errorText) : undefined;\n\tconst errorId =\n\t\tariaDescribedBy || (errorMessage ? generatedErrorId : undefined);\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\t// `label` is deprecated\n\tconst label = labels?.label ?? labelProp;\n\tconst labelText = label || assistiveText.label;\n\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tSLIDER,\n\t\t\t{\n\t\t\t\tassistiveText: propAssistiveText,\n\t\t\t\tclassNameContainer,\n\t\t\t\tdefaultValue,\n\t\t\t\tdisabled,\n\t\t\t\terrorText,\n\t\t\t\tlabel: labelProp,\n\t\t\t\tlabels,\n\t\t\t\tonChange,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t}, [\n\t\tpropAssistiveText,\n\t\tclassNameContainer,\n\t\tdefaultValue,\n\t\tdisabled,\n\t\terrorText,\n\t\tlabelProp,\n\t\tlabels,\n\t\tonChange,\n\t]);\n\n\tconst ariaProps = getAriaProps(rest) as Record<string, unknown>;\n\tif (errorId) {\n\t\tariaProps['aria-describedby'] = errorId;\n\t}\n\n\tconst handleChange = useCallback(\n\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\tonChange?.(event, { value: Number(event.target.value) });\n\t\t},\n\t\t[onChange]\n\t);\n\n\tconst handleInput = useCallback(\n\t\t(event: InputEvent<HTMLInputElement>) => {\n\t\t\tonInput?.(event, {\n\t\t\t\tvalue: Number((event.target as HTMLInputElement).value),\n\t\t\t});\n\t\t},\n\t\t[onInput]\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-form-element',\n\t\t\t\t{ 'slds-has-error': hasError },\n\t\t\t\tclassNameContainer,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tref={ref}\n\t\t>\n\t\t\t<label\n\t\t\t\tclassName={classNames('slds-form-element__label', {\n\t\t\t\t\t'slds-assistive-text': assistiveText.label && !label,\n\t\t\t\t})}\n\t\t\t\thtmlFor={id}\n\t\t\t>\n\t\t\t\t<span className=\"slds-slider-label\">\n\t\t\t\t\t{labelText && (\n\t\t\t\t\t\t<span className=\"slds-slider-label__label\">{labelText}</span>\n\t\t\t\t\t)}\n\t\t\t\t\t<span className=\"slds-slider-label__range\">\n\t\t\t\t\t\t{min} - {max}\n\t\t\t\t\t</span>\n\t\t\t\t\t{disabled && (\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t{assistiveText.disabled}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</span>\n\t\t\t</label>\n\t\t\t<div className=\"slds-form-element__control\">\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames('slds-slider', {\n\t\t\t\t\t\t'slds-slider_vertical': vertical,\n\t\t\t\t\t\t'slds-size_x-small': size === 'x-small',\n\t\t\t\t\t\t'slds-size_small': size === 'small',\n\t\t\t\t\t\t'slds-size_medium': size === 'medium',\n\t\t\t\t\t\t'slds-size_large': size === 'large',\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"range\"\n\t\t\t\t\t\tid={id}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tclassName=\"slds-slider__range\"\n\t\t\t\t\t\tmin={min}\n\t\t\t\t\t\tmax={max}\n\t\t\t\t\t\tstep={step}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\tonInput={handleInput}\n\t\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"slds-slider__value\" aria-hidden=\"true\">\n\t\t\t\t\t\t{value}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t{errorMessage && (\n\t\t\t\t\t<div id={errorId} className=\"slds-form-element__help\">\n\t\t\t\t\t\t{errorMessage}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n});\n\nSlider.displayName = SLIDER;\n\nexport default Slider;\n"],"mappings":";;;;;;;;AA8HA,IAAM,IAA4C,EACjD,UAAU,WACX,GAMM,IAAS,GAAyC,GAAO,MAAQ;CACtE,IAAM,EACL,oBAAoB,GACpB,eAAe,GACf,cACA,uBACA,iBACA,aACA,cACA,UAAU,GACV,IAAI,GACJ,OAAO,GACP,WACA,SAAM,KACN,SAAM,GACN,SACA,aACA,YACA,SACA,UAAO,GACP,UACA,aACA,GAAG,MACA,GAEE,IAAc,EAAM,GACpB,IAAmB,EAAM,GAEzB,IAAK,KAAU,GAEf,IAAW,KAAgB,CAAC,CAAC,GAC7B,IAAe,IAAY,GAAQ,SAAS,IAAa,KAAA,GACzD,IACL,MAAoB,IAAe,IAAmB,KAAA,IACjD,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB,GAEhE,IAAQ,GAAQ,SAAS,GACzB,IAAY,KAAS,EAAc;CAEzC,QAAgB;EACf,EACC,GACA;GACC,eAAe;GACf;GACA;GACA;GACA;GACA,OAAO;GACP;GACA;EACD,GACA,CACD;CACD,GAAG;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CAED,IAAM,IAAY,EAAa,CAAI;CACnC,AAAI,MACH,EAAU,sBAAsB;CAGjC,IAAM,IAAe,GACnB,MAAyC;EACzC,IAAW,GAAO,EAAE,OAAO,OAAO,EAAM,OAAO,KAAK,EAAE,CAAC;CACxD,GACA,CAAC,CAAQ,CACV,GAEM,IAAc,GAClB,MAAwC;EACxC,IAAU,GAAO,EAChB,OAAO,OAAQ,EAAM,OAA4B,KAAK,EACvD,CAAC;CACF,GACA,CAAC,CAAO,CACT;CAEA,OACC,kBAAC,OAAD;EACC,WAAW,EACV,qBACA,EAAE,kBAAkB,EAAS,GAC7B,GACA,CACD;EACK;EAPN,UAAA,CASC,kBAAC,SAAD;GACC,WAAW,EAAW,4BAA4B,EACjD,uBAAuB,EAAc,SAAS,CAAC,EAChD,CAAC;GACD,SAAS;GAET,UAAA,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA;KACE,KACA,kBAAC,QAAD;MAAM,WAAU;MAA4B,UAAA;KAAgB,CAAA;KAE7D,kBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA;OACE;OAAI;OAAI;MACJ;;KACL,KACA,kBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,KACA,EAAc,QACV;;IAEF;;EACA,CAAA,GACP,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACC,kBAAC,OAAD;IACC,WAAW,EAAW,eAAe;KACpC,wBAAwB;KACxB,qBAAqB,MAAS;KAC9B,mBAAmB,MAAS;KAC5B,oBAAoB,MAAS;KAC7B,mBAAmB,MAAS;IAC7B,CAAC;IAPF,UAAA,CASC,kBAAC,SAAD;KACC,MAAK;KACD;KACE;KACN,WAAU;KACL;KACA;KACC;KACI;KACV,UAAU;KACV,SAAS;KACT,GAAI;KACG;IACP,CAAA,GACD,kBAAC,QAAD;KAAM,WAAU;KAAqB,eAAY;KAC/C,UAAA;IACI,CAAA,CACF;GACJ,CAAA,GAAA,KACA,kBAAC,OAAD;IAAK,IAAI;IAAS,WAAU;IAC1B,UAAA;GACG,CAAA,CAEF;EACD,CAAA,CAAA;;AAEP,CAAC;AAED,EAAO,cAAc"}
|
|
@@ -4,7 +4,7 @@ import t from "../../utilities/warning/deprecated-property.js";
|
|
|
4
4
|
var n = function() {};
|
|
5
5
|
process.env.NODE_ENV !== "production" && (n = function(n, r = {}, i) {
|
|
6
6
|
let a = e(i);
|
|
7
|
-
t(n, r.containerClassName, "containerClassName", "className", a("className")), t(n, r.containerStyle, "containerStyle", "style", a("style"));
|
|
7
|
+
t(n, r.containerClassName, "containerClassName", "className", a("className")), t(n, r.containerStyle, "containerStyle", "style", a("style")), t(n, r.isInline, "isInline", "placement=\"inline\"", a("placement")), t(n, r.isInput, "isInput", "placement=\"input\"", a("placement"));
|
|
8
8
|
});
|
|
9
9
|
var r = n;
|
|
10
10
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/spinner/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props = {}, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.containerClassName,\n\t\t\t'containerClassName',\n\t\t\t'className',\n\t\t\tcreateDocUrl('className')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.containerStyle,\n\t\t\t'containerStyle',\n\t\t\t'style',\n\t\t\tcreateDocUrl('style')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;AAOA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,IAAQ,CAAC,GAAG,GAAS;CACxE,IAAM,IAAe,EAAkB,CAAO;
|
|
1
|
+
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/spinner/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props = {}, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.containerClassName,\n\t\t\t'containerClassName',\n\t\t\t'className',\n\t\t\tcreateDocUrl('className')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.containerStyle,\n\t\t\t'containerStyle',\n\t\t\t'style',\n\t\t\tcreateDocUrl('style')\n\t\t);\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.isInline,\n\t\t\t'isInline',\n\t\t\t'placement=\"inline\"',\n\t\t\tcreateDocUrl('placement')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.isInput,\n\t\t\t'isInput',\n\t\t\t'placement=\"input\"',\n\t\t\tcreateDocUrl('placement')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;AAOA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,IAAQ,CAAC,GAAG,GAAS;CACxE,IAAM,IAAe,EAAkB,CAAO;CAwB9C,AAtBA,EACC,GACA,EAAM,oBACN,sBACA,aACA,EAAa,WAAW,CACzB,GACA,EACC,GACA,EAAM,gBACN,kBACA,SACA,EAAa,OAAO,CACrB,GAEA,EACC,GACA,EAAM,UACN,YACA,wBACA,EAAa,WAAW,CACzB,GACA,EACC,GACA,EAAM,SACN,WACA,uBACA,EAAa,WAAW,CACzB;AACD;AAGD,IAAA,IAAe"}
|
|
@@ -5,48 +5,51 @@ import { forwardRef as r, useEffect as i } from "react";
|
|
|
5
5
|
import a from "classnames";
|
|
6
6
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
//#region components/spinner/index.tsx
|
|
8
|
-
var c = { label: "Loading..." }, l = r((
|
|
8
|
+
var c = { label: "Loading..." }, l = r((r, l) => {
|
|
9
|
+
let { assistiveText: u = c, className: d, classNameSpinner: f, containerClassName: p, containerStyle: m, hasContainer: h = !0, id: g, isDelayed: _ = !1, isInline: v, isInput: y, placement: b, size: x = "medium", style: S, variant: C = "base" } = r;
|
|
9
10
|
i(() => {
|
|
10
11
|
t(e, {
|
|
11
|
-
containerClassName:
|
|
12
|
-
containerStyle:
|
|
12
|
+
containerClassName: p,
|
|
13
|
+
containerStyle: m,
|
|
14
|
+
isInline: v,
|
|
15
|
+
isInput: y
|
|
13
16
|
}, n);
|
|
14
17
|
}, []);
|
|
15
|
-
let
|
|
18
|
+
let w = b ?? (y ? "input" : v ? "inline" : "container"), T = {
|
|
16
19
|
...c,
|
|
17
|
-
...
|
|
18
|
-
}.label,
|
|
19
|
-
...
|
|
20
|
-
...
|
|
21
|
-
} :
|
|
22
|
-
"slds-spinner_inline":
|
|
23
|
-
"slds-input__spinner":
|
|
24
|
-
"slds-spinner_brand":
|
|
25
|
-
"slds-spinner_inverse":
|
|
26
|
-
"slds-spinner_delayed":
|
|
27
|
-
[`slds-spinner_${
|
|
28
|
-
},
|
|
20
|
+
...u
|
|
21
|
+
}.label, E = h ? a(p, d) : d, D = h ? {
|
|
22
|
+
...m,
|
|
23
|
+
...S
|
|
24
|
+
} : S, O = a("slds-spinner", {
|
|
25
|
+
"slds-spinner_inline": w === "inline",
|
|
26
|
+
"slds-input__spinner": w === "input",
|
|
27
|
+
"slds-spinner_brand": C === "brand",
|
|
28
|
+
"slds-spinner_inverse": C === "inverse",
|
|
29
|
+
"slds-spinner_delayed": _,
|
|
30
|
+
[`slds-spinner_${x}`]: x
|
|
31
|
+
}, f, h ? void 0 : E), k = /* @__PURE__ */ s("div", {
|
|
29
32
|
"aria-hidden": "false",
|
|
30
|
-
className:
|
|
31
|
-
id:
|
|
32
|
-
ref:
|
|
33
|
+
className: O,
|
|
34
|
+
id: g,
|
|
35
|
+
ref: h ? void 0 : l,
|
|
33
36
|
role: "status",
|
|
34
|
-
style:
|
|
37
|
+
style: h ? void 0 : D,
|
|
35
38
|
children: [
|
|
36
|
-
|
|
39
|
+
T && /* @__PURE__ */ o("span", {
|
|
37
40
|
className: "slds-assistive-text",
|
|
38
|
-
children:
|
|
41
|
+
children: T
|
|
39
42
|
}),
|
|
40
43
|
/* @__PURE__ */ o("div", { className: "slds-spinner__dot-a" }),
|
|
41
44
|
/* @__PURE__ */ o("div", { className: "slds-spinner__dot-b" })
|
|
42
45
|
]
|
|
43
46
|
});
|
|
44
|
-
return
|
|
45
|
-
className: a(
|
|
46
|
-
ref:
|
|
47
|
-
style:
|
|
48
|
-
children:
|
|
49
|
-
}) :
|
|
47
|
+
return h ? /* @__PURE__ */ o("div", {
|
|
48
|
+
className: a(E, "slds-spinner_container"),
|
|
49
|
+
ref: l,
|
|
50
|
+
style: D,
|
|
51
|
+
children: k
|
|
52
|
+
}) : k;
|
|
50
53
|
});
|
|
51
54
|
l.displayName = e;
|
|
52
55
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/spinner/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport { forwardRef, useEffect, type CSSProperties } from 'react';\nimport classNames from 'classnames';\nimport { SPINNER } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Spinner size options\n */\nexport type SpinnerSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Spinner color variant\n */\nexport type SpinnerVariant = 'base' | 'brand' | 'inverse';\n\n/**\n * Assistive text for Spinner\n */\nexport interface SpinnerAssistiveText {\n\t/** Text read by screen readers */\n\tlabel?: string;\n}\n\n/**\n * Props for the Spinner component\n */\
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/spinner/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport { forwardRef, useEffect, type CSSProperties } from 'react';\nimport classNames from 'classnames';\nimport { SPINNER } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Spinner size options\n */\nexport type SpinnerSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Spinner color variant\n */\nexport type SpinnerVariant = 'base' | 'brand' | 'inverse';\n\n/**\n * Where the spinner sits: in a container (`container`), inline in the document flow\n * (`inline`), or inside an input field (`input`).\n */\nexport type SpinnerPlacement = 'container' | 'inline' | 'input';\n\n/**\n * Assistive text for Spinner\n */\nexport interface SpinnerAssistiveText {\n\t/** Text read by screen readers */\n\tlabel?: string;\n}\n\n/**\n * Props for the Spinner component\n */\ninterface SpinnerBaseProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: SpinnerAssistiveText;\n\t/**\n\t * CSS classes for the root element: the `.slds-spinner_container` div, or the\n\t * `.slds-spinner` div when `hasContainer` is `false`.\n\t */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** CSS classes for the `.slds-spinner` div */\n\tclassNameSpinner?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use `className`, which lands on the container when `hasContainer` is `true`. */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** @deprecated Use `style`, which lands on the container when `hasContainer` is `true`. */\n\tcontainerStyle?: CSSProperties;\n\t/** Render inside a container div */\n\thasContainer?: boolean;\n\t/** Unique identifier */\n\tid?: string;\n\t/** Add 300ms delay before showing */\n\tisDelayed?: boolean;\n\t/** Size of the spinner */\n\tsize?: SpinnerSize;\n\t/** Styles for the root element (see `className`) */\n\tstyle?: CSSProperties;\n\t/** Color variant */\n\tvariant?: SpinnerVariant;\n}\n\n/** Where the spinner sits. Replaces `isInline` and `isInput`. */\ninterface SpinnerPlacementProps {\n\t/** Where the spinner sits. Defaults to `container`. */\n\tplacement?: SpinnerPlacement;\n\tisInline?: never;\n\tisInput?: never;\n}\n\n/** @deprecated Use `placement=\"inline\"`. */\ninterface SpinnerInlineProps {\n\t/** @deprecated Use `placement=\"inline\"`. */\n\tisInline?: boolean;\n\tisInput?: never;\n\tplacement?: never;\n}\n\n/** @deprecated Use `placement=\"input\"`. */\ninterface SpinnerInputProps {\n\t/** @deprecated Use `placement=\"input\"`. */\n\tisInput?: boolean;\n\tisInline?: never;\n\tplacement?: never;\n}\n\n/**\n * Props for the Spinner component. A spinner is in one place at a time, so\n * `placement` replaces the exclusive `isInline` and `isInput` flags.\n */\nexport type SpinnerProps = SpinnerBaseProps &\n\t(SpinnerPlacementProps | SpinnerInlineProps | SpinnerInputProps);\n\nconst defaultAssistiveText: SpinnerAssistiveText = { label: 'Loading...' };\n\n/**\n * Spinners are CSS loading indicators that should be shown when retrieving data\n * or performing slow computations.\n */\nconst Spinner = forwardRef<HTMLDivElement, SpinnerProps>((props, ref) => {\n\tconst {\n\t\tassistiveText = defaultAssistiveText,\n\t\tclassName,\n\t\tclassNameSpinner,\n\t\tcontainerClassName,\n\t\tcontainerStyle,\n\t\thasContainer = true,\n\t\tid,\n\t\tisDelayed = false,\n\t\tisInline: deprecatedIsInline,\n\t\tisInput: deprecatedIsInput,\n\t\tplacement: propPlacement,\n\t\tsize = 'medium',\n\t\tstyle,\n\t\tvariant = 'base',\n\t} = props;\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tSPINNER,\n\t\t\t{\n\t\t\t\tcontainerClassName,\n\t\t\t\tcontainerStyle,\n\t\t\t\tisInline: deprecatedIsInline,\n\t\t\t\tisInput: deprecatedIsInput,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []); // Only run on mount\n\n\t// `isInline` and `isInput` are the deprecated spellings of `placement`\n\tconst placement =\n\t\tpropPlacement ??\n\t\t(deprecatedIsInput ? 'input' : deprecatedIsInline ? 'inline' : 'container');\n\n\tconst mergedAssistiveText = {\n\t\t...defaultAssistiveText,\n\t\t...assistiveText,\n\t}.label;\n\n\t// The deprecated container props only ever applied to the container\n\tconst rootClassName = hasContainer\n\t\t? classNames(containerClassName, className)\n\t\t: className;\n\tconst rootStyle = hasContainer ? { ...containerStyle, ...style } : style;\n\n\tconst spinnerClassName = classNames(\n\t\t'slds-spinner',\n\t\t{\n\t\t\t'slds-spinner_inline': placement === 'inline',\n\t\t\t'slds-input__spinner': placement === 'input',\n\t\t\t'slds-spinner_brand': variant === 'brand',\n\t\t\t'slds-spinner_inverse': variant === 'inverse',\n\t\t\t'slds-spinner_delayed': isDelayed,\n\t\t\t[`slds-spinner_${size}`]: size,\n\t\t},\n\t\tclassNameSpinner,\n\t\thasContainer ? undefined : rootClassName\n\t);\n\n\tconst spinner = (\n\t\t<div\n\t\t\taria-hidden=\"false\"\n\t\t\tclassName={spinnerClassName}\n\t\t\tid={id}\n\t\t\tref={hasContainer ? undefined : ref}\n\t\t\trole=\"status\"\n\t\t\tstyle={hasContainer ? undefined : rootStyle}\n\t\t>\n\t\t\t{mergedAssistiveText && (\n\t\t\t\t<span className=\"slds-assistive-text\">{mergedAssistiveText}</span>\n\t\t\t)}\n\t\t\t<div className=\"slds-spinner__dot-a\" />\n\t\t\t<div className=\"slds-spinner__dot-b\" />\n\t\t</div>\n\t);\n\n\tif (hasContainer) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames(rootClassName, 'slds-spinner_container')}\n\t\t\t\tref={ref}\n\t\t\t\tstyle={rootStyle}\n\t\t\t>\n\t\t\t\t{spinner}\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn spinner;\n});\n\nSpinner.displayName = SPINNER;\n\nexport default Spinner;\n"],"mappings":";;;;;;;AA+FA,IAAM,IAA6C,EAAE,OAAO,aAAa,GAMnE,IAAU,GAA0C,GAAO,MAAQ;CACxE,IAAM,EACL,mBAAgB,GAChB,cACA,qBACA,uBACA,mBACA,kBAAe,IACf,OACA,eAAY,IACZ,UAAU,GACV,SAAS,GACT,WAAW,GACX,UAAO,UACP,UACA,aAAU,WACP;CACJ,QAAgB;EACf,EACC,GACA;GACC;GACA;GACA,UAAU;GACV,SAAS;EACV,GACA,CACD;CAED,GAAG,CAAC,CAAC;CAGL,IAAM,IACL,MACC,IAAoB,UAAU,IAAqB,WAAW,cAE1D,IAAsB;EAC3B,GAAG;EACH,GAAG;CACJ,EAAE,OAGI,IAAgB,IACnB,EAAW,GAAoB,CAAS,IACxC,GACG,IAAY,IAAe;EAAE,GAAG;EAAgB,GAAG;CAAM,IAAI,GAE7D,IAAmB,EACxB,gBACA;EACC,uBAAuB,MAAc;EACrC,uBAAuB,MAAc;EACrC,sBAAsB,MAAY;EAClC,wBAAwB,MAAY;EACpC,wBAAwB;GACvB,gBAAgB,MAAS;CAC3B,GACA,GACA,IAAe,KAAA,IAAY,CAC5B,GAEM,IACL,kBAAC,OAAD;EACC,eAAY;EACZ,WAAW;EACP;EACJ,KAAK,IAAe,KAAA,IAAY;EAChC,MAAK;EACL,OAAO,IAAe,KAAA,IAAY;EANnC,UAAA;GAQE,KACA,kBAAC,QAAD;IAAM,WAAU;IAAuB,UAAA;GAA0B,CAAA;GAElE,kBAAC,OAAD,EAAK,WAAU,sBAAuB,CAAA;GACtC,kBAAC,OAAD,EAAK,WAAU,sBAAuB,CAAA;EAClC;;CAeN,OAZI,IAEF,kBAAC,OAAD;EACC,WAAW,EAAW,GAAe,wBAAwB;EACxD;EACL,OAAO;EAEN,UAAA;CACG,CAAA,IAIA;AACR,CAAC;AAED,EAAQ,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","names":[],"sources":["../../../../components/split-view/header.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React from 'react';\nimport classNames from 'classnames';\nimport PageHeader, { type PageHeaderProps } from '../page-header';\n\nimport { SPLIT_VIEW_HEADER } from '../../utilities/constants';\n\
|
|
1
|
+
{"version":3,"file":"header.js","names":[],"sources":["../../../../components/split-view/header.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React from 'react';\nimport classNames from 'classnames';\nimport PageHeader, { type PageHeaderProps } from '../page-header';\n\nimport { SPLIT_VIEW_HEADER } from '../../utilities/constants';\n\n/** The Split View Header takes the same properties as `PageHeader`. */\nexport type SplitViewHeaderProps = PageHeaderProps;\n\n/**\n * The Split View Header takes the same properties as the [PageHeader](https://react.lightningdesignsystem.com/components/page-headers/) component.\n */\nconst SplitViewHeader = ({\n\tclassName,\n\t...rest\n}: SplitViewHeaderProps): React.ReactElement => (\n\t<PageHeader\n\t\tclassName={classNames(\n\t\t\t'slds-split-view__header slds-has-bottom-magnet',\n\t\t\tclassName\n\t\t)}\n\t\t{...rest}\n\t/>\n);\n\nSplitViewHeader.displayName = SPLIT_VIEW_HEADER;\n\nexport default SplitViewHeader;\n"],"mappings":";;;;;;AAeA,IAAM,KAAmB,EACxB,cACA,GAAG,QAEH,kBAAC,GAAD;CACC,WAAW,EACV,kDACA,CACD;CACA,GAAI;AACJ,CAAA;AAGF,EAAgB,cAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SPLIT_VIEW_LISTBOX as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "
|
|
2
|
+
import t from "../icon/index.js";
|
|
3
|
+
import n from "../../utilities/event.js";
|
|
4
4
|
import r from "./component.js";
|
|
5
5
|
import i from "./private/list-item-content.js";
|
|
6
6
|
import a from "./private/list-item-with-content.js";
|
|
@@ -70,10 +70,10 @@ var f = Object.freeze({
|
|
|
70
70
|
}
|
|
71
71
|
handleKeyDown(e) {
|
|
72
72
|
if (this.props.multiple && e.key === "a" && e.ctrlKey) {
|
|
73
|
-
|
|
74
|
-
let { options:
|
|
75
|
-
|
|
76
|
-
} else e.key === "ArrowUp" ? (
|
|
73
|
+
n.trap(e);
|
|
74
|
+
let { options: t } = this.props;
|
|
75
|
+
t.length > 0 && t.every((e) => this.isSelected(e)) ? this.deselectAllListItems(e) : this.selectAllListItems(e);
|
|
76
|
+
} else e.key === "ArrowUp" ? (n.trap(e), this.moveToPreviousItem(e)) : e.key === "ArrowDown" && (n.trap(e), this.moveToNextItem(e));
|
|
77
77
|
}
|
|
78
78
|
moveToNextItem(e) {
|
|
79
79
|
let t = this.state.currentFocusedListItem.index === this.props.options.length - 1 ? 0 : this.state.currentFocusedListItem.index + 1;
|
|
@@ -124,7 +124,7 @@ var f = Object.freeze({
|
|
|
124
124
|
this.selectListItem(t, e), this.focusItem(t);
|
|
125
125
|
}
|
|
126
126
|
sortDirection() {
|
|
127
|
-
return this.props.sortDirection ? /* @__PURE__ */ u(
|
|
127
|
+
return this.props.sortDirection ? /* @__PURE__ */ u(t, {
|
|
128
128
|
category: "utility",
|
|
129
129
|
name: this.props.sortDirection === f.DOWN ? "arrowdown" : "arrowup",
|
|
130
130
|
size: "xx-small",
|
|
@@ -138,7 +138,7 @@ var f = Object.freeze({
|
|
|
138
138
|
href: "#",
|
|
139
139
|
role: "button",
|
|
140
140
|
className: "slds-split-view__list-header slds-grid slds-text-link_reset",
|
|
141
|
-
onClick:
|
|
141
|
+
onClick: n.trappedHandler(this.props.events.onSort),
|
|
142
142
|
children: e
|
|
143
143
|
}) : /* @__PURE__ */ u("div", {
|
|
144
144
|
style: { borderTop: "0" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox.js","names":[],"sources":["../../../../components/split-view/listbox.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable class-methods-use-this */\n\nimport React, { type ReactNode, type SyntheticEvent } from 'react';\nimport classNames from 'classnames';\nimport eventUtil from '../../utilities/event';\n\nimport { SPLIT_VIEW_LISTBOX } from '../../utilities/constants';\n\nimport Icon from '../icon';\nimport SplitViewListItemContent, {\n\ttype SplitViewListItem,\n} from './private/list-item-content';\nimport listItemWithContent from './private/list-item-with-content';\nimport checkProps, { checkSelectionProps } from './listbox-check-props';\nimport componentDoc from './component.json';\n\nexport const SORT_OPTIONS = Object.freeze({\n\tUP: 'up',\n\tDOWN: 'down',\n});\n\nexport interface SplitViewListboxSortAssistiveText {\n\tsortedBy?: string;\n\tdescending?: string;\n\tascending?: string;\n}\n\nexport interface SplitViewListboxAssistiveText {\n\tlist?: string;\n\tsort?: SplitViewListboxSortAssistiveText;\n\tunreadItem?: string;\n}\n\nexport interface SplitViewListboxSelectData<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/** The requested selection, as item ids. Pass it back as `selection`. */\n\tselection: SplitViewListboxItemId[];\n\t/** The items of the requested selection */\n\tselectedItems: T[];\n\t/** The item that was clicked, or the range anchor for select-all (`null` when deselecting all) */\n\titem: T | null;\n}\n\nexport interface SplitViewListboxEvents<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/**\n\t * Called when the selection is asked to change (click, meta/shift-click, Ctrl+A).\n\t * `data.selection` is the requested selection; update `selection` to apply it.\n\t */\n\tonSelect: (\n\t\tevent: SyntheticEvent,\n\t\tdata: SplitViewListboxSelectData<T>\n\t) => void;\n\t/**\n\t * Called when the list is sorted.\n\t */\n\tonSort?: (event: SyntheticEvent) => void;\n}\n\nexport interface SplitViewListboxLabels {\n\t/** This is the header of the list. */\n\theader?: string;\n}\n\n/** An item's `id`, as used in `selection` and `unread` */\nexport type SplitViewListboxItemId = string | number;\n\n/**\n * Fields read by the default list item. Items with other fields are typed by\n * the `SplitViewListbox` type parameter, which flows to `renderListItem`, `listItem` and `onSelect`.\n */\nexport type SplitViewListboxItem = SplitViewListItem & {\n\t/** Unique id of the item, matched against `selection` and `unread` */\n\tid: SplitViewListboxItemId;\n};\n\n/**\n * Data passed to `renderListItem`\n */\nexport interface SplitViewListboxRenderListItemData<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/** Whether the item has keyboard focus (is the list's tab stop) */\n\tisFocused: boolean;\n\t/** Whether the item is in `selection` */\n\tisSelected: boolean;\n\t/** Whether the item is in `unread` */\n\tisUnread: boolean;\n\t/** The item from `options` */\n\titem: T;\n}\n\nexport interface SplitViewListboxProps<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `list`: aria label for the list\n\t * * `sort`\n\t * * `sortedBy`: Clickable sort header for the list.\n\t * * `descending`: Descending sorting.\n\t * * `ascending`: Ascending sorting.\n\t */\n\tassistiveText?: SplitViewListboxAssistiveText;\n\t/**\n\t * CSS classes to be added to the parent `div` tag.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Event Callbacks\n\t * * `onSelect` (required): Called with `(event, { selection, selectedItems, item })` when the selection is asked to change. `selection` is the requested selection as item ids.\n\t * * `onSort`: Called when the list is sorted.\n\t */\n\tevents: SplitViewListboxEvents<T>;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `header`: This is the header of the list.\n\t */\n\tlabels?: SplitViewListboxLabels;\n\t/**\n\t * The direction of the sort arrow. Option are:\n\t * * SORT_OPTIONS.UP: `up`\n\t * * SORT_OPTIONS.DOWN: `down`\n\t */\n\tsortDirection?: 'up' | 'down';\n\t/**\n\t * Allows multiple item to be selection\n\t */\n\tmultiple?: boolean;\n\t/**\n\t * The list of items.\n\t * It is recommended that you have a unique `id` for each item.\n\t */\n\toptions: T[];\n\t/**\n\t * Ids (`item.id`) of the selected items (`[]` for none). The listbox is controlled: it renders this\n\t * selection and reports changes through `events.onSelect`. For single selection, pass an array of one id.\n\t *\n\t * Passing item objects is deprecated: they are still matched by `id` (or by identity when an item\n\t * has no `id`), and the listbox warns.\n\t */\n\tselection: SplitViewListboxItemId[] | T[];\n\t/**\n\t * Ids (`item.id`) of the unread items.\n\t *\n\t * Passing item objects is deprecated: they are still matched by `id` (or by identity when an item\n\t * has no `id`), and the listbox warns.\n\t */\n\tunread?: SplitViewListboxItemId[] | T[];\n\t/**\n\t * @deprecated Use `renderListItem` instead, which is called as a function with `{ isFocused, isSelected, isUnread, item }`.\n\t */\n\tlistItem?: React.ComponentType<{ item: T }>;\n\t/**\n\t * Renders the content of each list item in place of the default label and text. The listbox still renders the option, its selection and the unread indicator around it. Receives `{ isFocused, isSelected, isUnread, item }`.\n\t */\n\trenderListItem?: (data: SplitViewListboxRenderListItemData<T>) => ReactNode;\n}\n\ninterface SplitViewListboxState<T extends SplitViewListboxItem> {\n\t/** Anchor of shift-click range selection: the last clicked item (ephemeral, not the selection) */\n\tanchorItem: T | null;\n\tcurrentFocusedListItem: {\n\t\tindex: number;\n\t\titem: T | null;\n\t};\n}\n\n// Typed by its keys (not `Partial<SplitViewListboxProps>`) so JSX still requires the other props\nconst defaultProps = {\n\tassistiveText: {\n\t\tlist: 'Select an item to open it in a new workspace tab.',\n\t\tsort: {\n\t\t\tsortedBy: 'Sorted by',\n\t\t\tdescending: 'Descending',\n\t\t\tascending: 'Ascending',\n\t\t},\n\t},\n\tlabels: {},\n} satisfies Partial<SplitViewListboxProps>;\n\nconst EMPTY: never[] = [];\n\n/**\n * Key an item, or an entry of `selection`/`unread`, is matched by: the id, or for an item object\n * without an `id` (deprecated object entries only), the object itself.\n */\nconst toKey = (entry: unknown): unknown =>\n\tentry !== null && typeof entry === 'object'\n\t\t? ((entry as { id?: unknown }).id ?? entry)\n\t\t: entry;\n\n/**\n * The menu with the ARIA role of a listbox.\n */\nclass SplitViewListbox<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> extends React.Component<SplitViewListboxProps<T>, SplitViewListboxState<T>> {\n\tstatic displayName = SPLIT_VIEW_LISTBOX;\n\n\tstatic defaultProps = defaultProps;\n\n\tlistItemComponents: Record<number, HTMLAnchorElement>;\n\n\tListItemWithContent: ReturnType<typeof listItemWithContent>;\n\n\tconstructor(props: SplitViewListboxProps<T>) {\n\t\tsuper(props);\n\n\t\tthis.listItemComponents = {};\n\n\t\tthis.state = {\n\t\t\tanchorItem: null,\n\t\t\tcurrentFocusedListItem: {\n\t\t\t\tindex: 0,\n\t\t\t\titem: null,\n\t\t\t},\n\t\t};\n\n\t\tcheckProps(SPLIT_VIEW_LISTBOX, props, componentDoc);\n\n\t\t// Generates the list item template\n\t\tthis.ListItemWithContent = listItemWithContent(\n\t\t\t(props.listItem as unknown as React.ComponentType<\n\t\t\t\timport('./private/list-item-with-content').ListItemWithContentProps\n\t\t\t>) ||\n\t\t\t\t(SplitViewListItemContent as unknown as React.ComponentType<\n\t\t\t\t\timport('./private/list-item-with-content').ListItemWithContentProps\n\t\t\t\t>)\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tcheckSelectionProps(SPLIT_VIEW_LISTBOX, this.props, componentDoc);\n\t\tthis.focusFirstItem();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tcheckSelectionProps(SPLIT_VIEW_LISTBOX, this.props, componentDoc);\n\t}\n\n\tisListItemFocused(item: T) {\n\t\tconst focusedItem = this.state.currentFocusedListItem.item;\n\t\treturn focusedItem !== null && toKey(focusedItem) === toKey(item);\n\t}\n\n\tisSelected(item: T) {\n\t\tconst key = toKey(item);\n\t\treturn (this.props.selection || EMPTY).some(\n\t\t\t(entry: unknown) => toKey(entry) === key\n\t\t);\n\t}\n\n\tisUnread(item: T) {\n\t\tconst key = toKey(item);\n\t\treturn (this.props.unread || EMPTY).some(\n\t\t\t(entry: unknown) => toKey(entry) === key\n\t\t);\n\t}\n\n\t/** The selected items, in `options` order */\n\tselectedItems(): T[] {\n\t\treturn this.props.options.filter((item) => this.isSelected(item));\n\t}\n\n\tindexOfItem(item: T | null): number {\n\t\tconst key = item === null ? undefined : toKey(item);\n\t\treturn key === undefined\n\t\t\t? -1\n\t\t\t: this.props.options.findIndex((option) => toKey(option) === key);\n\t}\n\n\treportSelection(event: SyntheticEvent, selectedItems: T[], item: T | null) {\n\t\tthis.props.events?.onSelect?.(event, {\n\t\t\tselection: selectedItems.map((selectedItem) => selectedItem.id),\n\t\t\tselectedItems,\n\t\t\titem,\n\t\t});\n\t}\n\n\thandleKeyDown(event: React.KeyboardEvent) {\n\t\tif (this.props.multiple && event.key === 'a' && event.ctrlKey) {\n\t\t\t// select / deselect all\n\t\t\teventUtil.trap(event);\n\t\t\tconst { options } = this.props;\n\t\t\tif (\n\t\t\t\toptions.length > 0 &&\n\t\t\t\toptions.every((option) => this.isSelected(option))\n\t\t\t) {\n\t\t\t\tthis.deselectAllListItems(event);\n\t\t\t} else {\n\t\t\t\tthis.selectAllListItems(event);\n\t\t\t}\n\t\t} else if (event.key === 'ArrowUp') {\n\t\t\teventUtil.trap(event);\n\t\t\tthis.moveToPreviousItem(event);\n\t\t} else if (event.key === 'ArrowDown') {\n\t\t\teventUtil.trap(event);\n\t\t\tthis.moveToNextItem(event);\n\t\t}\n\t}\n\n\tmoveToNextItem(event: SyntheticEvent) {\n\t\tconst nextFocusIndex =\n\t\t\tthis.state.currentFocusedListItem.index === this.props.options.length - 1\n\t\t\t\t? 0\n\t\t\t\t: this.state.currentFocusedListItem.index + 1;\n\n\t\tthis.moveToIndex(event, nextFocusIndex);\n\t}\n\n\tmoveToPreviousItem(event: SyntheticEvent) {\n\t\tconst previousFocusIndex =\n\t\t\tthis.state.currentFocusedListItem.index === 0\n\t\t\t\t? this.props.options.length - 1\n\t\t\t\t: this.state.currentFocusedListItem.index - 1;\n\n\t\tthis.moveToIndex(event, previousFocusIndex);\n\t}\n\n\tmoveToIndex(event: SyntheticEvent, index: number) {\n\t\tconst item = this.props.options[index];\n\n\t\tthis.focusItem(item);\n\t}\n\n\tfocusFirstItem() {\n\t\tconst firstSelectedItem =\n\t\t\tthis.props.options.find((item) => this.isSelected(item)) ||\n\t\t\tthis.props.options[0];\n\n\t\tif (firstSelectedItem) {\n\t\t\tthis.focusItem(firstSelectedItem, true);\n\t\t}\n\t}\n\n\tfocusItem(item: T, setDataOnly?: boolean) {\n\t\tconst index = this.props.options.indexOf(item);\n\n\t\tif (!setDataOnly) {\n\t\t\tthis.listItemComponents[index].focus();\n\t\t}\n\n\t\tthis.setState({\n\t\t\tcurrentFocusedListItem: {\n\t\t\t\tindex,\n\t\t\t\titem,\n\t\t\t},\n\t\t});\n\t}\n\n\tdeselectAllListItems(event: SyntheticEvent) {\n\t\tthis.setState({ anchorItem: null });\n\t\tthis.reportSelection(event, [], null);\n\t}\n\n\tselectAllListItems(event: SyntheticEvent) {\n\t\tthis.reportSelection(event, [...this.props.options], this.state.anchorItem);\n\t}\n\n\t// Reports the requested selection. The rendered selection only changes when `selection` does.\n\tselectListItem(item: T, event: React.MouseEvent) {\n\t\tlet selectedItems = [item];\n\n\t\tif (this.props.multiple) {\n\t\t\tconst currentItems = this.selectedItems();\n\t\t\tif (event.metaKey) {\n\t\t\t\tselectedItems = this.isSelected(item)\n\t\t\t\t\t? currentItems.filter((i) => toKey(i) !== toKey(item))\n\t\t\t\t\t: [item, ...currentItems];\n\t\t\t} else if (event.shiftKey) {\n\t\t\t\tconst itemIndex = this.indexOfItem(item);\n\t\t\t\t// Without an earlier click, the range starts at the first selected item\n\t\t\t\tconst anchorIndex = [\n\t\t\t\t\tthis.indexOfItem(this.state.anchorItem),\n\t\t\t\t\tthis.indexOfItem(currentItems[0] ?? null),\n\t\t\t\t\titemIndex,\n\t\t\t\t].find((index) => index !== -1) as number;\n\t\t\t\tconst begin = Math.min(anchorIndex, itemIndex);\n\t\t\t\tconst end = Math.max(anchorIndex, itemIndex);\n\n\t\t\t\tconst addToSelection = this.props.options.slice(begin, end + 1);\n\t\t\t\tconst addedKeys = addToSelection.map(toKey);\n\n\t\t\t\tselectedItems = [\n\t\t\t\t\t...addToSelection,\n\t\t\t\t\t...currentItems.filter((i) => !addedKeys.includes(toKey(i))),\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\tthis.setState({ anchorItem: item });\n\n\t\tthis.reportSelection(event, selectedItems, item);\n\t}\n\n\thandleOnSelect(event: React.MouseEvent, { item }: { item: T }) {\n\t\tthis.selectListItem(item, event);\n\t\tthis.focusItem(item);\n\t}\n\n\tsortDirection(): ReactNode {\n\t\treturn this.props.sortDirection ? (\n\t\t\t<Icon\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tname={\n\t\t\t\t\tthis.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t? 'arrowdown'\n\t\t\t\t\t\t: 'arrowup'\n\t\t\t\t}\n\t\t\t\tsize=\"xx-small\"\n\t\t\t\tclassName=\"slds-align-top\"\n\t\t\t/>\n\t\t) : null;\n\t}\n\n\theaderWrapper(children: ReactNode): ReactNode {\n\t\treturn this.props.events?.onSort ? (\n\t\t\t<a\n\t\t\t\taria-live=\"polite\"\n\t\t\t\tstyle={{ borderTop: '0' }}\n\t\t\t\thref=\"#\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclassName=\"slds-split-view__list-header slds-grid slds-text-link_reset\"\n\t\t\t\tonClick={eventUtil.trappedHandler(this.props.events.onSort)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</a>\n\t\t) : (\n\t\t\t<div\n\t\t\t\tstyle={{ borderTop: '0' }}\n\t\t\t\tclassName=\"slds-split-view__list-header slds-grid\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n\n\theader(): ReactNode {\n\t\tconst sort = this.props.assistiveText?.sort || {};\n\t\treturn this.props.labels?.header\n\t\t\t? this.headerWrapper(\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-sort={\n\t\t\t\t\t\t\t(this.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t\t\t? sort.descending\n\t\t\t\t\t\t\t\t: sort.ascending) as React.AriaAttributes['aria-sort']\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{sort.sortedBy}\n\t\t\t\t\t\t\t{': '}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{this.props.labels.header}\n\t\t\t\t\t\t\t{this.sortDirection()}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{'- '}\n\t\t\t\t\t\t\t{this.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t\t\t? sort.descending\n\t\t\t\t\t\t\t\t: sort.ascending}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t)\n\t\t\t: null;\n\t}\n\n\taddListItemComponent(component: HTMLAnchorElement, index: number) {\n\t\tthis.listItemComponents[index] = component;\n\t}\n\n\tlistItems(): ReactNode {\n\t\tconst { ListItemWithContent } = this;\n\t\tconst { renderListItem } = this.props;\n\n\t\treturn this.props.options.map((item, index) => (\n\t\t\t<ListItemWithContent\n\t\t\t\tkey={item.id || index}\n\t\t\t\tassistiveText={{\n\t\t\t\t\tunreadItem: this.props.assistiveText?.unreadItem,\n\t\t\t\t}}\n\t\t\t\tlistItemRef={(component: HTMLAnchorElement | null) => {\n\t\t\t\t\tif (component) {\n\t\t\t\t\t\tthis.addListItemComponent(component, index);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\titem={item}\n\t\t\t\tisFocused={this.isListItemFocused(item)}\n\t\t\t\tisSelected={this.isSelected(item)}\n\t\t\t\tisUnread={this.isUnread(item)}\n\t\t\t\tevents={{\n\t\t\t\t\tonClick: (event, meta) =>\n\t\t\t\t\t\tthis.handleOnSelect(event, {\n\t\t\t\t\t\t\titem: meta.item as T,\n\t\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t\tmultiple={this.props.multiple}\n\t\t\t\trenderContent={\n\t\t\t\t\trenderListItem\n\t\t\t\t\t\t? (data) => renderListItem({ ...data, item })\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t/>\n\t\t));\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={this.props.id}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-grid slds-grid_vertical slds-scrollable_none',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{this.header()}\n\t\t\t\t<ul\n\t\t\t\t\tclassName=\"slds-scrollable_y\"\n\t\t\t\t\taria-label={this.props.assistiveText?.list}\n\t\t\t\t\taria-multiselectable={this.props.multiple}\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\tonKeyDown={(event) => this.handleKeyDown(event)}\n\t\t\t\t>\n\t\t\t\t\t{this.listItems()}\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default SplitViewListbox;\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,IAAe,OAAO,OAAO;CACzC,IAAI;CACJ,MAAM;AACP,CAAC,GA4JK,IAAe;CACpB,eAAe;EACd,MAAM;EACN,MAAM;GACL,UAAU;GACV,YAAY;GACZ,WAAW;EACZ;CACD;CACA,QAAQ,CAAC;AACV,GAEM,IAAiB,CAAC,GAMlB,KAAS,MACI,OAAO,KAAU,YAAnC,IACK,EAA2B,MAAM,IACnC,GAKE,IAAN,cAEU,EAAM,UAA8D;CAC7E,OAAO,cAAc;CAErB,OAAO,eAAe;CAEtB;CAEA;CAEA,YAAY,GAAiC;EAgB5C,AAfA,MAAM,CAAK,GAEX,KAAK,qBAAqB,CAAC,GAE3B,KAAK,QAAQ;GACZ,YAAY;GACZ,wBAAwB;IACvB,OAAO;IACP,MAAM;GACP;EACD,GAEA,EAAW,GAAoB,GAAO,CAAY,GAGlD,KAAK,sBAAsB,EACzB,EAAM,YAGL,CAGH;CACD;CAEA,oBAAoB;EAEnB,AADA,EAAoB,GAAoB,KAAK,OAAO,CAAY,GAChE,KAAK,eAAe;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MAAD;IACC,WAAU;IACV,cAAY,KAAK,MAAM,eAAe;IACtC,wBAAsB,KAAK,MAAM;IACjC,MAAK;IACL,YAAY,MAAU,KAAK,cAAc,CAAK;IAE7C,UAAA,KAAK,UAAU;GACb,CAAA,CACA;;CAEP;AACD"}
|
|
1
|
+
{"version":3,"file":"listbox.js","names":[],"sources":["../../../../components/split-view/listbox.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable class-methods-use-this */\n\nimport React, { type ReactNode, type SyntheticEvent } from 'react';\nimport classNames from 'classnames';\nimport eventUtil from '../../utilities/event';\n\nimport { SPLIT_VIEW_LISTBOX } from '../../utilities/constants';\n\nimport Icon from '../icon';\nimport SplitViewListItemContent from './private/list-item-content';\nimport listItemWithContent from './private/list-item-with-content';\nimport checkProps, { checkSelectionProps } from './listbox-check-props';\nimport componentDoc from './component.json';\nimport type { SplitViewListItem } from './types';\n\nexport type { SplitViewListItem };\n\nexport const SORT_OPTIONS = Object.freeze({\n\tUP: 'up',\n\tDOWN: 'down',\n});\n\nexport interface SplitViewListboxSortAssistiveText {\n\tsortedBy?: string;\n\tdescending?: string;\n\tascending?: string;\n}\n\nexport interface SplitViewListboxAssistiveText {\n\tlist?: string;\n\tsort?: SplitViewListboxSortAssistiveText;\n\tunreadItem?: string;\n}\n\nexport interface SplitViewListboxSelectData<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/** The requested selection, as item ids. Pass it back as `selection`. */\n\tselection: SplitViewListboxItemId[];\n\t/** The items of the requested selection */\n\tselectedItems: T[];\n\t/** The item that was clicked, or the range anchor for select-all (`null` when deselecting all) */\n\titem: T | null;\n}\n\nexport interface SplitViewListboxEvents<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/**\n\t * Called when the selection is asked to change (click, meta/shift-click, Ctrl+A).\n\t * `data.selection` is the requested selection; update `selection` to apply it.\n\t */\n\tonSelect: (\n\t\tevent: SyntheticEvent,\n\t\tdata: SplitViewListboxSelectData<T>\n\t) => void;\n\t/**\n\t * Called when the list is sorted.\n\t */\n\tonSort?: (event: SyntheticEvent) => void;\n}\n\nexport interface SplitViewListboxLabels {\n\t/** This is the header of the list. */\n\theader?: string;\n}\n\n/** An item's `id`, as used in `selection` and `unread` */\nexport type SplitViewListboxItemId = string | number;\n\n/**\n * Fields read by the default list item. Items with other fields are typed by\n * the `SplitViewListbox` type parameter, which flows to `renderListItem`, `listItem` and `onSelect`.\n */\nexport type SplitViewListboxItem = SplitViewListItem & {\n\t/** Unique id of the item, matched against `selection` and `unread` */\n\tid: SplitViewListboxItemId;\n};\n\n/**\n * Data passed to `renderListItem`\n */\nexport interface SplitViewListboxRenderListItemData<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/** Whether the item has keyboard focus (is the list's tab stop) */\n\tisFocused: boolean;\n\t/** Whether the item is in `selection` */\n\tisSelected: boolean;\n\t/** Whether the item is in `unread` */\n\tisUnread: boolean;\n\t/** The item from `options` */\n\titem: T;\n}\n\nexport interface SplitViewListboxProps<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `list`: aria label for the list\n\t * * `sort`\n\t * * `sortedBy`: Clickable sort header for the list.\n\t * * `descending`: Descending sorting.\n\t * * `ascending`: Ascending sorting.\n\t */\n\tassistiveText?: SplitViewListboxAssistiveText;\n\t/**\n\t * CSS classes to be added to the parent `div` tag.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Event Callbacks\n\t * * `onSelect` (required): Called with `(event, { selection, selectedItems, item })` when the selection is asked to change. `selection` is the requested selection as item ids.\n\t * * `onSort`: Called when the list is sorted.\n\t */\n\tevents: SplitViewListboxEvents<T>;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * **Text labels for internationalization**\n\t * * `header`: This is the header of the list.\n\t */\n\tlabels?: SplitViewListboxLabels;\n\t/**\n\t * The direction of the sort arrow. Option are:\n\t * * SORT_OPTIONS.UP: `up`\n\t * * SORT_OPTIONS.DOWN: `down`\n\t */\n\tsortDirection?: 'up' | 'down';\n\t/**\n\t * Allows multiple item to be selection\n\t */\n\tmultiple?: boolean;\n\t/**\n\t * The list of items.\n\t * It is recommended that you have a unique `id` for each item.\n\t */\n\toptions: T[];\n\t/**\n\t * Ids (`item.id`) of the selected items (`[]` for none). The listbox is controlled: it renders this\n\t * selection and reports changes through `events.onSelect`. For single selection, pass an array of one id.\n\t *\n\t * Passing item objects is deprecated: they are still matched by `id` (or by identity when an item\n\t * has no `id`), and the listbox warns.\n\t */\n\tselection: SplitViewListboxItemId[] | T[];\n\t/**\n\t * Ids (`item.id`) of the unread items.\n\t *\n\t * Passing item objects is deprecated: they are still matched by `id` (or by identity when an item\n\t * has no `id`), and the listbox warns.\n\t */\n\tunread?: SplitViewListboxItemId[] | T[];\n\t/**\n\t * @deprecated Use `renderListItem` instead, which is called as a function with `{ isFocused, isSelected, isUnread, item }`.\n\t */\n\tlistItem?: React.ComponentType<{ item: T }>;\n\t/**\n\t * Renders the content of each list item in place of the default label and text. The listbox still renders the option, its selection and the unread indicator around it. Receives `{ isFocused, isSelected, isUnread, item }`.\n\t */\n\trenderListItem?: (data: SplitViewListboxRenderListItemData<T>) => ReactNode;\n}\n\ninterface SplitViewListboxState<T extends SplitViewListboxItem> {\n\t/** Anchor of shift-click range selection: the last clicked item (ephemeral, not the selection) */\n\tanchorItem: T | null;\n\tcurrentFocusedListItem: {\n\t\tindex: number;\n\t\titem: T | null;\n\t};\n}\n\n// Typed by its keys (not `Partial<SplitViewListboxProps>`) so JSX still requires the other props\nconst defaultProps = {\n\tassistiveText: {\n\t\tlist: 'Select an item to open it in a new workspace tab.',\n\t\tsort: {\n\t\t\tsortedBy: 'Sorted by',\n\t\t\tdescending: 'Descending',\n\t\t\tascending: 'Ascending',\n\t\t},\n\t},\n\tlabels: {},\n} satisfies Partial<SplitViewListboxProps>;\n\nconst EMPTY: never[] = [];\n\n/**\n * Key an item, or an entry of `selection`/`unread`, is matched by: the id, or for an item object\n * without an `id` (deprecated object entries only), the object itself.\n */\nconst toKey = (entry: unknown): unknown =>\n\tentry !== null && typeof entry === 'object'\n\t\t? ((entry as { id?: unknown }).id ?? entry)\n\t\t: entry;\n\n/**\n * The menu with the ARIA role of a listbox.\n */\nclass SplitViewListbox<\n\tT extends SplitViewListboxItem = SplitViewListboxItem,\n> extends React.Component<SplitViewListboxProps<T>, SplitViewListboxState<T>> {\n\tstatic displayName = SPLIT_VIEW_LISTBOX;\n\n\tstatic defaultProps = defaultProps;\n\n\tlistItemComponents: Record<number, HTMLAnchorElement>;\n\n\tListItemWithContent: ReturnType<typeof listItemWithContent>;\n\n\tconstructor(props: SplitViewListboxProps<T>) {\n\t\tsuper(props);\n\n\t\tthis.listItemComponents = {};\n\n\t\tthis.state = {\n\t\t\tanchorItem: null,\n\t\t\tcurrentFocusedListItem: {\n\t\t\t\tindex: 0,\n\t\t\t\titem: null,\n\t\t\t},\n\t\t};\n\n\t\tcheckProps(SPLIT_VIEW_LISTBOX, props, componentDoc);\n\n\t\t// Generates the list item template\n\t\tthis.ListItemWithContent = listItemWithContent(\n\t\t\t(props.listItem as unknown as React.ComponentType<\n\t\t\t\timport('./private/list-item-with-content').ListItemWithContentProps\n\t\t\t>) ||\n\t\t\t\t(SplitViewListItemContent as unknown as React.ComponentType<\n\t\t\t\t\timport('./private/list-item-with-content').ListItemWithContentProps\n\t\t\t\t>)\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tcheckSelectionProps(SPLIT_VIEW_LISTBOX, this.props, componentDoc);\n\t\tthis.focusFirstItem();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tcheckSelectionProps(SPLIT_VIEW_LISTBOX, this.props, componentDoc);\n\t}\n\n\tisListItemFocused(item: T) {\n\t\tconst focusedItem = this.state.currentFocusedListItem.item;\n\t\treturn focusedItem !== null && toKey(focusedItem) === toKey(item);\n\t}\n\n\tisSelected(item: T) {\n\t\tconst key = toKey(item);\n\t\treturn (this.props.selection || EMPTY).some(\n\t\t\t(entry: unknown) => toKey(entry) === key\n\t\t);\n\t}\n\n\tisUnread(item: T) {\n\t\tconst key = toKey(item);\n\t\treturn (this.props.unread || EMPTY).some(\n\t\t\t(entry: unknown) => toKey(entry) === key\n\t\t);\n\t}\n\n\t/** The selected items, in `options` order */\n\tselectedItems(): T[] {\n\t\treturn this.props.options.filter((item) => this.isSelected(item));\n\t}\n\n\tindexOfItem(item: T | null): number {\n\t\tconst key = item === null ? undefined : toKey(item);\n\t\treturn key === undefined\n\t\t\t? -1\n\t\t\t: this.props.options.findIndex((option) => toKey(option) === key);\n\t}\n\n\treportSelection(event: SyntheticEvent, selectedItems: T[], item: T | null) {\n\t\tthis.props.events?.onSelect?.(event, {\n\t\t\tselection: selectedItems.map((selectedItem) => selectedItem.id),\n\t\t\tselectedItems,\n\t\t\titem,\n\t\t});\n\t}\n\n\thandleKeyDown(event: React.KeyboardEvent) {\n\t\tif (this.props.multiple && event.key === 'a' && event.ctrlKey) {\n\t\t\t// select / deselect all\n\t\t\teventUtil.trap(event);\n\t\t\tconst { options } = this.props;\n\t\t\tif (\n\t\t\t\toptions.length > 0 &&\n\t\t\t\toptions.every((option) => this.isSelected(option))\n\t\t\t) {\n\t\t\t\tthis.deselectAllListItems(event);\n\t\t\t} else {\n\t\t\t\tthis.selectAllListItems(event);\n\t\t\t}\n\t\t} else if (event.key === 'ArrowUp') {\n\t\t\teventUtil.trap(event);\n\t\t\tthis.moveToPreviousItem(event);\n\t\t} else if (event.key === 'ArrowDown') {\n\t\t\teventUtil.trap(event);\n\t\t\tthis.moveToNextItem(event);\n\t\t}\n\t}\n\n\tmoveToNextItem(event: SyntheticEvent) {\n\t\tconst nextFocusIndex =\n\t\t\tthis.state.currentFocusedListItem.index === this.props.options.length - 1\n\t\t\t\t? 0\n\t\t\t\t: this.state.currentFocusedListItem.index + 1;\n\n\t\tthis.moveToIndex(event, nextFocusIndex);\n\t}\n\n\tmoveToPreviousItem(event: SyntheticEvent) {\n\t\tconst previousFocusIndex =\n\t\t\tthis.state.currentFocusedListItem.index === 0\n\t\t\t\t? this.props.options.length - 1\n\t\t\t\t: this.state.currentFocusedListItem.index - 1;\n\n\t\tthis.moveToIndex(event, previousFocusIndex);\n\t}\n\n\tmoveToIndex(event: SyntheticEvent, index: number) {\n\t\tconst item = this.props.options[index];\n\n\t\tthis.focusItem(item);\n\t}\n\n\tfocusFirstItem() {\n\t\tconst firstSelectedItem =\n\t\t\tthis.props.options.find((item) => this.isSelected(item)) ||\n\t\t\tthis.props.options[0];\n\n\t\tif (firstSelectedItem) {\n\t\t\tthis.focusItem(firstSelectedItem, true);\n\t\t}\n\t}\n\n\tfocusItem(item: T, setDataOnly?: boolean) {\n\t\tconst index = this.props.options.indexOf(item);\n\n\t\tif (!setDataOnly) {\n\t\t\tthis.listItemComponents[index].focus();\n\t\t}\n\n\t\tthis.setState({\n\t\t\tcurrentFocusedListItem: {\n\t\t\t\tindex,\n\t\t\t\titem,\n\t\t\t},\n\t\t});\n\t}\n\n\tdeselectAllListItems(event: SyntheticEvent) {\n\t\tthis.setState({ anchorItem: null });\n\t\tthis.reportSelection(event, [], null);\n\t}\n\n\tselectAllListItems(event: SyntheticEvent) {\n\t\tthis.reportSelection(event, [...this.props.options], this.state.anchorItem);\n\t}\n\n\t// Reports the requested selection. The rendered selection only changes when `selection` does.\n\tselectListItem(item: T, event: React.MouseEvent) {\n\t\tlet selectedItems = [item];\n\n\t\tif (this.props.multiple) {\n\t\t\tconst currentItems = this.selectedItems();\n\t\t\tif (event.metaKey) {\n\t\t\t\tselectedItems = this.isSelected(item)\n\t\t\t\t\t? currentItems.filter((i) => toKey(i) !== toKey(item))\n\t\t\t\t\t: [item, ...currentItems];\n\t\t\t} else if (event.shiftKey) {\n\t\t\t\tconst itemIndex = this.indexOfItem(item);\n\t\t\t\t// Without an earlier click, the range starts at the first selected item\n\t\t\t\tconst anchorIndex = [\n\t\t\t\t\tthis.indexOfItem(this.state.anchorItem),\n\t\t\t\t\tthis.indexOfItem(currentItems[0] ?? null),\n\t\t\t\t\titemIndex,\n\t\t\t\t].find((index) => index !== -1) as number;\n\t\t\t\tconst begin = Math.min(anchorIndex, itemIndex);\n\t\t\t\tconst end = Math.max(anchorIndex, itemIndex);\n\n\t\t\t\tconst addToSelection = this.props.options.slice(begin, end + 1);\n\t\t\t\tconst addedKeys = addToSelection.map(toKey);\n\n\t\t\t\tselectedItems = [\n\t\t\t\t\t...addToSelection,\n\t\t\t\t\t...currentItems.filter((i) => !addedKeys.includes(toKey(i))),\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\tthis.setState({ anchorItem: item });\n\n\t\tthis.reportSelection(event, selectedItems, item);\n\t}\n\n\thandleOnSelect(event: React.MouseEvent, { item }: { item: T }) {\n\t\tthis.selectListItem(item, event);\n\t\tthis.focusItem(item);\n\t}\n\n\tsortDirection(): ReactNode {\n\t\treturn this.props.sortDirection ? (\n\t\t\t<Icon\n\t\t\t\tcategory=\"utility\"\n\t\t\t\tname={\n\t\t\t\t\tthis.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t? 'arrowdown'\n\t\t\t\t\t\t: 'arrowup'\n\t\t\t\t}\n\t\t\t\tsize=\"xx-small\"\n\t\t\t\tclassName=\"slds-align-top\"\n\t\t\t/>\n\t\t) : null;\n\t}\n\n\theaderWrapper(children: ReactNode): ReactNode {\n\t\treturn this.props.events?.onSort ? (\n\t\t\t// eslint-disable-next-line jsx-a11y/anchor-is-valid -- SLDS split view header markup uses an anchor for sorting\n\t\t\t<a\n\t\t\t\taria-live=\"polite\"\n\t\t\t\tstyle={{ borderTop: '0' }}\n\t\t\t\thref=\"#\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclassName=\"slds-split-view__list-header slds-grid slds-text-link_reset\"\n\t\t\t\tonClick={eventUtil.trappedHandler(this.props.events.onSort)}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</a>\n\t\t) : (\n\t\t\t<div\n\t\t\t\tstyle={{ borderTop: '0' }}\n\t\t\t\tclassName=\"slds-split-view__list-header slds-grid\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n\n\theader(): ReactNode {\n\t\tconst sort = this.props.assistiveText?.sort || {};\n\t\treturn this.props.labels?.header\n\t\t\t? this.headerWrapper(\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-sort={\n\t\t\t\t\t\t\t(this.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t\t\t? sort.descending\n\t\t\t\t\t\t\t\t: sort.ascending) as React.AriaAttributes['aria-sort']\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{sort.sortedBy}\n\t\t\t\t\t\t\t{': '}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{this.props.labels.header}\n\t\t\t\t\t\t\t{this.sortDirection()}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t\t{'- '}\n\t\t\t\t\t\t\t{this.props.sortDirection === SORT_OPTIONS.DOWN\n\t\t\t\t\t\t\t\t? sort.descending\n\t\t\t\t\t\t\t\t: sort.ascending}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t)\n\t\t\t: null;\n\t}\n\n\taddListItemComponent(component: HTMLAnchorElement, index: number) {\n\t\tthis.listItemComponents[index] = component;\n\t}\n\n\tlistItems(): ReactNode {\n\t\tconst { ListItemWithContent } = this;\n\t\tconst { renderListItem } = this.props;\n\n\t\treturn this.props.options.map((item, index) => (\n\t\t\t<ListItemWithContent\n\t\t\t\tkey={item.id || index}\n\t\t\t\tassistiveText={{\n\t\t\t\t\tunreadItem: this.props.assistiveText?.unreadItem,\n\t\t\t\t}}\n\t\t\t\tlistItemRef={(component: HTMLAnchorElement | null) => {\n\t\t\t\t\tif (component) {\n\t\t\t\t\t\tthis.addListItemComponent(component, index);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\titem={item}\n\t\t\t\tisFocused={this.isListItemFocused(item)}\n\t\t\t\tisSelected={this.isSelected(item)}\n\t\t\t\tisUnread={this.isUnread(item)}\n\t\t\t\tevents={{\n\t\t\t\t\tonClick: (event, meta) =>\n\t\t\t\t\t\tthis.handleOnSelect(event, {\n\t\t\t\t\t\t\titem: meta.item as T,\n\t\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t\tmultiple={this.props.multiple}\n\t\t\t\trenderContent={\n\t\t\t\t\trenderListItem\n\t\t\t\t\t\t? (data) => renderListItem({ ...data, item })\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t/>\n\t\t));\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={this.props.id}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-grid slds-grid_vertical slds-scrollable_none',\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{this.header()}\n\t\t\t\t<ul\n\t\t\t\t\tclassName=\"slds-scrollable_y\"\n\t\t\t\t\taria-label={this.props.assistiveText?.list}\n\t\t\t\t\taria-multiselectable={this.props.multiple}\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\tonKeyDown={(event) => this.handleKeyDown(event)}\n\t\t\t\t>\n\t\t\t\t\t{this.listItems()}\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default SplitViewListbox;\n"],"mappings":";;;;;;;;;;;AAoBA,IAAa,IAAe,OAAO,OAAO;CACzC,IAAI;CACJ,MAAM;AACP,CAAC,GA4JK,IAAe;CACpB,eAAe;EACd,MAAM;EACN,MAAM;GACL,UAAU;GACV,YAAY;GACZ,WAAW;EACZ;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ACH,KAAK,qBAAqB,GAAW,CAAK;GAE5C;GACM;GACN,WAAW,KAAK,kBAAkB,CAAI;GACtC,YAAY,KAAK,WAAW,CAAI;GAChC,UAAU,KAAK,SAAS,CAAI;GAC5B,QAAQ,EACP,UAAU,GAAO,MAChB,KAAK,eAAe,GAAO,EAC1B,MAAM,EAAK,KACZ,CAAC,EACH;GACA,UAAU,KAAK,MAAM;GACrB,eACC,KACI,MAAS,EAAe;IAAE,GAAG;IAAM;GAAK,CAAC,IAC1C,KAAA;EAEJ,GAzBK,EAAK,MAAM,CAyBhB,CACD;CACF;CAEA,SAAS;EACR,OACC,kBAAC,OAAD;GACC,IAAI,KAAK,MAAM;GACf,WAAW,EACV,qDACA,KAAK,MAAM,SACZ;GALD,UAAA,CAOE,KAAK,OAAO,GACb,kBAAC,MAAD;IACC,WAAU;IACV,cAAY,KAAK,MAAM,eAAe;IACtC,wBAAsB,KAAK,MAAM;IACjC,MAAK;IACL,YAAY,MAAU,KAAK,cAAc,CAAK;IAE7C,UAAA,KAAK,UAAU;GACb,CAAA,CACA;;CAEP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-content.js","names":[],"sources":["../../../../../components/split-view/private/list-item-content.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\
|
|
1
|
+
{"version":3,"file":"list-item-content.js","names":[],"sources":["../../../../../components/split-view/private/list-item-content.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport type { SplitViewListItem } from '../types';\n\nexport const DISPLAY_NAME = 'SLDSSplitViewListItemContent';\n\nexport interface SplitViewListItemContentProps {\n\t/**\n\t * **Item to be displayed**\n\t * * `label`: The main label displayed on the top left.\n\t * * `topRightText`: The text displayed on the top right.\n\t * * `bottomLeftText`: The text displayed on the bottom left.\n\t * * `bottomRightText`: The text displayed on the bottom right.\n\t */\n\titem?: SplitViewListItem;\n}\n\nconst SplitViewListItemContent = ({\n\titem = {},\n}: SplitViewListItemContentProps) => (\n\t<div>\n\t\t<div className=\"slds-grid slds-wrap\">\n\t\t\t<span\n\t\t\t\tclassName=\"slds-truncate slds-text-body_regular slds-text-color_default\"\n\t\t\t\ttitle={item.label}\n\t\t\t>\n\t\t\t\t{item.label}\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tclassName=\"slds-truncate slds-col_bump-left\"\n\t\t\t\ttitle={item.topRightText}\n\t\t\t>\n\t\t\t\t{item.topRightText}\n\t\t\t</span>\n\t\t</div>\n\t\t<div className=\"slds-grid slds-wrap\">\n\t\t\t<span className=\"slds-truncate\" title={item.bottomLeftText}>\n\t\t\t\t{item.bottomLeftText}\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tclassName=\"slds-truncate slds-col_bump-left\"\n\t\t\t\ttitle={item.bottomRightText}\n\t\t\t>\n\t\t\t\t{item.bottomRightText}\n\t\t\t</span>\n\t\t</div>\n\t</div>\n);\n\nSplitViewListItemContent.displayName = DISPLAY_NAME;\n\nexport default SplitViewListItemContent;\n"],"mappings":";;AAKA,IAAa,IAAe,gCAatB,KAA4B,EACjC,UAAO,CAAC,QAER,kBAAC,OAAD,EAAA,UAAA,CACC,kBAAC,OAAD;CAAK,WAAU;CAAf,UAAA,CACC,kBAAC,QAAD;EACC,WAAU;EACV,OAAO,EAAK;EAEX,UAAA,EAAK;CACD,CAAA,GACN,kBAAC,QAAD;EACC,WAAU;EACV,OAAO,EAAK;EAEX,UAAA,EAAK;CACD,CAAA,CACF;AACL,CAAA,GAAA,kBAAC,OAAD;CAAK,WAAU;CAAf,UAAA,CACC,kBAAC,QAAD;EAAM,WAAU;EAAgB,OAAO,EAAK;EAC1C,UAAA,EAAK;CACD,CAAA,GACN,kBAAC,QAAD;EACC,WAAU;EACV,OAAO,EAAK;EAEX,UAAA,EAAK;CACD,CAAA,CACF;AACD,CAAA,CAAA,EAAA,CAAA;AAGN,EAAyB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-with-content.js","names":[],"sources":["../../../../../components/split-view/private/list-item-with-content.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable class-methods-use-this */\n\nimport React, {\n\tComponent,\n\ttype ComponentType,\n\ttype ReactNode,\n\ttype Ref,\n} from 'react';\nimport classNames from 'classnames';\n\nexport const DISPLAY_NAME = 'SLDSSplitViewListItemWithContent';\n\nexport interface SplitViewListItemAssistiveText {\n\t/** The unread indicator. */\n\tunreadItem?: string;\n}\n\nexport interface SplitViewListItemEventData {\n\titem: unknown;\n\tisSelected: boolean;\n\tisUnread?: boolean;\n}\n\nexport interface SplitViewListItemEvents {\n\t/** Called when the item is clicked. */\n\tonClick: (event: React.MouseEvent, data: SplitViewListItemEventData) => void;\n}\n\nexport interface ListItemWithContentProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `unreadItem`: The unread indicator.\n\t */\n\tassistiveText?: SplitViewListItemAssistiveText;\n\t/**\n\t * Item to be displayed\n\t */\n\titem: unknown;\n\t/**\n\t * Allows multiple item to be selection\n\t */\n\tmultiple?: boolean;\n\t/**\n\t * Shows the item as `focused`.\n\t */\n\tisFocused: boolean;\n\t/**\n\t * Shows the item as `selected`.\n\t */\n\tisSelected: boolean;\n\t/**\n\t * Shows the item as `unread`.\n\t */\n\tisUnread?: boolean;\n\t/**\n\t * **Event Callbacks**\n\t * * `onClick`: Called when the item is clicked.\n\t * * * Event\n\t * * * Meta data\n\t * * * * `item`: The original item.\n\t * * * * `isSelected`: Is the item selected.\n\t * * * * `isUnread`: Is the item unread.\n\t */\n\tevents?: SplitViewListItemEvents;\n\t/**\n\t * Reference to the list item component\n\t */\n\tlistItemRef?: Ref<HTMLAnchorElement>;\n\t/**\n\t * Called to render the item content. Takes precedence over the wrapped component.\n\t */\n\trenderContent?: (data: {\n\t\tisFocused: boolean;\n\t\tisSelected: boolean;\n\t\tisUnread: boolean;\n\t\titem: unknown;\n\t}) => ReactNode;\n}\n\nconst defaultProps: Partial<ListItemWithContentProps> = {\n\tassistiveText: {\n\t\tunreadItem: 'Unread Item',\n\t},\n\tevents: {} as SplitViewListItemEvents,\n};\n\n/**\n * HOC that wraps the list item content with selection and unread functionality.\n * @param ListItemContent {node} A React component\n * @returns {ListItemWithContent} A React component\n */\nconst listItemWithContent = (\n\tListItemContent: ComponentType<ListItemWithContentProps>\n) => {\n\tclass ListItemWithContent extends Component<ListItemWithContentProps> {\n\t\tstatic displayName = `${DISPLAY_NAME}(${\n\t\t\tListItemContent.displayName || ListItemContent.name || 'Component'\n\t\t})`;\n\n\t\tstatic defaultProps = defaultProps;\n\n\t\tonClick = (event: React.MouseEvent) => {\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.props.events?.onClick(event, {\n\t\t\t\titem: this.props.item,\n\t\t\t\tisSelected: this.props.isSelected,\n\t\t\t\tisUnread: this.props.isUnread,\n\t\t\t});\n\t\t};\n\n\t\tunread() {\n\t\t\treturn this.props.isUnread ? (\n\t\t\t\t<abbr\n\t\t\t\t\tclassName=\"slds-indicator_unread\"\n\t\t\t\t\ttitle={this.props.assistiveText?.unreadItem}\n\t\t\t\t\taria-label={this.props.assistiveText?.unreadItem}\n\t\t\t\t>\n\t\t\t\t\t{/* eslint-disable-next-line react/jsx-curly-brace-presence */}\n\t\t\t\t\t<span className=\"slds-assistive-text\">{'●'}</span>\n\t\t\t\t</abbr>\n\t\t\t) : null;\n\t\t}\n\n\t\trender() {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tclassName={classNames('slds-split-view__list-item', {\n\t\t\t\t\t\t'slds-is-unread': this.props.isUnread,\n\t\t\t\t\t})}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t>\n\t\t\t\t\t<a\n\t\t\t\t\t\tclassName=\"slds-split-view__list-item-action slds-grow slds-has-flexi-truncate\"\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\tref={this.props.listItemRef}\n\t\t\t\t\t\taria-selected={\n\t\t\t\t\t\t\tthis.props.multiple\n\t\t\t\t\t\t\t\t? !!this.props.isSelected\n\t\t\t\t\t\t\t\t: this.props.isSelected\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttabIndex={this.props.isFocused ? 0 : -1}\n\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t\tonClick={this.onClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.unread()}\n\t\t\t\t\t\t{this.props.renderContent ? (\n\t\t\t\t\t\t\tthis.props.renderContent({\n\t\t\t\t\t\t\t\tisFocused: this.props.isFocused,\n\t\t\t\t\t\t\t\tisSelected: this.props.isSelected,\n\t\t\t\t\t\t\t\tisUnread: Boolean(this.props.isUnread),\n\t\t\t\t\t\t\t\titem: this.props.item,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ListItemContent {...this.props} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\t}\n\n\treturn ListItemWithContent;\n};\n\nexport default listItemWithContent;\n"],"mappings":";;;;AAaA,IAAa,IAAe,oCAqEtB,IAAkD;CACvD,eAAe,EACd,YAAY,cACb;CACA,QAAQ,CAAC;AACV,GAOM,KACL,MACI;CACJ,MAAM,UAA4B,EAAoC;EACrE,OAAO,cAAc,GAAG,EAAa,GACpC,EAAgB,eAAe,EAAgB,QAAQ,YACvD;EAED,OAAO,eAAe;EAEtB,WAAW,MAA4B;GAGtC,AAFA,EAAM,eAAe,GAErB,KAAK,MAAM,QAAQ,QAAQ,GAAO;IACjC,MAAM,KAAK,MAAM;IACjB,YAAY,KAAK,MAAM;IACvB,UAAU,KAAK,MAAM;GACtB,CAAC;EACF;EAEA,SAAS;GACR,OAAO,KAAK,MAAM,WACjB,kBAAC,QAAD;IACC,WAAU;IACV,OAAO,KAAK,MAAM,eAAe;IACjC,cAAY,KAAK,MAAM,eAAe;IAGtC,UAAA,kBAAC,QAAD;KAAM,WAAU;KAAuB,UAAA;IAAU,CAAA;GAC5C,CAAA,IACH;EACL;EAEA,SAAS;GACR,OACC,kBAAC,MAAD;IACC,WAAW,EAAW,8BAA8B,EACnD,kBAAkB,KAAK,MAAM,SAC9B,CAAC;IACD,MAAK;
|
|
1
|
+
{"version":3,"file":"list-item-with-content.js","names":[],"sources":["../../../../../components/split-view/private/list-item-with-content.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable class-methods-use-this */\n\nimport React, {\n\tComponent,\n\ttype ComponentType,\n\ttype ReactNode,\n\ttype Ref,\n} from 'react';\nimport classNames from 'classnames';\n\nexport const DISPLAY_NAME = 'SLDSSplitViewListItemWithContent';\n\nexport interface SplitViewListItemAssistiveText {\n\t/** The unread indicator. */\n\tunreadItem?: string;\n}\n\nexport interface SplitViewListItemEventData {\n\titem: unknown;\n\tisSelected: boolean;\n\tisUnread?: boolean;\n}\n\nexport interface SplitViewListItemEvents {\n\t/** Called when the item is clicked. */\n\tonClick: (event: React.MouseEvent, data: SplitViewListItemEventData) => void;\n}\n\nexport interface ListItemWithContentProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `unreadItem`: The unread indicator.\n\t */\n\tassistiveText?: SplitViewListItemAssistiveText;\n\t/**\n\t * Item to be displayed\n\t */\n\titem: unknown;\n\t/**\n\t * Allows multiple item to be selection\n\t */\n\tmultiple?: boolean;\n\t/**\n\t * Shows the item as `focused`.\n\t */\n\tisFocused: boolean;\n\t/**\n\t * Shows the item as `selected`.\n\t */\n\tisSelected: boolean;\n\t/**\n\t * Shows the item as `unread`.\n\t */\n\tisUnread?: boolean;\n\t/**\n\t * **Event Callbacks**\n\t * * `onClick`: Called when the item is clicked.\n\t * * * Event\n\t * * * Meta data\n\t * * * * `item`: The original item.\n\t * * * * `isSelected`: Is the item selected.\n\t * * * * `isUnread`: Is the item unread.\n\t */\n\tevents?: SplitViewListItemEvents;\n\t/**\n\t * Reference to the list item component\n\t */\n\tlistItemRef?: Ref<HTMLAnchorElement>;\n\t/**\n\t * Called to render the item content. Takes precedence over the wrapped component.\n\t */\n\trenderContent?: (data: {\n\t\tisFocused: boolean;\n\t\tisSelected: boolean;\n\t\tisUnread: boolean;\n\t\titem: unknown;\n\t}) => ReactNode;\n}\n\nconst defaultProps: Partial<ListItemWithContentProps> = {\n\tassistiveText: {\n\t\tunreadItem: 'Unread Item',\n\t},\n\tevents: {} as SplitViewListItemEvents,\n};\n\n/**\n * HOC that wraps the list item content with selection and unread functionality.\n * @param ListItemContent {node} A React component\n * @returns {ListItemWithContent} A React component\n */\nconst listItemWithContent = (\n\tListItemContent: ComponentType<ListItemWithContentProps>\n) => {\n\tclass ListItemWithContent extends Component<ListItemWithContentProps> {\n\t\tstatic displayName = `${DISPLAY_NAME}(${\n\t\t\tListItemContent.displayName || ListItemContent.name || 'Component'\n\t\t})`;\n\n\t\tstatic defaultProps = defaultProps;\n\n\t\tonClick = (event: React.MouseEvent) => {\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.props.events?.onClick(event, {\n\t\t\t\titem: this.props.item,\n\t\t\t\tisSelected: this.props.isSelected,\n\t\t\t\tisUnread: this.props.isUnread,\n\t\t\t});\n\t\t};\n\n\t\tunread() {\n\t\t\treturn this.props.isUnread ? (\n\t\t\t\t<abbr\n\t\t\t\t\tclassName=\"slds-indicator_unread\"\n\t\t\t\t\ttitle={this.props.assistiveText?.unreadItem}\n\t\t\t\t\taria-label={this.props.assistiveText?.unreadItem}\n\t\t\t\t>\n\t\t\t\t\t{/* eslint-disable-next-line react/jsx-curly-brace-presence */}\n\t\t\t\t\t<span className=\"slds-assistive-text\">{'●'}</span>\n\t\t\t\t</abbr>\n\t\t\t) : null;\n\t\t}\n\n\t\trender() {\n\t\t\treturn (\n\t\t\t\t<li\n\t\t\t\t\tclassName={classNames('slds-split-view__list-item', {\n\t\t\t\t\t\t'slds-is-unread': this.props.isUnread,\n\t\t\t\t\t})}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t>\n\t\t\t\t\t{/* eslint-disable-next-line jsx-a11y/anchor-is-valid -- SLDS split view list item markup; keyboard handled by the listbox */}\n\t\t\t\t\t<a\n\t\t\t\t\t\tclassName=\"slds-split-view__list-item-action slds-grow slds-has-flexi-truncate\"\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\tref={this.props.listItemRef}\n\t\t\t\t\t\taria-selected={\n\t\t\t\t\t\t\tthis.props.multiple\n\t\t\t\t\t\t\t\t? !!this.props.isSelected\n\t\t\t\t\t\t\t\t: this.props.isSelected\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttabIndex={this.props.isFocused ? 0 : -1}\n\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t\tonClick={this.onClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.unread()}\n\t\t\t\t\t\t{this.props.renderContent ? (\n\t\t\t\t\t\t\tthis.props.renderContent({\n\t\t\t\t\t\t\t\tisFocused: this.props.isFocused,\n\t\t\t\t\t\t\t\tisSelected: this.props.isSelected,\n\t\t\t\t\t\t\t\tisUnread: Boolean(this.props.isUnread),\n\t\t\t\t\t\t\t\titem: this.props.item,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ListItemContent {...this.props} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t);\n\t\t}\n\t}\n\n\treturn ListItemWithContent;\n};\n\nexport default listItemWithContent;\n"],"mappings":";;;;AAaA,IAAa,IAAe,oCAqEtB,IAAkD;CACvD,eAAe,EACd,YAAY,cACb;CACA,QAAQ,CAAC;AACV,GAOM,KACL,MACI;CACJ,MAAM,UAA4B,EAAoC;EACrE,OAAO,cAAc,GAAG,EAAa,GACpC,EAAgB,eAAe,EAAgB,QAAQ,YACvD;EAED,OAAO,eAAe;EAEtB,WAAW,MAA4B;GAGtC,AAFA,EAAM,eAAe,GAErB,KAAK,MAAM,QAAQ,QAAQ,GAAO;IACjC,MAAM,KAAK,MAAM;IACjB,YAAY,KAAK,MAAM;IACvB,UAAU,KAAK,MAAM;GACtB,CAAC;EACF;EAEA,SAAS;GACR,OAAO,KAAK,MAAM,WACjB,kBAAC,QAAD;IACC,WAAU;IACV,OAAO,KAAK,MAAM,eAAe;IACjC,cAAY,KAAK,MAAM,eAAe;IAGtC,UAAA,kBAAC,QAAD;KAAM,WAAU;KAAuB,UAAA;IAAU,CAAA;GAC5C,CAAA,IACH;EACL;EAEA,SAAS;GACR,OACC,kBAAC,MAAD;IACC,WAAW,EAAW,8BAA8B,EACnD,kBAAkB,KAAK,MAAM,SAC9B,CAAC;IACD,MAAK;IAGL,UAAA,kBAAC,KAAD;KACC,WAAU;KACV,MAAK;KACL,KAAK,KAAK,MAAM;KAChB,iBACC,KAAK,MAAM,WACR,CAAC,CAAC,KAAK,MAAM,aACb,KAAK,MAAM;KAEf,UAAU,KAAK,MAAM,YAAY,IAAI;KACrC,MAAK;KACL,SAAS,KAAK;KAXf,UAAA,CAaE,KAAK,OAAO,GACZ,KAAK,MAAM,gBACX,KAAK,MAAM,cAAc;MACxB,WAAW,KAAK,MAAM;MACtB,YAAY,KAAK,MAAM;MACvB,UAAU,EAAQ,KAAK,MAAM;MAC7B,MAAM,KAAK,MAAM;KAClB,CAAC,IAED,kBAAC,GAAD,EAAiB,GAAI,KAAK,MAAQ,CAAA,CAEjC;;GACA,CAAA;EAEN;CACD;CAEA,OAAO;AACR"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TABS as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "../../utilities/
|
|
3
|
-
import n from "../../utilities/
|
|
2
|
+
import t from "../../utilities/key-code.js";
|
|
3
|
+
import n from "../../utilities/event.js";
|
|
4
4
|
import r from "./private/tabs-list.js";
|
|
5
5
|
import i from "./private/tab.js";
|
|
6
6
|
import a from "./private/tab-panel.js";
|
|
@@ -88,7 +88,7 @@ var x = (x) => {
|
|
|
88
88
|
}, [V, B]), U = l((e) => {
|
|
89
89
|
if (V(e.target)) {
|
|
90
90
|
let r = L, i = !1;
|
|
91
|
-
e.
|
|
91
|
+
e.key === t.LEFT || e.key === t.UP ? (r = z(r), i = !0) : (e.key === t.RIGHT || e.key === t.DOWN) && (r = R(r), i = !0), i && n.trap(e), B(e, r, !0);
|
|
92
92
|
}
|
|
93
93
|
}, [
|
|
94
94
|
V,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/tabs/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseId,\n\ttype ReactNode,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\n\n// Child components\nimport TabsList from './private/tabs-list';\nimport Tab from './private/tab';\nimport TabPanel from './private/tab-panel';\n\nimport { TABS } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Tabs variant types\n */\nexport type TabsVariant = 'default' | 'scoped' | 'vertical';\n\n/**\n * Tab child props (TabsPanel)\n */\nexport interface TabChildProps {\n\tlabel: ReactNode;\n\tvalue?: string;\n\tdisabled?: boolean;\n\thasError?: boolean;\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n\tchildren?: ReactNode;\n\tkey?: string | number;\n}\n\n/**\n * Data passed to the Tabs `onSelect` callback\n */\nexport interface TabsSelectData {\n\t/**\n\t * `value` of the tab being selected: the panel's `value`, or its index as a\n\t * string (`'0'`, `'1'`, ...) when the panel has no `value`.\n\t */\n\tvalue: string;\n\t/**\n\t * `value` of the tab that was selected before this selection, or `undefined`\n\t * when no tab was selected.\n\t */\n\tpreviousValue: string | undefined;\n\t/** Index of the tab being selected */\n\tselectedIndex: number;\n\t/** Index of the tab that was selected before this selection, or `-1` when no tab was selected */\n\tpreviousIndex: number;\n}\n\n/**\n * Props shared by both ways of controlling the selected tab\n */\ninterface TabsBaseProps {\n\t/** TabsPanel children */\n\tchildren: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/**\n\t * Called when a tab is requested by click or arrow key. Receives the triggering event and\n\t * `{ value, previousValue, selectedIndex, previousIndex }`. Tabs is controlled: update `value`\n\t * from this callback to change tabs. It is not called for a disabled tab or for the tab that is\n\t * already selected.\n\t */\n\tonSelect: (\n\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\tdata: TabsSelectData\n\t) => void;\n\t/** Tab style variant */\n\tvariant?: TabsVariant;\n}\n\n/**\n * Select the tab by the `value` of its `TabsPanel`.\n */\ninterface TabsValueProps {\n\t/**\n\t * `value` of the selected `TabsPanel` (required, controlled). A panel without a `value` is\n\t * matched by its index as a string (`'0'`, `'1'`, ...). When no panel matches, no tab is selected.\n\t */\n\tvalue: string;\n\tselectedIndex?: never;\n}\n\n/**\n * Select the tab by index (deprecated).\n */\ninterface TabsSelectedIndexProps {\n\tvalue?: undefined;\n\t/**\n\t * @deprecated Use `value` instead (set `value` on each `TabsPanel`, or use the index as a\n\t * string). Index of the selected tab, controlled. Used only when `value` is not passed.\n\t */\n\tselectedIndex: number;\n}\n\n/**\n * Props for the Tabs component\n */\nexport type TabsProps = TabsBaseProps &\n\t(TabsValueProps | TabsSelectedIndexProps);\n\n// The value a panel is matched by: its `value`, or its index as a string.\nconst getPanelValue = (\n\tchild: React.ReactElement<TabChildProps>,\n\tindex: number\n): string => child.props.value ?? String(index);\n\n// Determine if a node from event.target is a Tab element\nfunction isTabNode(node: HTMLElement): boolean {\n\treturn (\n\t\t(node.nodeName === 'A' && node.getAttribute('role') === 'tab') ||\n\t\t(node.nodeName === 'LI' &&\n\t\t\t(node.classList.contains('slds-tabs_default__item') ||\n\t\t\t\tnode.classList.contains('slds-tabs_scoped__item') ||\n\t\t\t\tnode.classList.contains('slds-vertical-tabs__nav-item')))\n\t);\n}\n\n// Determine if a tab node is disabled (from DOM)\nfunction isTabNodeDisabled(node: HTMLElement): boolean {\n\tif (node.classList?.contains('slds-disabled')) {\n\t\treturn true;\n\t}\n\tif (node.getAttribute?.('aria-disabled') === 'true') {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n// Determine if a tab React element is disabled\nfunction isTabDisabled(tab: React.ReactElement<TabChildProps>): boolean {\n\treturn Boolean(tab.props?.disabled);\n}\n\n/**\n * Tabs keeps related content in a single container that is shown and hidden through navigation.\n */\nconst Tabs = (props: TabsProps): React.ReactElement => {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tid: propId,\n\t\tonSelect,\n\t\tselectedIndex: selectedIndexProp,\n\t\tvalue,\n\t\tvariant = 'default',\n\t} = props;\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tTABS,\n\t\t\t{\n\t\t\t\tdefaultSelectedIndex: (props as { defaultSelectedIndex?: number })\n\t\t\t\t\t.defaultSelectedIndex,\n\t\t\t\tselectedIndex: selectedIndexProp,\n\t\t\t\tvalue,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t});\n\n\tconst [focus, setFocus] = useState(false);\n\tconst tabsRef = useRef<\n\t\tArray<{ tab: React.ReactElement<TabChildProps>; node: HTMLElement | null }>\n\t>([]);\n\tconst tabsNodeRef = useRef<HTMLDivElement>(null);\n\n\tconst childArray = React.Children.toArray(\n\t\tchildren\n\t) as React.ReactElement<TabChildProps>[];\n\tconst tabsCount = childArray.length;\n\n\t// Selection is controlled: derived from `value`, or from the deprecated\n\t// `selectedIndex` when `value` is not passed. There is no internal copy.\n\tconst selectedIndex =\n\t\tvalue !== undefined\n\t\t\t? childArray.findIndex(\n\t\t\t\t\t(child, index) => getPanelValue(child, index) === value\n\t\t\t\t)\n\t\t\t: Number.isInteger(selectedIndexProp)\n\t\t\t\t? (selectedIndexProp as number)\n\t\t\t\t: -1;\n\n\tconst getNextTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab from index to the last tab\n\t\t\tfor (let i = index + 1; i < tabsCount; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from first tab\n\t\t\tfor (let i = 0; i < index; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst getPrevTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab backwards\n\t\t\tfor (let i = index - 1; i >= 0; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from last tab\n\t\t\tfor (let i = tabsCount - 1; i > index; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst setSelected = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\t\tindex: number,\n\t\t\tshouldFocus?: boolean\n\t\t) => {\n\t\t\tif (index < 0 || index >= tabsCount || index === selectedIndex) return;\n\n\t\t\tconst previous =\n\t\t\t\tselectedIndex >= 0 ? childArray[selectedIndex] : undefined;\n\t\t\tonSelect?.(event, {\n\t\t\t\tvalue: getPanelValue(childArray[index], index),\n\t\t\t\tpreviousValue: previous\n\t\t\t\t\t? getPanelValue(previous, selectedIndex)\n\t\t\t\t\t: undefined,\n\t\t\t\tselectedIndex: index,\n\t\t\t\tpreviousIndex: selectedIndex,\n\t\t\t});\n\t\t\t// Focus follows the selection once the parent updates `value`.\n\t\t\tsetFocus(shouldFocus === true);\n\t\t},\n\t\t[tabsCount, onSelect, selectedIndex, childArray]\n\t);\n\n\tconst isTabFromContainer = useCallback((node: HTMLElement): boolean => {\n\t\tif (!isTabNode(node)) return false;\n\n\t\tlet nodeAncestor: HTMLElement | null = node.parentElement;\n\t\twhile (nodeAncestor) {\n\t\t\tif (nodeAncestor === tabsNodeRef.current) return true;\n\t\t\tif (nodeAncestor.getAttribute('data-tabs')) break;\n\t\t\tnodeAncestor = nodeAncestor.parentElement;\n\t\t}\n\t\treturn false;\n\t}, []);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLDivElement>) => {\n\t\t\tlet node = e.target as HTMLElement;\n\t\t\tdo {\n\t\t\t\tif (isTabFromContainer(node)) {\n\t\t\t\t\tif (isTabNodeDisabled(node)) return;\n\n\t\t\t\t\tlet parentNode = node.parentNode as HTMLElement;\n\t\t\t\t\tif (parentNode?.nodeName === 'LI') {\n\t\t\t\t\t\tnode = parentNode;\n\t\t\t\t\t\tparentNode = node.parentNode as HTMLElement;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst index = Array.from(parentNode.children).indexOf(node);\n\t\t\t\t\tsetSelected(e, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tnode = node.parentNode as HTMLElement;\n\t\t\t} while (node !== null);\n\t\t},\n\t\t[isTabFromContainer, setSelected]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLDivElement>) => {\n\t\t\tif (isTabFromContainer(event.target as HTMLElement)) {\n\t\t\t\tlet index = selectedIndex;\n\t\t\t\tlet preventDefault = false;\n\n\t\t\t\tif (event.keyCode === KEYS.LEFT || event.keyCode === KEYS.UP) {\n\t\t\t\t\tindex = getPrevTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t} else if (\n\t\t\t\t\tevent.keyCode === KEYS.RIGHT ||\n\t\t\t\t\tevent.keyCode === KEYS.DOWN\n\t\t\t\t) {\n\t\t\t\t\tindex = getNextTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t}\n\n\t\t\t\tif (preventDefault) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t}\n\n\t\t\t\tsetSelected(event, index, true);\n\t\t\t}\n\t\t},\n\t\t[isTabFromContainer, selectedIndex, getPrevTab, getNextTab, setSelected]\n\t);\n\n\tconst renderTabsList = () => (\n\t\t<TabsList id={id} variant={variant}>\n\t\t\t{childArray.map((child, index) => {\n\t\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\t\tconst isSelected = selectedIndex === index;\n\t\t\t\tconst shouldFocus = isSelected && focus;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Tab\n\t\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\t\tref={(node: HTMLElement | null) => {\n\t\t\t\t\t\t\ttabsRef.current[index] = { tab: child, node };\n\t\t\t\t\t\t\tif (focus) {\n\t\t\t\t\t\t\t\tsetFocus(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfocus={shouldFocus}\n\t\t\t\t\t\tselected={isSelected}\n\t\t\t\t\t\tid={tabId}\n\t\t\t\t\t\tpanelId={panelId}\n\t\t\t\t\t\tdisabled={child.props.disabled}\n\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\thasError={child.props.hasError}\n\t\t\t\t\t\tassistiveText={child.props.assistiveText}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child.props.label}\n\t\t\t\t\t</Tab>\n\t\t\t\t);\n\t\t\t})}\n\t\t</TabsList>\n\t);\n\n\tconst renderTabPanels = () =>\n\t\tchildArray.map((child, index) => {\n\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\tconst isSelected = selectedIndex === index;\n\n\t\t\treturn (\n\t\t\t\t<TabPanel\n\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\tselected={isSelected}\n\t\t\t\t\tid={panelId}\n\t\t\t\t\ttabId={tabId}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t>\n\t\t\t\t\t{child}\n\t\t\t\t</TabPanel>\n\t\t\t);\n\t\t});\n\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\tclassName={classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-tabs_default': variant === 'default',\n\t\t\t\t\t'slds-tabs_scoped': variant === 'scoped',\n\t\t\t\t\t'slds-vertical-tabs': variant === 'vertical',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tdata-tabs\n\t\t\tref={tabsNodeRef}\n\t\t>\n\t\t\t{renderTabsList()}\n\t\t\t{renderTabPanels()}\n\t\t</div>\n\t);\n};\n\nTabs.displayName = TABS;\n\nexport default Tabs;\n"],"mappings":";;;;;;;;;;;;AA0HA,IAAM,KACL,GACA,MACY,EAAM,MAAM,SAAS,OAAO,CAAK;AAG9C,SAAS,EAAU,GAA4B;CAC9C,OACE,EAAK,aAAa,OAAO,EAAK,aAAa,MAAM,MAAM,SACvD,EAAK,aAAa,SACjB,EAAK,UAAU,SAAS,yBAAyB,KACjD,E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;EAEZ,CAAC,CAoBI;;AAEP;AAEA,EAAK,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/tabs/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseId,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\n\n// Child components\nimport TabsList from './private/tabs-list';\nimport Tab from './private/tab';\nimport TabPanel from './private/tab-panel';\nimport type { TabsPanelProps } from './panel';\nimport type { ChildrenOf } from '../../types/common';\n\nimport { TABS } from '../../utilities/constants';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n/**\n * Tabs variant types\n */\nexport type TabsVariant = 'default' | 'scoped' | 'vertical';\n\n/** @deprecated Use `TabsPanelProps` from `tabs/panel`. */\nexport type TabChildProps = TabsPanelProps;\n\n/**\n * Data passed to the Tabs `onSelect` callback\n */\nexport interface TabsSelectData {\n\t/**\n\t * `value` of the tab being selected: the panel's `value`, or its index as a\n\t * string (`'0'`, `'1'`, ...) when the panel has no `value`.\n\t */\n\tvalue: string;\n\t/**\n\t * `value` of the tab that was selected before this selection, or `undefined`\n\t * when no tab was selected.\n\t */\n\tpreviousValue: string | undefined;\n\t/** Index of the tab being selected */\n\tselectedIndex: number;\n\t/** Index of the tab that was selected before this selection, or `-1` when no tab was selected */\n\tpreviousIndex: number;\n}\n\n/**\n * Props shared by both ways of controlling the selected tab\n */\ninterface TabsBaseProps {\n\t/** `TabsPanel` elements, one per tab. Tabs reads each panel's `label`, `value`, `disabled`, `hasError` and `assistiveText`. */\n\tchildren: ChildrenOf<TabsPanelProps>;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/**\n\t * Called when a tab is requested by click or arrow key. Receives the triggering event and\n\t * `{ value, previousValue, selectedIndex, previousIndex }`. Tabs is controlled: update `value`\n\t * from this callback to change tabs. It is not called for a disabled tab or for the tab that is\n\t * already selected.\n\t */\n\tonSelect: (\n\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\tdata: TabsSelectData\n\t) => void;\n\t/** Tab style variant */\n\tvariant?: TabsVariant;\n}\n\n/**\n * Select the tab by the `value` of its `TabsPanel`.\n */\ninterface TabsValueProps {\n\t/**\n\t * `value` of the selected `TabsPanel` (required, controlled). A panel without a `value` is\n\t * matched by its index as a string (`'0'`, `'1'`, ...). When no panel matches, no tab is selected.\n\t */\n\tvalue: string;\n\tselectedIndex?: never;\n}\n\n/**\n * Select the tab by index (deprecated).\n */\ninterface TabsSelectedIndexProps {\n\tvalue?: undefined;\n\t/**\n\t * @deprecated Use `value` instead (set `value` on each `TabsPanel`, or use the index as a\n\t * string). Index of the selected tab, controlled. Used only when `value` is not passed.\n\t */\n\tselectedIndex: number;\n}\n\n/**\n * Props for the Tabs component\n */\nexport type TabsProps = TabsBaseProps &\n\t(TabsValueProps | TabsSelectedIndexProps);\n\n// The value a panel is matched by: its `value`, or its index as a string.\nconst getPanelValue = (\n\tchild: React.ReactElement<TabsPanelProps>,\n\tindex: number\n): string => child.props.value ?? String(index);\n\n// Determine if a node from event.target is a Tab element\nfunction isTabNode(node: HTMLElement): boolean {\n\treturn (\n\t\t(node.nodeName === 'A' && node.getAttribute('role') === 'tab') ||\n\t\t(node.nodeName === 'LI' &&\n\t\t\t(node.classList.contains('slds-tabs_default__item') ||\n\t\t\t\tnode.classList.contains('slds-tabs_scoped__item') ||\n\t\t\t\tnode.classList.contains('slds-vertical-tabs__nav-item')))\n\t);\n}\n\n// Determine if a tab node is disabled (from DOM)\nfunction isTabNodeDisabled(node: HTMLElement): boolean {\n\tif (node.classList?.contains('slds-disabled')) {\n\t\treturn true;\n\t}\n\tif (node.getAttribute?.('aria-disabled') === 'true') {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n// Determine if a tab React element is disabled\nfunction isTabDisabled(tab: React.ReactElement<TabsPanelProps>): boolean {\n\treturn Boolean(tab.props?.disabled);\n}\n\n/**\n * Tabs keeps related content in a single container that is shown and hidden through navigation.\n */\nconst Tabs = (props: TabsProps): React.ReactElement => {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tid: propId,\n\t\tonSelect,\n\t\tselectedIndex: selectedIndexProp,\n\t\tvalue,\n\t\tvariant = 'default',\n\t} = props;\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tuseEffect(() => {\n\t\tcheckProps(\n\t\t\tTABS,\n\t\t\t{\n\t\t\t\tdefaultSelectedIndex: (props as { defaultSelectedIndex?: number })\n\t\t\t\t\t.defaultSelectedIndex,\n\t\t\t\tselectedIndex: selectedIndexProp,\n\t\t\t\tvalue,\n\t\t\t},\n\t\t\tcomponentDoc\n\t\t);\n\t});\n\n\tconst [focus, setFocus] = useState(false);\n\tconst tabsRef = useRef<\n\t\tArray<{ tab: React.ReactElement<TabsPanelProps>; node: HTMLElement | null }>\n\t>([]);\n\tconst tabsNodeRef = useRef<HTMLDivElement>(null);\n\n\tconst childArray = React.Children.toArray(\n\t\tchildren\n\t) as React.ReactElement<TabsPanelProps>[];\n\tconst tabsCount = childArray.length;\n\n\t// Selection is controlled: derived from `value`, or from the deprecated\n\t// `selectedIndex` when `value` is not passed. There is no internal copy.\n\tconst selectedIndex =\n\t\tvalue !== undefined\n\t\t\t? childArray.findIndex(\n\t\t\t\t\t(child, index) => getPanelValue(child, index) === value\n\t\t\t\t)\n\t\t\t: Number.isInteger(selectedIndexProp)\n\t\t\t\t? (selectedIndexProp as number)\n\t\t\t\t: -1;\n\n\tconst getNextTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab from index to the last tab\n\t\t\tfor (let i = index + 1; i < tabsCount; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from first tab\n\t\t\tfor (let i = 0; i < index; i++) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst getPrevTab = useCallback(\n\t\t(index: number): number => {\n\t\t\t// Look for non-disabled tab backwards\n\t\t\tfor (let i = index - 1; i >= 0; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Continue from last tab\n\t\t\tfor (let i = tabsCount - 1; i > index; i--) {\n\t\t\t\tconst tab = tabsRef.current[i];\n\t\t\t\tif (tab && !isTabDisabled(tab.tab)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn index;\n\t\t},\n\t\t[tabsCount]\n\t);\n\n\tconst setSelected = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>,\n\t\t\tindex: number,\n\t\t\tshouldFocus?: boolean\n\t\t) => {\n\t\t\tif (index < 0 || index >= tabsCount || index === selectedIndex) return;\n\n\t\t\tconst previous =\n\t\t\t\tselectedIndex >= 0 ? childArray[selectedIndex] : undefined;\n\t\t\tonSelect?.(event, {\n\t\t\t\tvalue: getPanelValue(childArray[index], index),\n\t\t\t\tpreviousValue: previous\n\t\t\t\t\t? getPanelValue(previous, selectedIndex)\n\t\t\t\t\t: undefined,\n\t\t\t\tselectedIndex: index,\n\t\t\t\tpreviousIndex: selectedIndex,\n\t\t\t});\n\t\t\t// Focus follows the selection once the parent updates `value`.\n\t\t\tsetFocus(shouldFocus === true);\n\t\t},\n\t\t[tabsCount, onSelect, selectedIndex, childArray]\n\t);\n\n\tconst isTabFromContainer = useCallback((node: HTMLElement): boolean => {\n\t\tif (!isTabNode(node)) return false;\n\n\t\tlet nodeAncestor: HTMLElement | null = node.parentElement;\n\t\twhile (nodeAncestor) {\n\t\t\tif (nodeAncestor === tabsNodeRef.current) return true;\n\t\t\tif (nodeAncestor.getAttribute('data-tabs')) break;\n\t\t\tnodeAncestor = nodeAncestor.parentElement;\n\t\t}\n\t\treturn false;\n\t}, []);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLDivElement>) => {\n\t\t\tlet node = e.target as HTMLElement;\n\t\t\tdo {\n\t\t\t\tif (isTabFromContainer(node)) {\n\t\t\t\t\tif (isTabNodeDisabled(node)) return;\n\n\t\t\t\t\tlet parentNode = node.parentNode as HTMLElement;\n\t\t\t\t\tif (parentNode?.nodeName === 'LI') {\n\t\t\t\t\t\tnode = parentNode;\n\t\t\t\t\t\tparentNode = node.parentNode as HTMLElement;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst index = Array.from(parentNode.children).indexOf(node);\n\t\t\t\t\tsetSelected(e, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tnode = node.parentNode as HTMLElement;\n\t\t\t} while (node !== null);\n\t\t},\n\t\t[isTabFromContainer, setSelected]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLDivElement>) => {\n\t\t\tif (isTabFromContainer(event.target as HTMLElement)) {\n\t\t\t\tlet index = selectedIndex;\n\t\t\t\tlet preventDefault = false;\n\n\t\t\t\tif (event.key === KEYS.LEFT || event.key === KEYS.UP) {\n\t\t\t\t\tindex = getPrevTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t} else if (event.key === KEYS.RIGHT || event.key === KEYS.DOWN) {\n\t\t\t\t\tindex = getNextTab(index);\n\t\t\t\t\tpreventDefault = true;\n\t\t\t\t}\n\n\t\t\t\tif (preventDefault) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t}\n\n\t\t\t\tsetSelected(event, index, true);\n\t\t\t}\n\t\t},\n\t\t[isTabFromContainer, selectedIndex, getPrevTab, getNextTab, setSelected]\n\t);\n\n\tconst renderTabsList = () => (\n\t\t<TabsList id={id} variant={variant}>\n\t\t\t{childArray.map((child, index) => {\n\t\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\t\tconst isSelected = selectedIndex === index;\n\t\t\t\tconst shouldFocus = isSelected && focus;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Tab\n\t\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\t\tref={(node: HTMLElement | null) => {\n\t\t\t\t\t\t\ttabsRef.current[index] = { tab: child, node };\n\t\t\t\t\t\t\tif (focus) {\n\t\t\t\t\t\t\t\tsetFocus(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tfocus={shouldFocus}\n\t\t\t\t\t\tselected={isSelected}\n\t\t\t\t\t\tid={tabId}\n\t\t\t\t\t\tpanelId={panelId}\n\t\t\t\t\t\tdisabled={child.props.disabled}\n\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\thasError={child.props.hasError}\n\t\t\t\t\t\tassistiveText={child.props.assistiveText}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child.props.label}\n\t\t\t\t\t</Tab>\n\t\t\t\t);\n\t\t\t})}\n\t\t</TabsList>\n\t);\n\n\tconst renderTabPanels = () =>\n\t\tchildArray.map((child, index) => {\n\t\t\tconst tabId = `${id}-slds-tabs_tab-${index}`;\n\t\t\tconst panelId = `${id}-slds-tabs_panel-${index}`;\n\t\t\tconst isSelected = selectedIndex === index;\n\n\t\t\treturn (\n\t\t\t\t<TabPanel\n\t\t\t\t\tkey={child.key ?? index}\n\t\t\t\t\tselected={isSelected}\n\t\t\t\t\tid={panelId}\n\t\t\t\t\ttabId={tabId}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t>\n\t\t\t\t\t{child}\n\t\t\t\t</TabPanel>\n\t\t\t);\n\t\t});\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- wrapper delegates events from the focusable tabs it contains\n\t\t<div\n\t\t\tid={id}\n\t\t\tclassName={classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-tabs_default': variant === 'default',\n\t\t\t\t\t'slds-tabs_scoped': variant === 'scoped',\n\t\t\t\t\t'slds-vertical-tabs': variant === 'vertical',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tonClick={handleClick}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tdata-tabs\n\t\t\tref={tabsNodeRef}\n\t\t>\n\t\t\t{renderTabsList()}\n\t\t\t{renderTabPanels()}\n\t\t</div>\n\t);\n};\n\nTabs.displayName = TABS;\n\nexport default Tabs;\n"],"mappings":";;;;;;;;;;;;AA+GA,IAAM,KACL,GACA,MACY,EAAM,MAAM,SAAS,OAAO,CAAK;AAG9C,SAAS,EAAU,GAA4B;CAC9C,OACE,EAAK,aAAa,OAAO,EAAK,aAAa,MAAM,MAAM,SACvD,EAAK,aAAa,SACjB,EAAK,UAAU,SAAS,yBAAyB,KACjD,EAAK,UAAU,SAAS,wBAAwB,KAChD,EAAK,UAAU,SAAS,8BAA8B;AAE1D;AAGA,SAAS,EAAkB,GAA4B;CAOtD,OAHA,GAHI,EAAK,WAAW,SAAS,eAAe,KAGxC,EAAK,eAAe,eAAe,MAAM;AAI9C;AAGA,SAAS,EAAc,GAAkD;CACxE,OAAO,EAAQ,EAAI,OAAO;AAC3B;AAKA,IAAM,KAAQ,MAAyC;CACtD,IAAM,EACL,aACA,cACA,IAAI,GACJ,aACA,eAAe,GACf,UACA,aAAU,cACP,GACE,IAAc,EAAM,GACpB,IAAK,KAAU;CAErB,QAAgB;EACf,EACC,GACA;GACC,sBAAu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AqB,MAAY;GACjC,oBAAoB,MAAY;GAChC,sBAAsB,MAAY;EACnC,GACA,CACD;EACA,SAAS;EACT,WAAW;EACX,aAAA;EACA,KAAK;EAbN,UAAA,CArDA,kBAAC,GAAD;GAAc;GAAa;GACzB,UAAA,EAAW,KAAK,GAAO,MAAU;IACjC,IAAM,IAAQ,GAAG,EAAG,iBAAiB,KAC/B,IAAU,GAAG,EAAG,mBAAmB,KACnC,IAAa,MAAkB;IAGrC,OACC,kBAAC,GAAD;KAEC,MAAM,MAA6B;MAElC,AADA,EAAQ,QAAQ,KAAS;OAAE,KAAK;OAAO;MAAK,GACxC,KACH,EAAS,EAAK;KAEhB;KACA,OAXkB,KAAc;KAYhC,UAAU;KACV,IAAI;KACK;KACT,UAAU,EAAM,MAAM;KACb;KACT,UAAU,EAAM,MAAM;KACtB,eAAe,EAAM,MAAM;KAE1B,UAAA,EAAM,MAAM;IACT,GAjBC,EAAM,OAAO,CAiBd;GAEP,CAAC;EACQ,CAAA,GAIV,EAAW,KAAK,GAAO,MAAU;GAChC,IAAM,IAAQ,GAAG,EAAG,iBAAiB,KAC/B,IAAU,GAAG,EAAG,mBAAmB;GAGzC,OACC,kBAAC,GAAD;IAEC,UALiB,MAAkB;IAMnC,IAAI;IACG;IACE;IAER,UAAA;GACQ,GAPJ,EAAM,OAAO,CAOT;EAEZ,CAAC,CAqBI;;AAEP;AAEA,EAAK,cAAc"}
|
|
@@ -47,7 +47,7 @@ var c = n((e, n) => {
|
|
|
47
47
|
children: /* @__PURE__ */ o(t, {
|
|
48
48
|
assistiveText: { label: y.withErrorIcon },
|
|
49
49
|
category: "utility",
|
|
50
|
-
containerClassName: "slds-icon_container
|
|
50
|
+
containerClassName: "slds-icon_container",
|
|
51
51
|
size: "x-small",
|
|
52
52
|
name: "error",
|
|
53
53
|
colorVariant: "error",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.js","names":[],"sources":["../../../../../components/tabs/private/tab.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable jsx-a11y/no-interactive-element-to-noninteractive-role */\n\n// # TabItem Component\n\n// ## Dependencies\n\n// ### React\nimport React, {
|
|
1
|
+
{"version":3,"file":"tab.js","names":[],"sources":["../../../../../components/tabs/private/tab.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n/* eslint-disable jsx-a11y/no-interactive-element-to-noninteractive-role */\n\n// # TabItem Component\n\n// ## Dependencies\n\n// ### React\nimport React, { forwardRef, useEffect, useRef, type ReactNode } from 'react';\n\n// ### classNames\nimport classNames from 'classnames';\n\n// ## Constants\nimport { TAB } from '../../../utilities/constants';\n\nimport Icon from '../../icon';\nimport { type TabsVariant } from '../index';\n\nexport interface TabProps {\n\t/**\n\t * The CSS class to be applied when this tab is selected. Defaults to `.slds-is-active`. If another class is desired, it should be passed in _along with_ `.slds-is-active`, not _instead_ of it.\n\t */\n\tactiveTabClassName?: string;\n\t/**\n\t * **Assistive text for accessibility**\n\t * This object is merged with the default props object on every render.\n\t * * `withErrorIcon`: This text is for the error icon that will be placed next to the `<Tab />` title\n\t */\n\tassistiveText?: {\n\t\twithErrorIcon?: string;\n\t};\n\t/**\n\t * The string or element that is shown as both the title and the label for this tab.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * CSS classes to be added to the tab.\n\t */\n\tclassName?: string;\n\t/**\n\t * When `true`, the HTML attribute `aria-disabled` will be applied.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * The CSS class to be applied when this tab is disabled. Defaults to `.slds-disabled`. If another class is desired, it should be passed in _along with_ `.slds-disabled`, not _instead_ of it.\n\t */\n\tdisabledTabClassName?: string;\n\t/**\n\t * Whether to apply focus to this tab.\n\t */\n\tfocus?: boolean;\n\t/**\n\t * Show an icon that can be used to communicate when a tab contains a validation error that needs attention\n\t */\n\thasError?: boolean;\n\t/**\n\t * The HTML ID of this tab. Also used by the `<TabPanel />` it controls as `tabId`.\n\t */\n\tid?: string;\n\t/**\n\t * The HTML ID of `<TabPanel />` this tab controls.\n\t */\n\tpanelId?: string;\n\t/**\n\t * When `true`, the class `.slds-is-active` is applied.\n\t */\n\tselected?: boolean;\n\t/**\n\t * If the Tabs should be scoped, vertical, or default (default value)\n\t */\n\tvariant?: TabsVariant;\n}\n\nconst Tab = forwardRef<HTMLElement, TabProps>((props, ref) => {\n\tconst {\n\t\tselected = false,\n\t\tdisabled,\n\t\tpanelId,\n\t\tactiveTabClassName = 'slds-is-active',\n\t\tdisabledTabClassName = 'slds-disabled',\n\t\tclassName,\n\t\tchildren,\n\t\tid,\n\t\tvariant = 'default',\n\t\thasError = false,\n\t\tfocus = false,\n\t\tassistiveText = { withErrorIcon: 'This item has an error' },\n\t} = props;\n\n\tconst nodeRef = useRef<HTMLAnchorElement | null>(null);\n\n\tconst setRefs = (node: HTMLAnchorElement | null) => {\n\t\tnodeRef.current = node;\n\t\tif (typeof ref === 'function') {\n\t\t\tref(node);\n\t\t} else if (ref) {\n\t\t\t(ref as React.RefObject<HTMLElement | null>).current = node;\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (selected && focus && nodeRef.current) {\n\t\t\tnodeRef.current.focus();\n\t\t}\n\t});\n\n\t/**\n\t * Desired a11y behaviour: The active Tab should get focus when the user presses the\n\t * Tab key. After that, Arrow keys should be used to change the focus from one tab\n\t * to another. Pressing the Tab key one more time should move the focus away from the\n\t * Tab group.\n\t *\n\t * Here, we put the selected Tab in the navigation path (tabIndex = 0) and remove other\n\t * tabs from navigation path (tabIndex = -1).\n\t */\n\tconst tabIndex = selected ? 0 : -1;\n\n\treturn (\n\t\t<li\n\t\t\tclassName={classNames(className, {\n\t\t\t\t[activeTabClassName]: selected,\n\t\t\t\t[disabledTabClassName]: disabled,\n\t\t\t\t'slds-tabs_default__item': variant === 'default',\n\t\t\t\t'slds-tabs_scoped__item': variant === 'scoped',\n\t\t\t\t'slds-vertical-tabs__nav-item': variant === 'vertical',\n\t\t\t})}\n\t\t\trole=\"presentation\"\n\t\t\tid={id}\n\t\t\ttitle={typeof children === 'string' ? children : undefined}\n\t\t>\n\t\t\t{/* eslint-disable-next-line jsx-a11y/anchor-is-valid -- SLDS tabs markup uses an anchor for each tab */}\n\t\t\t<a\n\t\t\t\tclassName={classNames({\n\t\t\t\t\t[activeTabClassName]: selected,\n\t\t\t\t\t[disabledTabClassName]: disabled,\n\t\t\t\t\t'slds-tabs_default__link': variant === 'default',\n\t\t\t\t\t'slds-tabs_scoped__link': variant === 'scoped',\n\t\t\t\t\t'slds-vertical-tabs__link': variant === 'vertical',\n\t\t\t\t})}\n\t\t\t\thref=\"#\"\n\t\t\t\trole=\"tab\"\n\t\t\t\tref={setRefs}\n\t\t\t\ttabIndex={tabIndex}\n\t\t\t\taria-controls={panelId}\n\t\t\t\taria-disabled={disabled}\n\t\t\t\taria-selected={selected ? 'true' : 'false'}\n\t\t\t\tonClick={(event) => event.preventDefault()}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t{hasError && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={classNames({\n\t\t\t\t\t\t\t'slds-tabs__right-icon': variant !== 'vertical',\n\t\t\t\t\t\t\t'slds-vertical-tabs__right-icon': variant === 'vertical',\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\t\t\tlabel: assistiveText.withErrorIcon,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tcontainerClassName=\"slds-icon_container\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t\tname=\"error\"\n\t\t\t\t\t\t\tcolorVariant=\"error\"\n\t\t\t\t\t\t\ttitle={assistiveText.withErrorI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T,oBAAmB;KACnB,MAAK;KACL,MAAK;KACL,cAAa;KACb,OAAO,EAAc;IACrB,CAAA;GACI,CAAA,CAEL;;CACA,CAAA;AAEN,CAAC;AAED,EAAI,cAAc"}
|
|
@@ -9,7 +9,7 @@ process.env.NODE_ENV !== "production" && (i = function(i, a, o) {
|
|
|
9
9
|
r(i, {
|
|
10
10
|
"labels.label": a.labels?.label ?? a.label,
|
|
11
11
|
"assistiveText.label": a.assistiveText?.label
|
|
12
|
-
}, s()), e(i, a.defaultValue !== void 0, "defaultValue", "Textarea is controlled: pass `value` and update it in `onChange`."), typeof a.maxLength == "string" && e(i, a.maxLength, "maxLength", `\`maxLength\` as a string has been deprecated. Please pass a number instead. ${s("maxLength")}`), n(i, a.errorText, "errorText", "labels.error` and `hasError", s("labels")), n(i, a.label, "label", "labels.label", s("labels"));
|
|
12
|
+
}, s()), e(i, a.defaultValue !== void 0, "defaultValue", "Textarea is controlled: pass `value` and update it in `onChange`."), typeof a.maxLength == "string" && e(i, a.maxLength, "maxLength", `\`maxLength\` as a string has been deprecated. Please pass a number instead. ${s("maxLength")}`), n(i, a.onKeyPress, "onKeyPress", "onKeyDown", `\`keypress\` is a deprecated DOM event; read \`event.key\` instead. ${s("onKeyDown")}`), n(i, a.errorText, "errorText", "labels.error` and `hasError", s("labels")), n(i, a.label, "label", "labels.label", s("labels"));
|
|
13
13
|
});
|
|
14
14
|
var a = i;
|
|
15
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/textarea/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n/* eslint-disable max-len */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tonlyOneOfProperties(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\t'labels.label': props.labels?.label ?? props.label,\n\t\t\t\t'assistiveText.label': props.assistiveText?.label,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.defaultValue !== undefined,\n\t\t\t'defaultValue',\n\t\t\t'Textarea is controlled: pass `value` and update it in `onChange`.'\n\t\t);\n\n\t\tif (typeof props.maxLength === 'string') {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.maxLength,\n\t\t\t\t'maxLength',\n\t\t\t\t`\\`maxLength\\` as a string has been deprecated. Please pass a number instead. ${createDocUrl(\n\t\t\t\t\t'maxLength'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.errorText,\n\t\t\t'errorText',\n\t\t\t'labels.error` and `hasError',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.label,\n\t\t\t'label',\n\t\t\t'labels.label',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;;AAUA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;
|
|
1
|
+
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/textarea/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n/* eslint-disable max-len */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tonlyOneOfProperties(\n\t\t\tCOMPONENT,\n\t\t\t{\n\t\t\t\t'labels.label': props.labels?.label ?? props.label,\n\t\t\t\t'assistiveText.label': props.assistiveText?.label,\n\t\t\t},\n\t\t\tcreateDocUrl()\n\t\t);\n\n\t\tsunsetProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.defaultValue !== undefined,\n\t\t\t'defaultValue',\n\t\t\t'Textarea is controlled: pass `value` and update it in `onChange`.'\n\t\t);\n\n\t\tif (typeof props.maxLength === 'string') {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.maxLength,\n\t\t\t\t'maxLength',\n\t\t\t\t`\\`maxLength\\` as a string has been deprecated. Please pass a number instead. ${createDocUrl(\n\t\t\t\t\t'maxLength'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.onKeyPress,\n\t\t\t'onKeyPress',\n\t\t\t'onKeyDown',\n\t\t\t`\\`keypress\\` is a deprecated DOM event; read \\`event.key\\` instead. ${createDocUrl('onKeyDown')}`\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.errorText,\n\t\t\t'errorText',\n\t\t\t'labels.error` and `hasError',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.label,\n\t\t\t'label',\n\t\t\t'labels.label',\n\t\t\tcreateDocUrl('labels')\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;;AAUA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CA2C9C,AAzCA,EACC,GACA;EACC,gBAAgB,EAAM,QAAQ,SAAS,EAAM;EAC7C,uBAAuB,EAAM,eAAe;CAC7C,GACA,EAAa,CACd,GAEA,EACC,GACA,EAAM,iBAAiB,KAAA,GACvB,gBACA,mEACD,GAEI,OAAO,EAAM,aAAc,YAC9B,EACC,GACA,EAAM,WACN,aACA,gFAAgF,EAC/E,WACD,GACD,GAGD,EACC,GACA,EAAM,YACN,cACA,aACA,uEAAuE,EAAa,WAAW,GAChG,GACA,EACC,GACA,EAAM,WACN,aACA,+BACA,EAAa,QAAQ,CACtB,GACA,EACC,GACA,EAAM,OACN,SACA,gBACA,EAAa,QAAQ,CACtB;AACD;AAGD,IAAA,IAAe"}
|