@salesforce/design-system-react 11.0.0-alpha.2 → 11.0.0-alpha.3
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/dist/cjs/components/combobox/combobox.cjs +1 -1
- package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
- package/dist/cjs/components/data-table/highlight-cell.cjs +1 -1
- package/dist/cjs/components/data-table/index.cjs +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 +1 -1
- package/dist/cjs/components/date-picker/index.cjs.map +1 -1
- package/dist/cjs/components/illustration/check-props.cjs +2 -0
- package/dist/cjs/components/illustration/check-props.cjs.map +1 -0
- package/dist/cjs/components/illustration/index.cjs +1 -1
- package/dist/cjs/components/illustration/index.cjs.map +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/modal/trigger.cjs +1 -1
- package/dist/cjs/components/pill/index.cjs +1 -1
- package/dist/cjs/components/pill/index.cjs.map +1 -1
- package/dist/cjs/components/pill-container/index.cjs +1 -1
- package/dist/cjs/components/pill-container/index.cjs.map +1 -1
- package/dist/cjs/components/pill-container/private/selected-listbox.cjs +1 -1
- package/dist/cjs/components/pill-container/private/selected-listbox.cjs.map +1 -1
- package/dist/cjs/components/tree/private/item.cjs +1 -1
- package/dist/cjs/components/tree/private/render-branch.cjs +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/utilities/constants.cjs +1 -1
- package/dist/cjs/utilities/constants.cjs.map +1 -1
- package/dist/es/components/combobox/combobox.js +131 -117
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/data-table/highlight-cell.js +4 -4
- package/dist/es/components/data-table/index.js +9 -9
- package/dist/es/components/date-picker/date-picker.js +150 -145
- package/dist/es/components/date-picker/date-picker.js.map +1 -1
- package/dist/es/components/date-picker/index.js +6 -18
- package/dist/es/components/date-picker/index.js.map +1 -1
- package/dist/es/components/illustration/check-props.js +11 -0
- package/dist/es/components/illustration/check-props.js.map +1 -0
- package/dist/es/components/illustration/index.js +37 -25
- package/dist/es/components/illustration/index.js.map +1 -1
- package/dist/es/components/index.js +89 -115
- package/dist/es/components/modal/trigger.js +4 -4
- package/dist/es/components/pill/index.js +32 -30
- package/dist/es/components/pill/index.js.map +1 -1
- package/dist/es/components/pill-container/index.js +1 -0
- package/dist/es/components/pill-container/index.js.map +1 -1
- package/dist/es/components/pill-container/private/selected-listbox.js +3 -1
- package/dist/es/components/pill-container/private/selected-listbox.js.map +1 -1
- package/dist/es/components/tree/private/item.js +4 -4
- package/dist/es/components/tree/private/render-branch.js +9 -9
- package/dist/es/components/utilities/dialog/index.js +2 -2
- package/dist/es/components/utilities/dialog/index.js.map +1 -1
- package/dist/es/utilities/constants.js +2 -2
- package/dist/es/utilities/constants.js.map +1 -1
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/components/date-picker/index.d.ts +6 -2
- package/dist/types/components/date-picker/index.d.ts.map +1 -1
- package/dist/types/components/illustration/index.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +0 -52
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/pill/index.d.ts +4 -0
- package/dist/types/components/pill/index.d.ts.map +1 -1
- package/dist/types/components/pill-container/index.d.ts.map +1 -1
- package/dist/types/components/pill-container/private/selected-listbox.d.ts +7 -1
- package/dist/types/components/pill-container/private/selected-listbox.d.ts.map +1 -1
- package/package.json +4 -1
- package/dist/cjs/components/app-launcher/check-props.cjs +0 -2
- package/dist/cjs/components/app-launcher/check-props.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/component.cjs +0 -2
- package/dist/cjs/components/app-launcher/component.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/expandable-section.cjs +0 -2
- package/dist/cjs/components/app-launcher/expandable-section.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/index.cjs +0 -2
- package/dist/cjs/components/app-launcher/index.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/link.cjs +0 -2
- package/dist/cjs/components/app-launcher/link.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/tile.cjs +0 -2
- package/dist/cjs/components/app-launcher/tile.cjs.map +0 -1
- package/dist/cjs/components/app-launcher.cjs +0 -1
- package/dist/cjs/components/brand-band/index.cjs +0 -2
- package/dist/cjs/components/brand-band/index.cjs.map +0 -1
- package/dist/cjs/components/brand-band.cjs +0 -1
- package/dist/cjs/components/expression/condition.cjs +0 -2
- package/dist/cjs/components/expression/condition.cjs.map +0 -1
- package/dist/cjs/components/expression/formula.cjs +0 -2
- package/dist/cjs/components/expression/formula.cjs.map +0 -1
- package/dist/cjs/components/expression/group.cjs +0 -2
- package/dist/cjs/components/expression/group.cjs.map +0 -1
- package/dist/cjs/components/expression/index.cjs +0 -2
- package/dist/cjs/components/expression/index.cjs.map +0 -1
- package/dist/cjs/components/expression.cjs +0 -1
- package/dist/cjs/components/global-header/button.cjs +0 -2
- package/dist/cjs/components/global-header/button.cjs.map +0 -1
- package/dist/cjs/components/global-header/check-props.cjs +0 -2
- package/dist/cjs/components/global-header/check-props.cjs.map +0 -1
- package/dist/cjs/components/global-header/dropdown.cjs +0 -2
- package/dist/cjs/components/global-header/dropdown.cjs.map +0 -1
- package/dist/cjs/components/global-header/favorites.cjs +0 -2
- package/dist/cjs/components/global-header/favorites.cjs.map +0 -1
- package/dist/cjs/components/global-header/help.cjs +0 -2
- package/dist/cjs/components/global-header/help.cjs.map +0 -1
- package/dist/cjs/components/global-header/index.cjs +0 -2
- package/dist/cjs/components/global-header/index.cjs.map +0 -1
- package/dist/cjs/components/global-header/notifications.cjs +0 -2
- package/dist/cjs/components/global-header/notifications.cjs.map +0 -1
- package/dist/cjs/components/global-header/private/dropdown-trigger.cjs +0 -2
- package/dist/cjs/components/global-header/private/dropdown-trigger.cjs.map +0 -1
- package/dist/cjs/components/global-header/profile.cjs +0 -2
- package/dist/cjs/components/global-header/profile.cjs.map +0 -1
- package/dist/cjs/components/global-header/search.cjs +0 -2
- package/dist/cjs/components/global-header/search.cjs.map +0 -1
- package/dist/cjs/components/global-header/setup.cjs +0 -2
- package/dist/cjs/components/global-header/setup.cjs.map +0 -1
- package/dist/cjs/components/global-header/task.cjs +0 -2
- package/dist/cjs/components/global-header/task.cjs.map +0 -1
- package/dist/cjs/components/global-header.cjs +0 -1
- package/dist/cjs/components/global-navigation-bar/button.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/button.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/check-props.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/check-props.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/component.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/component.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/dropdown-trigger.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/dropdown-trigger.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/dropdown.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/dropdown.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/index.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/index.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/label.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/label.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/link.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/link.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/region.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/region.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar.cjs +0 -1
- package/dist/cjs/components/location-map/index.cjs +0 -2
- package/dist/cjs/components/location-map/index.cjs.map +0 -1
- package/dist/cjs/components/location-map.cjs +0 -1
- package/dist/cjs/components/utilities/truncate/index.cjs +0 -2
- package/dist/cjs/components/utilities/truncate/index.cjs.map +0 -1
- package/dist/cjs/components/utilities/truncate.cjs +0 -1
- package/dist/cjs/utilities/warning/one-of-component.cjs +0 -2
- package/dist/cjs/utilities/warning/one-of-component.cjs.map +0 -1
- package/dist/es/components/app-launcher/check-props.js +0 -17
- package/dist/es/components/app-launcher/check-props.js.map +0 -1
- package/dist/es/components/app-launcher/component.js +0 -31
- package/dist/es/components/app-launcher/component.js.map +0 -1
- package/dist/es/components/app-launcher/expandable-section.js +0 -42
- package/dist/es/components/app-launcher/expandable-section.js.map +0 -1
- package/dist/es/components/app-launcher/index.js +0 -96
- package/dist/es/components/app-launcher/index.js.map +0 -1
- package/dist/es/components/app-launcher/link.js +0 -29
- package/dist/es/components/app-launcher/link.js.map +0 -1
- package/dist/es/components/app-launcher/tile.js +0 -101
- package/dist/es/components/app-launcher/tile.js.map +0 -1
- package/dist/es/components/app-launcher.js +0 -2
- package/dist/es/components/brand-band/index.js +0 -27
- package/dist/es/components/brand-band/index.js.map +0 -1
- package/dist/es/components/brand-band.js +0 -2
- package/dist/es/components/expression/condition.js +0 -124
- package/dist/es/components/expression/condition.js.map +0 -1
- package/dist/es/components/expression/formula.js +0 -105
- package/dist/es/components/expression/formula.js.map +0 -1
- package/dist/es/components/expression/group.js +0 -153
- package/dist/es/components/expression/group.js.map +0 -1
- package/dist/es/components/expression/index.js +0 -33
- package/dist/es/components/expression/index.js.map +0 -1
- package/dist/es/components/expression.js +0 -2
- package/dist/es/components/global-header/button.js +0 -19
- package/dist/es/components/global-header/button.js.map +0 -1
- package/dist/es/components/global-header/check-props.js +0 -20
- package/dist/es/components/global-header/check-props.js.map +0 -1
- package/dist/es/components/global-header/dropdown.js +0 -33
- package/dist/es/components/global-header/dropdown.js.map +0 -1
- package/dist/es/components/global-header/favorites.js +0 -74
- package/dist/es/components/global-header/favorites.js.map +0 -1
- package/dist/es/components/global-header/help.js +0 -39
- package/dist/es/components/global-header/help.js.map +0 -1
- package/dist/es/components/global-header/index.js +0 -90
- package/dist/es/components/global-header/index.js.map +0 -1
- package/dist/es/components/global-header/notifications.js +0 -51
- package/dist/es/components/global-header/notifications.js.map +0 -1
- package/dist/es/components/global-header/private/dropdown-trigger.js +0 -50
- package/dist/es/components/global-header/private/dropdown-trigger.js.map +0 -1
- package/dist/es/components/global-header/profile.js +0 -47
- package/dist/es/components/global-header/profile.js.map +0 -1
- package/dist/es/components/global-header/search.js +0 -12
- package/dist/es/components/global-header/search.js.map +0 -1
- package/dist/es/components/global-header/setup.js +0 -39
- package/dist/es/components/global-header/setup.js.map +0 -1
- package/dist/es/components/global-header/task.js +0 -38
- package/dist/es/components/global-header/task.js.map +0 -1
- package/dist/es/components/global-header.js +0 -2
- package/dist/es/components/global-navigation-bar/button.js +0 -22
- package/dist/es/components/global-navigation-bar/button.js.map +0 -1
- package/dist/es/components/global-navigation-bar/check-props.js +0 -13
- package/dist/es/components/global-navigation-bar/check-props.js.map +0 -1
- package/dist/es/components/global-navigation-bar/component.js +0 -43
- package/dist/es/components/global-navigation-bar/component.js.map +0 -1
- package/dist/es/components/global-navigation-bar/dropdown-trigger.js +0 -66
- package/dist/es/components/global-navigation-bar/dropdown-trigger.js.map +0 -1
- package/dist/es/components/global-navigation-bar/dropdown.js +0 -34
- package/dist/es/components/global-navigation-bar/dropdown.js.map +0 -1
- package/dist/es/components/global-navigation-bar/index.js +0 -27
- package/dist/es/components/global-navigation-bar/index.js.map +0 -1
- package/dist/es/components/global-navigation-bar/label.js +0 -25
- package/dist/es/components/global-navigation-bar/label.js.map +0 -1
- package/dist/es/components/global-navigation-bar/link.js +0 -50
- package/dist/es/components/global-navigation-bar/link.js.map +0 -1
- package/dist/es/components/global-navigation-bar/region.js +0 -50
- package/dist/es/components/global-navigation-bar/region.js.map +0 -1
- package/dist/es/components/global-navigation-bar.js +0 -2
- package/dist/es/components/location-map/index.js +0 -75
- package/dist/es/components/location-map/index.js.map +0 -1
- package/dist/es/components/location-map.js +0 -2
- package/dist/es/components/utilities/truncate/index.js +0 -91
- package/dist/es/components/utilities/truncate/index.js.map +0 -1
- package/dist/es/components/utilities/truncate.js +0 -2
- package/dist/es/utilities/warning/one-of-component.js +0 -15
- package/dist/es/utilities/warning/one-of-component.js.map +0 -1
- package/dist/types/components/app-launcher/check-props.d.ts +0 -3
- package/dist/types/components/app-launcher/check-props.d.ts.map +0 -1
- package/dist/types/components/app-launcher/expandable-section.d.ts +0 -62
- package/dist/types/components/app-launcher/expandable-section.d.ts.map +0 -1
- package/dist/types/components/app-launcher/index.d.ts +0 -48
- package/dist/types/components/app-launcher/index.d.ts.map +0 -1
- package/dist/types/components/app-launcher/link.d.ts +0 -39
- package/dist/types/components/app-launcher/link.d.ts.map +0 -1
- package/dist/types/components/app-launcher/section.d.ts +0 -55
- package/dist/types/components/app-launcher/section.d.ts.map +0 -1
- package/dist/types/components/app-launcher/tile.d.ts +0 -74
- package/dist/types/components/app-launcher/tile.d.ts.map +0 -1
- package/dist/types/components/app-launcher.d.ts +0 -2
- package/dist/types/components/brand-band/check-props.d.ts +0 -3
- package/dist/types/components/brand-band/check-props.d.ts.map +0 -1
- package/dist/types/components/brand-band/index.d.ts +0 -39
- package/dist/types/components/brand-band/index.d.ts.map +0 -1
- package/dist/types/components/brand-band.d.ts +0 -2
- package/dist/types/components/bread-crumb/index.d.ts +0 -3
- package/dist/types/components/bread-crumb/index.d.ts.map +0 -1
- package/dist/types/components/bread-crumb.d.ts +0 -2
- package/dist/types/components/expression/condition.d.ts +0 -105
- package/dist/types/components/expression/condition.d.ts.map +0 -1
- package/dist/types/components/expression/formula.d.ts +0 -88
- package/dist/types/components/expression/formula.d.ts.map +0 -1
- package/dist/types/components/expression/group.d.ts +0 -114
- package/dist/types/components/expression/group.d.ts.map +0 -1
- package/dist/types/components/expression/index.d.ts +0 -72
- package/dist/types/components/expression/index.d.ts.map +0 -1
- package/dist/types/components/expression.d.ts +0 -2
- package/dist/types/components/forms/input/index.d.ts +0 -3
- package/dist/types/components/forms/input/index.d.ts.map +0 -1
- package/dist/types/components/forms/input/search.d.ts +0 -3
- package/dist/types/components/forms/input/search.d.ts.map +0 -1
- package/dist/types/components/forms/input.d.ts +0 -2
- package/dist/types/components/forms/radio/index.d.ts +0 -3
- package/dist/types/components/forms/radio/index.d.ts.map +0 -1
- package/dist/types/components/forms/radio.d.ts +0 -2
- package/dist/types/components/forms/textarea/index.d.ts +0 -3
- package/dist/types/components/forms/textarea/index.d.ts.map +0 -1
- package/dist/types/components/forms/textarea.d.ts +0 -2
- package/dist/types/components/global-header/button.d.ts +0 -15
- package/dist/types/components/global-header/button.d.ts.map +0 -1
- package/dist/types/components/global-header/check-props.d.ts +0 -3
- package/dist/types/components/global-header/check-props.d.ts.map +0 -1
- package/dist/types/components/global-header/dropdown.d.ts +0 -59
- package/dist/types/components/global-header/dropdown.d.ts.map +0 -1
- package/dist/types/components/global-header/favorites.d.ts +0 -42
- package/dist/types/components/global-header/favorites.d.ts.map +0 -1
- package/dist/types/components/global-header/help.d.ts +0 -25
- package/dist/types/components/global-header/help.d.ts.map +0 -1
- package/dist/types/components/global-header/index.d.ts +0 -38
- package/dist/types/components/global-header/index.d.ts.map +0 -1
- package/dist/types/components/global-header/notifications.d.ts +0 -33
- package/dist/types/components/global-header/notifications.d.ts.map +0 -1
- package/dist/types/components/global-header/private/dropdown-trigger.d.ts +0 -78
- package/dist/types/components/global-header/private/dropdown-trigger.d.ts.map +0 -1
- package/dist/types/components/global-header/profile.d.ts +0 -38
- package/dist/types/components/global-header/profile.d.ts.map +0 -1
- package/dist/types/components/global-header/search.d.ts +0 -14
- package/dist/types/components/global-header/search.d.ts.map +0 -1
- package/dist/types/components/global-header/setup.d.ts +0 -25
- package/dist/types/components/global-header/setup.d.ts.map +0 -1
- package/dist/types/components/global-header/task.d.ts +0 -25
- package/dist/types/components/global-header/task.d.ts.map +0 -1
- package/dist/types/components/global-header.d.ts +0 -2
- package/dist/types/components/global-navigation-bar/button.d.ts +0 -18
- package/dist/types/components/global-navigation-bar/button.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/check-props.d.ts +0 -3
- package/dist/types/components/global-navigation-bar/check-props.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/dropdown-trigger.d.ts +0 -88
- package/dist/types/components/global-navigation-bar/dropdown-trigger.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/dropdown.d.ts +0 -64
- package/dist/types/components/global-navigation-bar/dropdown.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/index.d.ts +0 -35
- package/dist/types/components/global-navigation-bar/index.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/label.d.ts +0 -25
- package/dist/types/components/global-navigation-bar/label.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/link.d.ts +0 -84
- package/dist/types/components/global-navigation-bar/link.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/region.d.ts +0 -36
- package/dist/types/components/global-navigation-bar/region.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar.d.ts +0 -2
- package/dist/types/components/location-map/index.d.ts +0 -49
- package/dist/types/components/location-map/index.d.ts.map +0 -1
- package/dist/types/components/location-map.d.ts +0 -2
- package/dist/types/components/navigation/index.d.ts +0 -3
- package/dist/types/components/navigation/index.d.ts.map +0 -1
- package/dist/types/components/navigation.d.ts +0 -2
- package/dist/types/components/popover-tooltip/index.d.ts +0 -3
- package/dist/types/components/popover-tooltip/index.d.ts.map +0 -1
- package/dist/types/components/popover-tooltip.d.ts +0 -2
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { DATE_PICKER as e } from "../../utilities/constants.js";
|
|
2
2
|
import { IconSettingsContext as t } from "../icon-settings/index.js";
|
|
3
3
|
import n from "../../utilities/event.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import ee from "../../utilities/generate-id.js";
|
|
5
|
+
import r from "../../utilities/key-code.js";
|
|
6
|
+
import te from "../utilities/dialog/index.js";
|
|
7
|
+
import ne from "../input/index.js";
|
|
8
|
+
import re from "../icon/input-icon/index.js";
|
|
9
|
+
import ie from "../../utilities/hooks/use-click-outside.js";
|
|
10
|
+
import ae from "./private/calendar-wrapper.js";
|
|
11
|
+
import i from "./check-props.js";
|
|
12
|
+
import oe from "./component.js";
|
|
7
13
|
import a from "../../utilities/warning/low-priority-warning.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import ie from "./component.js";
|
|
13
|
-
import ae, { useCallback as s, useContext as oe, useEffect as se, useRef as c, useState as l } from "react";
|
|
14
|
-
import u from "classnames";
|
|
15
|
-
import { jsx as d, jsxs as ce } from "react/jsx-runtime";
|
|
16
|
-
import le from "lodash.assign";
|
|
14
|
+
import se, { useCallback as o, useContext as ce, useEffect as le, useRef as s, useState as c } from "react";
|
|
15
|
+
import l from "classnames";
|
|
16
|
+
import { jsx as u, jsxs as ue } from "react/jsx-runtime";
|
|
17
|
+
import d from "lodash.assign";
|
|
17
18
|
//#region components/date-picker/date-picker.tsx
|
|
18
|
-
var
|
|
19
|
+
var de = {
|
|
19
20
|
nextMonth: "Next month",
|
|
20
21
|
openCalendar: "Open Calendar",
|
|
21
22
|
previousMonth: "Previous month",
|
|
22
23
|
year: "Year"
|
|
23
|
-
},
|
|
24
|
+
}, fe = {
|
|
24
25
|
abbreviatedWeekDays: [
|
|
25
26
|
"Sun",
|
|
26
27
|
"Mon",
|
|
@@ -56,213 +57,217 @@ var ue = {
|
|
|
56
57
|
"Friday",
|
|
57
58
|
"Saturday"
|
|
58
59
|
]
|
|
59
|
-
},
|
|
60
|
-
let { assistiveText: f = {}, align: p = "left", className:
|
|
61
|
-
let e =
|
|
62
|
-
return
|
|
63
|
-
}), [
|
|
64
|
-
let e =
|
|
65
|
-
return
|
|
66
|
-
}), [
|
|
67
|
-
|
|
68
|
-
typeof
|
|
60
|
+
}, pe = (e) => e ? `${e.getMonth() + 1}/${e.getDate()}/${e.getFullYear()}` : "", me = (e) => (a(!1, "Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser."), new Date(e)), f = (a) => {
|
|
61
|
+
let { assistiveText: f = {}, align: p = "left", className: he, children: m, disabled: h, dateDisabled: ge = () => !1, formatter: g = pe, formattedValue: _e, hasError: ve, hasStaticAlignment: ye, id: be, input: xe, isOpen: _, isIsoWeekday: Se, labels: Ce = {}, menuPosition: v = "absolute", onCalendarFocus: y, onChange: b, onClose: x, onOpen: S, onRequestClose: C, onRequestOpen: w, parser: T = me, portalMount: E, relativeYearFrom: D = -10, relativeYearTo: O = 10, triggerClassName: we, value: k, label: A, placeholder: j, assistiveTextOpenCalendar: M, required: N, onBlur: P, onFocus: F, onKeyDown: I } = a, L = d({}, de, f), R = d({}, fe, Ce), z = ce(t), B = s(null), V = s(null), H = s(null), Te = s(ee()), [U, W] = c(!1), [G, K] = c(!1), [Ee, De] = c(k), [q, Oe] = c(() => {
|
|
62
|
+
let e = g(k);
|
|
63
|
+
return k ? e : _e || "";
|
|
64
|
+
}), [ke, Ae] = c(() => {
|
|
65
|
+
let e = g(k);
|
|
66
|
+
return k ? e : _e || "";
|
|
67
|
+
}), [je, Me] = c(!1);
|
|
68
|
+
le(() => {
|
|
69
|
+
typeof i == "function" && i(e, a, oe);
|
|
69
70
|
}, []);
|
|
70
|
-
let J =
|
|
71
|
-
let t =
|
|
71
|
+
let J = o(() => be || Te.current, [be]), Y = o(() => !!(typeof _ == "boolean" ? _ : U), [_, U]), X = o((e) => {
|
|
72
|
+
let t = T(e);
|
|
72
73
|
return (Object.prototype.toString.call(t) !== "[object Date]" || isNaN(t.getTime())) && (t = /* @__PURE__ */ new Date()), t;
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
|
|
79
|
-
}, [
|
|
80
|
-
e || K(!1),
|
|
81
|
-
}, [
|
|
74
|
+
}, [T]), Z = o(() => {
|
|
75
|
+
C && C(), Y() && (W(!1), K(!1), V.current && V.current.focus());
|
|
76
|
+
}, [C, Y]), Ne = o(() => {
|
|
77
|
+
x && x();
|
|
78
|
+
}, [x]), Pe = o((e, t) => {
|
|
79
|
+
S && S(e, t), H.current && G && H.current.focus();
|
|
80
|
+
}, [S, G]), Q = o((e = !1) => {
|
|
81
|
+
e || K(!1), w ? w() : W(!0);
|
|
82
|
+
}, [w]), Fe = o(() => {
|
|
82
83
|
K(!0), Q(!0);
|
|
83
|
-
}, [Q]),
|
|
84
|
-
|
|
84
|
+
}, [Q]), Ie = o((e, { date: t }) => {
|
|
85
|
+
k || (De(t), Oe(g(t)), Ae(g(t))), Z(), b && b(e, {
|
|
85
86
|
date: t,
|
|
86
|
-
formattedDate:
|
|
87
|
+
formattedDate: g(t),
|
|
87
88
|
timezoneOffset: t.getTimezoneOffset()
|
|
88
89
|
});
|
|
89
90
|
}, [
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
k,
|
|
92
|
+
g,
|
|
92
93
|
Z,
|
|
93
|
-
|
|
94
|
-
]),
|
|
95
|
-
typeof
|
|
96
|
-
let t =
|
|
97
|
-
|
|
94
|
+
b
|
|
95
|
+
]), Le = o((e) => {
|
|
96
|
+
typeof _ != "boolean" && U && W(!1), Oe(e.target.value), Ae(e.target.value);
|
|
97
|
+
let t = T(e.target.value);
|
|
98
|
+
b && b(e, {
|
|
98
99
|
date: t,
|
|
99
100
|
formattedDate: e.target.value,
|
|
100
101
|
timezoneOffset: t.getTimezoneOffset()
|
|
101
102
|
});
|
|
102
103
|
}, [
|
|
103
|
-
|
|
104
|
+
_,
|
|
104
105
|
U,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
]),
|
|
108
|
-
e.keyCode && !e.shiftKey && (e.keyCode ===
|
|
109
|
-
}, [
|
|
110
|
-
s(() => {
|
|
106
|
+
T,
|
|
107
|
+
b
|
|
108
|
+
]), $ = o((e) => {
|
|
109
|
+
e.keyCode && !e.shiftKey && (e.keyCode === r.DOWN || e.keyCode === r.UP) && (n.trapEvent(e), W(!0)), (e.keyCode === r.ESCAPE || e.keyCode === r.ENTER) && (n.trapEvent(e), W(!1)), I && I(e, {});
|
|
110
|
+
}, [I]), Re = o(() => {
|
|
111
111
|
Z();
|
|
112
112
|
}, [Z]);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
ie(B, Re, {
|
|
114
|
+
enabled: Y(),
|
|
115
|
+
ignoreClass: "ignore-react-onclickoutside"
|
|
116
|
+
});
|
|
117
|
+
let ze = o((e) => {
|
|
118
|
+
V.current = e, je || Me(!0);
|
|
119
|
+
}, [je]), Be = o(() => {
|
|
116
120
|
let e;
|
|
117
|
-
if (
|
|
118
|
-
let t =
|
|
119
|
-
e = t ? X(t) :
|
|
120
|
-
} else e = q ? X(q) :
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
-
abbreviatedWeekDayLabels:
|
|
123
|
-
assistiveTextNextMonth:
|
|
124
|
-
assistiveTextPreviousMonth:
|
|
125
|
-
assistiveTextYear:
|
|
121
|
+
if (k) {
|
|
122
|
+
let t = g(k);
|
|
123
|
+
e = t ? X(t) : k;
|
|
124
|
+
} else e = q ? X(q) : Ee || /* @__PURE__ */ new Date();
|
|
125
|
+
return /* @__PURE__ */ u(ae, {
|
|
126
|
+
abbreviatedWeekDayLabels: R.abbreviatedWeekDays,
|
|
127
|
+
assistiveTextNextMonth: L.nextMonth,
|
|
128
|
+
assistiveTextPreviousMonth: L.previousMonth,
|
|
129
|
+
assistiveTextYear: L.year,
|
|
126
130
|
canFocusCalendar: G,
|
|
127
131
|
id: J(),
|
|
128
|
-
isIsoWeekday:
|
|
129
|
-
monthLabels:
|
|
130
|
-
onCalendarFocus:
|
|
131
|
-
dateDisabled:
|
|
132
|
+
isIsoWeekday: Se,
|
|
133
|
+
monthLabels: R.months,
|
|
134
|
+
onCalendarFocus: y,
|
|
135
|
+
dateDisabled: ge,
|
|
132
136
|
onRequestClose: Z,
|
|
133
|
-
onSelectDate:
|
|
134
|
-
relativeYearFrom:
|
|
135
|
-
relativeYearTo:
|
|
137
|
+
onSelectDate: Ie,
|
|
138
|
+
relativeYearFrom: D,
|
|
139
|
+
relativeYearTo: O,
|
|
136
140
|
selectedDate: e,
|
|
137
141
|
selectedDateRef: (e) => {
|
|
138
142
|
H.current = e;
|
|
139
143
|
},
|
|
140
|
-
todayLabel:
|
|
141
|
-
weekDayLabels:
|
|
144
|
+
todayLabel: R.today,
|
|
145
|
+
weekDayLabels: R.weekDays
|
|
142
146
|
});
|
|
143
147
|
}, [
|
|
144
|
-
|
|
145
|
-
|
|
148
|
+
k,
|
|
149
|
+
g,
|
|
146
150
|
X,
|
|
147
151
|
q,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
Ee,
|
|
153
|
+
R,
|
|
154
|
+
L,
|
|
151
155
|
G,
|
|
152
156
|
J,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
Se,
|
|
158
|
+
y,
|
|
159
|
+
ge,
|
|
156
160
|
Z,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
]),
|
|
161
|
-
let e =
|
|
161
|
+
Ie,
|
|
162
|
+
D,
|
|
163
|
+
O
|
|
164
|
+
]), Ve = o(() => {
|
|
165
|
+
let e = v === "relative" ? {} : { transform: "none" };
|
|
162
166
|
if (h || !Y()) return null;
|
|
163
167
|
let t = {
|
|
164
168
|
align: `bottom ${p}`,
|
|
165
|
-
contentsClassName:
|
|
166
|
-
"slds-dropdown_right":
|
|
167
|
-
"slds-dropdown_left":
|
|
168
|
-
},
|
|
169
|
-
context:
|
|
170
|
-
hasStaticAlignment:
|
|
169
|
+
contentsClassName: l("slds-datepicker slds-dropdown", {
|
|
170
|
+
"slds-dropdown_right": v === "relative" && p === "right",
|
|
171
|
+
"slds-dropdown_left": v === "relative" && p === "left"
|
|
172
|
+
}, he),
|
|
173
|
+
context: z,
|
|
174
|
+
hasStaticAlignment: ye,
|
|
171
175
|
style: e,
|
|
172
|
-
onClose:
|
|
173
|
-
onOpen:
|
|
176
|
+
onClose: Ne,
|
|
177
|
+
onOpen: Pe,
|
|
174
178
|
onRequestTargetElement: () => V.current,
|
|
175
|
-
position:
|
|
176
|
-
portalMount:
|
|
179
|
+
position: v,
|
|
180
|
+
portalMount: E
|
|
177
181
|
};
|
|
178
|
-
return /* @__PURE__ */
|
|
182
|
+
return /* @__PURE__ */ u(te, {
|
|
179
183
|
...t,
|
|
180
|
-
children:
|
|
184
|
+
children: Be()
|
|
181
185
|
});
|
|
182
186
|
}, [
|
|
183
|
-
|
|
187
|
+
v,
|
|
184
188
|
h,
|
|
185
189
|
Y,
|
|
186
190
|
p,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
]),
|
|
191
|
+
he,
|
|
192
|
+
z,
|
|
193
|
+
ye,
|
|
194
|
+
Ne,
|
|
195
|
+
Pe,
|
|
196
|
+
E,
|
|
197
|
+
Be
|
|
198
|
+
]), He = o(() => {
|
|
195
199
|
let e = {
|
|
196
|
-
iconRight: /* @__PURE__ */
|
|
197
|
-
assistiveText: { icon:
|
|
200
|
+
iconRight: /* @__PURE__ */ u(re, {
|
|
201
|
+
assistiveText: { icon: M || L.openCalendar },
|
|
198
202
|
"aria-haspopup": !0,
|
|
199
203
|
"aria-expanded": Y(),
|
|
200
204
|
category: "utility",
|
|
201
205
|
name: "event",
|
|
202
206
|
onClick: () => {
|
|
203
|
-
|
|
207
|
+
Fe();
|
|
204
208
|
},
|
|
205
209
|
type: "button"
|
|
206
210
|
}),
|
|
207
211
|
inputRef: (e) => {
|
|
208
|
-
|
|
212
|
+
ze(e);
|
|
209
213
|
},
|
|
210
214
|
id: J(),
|
|
211
|
-
onChange:
|
|
215
|
+
onChange: Le,
|
|
212
216
|
onClick: () => {
|
|
213
217
|
Q();
|
|
214
218
|
},
|
|
215
|
-
onKeyDown:
|
|
216
|
-
value:
|
|
219
|
+
onKeyDown: $,
|
|
220
|
+
value: k ? g(k) : ke
|
|
217
221
|
}, t = {
|
|
218
222
|
disabled: h,
|
|
219
|
-
label:
|
|
220
|
-
onBlur:
|
|
221
|
-
onFocus:
|
|
222
|
-
placeholder:
|
|
223
|
-
required:
|
|
224
|
-
}, n = m?.props || {},
|
|
223
|
+
label: A || R.label,
|
|
224
|
+
onBlur: P,
|
|
225
|
+
onFocus: F,
|
|
226
|
+
placeholder: j || R.placeholder,
|
|
227
|
+
required: N
|
|
228
|
+
}, n = m?.props || {}, ee = {
|
|
225
229
|
...n,
|
|
226
230
|
onClick: () => {
|
|
227
231
|
Q(), typeof n.onClick == "function" && n.onClick();
|
|
228
232
|
}
|
|
229
|
-
},
|
|
233
|
+
}, r = xe?.props || {};
|
|
230
234
|
return {
|
|
231
235
|
...e,
|
|
232
236
|
...t,
|
|
233
|
-
...
|
|
234
|
-
...
|
|
237
|
+
...ee,
|
|
238
|
+
...r
|
|
235
239
|
};
|
|
236
240
|
}, [
|
|
237
|
-
|
|
238
|
-
|
|
241
|
+
M,
|
|
242
|
+
L.openCalendar,
|
|
239
243
|
Y,
|
|
240
|
-
Ne,
|
|
241
|
-
Le,
|
|
242
|
-
J,
|
|
243
244
|
Fe,
|
|
245
|
+
ze,
|
|
246
|
+
J,
|
|
247
|
+
Le,
|
|
244
248
|
Q,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
$,
|
|
250
|
+
k,
|
|
251
|
+
g,
|
|
252
|
+
ke,
|
|
249
253
|
h,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
L,
|
|
255
|
-
N,
|
|
254
|
+
A,
|
|
255
|
+
R.label,
|
|
256
|
+
R.placeholder,
|
|
257
|
+
P,
|
|
256
258
|
F,
|
|
259
|
+
j,
|
|
260
|
+
N,
|
|
257
261
|
m,
|
|
258
|
-
|
|
259
|
-
])(),
|
|
260
|
-
return /* @__PURE__ */
|
|
261
|
-
|
|
262
|
-
|
|
262
|
+
xe
|
|
263
|
+
])(), Ue = m ? se.cloneElement(m, He) : /* @__PURE__ */ u(ne, { ...He });
|
|
264
|
+
return /* @__PURE__ */ ue("div", {
|
|
265
|
+
ref: B,
|
|
266
|
+
className: l("slds-dropdown-trigger", "slds-dropdown-trigger_click", "ignore-react-onclickoutside", {
|
|
267
|
+
"slds-has-error": ve,
|
|
263
268
|
"slds-is-open": Y()
|
|
264
|
-
},
|
|
265
|
-
children: [
|
|
269
|
+
}, we),
|
|
270
|
+
children: [Ue, Ve()]
|
|
266
271
|
});
|
|
267
272
|
};
|
|
268
273
|
f.displayName = e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","names":[],"sources":["../../../../components/date-picker/date-picker.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n\ttype ChangeEvent,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport classNames from 'classnames';\n\nimport Dialog from '../utilities/dialog';\nimport CalendarWrapper from './private/calendar-wrapper';\nimport InputIcon from '../icon/input-icon';\nimport Input from '../input';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KEYS from '../../utilities/key-code';\nimport lowPriorityWarning from '../../utilities/warning/low-priority-warning';\n\nimport { DATE_PICKER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { IconSettingsContext } from '../icon-settings';\n\n// ===== Types =====\n\nexport interface DatePickerAssistiveText {\n\tnextMonth?: string;\n\topenCalendar?: string;\n\tpreviousMonth?: string;\n\tyear?: string;\n}\n\nexport interface DatePickerLabels {\n\tabbreviatedWeekDays?: string[];\n\tlabel?: string;\n\tmonths?: string[];\n\tplaceholder?: string;\n\ttoday?: string;\n\tweekDays?: string[];\n}\n\nexport interface DatePickerChangeData {\n\tdate: Date;\n\tformattedDate: string;\n\ttimezoneOffset: number;\n}\n\nexport interface DatePickerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: DatePickerAssistiveText;\n\t/** Alignment of dropdown */\n\talign?: 'left' | 'right';\n\t/** CSS classes for datepicker */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Children (deprecated - use input prop) */\n\tchildren?: ReactElement;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Function to determine if a date should be disabled */\n\tdateDisabled?: (date: Date) => boolean;\n\t/** Date formatting function */\n\tformatter?: (date: Date | null | undefined) => string;\n\t/** Initial formatted value (deprecated) */\n\tformattedValue?: string;\n\t/** Whether to show error state */\n\thasError?: boolean;\n\t/** Prevent dropdown position flipping */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/** Whether dropdown is open (controlled) */\n\tisOpen?: boolean;\n\t/** Make Monday first day of week */\n\tisIsoWeekday?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: DatePickerLabels;\n\t/** Menu position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Called when calendar focus changes */\n\tonCalendarFocus?: (event: React.SyntheticEvent | null, data: { date?: Date; ref?: HTMLElement; direction?: string }) => void;\n\t/** Called when date changes */\n\tonChange?: (event: React.SyntheticEvent, data: DatePickerChangeData) => void;\n\t/** Called when calendar closes */\n\tonClose?: () => void;\n\t/** Called when calendar opens */\n\tonOpen?: (event: React.SyntheticEvent | undefined, data: { portal?: HTMLElement }) => void;\n\t/** Called when calendar wants to close */\n\tonRequestClose?: () => void;\n\t/** Called when calendar wants to open */\n\tonRequestOpen?: () => void;\n\t/** Date parsing function */\n\tparser?: (str: string) => Date;\n\t/** Portal mount function */\n\tportalMount?: (element: ReactNode, container: HTMLElement) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom?: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo?: number;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Selected date value */\n\tvalue?: Date;\n\t/** @deprecated Use labels.label */\n\tlabel?: string;\n\t/** @deprecated Use labels.placeholder */\n\tplaceholder?: string;\n\t/** @deprecated Use assistiveText.openCalendar */\n\tassistiveTextOpenCalendar?: string;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/** Blur handler */\n\tonBlur?: (event: React.FocusEvent) => void;\n\t/** Focus handler */\n\tonFocus?: (event: React.FocusEvent) => void;\n\t/** Keydown handler */\n\tonKeyDown?: (event: KeyboardEvent, data: Record<string, unknown>) => void;\n}\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<DatePickerAssistiveText> = {\n\tnextMonth: 'Next month',\n\topenCalendar: 'Open Calendar',\n\tpreviousMonth: 'Previous month',\n\tyear: 'Year',\n};\n\nconst defaultLabels: Required<DatePickerLabels> = {\n\tabbreviatedWeekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\tlabel: '',\n\tmonths: [\n\t\t'January',\n\t\t'February',\n\t\t'March',\n\t\t'April',\n\t\t'May',\n\t\t'June',\n\t\t'July',\n\t\t'August',\n\t\t'September',\n\t\t'October',\n\t\t'November',\n\t\t'December',\n\t],\n\tplaceholder: 'Pick a Date',\n\ttoday: 'Today',\n\tweekDays: [\n\t\t'Sunday',\n\t\t'Monday',\n\t\t'Tuesday',\n\t\t'Wednesday',\n\t\t'Thursday',\n\t\t'Friday',\n\t\t'Saturday',\n\t],\n};\n\nconst defaultFormatter = (date: Date | null | undefined): string => {\n\treturn date\n\t\t? `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`\n\t\t: '';\n};\n\nconst defaultParser = (str: string): Date => {\n\tlowPriorityWarning(\n\t\tfalse,\n\t\t`Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser.`\n\t);\n\treturn new Date(str);\n};\n\n// ===== Component =====\n\nconst Datepicker: React.FC<DatePickerProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\talign = 'left',\n\t\tclassName,\n\t\tchildren,\n\t\tdisabled,\n\t\tdateDisabled = () => false,\n\t\tformatter = defaultFormatter,\n\t\tformattedValue: formattedValueProp,\n\t\thasError,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinput,\n\t\tisOpen: isOpenProp,\n\t\tisIsoWeekday,\n\t\tlabels: labelsProp = {},\n\t\tmenuPosition = 'absolute',\n\t\tonCalendarFocus,\n\t\tonChange,\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t\tparser = defaultParser,\n\t\tportalMount,\n\t\trelativeYearFrom = -10,\n\t\trelativeYearTo = 10,\n\t\ttriggerClassName,\n\t\tvalue,\n\t\t// Deprecated props\n\t\tlabel,\n\t\tplaceholder,\n\t\tassistiveTextOpenCalendar,\n\t\trequired,\n\t\tonBlur,\n\t\tonFocus,\n\t\tonKeyDown,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst selectedDateCellRef = useRef<HTMLElement | null>(null);\n\tconst generatedId = useRef(generateId());\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [isOpenFromIcon, setIsOpenFromIcon] = useState(false);\n\tconst [internalValue, setInternalValue] = useState<Date | undefined>(value);\n\tconst [formattedValue, setFormattedValue] = useState(() => {\n\t\tconst dateString = formatter(value);\n\t\treturn value ? dateString : formattedValueProp || '';\n\t});\n\tconst [inputValue, setInputValue] = useState(() => {\n\t\tconst dateString = formatter(value);\n\t\treturn value ? dateString : formattedValueProp || '';\n\t});\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Check props on mount (only in development)\n\tuseEffect(() => {\n\t\tif (typeof checkProps === 'function') {\n\t\t\tcheckProps(DATE_PICKER, props as unknown as Record<string, unknown>, componentDoc);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getId = useCallback(() => idProp || generatedId.current, [idProp]);\n\n\tconst getIsOpen = useCallback(() => {\n\t\treturn !!(typeof isOpenProp === 'boolean' ? isOpenProp : isOpenState);\n\t}, [isOpenProp, isOpenState]);\n\n\tconst parseDate = useCallback((dateString: string): Date => {\n\t\tlet parsedDate = parser(dateString);\n\t\tif (\n\t\t\tObject.prototype.toString.call(parsedDate) !== '[object Date]' ||\n\t\t\tisNaN(parsedDate.getTime())\n\t\t) {\n\t\t\tparsedDate = new Date();\n\t\t}\n\t\treturn parsedDate;\n\t}, [parser]);\n\n\t// ===== Event Handlers =====\n\n\tconst handleRequestClose = useCallback(() => {\n\t\tif (onRequestClose) {\n\t\t\tonRequestClose();\n\t\t}\n\n\t\tif (getIsOpen()) {\n\t\t\tsetIsOpenState(false);\n\t\t\tsetIsOpenFromIcon(false);\n\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t}\n\t\t}\n\t}, [onRequestClose, getIsOpen]);\n\n\tconst handleClose = useCallback(() => {\n\t\tif (onClose) {\n\t\t\tonClose();\n\t\t}\n\t}, [onClose]);\n\n\tconst handleOpen = useCallback((event: React.SyntheticEvent | undefined, data: { portal?: HTMLElement }) => {\n\t\tif (onOpen) {\n\t\t\tonOpen(event, data);\n\t\t}\n\n\t\tif (selectedDateCellRef.current && isOpenFromIcon) {\n\t\t\tselectedDateCellRef.current.focus();\n\t\t}\n\t}, [onOpen, isOpenFromIcon]);\n\n\tconst openDialog = useCallback((fromIcon = false) => {\n\t\tif (!fromIcon) {\n\t\t\tsetIsOpenFromIcon(false);\n\t\t}\n\t\tif (onRequestOpen) {\n\t\t\tonRequestOpen();\n\t\t} else {\n\t\t\tsetIsOpenState(true);\n\t\t}\n\t}, [onRequestOpen]);\n\n\tconst openDialogFromIcon = useCallback(() => {\n\t\tsetIsOpenFromIcon(true);\n\t\topenDialog(true);\n\t}, [openDialog]);\n\n\tconst handleCalendarChange = useCallback((event: React.SyntheticEvent, { date }: { date: Date }) => {\n\t\tif (!value) {\n\t\t\tsetInternalValue(date);\n\t\t\tsetFormattedValue(formatter(date));\n\t\t\tsetInputValue(formatter(date));\n\t\t}\n\n\t\thandleRequestClose();\n\n\t\tif (onChange) {\n\t\t\tonChange(event, {\n\t\t\t\tdate,\n\t\t\t\tformattedDate: formatter(date),\n\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t});\n\t\t}\n\t}, [value, formatter, handleRequestClose, onChange]);\n\n\tconst handleInputChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n\t\t// Typing in the input closes the calendar when it's used as an uncontrolled component\n\t\tif (typeof isOpenProp !== 'boolean' && isOpenState) {\n\t\t\tsetIsOpenState(false);\n\t\t}\n\n\t\tsetFormattedValue(event.target.value);\n\t\tsetInputValue(event.target.value);\n\n\t\tconst date = parser(event.target.value);\n\n\t\tif (onChange) {\n\t\t\tonChange(event, {\n\t\t\t\tdate,\n\t\t\t\tformattedDate: event.target.value,\n\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t});\n\t\t}\n\t}, [isOpenProp, isOpenState, parser, onChange]);\n\n\tconst handleKeyDown = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n\t\t// Don't open if user is selecting text\n\t\tif (\n\t\t\tevent.keyCode &&\n\t\t\t!event.shiftKey &&\n\t\t\t(event.keyCode === KEYS.DOWN || event.keyCode === KEYS.UP)\n\t\t) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tsetIsOpenState(true);\n\t\t}\n\n\t\tif (event.keyCode === KEYS.ESCAPE || event.keyCode === KEYS.ENTER) {\n\t\t\tEventUtil.trapEvent(event);\n\t\t\tsetIsOpenState(false);\n\t\t}\n\n\t\tif (onKeyDown) {\n\t\t\tonKeyDown(event, {});\n\t\t}\n\t}, [onKeyDown]);\n\n\tconst handleClickOutside = useCallback(() => {\n\t\thandleRequestClose();\n\t}, [handleRequestClose]);\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback((component: HTMLInputElement | null) => {\n\t\tinputRef.current = component;\n\t\tif (!inputRendered) {\n\t\t\tsetInputRendered(true);\n\t\t}\n\t}, [inputRendered]);\n\n\t// ===== Render Helpers =====\n\n\tconst getDatePicker = useCallback(() => {\n\t\tlet date: Date;\n\t\t// Use props if present. Otherwise, use state.\n\t\tif (value) {\n\t\t\tconst formattedDate = formatter(value);\n\t\t\tdate = formattedDate ? parseDate(formattedDate) : value;\n\t\t} else {\n\t\t\tdate = formattedValue ? parseDate(formattedValue) : internalValue || new Date();\n\t\t}\n\n\t\treturn (\n\t\t\t<CalendarWrapper\n\t\t\t\tabbreviatedWeekDayLabels={labels.abbreviatedWeekDays}\n\t\t\t\tassistiveTextNextMonth={assistiveText.nextMonth}\n\t\t\t\tassistiveTextPreviousMonth={assistiveText.previousMonth}\n\t\t\t\tassistiveTextYear={assistiveText.year}\n\t\t\t\tcanFocusCalendar={isOpenFromIcon}\n\t\t\t\tid={getId()}\n\t\t\t\tisIsoWeekday={isIsoWeekday}\n\t\t\t\tmonthLabels={labels.months}\n\t\t\t\tonCalendarFocus={onCalendarFocus}\n\t\t\t\tdateDisabled={dateDisabled}\n\t\t\t\tonRequestClose={handleRequestClose}\n\t\t\t\tonSelectDate={handleCalendarChange}\n\t\t\t\trelativeYearFrom={relativeYearFrom}\n\t\t\t\trelativeYearTo={relativeYearTo}\n\t\t\t\tselectedDate={date}\n\t\t\t\tselectedDateRef={(component: HTMLElement | null) => {\n\t\t\t\t\tselectedDateCellRef.current = component;\n\t\t\t\t}}\n\t\t\t\ttodayLabel={labels.today}\n\t\t\t\tweekDayLabels={labels.weekDays}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvalue,\n\t\tformatter,\n\t\tparseDate,\n\t\tformattedValue,\n\t\tinternalValue,\n\t\tlabels,\n\t\tassistiveText,\n\t\tisOpenFromIcon,\n\t\tgetId,\n\t\tisIsoWeekday,\n\t\tonCalendarFocus,\n\t\tdateDisabled,\n\t\thandleRequestClose,\n\t\thandleCalendarChange,\n\t\trelativeYearFrom,\n\t\trelativeYearTo,\n\t]);\n\n\tconst getDialog = useCallback(() => {\n\t\t// SLDS override\n\t\tconst style = menuPosition !== 'relative' ? { transform: 'none' } : {};\n\n\t\tif (disabled || !getIsOpen()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst dialogProps = {\n\t\t\talign: `bottom ${align}` as const,\n\t\t\tcontentsClassName: classNames(\n\t\t\t\t'slds-datepicker slds-dropdown',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_right': menuPosition === 'relative' && align === 'right',\n\t\t\t\t\t'slds-dropdown_left': menuPosition === 'relative' && align === 'left',\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t),\n\t\t\tcontext: iconSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tstyle,\n\t\t\tonClose: handleClose,\n\t\t\tonOpen: handleOpen,\n\t\t\tonRequestTargetElement: () => inputRef.current,\n\t\t\tposition: menuPosition,\n\t\t\tportalMount,\n\t\t};\n\n\t\treturn (\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t<Dialog {...(dialogProps as any)}>\n\t\t\t\t{getDatePicker()}\n\t\t\t</Dialog>\n\t\t);\n\t}, [\n\t\tmenuPosition,\n\t\tdisabled,\n\t\tgetIsOpen,\n\t\talign,\n\t\tclassName,\n\t\ticonSettingsContext,\n\t\thasStaticAlignment,\n\t\thandleClose,\n\t\thandleOpen,\n\t\tportalMount,\n\t\tgetDatePicker,\n\t]);\n\n\tconst getInputProps = useCallback(() => {\n\t\tconst defaultInputProps = {\n\t\t\ticonRight: (\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveTextOpenCalendar || assistiveText.openCalendar,\n\t\t\t\t\t}}\n\t\t\t\t\taria-haspopup\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"event\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\topenDialogFromIcon();\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t),\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t\tid: getId(),\n\t\t\tonChange: handleInputChange,\n\t\t\tonClick: () => {\n\t\t\t\topenDialog();\n\t\t\t},\n\t\t\tonKeyDown: handleKeyDown,\n\t\t\tvalue: value ? formatter(value) : inputValue,\n\t\t};\n\n\t\tconst topLevelDeprecatedComponentProps = {\n\t\t\tdisabled,\n\t\t\tlabel: label || labels.label,\n\t\t\tonBlur,\n\t\t\tonFocus,\n\t\t\tplaceholder: placeholder || labels.placeholder,\n\t\t\trequired,\n\t\t};\n\n\t\tconst childrenProps = (children?.props || {}) as Record<string, unknown>;\n\t\tconst childrenPropInputProps = {\n\t\t\t...childrenProps,\n\t\t\tonClick: () => {\n\t\t\t\topenDialog();\n\t\t\t\tif (typeof childrenProps.onClick === 'function') {\n\t\t\t\t\tchildrenProps.onClick();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\n\t\tconst inputRenderProps = input?.props || {};\n\n\t\treturn {\n\t\t\t...defaultInputProps,\n\t\t\t...topLevelDeprecatedComponentProps,\n\t\t\t...childrenPropInputProps,\n\t\t\t...inputRenderProps,\n\t\t};\n\t}, [\n\t\tassistiveTextOpenCalendar,\n\t\tassistiveText.openCalendar,\n\t\tgetIsOpen,\n\t\topenDialogFromIcon,\n\t\tsetInputRefCallback,\n\t\tgetId,\n\t\thandleInputChange,\n\t\topenDialog,\n\t\thandleKeyDown,\n\t\tvalue,\n\t\tformatter,\n\t\tinputValue,\n\t\tdisabled,\n\t\tlabel,\n\t\tlabels.label,\n\t\tlabels.placeholder,\n\t\tonBlur,\n\t\tonFocus,\n\t\tplaceholder,\n\t\trequired,\n\t\tchildren,\n\t\tinput,\n\t]);\n\n\t// ===== Main Render =====\n\n\tconst inputProps = getInputProps();\n\n\t// `children` prop is a deprecated API\n\tconst inputToRender = children ? (\n\t\tReact.cloneElement(children, inputProps as Record<string, unknown>)\n\t) : (\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t<Input {...(inputProps as any)} />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t{\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t},\n\t\t\t\ttriggerClassName\n\t\t\t)}\n\t\t>\n\t\t\t{inputToRender}\n\t\t\t{getDialog()}\n\t\t</div>\n\t);\n};\n\nDatepicker.displayName = DATE_PICKER;\n\nexport default Datepicker;\n\n"],"mappings":";;;;;;;;;;;;;;;;;AAqIA,IAAM,KAA0D;CAC/D,WAAW;CACX,cAAc;CACd,eAAe;CACf,MAAM;AACP,GAEM,KAA4C;CACjD,qBAAqB;EAAC;EAAO;EAAO;EAAO;EAAO;EAAO;EAAO;CAAK;CACrE,OAAO;CACP,QAAQ;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACA,aAAa;CACb,OAAO;CACP,UAAU;EACT;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD,GAEM,MAAoB,MAClB,IACJ,GAAG,EAAK,SAAS,IAAI,EAAE,G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G;GACH,GAAG;GACH,GAAG;EACJ;CACD,GAAG;EACF;EACA,EAAc;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAO;EACP,EAAO;EACP;EACA;EACA;EACA;EACA;EACA;CACD,CAImB,CAAA,CAAc,GAG3B,KAAgB,IACrB,GAAM,aAAa,GAAU,CAAqC,IAGlE,kBAAC,IAAD,EAAO,GAAK,EAAqB,CAAA;CAGlC,OACC,mBAAC,OAAD;EACC,WAAW,EACV,yBACA,+BACA,+BACA;GACC,kBAAkB;GAClB,gBAAgB,EAAU;EAC3B,GACA,EACD;EAVD,UAAA,CAYE,IACA,GAAU,CACP;;AAEP;AAEA,EAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"date-picker.js","names":[],"sources":["../../../../components/date-picker/date-picker.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n\ttype ChangeEvent,\n} from 'react';\n\nimport assign from 'lodash.assign';\nimport classNames from 'classnames';\n\nimport Dialog from '../utilities/dialog';\nimport CalendarWrapper from './private/calendar-wrapper';\nimport InputIcon from '../icon/input-icon';\nimport Input from '../input';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport KEYS from '../../utilities/key-code';\nimport lowPriorityWarning from '../../utilities/warning/low-priority-warning';\n\nimport { DATE_PICKER } from '../../utilities/constants';\nimport generateId from '../../utilities/generate-id';\nimport { IconSettingsContext } from '../icon-settings';\nimport { useClickOutside } from '../../utilities/hooks/use-click-outside';\n\n// ===== Types =====\n\nexport interface DatePickerAssistiveText {\n\tnextMonth?: string;\n\topenCalendar?: string;\n\tpreviousMonth?: string;\n\tyear?: string;\n}\n\nexport interface DatePickerLabels {\n\tabbreviatedWeekDays?: string[];\n\tlabel?: string;\n\tmonths?: string[];\n\tplaceholder?: string;\n\ttoday?: string;\n\tweekDays?: string[];\n}\n\nexport interface DatePickerChangeData {\n\tdate: Date;\n\tformattedDate: string;\n\ttimezoneOffset: number;\n}\n\nexport interface DatePickerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: DatePickerAssistiveText;\n\t/** Alignment of dropdown */\n\talign?: 'left' | 'right';\n\t/** CSS classes for datepicker */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Children (deprecated - use input prop) */\n\tchildren?: ReactElement;\n\t/** Whether component is disabled */\n\tdisabled?: boolean;\n\t/** Function to determine if a date should be disabled */\n\tdateDisabled?: (date: Date) => boolean;\n\t/** Date formatting function */\n\tformatter?: (date: Date | null | undefined) => string;\n\t/** Initial formatted value (deprecated) */\n\tformattedValue?: string;\n\t/** Whether to show error state */\n\thasError?: boolean;\n\t/** Prevent dropdown position flipping */\n\thasStaticAlignment?: boolean;\n\t/** HTML id */\n\tid?: string;\n\t/** Custom input component */\n\tinput?: ReactElement;\n\t/** Whether dropdown is open (controlled) */\n\tisOpen?: boolean;\n\t/** Make Monday first day of week */\n\tisIsoWeekday?: boolean;\n\t/** Text labels for internationalization */\n\tlabels?: DatePickerLabels;\n\t/** Menu position strategy */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Called when calendar focus changes */\n\tonCalendarFocus?: (\n\t\tevent: React.SyntheticEvent | null,\n\t\tdata: { date?: Date; ref?: HTMLElement; direction?: string }\n\t) => void;\n\t/** Called when date changes */\n\tonChange?: (event: React.SyntheticEvent, data: DatePickerChangeData) => void;\n\t/** Called when calendar closes */\n\tonClose?: () => void;\n\t/** Called when calendar opens */\n\tonOpen?: (\n\t\tevent: React.SyntheticEvent | undefined,\n\t\tdata: { portal?: HTMLElement }\n\t) => void;\n\t/** Called when calendar wants to close */\n\tonRequestClose?: () => void;\n\t/** Called when calendar wants to open */\n\tonRequestOpen?: () => void;\n\t/** Date parsing function */\n\tparser?: (str: string) => Date;\n\t/** Portal mount function */\n\tportalMount?: (element: ReactNode, container: HTMLElement) => void;\n\t/** Years before current year in dropdown */\n\trelativeYearFrom?: number;\n\t/** Years after current year in dropdown */\n\trelativeYearTo?: number;\n\t/** CSS classes for trigger wrapper */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Selected date value */\n\tvalue?: Date;\n\t/** @deprecated Use labels.label */\n\tlabel?: string;\n\t/** @deprecated Use labels.placeholder */\n\tplaceholder?: string;\n\t/** @deprecated Use assistiveText.openCalendar */\n\tassistiveTextOpenCalendar?: string;\n\t/** Whether field is required */\n\trequired?: boolean;\n\t/** Blur handler */\n\tonBlur?: (event: React.FocusEvent) => void;\n\t/** Focus handler */\n\tonFocus?: (event: React.FocusEvent) => void;\n\t/** Keydown handler */\n\tonKeyDown?: (event: KeyboardEvent, data: Record<string, unknown>) => void;\n}\n\n// ===== Default Props =====\n\nconst defaultAssistiveText: Required<DatePickerAssistiveText> = {\n\tnextMonth: 'Next month',\n\topenCalendar: 'Open Calendar',\n\tpreviousMonth: 'Previous month',\n\tyear: 'Year',\n};\n\nconst defaultLabels: Required<DatePickerLabels> = {\n\tabbreviatedWeekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\tlabel: '',\n\tmonths: [\n\t\t'January',\n\t\t'February',\n\t\t'March',\n\t\t'April',\n\t\t'May',\n\t\t'June',\n\t\t'July',\n\t\t'August',\n\t\t'September',\n\t\t'October',\n\t\t'November',\n\t\t'December',\n\t],\n\tplaceholder: 'Pick a Date',\n\ttoday: 'Today',\n\tweekDays: [\n\t\t'Sunday',\n\t\t'Monday',\n\t\t'Tuesday',\n\t\t'Wednesday',\n\t\t'Thursday',\n\t\t'Friday',\n\t\t'Saturday',\n\t],\n};\n\nconst defaultFormatter = (date: Date | null | undefined): string => {\n\treturn date\n\t\t? `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`\n\t\t: '';\n};\n\nconst defaultParser = (str: string): Date => {\n\tlowPriorityWarning(\n\t\tfalse,\n\t\t`Please use an external library for date parsing and internationalization like MomentJS (https://github.com/moment/moment/) instead of the default parser.`\n\t);\n\treturn new Date(str);\n};\n\n// ===== Component =====\n\nconst Datepicker: React.FC<DatePickerProps> = (props) => {\n\tconst {\n\t\tassistiveText: assistiveTextProp = {},\n\t\talign = 'left',\n\t\tclassName,\n\t\tchildren,\n\t\tdisabled,\n\t\tdateDisabled = () => false,\n\t\tformatter = defaultFormatter,\n\t\tformattedValue: formattedValueProp,\n\t\thasError,\n\t\thasStaticAlignment,\n\t\tid: idProp,\n\t\tinput,\n\t\tisOpen: isOpenProp,\n\t\tisIsoWeekday,\n\t\tlabels: labelsProp = {},\n\t\tmenuPosition = 'absolute',\n\t\tonCalendarFocus,\n\t\tonChange,\n\t\tonClose,\n\t\tonOpen,\n\t\tonRequestClose,\n\t\tonRequestOpen,\n\t\tparser = defaultParser,\n\t\tportalMount,\n\t\trelativeYearFrom = -10,\n\t\trelativeYearTo = 10,\n\t\ttriggerClassName,\n\t\tvalue,\n\t\t// Deprecated props\n\t\tlabel,\n\t\tplaceholder,\n\t\tassistiveTextOpenCalendar,\n\t\trequired,\n\t\tonBlur,\n\t\tonFocus,\n\t\tonKeyDown,\n\t} = props;\n\n\t// Merge with defaults\n\tconst assistiveText = assign({}, defaultAssistiveText, assistiveTextProp);\n\tconst labels = assign({}, defaultLabels, labelsProp);\n\n\t// Context\n\tconst iconSettingsContext = useContext(IconSettingsContext);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLDivElement | null>(null);\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst selectedDateCellRef = useRef<HTMLElement | null>(null);\n\tconst generatedId = useRef(generateId());\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [isOpenFromIcon, setIsOpenFromIcon] = useState(false);\n\tconst [internalValue, setInternalValue] = useState<Date | undefined>(value);\n\tconst [formattedValue, setFormattedValue] = useState(() => {\n\t\tconst dateString = formatter(value);\n\t\treturn value ? dateString : formattedValueProp || '';\n\t});\n\tconst [inputValue, setInputValue] = useState(() => {\n\t\tconst dateString = formatter(value);\n\t\treturn value ? dateString : formattedValueProp || '';\n\t});\n\tconst [inputRendered, setInputRendered] = useState(false);\n\n\t// Check props on mount (only in development)\n\tuseEffect(() => {\n\t\tif (typeof checkProps === 'function') {\n\t\t\tcheckProps(\n\t\t\t\tDATE_PICKER,\n\t\t\t\tprops as unknown as Record<string, unknown>,\n\t\t\t\tcomponentDoc\n\t\t\t);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\t// Derived state\n\tconst getId = useCallback(() => idProp || generatedId.current, [idProp]);\n\n\tconst getIsOpen = useCallback(() => {\n\t\treturn !!(typeof isOpenProp === 'boolean' ? isOpenProp : isOpenState);\n\t}, [isOpenProp, isOpenState]);\n\n\tconst parseDate = useCallback(\n\t\t(dateString: string): Date => {\n\t\t\tlet parsedDate = parser(dateString);\n\t\t\tif (\n\t\t\t\tObject.prototype.toString.call(parsedDate) !== '[object Date]' ||\n\t\t\t\tisNaN(parsedDate.getTime())\n\t\t\t) {\n\t\t\t\tparsedDate = new Date();\n\t\t\t}\n\t\t\treturn parsedDate;\n\t\t},\n\t\t[parser]\n\t);\n\n\t// ===== Event Handlers =====\n\n\tconst handleRequestClose = useCallback(() => {\n\t\tif (onRequestClose) {\n\t\t\tonRequestClose();\n\t\t}\n\n\t\tif (getIsOpen()) {\n\t\t\tsetIsOpenState(false);\n\t\t\tsetIsOpenFromIcon(false);\n\n\t\t\tif (inputRef.current) {\n\t\t\t\tinputRef.current.focus();\n\t\t\t}\n\t\t}\n\t}, [onRequestClose, getIsOpen]);\n\n\tconst handleClose = useCallback(() => {\n\t\tif (onClose) {\n\t\t\tonClose();\n\t\t}\n\t}, [onClose]);\n\n\tconst handleOpen = useCallback(\n\t\t(\n\t\t\tevent: React.SyntheticEvent | undefined,\n\t\t\tdata: { portal?: HTMLElement }\n\t\t) => {\n\t\t\tif (onOpen) {\n\t\t\t\tonOpen(event, data);\n\t\t\t}\n\n\t\t\tif (selectedDateCellRef.current && isOpenFromIcon) {\n\t\t\t\tselectedDateCellRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[onOpen, isOpenFromIcon]\n\t);\n\n\tconst openDialog = useCallback(\n\t\t(fromIcon = false) => {\n\t\t\tif (!fromIcon) {\n\t\t\t\tsetIsOpenFromIcon(false);\n\t\t\t}\n\t\t\tif (onRequestOpen) {\n\t\t\t\tonRequestOpen();\n\t\t\t} else {\n\t\t\t\tsetIsOpenState(true);\n\t\t\t}\n\t\t},\n\t\t[onRequestOpen]\n\t);\n\n\tconst openDialogFromIcon = useCallback(() => {\n\t\tsetIsOpenFromIcon(true);\n\t\topenDialog(true);\n\t}, [openDialog]);\n\n\tconst handleCalendarChange = useCallback(\n\t\t(event: React.SyntheticEvent, { date }: { date: Date }) => {\n\t\t\tif (!value) {\n\t\t\t\tsetInternalValue(date);\n\t\t\t\tsetFormattedValue(formatter(date));\n\t\t\t\tsetInputValue(formatter(date));\n\t\t\t}\n\n\t\t\thandleRequestClose();\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: formatter(date),\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[value, formatter, handleRequestClose, onChange]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t(event: ChangeEvent<HTMLInputElement>) => {\n\t\t\t// Typing in the input closes the calendar when it's used as an uncontrolled component\n\t\t\tif (typeof isOpenProp !== 'boolean' && isOpenState) {\n\t\t\t\tsetIsOpenState(false);\n\t\t\t}\n\n\t\t\tsetFormattedValue(event.target.value);\n\t\t\tsetInputValue(event.target.value);\n\n\t\t\tconst date = parser(event.target.value);\n\n\t\t\tif (onChange) {\n\t\t\t\tonChange(event, {\n\t\t\t\t\tdate,\n\t\t\t\t\tformattedDate: event.target.value,\n\t\t\t\t\ttimezoneOffset: date.getTimezoneOffset(),\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[isOpenProp, isOpenState, parser, onChange]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent<HTMLInputElement>) => {\n\t\t\t// Don't open if user is selecting text\n\t\t\tif (\n\t\t\t\tevent.keyCode &&\n\t\t\t\t!event.shiftKey &&\n\t\t\t\t(event.keyCode === KEYS.DOWN || event.keyCode === KEYS.UP)\n\t\t\t) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\tsetIsOpenState(true);\n\t\t\t}\n\n\t\t\tif (event.keyCode === KEYS.ESCAPE || event.keyCode === KEYS.ENTER) {\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t\tsetIsOpenState(false);\n\t\t\t}\n\n\t\t\tif (onKeyDown) {\n\t\t\t\tonKeyDown(event, {});\n\t\t\t}\n\t\t},\n\t\t[onKeyDown]\n\t);\n\n\tconst handleClickOutside = useCallback(() => {\n\t\thandleRequestClose();\n\t}, [handleRequestClose]);\n\n\t// Detect clicks outside the trigger/calendar and close the dialog. Anchored\n\t// on the trigger element so this works whether the DatePicker is controlled\n\t// (`onRequestClose` is invoked via `handleRequestClose`) or uncontrolled\n\t// (internal open state is reset). The trigger carries the\n\t// `ignore-react-onclickoutside` class and, in `overflowBoundaryElement`\n\t// mode, so does the portaled calendar, so clicks within the calendar are\n\t// treated as inside.\n\tuseClickOutside(triggerRef, handleClickOutside, {\n\t\tenabled: getIsOpen(),\n\t\tignoreClass: 'ignore-react-onclickoutside',\n\t});\n\n\t// ===== Refs =====\n\n\tconst setInputRefCallback = useCallback(\n\t\t(component: HTMLInputElement | null) => {\n\t\t\tinputRef.current = component;\n\t\t\tif (!inputRendered) {\n\t\t\t\tsetInputRendered(true);\n\t\t\t}\n\t\t},\n\t\t[inputRendered]\n\t);\n\n\t// ===== Render Helpers =====\n\n\tconst getDatePicker = useCallback(() => {\n\t\tlet date: Date;\n\t\t// Use props if present. Otherwise, use state.\n\t\tif (value) {\n\t\t\tconst formattedDate = formatter(value);\n\t\t\tdate = formattedDate ? parseDate(formattedDate) : value;\n\t\t} else {\n\t\t\tdate = formattedValue\n\t\t\t\t? parseDate(formattedValue)\n\t\t\t\t: internalValue || new Date();\n\t\t}\n\n\t\treturn (\n\t\t\t<CalendarWrapper\n\t\t\t\tabbreviatedWeekDayLabels={labels.abbreviatedWeekDays}\n\t\t\t\tassistiveTextNextMonth={assistiveText.nextMonth}\n\t\t\t\tassistiveTextPreviousMonth={assistiveText.previousMonth}\n\t\t\t\tassistiveTextYear={assistiveText.year}\n\t\t\t\tcanFocusCalendar={isOpenFromIcon}\n\t\t\t\tid={getId()}\n\t\t\t\tisIsoWeekday={isIsoWeekday}\n\t\t\t\tmonthLabels={labels.months}\n\t\t\t\tonCalendarFocus={onCalendarFocus}\n\t\t\t\tdateDisabled={dateDisabled}\n\t\t\t\tonRequestClose={handleRequestClose}\n\t\t\t\tonSelectDate={handleCalendarChange}\n\t\t\t\trelativeYearFrom={relativeYearFrom}\n\t\t\t\trelativeYearTo={relativeYearTo}\n\t\t\t\tselectedDate={date}\n\t\t\t\tselectedDateRef={(component: HTMLElement | null) => {\n\t\t\t\t\tselectedDateCellRef.current = component;\n\t\t\t\t}}\n\t\t\t\ttodayLabel={labels.today}\n\t\t\t\tweekDayLabels={labels.weekDays}\n\t\t\t/>\n\t\t);\n\t}, [\n\t\tvalue,\n\t\tformatter,\n\t\tparseDate,\n\t\tformattedValue,\n\t\tinternalValue,\n\t\tlabels,\n\t\tassistiveText,\n\t\tisOpenFromIcon,\n\t\tgetId,\n\t\tisIsoWeekday,\n\t\tonCalendarFocus,\n\t\tdateDisabled,\n\t\thandleRequestClose,\n\t\thandleCalendarChange,\n\t\trelativeYearFrom,\n\t\trelativeYearTo,\n\t]);\n\n\tconst getDialog = useCallback(() => {\n\t\t// SLDS override\n\t\tconst style = menuPosition !== 'relative' ? { transform: 'none' } : {};\n\n\t\tif (disabled || !getIsOpen()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst dialogProps = {\n\t\t\talign: `bottom ${align}` as const,\n\t\t\tcontentsClassName: classNames(\n\t\t\t\t'slds-datepicker slds-dropdown',\n\t\t\t\t{\n\t\t\t\t\t'slds-dropdown_right':\n\t\t\t\t\t\tmenuPosition === 'relative' && align === 'right',\n\t\t\t\t\t'slds-dropdown_left': menuPosition === 'relative' && align === 'left',\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t),\n\t\t\tcontext: iconSettingsContext,\n\t\t\thasStaticAlignment,\n\t\t\tstyle,\n\t\t\tonClose: handleClose,\n\t\t\tonOpen: handleOpen,\n\t\t\tonRequestTargetElement: () => inputRef.current,\n\t\t\tposition: menuPosition,\n\t\t\tportalMount,\n\t\t};\n\n\t\treturn (\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t<Dialog {...(dialogProps as any)}>{getDatePicker()}</Dialog>\n\t\t);\n\t}, [\n\t\tmenuPosition,\n\t\tdisabled,\n\t\tgetIsOpen,\n\t\talign,\n\t\tclassName,\n\t\ticonSettingsContext,\n\t\thasStaticAlignment,\n\t\thandleClose,\n\t\thandleOpen,\n\t\tportalMount,\n\t\tgetDatePicker,\n\t]);\n\n\tconst getInputProps = useCallback(() => {\n\t\tconst defaultInputProps = {\n\t\t\ticonRight: (\n\t\t\t\t<InputIcon\n\t\t\t\t\tassistiveText={{\n\t\t\t\t\t\ticon: assistiveTextOpenCalendar || assistiveText.openCalendar,\n\t\t\t\t\t}}\n\t\t\t\t\taria-haspopup\n\t\t\t\t\taria-expanded={getIsOpen()}\n\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\tname=\"event\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\topenDialogFromIcon();\n\t\t\t\t\t}}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t/>\n\t\t\t),\n\t\t\tinputRef: (component: HTMLInputElement | null) => {\n\t\t\t\tsetInputRefCallback(component);\n\t\t\t},\n\t\t\tid: getId(),\n\t\t\tonChange: handleInputChange,\n\t\t\tonClick: () => {\n\t\t\t\topenDialog();\n\t\t\t},\n\t\t\tonKeyDown: handleKeyDown,\n\t\t\tvalue: value ? formatter(value) : inputValue,\n\t\t};\n\n\t\tconst topLevelDeprecatedComponentProps = {\n\t\t\tdisabled,\n\t\t\tlabel: label || labels.label,\n\t\t\tonBlur,\n\t\t\tonFocus,\n\t\t\tplaceholder: placeholder || labels.placeholder,\n\t\t\trequired,\n\t\t};\n\n\t\tconst childrenProps = (children?.props || {}) as Record<string, unknown>;\n\t\tconst childrenPropInputProps = {\n\t\t\t...childrenProps,\n\t\t\tonClick: () => {\n\t\t\t\topenDialog();\n\t\t\t\tif (typeof childrenProps.onClick === 'function') {\n\t\t\t\t\tchildrenProps.onClick();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\n\t\tconst inputRenderProps = input?.props || {};\n\n\t\treturn {\n\t\t\t...defaultInputProps,\n\t\t\t...topLevelDeprecatedComponentProps,\n\t\t\t...childrenPropInputProps,\n\t\t\t...inputRenderProps,\n\t\t};\n\t}, [\n\t\tassistiveTextOpenCalendar,\n\t\tassistiveText.openCalendar,\n\t\tgetIsOpen,\n\t\topenDialogFromIcon,\n\t\tsetInputRefCallback,\n\t\tgetId,\n\t\thandleInputChange,\n\t\topenDialog,\n\t\thandleKeyDown,\n\t\tvalue,\n\t\tformatter,\n\t\tinputValue,\n\t\tdisabled,\n\t\tlabel,\n\t\tlabels.label,\n\t\tlabels.placeholder,\n\t\tonBlur,\n\t\tonFocus,\n\t\tplaceholder,\n\t\trequired,\n\t\tchildren,\n\t\tinput,\n\t]);\n\n\t// ===== Main Render =====\n\n\tconst inputProps = getInputProps();\n\n\t// `children` prop is a deprecated API\n\tconst inputToRender = children ? (\n\t\tReact.cloneElement(children, inputProps as Record<string, unknown>)\n\t) : (\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t<Input {...(inputProps as any)} />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={triggerRef}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-dropdown-trigger',\n\t\t\t\t'slds-dropdown-trigger_click',\n\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t{\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-is-open': getIsOpen(),\n\t\t\t\t},\n\t\t\t\ttriggerClassName\n\t\t\t)}\n\t\t>\n\t\t\t{inputToRender}\n\t\t\t{getDialog()}\n\t\t</div>\n\t);\n};\n\nDatepicker.displayName = DATE_PICKER;\n\nexport default Datepicker;\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4IA,IAAM,KAA0D;CAC/D,WAAW;CACX,cAAc;CACd,eAAe;CACf,MAAM;AACP,GAEM,KAA4C;CACjD,qBAAqB;EAAC;EAAO;EAAO;EAAO;EAAO;EAAO;EAAO;CAAK;CACrE,OAAO;CACP,QAAQ;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACA,aAAa;CACb,OAAO;CACP,UAAU;EACT;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD,GAEM,MAAoB,MAClB,IACJ,GAAG,EAAK,SAAS,IAAI,EAAE,GAAG,EAAK,QAAQ,EAAE,GAAG,EAAK,YAAY,MAC7D,IAGE,MAAiB,OACtB,EACC,IACA,2JACD,GACO,IAAI,KAAK,CAAG,IAKd,KAAyC,MAAU;CACxD,IAAM,EACL,eAAe,IAAoB,CAAC,GACpC,WAAQ,QACR,eACA,aACA,aACA,yBAAqB,IACrB,eAAY,IACZ,gBAAgB,IAChB,cACA,wBACA,IAAI,IACJ,WACA,QAAQ,GACR,kBACA,QAAQ,KAAa,CAAC,GACtB,kBAAe,YACf,oBACA,aACA,YACA,WACA,mBACA,kBACA,YAAS,IACT,gBACA,sB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mBAAC,OAAD;EACC,KAAK;EACL,WAAW,EACV,yBACA,+BACA,+BACA;GACC,kBAAkB;GAClB,gBAAgB,EAAU;EAC3B,GACA,EACD;EAXD,UAAA,CAaE,IACA,GAAU,CACP;;AAEP;AAEA,EAAW,cAAc"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
1
|
+
import e from "./date-picker.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
4
|
//#region components/date-picker/index.tsx
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
return e(o, () => {
|
|
9
|
-
n.onRequestClose && n.onRequestClose();
|
|
10
|
-
}, {
|
|
11
|
-
enabled: !0,
|
|
12
|
-
ignoreClass: "ignore-react-onclickoutside"
|
|
13
|
-
}), /* @__PURE__ */ i("div", {
|
|
14
|
-
ref: o,
|
|
15
|
-
children: /* @__PURE__ */ i(t, { ...n })
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
a.displayName = "DatepickerWithClickOutside";
|
|
5
|
+
var r = t((t, r) => /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(e, { ...t }) }));
|
|
6
|
+
r.displayName = "DatepickerWithClickOutside";
|
|
19
7
|
//#endregion
|
|
20
|
-
export {
|
|
8
|
+
export { r as default };
|
|
21
9
|
|
|
22
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/date-picker/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 {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/date-picker/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport { forwardRef, type ForwardedRef } from 'react';\nimport Datepicker, { type DatePickerProps } from './date-picker';\n\nexport type {\n\tDatePickerProps,\n\tDatePickerAssistiveText,\n\tDatePickerLabels,\n\tDatePickerChangeData,\n} from './date-picker';\n\n/**\n * DatePicker wrapper preserved for markup/backwards compatibility.\n *\n * Click-outside detection now lives inside the DatePicker component itself\n * (see `date-picker.tsx`) so it can call the internal close handler directly\n * and work for both controlled and uncontrolled usage. This replaces the\n * react-onclickoutside HOC that was removed for React 19 compatibility.\n */\nconst DatepickerWithClickOutside = forwardRef<HTMLDivElement, DatePickerProps>(\n\t(props, _ref: ForwardedRef<HTMLDivElement>) => (\n\t\t<div>\n\t\t\t<Datepicker {...props} />\n\t\t</div>\n\t)\n);\n\nDatepickerWithClickOutside.displayName = 'DatepickerWithClickOutside';\n\nexport default DatepickerWithClickOutside;\n"],"mappings":";;;;AAqBA,IAAM,IAA6B,GACjC,GAAO,MACP,kBAAC,OAAD,EAAA,UACC,kBAAC,GAAD,EAAY,GAAI,EAAQ,CAAA,EACpB,CAAA,CAEP;AAEA,EAA2B,cAAc"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import e from "../../utilities/warning/component-is-deprecated.js";
|
|
2
|
+
//#region components/illustration/check-props.js
|
|
3
|
+
var t = function() {};
|
|
4
|
+
process.env.NODE_ENV !== "production" && (t = function(t, n) {
|
|
5
|
+
e(t, n, "This was decided due to issues with shadow DOM preventing imported SVG files from detecting SLDS styles. Please visit https://www.lightningdesignsystem.com/components/illustration/ to copy the provided example code for use in your application. For security reasons, DO NOT use the `path` prop with user-provided SVG files as it can lead to XSS vulnerability.");
|
|
6
|
+
});
|
|
7
|
+
var n = t;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as default };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=check-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/illustration/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 componentIsDeprecated from '../../utilities/warning/component-is-deprecated';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props) {\n\t\tcomponentIsDeprecated(\n\t\t\tCOMPONENT,\n\t\t\tprops,\n\t\t\t'This was decided due to issues with shadow DOM preventing imported SVG files from detecting SLDS styles. Please visit https://www.lightningdesignsystem.com/components/illustration/ to copy the provided example code for use in your application. For security reasons, DO NOT use the `path` prop with user-provided SVG files as it can lead to XSS vulnerability.'\n\t\t);\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;AAMA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO;CAC1D,EACC,GACA,GACA,wWACD;AACD;AAGD,IAAA,IAAe"}
|