@salesforce/design-system-react 11.0.0-rc.0 → 11.0.0-rc.2
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 +27 -1
- package/dist/cjs/components/accordion/index.cjs +1 -1
- 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/nav-dropdown.cjs.map +1 -1
- package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
- package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
- package/dist/cjs/components/button/check-props.cjs +1 -1
- package/dist/cjs/components/button/check-props.cjs.map +1 -1
- package/dist/cjs/components/button/index.cjs +1 -1
- package/dist/cjs/components/button/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/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/color-picker.cjs +1 -1
- package/dist/cjs/components/color-picker/color-picker.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.cjs +1 -1
- package/dist/cjs/components/color-picker/private/swatch.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/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/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.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/files/file.cjs +1 -8
- package/dist/cjs/components/files/file.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/icon/check-props.cjs +1 -1
- package/dist/cjs/components/icon/check-props.cjs.map +1 -1
- 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.map +1 -1
- package/dist/cjs/components/icon-settings/index.cjs.map +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.map +1 -1
- package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
- package/dist/cjs/components/input/search.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/button-trigger.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/panel/filtering/group.cjs.map +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/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/index.cjs.map +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/index.cjs +1 -1
- package/dist/cjs/components/radio/index.cjs.map +1 -1
- package/dist/cjs/components/radio-group/check-props.cjs.map +1 -1
- package/dist/cjs/components/radio-group/index.cjs.map +1 -1
- package/dist/cjs/components/scoped-notification/index.cjs.map +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/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/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/split-view/header.cjs.map +1 -1
- package/dist/cjs/components/split-view/listbox.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.map +1 -1
- package/dist/cjs/components/tabs/panel.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.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/tree/private/branch.cjs.map +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.map +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-label.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/utility-icon/index.cjs +1 -1
- package/dist/cjs/components/utilities/utility-icon/index.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/dom-element-focus.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-component-doc.cjs +1 -1
- package/dist/cjs/utilities/get-component-doc.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/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/product-tokens/icon-backgrounds.cjs.map +1 -1
- package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
- package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
- 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/removal-version.cjs +2 -0
- package/dist/cjs/utilities/warning/removal-version.cjs.map +1 -0
- 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 +7 -3
- 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 +4 -5
- package/dist/es/components/alert/index.js.map +1 -1
- package/dist/es/components/builder-header/nav-dropdown.js.map +1 -1
- package/dist/es/components/builder-header/nav-link.js.map +1 -1
- package/dist/es/components/builder-header/toolbar.js.map +1 -1
- package/dist/es/components/button/check-props.js +1 -1
- package/dist/es/components/button/check-props.js.map +1 -1
- package/dist/es/components/button/index.js +50 -50
- package/dist/es/components/button/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 +3 -2
- package/dist/es/components/button-stateful/index.js.map +1 -1
- package/dist/es/components/carousel/index.js +155 -129
- 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 +102 -100
- package/dist/es/components/checkbox/index.js.map +1 -1
- package/dist/es/components/color-picker/color-picker.js +150 -151
- package/dist/es/components/color-picker/color-picker.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 +16 -20
- 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.js +1 -1
- package/dist/es/components/color-picker/private/swatch.js.map +1 -1
- package/dist/es/components/combobox/combobox.js +569 -582
- package/dist/es/components/combobox/combobox.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 +3 -3
- package/dist/es/components/combobox/private/menu.js.map +1 -1
- package/dist/es/components/date-picker/date-picker.js +101 -102
- 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.js.map +1 -1
- package/dist/es/components/date-picker/private/day.js +1 -1
- package/dist/es/components/date-picker/private/day.js.map +1 -1
- package/dist/es/components/files/file.js +5 -6
- package/dist/es/components/files/file.js.map +1 -1
- package/dist/es/components/files/private/file-actions.js +2 -2
- 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 +5 -1
- package/dist/es/components/filter/filter.js.map +1 -1
- package/dist/es/components/icon/check-props.js +9 -7
- package/dist/es/components/icon/check-props.js.map +1 -1
- package/dist/es/components/icon/index.js +13 -10
- package/dist/es/components/icon/index.js.map +1 -1
- package/dist/es/components/icon/input-icon/index.js.map +1 -1
- package/dist/es/components/icon-settings/index.js.map +1 -1
- package/dist/es/components/input/check-props.js +14 -13
- package/dist/es/components/input/check-props.js.map +1 -1
- package/dist/es/components/input/index.js.map +1 -1
- package/dist/es/components/input/private/inner-input.js.map +1 -1
- package/dist/es/components/input/search.js.map +1 -1
- package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
- package/dist/es/components/menu-dropdown/menu-dropdown.js +202 -207
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/modal/index.js +1 -2
- package/dist/es/components/modal/index.js.map +1 -1
- package/dist/es/components/panel/filtering/group.js.map +1 -1
- package/dist/es/components/pill/index.js.map +1 -1
- package/dist/es/components/pill-container/index.js +10 -6
- package/dist/es/components/pill-container/index.js.map +1 -1
- 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 +181 -177
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/progress-indicator/index.js.map +1 -1
- 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/index.js +1 -1
- package/dist/es/components/radio/index.js.map +1 -1
- package/dist/es/components/radio-group/check-props.js.map +1 -1
- package/dist/es/components/radio-group/index.js.map +1 -1
- package/dist/es/components/scoped-notification/index.js.map +1 -1
- package/dist/es/components/setup-assistant/step.js.map +1 -1
- package/dist/es/components/simple-data-table/cell.js +8 -5
- package/dist/es/components/simple-data-table/cell.js.map +1 -1
- package/dist/es/components/simple-data-table/index.js +97 -91
- package/dist/es/components/simple-data-table/index.js.map +1 -1
- package/dist/es/components/simple-data-table/interactive-element.js +31 -28
- 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 +2 -1
- package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -1
- package/dist/es/components/simple-data-table/private/link.js.map +1 -1
- package/dist/es/components/simple-data-table/private/row.js +96 -60
- package/dist/es/components/simple-data-table/private/row.js.map +1 -1
- package/dist/es/components/simple-data-table/row-actions.js +4 -1
- 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/split-view/header.js.map +1 -1
- package/dist/es/components/split-view/listbox.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.map +1 -1
- package/dist/es/components/tabs/panel.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 +29 -42
- package/dist/es/components/textarea/index.js.map +1 -1
- package/dist/es/components/toast/index.js.map +1 -1
- package/dist/es/components/tooltip/index.js +107 -88
- package/dist/es/components/tooltip/index.js.map +1 -1
- package/dist/es/components/tree/private/branch.js.map +1 -1
- package/dist/es/components/tree/private/item.js.map +1 -1
- package/dist/es/components/tree/private/render-branch.js +14 -19
- 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.map +1 -1
- package/dist/es/components/trial-bar/dropdown.js.map +1 -1
- package/dist/es/components/utilities/dialog/index.js +2 -1
- 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-label.js.map +1 -1
- package/dist/es/components/utilities/menu-list/item.js +42 -18
- package/dist/es/components/utilities/menu-list/item.js.map +1 -1
- 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/utilities/color.js +1 -1
- package/dist/es/utilities/color.js.map +1 -1
- package/dist/es/utilities/dom-element-focus.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-component-doc.js +6 -6
- package/dist/es/utilities/get-component-doc.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/keyboard-navigable-dialog.js +7 -7
- package/dist/es/utilities/keyboard-navigable-dialog.js.map +1 -1
- package/dist/es/utilities/keyboard-navigate.js +1 -1
- package/dist/es/utilities/keyboard-navigate.js.map +1 -1
- package/dist/es/utilities/product-tokens/icon-backgrounds.js.map +1 -1
- package/dist/es/utilities/warning/children-as-trigger.js +10 -8
- package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
- package/dist/es/utilities/warning/deprecated-property-value.js +12 -10
- package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
- package/dist/es/utilities/warning/deprecated-property.js +10 -8
- 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/removal-version.js +6 -0
- package/dist/es/utilities/warning/removal-version.js.map +1 -0
- 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/llms/components/accordion.md +267 -0
- package/dist/llms/components/alert.md +228 -0
- package/dist/llms/components/avatar.md +167 -0
- package/dist/llms/components/badge.md +153 -0
- package/dist/llms/components/breadcrumb.md +148 -0
- package/dist/llms/components/builder-header.examples.md +239 -0
- package/dist/llms/components/builder-header.md +736 -0
- package/dist/llms/components/button-group.md +167 -0
- package/dist/llms/components/button-stateful.md +246 -0
- package/dist/llms/components/button.md +661 -0
- package/dist/llms/components/card.md +368 -0
- package/dist/llms/components/carousel.md +365 -0
- package/dist/llms/components/checkbox.md +887 -0
- package/dist/llms/components/color-picker.md +591 -0
- package/dist/llms/components/combobox.examples.md +802 -0
- package/dist/llms/components/combobox.md +929 -0
- package/dist/llms/components/date-picker.md +546 -0
- package/dist/llms/components/docked-composer.md +173 -0
- package/dist/llms/components/dynamic-icon.md +226 -0
- package/dist/llms/components/expandable-section.md +198 -0
- package/dist/llms/components/files.md +337 -0
- package/dist/llms/components/filter.md +775 -0
- package/dist/llms/components/icon-settings.md +301 -0
- package/dist/llms/components/icon.md +1040 -0
- package/dist/llms/components/input.md +746 -0
- package/dist/llms/components/media-object.md +125 -0
- package/dist/llms/components/menu-dropdown.md +732 -0
- package/dist/llms/components/modal.md +504 -0
- package/dist/llms/components/page-header.md +282 -0
- package/dist/llms/components/panel.md +256 -0
- package/dist/llms/components/pill-container.md +218 -0
- package/dist/llms/components/pill.md +266 -0
- package/dist/llms/components/popover.md +600 -0
- package/dist/llms/components/portal-settings.md +371 -0
- package/dist/llms/components/progress-bar.md +175 -0
- package/dist/llms/components/progress-indicator.md +399 -0
- package/dist/llms/components/progress-ring.md +146 -0
- package/dist/llms/components/radio-button-group.md +285 -0
- package/dist/llms/components/radio-group.md +242 -0
- package/dist/llms/components/radio.md +269 -0
- package/dist/llms/components/scoped-notification.md +156 -0
- package/dist/llms/components/setup-assistant.md +398 -0
- package/dist/llms/components/simple-data-table.examples.md +2773 -0
- package/dist/llms/components/simple-data-table.md +919 -0
- package/dist/llms/components/slider.md +217 -0
- package/dist/llms/components/spinner.md +232 -0
- package/dist/llms/components/split-view.md +350 -0
- package/dist/llms/components/tabs.md +311 -0
- package/dist/llms/components/textarea.md +331 -0
- package/dist/llms/components/toast.md +267 -0
- package/dist/llms/components/tooltip.md +470 -0
- package/dist/llms/components/tree.md +1011 -0
- package/dist/llms/components/trial-bar.md +383 -0
- package/dist/llms/components/vertical-navigation.md +196 -0
- package/dist/llms/components/visual-picker.md +362 -0
- package/dist/llms/components/welcome-mat.md +885 -0
- package/dist/llms/docs/migration-v11.md +471 -0
- package/dist/llms/llms-full.txt +6874 -0
- package/dist/llms/llms.txt +133 -0
- package/dist/llms/rules.md +36 -0
- package/dist/types/components/accordion/index.d.ts.map +1 -1
- package/dist/types/components/accordion/panel.d.ts +7 -7
- package/dist/types/components/builder-header/nav-dropdown.d.ts +1 -0
- package/dist/types/components/builder-header/nav-dropdown.d.ts.map +1 -1
- package/dist/types/components/builder-header/nav-link.d.ts +0 -1
- package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
- package/dist/types/components/builder-header/toolbar.d.ts +0 -1
- package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
- package/dist/types/components/button/index.d.ts +19 -6
- package/dist/types/components/button/index.d.ts.map +1 -1
- package/dist/types/components/button-stateful/index.d.ts +8 -2
- package/dist/types/components/button-stateful/index.d.ts.map +1 -1
- package/dist/types/components/carousel/index.d.ts +7 -1
- package/dist/types/components/carousel/index.d.ts.map +1 -1
- package/dist/types/components/checkbox/index.d.ts +22 -5
- package/dist/types/components/checkbox/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts +6 -4
- package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/types/components/color-picker/types.d.ts +2 -2
- package/dist/types/components/combobox/combobox.d.ts +22 -0
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/combobox/index.d.ts +1 -1
- package/dist/types/components/combobox/index.d.ts.map +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts +16 -4
- package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/components/date-picker/index.d.ts +2 -6
- package/dist/types/components/date-picker/index.d.ts.map +1 -1
- package/dist/types/components/files/file.d.ts +5 -0
- package/dist/types/components/files/file.d.ts.map +1 -1
- package/dist/types/components/icon/index.d.ts +8 -1
- package/dist/types/components/icon/index.d.ts.map +1 -1
- package/dist/types/components/icon/input-icon/index.d.ts +3 -0
- package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
- package/dist/types/components/icon-settings/index.d.ts.map +1 -1
- package/dist/types/components/input/index.d.ts +10 -6
- package/dist/types/components/input/index.d.ts.map +1 -1
- package/dist/types/components/input/search.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/button-trigger.d.ts +5 -0
- package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +13 -3
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
- package/dist/types/components/modal/index.d.ts +5 -5
- package/dist/types/components/modal/index.d.ts.map +1 -1
- package/dist/types/components/page-header/types.d.ts +3 -0
- package/dist/types/components/page-header/types.d.ts.map +1 -1
- package/dist/types/components/panel/filtering/group.d.ts +2 -0
- package/dist/types/components/panel/filtering/group.d.ts.map +1 -1
- package/dist/types/components/pill/index.d.ts +1 -0
- package/dist/types/components/pill/index.d.ts.map +1 -1
- package/dist/types/components/popover/edit-dialog.d.ts +1 -3
- 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 +1 -0
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/index.d.ts +1 -0
- package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
- package/dist/types/components/progress-ring/index.d.ts +1 -0
- package/dist/types/components/progress-ring/index.d.ts.map +1 -1
- package/dist/types/components/radio/index.d.ts +11 -4
- package/dist/types/components/radio/index.d.ts.map +1 -1
- package/dist/types/components/radio-group/index.d.ts +5 -3
- package/dist/types/components/radio-group/index.d.ts.map +1 -1
- package/dist/types/components/scoped-notification/index.d.ts +1 -0
- package/dist/types/components/scoped-notification/index.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/step.d.ts +0 -1
- package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/cell.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/interactive-element.d.ts +8 -1
- package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/types.d.ts +11 -2
- package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
- package/dist/types/components/slider/index.d.ts +6 -4
- package/dist/types/components/slider/index.d.ts.map +1 -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/tabs/index.d.ts +1 -0
- package/dist/types/components/tabs/index.d.ts.map +1 -1
- package/dist/types/components/tabs/panel.d.ts +2 -1
- package/dist/types/components/tabs/panel.d.ts.map +1 -1
- package/dist/types/components/textarea/index.d.ts +12 -40
- package/dist/types/components/textarea/index.d.ts.map +1 -1
- package/dist/types/components/toast/index.d.ts.map +1 -1
- package/dist/types/components/tooltip/index.d.ts +5 -0
- package/dist/types/components/tooltip/index.d.ts.map +1 -1
- package/dist/types/components/tree/tree.d.ts +5 -0
- package/dist/types/components/tree/tree.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-label.d.ts +12 -0
- package/dist/types/components/utilities/menu-list/item-label.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.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/types/common.d.ts.map +1 -1
- package/dist/types/types/components.d.ts.map +1 -1
- package/package.json +9 -7
- 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/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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","names":[],"sources":["../../../../../components/date-picker/private/calendar.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 { DatePickerFocusDirection } from '../date-picker';\nimport React, { type ReactElement, type SyntheticEvent } from 'react';\n\nimport Week from './week';\nimport DateUtil from '../../../utilities/date';\n\nexport interface CalendarProps {\n\t/** Three letter abbreviations of the days of the week */\n\tabbreviatedWeekDayLabels: string[];\n\t/** Function to determine if a date should be disabled */\n\tdateDisabled?: (data: { date: Date }) => boolean;\n\t/** HTML id for component */\n\tid: string;\n\t/** Date used to create calendar that is displayed */\n\tinitialDateForCalendarRender: Date;\n\t/** Makes Monday the first day of the week */\n\tisIsoWeekday?: boolean;\n\t/** Called when focus moves off calendar */\n\tonCalendarBlur: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { direction: DatePickerFocusDirection }\n\t) => void;\n\t/** Called when month changes */\n\tonChangeMonth: (event: SyntheticEvent | undefined, date: Date) => void;\n\t/** Called when internal focus date requested */\n\tonRequestInternalFocusDate?: (\n\t\tevent: SyntheticEvent | undefined,\n\t\tdata: { date: Date; ref?: HTMLElement | null; triggerCallback?: boolean }\n\t) => void;\n\t/** Called when calendar should close */\n\tonRequestClose: (\n\t\tevent?: SyntheticEvent,\n\t\tdata?: Record<string, unknown>\n\t) => void;\n\t/** Called when a date is selected */\n\tonSelectDate: (event: SyntheticEvent, data: { date: Date }) => void;\n\t/** Currently selected date */\n\tselectedDate?: Date;\n\t/** Ref callback for selected date cell */\n\tselectedDateRef?: (ref: HTMLElement | null) => void;\n\t/** Label for today shortcut */\n\ttodayLabel: string;\n\t/** Called on last focusable node keydown */\n\tonLastFocusableNodeKeyDown?: (event: React.KeyboardEvent) => void;\n\t/** Ref callback for today link */\n\ttodayRef?: (ref: HTMLAnchorElement | null) => void;\n\t/** Full names of the days of the week */\n\tweekDayLabels: string[];\n}\n\ninterface CalendarState {\n\tfocusedDate: Date;\n\tcalendarHasFocus: boolean;\n\ttodayFocus: boolean;\n\tselected?: Date;\n}\n\nclass DatepickerCalendar extends React.Component<CalendarProps, CalendarState> {\n\tstatic displayName = 'SLDSDatepickerCalendar';\n\n\tstate: CalendarState = {\n\t\tfocusedDate: this.props.initialDateForCalendarRender,\n\t\tcalendarHasFocus: true,\n\t\ttodayFocus: false,\n\t};\n\n\tcomponentDidUpdate(prevProps: CalendarProps) {\n\t\tthis.setCalendarRenderSeedDate(prevProps);\n\t}\n\n\tsetCalendarRenderSeedDate = (prevProps: CalendarProps) => {\n\t\t// Set prop that sets focus in child component once it is rendered. This occurs when the month DOM has changed. This will trigger a re-render, but no DOM change will occur, just a DOM focus.\n\t\tif (\n\t\t\t!DateUtil.isEqual(\n\t\t\t\tthis.props.initialDateForCalendarRender,\n\t\t\t\tprevProps.initialDateForCalendarRender\n\t\t\t)\n\t\t) {\n\t\t\tthis.setState({ focusedDate: this.props.initialDateForCalendarRender });\n\t\t\tthis.props.onRequestInternalFocusDate?.(undefined, {\n\t\t\t\tdate: this.props.initialDateForCalendarRender,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\thandleSelectDate = (event: SyntheticEvent, { date }: { date: Date }) => {\n\t\tif (!this.props.dateDisabled?.({ date })) {\n\t\t\tthis.setState({ selected: date });\n\t\t\tthis.props.onSelectDate(event, { date });\n\t\t}\n\t};\n\n\thandleRequestClose = (event?: SyntheticEvent) => {\n\t\tif (this.props.onRequestClose) {\n\t\t\tthis.props.onRequestClose(event, {});\n\t\t}\n\t};\n\n\thandleKeyboardNavigateToPreviousDay = (\n\t\tevent: SyntheticEvent,\n\t\t{ date }: { date: Date }\n\t) => {\n\t\tconst prevDate = DateUtil.addDays(date, -1);\n\t\tif (!DateUtil.isSameMonth(prevDate, date)) {\n\t\t\tthis.props.onChangeMonth(event, prevDate);\n\t\t} else {\n\t\t\tthis.setState({ focusedDate: prevDate });\n\t\t\tthis.props.onRequestInternalFocusDate?.(event, {\n\t\t\t\tdate: prevDate,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\thandleKeyboardNavigateToNextDay = (\n\t\tevent: SyntheticEvent,\n\t\t{ date }: { date: Date }\n\t) => {\n\t\tconst nextDate = DateUtil.addDays(date, 1);\n\t\tif (!DateUtil.isSameMonth(nextDate, date)) {\n\t\t\tthis.props.onChangeMonth(event, nextDate);\n\t\t} else {\n\t\t\tthis.setState({ focusedDate: nextDate });\n\t\t\tthis.props.onRequestInternalFocusDate?.(event, {\n\t\t\t\tdate: nextDate,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\thandleKeyboardNavigateToPreviousWeek = (\n\t\tevent: SyntheticEvent,\n\t\t{ date }: { date: Date }\n\t) => {\n\t\tconst prevDate = DateUtil.addDays(date, -7);\n\t\tif (!DateUtil.isSameMonth(prevDate, date)) {\n\t\t\tthis.props.onChangeMonth(event, prevDate);\n\t\t} else {\n\t\t\tthis.setState({ focusedDate: prevDate });\n\t\t\tthis.props.onRequestInternalFocusDate?.(event, {\n\t\t\t\tdate: prevDate,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\thandleKeyboardNavigateToNextWeek = (\n\t\tevent: SyntheticEvent,\n\t\t{ date }: { date: Date }\n\t) => {\n\t\tconst nextDate = DateUtil.addDays(date, 7);\n\t\tif (!DateUtil.isSameMonth(nextDate, date)) {\n\t\t\tthis.props.onChangeMonth(event, nextDate);\n\t\t} else {\n\t\t\tthis.setState({ focusedDate: nextDate });\n\t\t\tthis.props.onRequestInternalFocusDate?.(event, {\n\t\t\t\tdate: nextDate,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\trenderWeeks = () => {\n\t\tconst firstDayOfWeekOffset = this.props.isIsoWeekday ? 1 : 0;\n\n\t\tconst firstDayOfMonth = DateUtil.firstDayOfMonth(\n\t\t\tthis.props.initialDateForCalendarRender\n\t\t);\n\n\t\tlet firstDayOfWeek;\n\t\tif (\n\t\t\tfirstDayOfMonth.getDay() > firstDayOfWeekOffset ||\n\t\t\tfirstDayOfMonth.getDay() < firstDayOfWeekOffset\n\t\t) {\n\t\t\tconst prevWeek = DateUtil.addWeeks(firstDayOfMonth, -1);\n\t\t\tfirstDayOfWeek = DateUtil.nearestWeekDay(prevWeek, firstDayOfWeekOffset);\n\t\t} else {\n\t\t\tfirstDayOfWeek = firstDayOfMonth;\n\t\t}\n\n\t\tconst weeks: ReactElement[] = [];\n\t\tlet done = false;\n\n\t\tlet monthIndex = firstDayOfWeek.getMonth();\n\t\tlet count = 0;\n\n\t\twhile (!done) {\n\t\t\tweeks.push(\n\t\t\t\t<Week\n\t\t\t\t\tcalendarHasFocus={this.state.calendarHasFocus}\n\t\t\t\t\tdateDisabled={this.props.dateDisabled}\n\t\t\t\t\tfirstDayOfWeek={firstDayOfWeek}\n\t\t\t\t\tkey={firstDayOfWeek.toString()}\n\t\t\t\t\tfocusedDate={this.state.focusedDate}\n\t\t\t\t\tinitialDateForCalendarRender={this.props.initialDateForCalendarRender}\n\t\t\t\t\tonCalendarBlur={this.props.onCalendarBlur}\n\t\t\t\t\tonKeyboardNavigateToPreviousDay={\n\t\t\t\t\t\tthis.handleKeyboardNavigateToPreviousDay\n\t\t\t\t\t}\n\t\t\t\t\tonKeyboardNavigateToNextDay={this.handleKeyboardNavigateToNextDay}\n\t\t\t\t\tonKeyboardNavigateToPreviousWeek={\n\t\t\t\t\t\tthis.handleKeyboardNavigateToPreviousWeek\n\t\t\t\t\t}\n\t\t\t\t\tonKeyboardNavigateToNextWeek={this.handleKeyboardNavigateToNextWeek}\n\t\t\t\t\tonRequestClose={this.handleRequestClose}\n\t\t\t\t\tonRequestInternalFocusDate={this.props.onRequestInternalFocusDate}\n\t\t\t\t\tonSelectDate={this.handleSelectDate}\n\t\t\t\t\tselectedDate={this.props.selectedDate}\n\t\t\t\t\tselectedDateRef={this.props.selectedDateRef}\n\t\t\t\t\ttodayLabel={this.props.todayLabel}\n\t\t\t\t/>\n\t\t\t);\n\n\t\t\t// create new weeks\n\t\t\tfirstDayOfWeek = DateUtil.addWeeks(firstDayOfWeek, 1);\n\t\t\tdone = count > 2 && monthIndex !== firstDayOfWeek.getMonth();\n\t\t\tcount += 1;\n\t\t\tmonthIndex = firstDayOfWeek.getMonth();\n\t\t}\n\t\tlet extraWeeks = 0;\n\t\twhile (weeks.length < 6) {\n\t\t\textraWeeks += 1;\n\t\t\tweeks.push(\n\t\t\t\t<tr key={`extra_${extraWeeks}`} className=\"week\">\n\t\t\t\t\t<td\n\t\t\t\t\t\taria-disabled=\"true\"\n\t\t\t\t\t\taria-selected=\"false\"\n\t\t\t\t\t\tclassName=\"slds-disabled-text\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-day \"> </span>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t);\n\t\t}\n\n\t\treturn weeks;\n\t};\n\n\trender() {\n\t\tconst sunday = (\n\t\t\t<th>\n\t\t\t\t<abbr title={this.props.weekDayLabels[0]}>\n\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[0]}\n\t\t\t\t</abbr>\n\t\t\t</th>\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"calendar\">\n\t\t\t\t<table\n\t\t\t\t\tclassName=\"datepicker__month\"\n\t\t\t\t\trole=\"grid\"\n\t\t\t\t\taria-labelledby={`${this.props.id}-month`}\n\t\t\t\t>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t{this.props.isIsoWeekday ? null : sunday}\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[1]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[1]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[2]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[2]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[3]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[3]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[4]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[4]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[5]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[5]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[6]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[6]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t{this.props.isIsoWeekday && sunday}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t{this.renderWeeks()}\n\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colSpan={7} role=\"gridcell\">\n\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\t\tclassName=\"slds-show_inline-block slds-p-bottom_x-small\"\n\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tthis.handleSelectDate(event, { date: new Date() });\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tonKeyDown={this.props.onLastFocusableNodeKeyDown}\n\t\t\t\t\t\t\t\t\tref={this.props.todayRef}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{this.props.todayLabel}\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nex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;OACpC,UAAA,KAAK,MAAM,yBAAyB;MAChC,CAAA;KACH,CAAA;KACJ,kBAAC,MAAD;MAAI,OAAM;MACT,UAAA,kBAAC,QAAD;OAAM,OAAO,KAAK,MAAM,cAAc;OACpC,UAAA,KAAK,MAAM,yBAAyB;MAChC,CAAA;KACH,CAAA;KACJ,kBAAC,MAAD;MAAI,OAAM;MACT,UAAA,kBAAC,QAAD;OAAM,OAAO,KAAK,MAAM,cAAc;OACpC,UAAA,KAAK,MAAM,yBAAyB;MAChC,CAAA;KACH,CAAA;KACJ,kBAAC,MAAD;MAAI,OAAM;MACT,UAAA,kBAAC,QAAD;OAAM,OAAO,KAAK,MAAM,cAAc;OACpC,UAAA,KAAK,MAAM,yBAAyB;MAChC,CAAA;KACH,CAAA;KACH,KAAK,MAAM,gBAAgB;IACzB,EAAA,CAAA,EACE,CAAA,GACP,kBAAC,SAAD,EAAA,UAAA,CACE,KAAK,YAAY,GAElB,kBAAC,MAAD,EAAA,UACC,kBAAC,MAAD;KAAI,SAAS;KAAG,MAAK;KACpB,UAAA,kBAAC,KAAD;MACC,MAAK;MACL,UAAU;MACV,WAAU;MACV,UAAU,MAAU;OAEnB,AADA,EAAM,eAAe,GACrB,KAAK,iBAAiB,GAAO,EAAE,sBAAM,IAAI,KAAK,EAAE,CAAC;MAClD;MACA,WAAW,KAAK,MAAM;MACtB,KAAK,KAAK,MAAM;MAEf,UAAA,KAAK,MAAM;KACV,CAAA;IACA,CAAA,EACD,CAAA,CACE,EAAA,CAAA,CACD;;EACH,CAAA;CAEP;AACD"}
|
|
1
|
+
{"version":3,"file":"calendar.js","names":[],"sources":["../../../../../components/date-picker/private/calendar.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 { DatePickerFocusDirection } from '../date-picker';\nimport React, { type ReactElement, type SyntheticEvent } from 'react';\n\nimport Week from './week';\nimport DateUtil from '../../../utilities/date';\n\nexport interface CalendarProps {\n\t/** Three letter abbreviations of the days of the week */\n\tabbreviatedWeekDayLabels: string[];\n\t/** Function to determine if a date should be disabled */\n\tdateDisabled?: (data: { date: Date }) => boolean;\n\t/** HTML id for component */\n\tid: string;\n\t/** Date used to create calendar that is displayed */\n\tinitialDateForCalendarRender: Date;\n\t/** Makes Monday the first day of the week */\n\tisIsoWeekday?: boolean;\n\t/** Called when focus moves off calendar */\n\tonCalendarBlur: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { direction: DatePickerFocusDirection }\n\t) => void;\n\t/** Called when month changes */\n\tonChangeMonth: (event: SyntheticEvent | undefined, date: Date) => void;\n\t/** Called when internal focus date requested */\n\tonRequestInternalFocusDate?: (\n\t\tevent: SyntheticEvent | undefined,\n\t\tdata: { date: Date; ref?: HTMLElement | null; triggerCallback?: boolean }\n\t) => void;\n\t/** Called when calendar should close */\n\tonRequestClose: (\n\t\tevent?: SyntheticEvent,\n\t\tdata?: Record<string, unknown>\n\t) => void;\n\t/** Called when a date is selected */\n\tonSelectDate: (event: SyntheticEvent, data: { date: Date }) => void;\n\t/** Currently selected date */\n\tselectedDate?: Date;\n\t/** Ref callback for selected date cell */\n\tselectedDateRef?: (ref: HTMLElement | null) => void;\n\t/** Label for today shortcut */\n\ttodayLabel: string;\n\t/** Called on last focusable node keydown */\n\tonLastFocusableNodeKeyDown?: (event: React.KeyboardEvent) => void;\n\t/** Ref callback for today link */\n\ttodayRef?: (ref: HTMLAnchorElement | null) => void;\n\t/** Full names of the days of the week */\n\tweekDayLabels: string[];\n}\n\ninterface CalendarState {\n\tfocusedDate: Date;\n\tcalendarHasFocus: boolean;\n\ttodayFocus: boolean;\n\tselected?: Date;\n}\n\nclass DatepickerCalendar extends React.Component<CalendarProps, CalendarState> {\n\tstatic displayName = 'SLDSDatepickerCalendar';\n\n\tstate: CalendarState = {\n\t\tfocusedDate: this.props.initialDateForCalendarRender,\n\t\tcalendarHasFocus: true,\n\t\ttodayFocus: false,\n\t};\n\n\tcomponentDidUpdate(prevProps: CalendarProps) {\n\t\tthis.setCalendarRenderSeedDate(prevProps);\n\t}\n\n\tsetCalendarRenderSeedDate = (prevProps: CalendarProps) => {\n\t\t// Set prop that sets focus in child component once it is rendered. This occurs when the month DOM has changed. This will trigger a re-render, but no DOM change will occur, just a DOM focus.\n\t\tif (\n\t\t\t!DateUtil.isEqual(\n\t\t\t\tthis.props.initialDateForCalendarRender,\n\t\t\t\tprevProps.initialDateForCalendarRender\n\t\t\t)\n\t\t) {\n\t\t\tthis.setState({ focusedDate: this.props.initialDateForCalendarRender });\n\t\t\tthis.props.onRequestInternalFocusDate?.(undefined, {\n\t\t\t\tdate: this.props.initialDateForCalendarRender,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\thandleSelectDate = (event: SyntheticEvent, { date }: { date: Date }) => {\n\t\tif (!this.props.dateDisabled?.({ date })) {\n\t\t\tthis.setState({ selected: date });\n\t\t\tthis.props.onSelectDate(event, { date });\n\t\t}\n\t};\n\n\thandleRequestClose = (event?: SyntheticEvent) => {\n\t\tif (this.props.onRequestClose) {\n\t\t\tthis.props.onRequestClose(event, {});\n\t\t}\n\t};\n\n\thandleKeyboardNavigateToPreviousDay = (\n\t\tevent: SyntheticEvent,\n\t\t{ date }: { date: Date }\n\t) => {\n\t\tconst prevDate = DateUtil.addDays(date, -1);\n\t\tif (!DateUtil.isSameMonth(prevDate, date)) {\n\t\t\tthis.props.onChangeMonth(event, prevDate);\n\t\t} else {\n\t\t\tthis.setState({ focusedDate: prevDate });\n\t\t\tthis.props.onRequestInternalFocusDate?.(event, {\n\t\t\t\tdate: prevDate,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\thandleKeyboardNavigateToNextDay = (\n\t\tevent: SyntheticEvent,\n\t\t{ date }: { date: Date }\n\t) => {\n\t\tconst nextDate = DateUtil.addDays(date, 1);\n\t\tif (!DateUtil.isSameMonth(nextDate, date)) {\n\t\t\tthis.props.onChangeMonth(event, nextDate);\n\t\t} else {\n\t\t\tthis.setState({ focusedDate: nextDate });\n\t\t\tthis.props.onRequestInternalFocusDate?.(event, {\n\t\t\t\tdate: nextDate,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\thandleKeyboardNavigateToPreviousWeek = (\n\t\tevent: SyntheticEvent,\n\t\t{ date }: { date: Date }\n\t) => {\n\t\tconst prevDate = DateUtil.addDays(date, -7);\n\t\tif (!DateUtil.isSameMonth(prevDate, date)) {\n\t\t\tthis.props.onChangeMonth(event, prevDate);\n\t\t} else {\n\t\t\tthis.setState({ focusedDate: prevDate });\n\t\t\tthis.props.onRequestInternalFocusDate?.(event, {\n\t\t\t\tdate: prevDate,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\thandleKeyboardNavigateToNextWeek = (\n\t\tevent: SyntheticEvent,\n\t\t{ date }: { date: Date }\n\t) => {\n\t\tconst nextDate = DateUtil.addDays(date, 7);\n\t\tif (!DateUtil.isSameMonth(nextDate, date)) {\n\t\t\tthis.props.onChangeMonth(event, nextDate);\n\t\t} else {\n\t\t\tthis.setState({ focusedDate: nextDate });\n\t\t\tthis.props.onRequestInternalFocusDate?.(event, {\n\t\t\t\tdate: nextDate,\n\t\t\t\ttriggerCallback: true,\n\t\t\t});\n\t\t}\n\t};\n\n\trenderWeeks = () => {\n\t\tconst firstDayOfWeekOffset = this.props.isIsoWeekday ? 1 : 0;\n\n\t\tconst firstDayOfMonth = DateUtil.firstDayOfMonth(\n\t\t\tthis.props.initialDateForCalendarRender\n\t\t);\n\n\t\tlet firstDayOfWeek;\n\t\tif (\n\t\t\tfirstDayOfMonth.getDay() > firstDayOfWeekOffset ||\n\t\t\tfirstDayOfMonth.getDay() < firstDayOfWeekOffset\n\t\t) {\n\t\t\tconst prevWeek = DateUtil.addWeeks(firstDayOfMonth, -1);\n\t\t\tfirstDayOfWeek = DateUtil.nearestWeekDay(prevWeek, firstDayOfWeekOffset);\n\t\t} else {\n\t\t\tfirstDayOfWeek = firstDayOfMonth;\n\t\t}\n\n\t\tconst weeks: ReactElement[] = [];\n\t\tlet done = false;\n\n\t\tlet monthIndex = firstDayOfWeek.getMonth();\n\t\tlet count = 0;\n\n\t\twhile (!done) {\n\t\t\tweeks.push(\n\t\t\t\t<Week\n\t\t\t\t\tcalendarHasFocus={this.state.calendarHasFocus}\n\t\t\t\t\tdateDisabled={this.props.dateDisabled}\n\t\t\t\t\tfirstDayOfWeek={firstDayOfWeek}\n\t\t\t\t\tkey={firstDayOfWeek.toString()}\n\t\t\t\t\tfocusedDate={this.state.focusedDate}\n\t\t\t\t\tinitialDateForCalendarRender={this.props.initialDateForCalendarRender}\n\t\t\t\t\tonCalendarBlur={this.props.onCalendarBlur}\n\t\t\t\t\tonKeyboardNavigateToPreviousDay={\n\t\t\t\t\t\tthis.handleKeyboardNavigateToPreviousDay\n\t\t\t\t\t}\n\t\t\t\t\tonKeyboardNavigateToNextDay={this.handleKeyboardNavigateToNextDay}\n\t\t\t\t\tonKeyboardNavigateToPreviousWeek={\n\t\t\t\t\t\tthis.handleKeyboardNavigateToPreviousWeek\n\t\t\t\t\t}\n\t\t\t\t\tonKeyboardNavigateToNextWeek={this.handleKeyboardNavigateToNextWeek}\n\t\t\t\t\tonRequestClose={this.handleRequestClose}\n\t\t\t\t\tonRequestInternalFocusDate={this.props.onRequestInternalFocusDate}\n\t\t\t\t\tonSelectDate={this.handleSelectDate}\n\t\t\t\t\tselectedDate={this.props.selectedDate}\n\t\t\t\t\tselectedDateRef={this.props.selectedDateRef}\n\t\t\t\t\ttodayLabel={this.props.todayLabel}\n\t\t\t\t/>\n\t\t\t);\n\n\t\t\t// create new weeks\n\t\t\tfirstDayOfWeek = DateUtil.addWeeks(firstDayOfWeek, 1);\n\t\t\tdone = count > 2 && monthIndex !== firstDayOfWeek.getMonth();\n\t\t\tcount += 1;\n\t\t\tmonthIndex = firstDayOfWeek.getMonth();\n\t\t}\n\t\tlet extraWeeks = 0;\n\t\twhile (weeks.length < 6) {\n\t\t\textraWeeks += 1;\n\t\t\tweeks.push(\n\t\t\t\t<tr key={`extra_${extraWeeks}`} className=\"week\">\n\t\t\t\t\t<td\n\t\t\t\t\t\taria-disabled=\"true\"\n\t\t\t\t\t\taria-selected=\"false\"\n\t\t\t\t\t\tclassName=\"slds-disabled-text\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-day \"> </span>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t);\n\t\t}\n\n\t\treturn weeks;\n\t};\n\n\trender() {\n\t\tconst sunday = (\n\t\t\t<th>\n\t\t\t\t<abbr title={this.props.weekDayLabels[0]}>\n\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[0]}\n\t\t\t\t</abbr>\n\t\t\t</th>\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"calendar\">\n\t\t\t\t<table\n\t\t\t\t\tclassName=\"datepicker__month\"\n\t\t\t\t\trole=\"grid\"\n\t\t\t\t\taria-labelledby={`${this.props.id}-month`}\n\t\t\t\t>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t{this.props.isIsoWeekday ? null : sunday}\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[1]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[1]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[2]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[2]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[3]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[3]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[4]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[4]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[5]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[5]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th scope=\"col\">\n\t\t\t\t\t\t\t\t<abbr title={this.props.weekDayLabels[6]}>\n\t\t\t\t\t\t\t\t\t{this.props.abbreviatedWeekDayLabels[6]}\n\t\t\t\t\t\t\t\t</abbr>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t{this.props.isIsoWeekday && sunday}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t{this.renderWeeks()}\n\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colSpan={7} role=\"gridcell\">\n\t\t\t\t\t\t\t\t{/* eslint-disable-next-line jsx-a11y/anchor-is-valid -- SLDS datepicker markup uses an anchor for \"Today\" */}\n\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\t\tclassName=\"slds-show_inline-block slds-p-bottom_x-small\"\n\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tthis.handleSelectDate(event, { date: new Date() });\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tonKeyDown={this.props.onLastFocusableNodeKeyDown}\n\t\t\t\t\t\t\t\t\tref={this.props.todayRef}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{this.props.todayLabel}\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default DatepickerCalendar;\n"],"mappings":";;;;;AA4DA,IAAM,IAAN,cAAiC,EAAM,UAAwC;CAC9E,OAAO,cAAc;CAErB,QAAuB;EACtB,aAAa,KAAK,MAAM;EACxB,kBAAkB;EAClB,YAAY;CACb;CAEA,mBAAmB,GAA0B;EAC5C,KAAK,0BAA0B,CAAS;CACzC;CAEA,6BAA6B,MAA6B;EAEzD,AACE,EAAS,QACT,KAAK,MAAM,8BACX,EAAU,4BACX,MAEA,KAAK,SAAS,EAAE,aAAa,KAAK,MAAM,6BAA6B,CAAC,GACtE,KAAK,MAAM,6BAA6B,KAAA,GAAW;GAClD,MAAM,KAAK,MAAM;GACjB,iBAAiB;EAClB,CAAC;CAEH;CAEA,oBAAoB,GAAuB,EAAE,cAA2B;EACvE,AAAK,KAAK,MAAM,eAAe,EAAE,QAAK,CAAC,MACtC,KAAK,SAAS,EAAE,UAAU,EAAK,CAAC,GAChC,KAAK,MAAM,aAAa,GAAO,EAAE,QAAK,CAAC;CAEzC;CAEA,sBAAsB,MAA2B;EAChD,AAAI,KAAK,MAAM,kBACd,KAAK,MAAM,eAAe,GAAO,CAAC,CAAC;CAErC;CAEA,uCACC,GACA,EAAE,cACE;EACJ,IAAM,IAAW,EAAS,QAAQ,GAAM,EAAE;EAC1C,AAAK,EAAS,YAAY,GAAU,CAAI,KAGvC,KAAK,SAAS,EAAE,aAAa,EAAS,CAAC,GACvC,KAAK,MAAM,6BAA6B,GAAO;GAC9C,MAAM;GACN,iBAAiB;EAClB,CAAC,KAND,KAAK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,CAAA;CAEP;AACD"}
|
|
@@ -35,7 +35,7 @@ var c = (e, { date: t, onSelectDate: n }) => {
|
|
|
35
35
|
}, p = { [n.TAB]: () => {
|
|
36
36
|
a(t, { direction: "previous" });
|
|
37
37
|
} };
|
|
38
|
-
t.key && (t.shiftKey &&
|
|
38
|
+
t.key && (t.shiftKey && p[t.key] ? (r.trapEvent(t), p[t.key]()) : f[t.key] && (r.trapEvent(t), f[t.key]()));
|
|
39
39
|
}, u = (e) => {
|
|
40
40
|
let t = i.isSameMonth(e.date, e.initialDateForCalendarRender), n = i.isToday(e.date), r = i.isSameDay(e.date, e.selectedDate), u = i.isFirstDayOfMonth(e.date), d = !t || e.disabled;
|
|
41
41
|
return /* @__PURE__ */ o("td", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"day.js","names":[],"sources":["../../../../../components/date-picker/private/day.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 { DatePickerFocusDirection } from '../date-picker';\nimport React, { type SyntheticEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, \"a simple javascript utility for conditionally\n// joining classNames together.\"\nimport classNames from 'classnames';\n\nimport EventUtil from '../../../utilities/event';\nimport DateUtil from '../../../utilities/date';\nimport KEYS from '../../../utilities/key-code';\n\nimport { DIRECTIONS } from '../../utilities/UNSAFE_direction';\nimport LanguageDirection from '../../utilities/UNSAFE_direction/private/language-direction';\n\nexport interface DayProps {\n\t/** If elements within the calendar have focus */\n\tcalendarHasFocus?: boolean;\n\t/** Date of day */\n\tdate: Date;\n\t/** If date is disabled */\n\tdisabled?: boolean;\n\t/** Date used to create calendar that is displayed */\n\tinitialDateForCalendarRender: Date;\n\t/** Date that has focus */\n\tfocusedDate?: Date;\n\t/** Called when focus moves off calendar */\n\tonCalendarBlur: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { direction: DatePickerFocusDirection }\n\t) => void;\n\t/** Called on next day keyboard navigation */\n\tonKeyboardNavigateToNextDay: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { date: Date }\n\t) => void;\n\t/** Called on next week keyboard navigation */\n\tonKeyboardNavigateToNextWeek: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { date: Date }\n\t) => void;\n\t/** Called on previous day keyboard navigation */\n\tonKeyboardNavigateToPreviousDay: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { date: Date }\n\t) => void;\n\t/** Called on previous week keyboard navigation */\n\tonKeyboardNavigateToPreviousWeek: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { date: Date }\n\t) => void;\n\t/** Called when internal focus date requested */\n\tonRequestInternalFocusDate?: (\n\t\tevent: SyntheticEvent | undefined,\n\t\tdata: { date: Date; ref?: HTMLElement | null; triggerCallback?: boolean }\n\t) => void;\n\t/** Called when a date is selected */\n\tonSelectDate: (event: SyntheticEvent, data: { date: Date }) => void;\n\t/** Currently selected date */\n\tselectedDate?: Date;\n\t/** Ref callback for selected date cell */\n\tselectedDateRef?: (ref: HTMLElement | null) => void;\n\t/** Label for today shortcut */\n\ttodayLabel: string;\n\t/** Text direction */\n\tdirection?: 'ltr' | 'rtl';\n}\n\ntype DayHandlerProps = Pick<\n\tDayProps,\n\t| 'date'\n\t| 'onCalendarBlur'\n\t| 'onSelectDate'\n\t| 'onKeyboardNavigateToPreviousDay'\n\t| 'onKeyboardNavigateToNextDay'\n\t| 'onKeyboardNavigateToPreviousWeek'\n\t| 'onKeyboardNavigateToNextWeek'\n\t| 'direction'\n>;\n\nconst handleClick = (\n\tevent: SyntheticEvent,\n\t{ date, onSelectDate }: Pick<DayProps, 'date' | 'onSelectDate'>\n) => {\n\tonSelectDate(event, { date });\n};\n\nconst handleKeyDown = (\n\tevent: React.KeyboardEvent,\n\t{\n\t\tdate,\n\t\tonCalendarBlur,\n\t\tonSelectDate,\n\t\tonKeyboardNavigateToPreviousDay,\n\t\tonKeyboardNavigateToNextDay,\n\t\tonKeyboardNavigateToPreviousWeek,\n\t\tonKeyboardNavigateToNextWeek,\n\t\tdirection,\n\t}: DayHandlerProps\n) => {\n\tconst keyDownCallbacks: Record<string, () => void> = {\n\t\t[KEYS.SPACE]: () => {\n\t\t\tonSelectDate(event, { date });\n\t\t},\n\t\t[KEYS.ENTER]: () => {\n\t\t\tonSelectDate(event, { date });\n\t\t},\n\t\t[KEYS.TAB]: () => {\n\t\t\tonCalendarBlur(event, { direction: 'next' });\n\t\t},\n\t\t[KEYS.LEFT]: () => {\n\t\t\tif (direction === DIRECTIONS.RTL) {\n\t\t\t\tonKeyboardNavigateToNextDay(event, { date });\n\t\t\t} else {\n\t\t\t\tonKeyboardNavigateToPreviousDay(event, { date });\n\t\t\t}\n\t\t},\n\t\t[KEYS.RIGHT]: () => {\n\t\t\tif (direction === DIRECTIONS.RTL) {\n\t\t\t\tonKeyboardNavigateToPreviousDay(event, { date });\n\t\t\t} else {\n\t\t\t\tonKeyboardNavigateToNextDay(event, { date });\n\t\t\t}\n\t\t},\n\t\t[KEYS.UP]: () => {\n\t\t\tonKeyboardNavigateToPreviousWeek(event, { date });\n\t\t},\n\t\t[KEYS.DOWN]: () => {\n\t\t\tonKeyboardNavigateToNextWeek(event, { date });\n\t\t},\n\t};\n\n\tconst shiftKeyDownCallbacks: Record<string, () => void> = {\n\t\t[KEYS.TAB]: () => {\n\t\t\tonCalendarBlur(event, { direction: 'previous' });\n\t\t},\n\t};\n\n\tif (event.key) {\n\t\tif (event.shiftKey &&
|
|
1
|
+
{"version":3,"file":"day.js","names":[],"sources":["../../../../../components/date-picker/private/day.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 { DatePickerFocusDirection } from '../date-picker';\nimport React, { type SyntheticEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, \"a simple javascript utility for conditionally\n// joining classNames together.\"\nimport classNames from 'classnames';\n\nimport EventUtil from '../../../utilities/event';\nimport DateUtil from '../../../utilities/date';\nimport KEYS from '../../../utilities/key-code';\n\nimport { DIRECTIONS } from '../../utilities/UNSAFE_direction';\nimport LanguageDirection from '../../utilities/UNSAFE_direction/private/language-direction';\n\nexport interface DayProps {\n\t/** If elements within the calendar have focus */\n\tcalendarHasFocus?: boolean;\n\t/** Date of day */\n\tdate: Date;\n\t/** If date is disabled */\n\tdisabled?: boolean;\n\t/** Date used to create calendar that is displayed */\n\tinitialDateForCalendarRender: Date;\n\t/** Date that has focus */\n\tfocusedDate?: Date;\n\t/** Called when focus moves off calendar */\n\tonCalendarBlur: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { direction: DatePickerFocusDirection }\n\t) => void;\n\t/** Called on next day keyboard navigation */\n\tonKeyboardNavigateToNextDay: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { date: Date }\n\t) => void;\n\t/** Called on next week keyboard navigation */\n\tonKeyboardNavigateToNextWeek: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { date: Date }\n\t) => void;\n\t/** Called on previous day keyboard navigation */\n\tonKeyboardNavigateToPreviousDay: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { date: Date }\n\t) => void;\n\t/** Called on previous week keyboard navigation */\n\tonKeyboardNavigateToPreviousWeek: (\n\t\tevent: SyntheticEvent,\n\t\tdata: { date: Date }\n\t) => void;\n\t/** Called when internal focus date requested */\n\tonRequestInternalFocusDate?: (\n\t\tevent: SyntheticEvent | undefined,\n\t\tdata: { date: Date; ref?: HTMLElement | null; triggerCallback?: boolean }\n\t) => void;\n\t/** Called when a date is selected */\n\tonSelectDate: (event: SyntheticEvent, data: { date: Date }) => void;\n\t/** Currently selected date */\n\tselectedDate?: Date;\n\t/** Ref callback for selected date cell */\n\tselectedDateRef?: (ref: HTMLElement | null) => void;\n\t/** Label for today shortcut */\n\ttodayLabel: string;\n\t/** Text direction */\n\tdirection?: 'ltr' | 'rtl';\n}\n\ntype DayHandlerProps = Pick<\n\tDayProps,\n\t| 'date'\n\t| 'onCalendarBlur'\n\t| 'onSelectDate'\n\t| 'onKeyboardNavigateToPreviousDay'\n\t| 'onKeyboardNavigateToNextDay'\n\t| 'onKeyboardNavigateToPreviousWeek'\n\t| 'onKeyboardNavigateToNextWeek'\n\t| 'direction'\n>;\n\nconst handleClick = (\n\tevent: SyntheticEvent,\n\t{ date, onSelectDate }: Pick<DayProps, 'date' | 'onSelectDate'>\n) => {\n\tonSelectDate(event, { date });\n};\n\nconst handleKeyDown = (\n\tevent: React.KeyboardEvent,\n\t{\n\t\tdate,\n\t\tonCalendarBlur,\n\t\tonSelectDate,\n\t\tonKeyboardNavigateToPreviousDay,\n\t\tonKeyboardNavigateToNextDay,\n\t\tonKeyboardNavigateToPreviousWeek,\n\t\tonKeyboardNavigateToNextWeek,\n\t\tdirection,\n\t}: DayHandlerProps\n) => {\n\tconst keyDownCallbacks: Record<string, () => void> = {\n\t\t[KEYS.SPACE]: () => {\n\t\t\tonSelectDate(event, { date });\n\t\t},\n\t\t[KEYS.ENTER]: () => {\n\t\t\tonSelectDate(event, { date });\n\t\t},\n\t\t[KEYS.TAB]: () => {\n\t\t\tonCalendarBlur(event, { direction: 'next' });\n\t\t},\n\t\t[KEYS.LEFT]: () => {\n\t\t\tif (direction === DIRECTIONS.RTL) {\n\t\t\t\tonKeyboardNavigateToNextDay(event, { date });\n\t\t\t} else {\n\t\t\t\tonKeyboardNavigateToPreviousDay(event, { date });\n\t\t\t}\n\t\t},\n\t\t[KEYS.RIGHT]: () => {\n\t\t\tif (direction === DIRECTIONS.RTL) {\n\t\t\t\tonKeyboardNavigateToPreviousDay(event, { date });\n\t\t\t} else {\n\t\t\t\tonKeyboardNavigateToNextDay(event, { date });\n\t\t\t}\n\t\t},\n\t\t[KEYS.UP]: () => {\n\t\t\tonKeyboardNavigateToPreviousWeek(event, { date });\n\t\t},\n\t\t[KEYS.DOWN]: () => {\n\t\t\tonKeyboardNavigateToNextWeek(event, { date });\n\t\t},\n\t};\n\n\tconst shiftKeyDownCallbacks: Record<string, () => void> = {\n\t\t[KEYS.TAB]: () => {\n\t\t\tonCalendarBlur(event, { direction: 'previous' });\n\t\t},\n\t};\n\n\tif (event.key) {\n\t\tif (event.shiftKey && shiftKeyDownCallbacks[event.key]) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tshiftKeyDownCallbacks[event.key]();\n\t\t} else if (keyDownCallbacks[event.key]) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tkeyDownCallbacks[event.key]();\n\t\t}\n\t}\n};\n\nconst DatepickerCalendarDay = (props: DayProps) => {\n\tconst isCurrentMonth = DateUtil.isSameMonth(\n\t\tprops.date,\n\t\tprops.initialDateForCalendarRender\n\t);\n\tconst isToday = DateUtil.isToday(props.date);\n\tconst isSelectedDay = DateUtil.isSameDay(props.date, props.selectedDate);\n\tconst isFirstDayOfMonth = DateUtil.isFirstDayOfMonth(props.date);\n\tconst isDisabled = !isCurrentMonth || props.disabled;\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\t<td\n\t\t\taria-disabled={isDisabled}\n\t\t\taria-selected={isSelectedDay}\n\t\t\tclassName={classNames({\n\t\t\t\t'slds-is-today': isToday,\n\t\t\t\t'slds-disabled-text': isDisabled,\n\t\t\t\t'slds-is-selected': isSelectedDay,\n\t\t\t})}\n\t\t\tonClick={(event) => {\n\t\t\t\thandleClick(event, {\n\t\t\t\t\tdate: props.date,\n\t\t\t\t\tonSelectDate: props.onSelectDate,\n\t\t\t\t});\n\t\t\t}}\n\t\t\tonKeyDown={(event) => {\n\t\t\t\thandleKeyDown(event, {\n\t\t\t\t\t...props,\n\t\t\t\t});\n\t\t\t}}\n\t\t\tref={(component) => {\n\t\t\t\tif (isSelectedDay) {\n\t\t\t\t\tprops.selectedDateRef?.(component);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tprops.calendarHasFocus &&\n\t\t\t\t\tDateUtil.isSameDay(props.focusedDate, props.date) &&\n\t\t\t\t\tisCurrentMonth\n\t\t\t\t) {\n\t\t\t\t\tprops.onRequestInternalFocusDate?.(undefined, {\n\t\t\t\t\t\tdate: props.date,\n\t\t\t\t\t\tref: component,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}}\n\t\t\trole=\"gridcell\"\n\t\t\ttabIndex={\n\t\t\t\t!props.calendarHasFocus && isFirstDayOfMonth && isCurrentMonth ? 0 : -1\n\t\t\t}\n\t\t>\n\t\t\t{/* eslint-enable jsx-a11y/no-static-element-interactions */}\n\t\t\t<span className=\"slds-day\">\n\t\t\t\t{isToday ? (\n\t\t\t\t\t<span className=\"slds-assistive-text\">{`${props.todayLabel}: `}</span>\n\t\t\t\t) : null}\n\t\t\t\t{props.date.getDate()}\n\t\t\t</span>\n\t\t</td>\n\t);\n};\n\nDatepickerCalendarDay.displayName = 'SLDSDatepickerCalendarDay';\n\nexport default LanguageDirection(DatepickerCalendarDay);\n"],"mappings":";;;;;;;;;AAoFA,IAAM,KACL,GACA,EAAE,SAAM,sBACJ;CACJ,EAAa,GAAO,EAAE,QAAK,CAAC;AAC7B,GAEM,KACL,GACA,EACC,SACA,mBACA,iBACA,oCACA,gCACA,qCACA,iCACA,mBAEG;CACJ,IAAM,IAA+C;GACnD,EAAK,cAAc;GACnB,EAAa,GAAO,EAAE,QAAK,CAAC;EAC7B;GACC,EAAK,cAAc;GACnB,EAAa,GAAO,EAAE,QAAK,CAAC;EAC7B;GACC,EAAK,YAAY;GACjB,EAAe,GAAO,EAAE,WAAW,OAAO,CAAC;EAC5C;GACC,EAAK,aAAa;GAClB,AAAI,MAAc,EAAW,MAC5B,EAA4B,GAAO,EAAE,QAAK,CAAC,IAE3C,EAAgC,GAAO,EAAE,QAAK,CAAC;EAEjD;GACC,EAAK,cAAc;GACnB,AAAI,MAAc,EAAW,MAC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iB,IAAI;EAItE,UAAA,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,IACA,kBAAC,QAAD;IAAM,WAAU;IAAuB,UAAA,GAAG,EAAM,WAAW;GAAU,CAAA,IAClE,MACH,EAAM,KAAK,QAAQ,CACf;;CACH,CAAA;AAEN;AAEA,EAAsB,cAAc;AAEpC,IAAA,IAAe,EAAkB,CAAqB"}
|
|
@@ -16,11 +16,11 @@ var c = e, l = {
|
|
|
16
16
|
href: "#",
|
|
17
17
|
isLoading: !1,
|
|
18
18
|
hasNoVisibleTitle: !1
|
|
19
|
-
}, u = class
|
|
19
|
+
}, u = class extends i.Component {
|
|
20
20
|
static displayName = c;
|
|
21
21
|
static defaultProps = l;
|
|
22
22
|
static injectMoreActionsStyles() {
|
|
23
|
-
return
|
|
23
|
+
return null;
|
|
24
24
|
}
|
|
25
25
|
generatedId;
|
|
26
26
|
constructor(e) {
|
|
@@ -33,7 +33,7 @@ var c = e, l = {
|
|
|
33
33
|
this.props.href === "#" && e.preventDefault(), this.props.onClickImage && this.props.onClickImage(e);
|
|
34
34
|
};
|
|
35
35
|
render() {
|
|
36
|
-
let
|
|
36
|
+
let e = {
|
|
37
37
|
...l.assistiveText,
|
|
38
38
|
...this.props.assistiveText
|
|
39
39
|
};
|
|
@@ -46,7 +46,7 @@ var c = e, l = {
|
|
|
46
46
|
className: a("slds-file__crop", `slds-file__crop_${this.props.crop ?? "16-by-9"}`),
|
|
47
47
|
onClick: this.handleOnClickImage,
|
|
48
48
|
children: /* @__PURE__ */ o(n, {
|
|
49
|
-
assistiveText:
|
|
49
|
+
assistiveText: e,
|
|
50
50
|
labels: { title: this.props.labels.title },
|
|
51
51
|
isLoading: this.props.isLoading,
|
|
52
52
|
image: this.props.image,
|
|
@@ -70,9 +70,8 @@ var c = e, l = {
|
|
|
70
70
|
className: "slds-file__external-icon",
|
|
71
71
|
children: i.cloneElement(this.props.externalIcon, { containerClassName: a("slds-file__icon slds-icon_container", this.props.externalIcon.props.containerClassName) })
|
|
72
72
|
}) : null,
|
|
73
|
-
this.props.moreActionsDropdown ? e.injectMoreActionsStyles() : null,
|
|
74
73
|
/* @__PURE__ */ o(r, {
|
|
75
|
-
assistiveText:
|
|
74
|
+
assistiveText: e,
|
|
76
75
|
hasNoVisibleTitle: this.props.hasNoVisibleTitle,
|
|
77
76
|
onClickDownload: this.props.onClickDownload,
|
|
78
77
|
moreActionsDropdown: this.props.moreActionsDropdown
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","names":[],"sources":["../../../../components/files/file.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// Implements the [Files design pattern](https://lightningdesignsystem.com/components/files/) in React.\n// Based on SLDS v2.4.0\nimport React, { type ReactElement, type ReactNode } from 'react';\nimport classNames from 'classnames';\n\nimport { FILES_FILE } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport type { IconProps } from '../icon';\nimport type { MenuDropdownProps } from '../menu-dropdown';\nimport FileFigure from './private/file-figure';\nimport FileActions from './private/file-actions';\n\nconst displayName = FILES_FILE;\n\nexport interface FileAssistiveText {\n\tdownload?: string;\n\timage?: string;\n\tlink?: string;\n\tloading?: string;\n\tmoreActions?: string;\n}\n\nexport interface FileProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * download - description for the download button if present\n\t * * image - description for the file image\n\t * * link - description for the file link\n\t * * loading - description for the loading spinner if present\n\t * * moreActions - description for the more actions dropdown if present\n\t */\n\tassistiveText?: FileAssistiveText;\n\t/**\n\t * CSS class names to be added to the container element. `array`, `object`, or `string` are accepted.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Controls different cropping aspect ratios for the component. Inside `Files`, defaults to its `crop`; otherwise `16-by-9`.\n\t */\n\tcrop?: '16-by-9' | '4-by-3' | '1-by-1';\n\t/**\n\t * `Icon` shown in the top left corner of the file. Its `containerClassName` is added to the file's own classes.\n\t */\n\texternalIcon?: ReactElement<IconProps>;\n\t/**\n\t * Controls whether the file's title should be visible\n\t */\n\thasNoVisibleTitle?: boolean;\n\t/**\n\t * Href attribute for image. Defaults to `#`, which does not navigate, so `onClickImage`\n\t * can handle the click without a URL.\n\t */\n\thref?: string;\n\t/**\n\t * `Icon` associated with the file. The file renders it in the preview and the title, and sets its `size` in each.\n\t */\n\ticon?: ReactElement<IconProps>;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * Link to thumbnail image\n\t */\n\timage?: string;\n\t/**\n\t * Controls whether file preview is loading\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Labels for the File Component\n\t * * title - title for the file, shown under the preview and used as its name.\n\t */\n\tlabels: {\n\t\ttitle: string;\n\t};\n\t/**\n\t * `MenuDropdown` for the more actions button; doesn't show more actions button if empty.\n\t * The file styles it as an icon button; props you set on it win.\n\t */\n\tmoreActionsDropdown?: ReactElement<Partial<MenuDropdownProps>>;\n\t/**\n\t * Action to be done on clicking download button; doesn't show download button if empty\n\t */\n\tonClickDownload?: (event: React.MouseEvent) => void;\n\t/**\n\t * Function that is called when image is clicked; can be used instead of href for more advanced event handling\n\t */\n\tonClickImage?: (event: React.MouseEvent) => void;\n}\n\nconst defaultProps: Pick<\n\tFileProps,\n\t'assistiveText' | 'hasNoVisibleTitle' | 'href' | 'isLoading'\n> = {\n\tassistiveText: {\n\t\tdownload: 'download',\n\t\tlink: 'Preview:',\n\t\tloading: 'loading',\n\t\tmoreActions: 'more actions',\n\t},\n\thref: '#',\n\tisLoading: false,\n\thasNoVisibleTitle: false,\n};\n\n/**\n * File is a component that represents content uploaded as an attachment.\n */\nclass File extends React.Component<FileProps> {\n\tstatic displayName = displayName;\n\n\tstatic defaultProps = defaultProps;\n\n\
|
|
1
|
+
{"version":3,"file":"file.js","names":[],"sources":["../../../../components/files/file.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// Implements the [Files design pattern](https://lightningdesignsystem.com/components/files/) in React.\n// Based on SLDS v2.4.0\nimport React, { type ReactElement, type ReactNode } from 'react';\nimport classNames from 'classnames';\n\nimport { FILES_FILE } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\n\nimport type { IconProps } from '../icon';\nimport type { MenuDropdownProps } from '../menu-dropdown';\nimport FileFigure from './private/file-figure';\nimport FileActions from './private/file-actions';\n\nconst displayName = FILES_FILE;\n\nexport interface FileAssistiveText {\n\tdownload?: string;\n\timage?: string;\n\tlink?: string;\n\tloading?: string;\n\tmoreActions?: string;\n}\n\nexport interface FileProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * download - description for the download button if present\n\t * * image - description for the file image\n\t * * link - description for the file link\n\t * * loading - description for the loading spinner if present\n\t * * moreActions - description for the more actions dropdown if present\n\t */\n\tassistiveText?: FileAssistiveText;\n\t/**\n\t * CSS class names to be added to the container element. `array`, `object`, or `string` are accepted.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Controls different cropping aspect ratios for the component. Inside `Files`, defaults to its `crop`; otherwise `16-by-9`.\n\t */\n\tcrop?: '16-by-9' | '4-by-3' | '1-by-1';\n\t/**\n\t * `Icon` shown in the top left corner of the file. Its `containerClassName` is added to the file's own classes.\n\t */\n\texternalIcon?: ReactElement<IconProps>;\n\t/**\n\t * Controls whether the file's title should be visible\n\t */\n\thasNoVisibleTitle?: boolean;\n\t/**\n\t * Href attribute for image. Defaults to `#`, which does not navigate, so `onClickImage`\n\t * can handle the click without a URL.\n\t */\n\thref?: string;\n\t/**\n\t * `Icon` associated with the file. The file renders it in the preview and the title, and sets its `size` in each.\n\t */\n\ticon?: ReactElement<IconProps>;\n\t/**\n\t * HTML id for component.\n\t */\n\tid?: string;\n\t/**\n\t * Link to thumbnail image\n\t */\n\timage?: string;\n\t/**\n\t * Controls whether file preview is loading\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Labels for the File Component\n\t * * title - title for the file, shown under the preview and used as its name.\n\t */\n\tlabels: {\n\t\ttitle: string;\n\t};\n\t/**\n\t * `MenuDropdown` for the more actions button; doesn't show more actions button if empty.\n\t * The file styles it as an icon button; props you set on it win.\n\t */\n\tmoreActionsDropdown?: ReactElement<Partial<MenuDropdownProps>>;\n\t/**\n\t * Action to be done on clicking download button; doesn't show download button if empty\n\t */\n\tonClickDownload?: (event: React.MouseEvent) => void;\n\t/**\n\t * Function that is called when image is clicked; can be used instead of href for more advanced event handling\n\t */\n\tonClickImage?: (event: React.MouseEvent) => void;\n}\n\nconst defaultProps: Pick<\n\tFileProps,\n\t'assistiveText' | 'hasNoVisibleTitle' | 'href' | 'isLoading'\n> = {\n\tassistiveText: {\n\t\tdownload: 'download',\n\t\tlink: 'Preview:',\n\t\tloading: 'loading',\n\t\tmoreActions: 'more actions',\n\t},\n\thref: '#',\n\tisLoading: false,\n\thasNoVisibleTitle: false,\n};\n\n/**\n * File is a component that represents content uploaded as an attachment.\n */\nclass File extends React.Component<FileProps> {\n\tstatic displayName = displayName;\n\n\tstatic defaultProps = defaultProps;\n\n\t/**\n\t * @deprecated The more-actions button now uses SLDS's `slds-button_last`,\n\t * so this returns `null` and `File` no longer calls it. It will be removed\n\t * in 11.0.0.\n\t */\n\tstatic injectMoreActionsStyles(): ReactNode {\n\t\treturn null;\n\t}\n\n\tgeneratedId: string;\n\n\tconstructor(props: FileProps) {\n\t\tsuper(props);\n\n\t\tthis.generatedId = generateId();\n\t}\n\n\t/**\n\t * Get the File's HTML id. Generate a new one if no ID present.\n\t */\n\tgetId() {\n\t\treturn this.props.id || this.generatedId;\n\t}\n\n\thandleOnClickImage = (event: React.MouseEvent) => {\n\t\tif (this.props.href === '#') {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif (this.props.onClickImage) {\n\t\t\tthis.props.onClickImage(event);\n\t\t}\n\t};\n\n\trender() {\n\t\tconst assistiveText = {\n\t\t\t...defaultProps.assistiveText,\n\t\t\t...this.props.assistiveText,\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={this.getId()}\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-file',\n\t\t\t\t\t'slds-file_card',\n\t\t\t\t\t!this.props.hasNoVisibleTitle ? 'slds-has-title' : null,\n\t\t\t\t\tthis.props.className as string\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<figure>\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={this.props.href}\n\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t'slds-file__crop',\n\t\t\t\t\t\t\t`slds-file__crop_${this.props.crop ?? '16-by-9'}`\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonClick={this.handleOnClickImage}\n\t\t\t\t\t>\n\t\t\t\t\t\t<FileFigure\n\t\t\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\t\t\tlabels={{\n\t\t\t\t\t\t\t\ttitle: this.props.labels.title,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tisLoading={this.props.isLoading}\n\t\t\t\t\t\t\timage={this.props.image}\n\t\t\t\t\t\t\ticon={this.props.icon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</a>\n\t\t\t\t\t{!this.props.hasNoVisibleTitle ? (\n\t\t\t\t\t\t<figcaption className=\"slds-file__title slds-file__title_card\">\n\t\t\t\t\t\t\t<div className=\"slds-media__figure slds-line-height_reset\">\n\t\t\t\t\t\t\t\t{this.props.icon\n\t\t\t\t\t\t\t\t\t? React.cloneElement(this.props.icon, {\n\t\t\t\t\t\t\t\t\t\t\tsize: 'x-small',\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t: null}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"slds-media__body\">\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName=\"slds-file__text slds-truncate\"\n\t\t\t\t\t\t\t\t\ttitle={this.props.labels.title}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{this.props.labels.title}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</figcaption>\n\t\t\t\t\t) : null}\n\t\t\t\t</figure>\n\t\t\t\t{this.props.externalIcon ? (\n\t\t\t\t\t<div className=\"slds-file__external-icon\">\n\t\t\t\t\t\t{React.cloneElement(this.props.externalIcon, {\n\t\t\t\t\t\t\tcontainerClassName: classNames(\n\t\t\t\t\t\t\t\t'slds-file__icon slds-icon_container',\n\t\t\t\t\t\t\t\tthis.props.externalIcon.props.containerClassName\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t\t<FileActions\n\t\t\t\t\tassistiveText={assistiveText}\n\t\t\t\t\thasNoVisibleTitle={this.props.hasNoVisibleTitle}\n\t\t\t\t\tonClickDownload={this.props.onClickDownload}\n\t\t\t\t\tmoreActionsDropdown={this.props.moreActionsDropdown}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default File;\n"],"mappings":";;;;;;;;AAgBA,IAAM,IAAc,GA+Ed,IAGF;CACH,eAAe;EACd,UAAU;EACV,MAAM;EACN,SAAS;EACT,aAAa;CACd;CACA,MAAM;CACN,WAAW;CACX,mBAAmB;AACpB,GAKM,IAAN,cAAmB,EAAM,UAAqB;CAC7C,OAAO,cAAc;CAErB,OAAO,eAAe;CAOtB,OAAO,0BAAqC;EAC3C,OAAO;CACR;CAEA;CAEA,YAAY,GAAkB;EAG7B,AAFA,MAAM,CAAK,GAEX,KAAK,cAAc,EAAW;CAC/B;CAKA,QAAQ;EACP,OAAO,KAAK,MAAM,MAAM,KAAK;CAC9B;CAEA,sBAAsB,MAA4B;EAKjD,AAJI,KAAK,MAAM,SAAS,OACvB,EAAM,eAAe,GAGlB,KAAK,MAAM,g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AAA;GACG;;CAEP;AACD"}
|
|
@@ -31,10 +31,10 @@ var s = (e) => {
|
|
|
31
31
|
...c.props.assistiveText
|
|
32
32
|
},
|
|
33
33
|
overlay: c.props.overlay ?? !1,
|
|
34
|
+
menuPosition: c.props.menuPosition ?? "overflowBoundaryElement",
|
|
34
35
|
buttonVariant: c.props.buttonVariant ?? "icon",
|
|
35
36
|
buttonInverse: c.props.buttonInverse ?? e.hasNoVisibleTitle,
|
|
36
|
-
|
|
37
|
-
triggerClassName: i("dsr-file__more-actions", c.props.triggerClassName)
|
|
37
|
+
triggerClassName: i("slds-button_last", c.props.triggerClassName)
|
|
38
38
|
}) : null]
|
|
39
39
|
})
|
|
40
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-actions.js","names":[],"sources":["../../../../../components/files/private/file-actions.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// # FileActions Component\n\n// Implements the [FileActions design pattern](https://www.lightningdesignsystem.com/components/files/) in React.\n\nimport React, { type ReactElement } from 'react';\nimport classNames from 'classnames';\n\nimport { FILES_ACTIONS } from '../../../utilities/constants';\nimport Button from '../../button';\nimport Icon from '../../icon';\nimport type { MenuDropdownProps } from '../../menu-dropdown';\n\nexport interface FileActionsAssistiveText {\n\tdownload?: string;\n\tmoreActions?: string;\n}\n\nexport interface FileActionsProps {\n\t/**\n\t * Assistive text for the file component\n\t */\n\tassistiveText?: FileActionsAssistiveText;\n\t/**\n\t * Controls whether the file's title should be visible\n\t */\n\thasNoVisibleTitle?: boolean;\n\t/**\n\t * Dropdown for More Actions; doesn't show More actions button if empty\n\t */\n\tmoreActionsDropdown?: ReactElement<Partial<MenuDropdownProps>>;\n\t/**\n\t * Action to be done on clicking download button; doesnt show download button if empty\n\t */\n\tonClickDownload?: (event: React.MouseEvent) => void;\n}\n\n/**\n * A carousel allows multiple pieces of featured content to occupy an allocated amount of space.\n */\nconst FileActions = (props: FileActionsProps) => {\n\tconst assistiveText = props.assistiveText ?? {};\n\tconst { moreActionsDropdown } = props;\n\tconst actions = (\n\t\t<div className=\"slds-file__actions-menu\">\n\t\t\t<div className=\"slds-button-group\" role=\"group\">\n\t\t\t\t{typeof props.onClickDownload === 'function' ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\ticonSize=\"x-small\"\n\t\t\t\t\t\tonClick={props.onClickDownload}\n\t\t\t\t\t\ttitle=\"Download\"\n\t\t\t\t\t\tclassName=\"slds-button_icon-inverse\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{ label: assistiveText.download }}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"download\"\n\t\t\t\t\t\t\tsize=\"xx-small\"\n\t\t\t\t\t\t\tinverse={props.hasNoVisibleTitle}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t) : null}\n\t\t\t\t{moreActionsDropdown\n\t\t\t\t\t? React.cloneElement(moreActionsDropdown, {\n\t\t\t\t\t\t\tassistiveText: {\n\t\t\t\t\t\t\t\ticon: assistiveText.moreActions,\n\t\t\t\t\t\t\t\t...moreActionsDropdown.props.assistiveText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toverlay: moreActionsDropdown.props.overlay ?? false,\n\t\t\t\t\t\t\
|
|
1
|
+
{"version":3,"file":"file-actions.js","names":[],"sources":["../../../../../components/files/private/file-actions.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// # FileActions Component\n\n// Implements the [FileActions design pattern](https://www.lightningdesignsystem.com/components/files/) in React.\n\nimport React, { type ReactElement } from 'react';\nimport classNames from 'classnames';\n\nimport { FILES_ACTIONS } from '../../../utilities/constants';\nimport Button from '../../button';\nimport Icon from '../../icon';\nimport type { MenuDropdownProps } from '../../menu-dropdown';\n\nexport interface FileActionsAssistiveText {\n\tdownload?: string;\n\tmoreActions?: string;\n}\n\nexport interface FileActionsProps {\n\t/**\n\t * Assistive text for the file component\n\t */\n\tassistiveText?: FileActionsAssistiveText;\n\t/**\n\t * Controls whether the file's title should be visible\n\t */\n\thasNoVisibleTitle?: boolean;\n\t/**\n\t * Dropdown for More Actions; doesn't show More actions button if empty\n\t */\n\tmoreActionsDropdown?: ReactElement<Partial<MenuDropdownProps>>;\n\t/**\n\t * Action to be done on clicking download button; doesnt show download button if empty\n\t */\n\tonClickDownload?: (event: React.MouseEvent) => void;\n}\n\n/**\n * A carousel allows multiple pieces of featured content to occupy an allocated amount of space.\n */\nconst FileActions = (props: FileActionsProps) => {\n\tconst assistiveText = props.assistiveText ?? {};\n\tconst { moreActionsDropdown } = props;\n\tconst actions = (\n\t\t<div className=\"slds-file__actions-menu\">\n\t\t\t<div className=\"slds-button-group\" role=\"group\">\n\t\t\t\t{typeof props.onClickDownload === 'function' ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\ticonSize=\"x-small\"\n\t\t\t\t\t\tonClick={props.onClickDownload}\n\t\t\t\t\t\ttitle=\"Download\"\n\t\t\t\t\t\tclassName=\"slds-button_icon-inverse\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tassistiveText={{ label: assistiveText.download }}\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"download\"\n\t\t\t\t\t\t\tsize=\"xx-small\"\n\t\t\t\t\t\t\tinverse={props.hasNoVisibleTitle}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t) : null}\n\t\t\t\t{moreActionsDropdown\n\t\t\t\t\t? React.cloneElement(moreActionsDropdown, {\n\t\t\t\t\t\t\tassistiveText: {\n\t\t\t\t\t\t\t\ticon: assistiveText.moreActions,\n\t\t\t\t\t\t\t\t...moreActionsDropdown.props.assistiveText,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toverlay: moreActionsDropdown.props.overlay ?? false,\n\t\t\t\t\t\t\t// SLDS clips `.slds-file__title_scrim` (`overflow: hidden`), so\n\t\t\t\t\t\t\t// render the menu outside the file instead of inside the scrim.\n\t\t\t\t\t\t\tmenuPosition:\n\t\t\t\t\t\t\t\tmoreActionsDropdown.props.menuPosition ??\n\t\t\t\t\t\t\t\t'overflowBoundaryElement',\n\t\t\t\t\t\t\tbuttonVariant: moreActionsDropdown.props.buttonVariant ?? 'icon',\n\t\t\t\t\t\t\tbuttonInverse:\n\t\t\t\t\t\t\t\tmoreActionsDropdown.props.buttonInverse ??\n\t\t\t\t\t\t\t\tprops.hasNoVisibleTitle,\n\t\t\t\t\t\t\t// The trigger wraps the button, so SLDS's\n\t\t\t\t\t\t\t// `.slds-button-group .slds-button:first-child` would round\n\t\t\t\t\t\t\t// its left corners; `slds-button_last` rounds the right ones.\n\t\t\t\t\t\t\ttriggerClassName: classNames(\n\t\t\t\t\t\t\t\t'slds-button_last',\n\t\t\t\t\t\t\t\tmoreActionsDropdown.props.triggerClassName\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t})\n\t\t\t\t\t: null}\n\t\t\t</div>\n\t\t</div>\n\t);\n\tif (\n\t\ttypeof props.onClickDownload === 'function' ||\n\t\tprops.moreActionsDropdown\n\t) {\n\t\tif (!props.hasNoVisibleTitle) {\n\t\t\treturn actions;\n\t\t}\n\t\treturn (\n\t\t\t<div className=\"slds-file__title slds-file__title_scrim\">{actions}</div>\n\t\t);\n\t}\n\treturn null;\n};\n\nFileActions.displayName = FILES_ACTIONS;\n\nexport default FileActions;\n"],"mappings":";;;;;;;AA0CA,IAAM,KAAe,MAA4B;CAChD,IAAM,IAAgB,EAAM,iBAAiB,CAAC,GACxC,EAAE,2BAAwB,GAC1B,IACL,kBAAC,OAAD;EAAK,WAAU;EACd,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAoB,MAAK;GAAxC,UAAA,CACE,OAAO,EAAM,mBAAoB,aACjC,kBAAC,GAAD;IACC,MAAK;IACL,SAAQ;IACR,UAAS;IACT,SAAS,EAAM;IACf,OAAM;IACN,WAAU;IAEV,UAAA,kBAAC,GAAD;KACC,eAAe,EAAE,OAAO,EAAc,SAAS;KAC/C,UAAS;KACT,MAAK;KACL,MAAK;KACL,SAAS,EAAM;IACf,CAAA;GACM,CAAA,IACL,MACH,IACE,EAAM,aAAa,GAAqB;IACxC,eAAe;KACd,MAAM,EAAc;KACpB,GAAG,EAAoB,MAAM;IAC9B;IACA,SAAS,EAAoB,MAAM,WAAW;IAG9C,cACC,EAAoB,MAAM,gBAC1B;IACD,eAAe,EAAoB,MAAM,iBAAiB;IAC1D,eACC,EAAoB,MAAM,iBAC1B,EAAM;IAIP,kBAAkB,EACjB,oBACA,EAAoB,MAAM,gBAC3B;GACD,CAAC,IACA,IACC;;CACD,CAAA;CAaN,OAVC,OAAO,EAAM,mBAAoB,cACjC,EAAM,sBAED,EAAM,oBAIV,kBAAC,OAAD;EAAK,WAAU;EAA2C,UAAA;CAAa,CAAA,IAHhE,IAMF;AACR;AAEA,EAAY,cAAc"}
|
|
@@ -10,7 +10,7 @@ var a = ({ isLoading: e = !1, assistiveText: a = {}, image: o, labels: s = {}, i
|
|
|
10
10
|
size: "medium",
|
|
11
11
|
variant: "base",
|
|
12
12
|
assistiveText: { label: a.loading },
|
|
13
|
-
|
|
13
|
+
style: { zIndex: "1" }
|
|
14
14
|
})] }) : o ? /* @__PURE__ */ i(n.Fragment, { children: [/* @__PURE__ */ r("span", {
|
|
15
15
|
className: "slds-assistive-text",
|
|
16
16
|
children: a.link
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-figure.js","names":[],"sources":["../../../../../components/files/private/file-figure.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// # FileFigure Component\n\n// Implements the [FileFigure design pattern](https://www.lightningdesignsystem.com/components/files/) in React.\n\nimport React, { type ReactElement } from 'react';\n\nimport { FILES_FIGURE } from '../../../utilities/constants';\n\nimport Spinner from '../../spinner';\nimport type { IconProps, IconSize } from '../../icon';\n\nexport interface FileFigureAssistiveText {\n\timage?: string;\n\tlink?: string;\n\tloading?: string;\n}\n\nexport interface FileFigureProps {\n\tassistiveText?: FileFigureAssistiveText;\n\t/**\n\t * Icon for the file, shown when there is no image and it is not loading.\n\t */\n\ticon?: ReactElement<IconProps>;\n\t/**\n\t * Image/Figure for the file\n\t */\n\timage?: string;\n\t/**\n\t * Whether the file figure is loading\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Labels for the file figure component\n\t */\n\tlabels?: {\n\t\ttitle?: string;\n\t};\n}\n\n/**\n * A file can have a image, an icon or a loading animation as its thumbnail\n */\nconst FileFigure = ({\n\tisLoading = false,\n\tassistiveText = {},\n\timage,\n\tlabels = {},\n\ticon,\n}: FileFigureProps) => {\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t\t<Spinner\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\tassistiveText={{ label: assistiveText.loading }}\n\t\t\t\t\
|
|
1
|
+
{"version":3,"file":"file-figure.js","names":[],"sources":["../../../../../components/files/private/file-figure.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// # FileFigure Component\n\n// Implements the [FileFigure design pattern](https://www.lightningdesignsystem.com/components/files/) in React.\n\nimport React, { type ReactElement } from 'react';\n\nimport { FILES_FIGURE } from '../../../utilities/constants';\n\nimport Spinner from '../../spinner';\nimport type { IconProps, IconSize } from '../../icon';\n\nexport interface FileFigureAssistiveText {\n\timage?: string;\n\tlink?: string;\n\tloading?: string;\n}\n\nexport interface FileFigureProps {\n\tassistiveText?: FileFigureAssistiveText;\n\t/**\n\t * Icon for the file, shown when there is no image and it is not loading.\n\t */\n\ticon?: ReactElement<IconProps>;\n\t/**\n\t * Image/Figure for the file\n\t */\n\timage?: string;\n\t/**\n\t * Whether the file figure is loading\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Labels for the file figure component\n\t */\n\tlabels?: {\n\t\ttitle?: string;\n\t};\n}\n\n/**\n * A file can have a image, an icon or a loading animation as its thumbnail\n */\nconst FileFigure = ({\n\tisLoading = false,\n\tassistiveText = {},\n\timage,\n\tlabels = {},\n\ticon,\n}: FileFigureProps) => {\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t\t<Spinner\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\tassistiveText={{ label: assistiveText.loading }}\n\t\t\t\t\tstyle={{ zIndex: '1' }}\n\t\t\t\t/>\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\tif (image) {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t\t<img alt={assistiveText.image || labels.title} src={image} />\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<span className=\"slds-assistive-text\">{assistiveText.link}</span>\n\t\t\t<span\n\t\t\t\tclassName=\"slds-file__icon slds-icon_container\"\n\t\t\t\ttitle={labels.title}\n\t\t\t>\n\t\t\t\t{icon\n\t\t\t\t\t? // The container sizes the icon, so drop the icon's own size class\n\t\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\t\ticon as ReactElement<\n\t\t\t\t\t\t\t\tOmit<IconProps, 'size'> & { size?: IconSize | null }\n\t\t\t\t\t\t\t>,\n\t\t\t\t\t\t\t{ size: null }\n\t\t\t\t\t\t)\n\t\t\t\t\t: null}\n\t\t\t</span>\n\t\t</React.Fragment>\n\t);\n};\n\nFileFigure.displayName = FILES_FIGURE;\n\nexport default FileFigure;\n"],"mappings":";;;;;AA6CA,IAAM,KAAc,EACnB,eAAY,IACZ,mBAAgB,CAAC,GACjB,UACA,YAAS,CAAC,GACV,cAEI,IAEF,kBAAC,EAAM,UAAP,EAAA,UAAA,CACC,kBAAC,QAAD;CAAM,WAAU;CAAuB,UAAA,EAAc;AAAW,CAAA,GAChE,kBAAC,GAAD;CACC,MAAK;CACL,SAAQ;CACR,eAAe,EAAE,OAAO,EAAc,QAAQ;CAC9C,OAAO,EAAE,QAAQ,IAAI;AACrB,CAAA,CACc,EAAA,CAAA,IAGd,IAEF,kBAAC,EAAM,UAAP,EAAA,UAAA,CACC,kBAAC,QAAD;CAAM,WAAU;CAAuB,UAAA,EAAc;AAAW,CAAA,GAChE,kBAAC,OAAD;CAAK,KAAK,EAAc,SAAS,EAAO;CAAO,KAAK;AAAQ,CAAA,CAC7C,EAAA,CAAA,IAIjB,kBAAC,EAAM,UAAP,EAAA,UAAA,CACC,kBAAC,QAAD;CAAM,WAAU;CAAuB,UAAA,EAAc;AAAW,CAAA,GAChE,kBAAC,QAAD;CACC,WAAU;CACV,OAAO,EAAO;CAEb,UAAA,IAEC,EAAM,aACL,GAGA,EAAE,MAAM,KAAK,CACd,IACC;AACE,CAAA,CACS,EAAA,CAAA;AAIlB,EAAW,cAAc"}
|
|
@@ -26,7 +26,11 @@ var p = {
|
|
|
26
26
|
P(!1);
|
|
27
27
|
}, [P]), R = o((e) => {
|
|
28
28
|
P(!1), S?.(e, { id: k });
|
|
29
|
-
}, [
|
|
29
|
+
}, [
|
|
30
|
+
S,
|
|
31
|
+
k,
|
|
32
|
+
P
|
|
33
|
+
]), z = o((e) => {
|
|
30
34
|
C?.(e, { id: k });
|
|
31
35
|
}, [C, k]), B = /* @__PURE__ */ f("div", { children: [
|
|
32
36
|
/* @__PURE__ */ d("h4", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","names":[],"sources":["../../../../components/filter/filter.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, { useCallback, useContext, useMemo } from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport Popover from '../popover';\n\nimport { FILTER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { useControllableState } from '../../utilities/hooks';\nimport FilterErrorIdContext from './private/error-id-context';\n\nimport {\n\tFilterAssistiveText,\n\tFilterChangeHandler,\n\tFilterRemoveHandler,\n} from './types';\n\nexport interface FilterProps {\n\t/** Aligns the popover with the respective side of the trigger */\n\talign?: 'left' | 'right';\n\t/** Assistive text for accessibility */\n\tassistiveText?: FilterAssistiveText;\n\t/** Contents of popover - dropdowns and inputs that set filter criteria */\n\tchildren?: React.ReactNode;\n\t/** Custom CSS classes for slds-filters__item node */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Error message for a Filter inside a `PanelFilterList`. The list shows it below the\n\t * filter and sets `isError`. A standalone Filter doesn't render it.\n\t */\n\terrorLabel?: string;\n\t/**\n\t * Applies error state styling. Inside a `PanelFilterList` with `errorLabel`, the filter is\n\t * also described by the error message.\n\t */\n\tisError?: boolean;\n\t/** Unique ID for keyboard navigation and ARIA support */\n\tid?: string;\n\t/** If true, the filter will not display an editing popover when clicked */\n\tisLocked?: boolean;\n\t/** Applies new filter styling */\n\tisNew?: boolean;\n\t/** If true, the filter will not include a remove button */\n\tisPermanent?: boolean;\n\t/** Callback when Done within the Popover is clicked */\n\tonChange?: FilterChangeHandler;\n\t/** Callback when \"Remove Filter\" button is clicked */\n\tonRemove?: FilterRemoveHandler;\n\t/** Callback when Filter is clicked */\n\tonClick?: () => void;\n\t/** Custom Popover component with overridable props */\n\tpopover?: React.ReactElement;\n\t/** The filter predicate (e.g., \"is PURPLE\") */\n\tpredicate?: React.ReactNode;\n\t/** The filter property (e.g., \"Hair Color\") */\n\tproperty?: React.ReactNode;\n}\n\nconst defaultAssistiveText: FilterAssistiveText = {\n\teditFilter: 'Edit filter:',\n\teditFilterHeading: 'Choose filter criteria',\n};\n\n/**\n * A Filter is a popover with custom trigger. It can be used by Panel Filtering.\n * Menus within a Filter Popover will need to not have \"portal mounts\" and be inline.\n */\nconst Filter: React.FC<FilterProps> = ({\n\talign = 'left',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tclassName,\n\tisError = false,\n\tid: idProp,\n\tisLocked = false,\n\tisNew = false,\n\tisPermanent = false,\n\tonChange,\n\tonRemove,\n\tonClick,\n\tpopover,\n\tpredicate = 'New Filter',\n\tproperty,\n}) => {\n\t// Generate stable ID\n\tconst generatedId = useMemo(() => generateId(), []);\n\tconst id = idProp || generatedId;\n\t// Only describe the filter by an error element that is rendered\n\tconst errorId = useContext(FilterErrorIdContext);\n\tconst errorDescribedBy = isError ? errorId : undefined;\n\n\t// Popover state: controlled when the custom popover sets `isOpen`, otherwise internal and seeded\n\t// from its `defaultIsOpen`\n\tconst popoverOpenProps = popover?.props as\n\t\t{ isOpen?: boolean; defaultIsOpen?: boolean } | undefined;\n\tconst [popoverIsOpen, setPopoverIsOpen] = useControllableState(\n\t\tpopoverOpenProps?.isOpen,\n\t\tpopoverOpenProps?.defaultIsOpen ?? false\n\t);\n\n\t// Merge assistive text with defaults\n\tconst assistiveText = useMemo<FilterAssistiveText>(\n\t\t() => ({\n\t\t\t...defaultAssistiveText,\n\t\t\t...assistiveTextProp,\n\t\t\tremoveFilter:\n\t\t\t\tassistiveTextProp?.removeFilter ||\n\t\t\t\t`Remove Filter: ${property} ${predicate}`,\n\t\t}),\n\t\t[assistiveTextProp, property, predicate]\n\t);\n\n\t// Handle filter click\n\tconst handleFilterClick = useCallback(() => {\n\t\tsetPopoverIsOpen(true);\n\t\tonClick?.();\n\t}, [onClick, setPopoverIsOpen]);\n\n\t// Handle popover close\n\tconst handleClose = useCallback(() => {\n\t\tsetPopoverIsOpen(false);\n\t}, [setPopoverIsOpen]);\n\n\t// Handle change (Done button clicked)\n\tconst handleChange = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tsetPopoverIsOpen(false);\n\t\t\tonChange?.(event, { id });\n\t\t},\n\t\t[onChange, id]\n\t);\n\n\t// Handle remove\n\tconst handleRemove = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonRemove?.(event, { id });\n\t\t},\n\t\t[onRemove, id]\n\t);\n\n\t// Build popover body\n\tconst popoverBody = (\n\t\t<div>\n\t\t\t<h4 className=\"slds-assistive-text\" id={`${id}-popover-heading`}>\n\t\t\t\t{assistiveText.editFilterHeading}\n\t\t\t</h4>\n\t\t\t{children}\n\t\t\t<div className=\"slds-m-top_small slds-text-align_right\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\tlabel=\"Done\"\n\t\t\t\t\tonClick={handleChange}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\t// Build popover props\n\tconst popoverProps = {\n\t\tariaLabelledby: `${id}-popover-heading`,\n\t\talign,\n\t\tbody: popoverBody,\n\t\theading: '',\n\t\tid,\n\t\toffset: align === 'right' ? '0px -35px' : undefined,\n\t\tonClose: handleClose,\n\t\tonRequestClose: handleClose,\n\t\tposition: 'overflowBoundaryElement' as const,\n\t\tclassName: 'slds-grow',\n\t\t// Merge with custom popover props if provided\n\t\t...(popover?.props || {}),\n\t\tisOpen: popoverIsOpen,\n\t\t// Remove children from merged props\n\t\tchildren: undefined,\n\t};\n\n\t// Trigger button content\n\tconst triggerContent = (\n\t\t<>\n\t\t\t<span className=\"slds-assistive-text\">{assistiveText.editFilter}</span>\n\t\t\t{property ? (\n\t\t\t\t<span className=\"slds-show slds-text-body_small\">{property}</span>\n\t\t\t) : null}\n\t\t\t<span className=\"slds-show\">{predicate}</span>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-filters__item',\n\t\t\t\t'slds-grid',\n\t\t\t\t'slds-grid_vertical-align-center',\n\t\t\t\t{\n\t\t\t\t\t'slds-is-locked': isLocked,\n\t\t\t\t\t'slds-is-new': isNew,\n\t\t\t\t\t'slds-has-error': isError,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t{!isLocked && (children || popover) ? (\n\t\t\t\t// @ts-expect-error - Popover props are complex with overrides\n\t\t\t\t<Popover {...popoverProps} silenceDeprecatedPropertyWarning>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclassName=\"slds-button_reset slds-grow slds-has-blur-focus\"\n\t\t\t\t\t\tonClick={handleFilterClick}\n\t\t\t\t\t\taria-describedby={errorDescribedBy}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{triggerContent}\n\t\t\t\t\t</button>\n\t\t\t\t</Popover>\n\t\t\t) : (\n\t\t\t\t<button\n\t\t\t\t\taria-describedby={errorDescribedBy}\n\t\t\t\t\tclassName=\"slds-button_reset slds-grow slds-has-blur-focus\"\n\t\t\t\t\tdisabled\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-show slds-text-body_small\">{property}</span>\n\t\t\t\t\t<span className=\"slds-show\">{predicate}</span>\n\t\t\t\t</button>\n\t\t\t)}\n\t\t\t{!isPermanent && !isLocked && (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{ icon: assistiveText.removeFilter }}\n\t\t\t\t\thint\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"delete\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\ticonVariant=\"bare\"\n\t\t\t\t\tonClick={handleRemove}\n\t\t\t\t\ttitle={assistiveText.removeFilter}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nFilter.displayName = FILTER;\n\nexport default Filter;\n"],"mappings":";;;;;;;;;;AA6DA,IAAM,IAA4C;CACjD,YAAY;CACZ,mBAAmB;AACpB,GAMM,KAAiC,EACtC,WAAQ,QACR,eAAe,GACf,aACA,cACA,aAAU,IACV,IAAI,GACJ,cAAW,IACX,WAAQ,IACR,iBAAc,IACd,aACA,aACA,YACA,YACA,eAAY,cACZ,kBACK;CAEL,IAAM,IAAc,QAAc,EAAW,GAAG,CAAC,CAAC,GAC5C,IAAK,KAAU,GAEf,IAAU,EAAW,CAAoB,GACzC,IAAmB,IAAU,IAAU,KAAA,GAIvC,IAAmB,GAAS,OAE5B,CAAC,GAAe,KAAoB,EACzC,GAAkB,QAClB,GAAkB,iBAAiB,EACpC,GAGM,IAAgB,SACd;EACN,GAAG;EACH,GAAG;EACH,cACC,GAAmB,gBACnB,kBAAkB,EAAS,GAAG;CAChC,IACA;EAAC;EAAmB;EAAU;CAAS,CACxC,GAGM,IAAoB,QAAkB;EAE3C,AADA,EAAiB,EAAI,GACrB,IAAU;CACX,GAAG,CAAC,GAAS,CAAgB,CAAC,GAGxB,IAAc,QAAkB;EACrC,EAAiB,EAAK;CACvB,GAAG,CAAC,CAAgB,CAAC,GAGf,IAAe,GACnB,MAA+C;EAE/C,AADA,EAAiB,EAAK,GACtB,IAAW,GAAO,EAAE,MAAG,CAAC;CACzB,GACA,
|
|
1
|
+
{"version":3,"file":"filter.js","names":[],"sources":["../../../../components/filter/filter.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, { useCallback, useContext, useMemo } from 'react';\nimport classNames from 'classnames';\n\nimport Button from '../button';\nimport Popover from '../popover';\n\nimport { FILTER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { useControllableState } from '../../utilities/hooks';\nimport FilterErrorIdContext from './private/error-id-context';\n\nimport {\n\tFilterAssistiveText,\n\tFilterChangeHandler,\n\tFilterRemoveHandler,\n} from './types';\n\nexport interface FilterProps {\n\t/** Aligns the popover with the respective side of the trigger */\n\talign?: 'left' | 'right';\n\t/** Assistive text for accessibility */\n\tassistiveText?: FilterAssistiveText;\n\t/** Contents of popover - dropdowns and inputs that set filter criteria */\n\tchildren?: React.ReactNode;\n\t/** Custom CSS classes for slds-filters__item node */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/**\n\t * Error message for a Filter inside a `PanelFilterList`. The list shows it below the\n\t * filter and sets `isError`. A standalone Filter doesn't render it.\n\t */\n\terrorLabel?: string;\n\t/**\n\t * Applies error state styling. Inside a `PanelFilterList` with `errorLabel`, the filter is\n\t * also described by the error message.\n\t */\n\tisError?: boolean;\n\t/** Unique ID for keyboard navigation and ARIA support */\n\tid?: string;\n\t/** If true, the filter will not display an editing popover when clicked */\n\tisLocked?: boolean;\n\t/** Applies new filter styling */\n\tisNew?: boolean;\n\t/** If true, the filter will not include a remove button */\n\tisPermanent?: boolean;\n\t/** Callback when Done within the Popover is clicked */\n\tonChange?: FilterChangeHandler;\n\t/** Callback when \"Remove Filter\" button is clicked */\n\tonRemove?: FilterRemoveHandler;\n\t/** Callback when Filter is clicked */\n\tonClick?: () => void;\n\t/** Custom Popover component with overridable props */\n\tpopover?: React.ReactElement;\n\t/** The filter predicate (e.g., \"is PURPLE\") */\n\tpredicate?: React.ReactNode;\n\t/** The filter property (e.g., \"Hair Color\") */\n\tproperty?: React.ReactNode;\n}\n\nconst defaultAssistiveText: FilterAssistiveText = {\n\teditFilter: 'Edit filter:',\n\teditFilterHeading: 'Choose filter criteria',\n};\n\n/**\n * A Filter is a popover with custom trigger. It can be used by Panel Filtering.\n * Menus within a Filter Popover will need to not have \"portal mounts\" and be inline.\n */\nconst Filter: React.FC<FilterProps> = ({\n\talign = 'left',\n\tassistiveText: assistiveTextProp,\n\tchildren,\n\tclassName,\n\tisError = false,\n\tid: idProp,\n\tisLocked = false,\n\tisNew = false,\n\tisPermanent = false,\n\tonChange,\n\tonRemove,\n\tonClick,\n\tpopover,\n\tpredicate = 'New Filter',\n\tproperty,\n}) => {\n\t// Generate stable ID\n\tconst generatedId = useMemo(() => generateId(), []);\n\tconst id = idProp || generatedId;\n\t// Only describe the filter by an error element that is rendered\n\tconst errorId = useContext(FilterErrorIdContext);\n\tconst errorDescribedBy = isError ? errorId : undefined;\n\n\t// Popover state: controlled when the custom popover sets `isOpen`, otherwise internal and seeded\n\t// from its `defaultIsOpen`\n\tconst popoverOpenProps = popover?.props as\n\t\t{ isOpen?: boolean; defaultIsOpen?: boolean } | undefined;\n\tconst [popoverIsOpen, setPopoverIsOpen] = useControllableState(\n\t\tpopoverOpenProps?.isOpen,\n\t\tpopoverOpenProps?.defaultIsOpen ?? false\n\t);\n\n\t// Merge assistive text with defaults\n\tconst assistiveText = useMemo<FilterAssistiveText>(\n\t\t() => ({\n\t\t\t...defaultAssistiveText,\n\t\t\t...assistiveTextProp,\n\t\t\tremoveFilter:\n\t\t\t\tassistiveTextProp?.removeFilter ||\n\t\t\t\t`Remove Filter: ${property} ${predicate}`,\n\t\t}),\n\t\t[assistiveTextProp, property, predicate]\n\t);\n\n\t// Handle filter click\n\tconst handleFilterClick = useCallback(() => {\n\t\tsetPopoverIsOpen(true);\n\t\tonClick?.();\n\t}, [onClick, setPopoverIsOpen]);\n\n\t// Handle popover close\n\tconst handleClose = useCallback(() => {\n\t\tsetPopoverIsOpen(false);\n\t}, [setPopoverIsOpen]);\n\n\t// Handle change (Done button clicked)\n\tconst handleChange = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tsetPopoverIsOpen(false);\n\t\t\tonChange?.(event, { id });\n\t\t},\n\t\t[onChange, id, setPopoverIsOpen]\n\t);\n\n\t// Handle remove\n\tconst handleRemove = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonRemove?.(event, { id });\n\t\t},\n\t\t[onRemove, id]\n\t);\n\n\t// Build popover body\n\tconst popoverBody = (\n\t\t<div>\n\t\t\t<h4 className=\"slds-assistive-text\" id={`${id}-popover-heading`}>\n\t\t\t\t{assistiveText.editFilterHeading}\n\t\t\t</h4>\n\t\t\t{children}\n\t\t\t<div className=\"slds-m-top_small slds-text-align_right\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"slds-col_bump-left\"\n\t\t\t\t\tlabel=\"Done\"\n\t\t\t\t\tonClick={handleChange}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\t// Build popover props\n\tconst popoverProps = {\n\t\tariaLabelledby: `${id}-popover-heading`,\n\t\talign,\n\t\tbody: popoverBody,\n\t\theading: '',\n\t\tid,\n\t\toffset: align === 'right' ? '0px -35px' : undefined,\n\t\tonClose: handleClose,\n\t\tonRequestClose: handleClose,\n\t\tposition: 'overflowBoundaryElement' as const,\n\t\tclassName: 'slds-grow',\n\t\t// Merge with custom popover props if provided\n\t\t...(popover?.props || {}),\n\t\tisOpen: popoverIsOpen,\n\t\t// Remove children from merged props\n\t\tchildren: undefined,\n\t};\n\n\t// Trigger button content\n\tconst triggerContent = (\n\t\t<>\n\t\t\t<span className=\"slds-assistive-text\">{assistiveText.editFilter}</span>\n\t\t\t{property ? (\n\t\t\t\t<span className=\"slds-show slds-text-body_small\">{property}</span>\n\t\t\t) : null}\n\t\t\t<span className=\"slds-show\">{predicate}</span>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-filters__item',\n\t\t\t\t'slds-grid',\n\t\t\t\t'slds-grid_vertical-align-center',\n\t\t\t\t{\n\t\t\t\t\t'slds-is-locked': isLocked,\n\t\t\t\t\t'slds-is-new': isNew,\n\t\t\t\t\t'slds-has-error': isError,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t{!isLocked && (children || popover) ? (\n\t\t\t\t// @ts-expect-error - Popover props are complex with overrides\n\t\t\t\t<Popover {...popoverProps} silenceDeprecatedPropertyWarning>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclassName=\"slds-button_reset slds-grow slds-has-blur-focus\"\n\t\t\t\t\t\tonClick={handleFilterClick}\n\t\t\t\t\t\taria-describedby={errorDescribedBy}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{triggerContent}\n\t\t\t\t\t</button>\n\t\t\t\t</Popover>\n\t\t\t) : (\n\t\t\t\t<button\n\t\t\t\t\taria-describedby={errorDescribedBy}\n\t\t\t\t\tclassName=\"slds-button_reset slds-grow slds-has-blur-focus\"\n\t\t\t\t\tdisabled\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"slds-show slds-text-body_small\">{property}</span>\n\t\t\t\t\t<span className=\"slds-show\">{predicate}</span>\n\t\t\t\t</button>\n\t\t\t)}\n\t\t\t{!isPermanent && !isLocked && (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{ icon: assistiveText.removeFilter }}\n\t\t\t\t\thint\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"delete\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\ticonVariant=\"bare\"\n\t\t\t\t\tonClick={handleRemove}\n\t\t\t\t\ttitle={assistiveText.removeFilter}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nFilter.displayName = FILTER;\n\nexport default Filter;\n"],"mappings":";;;;;;;;;;AA6DA,IAAM,IAA4C;CACjD,YAAY;CACZ,mBAAmB;AACpB,GAMM,KAAiC,EACtC,WAAQ,QACR,eAAe,GACf,aACA,cACA,aAAU,IACV,IAAI,GACJ,cAAW,IACX,WAAQ,IACR,iBAAc,I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KAAA;CACX,GAGM,IACL,kBAAA,GAAA,EAAA,UAAA;EACC,kBAAC,QAAD;GAAM,WAAU;GAAuB,UAAA,EAAc;EAAiB,CAAA;EACrE,IACA,kBAAC,QAAD;GAAM,WAAU;GAAkC,UAAA;EAAe,CAAA,IAC9D;EACJ,kBAAC,QAAD;GAAM,WAAU;GAAa,UAAA;EAAgB,CAAA;CAC5C,EAAA,CAAA;CAGH,OACC,kBAAC,OAAD;EACC,WAAW,EACV,sBACA,aACA,mCACA;GACC,kBAAkB;GAClB,eAAe;GACf,kBAAkB;EACnB,GACA,CACD;EAXD,UAAA,CAaE,CAAC,MAAa,KAAY,KAE1B,kBAAC,GAAD;GAAS,GAAI;GAAc,kCAAA;GAC1B,UAAA,kBAAC,UAAD;IACC,WAAU;IACV,SAAS;IACT,oBAAkB;IAClB,MAAK;IAEJ,UAAA;GACM,CAAA;EACA,CAAA,IAET,kBAAC,UAAD;GACC,oBAAkB;GAClB,WAAU;GACV,UAAA;GACA,MAAK;GAJN,UAAA,CAMC,kBAAC,QAAD;IAAM,WAAU;IAAkC,UAAA;GAAe,CAAA,GACjE,kBAAC,QAAD;IAAM,WAAU;IAAa,UAAA;GAAgB,CAAA,CACtC;EAER,CAAA,GAAA,CAAC,KAAe,CAAC,KACjB,kBAAC,GAAD;GACC,eAAe,EAAE,MAAM,EAAc,aAAa;GAClD,MAAA;GACA,cAAa;GACb,UAAS;GACT,UAAS;GACT,aAAY;GACZ,SAAS;GACT,OAAO,EAAc;GACrB,SAAQ;EACR,CAAA,CAEE;;AAEP;AAEA,EAAO,cAAc"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import e from "../../utilities/warning/sunset-property.js";
|
|
2
2
|
import t from "../../utilities/get-component-doc.js";
|
|
3
|
+
import n from "../../utilities/warning/deprecated-property.js";
|
|
3
4
|
//#region components/icon/check-props.js
|
|
4
|
-
var
|
|
5
|
-
process.env.NODE_ENV !== "production" && (
|
|
6
|
-
if (typeof
|
|
7
|
-
let
|
|
8
|
-
e(
|
|
5
|
+
var r = function() {};
|
|
6
|
+
process.env.NODE_ENV !== "production" && (r = function(r, i, a) {
|
|
7
|
+
if (typeof i.assistiveText == "string") {
|
|
8
|
+
let n = t(a);
|
|
9
|
+
e(r, i.assistiveText, "assistiveText", `\`assistiveText\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \`assistiveText.label\` instead. ${n("assistiveText")}`);
|
|
9
10
|
}
|
|
11
|
+
n(r, i.productTheme, "productTheme", void 0, "It hard-codes legacy product brand colors that SLDS 2 themes don't define, and is removed before 11.0.0. Set the background color yourself with `style` or `className`: `<Icon style={{ backgroundColor: '#00857d' }} />`.");
|
|
10
12
|
});
|
|
11
|
-
var
|
|
13
|
+
var i = r;
|
|
12
14
|
//#endregion
|
|
13
|
-
export {
|
|
15
|
+
export { i as default };
|
|
14
16
|
|
|
15
17
|
//# sourceMappingURL=check-props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/icon/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 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\tif (typeof props.assistiveText === 'string') {\n\t\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText,\n\t\t\t\t'assistiveText',\n\t\t\t\t`\\`assistiveText\\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \\`assistiveText.label\\` instead. ${createDocUrl(\n\t\t\t\t\t'assistiveText'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/icon/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 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\tif (typeof props.assistiveText === 'string') {\n\t\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText,\n\t\t\t\t'assistiveText',\n\t\t\t\t`\\`assistiveText\\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \\`assistiveText.label\\` instead. ${createDocUrl(\n\t\t\t\t\t'assistiveText'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\n\t\tdeprecatedProperty(\n\t\t\tCOMPONENT,\n\t\t\tprops.productTheme,\n\t\t\t'productTheme',\n\t\t\tundefined,\n\t\t\t\"It hard-codes legacy product brand colors that SLDS 2 themes don't define, and is removed before 11.0.0. Set the background color yourself with `style` or `className`: `<Icon style={{ backgroundColor: '#00857d' }} />`.\"\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;;AAQA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAI,OAAO,EAAM,iBAAkB,UAAU;EAC5C,IAAM,IAAe,EAAkB,CAAO;EAE9C,EACC,GACA,EAAM,eACN,iBACA,mKAAmK,EAClK,eACD,GACD;CACD;CAEA,EACC,GACA,EAAM,cACN,gBACA,KAAA,GACA,4NACD;AACD;AAGD,IAAA,IAAe"}
|
|
@@ -13,20 +13,23 @@ var l = {
|
|
|
13
13
|
colorVariant: "default",
|
|
14
14
|
size: "medium"
|
|
15
15
|
}, u = ({ category: u = l.category, className: d, colorVariant: f = l.colorVariant, containerClassName: p, containerStyle: m, icon: h, inverse: g, name: _, path: v, size: y = l.size, title: b, productTheme: x, assistiveText: S = l.assistiveText, style: C }) => {
|
|
16
|
-
let w = C;
|
|
17
|
-
|
|
18
|
-
backgroundColor:
|
|
16
|
+
let w = C, T = x && r[x];
|
|
17
|
+
T && (w = {
|
|
18
|
+
backgroundColor: T,
|
|
19
19
|
...C
|
|
20
20
|
}), o(() => {
|
|
21
|
-
i(e, {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
i(e, {
|
|
22
|
+
assistiveText: S,
|
|
23
|
+
productTheme: x
|
|
24
|
+
}, a);
|
|
25
|
+
}, [S, x]);
|
|
26
|
+
let E = typeof S == "object" ? S?.label ?? l.assistiveText.label : void 0, D = _ ? _.replace(/_/g, "-") : "", O = n({
|
|
24
27
|
"slds-icon_container": u !== "utility",
|
|
25
28
|
"slds-icon_container_circle": u === "action",
|
|
26
|
-
[`slds-icon-${u}-${
|
|
29
|
+
[`slds-icon-${u}-${D}`]: u !== "utility" && u !== "doctype" && !v
|
|
27
30
|
}, p);
|
|
28
31
|
return /* @__PURE__ */ c("span", {
|
|
29
|
-
className:
|
|
32
|
+
className: O,
|
|
30
33
|
style: m,
|
|
31
34
|
title: b,
|
|
32
35
|
children: [/* @__PURE__ */ s(t, {
|
|
@@ -47,9 +50,9 @@ var l = {
|
|
|
47
50
|
name: _,
|
|
48
51
|
path: v,
|
|
49
52
|
style: w
|
|
50
|
-
}),
|
|
53
|
+
}), E ? /* @__PURE__ */ s("span", {
|
|
51
54
|
className: "slds-assistive-text",
|
|
52
|
-
children:
|
|
55
|
+
children: E
|
|
53
56
|
}) : null]
|
|
54
57
|
});
|
|
55
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/icon/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, { useEffect, type CSSProperties } from 'react';\nimport classNames from '../../utilities/class-names';\nimport UtilityIcon, {\n\ttype InlineIconData,\n} from '../utilities/utility-icon/index';\nimport IconBackgrounds from '../../utilities/product-tokens/icon-backgrounds';\nimport { ICON } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Icon color variant types\n */\nexport type { IconCategory };\n\nexport type IconColorVariant =\n\t'base' | 'default' | 'error' | 'light' | 'warning' | 'success';\n\n/**\n * Icon size types\n */\nexport type IconSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Product theme types for icon backgrounds\n */\nexport type ProductTheme =\n\t| 'global-setup'\n\t| 'service-cloud'\n\t| 'industry-cloud'\n\t| 'sales-cloud'\n\t| 'commerce-cloud'\n\t| 'community-cloud'\n\t| 'marketing-cloud'\n\t| 'quip';\n\n/**\n * Props for the Icon component\n */\nexport interface IconProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: { label?: string
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/icon/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, { useEffect, type CSSProperties } from 'react';\nimport classNames from '../../utilities/class-names';\nimport UtilityIcon, {\n\ttype InlineIconData,\n} from '../utilities/utility-icon/index';\nimport IconBackgrounds from '../../utilities/product-tokens/icon-backgrounds';\nimport { ICON } from '../../utilities/constants';\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Icon color variant types\n */\nexport type { IconCategory };\n\nexport type IconColorVariant =\n\t'base' | 'default' | 'error' | 'light' | 'warning' | 'success';\n\n/**\n * Icon size types\n */\nexport type IconSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Product theme types for icon backgrounds\n * @deprecated Removed before 11.0.0. Set the background color with `style` or `className`.\n */\nexport type ProductTheme =\n\t| 'global-setup'\n\t| 'service-cloud'\n\t| 'industry-cloud'\n\t| 'sales-cloud'\n\t| 'commerce-cloud'\n\t| 'community-cloud'\n\t| 'marketing-cloud'\n\t| 'quip';\n\n/**\n * Props for the Icon component\n */\nexport interface IconProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: {\n\t\t/** Visually hidden label read in place of the icon. Leave unset for a decorative icon. */\n\t\tlabel?: string;\n\t};\n\t/** Icon category from SLDS */\n\tcategory?: IconCategory;\n\t/** CSS classes for the SVG element */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Icon color variant */\n\tcolorVariant?: IconColorVariant;\n\t/** CSS classes for the container span */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** Styles for the container span */\n\tcontainerStyle?: CSSProperties;\n\t/** Custom SVG icon data */\n\ticon?: InlineIconData;\n\t/** Invert colors for dark backgrounds */\n\tinverse?: boolean;\n\t/** Name of the icon */\n\tname?: string;\n\t/** Direct path to the icon sprite */\n\tpath?: string;\n\t/**\n\t * Background theme color (only for standard category)\n\t * @deprecated Removed before 11.0.0. These legacy product brand colors aren't\n\t * SLDS 2 theme values; set the background color yourself with `style` or\n\t * `className`, for example `style={{ backgroundColor: '#00857d' }}`.\n\t */\n\tproductTheme?: ProductTheme;\n\t/** Size of the icon */\n\tsize?: IconSize;\n\t/** Custom styles for the SVG */\n\tstyle?: CSSProperties;\n\t/** HTML title attribute for the container */\n\ttitle?: string;\n}\n\nconst defaultProps: Required<\n\tPick<IconProps, 'assistiveText' | 'category' | 'colorVariant' | 'size'>\n> = {\n\tassistiveText: {},\n\tcategory: 'standard',\n\tcolorVariant: 'default',\n\tsize: 'medium',\n};\n\n/**\n * The Icon component is the Lightning Design System Icon component and should be used for naked icons.\n * For icons that are buttons, use the Button component with `variant='icon'`.\n */\nconst Icon = ({\n\tcategory = defaultProps.category,\n\tclassName,\n\tcolorVariant = defaultProps.colorVariant,\n\tcontainerClassName,\n\tcontainerStyle,\n\ticon,\n\tinverse,\n\tname,\n\tpath,\n\tsize = defaultProps.size,\n\ttitle,\n\tproductTheme,\n\tassistiveText = defaultProps.assistiveText,\n\tstyle,\n}: IconProps): React.ReactElement => {\n\tlet styleOverride = style;\n\t// eslint-disable-next-line local/no-deprecated -- honors the deprecated `productTheme` prop until it is removed\n\tconst productBackground = productTheme && IconBackgrounds[productTheme];\n\tif (productBackground) {\n\t\tstyleOverride = {\n\t\t\tbackgroundColor: productBackground,\n\t\t\t...style,\n\t\t};\n\t}\n\n\tuseEffect(() => {\n\t\tcheckProps(ICON, { assistiveText, productTheme }, componentDoc);\n\t}, [assistiveText, productTheme]);\n\n\t// A string `assistiveText` was removed in v11; it is ignored and warns.\n\tconst mergedAssistiveText =\n\t\ttypeof assistiveText === 'object'\n\t\t\t? (assistiveText?.label ?? defaultProps.assistiveText.label)\n\t\t\t: undefined;\n\n\tconst kebabCaseName = name ? name.replace(/_/g, '-') : '';\n\n\tconst containerClasses = classNames(\n\t\t{\n\t\t\t'slds-icon_container': category !== 'utility',\n\t\t\t'slds-icon_container_circle': category === 'action',\n\t\t\t[`slds-icon-${category}-${kebabCaseName}`]:\n\t\t\t\tcategory !== 'utility' && category !== 'doctype' && !path,\n\t\t},\n\t\tcontainerClassName as string\n\t);\n\n\treturn (\n\t\t<span className={containerClasses} style={containerStyle} title={title}>\n\t\t\t<UtilityIcon\n\t\t\t\taria-hidden={true}\n\t\t\t\tcategory={category}\n\t\t\t\tclassName={\n\t\t\t\t\tclassNames(className, 'slds-icon', {\n\t\t\t\t\t\t'slds-icon_xx-small': size === 'xx-small',\n\t\t\t\t\t\t'slds-icon_x-small': size === 'x-small',\n\t\t\t\t\t\t'slds-icon_small': size === 'small',\n\t\t\t\t\t\t// medium intentionally not present\n\t\t\t\t\t\t'slds-icon_large': size === 'large',\n\t\t\t\t\t\t// Color logic for utility vs other categories\n\t\t\t\t\t\t'slds-icon-text-default':\n\t\t\t\t\t\t\tcolorVariant === 'default' && category === 'utility'\n\t\t\t\t\t\t\t\t? !inverse\n\t\t\t\t\t\t\t\t: inverse,\n\t\t\t\t\t\t'slds-icon-text-success': colorVariant === 'success',\n\t\t\t\t\t\t'slds-icon-text-warning': colorVariant === 'warning',\n\t\t\t\t\t\t'slds-icon-text-error': colorVariant === 'error',\n\t\t\t\t\t\t'slds-icon-text-light': colorVariant === 'light',\n\t\t\t\t\t}) as string\n\t\t\t\t}\n\t\t\t\ticon={icon}\n\t\t\t\tname={name}\n\t\t\t\tpath={path}\n\t\t\t\tstyle={styleOverride}\n\t\t\t/>\n\t\t\t{mergedAssistiveText ? (\n\t\t\t\t<span className=\"slds-assistive-text\">{mergedAssistiveText}</span>\n\t\t\t) : null}\n\t\t</span>\n\t);\n};\n\nIcon.displayName = ICON;\n\nexport default Icon;\n"],"mappings":";;;;;;;;;AAmFA,IAAM,IAEF;CACH,eAAe,CAAC;CAChB,UAAU;CACV,cAAc;CACd,MAAM;AACP,GAMM,KAAQ,EACb,cAAW,EAAa,UACxB,cACA,kBAAe,EAAa,cAC5B,uBACA,mBACA,SACA,YACA,SACA,SACA,UAAO,EAAa,MACpB,UACA,iBACA,mBAAgB,EAAa,eAC7B,eACoC;CACpC,IAAI,IAAgB,GAEd,IAAoB,KAAgB,EAAgB;CAQ1D,AAPI,MACH,IAAgB;EACf,iBAAiB;EACjB,GAAG;CACJ,IAGD,QAAgB;EACf,EAAW,GAAM;GAAE;GAAe;EAAa,GAAG,CAAY;CAC/D,GAAG,CAAC,GAAe,CAAY,CAAC;CAGhC,IAAM,IACL,OAAO,KAAkB,WACrB,GAAe,SAAS,EAAa,cAAc,QACpD,KAAA,GAEE,IAAgB,IAAO,EAAK,QAAQ,MAAM,GAAG,IAAI,IAEjD,IAAmB,EACxB;EACC,uBAAuB,MAAa;EACpC,8BAA8B,MAAa;GAC1C,aAAa,EAAS,GAAG,MACzB,MAAa,aAAa,MAAa,aAAa,CAAC;CACvD,GACA,CACD;CAEA,OACC,kBAAC,QAAD;EAAM,WAAW;EAAkB,OAAO;EAAuB;EAAjE,UAAA,CACC,kBAAC,GAAD;GACC,eAAa;GACH;GACV,WACC,EAAW,GAAW,aAAa;IAClC,sBAAsB,MAAS;IAC/B,qBAAqB,MAAS;IAC9B,mBAAmB,MAAS;IAE5B,mBAAmB,MAAS;IAE5B,0BACC,MAAiB,aAAa,MAAa,YACxC,CAAC,IACD;IACJ,0BAA0B,MAAiB;IAC3C,0BAA0B,MAAiB;IAC3C,wBAAwB,MAAiB;IACzC,wBAAwB,MAAiB;GAC1C,CAAC;GAEI;GACA;GACA;GACN,OAAO;EACP,CAAA,GACA,IACA,kBAAC,QAAD;GAAM,WAAU;GAAuB,UAAA;EAA0B,CAAA,IAC9D,IACC;;AAER;AAEA,EAAK,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../components/icon/input-icon/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\n// ### React\nimport React, { type ButtonHTMLAttributes, type MouseEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// A simple javascript utility for conditionally joining classNames together.\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\n\n// ## Children\nimport UtilityIcon from '../../utilities/utility-icon';\nimport type { UtilityIconProps } from '../../utilities/utility-icon';\nimport Button from '../../button';\nimport type { IconCategory } from '../../../types/common';\n\n// ## Constants\nimport { ICON_INPUT } from '../../../utilities/constants';\n\ninterface InputIconBaseProps {\n\t/**\n\t * Icon category from [lightningdesignsystem.com/icons/](https://www.lightningdesignsystem.com/icons/)\n\t */\n\tcategory?: IconCategory;\n\t/**\n\t * This is only needed if an input contains two icons, the Input component handles this prop for you.\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * Name of the icon. Visit <a href='http://www.lightningdesignsystem.com/resources/icons'>Lightning Design System Icons</a> to reference icon names.\n\t */\n\tname?: string;\n\t/**\n\t * Path to the icon. This will override any global icon settings.\n\t */\n\tpath?: string;\n\t/**\n\t * Changes styles of the InputIcon.\n\t */\n\tvariant?: 'base' | 'combobox';\n}\n\n/** A clickable icon, rendered as an icon `Button`. */\nexport interface InputIconClickableProps\n\textends\n\t\tInputIconBaseProps,\n\t\tOmit<\n\t\t\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\t\t'children' | 'className' | 'onClick' | 'style' | 'title' | 'type'\n\t\t> {\n\t/** Assistive text for the icon button */\n\tassistiveText: { icon: string
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../components/icon/input-icon/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\n// ### React\nimport React, { type ButtonHTMLAttributes, type MouseEvent } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// A simple javascript utility for conditionally joining classNames together.\nimport classNames from 'classnames';\n\n// ### isFunction\nimport isFunction from 'lodash.isfunction';\n\n// ## Children\nimport UtilityIcon from '../../utilities/utility-icon';\nimport type { UtilityIconProps } from '../../utilities/utility-icon';\nimport Button from '../../button';\nimport type { IconCategory } from '../../../types/common';\n\n// ## Constants\nimport { ICON_INPUT } from '../../../utilities/constants';\n\ninterface InputIconBaseProps {\n\t/**\n\t * Icon category from [lightningdesignsystem.com/icons/](https://www.lightningdesignsystem.com/icons/)\n\t */\n\tcategory?: IconCategory;\n\t/**\n\t * This is only needed if an input contains two icons, the Input component handles this prop for you.\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * Name of the icon. Visit <a href='http://www.lightningdesignsystem.com/resources/icons'>Lightning Design System Icons</a> to reference icon names.\n\t */\n\tname?: string;\n\t/**\n\t * Path to the icon. This will override any global icon settings.\n\t */\n\tpath?: string;\n\t/**\n\t * Changes styles of the InputIcon.\n\t */\n\tvariant?: 'base' | 'combobox';\n}\n\n/** A clickable icon, rendered as an icon `Button`. */\nexport interface InputIconClickableProps\n\textends\n\t\tInputIconBaseProps,\n\t\tOmit<\n\t\t\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\t\t'children' | 'className' | 'onClick' | 'style' | 'title' | 'type'\n\t\t> {\n\t/** Assistive text for the icon button */\n\tassistiveText: {\n\t\t/** Label of the icon button. */\n\t\ticon: string;\n\t};\n\t/** This event fires when the icon is clicked. */\n\tonClick: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Receives the button node */\n\tbuttonRef?: (node: HTMLButtonElement | null) => void;\n\t/** The button's `type`. */\n\ttype?: 'button' | 'submit' | 'reset';\n}\n\n/** A decorative icon, rendered as a `UtilityIcon`. */\nexport interface InputIconDecorativeProps\n\textends\n\t\tInputIconBaseProps,\n\t\tOmit<UtilityIconProps, 'category' | 'name' | 'path' | 'onClick'> {\n\t/** Unset for a decorative icon; pass `onClick` for a button. */\n\tonClick?: undefined;\n\t/** Tooltip text */\n\ttitle?: string;\n}\n\n/** Props for InputIcon: `onClick` selects between a button and a decorative icon. */\nexport type InputIconProps = InputIconClickableProps | InputIconDecorativeProps;\n\n/**\n * A wrapper for icons that will be rendered inside of an Input\n *\n * If the `onClick` function prop is provided, the `design-system-react/components/button` component is used.\n * If not, the icon will be an instance of `design-system-react/components/utilities/utility-icon`.\n * Checkout out the appropriate component to see what props can be passed along via the `{...props}` rest operator\n */\nconst InputIcon = ({\n\tcategory = 'utility',\n\tvariant = 'base',\n\ticonPosition,\n\tname,\n\tpath,\n\tonClick,\n\t...restProps\n}: InputIconProps): React.ReactElement => {\n\tconst rest = restProps as Record<string, unknown>;\n\t// SLDS 1 let clicks pass through a decorative icon to the input with\n\t// `.slds-input-has-icon .slds-input__icon:not(button)`; SLDS 2 dropped it.\n\tconst passThroughStyle = {\n\t\tpointerEvents: 'none' as const,\n\t\t...(rest.style as React.CSSProperties | undefined),\n\t};\n\n\tconst variants: Record<'combobox' | 'base', React.ReactElement> = {\n\t\tcombobox: (\n\t\t\t<span\n\t\t\t\tclassName=\"slds-icon_container slds-input__icon slds-input__icon_right\"\n\t\t\t\tstyle={{ pointerEvents: 'none' }}\n\t\t\t>\n\t\t\t\t<UtilityIcon\n\t\t\t\t\taria-hidden\n\t\t\t\t\tcategory={category}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'slds-icon slds-icon_x-small slds-icon-text-default'\n\t\t\t\t\t)}\n\t\t\t\t\tname={name}\n\t\t\t\t\tpath={path}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</span>\n\t\t),\n\t\tbase: (\n\t\t\t<UtilityIcon\n\t\t\t\taria-hidden\n\t\t\t\tcategory={category}\n\t\t\t\tclassName={classNames('slds-input__icon slds-icon-text-default', {\n\t\t\t\t\t[`slds-input__icon_${iconPosition}`]: iconPosition,\n\t\t\t\t})}\n\t\t\t\tname={name}\n\t\t\t\tpath={path}\n\t\t\t\t{...rest}\n\t\t\t\tstyle={passThroughStyle}\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn isFunction(onClick) ? (\n\t\t<Button\n\t\t\tclassName={classNames('slds-input__icon', {\n\t\t\t\t[`slds-input__icon_${iconPosition}`]: iconPosition,\n\t\t\t})}\n\t\t\ticonCategory={category}\n\t\t\ticonName={name}\n\t\t\ticonPath={path}\n\t\t\tonClick={onClick}\n\t\t\tvariant=\"icon\"\n\t\t\t{...rest}\n\t\t/>\n\t) : (\n\t\tvariants[variant]\n\t);\n};\n\nInputIcon.displayName = ICON_INPUT;\n\nexport default InputIcon;\n"],"mappings":";;;;;;;;AAwFA,IAAM,KAAa,EAClB,cAAW,WACX,aAAU,QACV,iBACA,SACA,SACA,YACA,GAAG,QACsC;CACzC,IAAM,IAAO,GAGP,IAAmB;EACxB,eAAe;EACf,GAAI,EAAK;CACV,GAEM,IAA4D;EACjE,UACC,kBAAC,QAAD;GACC,WAAU;GACV,OAAO,EAAE,eAAe,OAAO;GAE/B,UAAA,kBAAC,GAAD;IACC,eAAA;IACU;IACV,WAAW,EACV,oDACD;IACM;IACA;IACN,GAAI;GACJ,CAAA;EACI,CAAA;EAEP,MACC,kBAAC,GAAD;GACC,eAAA;GACU;GACV,WAAW,EAAW,2CAA2C,GAC/D,oBAAoB,MAAiB,EACvC,CAAC;GACK;GACA;GACN,GAAI;GACJ,OAAO;EACP,CAAA;CAEH;CAEA,OAAO,EAAW,CAAO,IACxB,kBAAC,GAAD;EACC,WAAW,EAAW,oBAAoB,GACxC,oBAAoB,MAAiB,EACvC,CAAC;EACD,cAAc;EACd,UAAU;EACV,UAAU;EACD;EACT,SAAQ;EACR,GAAI;CACJ,CAAA,IAED,EAAS;AAEX;AAEA,EAAU,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/icon-settings/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, { createContext, type ReactNode } from 'react';\nimport { ICON_SETTINGS } from '../../utilities/constants';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Context value shape for IconSettings\n */\nexport interface IconSettingsContextValue {\n\t/** Path to the root icon folder */\n\ticonPath?: string;\n\t/** Function to generate custom icon paths */\n\tonRequestIconPath?: (data: {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/icon-settings/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, { createContext, type ReactNode } from 'react';\nimport { ICON_SETTINGS } from '../../utilities/constants';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Context value shape for IconSettings\n */\nexport interface IconSettingsContextValue {\n\t/** Path to the root icon folder */\n\ticonPath?: string;\n\t/** Function to generate custom icon paths */\n\tonRequestIconPath?: (data: {\n\t\tcategory: IconCategory;\n\t\tname: string;\n\t}) => string;\n\t/** Path to the action sprite */\n\tactionSprite?: string;\n\t/** Path to the custom sprite */\n\tcustomSprite?: string;\n\t/** Path to the doctype sprite */\n\tdoctypeSprite?: string;\n\t/** Path to the standard sprite */\n\tstandardSprite?: string;\n\t/** Path to the utility sprite */\n\tutilitySprite?: string;\n}\n\n/**\n * Props for the IconSettings component\n */\nexport interface IconSettingsProps extends IconSettingsContextValue {\n\t/** Child components that will have access to icon settings */\n\tchildren: ReactNode;\n}\n\n/**\n * Context for sharing icon settings across the component tree\n */\nexport const IconSettingsContext = createContext<IconSettingsContextValue>({});\n\n/**\n * The Icon Settings component allows for the path to the icons to be specified in all child\n * components and is recommended to be used at the root of the application.\n *\n * **Individual sprites**\n * If your bundler rewrites asset paths, import each sprite and pass it in a\n * sprite prop (`actionSprite`, `customSprite`, `doctypeSprite`, `standardSprite`,\n * `utilitySprite`). With Vite:\n *\n * ```tsx\n * import actionSprite from '@salesforce-ux/design-system/assets/icons/action-sprite/svg/symbols.svg?url';\n * import utilitySprite from '@salesforce-ux/design-system/assets/icons/utility-sprite/svg/symbols.svg?url';\n *\n * <IconSettings actionSprite={actionSprite} utilitySprite={utilitySprite}>\n * <App />\n * </IconSettings>\n * ```\n *\n * **Root icon path**\n * Otherwise use the iconPath to specify the root path to where the icon files will be located\n * in your application such as `/assets/icons`.\n */\nconst IconSettings = ({\n\ticonPath,\n\tonRequestIconPath,\n\tactionSprite,\n\tcustomSprite,\n\tdoctypeSprite,\n\tstandardSprite,\n\tutilitySprite,\n\tchildren,\n}: IconSettingsProps): React.ReactElement => {\n\tconst contextValue: IconSettingsContextValue = {\n\t\ticonPath,\n\t\tonRequestIconPath,\n\t\tactionSprite,\n\t\tcustomSprite,\n\t\tdoctypeSprite,\n\t\tstandardSprite,\n\t\tutilitySprite,\n\t};\n\n\treturn (\n\t\t<IconSettingsContext.Provider value={contextValue}>\n\t\t\t{children}\n\t\t</IconSettingsContext.Provider>\n\t);\n};\n\nIconSettings.displayName = ICON_SETTINGS;\n\nexport default IconSettings;\n"],"mappings":";;;;AAyCA,IAAa,IAAsB,EAAwC,CAAC,CAAC,GAwBvE,KAAgB,EACrB,aACA,sBACA,iBACA,iBACA,kBACA,mBACA,kBACA,kBAC4C;CAC5C,IAAM,IAAyC;EAC9C;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CAEA,OACC,kBAAC,EAAoB,UAArB;EAA8B,OAAO;EACnC;CAC4B,CAAA;AAEhC;AAEA,EAAa,cAAc"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import "../../utilities/constants.js";
|
|
2
2
|
import e from "../../utilities/warning/sunset-property.js";
|
|
3
3
|
import t from "../../utilities/get-component-doc.js";
|
|
4
|
-
import n from "../../utilities/warning/
|
|
4
|
+
import n from "../../utilities/warning/deprecated-property.js";
|
|
5
|
+
import r from "../../utilities/warning/only-one-of-properties.js";
|
|
5
6
|
//#region components/input/check-props.js
|
|
6
|
-
var
|
|
7
|
-
process.env.NODE_ENV !== "production" && (
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
"assistiveText.label":
|
|
11
|
-
label:
|
|
12
|
-
},
|
|
13
|
-
fixedTextLeft:
|
|
14
|
-
fixedTextRight:
|
|
15
|
-
},
|
|
7
|
+
var i = function() {};
|
|
8
|
+
process.env.NODE_ENV !== "production" && (i = function(i, a = {}, o) {
|
|
9
|
+
let s = t(o);
|
|
10
|
+
i === "SLDSInput" && (n(i, a.onKeyPress, "onKeyPress", "onKeyDown", `\`keypress\` is a deprecated DOM event; read \`event.key\` instead. ${s("onKeyDown")}`), e(i, a.defaultValue !== void 0, "defaultValue", "Input is controlled: pass `value` and update it in `onChange`."), e(i, a.assistiveText && a.assistiveText.fieldLevelHelpButton, "assistiveText.fieldLevelHelpButton", `Pass a \`Tooltip\` to \`fieldLevelHelpTooltip\` and set its \`assistiveText.triggerLearnMoreIcon\`. ${s("fieldLevelHelpTooltip")}`), r(i, {
|
|
11
|
+
"assistiveText.label": a.assistiveText && a.assistiveText.label,
|
|
12
|
+
label: a.label
|
|
13
|
+
}, s("assistiveText")), r(i, {
|
|
14
|
+
fixedTextLeft: a.fixedTextLeft,
|
|
15
|
+
fixedTextRight: a.fixedTextRight
|
|
16
|
+
}, s("assistiveText")));
|
|
16
17
|
});
|
|
17
|
-
var
|
|
18
|
+
var a = i;
|
|
18
19
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
+
export { a as default };
|
|
20
21
|
|
|
21
22
|
//# sourceMappingURL=check-props.js.map
|