@wordpress/dataviews 12.0.1-next.v.202602091733.0 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -1
- package/README.md +3 -1
- package/build/components/dataform-controls/color.cjs +19 -30
- package/build/components/dataform-controls/color.cjs.map +3 -3
- package/build/components/dataform-controls/date.cjs.map +1 -1
- package/build/components/dataform-controls/datetime.cjs +12 -21
- package/build/components/dataform-controls/datetime.cjs.map +2 -2
- package/build/components/dataform-layouts/card/index.cjs +112 -164
- package/build/components/dataform-layouts/card/index.cjs.map +3 -3
- package/build/components/dataform-layouts/index.cjs +1 -1
- package/build/components/dataform-layouts/index.cjs.map +1 -1
- package/build/components/dataform-layouts/normalize-form.cjs +2 -1
- package/build/components/dataform-layouts/normalize-form.cjs.map +2 -2
- package/build/components/dataform-layouts/panel/dropdown.cjs +79 -65
- package/build/components/dataform-layouts/panel/dropdown.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/index.cjs +13 -177
- package/build/components/dataform-layouts/panel/index.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/modal.cjs +12 -9
- package/build/components/dataform-layouts/panel/modal.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/summary-button.cjs +125 -56
- package/build/components/dataform-layouts/panel/summary-button.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/utils/get-first-validation-error.cjs +59 -0
- package/build/components/dataform-layouts/panel/utils/get-first-validation-error.cjs.map +7 -0
- package/build/components/dataform-layouts/panel/utils/get-label-classname.cjs +45 -0
- package/build/components/dataform-layouts/panel/utils/get-label-classname.cjs.map +7 -0
- package/build/components/dataform-layouts/panel/utils/get-label-content.cjs +36 -0
- package/build/components/dataform-layouts/panel/utils/get-label-content.cjs.map +7 -0
- package/build/components/dataform-layouts/panel/utils/use-field-from-form-field.cjs +77 -0
- package/build/components/dataform-layouts/panel/utils/use-field-from-form-field.cjs.map +7 -0
- package/build/components/dataviews-bulk-actions/index.cjs +2 -2
- package/build/components/dataviews-bulk-actions/index.cjs.map +2 -2
- package/build/components/dataviews-context/index.cjs +1 -0
- package/build/components/dataviews-context/index.cjs.map +2 -2
- package/build/components/dataviews-filters/filter.cjs.map +1 -1
- package/build/components/dataviews-filters/search-widget.cjs +25 -11
- package/build/components/dataviews-filters/search-widget.cjs.map +2 -2
- package/build/components/dataviews-filters/toggle.cjs +6 -2
- package/build/components/dataviews-filters/toggle.cjs.map +2 -2
- package/build/components/dataviews-footer/index.cjs +28 -12
- package/build/components/dataviews-footer/index.cjs.map +3 -3
- package/build/components/dataviews-item-actions/index.cjs +0 -1
- package/build/components/dataviews-item-actions/index.cjs.map +2 -2
- package/build/components/dataviews-layout/index.cjs +12 -0
- package/build/components/dataviews-layout/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/activity/index.cjs +41 -26
- package/build/components/dataviews-layouts/activity/index.cjs.map +3 -3
- package/build/components/dataviews-layouts/grid/composite-grid.cjs +2 -0
- package/build/components/dataviews-layouts/grid/composite-grid.cjs.map +2 -2
- package/build/components/dataviews-layouts/grid/index.cjs +19 -14
- package/build/components/dataviews-layouts/grid/index.cjs.map +3 -3
- package/build/components/dataviews-layouts/list/index.cjs +13 -9
- package/build/components/dataviews-layouts/list/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/picker-table/index.cjs +1 -1
- package/build/components/dataviews-layouts/picker-table/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/table/index.cjs +40 -19
- package/build/components/dataviews-layouts/table/index.cjs.map +2 -2
- package/build/dataviews/index.cjs +9 -2
- package/build/dataviews/index.cjs.map +3 -3
- package/build/dataviews-picker/index.cjs +1 -0
- package/build/dataviews-picker/index.cjs.map +2 -2
- package/build/hooks/use-data.cjs +46 -0
- package/build/hooks/use-data.cjs.map +7 -0
- package/build/hooks/use-delayed-loading.cjs +47 -0
- package/build/hooks/use-delayed-loading.cjs.map +7 -0
- package/build/types/dataform.cjs.map +1 -1
- package/build-module/components/dataform-controls/color.mjs +24 -31
- package/build-module/components/dataform-controls/color.mjs.map +2 -2
- package/build-module/components/dataform-controls/date.mjs.map +1 -1
- package/build-module/components/dataform-controls/datetime.mjs +13 -22
- package/build-module/components/dataform-controls/datetime.mjs.map +2 -2
- package/build-module/components/dataform-layouts/card/index.mjs +113 -161
- package/build-module/components/dataform-layouts/card/index.mjs.map +3 -3
- package/build-module/components/dataform-layouts/index.mjs +1 -1
- package/build-module/components/dataform-layouts/index.mjs.map +1 -1
- package/build-module/components/dataform-layouts/normalize-form.mjs +2 -1
- package/build-module/components/dataform-layouts/normalize-form.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/dropdown.mjs +81 -67
- package/build-module/components/dataform-layouts/panel/dropdown.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/index.mjs +14 -178
- package/build-module/components/dataform-layouts/panel/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/modal.mjs +12 -9
- package/build-module/components/dataform-layouts/panel/modal.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/summary-button.mjs +117 -58
- package/build-module/components/dataform-layouts/panel/summary-button.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/utils/get-first-validation-error.mjs +38 -0
- package/build-module/components/dataform-layouts/panel/utils/get-first-validation-error.mjs.map +7 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-classname.mjs +14 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-classname.mjs.map +7 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs +15 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs.map +7 -0
- package/build-module/components/dataform-layouts/panel/utils/use-field-from-form-field.mjs +46 -0
- package/build-module/components/dataform-layouts/panel/utils/use-field-from-form-field.mjs.map +7 -0
- package/build-module/components/dataviews-bulk-actions/index.mjs +2 -2
- package/build-module/components/dataviews-bulk-actions/index.mjs.map +2 -2
- package/build-module/components/dataviews-context/index.mjs +1 -0
- package/build-module/components/dataviews-context/index.mjs.map +2 -2
- package/build-module/components/dataviews-filters/filter.mjs.map +1 -1
- package/build-module/components/dataviews-filters/search-widget.mjs +25 -11
- package/build-module/components/dataviews-filters/search-widget.mjs.map +2 -2
- package/build-module/components/dataviews-filters/toggle.mjs +6 -2
- package/build-module/components/dataviews-filters/toggle.mjs.map +2 -2
- package/build-module/components/dataviews-footer/index.mjs +28 -12
- package/build-module/components/dataviews-footer/index.mjs.map +2 -2
- package/build-module/components/dataviews-item-actions/index.mjs +0 -1
- package/build-module/components/dataviews-item-actions/index.mjs.map +2 -2
- package/build-module/components/dataviews-layout/index.mjs +12 -0
- package/build-module/components/dataviews-layout/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/activity/index.mjs +41 -26
- package/build-module/components/dataviews-layouts/activity/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs +2 -0
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/grid/index.mjs +19 -14
- package/build-module/components/dataviews-layouts/grid/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/list/index.mjs +13 -9
- package/build-module/components/dataviews-layouts/list/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/picker-table/index.mjs +1 -1
- package/build-module/components/dataviews-layouts/picker-table/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/table/index.mjs +40 -19
- package/build-module/components/dataviews-layouts/table/index.mjs.map +2 -2
- package/build-module/dataviews/index.mjs +9 -2
- package/build-module/dataviews/index.mjs.map +2 -2
- package/build-module/dataviews-picker/index.mjs +1 -0
- package/build-module/dataviews-picker/index.mjs.map +2 -2
- package/build-module/hooks/use-data.mjs +25 -0
- package/build-module/hooks/use-data.mjs.map +7 -0
- package/build-module/hooks/use-delayed-loading.mjs +22 -0
- package/build-module/hooks/use-delayed-loading.mjs.map +7 -0
- package/build-style/style-rtl.css +190 -31
- package/build-style/style.css +190 -31
- package/build-types/components/dataform-controls/color.d.ts.map +1 -1
- package/build-types/components/dataform-controls/datetime.d.ts.map +1 -1
- package/build-types/components/dataform-controls/utils/use-disabled-date-matchers.d.ts +16 -0
- package/build-types/components/dataform-controls/utils/use-disabled-date-matchers.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/card/index.d.ts +1 -10
- package/build-types/components/dataform-layouts/card/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/normalize-form.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/dropdown.d.ts +2 -13
- package/build-types/components/dataform-layouts/panel/dropdown.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/index.d.ts +1 -1
- package/build-types/components/dataform-layouts/panel/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/modal.d.ts +2 -11
- package/build-types/components/dataform-layouts/panel/modal.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/summary-button.d.ts +6 -5
- package/build-types/components/dataform-layouts/panel/summary-button.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/utils/get-first-validation-error.d.ts +4 -0
- package/build-types/components/dataform-layouts/panel/utils/get-first-validation-error.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-classname.d.ts +4 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-classname.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-content.d.ts +3 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-content.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/panel/utils/use-field-from-form-field.d.ts +23 -0
- package/build-types/components/dataform-layouts/panel/utils/use-field-from-form-field.d.ts.map +1 -0
- package/build-types/components/dataviews-context/index.d.ts +1 -0
- package/build-types/components/dataviews-context/index.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/filter.d.ts +1 -1
- package/build-types/components/dataviews-filters/filter.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/search-widget.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/toggle.d.ts.map +1 -1
- package/build-types/components/dataviews-footer/index.d.ts +1 -1
- package/build-types/components/dataviews-footer/index.d.ts.map +1 -1
- package/build-types/components/dataviews-item-actions/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layout/index.d.ts +1 -1
- package/build-types/components/dataviews-layout/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/activity/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/grid/composite-grid.d.ts +2 -1
- package/build-types/components/dataviews-layouts/grid/composite-grid.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/grid/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/list/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/picker-activity/index.d.ts +3 -0
- package/build-types/components/dataviews-layouts/picker-activity/index.d.ts.map +1 -0
- package/build-types/components/dataviews-layouts/table/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/table/use-scroll-state.d.ts +25 -0
- package/build-types/components/dataviews-layouts/table/use-scroll-state.d.ts.map +1 -0
- package/build-types/components/dataviews-layouts/utils/grid-config-options.d.ts +2 -0
- package/build-types/components/dataviews-layouts/utils/grid-config-options.d.ts.map +1 -0
- package/build-types/components/dataviews-layouts/utils/use-infinite-scroll.d.ts +22 -0
- package/build-types/components/dataviews-layouts/utils/use-infinite-scroll.d.ts.map +1 -0
- package/build-types/dataform/stories/index.story.d.ts +9 -1
- package/build-types/dataform/stories/index.story.d.ts.map +1 -1
- package/build-types/dataform/stories/layout-panel.d.ts +3 -1
- package/build-types/dataform/stories/layout-panel.d.ts.map +1 -1
- package/build-types/dataviews/index.d.ts.map +1 -1
- package/build-types/dataviews/stories/empty.d.ts.map +1 -1
- package/build-types/dataviews/stories/fixtures.d.ts +1 -0
- package/build-types/dataviews/stories/fixtures.d.ts.map +1 -1
- package/build-types/dataviews/stories/free-composition.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-table.d.ts.map +1 -1
- package/build-types/dataviews/stories/minimal-ui.d.ts.map +1 -1
- package/build-types/dataviews/stories/with-card.d.ts.map +1 -1
- package/build-types/dataviews-picker/index.d.ts.map +1 -1
- package/build-types/field-types/utils/is-valid-date-boundary.d.ts +7 -0
- package/build-types/field-types/utils/is-valid-date-boundary.d.ts.map +1 -0
- package/build-types/hooks/test/use-data.d.ts +2 -0
- package/build-types/hooks/test/use-data.d.ts.map +1 -0
- package/build-types/hooks/use-data.d.ts +12 -0
- package/build-types/hooks/use-data.d.ts.map +1 -0
- package/build-types/hooks/use-delayed-loading.d.ts +4 -0
- package/build-types/hooks/use-delayed-loading.d.ts.map +1 -0
- package/build-types/hooks/use-infinite-scroll.d.ts +21 -0
- package/build-types/hooks/use-infinite-scroll.d.ts.map +1 -0
- package/build-types/hooks/use-selected-items.d.ts +19 -0
- package/build-types/hooks/use-selected-items.d.ts.map +1 -0
- package/build-types/types/dataform.d.ts +3 -0
- package/build-types/types/dataform.d.ts.map +1 -1
- package/build-wp/index.js +2898 -2198
- package/package.json +21 -21
- package/src/components/dataform-controls/color.tsx +29 -36
- package/src/components/dataform-controls/date.tsx +2 -2
- package/src/components/dataform-controls/datetime.tsx +19 -34
- package/src/components/dataform-controls/style.scss +4 -0
- package/src/components/dataform-layouts/card/index.tsx +118 -185
- package/src/components/dataform-layouts/index.tsx +1 -1
- package/src/components/dataform-layouts/normalize-form.ts +1 -0
- package/src/components/dataform-layouts/panel/dropdown.tsx +95 -96
- package/src/components/dataform-layouts/panel/index.tsx +10 -245
- package/src/components/dataform-layouts/panel/modal.tsx +16 -20
- package/src/components/dataform-layouts/panel/style.scss +110 -27
- package/src/components/dataform-layouts/panel/summary-button.tsx +140 -62
- package/src/components/dataform-layouts/panel/utils/get-first-validation-error.ts +47 -0
- package/src/components/dataform-layouts/panel/utils/get-label-classname.ts +18 -0
- package/src/components/dataform-layouts/panel/utils/get-label-content.tsx +24 -0
- package/src/components/dataform-layouts/panel/utils/use-field-from-form-field.ts +78 -0
- package/src/components/dataform-layouts/regular/style.scss +7 -0
- package/src/components/dataform-layouts/test/normalize-form.ts +5 -0
- package/src/components/dataviews-bulk-actions/index.tsx +2 -2
- package/src/components/dataviews-context/index.ts +2 -0
- package/src/components/dataviews-filters/filter.tsx +1 -1
- package/src/components/dataviews-filters/search-widget.tsx +10 -2
- package/src/components/dataviews-filters/style.scss +8 -0
- package/src/components/dataviews-filters/toggle.tsx +10 -3
- package/src/components/dataviews-footer/index.tsx +39 -12
- package/src/components/dataviews-footer/style.scss +6 -1
- package/src/components/dataviews-item-actions/index.tsx +0 -3
- package/src/components/dataviews-item-actions/style.scss +7 -0
- package/src/components/dataviews-layout/index.tsx +24 -0
- package/src/components/dataviews-layouts/activity/index.tsx +29 -22
- package/src/components/dataviews-layouts/activity/style.scss +5 -0
- package/src/components/dataviews-layouts/grid/composite-grid.tsx +5 -1
- package/src/components/dataviews-layouts/grid/index.tsx +19 -22
- package/src/components/dataviews-layouts/grid/style.scss +5 -0
- package/src/components/dataviews-layouts/list/index.tsx +18 -18
- package/src/components/dataviews-layouts/list/style.scss +5 -0
- package/src/components/dataviews-layouts/picker-table/index.tsx +1 -1
- package/src/components/dataviews-layouts/table/index.tsx +48 -22
- package/src/components/dataviews-layouts/table/style.scss +8 -2
- package/src/dataform/stories/index.story.tsx +5 -0
- package/src/dataform/stories/layout-panel.tsx +19 -2
- package/src/dataform/test/dataform.tsx +2 -2
- package/src/dataviews/index.tsx +11 -3
- package/src/dataviews/stories/empty.tsx +1 -7
- package/src/dataviews/stories/fixtures.tsx +89 -0
- package/src/dataviews/stories/free-composition.tsx +0 -5
- package/src/dataviews/stories/layout-table.tsx +1 -7
- package/src/dataviews/stories/minimal-ui.tsx +0 -5
- package/src/dataviews/stories/with-card.tsx +1 -7
- package/src/dataviews/style.scss +25 -0
- package/src/dataviews-picker/index.tsx +2 -1
- package/src/hooks/use-data.ts +45 -0
- package/src/hooks/use-delayed-loading.ts +21 -0
- package/src/types/dataform.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- DataViews: Align to end integer and number field types. [#75917](https://github.com/WordPress/gutenberg/pull/75917)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- DataForm: Properly handle dates in datetime control. [#76193](https://github.com/WordPress/gutenberg/pull/76193)
|
|
12
|
+
- DataForm: Fix label color of array control. [#75730](https://github.com/WordPress/gutenberg/pull/75730)
|
|
13
|
+
- DataForm: Fix focus loss when collapsing in Card view. [#75689](https://github.com/WordPress/gutenberg/pull/75689)
|
|
14
|
+
- DataViews: Avoid flickering while refreshing. [#74572](https://github.com/WordPress/gutenberg/pull/74572)
|
|
15
|
+
- DataViews: Add spinner in DataViewsLayout in initial load of data. [#76486](https://github.com/WordPress/gutenberg/pull/76486)
|
|
16
|
+
- DataViews: Fix spacing in first column. [#75693](https://github.com/WordPress/gutenberg/pull/75693)
|
|
17
|
+
- DataViews: Fix filter toggle flickering when there are locked or primary filters. [#75913](https://github.com/WordPress/gutenberg/pull/75913)
|
|
18
|
+
- DataViews: Remove visual divider between quick and regular actions in the actions menu. [#75893](https://github.com/WordPress/gutenberg/pull/75893)
|
|
19
|
+
- DataForm: field label for panel layout are no longer uppercased. [#75944](https://github.com/WordPress/gutenberg/pull/75944)
|
|
20
|
+
|
|
21
|
+
### Enhancements
|
|
22
|
+
|
|
23
|
+
- DataViews: minimize padding for primary actions. [#75721](https://github.com/WordPress/gutenberg/pull/75721)
|
|
24
|
+
|
|
25
|
+
## 12.0.0 (2026-02-18)
|
|
6
26
|
|
|
7
27
|
### Breaking Changes
|
|
8
28
|
|
|
@@ -10,19 +30,37 @@
|
|
|
10
30
|
|
|
11
31
|
### Bug Fixes
|
|
12
32
|
|
|
33
|
+
- DataViews: Fix first/last column header text misalignment in table layout when no bulk actions are present. [#75372](https://github.com/WordPress/gutenberg/issues/75372)
|
|
34
|
+
- DataForm: Fix text selection in panel layout summary rows by replacing `::after` overlay with accessible card pattern. [#75565](https://github.com/WordPress/gutenberg/pull/75565)
|
|
35
|
+
- DataViews: Improve styling for filters when long values are in use. [#75369](https://github.com/WordPress/gutenberg/pull/75369)
|
|
13
36
|
- DataForm: Fix label case for regular layout. [#75292](https://github.com/WordPress/gutenberg/pull/75292)
|
|
14
37
|
- DataViews: Add title attribute in grid item title field. [#75085](https://github.com/WordPress/gutenberg/pull/75085)
|
|
15
38
|
- DataViews: Fix title truncation in list layout. [#75063](https://github.com/WordPress/gutenberg/pull/75063)
|
|
16
39
|
- DataViews: Fix fields async validation. [#74948](https://github.com/WordPress/gutenberg/pull/74948)
|
|
40
|
+
- DataForm: Fix color picker styles. [#75427](https://github.com/WordPress/gutenberg/pull/75427)
|
|
17
41
|
|
|
18
42
|
### Enhancements
|
|
19
43
|
|
|
44
|
+
- DataForm: add edit variant. [#75462](https://github.com/WordPress/gutenberg/pull/75462)
|
|
45
|
+
- DataForm: Update trigger mechanism for panel layout. [#75290](https://github.com/WordPress/gutenberg/pull/75290)
|
|
20
46
|
- DataViews: Add `onReset` prop to control view reset functionality from the view config dropdown. [#75093](https://github.com/WordPress/gutenberg/pull/75093)
|
|
21
47
|
- DataForm: Add automatic field labeling - forms now automatically mark the minority of fields (required or optional) to reduce visual noise. [#74430](https://github.com/WordPress/gutenberg/pull/74430)
|
|
22
48
|
- DataViews: Add details form layout validation. [#74996](https://github.com/WordPress/gutenberg/pull/74996)
|
|
23
49
|
- Add new `adaptiveSelect` DataForm control. [#74937](https://github.com/WordPress/gutenberg/pull/74937)
|
|
24
50
|
- DataViews: Consistent rendering of selection checkbox and actions in grid layout. [#75056](https://github.com/WordPress/gutenberg/pull/75056)
|
|
25
51
|
|
|
52
|
+
### Code Quality
|
|
53
|
+
- DataForm: Style SummaryButton in panel layout with `is-disabled` classname. [#75470](https://github.com/WordPress/gutenberg/pull/75470)
|
|
54
|
+
|
|
55
|
+
### Internal
|
|
56
|
+
|
|
57
|
+
- DataForm: Use public `ColorPicker` component instead of internal `Picker` in color control. [#75394](https://github.com/WordPress/gutenberg/pull/75394)
|
|
58
|
+
- Update Testing Library packages used in unit tests. [#75340](https://github.com/WordPress/gutenberg/pull/75340)
|
|
59
|
+
- Always specify initial values for `useRef` calls. [#75513](https://github.com/WordPress/gutenberg/pull/75513)
|
|
60
|
+
- Clean up type declarations using the `React` namespace. [#75508](https://github.com/WordPress/gutenberg/pull/75508)
|
|
61
|
+
- Update `RefObject` type usage for React 19 compatibility. [#75567](https://github.com/WordPress/gutenberg/pull/75567)
|
|
62
|
+
- Upgraded `@ariakit/react` (v0.4.21). [#75620](https://github.com/WordPress/gutenberg/pull/75620)
|
|
63
|
+
|
|
26
64
|
## 11.3.0 (2026-01-29)
|
|
27
65
|
|
|
28
66
|
### Enhancements
|
package/README.md
CHANGED
|
@@ -2057,7 +2057,9 @@ For example:
|
|
|
2057
2057
|
#### Panel
|
|
2058
2058
|
|
|
2059
2059
|
- `type`: `panel`. Required.
|
|
2060
|
-
- `labelPosition`: one of `side`, `top`, or `none`. Optional. `
|
|
2060
|
+
- `labelPosition`: one of `side`, `top`, or `none`. Optional. `side` by default.
|
|
2061
|
+
- `editVisibility`: one of `always`, or `on-hover`. Optional. `on-hover` by default.
|
|
2062
|
+
- `openAs`: one of `dropdown`, `modal`. Optional. `dropdown` by default.
|
|
2061
2063
|
- `summary`: Summary field configuration. Optional. Specifies which field(s) to display in the panel header. Can be:
|
|
2062
2064
|
- A string (single field ID)
|
|
2063
2065
|
- An array of strings (multiple field IDs)
|
|
@@ -36,11 +36,12 @@ module.exports = __toCommonJS(color_exports);
|
|
|
36
36
|
var import_colord = require("colord");
|
|
37
37
|
var import_components = require("@wordpress/components");
|
|
38
38
|
var import_element = require("@wordpress/element");
|
|
39
|
+
var import_i18n = require("@wordpress/i18n");
|
|
39
40
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
40
41
|
var import_get_custom_validity = __toESM(require("./utils/get-custom-validity.cjs"));
|
|
41
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
-
var { ValidatedInputControl
|
|
43
|
-
var
|
|
43
|
+
var { ValidatedInputControl } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
44
|
+
var ColorPickerDropdown = ({
|
|
44
45
|
color,
|
|
45
46
|
onColorChange
|
|
46
47
|
}) => {
|
|
@@ -48,33 +49,21 @@ var ColorPicker = ({
|
|
|
48
49
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
50
|
import_components.Dropdown,
|
|
50
51
|
{
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
className: "dataviews-controls__color-picker-dropdown",
|
|
53
|
+
popoverProps: { resize: false },
|
|
54
|
+
renderToggle: ({ onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
import_components.Button,
|
|
53
56
|
{
|
|
54
|
-
type: "button",
|
|
55
57
|
onClick: onToggle,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
borderRadius: "50%",
|
|
60
|
-
backgroundColor: validColor,
|
|
61
|
-
border: "1px solid #ddd",
|
|
62
|
-
cursor: "pointer",
|
|
63
|
-
outline: isOpen ? "2px solid #007cba" : "none",
|
|
64
|
-
outlineOffset: "2px",
|
|
65
|
-
display: "flex",
|
|
66
|
-
alignItems: "center",
|
|
67
|
-
justifyContent: "center",
|
|
68
|
-
padding: 0,
|
|
69
|
-
margin: 0
|
|
70
|
-
},
|
|
71
|
-
"aria-label": "Open color picker"
|
|
58
|
+
"aria-label": (0, import_i18n.__)("Open color picker"),
|
|
59
|
+
size: "small",
|
|
60
|
+
icon: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ColorIndicator, { colorValue: validColor })
|
|
72
61
|
}
|
|
73
|
-
)
|
|
74
|
-
renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
-
|
|
62
|
+
),
|
|
63
|
+
renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalDropdownContentWrapper, { paddingSize: "none", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
import_components.ColorPicker,
|
|
76
65
|
{
|
|
77
|
-
color:
|
|
66
|
+
color: validColor,
|
|
78
67
|
onChange: onColorChange,
|
|
79
68
|
enableAlpha: true
|
|
80
69
|
}
|
|
@@ -93,8 +82,8 @@ function Color({
|
|
|
93
82
|
const { label, placeholder, description, setValue, isValid } = field;
|
|
94
83
|
const value = field.getValue({ item: data }) || "";
|
|
95
84
|
const handleColorChange = (0, import_element.useCallback)(
|
|
96
|
-
(
|
|
97
|
-
onChange(setValue({ item: data, value:
|
|
85
|
+
(newColor) => {
|
|
86
|
+
onChange(setValue({ item: data, value: newColor }));
|
|
98
87
|
},
|
|
99
88
|
[data, onChange, setValue]
|
|
100
89
|
);
|
|
@@ -117,13 +106,13 @@ function Color({
|
|
|
117
106
|
onChange: handleInputChange,
|
|
118
107
|
hideLabelFromVision,
|
|
119
108
|
type: "text",
|
|
120
|
-
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
|
-
|
|
109
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalInputControlPrefixWrapper, { variant: "control", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
ColorPickerDropdown,
|
|
122
111
|
{
|
|
123
112
|
color: value,
|
|
124
113
|
onColorChange: handleColorChange
|
|
125
114
|
}
|
|
126
|
-
)
|
|
115
|
+
) })
|
|
127
116
|
}
|
|
128
117
|
);
|
|
129
118
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dataform-controls/color.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tDropdown,\n\tprivateApis,\n\t__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n} from '@wordpress/components';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DataFormControlProps } from '../../types';\nimport { unlock } from '../../lock-unlock';\nimport getCustomValidity from './utils/get-custom-validity';\n\nconst { ValidatedInputControl
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAuB;AAKvB,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tColorIndicator,\n\tColorPicker,\n\tDropdown,\n\tprivateApis,\n\t__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n} from '@wordpress/components';\nimport { useCallback } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { DataFormControlProps } from '../../types';\nimport { unlock } from '../../lock-unlock';\nimport getCustomValidity from './utils/get-custom-validity';\n\nconst { ValidatedInputControl } = unlock( privateApis );\n\nconst ColorPickerDropdown = ( {\n\tcolor,\n\tonColorChange,\n}: {\n\tcolor: string;\n\tonColorChange: ( newColor: string ) => void;\n} ) => {\n\tconst validColor = color && colord( color ).isValid() ? color : '#ffffff';\n\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName=\"dataviews-controls__color-picker-dropdown\"\n\t\t\tpopoverProps={ { resize: false } }\n\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\taria-label={ __( 'Open color picker' ) }\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\ticon={ () => <ColorIndicator colorValue={ validColor } /> }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\tcolor={ validColor }\n\t\t\t\t\t\tonChange={ onColorChange }\n\t\t\t\t\t\tenableAlpha\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t/>\n\t);\n};\n\nexport default function Color< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tmarkWhenOptional,\n\tvalidity,\n}: DataFormControlProps< Item > ) {\n\tconst { label, placeholder, description, setValue, isValid } = field;\n\tconst value = field.getValue( { item: data } ) || '';\n\n\tconst handleColorChange = useCallback(\n\t\t( newColor: string ) => {\n\t\t\tonChange( setValue( { item: data, value: newColor } ) );\n\t\t},\n\t\t[ data, onChange, setValue ]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\t( newValue: string | undefined ) => {\n\t\t\tonChange( setValue( { item: data, value: newValue || '' } ) );\n\t\t},\n\t\t[ data, onChange, setValue ]\n\t);\n\n\treturn (\n\t\t<ValidatedInputControl\n\t\t\trequired={ !! field.isValid?.required }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tcustomValidity={ getCustomValidity( isValid, validity ) }\n\t\t\tlabel={ label }\n\t\t\tplaceholder={ placeholder }\n\t\t\tvalue={ value }\n\t\t\thelp={ description }\n\t\t\tonChange={ handleInputChange }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\ttype=\"text\"\n\t\t\tprefix={\n\t\t\t\t<InputControlPrefixWrapper variant=\"control\">\n\t\t\t\t\t<ColorPickerDropdown\n\t\t\t\t\t\tcolor={ value }\n\t\t\t\t\t\tonColorChange={ handleColorChange }\n\t\t\t\t\t/>\n\t\t\t\t</InputControlPrefixWrapper>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAuB;AAKvB,wBAQ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MAAM,UAAU,QAAS;AAAA,EAC5B;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,UAAW,CAAC,CAAE,MAAM,SAAS;AAAA,MAC7B;AAAA,MACA,oBAAiB,2BAAAC,SAAmB,SAAS,QAAS;AAAA,MACtD;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAO;AAAA,MACP,UAAW;AAAA,MACX;AAAA,MACA,MAAK;AAAA,MACL,QACC,4CAAC,kBAAAC,yCAAA,EAA0B,SAAQ,WAClC;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ;AAAA,UACR,eAAgB;AAAA;AAAA,MACjB,GACD;AAAA;AAAA,EAEF;AAEF;",
|
|
6
|
+
"names": ["DropdownContentWrapper", "getCustomValidity", "InputControlPrefixWrapper"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dataform-controls/date.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport {\n\tformat,\n\tisValid as isValidDate,\n\tsubMonths,\n\tsubDays,\n\tsubYears,\n\tstartOfMonth,\n\tstartOfYear,\n} from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tButton,\n\tIcon,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalInputControl as InputControl,\n} from '@wordpress/components';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { getDate, getSettings } from '@wordpress/date';\nimport { error as errorIcon } from '@wordpress/icons';\nimport { Stack } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport RelativeDateControl from './utils/relative-date-control';\nimport {\n\tOPERATOR_IN_THE_PAST,\n\tOPERATOR_OVER,\n\tOPERATOR_BETWEEN,\n} from '../../constants';\nimport { unlock } from '../../lock-unlock';\nimport type {\n\tDataFormControlProps,\n\tFieldValidity,\n\tFormatDate,\n\tNormalizedField,\n} from '../../types';\nimport getCustomValidity from './utils/get-custom-validity';\n\nconst { DateCalendar, DateRangeCalendar } = unlock( componentsPrivateApis );\n\ntype DateRange = [ string, string ] | undefined;\n\nconst DATE_PRESETS: {\n\tid: string;\n\tlabel: string;\n\tgetValue: () => Date;\n}[] = [\n\t{\n\t\tid: 'today',\n\t\tlabel: __( 'Today' ),\n\t\tgetValue: () => getDate( null ),\n\t},\n\t{\n\t\tid: 'yesterday',\n\t\tlabel: __( 'Yesterday' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn subDays( today, 1 );\n\t\t},\n\t},\n\t{\n\t\tid: 'past-week',\n\t\tlabel: __( 'Past week' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn subDays( today, 7 );\n\t\t},\n\t},\n\t{\n\t\tid: 'past-month',\n\t\tlabel: __( 'Past month' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn subMonths( today, 1 );\n\t\t},\n\t},\n];\n\nconst DATE_RANGE_PRESETS = [\n\t{\n\t\tid: 'last-7-days',\n\t\tlabel: __( 'Last 7 days' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ subDays( today, 7 ), today ];\n\t\t},\n\t},\n\t{\n\t\tid: 'last-30-days',\n\t\tlabel: __( 'Last 30 days' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ subDays( today, 30 ), today ];\n\t\t},\n\t},\n\t{\n\t\tid: 'month-to-date',\n\t\tlabel: __( 'Month to date' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ startOfMonth( today ), today ];\n\t\t},\n\t},\n\t{\n\t\tid: 'last-year',\n\t\tlabel: __( 'Last year' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ subYears( today, 1 ), today ];\n\t\t},\n\t},\n\t{\n\t\tid: 'year-to-date',\n\t\tlabel: __( 'Year to date' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ startOfYear( today ), today ];\n\t\t},\n\t},\n];\n\nconst parseDate = ( dateString?: string ): Date | null => {\n\tif ( ! dateString ) {\n\t\treturn null;\n\t}\n\tconst parsed = getDate( dateString );\n\treturn parsed && isValidDate( parsed ) ? parsed : null;\n};\n\nconst formatDate = ( date?: Date | string ): string => {\n\tif ( ! date ) {\n\t\treturn '';\n\t}\n\treturn typeof date === 'string' ? date : format( date, 'yyyy-MM-dd' );\n};\n\nfunction ValidatedDateControl< Item >( {\n\tfield,\n\tvalidity,\n\tinputRefs,\n\tisTouched,\n\tsetIsTouched,\n\tchildren,\n}: {\n\tfield: NormalizedField< Item >;\n\tvalidity?: FieldValidity;\n\tinputRefs:\n\t\t| React.RefObject< HTMLInputElement >\n\t\t| React.RefObject< HTMLInputElement >[];\n\tisTouched: boolean;\n\tsetIsTouched: ( touched: boolean ) => void;\n\tchildren: React.ReactNode;\n} ) {\n\tconst { isValid } = field;\n\tconst [ customValidity, setCustomValidity ] = useState<\n\t\t| { type: 'valid' | 'validating' | 'invalid'; message?: string }\n\t\t| undefined\n\t>( undefined );\n\n\tconst validateRefs = useCallback( () => {\n\t\t// Check HTML5 validity on all refs\n\t\tconst refs = Array.isArray( inputRefs ) ? inputRefs : [ inputRefs ];\n\t\tfor ( const ref of refs ) {\n\t\t\tconst input = ref.current;\n\t\t\tif ( input && ! input.validity.valid ) {\n\t\t\t\tsetCustomValidity( {\n\t\t\t\t\ttype: 'invalid',\n\t\t\t\t\tmessage: input.validationMessage,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// No errors\n\t\tsetCustomValidity( undefined );\n\t}, [ inputRefs ] );\n\n\t// Sync React-level validation to native inputs.\n\tuseEffect( () => {\n\t\tconst refs = Array.isArray( inputRefs ) ? inputRefs : [ inputRefs ];\n\t\tconst result = validity\n\t\t\t? getCustomValidity( isValid, validity )\n\t\t\t: undefined;\n\t\tfor ( const ref of refs ) {\n\t\t\tconst input = ref.current;\n\t\t\tif ( input ) {\n\t\t\t\tinput.setCustomValidity(\n\t\t\t\t\tresult?.type === 'invalid' && result.message\n\t\t\t\t\t\t? result.message\n\t\t\t\t\t\t: ''\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}, [ inputRefs, isValid, validity ] );\n\n\t// Listen for 'invalid' events (e.g., from reportValidity() on card re-expand).\n\tuseEffect( () => {\n\t\tconst refs = Array.isArray( inputRefs ) ? inputRefs : [ inputRefs ];\n\t\tconst handleInvalid = ( event: Event ) => {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsTouched( true );\n\t\t};\n\t\tfor ( const ref of refs ) {\n\t\t\tref.current?.addEventListener( 'invalid', handleInvalid );\n\t\t}\n\t\treturn () => {\n\t\t\tfor ( const ref of refs ) {\n\t\t\t\tref.current?.removeEventListener( 'invalid', handleInvalid );\n\t\t\t}\n\t\t};\n\t}, [ inputRefs, setIsTouched ] );\n\n\tuseEffect( () => {\n\t\tif ( ! isTouched ) {\n\t\t\treturn;\n\t\t}\n\t\tconst result = validity\n\t\t\t? getCustomValidity( isValid, validity )\n\t\t\t: undefined;\n\t\tif ( result ) {\n\t\t\tsetCustomValidity( result );\n\t\t} else {\n\t\t\tvalidateRefs();\n\t\t}\n\t}, [ isTouched, isValid, validity, validateRefs ] );\n\n\tconst onBlur = ( event: React.FocusEvent< HTMLDivElement > ) => {\n\t\tif ( isTouched ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only consider \"blurred from the component\" if focus has fully left the wrapping div.\n\t\t// This prevents unnecessary blurs from components with multiple focusable elements.\n\t\tif (\n\t\t\t! event.relatedTarget ||\n\t\t\t! event.currentTarget.contains( event.relatedTarget )\n\t\t) {\n\t\t\tsetIsTouched( true );\n\t\t}\n\t};\n\n\treturn (\n\t\t<div onBlur={ onBlur }>\n\t\t\t{ children }\n\t\t\t<div aria-live=\"polite\">\n\t\t\t\t{ customValidity && (\n\t\t\t\t\t<p\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'components-validated-control__indicator',\n\t\t\t\t\t\t\tcustomValidity.type === 'invalid'\n\t\t\t\t\t\t\t\t? 'is-invalid'\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-validated-control__indicator-icon\"\n\t\t\t\t\t\t\ticon={ errorIcon }\n\t\t\t\t\t\t\tsize={ 16 }\n\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ customValidity.message }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction CalendarDateControl< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tmarkWhenOptional,\n\tvalidity,\n}: DataFormControlProps< Item > ) {\n\tconst {\n\t\tid,\n\t\tlabel,\n\t\tsetValue,\n\t\tgetValue,\n\t\tisValid,\n\t\tformat: fieldFormat,\n\t} = field;\n\tconst [ selectedPresetId, setSelectedPresetId ] = useState< string | null >(\n\t\tnull\n\t);\n\n\tconst weekStartsOn =\n\t\t( fieldFormat as FormatDate ).weekStartsOn ??\n\t\tgetSettings().l10n.startOfWeek;\n\n\tconst fieldValue = getValue( { item: data } );\n\tconst value = typeof fieldValue === 'string' ? fieldValue : undefined;\n\tconst [ calendarMonth, setCalendarMonth ] = useState< Date >( () => {\n\t\tconst parsedDate = parseDate( value );\n\t\treturn parsedDate || new Date(); // Default to current month\n\t} );\n\n\tconst [ isTouched, setIsTouched ] = useState( false );\n\tconst validityTargetRef = useRef< HTMLInputElement >( null );\n\n\tconst onChangeCallback = useCallback(\n\t\t( newValue: string | undefined ) =>\n\t\t\tonChange( setValue( { item: data, value: newValue } ) ),\n\t\t[ data, onChange, setValue ]\n\t);\n\n\tconst onSelectDate = useCallback(\n\t\t( newDate: Date | undefined | null ) => {\n\t\t\tconst dateValue = newDate\n\t\t\t\t? format( newDate, 'yyyy-MM-dd' )\n\t\t\t\t: undefined;\n\t\t\tonChangeCallback( dateValue );\n\t\t\tsetSelectedPresetId( null );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ onChangeCallback ]\n\t);\n\n\tconst handlePresetClick = useCallback(\n\t\t( preset: ( typeof DATE_PRESETS )[ 0 ] ) => {\n\t\t\tconst presetDate = preset.getValue();\n\t\t\tconst dateValue = formatDate( presetDate );\n\n\t\t\tsetCalendarMonth( presetDate );\n\t\t\tonChangeCallback( dateValue );\n\t\t\tsetSelectedPresetId( preset.id );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ onChangeCallback ]\n\t);\n\n\tconst handleManualDateChange = useCallback(\n\t\t( newValue?: string ) => {\n\t\t\tonChangeCallback( newValue );\n\t\t\tif ( newValue ) {\n\t\t\t\tconst parsedDate = parseDate( newValue );\n\t\t\t\tif ( parsedDate ) {\n\t\t\t\t\tsetCalendarMonth( parsedDate );\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetSelectedPresetId( null );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ onChangeCallback ]\n\t);\n\n\tconst {\n\t\ttimezone: { string: timezoneString },\n\t} = getSettings();\n\n\tlet displayLabel = label;\n\tif ( isValid?.required && ! markWhenOptional ) {\n\t\tdisplayLabel = `${ label } (${ __( 'Required' ) })`;\n\t} else if ( ! isValid?.required && markWhenOptional ) {\n\t\tdisplayLabel = `${ label } (${ __( 'Optional' ) })`;\n\t}\n\n\treturn (\n\t\t<ValidatedDateControl\n\t\t\tfield={ field }\n\t\t\tvalidity={ validity }\n\t\t\tinputRefs={ validityTargetRef }\n\t\t\tisTouched={ isTouched }\n\t\t\tsetIsTouched={ setIsTouched }\n\t\t>\n\t\t\t<BaseControl\n\t\t\t\tid={ id }\n\t\t\t\tclassName=\"dataviews-controls__date\"\n\t\t\t\tlabel={ displayLabel }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t>\n\t\t\t\t<Stack direction=\"column\" gap=\"lg\">\n\t\t\t\t\t{ /* Preset buttons */ }\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\twrap=\"wrap\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ DATE_PRESETS.map( ( preset ) => {\n\t\t\t\t\t\t\tconst isSelected = selectedPresetId === preset.id;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"dataviews-controls__date-preset\"\n\t\t\t\t\t\t\t\t\tkey={ preset.id }\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tisPressed={ isSelected }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\thandlePresetClick( preset )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ preset.label }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"dataviews-controls__date-preset\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tisPressed={ ! selectedPresetId }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tdisabled={ !! selectedPresetId }\n\t\t\t\t\t\t\taccessibleWhenDisabled={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Custom' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{ /* Manual date input */ }\n\t\t\t\t\t<InputControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tref={ validityTargetRef }\n\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\tlabel={ __( 'Date' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ handleManualDateChange }\n\t\t\t\t\t\trequired={ !! field.isValid?.required }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ /* Calendar widget */ }\n\t\t\t\t\t<DateCalendar\n\t\t\t\t\t\tstyle={ { width: '100%' } }\n\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\tvalue ? parseDate( value ) || undefined : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ onSelectDate }\n\t\t\t\t\t\tmonth={ calendarMonth }\n\t\t\t\t\t\tonMonthChange={ setCalendarMonth }\n\t\t\t\t\t\ttimeZone={ timezoneString || undefined }\n\t\t\t\t\t\tweekStartsOn={ weekStartsOn }\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t</BaseControl>\n\t\t</ValidatedDateControl>\n\t);\n}\n\nfunction CalendarDateRangeControl< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tmarkWhenOptional,\n\tvalidity,\n}: DataFormControlProps< Item > ) {\n\tconst { id, label, getValue, setValue, format: fieldFormat } = field;\n\tlet value: DateRange;\n\tconst fieldValue = getValue( { item: data } );\n\tif (\n\t\tArray.isArray( fieldValue ) &&\n\t\tfieldValue.length === 2 &&\n\t\tfieldValue.every( ( date ) => typeof date === 'string' )\n\t) {\n\t\tvalue = fieldValue as DateRange;\n\t}\n\n\tconst weekStartsOn =\n\t\t( fieldFormat as FormatDate ).weekStartsOn ??\n\t\tgetSettings().l10n.startOfWeek;\n\n\tconst onChangeCallback = useCallback(\n\t\t( newValue: DateRange ) => {\n\t\t\tonChange(\n\t\t\t\tsetValue( {\n\t\t\t\t\titem: data,\n\t\t\t\t\tvalue: newValue,\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t\t[ data, onChange, setValue ]\n\t);\n\n\tconst [ selectedPresetId, setSelectedPresetId ] = useState< string | null >(\n\t\tnull\n\t);\n\n\tconst selectedRange = useMemo( () => {\n\t\tif ( ! value ) {\n\t\t\treturn { from: undefined, to: undefined };\n\t\t}\n\n\t\tconst [ from, to ] = value;\n\t\treturn {\n\t\t\tfrom: parseDate( from ) || undefined,\n\t\t\tto: parseDate( to ) || undefined,\n\t\t};\n\t}, [ value ] );\n\n\tconst [ calendarMonth, setCalendarMonth ] = useState< Date >( () => {\n\t\treturn selectedRange.from || new Date();\n\t} );\n\n\tconst [ isTouched, setIsTouched ] = useState( false );\n\tconst fromInputRef = useRef< HTMLInputElement >( null );\n\tconst toInputRef = useRef< HTMLInputElement >( null );\n\n\tconst updateDateRange = useCallback(\n\t\t( fromDate?: Date | string, toDate?: Date | string ) => {\n\t\t\tif ( fromDate && toDate ) {\n\t\t\t\tonChangeCallback( [\n\t\t\t\t\tformatDate( fromDate ),\n\t\t\t\t\tformatDate( toDate ),\n\t\t\t\t] );\n\t\t\t} else if ( ! fromDate && ! toDate ) {\n\t\t\t\tonChangeCallback( undefined );\n\t\t\t}\n\t\t\t// Do nothing if only one date is set - wait for both\n\t\t},\n\t\t[ onChangeCallback ]\n\t);\n\n\tconst onSelectCalendarRange = useCallback(\n\t\t(\n\t\t\tnewRange:\n\t\t\t\t| { from: Date | undefined; to?: Date | undefined }\n\t\t\t\t| undefined\n\t\t) => {\n\t\t\tupdateDateRange( newRange?.from, newRange?.to );\n\t\t\tsetSelectedPresetId( null );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ updateDateRange ]\n\t);\n\n\tconst handlePresetClick = useCallback(\n\t\t( preset: ( typeof DATE_RANGE_PRESETS )[ 0 ] ) => {\n\t\t\tconst [ startDate, endDate ] = preset.getValue();\n\t\t\tsetCalendarMonth( startDate );\n\t\t\tupdateDateRange( startDate, endDate );\n\t\t\tsetSelectedPresetId( preset.id );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ updateDateRange ]\n\t);\n\n\tconst handleManualDateChange = useCallback(\n\t\t( fromOrTo: 'from' | 'to', newValue?: string ) => {\n\t\t\tconst [ currentFrom, currentTo ] = value || [\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t];\n\t\t\tconst updatedFrom = fromOrTo === 'from' ? newValue : currentFrom;\n\t\t\tconst updatedTo = fromOrTo === 'to' ? newValue : currentTo;\n\n\t\t\tupdateDateRange( updatedFrom, updatedTo );\n\n\t\t\tif ( newValue ) {\n\t\t\t\tconst parsedDate = parseDate( newValue );\n\t\t\t\tif ( parsedDate ) {\n\t\t\t\t\tsetCalendarMonth( parsedDate );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsetSelectedPresetId( null );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ value, updateDateRange ]\n\t);\n\n\tconst { timezone } = getSettings();\n\n\tlet displayLabel = label;\n\tif ( field.isValid?.required && ! markWhenOptional ) {\n\t\tdisplayLabel = `${ label } (${ __( 'Required' ) })`;\n\t} else if ( ! field.isValid?.required && markWhenOptional ) {\n\t\tdisplayLabel = `${ label } (${ __( 'Optional' ) })`;\n\t}\n\n\treturn (\n\t\t<ValidatedDateControl\n\t\t\tfield={ field }\n\t\t\tvalidity={ validity }\n\t\t\tinputRefs={ [ fromInputRef, toInputRef ] }\n\t\t\tisTouched={ isTouched }\n\t\t\tsetIsTouched={ setIsTouched }\n\t\t>\n\t\t\t<BaseControl\n\t\t\t\tid={ id }\n\t\t\t\tclassName=\"dataviews-controls__date\"\n\t\t\t\tlabel={ displayLabel }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t>\n\t\t\t\t<Stack direction=\"column\" gap=\"lg\">\n\t\t\t\t\t{ /* Preset buttons */ }\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\twrap=\"wrap\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ DATE_RANGE_PRESETS.map( ( preset ) => {\n\t\t\t\t\t\t\tconst isSelected = selectedPresetId === preset.id;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"dataviews-controls__date-preset\"\n\t\t\t\t\t\t\t\t\tkey={ preset.id }\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tisPressed={ isSelected }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\thandlePresetClick( preset )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ preset.label }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"dataviews-controls__date-preset\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tisPressed={ ! selectedPresetId }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\taccessibleWhenDisabled={ false }\n\t\t\t\t\t\t\tdisabled={ !! selectedPresetId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Custom' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{ /* Manual date range inputs */ }\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\tjustify=\"space-between\"\n\t\t\t\t\t\tclassName=\"dataviews-controls__date-range-inputs\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ fromInputRef }\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tlabel={ __( 'From' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tvalue={ value?.[ 0 ] }\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\thandleManualDateChange( 'from', newValue )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trequired={ !! field.isValid?.required }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ toInputRef }\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tlabel={ __( 'To' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tvalue={ value?.[ 1 ] }\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\thandleManualDateChange( 'to', newValue )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trequired={ !! field.isValid?.required }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t<DateRangeCalendar\n\t\t\t\t\t\tstyle={ { width: '100%' } }\n\t\t\t\t\t\tselected={ selectedRange }\n\t\t\t\t\t\tonSelect={ onSelectCalendarRange }\n\t\t\t\t\t\tmonth={ calendarMonth }\n\t\t\t\t\t\tonMonthChange={ setCalendarMonth }\n\t\t\t\t\t\ttimeZone={ timezone.string || undefined }\n\t\t\t\t\t\tweekStartsOn={ weekStartsOn }\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t</BaseControl>\n\t\t</ValidatedDateControl>\n\t);\n}\n\nexport default function DateControl< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tmarkWhenOptional,\n\toperator,\n\tvalidity,\n}: DataFormControlProps< Item > ) {\n\tif ( operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER ) {\n\t\treturn (\n\t\t\t<RelativeDateControl\n\t\t\t\tclassName=\"dataviews-controls__date\"\n\t\t\t\tdata={ data }\n\t\t\t\tfield={ field }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\toperator={ operator }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( operator === OPERATOR_BETWEEN ) {\n\t\treturn (\n\t\t\t<CalendarDateRangeControl\n\t\t\t\tdata={ data }\n\t\t\t\tfield={ field }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\t\tvalidity={ validity }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<CalendarDateControl\n\t\t\tdata={ data }\n\t\t\tfield={ field }\n\t\t\tonChange={ onChange }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tvalidity={ validity }\n\t\t/>\n\t);\n}\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport {\n\tformat,\n\tisValid as isValidDate,\n\tsubMonths,\n\tsubDays,\n\tsubYears,\n\tstartOfMonth,\n\tstartOfYear,\n} from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tButton,\n\tIcon,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalInputControl as InputControl,\n} from '@wordpress/components';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { getDate, getSettings } from '@wordpress/date';\nimport { error as errorIcon } from '@wordpress/icons';\nimport { Stack } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport RelativeDateControl from './utils/relative-date-control';\nimport {\n\tOPERATOR_IN_THE_PAST,\n\tOPERATOR_OVER,\n\tOPERATOR_BETWEEN,\n} from '../../constants';\nimport { unlock } from '../../lock-unlock';\nimport type {\n\tDataFormControlProps,\n\tFieldValidity,\n\tFormatDate,\n\tNormalizedField,\n} from '../../types';\nimport getCustomValidity from './utils/get-custom-validity';\n\nconst { DateCalendar, DateRangeCalendar } = unlock( componentsPrivateApis );\n\ntype DateRange = [ string, string ] | undefined;\n\nconst DATE_PRESETS: {\n\tid: string;\n\tlabel: string;\n\tgetValue: () => Date;\n}[] = [\n\t{\n\t\tid: 'today',\n\t\tlabel: __( 'Today' ),\n\t\tgetValue: () => getDate( null ),\n\t},\n\t{\n\t\tid: 'yesterday',\n\t\tlabel: __( 'Yesterday' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn subDays( today, 1 );\n\t\t},\n\t},\n\t{\n\t\tid: 'past-week',\n\t\tlabel: __( 'Past week' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn subDays( today, 7 );\n\t\t},\n\t},\n\t{\n\t\tid: 'past-month',\n\t\tlabel: __( 'Past month' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn subMonths( today, 1 );\n\t\t},\n\t},\n];\n\nconst DATE_RANGE_PRESETS = [\n\t{\n\t\tid: 'last-7-days',\n\t\tlabel: __( 'Last 7 days' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ subDays( today, 7 ), today ];\n\t\t},\n\t},\n\t{\n\t\tid: 'last-30-days',\n\t\tlabel: __( 'Last 30 days' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ subDays( today, 30 ), today ];\n\t\t},\n\t},\n\t{\n\t\tid: 'month-to-date',\n\t\tlabel: __( 'Month to date' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ startOfMonth( today ), today ];\n\t\t},\n\t},\n\t{\n\t\tid: 'last-year',\n\t\tlabel: __( 'Last year' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ subYears( today, 1 ), today ];\n\t\t},\n\t},\n\t{\n\t\tid: 'year-to-date',\n\t\tlabel: __( 'Year to date' ),\n\t\tgetValue: () => {\n\t\t\tconst today = getDate( null );\n\t\t\treturn [ startOfYear( today ), today ];\n\t\t},\n\t},\n];\n\nconst parseDate = ( dateString?: string ): Date | null => {\n\tif ( ! dateString ) {\n\t\treturn null;\n\t}\n\tconst parsed = getDate( dateString );\n\treturn parsed && isValidDate( parsed ) ? parsed : null;\n};\n\nconst formatDate = ( date?: Date | string ): string => {\n\tif ( ! date ) {\n\t\treturn '';\n\t}\n\treturn typeof date === 'string' ? date : format( date, 'yyyy-MM-dd' );\n};\n\nfunction ValidatedDateControl< Item >( {\n\tfield,\n\tvalidity,\n\tinputRefs,\n\tisTouched,\n\tsetIsTouched,\n\tchildren,\n}: {\n\tfield: NormalizedField< Item >;\n\tvalidity?: FieldValidity;\n\tinputRefs:\n\t\t| React.RefObject< HTMLInputElement | null >\n\t\t| React.RefObject< HTMLInputElement | null >[];\n\tisTouched: boolean;\n\tsetIsTouched: ( touched: boolean ) => void;\n\tchildren: React.ReactNode;\n} ) {\n\tconst { isValid } = field;\n\tconst [ customValidity, setCustomValidity ] = useState<\n\t\t| { type: 'valid' | 'validating' | 'invalid'; message?: string }\n\t\t| undefined\n\t>( undefined );\n\n\tconst validateRefs = useCallback( () => {\n\t\t// Check HTML5 validity on all refs\n\t\tconst refs = Array.isArray( inputRefs ) ? inputRefs : [ inputRefs ];\n\t\tfor ( const ref of refs ) {\n\t\t\tconst input = ref.current;\n\t\t\tif ( input && ! input.validity.valid ) {\n\t\t\t\tsetCustomValidity( {\n\t\t\t\t\ttype: 'invalid',\n\t\t\t\t\tmessage: input.validationMessage,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// No errors\n\t\tsetCustomValidity( undefined );\n\t}, [ inputRefs ] );\n\n\t// Sync React-level validation to native inputs.\n\tuseEffect( () => {\n\t\tconst refs = Array.isArray( inputRefs ) ? inputRefs : [ inputRefs ];\n\t\tconst result = validity\n\t\t\t? getCustomValidity( isValid, validity )\n\t\t\t: undefined;\n\t\tfor ( const ref of refs ) {\n\t\t\tconst input = ref.current;\n\t\t\tif ( input ) {\n\t\t\t\tinput.setCustomValidity(\n\t\t\t\t\tresult?.type === 'invalid' && result.message\n\t\t\t\t\t\t? result.message\n\t\t\t\t\t\t: ''\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}, [ inputRefs, isValid, validity ] );\n\n\t// Listen for 'invalid' events (e.g., from reportValidity() on card re-expand).\n\tuseEffect( () => {\n\t\tconst refs = Array.isArray( inputRefs ) ? inputRefs : [ inputRefs ];\n\t\tconst handleInvalid = ( event: Event ) => {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsTouched( true );\n\t\t};\n\t\tfor ( const ref of refs ) {\n\t\t\tref.current?.addEventListener( 'invalid', handleInvalid );\n\t\t}\n\t\treturn () => {\n\t\t\tfor ( const ref of refs ) {\n\t\t\t\tref.current?.removeEventListener( 'invalid', handleInvalid );\n\t\t\t}\n\t\t};\n\t}, [ inputRefs, setIsTouched ] );\n\n\tuseEffect( () => {\n\t\tif ( ! isTouched ) {\n\t\t\treturn;\n\t\t}\n\t\tconst result = validity\n\t\t\t? getCustomValidity( isValid, validity )\n\t\t\t: undefined;\n\t\tif ( result ) {\n\t\t\tsetCustomValidity( result );\n\t\t} else {\n\t\t\tvalidateRefs();\n\t\t}\n\t}, [ isTouched, isValid, validity, validateRefs ] );\n\n\tconst onBlur = ( event: React.FocusEvent< HTMLDivElement > ) => {\n\t\tif ( isTouched ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only consider \"blurred from the component\" if focus has fully left the wrapping div.\n\t\t// This prevents unnecessary blurs from components with multiple focusable elements.\n\t\tif (\n\t\t\t! event.relatedTarget ||\n\t\t\t! event.currentTarget.contains( event.relatedTarget )\n\t\t) {\n\t\t\tsetIsTouched( true );\n\t\t}\n\t};\n\n\treturn (\n\t\t<div onBlur={ onBlur }>\n\t\t\t{ children }\n\t\t\t<div aria-live=\"polite\">\n\t\t\t\t{ customValidity && (\n\t\t\t\t\t<p\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'components-validated-control__indicator',\n\t\t\t\t\t\t\tcustomValidity.type === 'invalid'\n\t\t\t\t\t\t\t\t? 'is-invalid'\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-validated-control__indicator-icon\"\n\t\t\t\t\t\t\ticon={ errorIcon }\n\t\t\t\t\t\t\tsize={ 16 }\n\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ customValidity.message }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction CalendarDateControl< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tmarkWhenOptional,\n\tvalidity,\n}: DataFormControlProps< Item > ) {\n\tconst {\n\t\tid,\n\t\tlabel,\n\t\tsetValue,\n\t\tgetValue,\n\t\tisValid,\n\t\tformat: fieldFormat,\n\t} = field;\n\tconst [ selectedPresetId, setSelectedPresetId ] = useState< string | null >(\n\t\tnull\n\t);\n\n\tconst weekStartsOn =\n\t\t( fieldFormat as FormatDate ).weekStartsOn ??\n\t\tgetSettings().l10n.startOfWeek;\n\n\tconst fieldValue = getValue( { item: data } );\n\tconst value = typeof fieldValue === 'string' ? fieldValue : undefined;\n\tconst [ calendarMonth, setCalendarMonth ] = useState< Date >( () => {\n\t\tconst parsedDate = parseDate( value );\n\t\treturn parsedDate || new Date(); // Default to current month\n\t} );\n\n\tconst [ isTouched, setIsTouched ] = useState( false );\n\tconst validityTargetRef = useRef< HTMLInputElement >( null );\n\n\tconst onChangeCallback = useCallback(\n\t\t( newValue: string | undefined ) =>\n\t\t\tonChange( setValue( { item: data, value: newValue } ) ),\n\t\t[ data, onChange, setValue ]\n\t);\n\n\tconst onSelectDate = useCallback(\n\t\t( newDate: Date | undefined | null ) => {\n\t\t\tconst dateValue = newDate\n\t\t\t\t? format( newDate, 'yyyy-MM-dd' )\n\t\t\t\t: undefined;\n\t\t\tonChangeCallback( dateValue );\n\t\t\tsetSelectedPresetId( null );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ onChangeCallback ]\n\t);\n\n\tconst handlePresetClick = useCallback(\n\t\t( preset: ( typeof DATE_PRESETS )[ 0 ] ) => {\n\t\t\tconst presetDate = preset.getValue();\n\t\t\tconst dateValue = formatDate( presetDate );\n\n\t\t\tsetCalendarMonth( presetDate );\n\t\t\tonChangeCallback( dateValue );\n\t\t\tsetSelectedPresetId( preset.id );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ onChangeCallback ]\n\t);\n\n\tconst handleManualDateChange = useCallback(\n\t\t( newValue?: string ) => {\n\t\t\tonChangeCallback( newValue );\n\t\t\tif ( newValue ) {\n\t\t\t\tconst parsedDate = parseDate( newValue );\n\t\t\t\tif ( parsedDate ) {\n\t\t\t\t\tsetCalendarMonth( parsedDate );\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetSelectedPresetId( null );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ onChangeCallback ]\n\t);\n\n\tconst {\n\t\ttimezone: { string: timezoneString },\n\t} = getSettings();\n\n\tlet displayLabel = label;\n\tif ( isValid?.required && ! markWhenOptional ) {\n\t\tdisplayLabel = `${ label } (${ __( 'Required' ) })`;\n\t} else if ( ! isValid?.required && markWhenOptional ) {\n\t\tdisplayLabel = `${ label } (${ __( 'Optional' ) })`;\n\t}\n\n\treturn (\n\t\t<ValidatedDateControl\n\t\t\tfield={ field }\n\t\t\tvalidity={ validity }\n\t\t\tinputRefs={ validityTargetRef }\n\t\t\tisTouched={ isTouched }\n\t\t\tsetIsTouched={ setIsTouched }\n\t\t>\n\t\t\t<BaseControl\n\t\t\t\tid={ id }\n\t\t\t\tclassName=\"dataviews-controls__date\"\n\t\t\t\tlabel={ displayLabel }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t>\n\t\t\t\t<Stack direction=\"column\" gap=\"lg\">\n\t\t\t\t\t{ /* Preset buttons */ }\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\twrap=\"wrap\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ DATE_PRESETS.map( ( preset ) => {\n\t\t\t\t\t\t\tconst isSelected = selectedPresetId === preset.id;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"dataviews-controls__date-preset\"\n\t\t\t\t\t\t\t\t\tkey={ preset.id }\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tisPressed={ isSelected }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\thandlePresetClick( preset )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ preset.label }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"dataviews-controls__date-preset\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tisPressed={ ! selectedPresetId }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tdisabled={ !! selectedPresetId }\n\t\t\t\t\t\t\taccessibleWhenDisabled={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Custom' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{ /* Manual date input */ }\n\t\t\t\t\t<InputControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tref={ validityTargetRef }\n\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\tlabel={ __( 'Date' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ handleManualDateChange }\n\t\t\t\t\t\trequired={ !! field.isValid?.required }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ /* Calendar widget */ }\n\t\t\t\t\t<DateCalendar\n\t\t\t\t\t\tstyle={ { width: '100%' } }\n\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\tvalue ? parseDate( value ) || undefined : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ onSelectDate }\n\t\t\t\t\t\tmonth={ calendarMonth }\n\t\t\t\t\t\tonMonthChange={ setCalendarMonth }\n\t\t\t\t\t\ttimeZone={ timezoneString || undefined }\n\t\t\t\t\t\tweekStartsOn={ weekStartsOn }\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t</BaseControl>\n\t\t</ValidatedDateControl>\n\t);\n}\n\nfunction CalendarDateRangeControl< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tmarkWhenOptional,\n\tvalidity,\n}: DataFormControlProps< Item > ) {\n\tconst { id, label, getValue, setValue, format: fieldFormat } = field;\n\tlet value: DateRange;\n\tconst fieldValue = getValue( { item: data } );\n\tif (\n\t\tArray.isArray( fieldValue ) &&\n\t\tfieldValue.length === 2 &&\n\t\tfieldValue.every( ( date ) => typeof date === 'string' )\n\t) {\n\t\tvalue = fieldValue as DateRange;\n\t}\n\n\tconst weekStartsOn =\n\t\t( fieldFormat as FormatDate ).weekStartsOn ??\n\t\tgetSettings().l10n.startOfWeek;\n\n\tconst onChangeCallback = useCallback(\n\t\t( newValue: DateRange ) => {\n\t\t\tonChange(\n\t\t\t\tsetValue( {\n\t\t\t\t\titem: data,\n\t\t\t\t\tvalue: newValue,\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t\t[ data, onChange, setValue ]\n\t);\n\n\tconst [ selectedPresetId, setSelectedPresetId ] = useState< string | null >(\n\t\tnull\n\t);\n\n\tconst selectedRange = useMemo( () => {\n\t\tif ( ! value ) {\n\t\t\treturn { from: undefined, to: undefined };\n\t\t}\n\n\t\tconst [ from, to ] = value;\n\t\treturn {\n\t\t\tfrom: parseDate( from ) || undefined,\n\t\t\tto: parseDate( to ) || undefined,\n\t\t};\n\t}, [ value ] );\n\n\tconst [ calendarMonth, setCalendarMonth ] = useState< Date >( () => {\n\t\treturn selectedRange.from || new Date();\n\t} );\n\n\tconst [ isTouched, setIsTouched ] = useState( false );\n\tconst fromInputRef = useRef< HTMLInputElement >( null );\n\tconst toInputRef = useRef< HTMLInputElement >( null );\n\n\tconst updateDateRange = useCallback(\n\t\t( fromDate?: Date | string, toDate?: Date | string ) => {\n\t\t\tif ( fromDate && toDate ) {\n\t\t\t\tonChangeCallback( [\n\t\t\t\t\tformatDate( fromDate ),\n\t\t\t\t\tformatDate( toDate ),\n\t\t\t\t] );\n\t\t\t} else if ( ! fromDate && ! toDate ) {\n\t\t\t\tonChangeCallback( undefined );\n\t\t\t}\n\t\t\t// Do nothing if only one date is set - wait for both\n\t\t},\n\t\t[ onChangeCallback ]\n\t);\n\n\tconst onSelectCalendarRange = useCallback(\n\t\t(\n\t\t\tnewRange:\n\t\t\t\t| { from: Date | undefined; to?: Date | undefined }\n\t\t\t\t| undefined\n\t\t) => {\n\t\t\tupdateDateRange( newRange?.from, newRange?.to );\n\t\t\tsetSelectedPresetId( null );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ updateDateRange ]\n\t);\n\n\tconst handlePresetClick = useCallback(\n\t\t( preset: ( typeof DATE_RANGE_PRESETS )[ 0 ] ) => {\n\t\t\tconst [ startDate, endDate ] = preset.getValue();\n\t\t\tsetCalendarMonth( startDate );\n\t\t\tupdateDateRange( startDate, endDate );\n\t\t\tsetSelectedPresetId( preset.id );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ updateDateRange ]\n\t);\n\n\tconst handleManualDateChange = useCallback(\n\t\t( fromOrTo: 'from' | 'to', newValue?: string ) => {\n\t\t\tconst [ currentFrom, currentTo ] = value || [\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t];\n\t\t\tconst updatedFrom = fromOrTo === 'from' ? newValue : currentFrom;\n\t\t\tconst updatedTo = fromOrTo === 'to' ? newValue : currentTo;\n\n\t\t\tupdateDateRange( updatedFrom, updatedTo );\n\n\t\t\tif ( newValue ) {\n\t\t\t\tconst parsedDate = parseDate( newValue );\n\t\t\t\tif ( parsedDate ) {\n\t\t\t\t\tsetCalendarMonth( parsedDate );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsetSelectedPresetId( null );\n\t\t\tsetIsTouched( true );\n\t\t},\n\t\t[ value, updateDateRange ]\n\t);\n\n\tconst { timezone } = getSettings();\n\n\tlet displayLabel = label;\n\tif ( field.isValid?.required && ! markWhenOptional ) {\n\t\tdisplayLabel = `${ label } (${ __( 'Required' ) })`;\n\t} else if ( ! field.isValid?.required && markWhenOptional ) {\n\t\tdisplayLabel = `${ label } (${ __( 'Optional' ) })`;\n\t}\n\n\treturn (\n\t\t<ValidatedDateControl\n\t\t\tfield={ field }\n\t\t\tvalidity={ validity }\n\t\t\tinputRefs={ [ fromInputRef, toInputRef ] }\n\t\t\tisTouched={ isTouched }\n\t\t\tsetIsTouched={ setIsTouched }\n\t\t>\n\t\t\t<BaseControl\n\t\t\t\tid={ id }\n\t\t\t\tclassName=\"dataviews-controls__date\"\n\t\t\t\tlabel={ displayLabel }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t>\n\t\t\t\t<Stack direction=\"column\" gap=\"lg\">\n\t\t\t\t\t{ /* Preset buttons */ }\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\twrap=\"wrap\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ DATE_RANGE_PRESETS.map( ( preset ) => {\n\t\t\t\t\t\t\tconst isSelected = selectedPresetId === preset.id;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"dataviews-controls__date-preset\"\n\t\t\t\t\t\t\t\t\tkey={ preset.id }\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tisPressed={ isSelected }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\thandlePresetClick( preset )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ preset.label }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"dataviews-controls__date-preset\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tisPressed={ ! selectedPresetId }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\taccessibleWhenDisabled={ false }\n\t\t\t\t\t\t\tdisabled={ !! selectedPresetId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Custom' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t{ /* Manual date range inputs */ }\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\tjustify=\"space-between\"\n\t\t\t\t\t\tclassName=\"dataviews-controls__date-range-inputs\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ fromInputRef }\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tlabel={ __( 'From' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tvalue={ value?.[ 0 ] }\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\thandleManualDateChange( 'from', newValue )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trequired={ !! field.isValid?.required }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ toInputRef }\n\t\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\t\tlabel={ __( 'To' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tvalue={ value?.[ 1 ] }\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\thandleManualDateChange( 'to', newValue )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trequired={ !! field.isValid?.required }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Stack>\n\n\t\t\t\t\t<DateRangeCalendar\n\t\t\t\t\t\tstyle={ { width: '100%' } }\n\t\t\t\t\t\tselected={ selectedRange }\n\t\t\t\t\t\tonSelect={ onSelectCalendarRange }\n\t\t\t\t\t\tmonth={ calendarMonth }\n\t\t\t\t\t\tonMonthChange={ setCalendarMonth }\n\t\t\t\t\t\ttimeZone={ timezone.string || undefined }\n\t\t\t\t\t\tweekStartsOn={ weekStartsOn }\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t</BaseControl>\n\t\t</ValidatedDateControl>\n\t);\n}\n\nexport default function DateControl< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tmarkWhenOptional,\n\toperator,\n\tvalidity,\n}: DataFormControlProps< Item > ) {\n\tif ( operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER ) {\n\t\treturn (\n\t\t\t<RelativeDateControl\n\t\t\t\tclassName=\"dataviews-controls__date\"\n\t\t\t\tdata={ data }\n\t\t\t\tfield={ field }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\toperator={ operator }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( operator === OPERATOR_BETWEEN ) {\n\t\treturn (\n\t\t\t<CalendarDateRangeControl\n\t\t\t\tdata={ data }\n\t\t\t\tfield={ field }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\t\tvalidity={ validity }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<CalendarDateControl\n\t\t\tdata={ data }\n\t\t\tfield={ field }\n\t\t\tonChange={ onChange }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tvalidity={ validity }\n\t\t/>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AACjB,sBAQO;AAKP,wBAMO;AACP,qBAMO;AACP,kBAAmB;AACnB,kBAAqC;AACrC,mBAAmC;AACnC,gBAAsB;AAKtB,mCAAgC;AAChC,uBAIO;AACP,yBAAuB;AAOvB,iCAA8B;AAkNzB;AAhNL,IAAM,EAAE,cAAc,kBAAkB,QAAI,2BAAQ,kBAAAA,WAAsB;AAI1E,IAAM,eAIA;AAAA,EACL;AAAA,IACC,IAAI;AAAA,IACJ,WAAO,gBAAI,OAAQ;AAAA,IACnB,UAAU,UAAM,qBAAS,IAAK;AAAA,EAC/B;AAAA,EACA;AAAA,IACC,IAAI;AAAA,IACJ,WAA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,UAAW,CAAC,CAAE,MAAM,SAAS;AAAA;AAAA,kBAC9B;AAAA;AAAA;AAAA,YACD;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACA,OAAQ,EAAE,OAAO,OAAO;AAAA,gBACxB,UAAW;AAAA,gBACX,UAAW;AAAA,gBACX,OAAQ;AAAA,gBACR,eAAgB;AAAA,gBAChB,UAAW,SAAS,UAAU;AAAA,gBAC9B;AAAA;AAAA,YACD;AAAA,aACD;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;AAEe,SAAR,YAAsC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAkC;AACjC,MAAK,aAAa,yCAAwB,aAAa,gCAAgB;AACtE,WACC;AAAA,MAAC,6BAAAC;AAAA,MAAA;AAAA,QACA,WAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,EAEF;AAEA,MAAK,aAAa,mCAAmB;AACpC,WACC;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,EAEF;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["componentsPrivateApis", "isValidDate", "getCustomValidity", "clsx", "errorIcon", "InputControl", "RelativeDateControl"]
|
|
7
7
|
}
|
|
@@ -33,7 +33,6 @@ __export(datetime_exports, {
|
|
|
33
33
|
default: () => DateTime
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(datetime_exports);
|
|
36
|
-
var import_date_fns = require("date-fns");
|
|
37
36
|
var import_components = require("@wordpress/components");
|
|
38
37
|
var import_element = require("@wordpress/element");
|
|
39
38
|
var import_i18n = require("@wordpress/i18n");
|
|
@@ -46,14 +45,11 @@ var import_parse_date_time = __toESM(require("../../field-types/utils/parse-date
|
|
|
46
45
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
47
46
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
47
|
var { DateCalendar, ValidatedInputControl } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
49
|
-
var formatDateTime = (
|
|
50
|
-
if (!
|
|
48
|
+
var formatDateTime = (value) => {
|
|
49
|
+
if (!value) {
|
|
51
50
|
return "";
|
|
52
51
|
}
|
|
53
|
-
|
|
54
|
-
return date;
|
|
55
|
-
}
|
|
56
|
-
return (0, import_date_fns.format)(date, "yyyy-MM-dd'T'HH:mm");
|
|
52
|
+
return (0, import_date.dateI18n)("Y-m-d\\TH:i", (0, import_date.getDate)(value));
|
|
57
53
|
};
|
|
58
54
|
function CalendarDateTimeControl({
|
|
59
55
|
data,
|
|
@@ -71,7 +67,7 @@ function CalendarDateTimeControl({
|
|
|
71
67
|
return parsedDate || /* @__PURE__ */ new Date();
|
|
72
68
|
});
|
|
73
69
|
const inputControlRef = (0, import_element.useRef)(null);
|
|
74
|
-
const validationTimeoutRef = (0, import_element.useRef)();
|
|
70
|
+
const validationTimeoutRef = (0, import_element.useRef)(void 0);
|
|
75
71
|
const previousFocusRef = (0, import_element.useRef)(null);
|
|
76
72
|
const onChangeCallback = (0, import_element.useCallback)(
|
|
77
73
|
(newValue) => onChange(setValue({ item: data, value: newValue })),
|
|
@@ -88,17 +84,14 @@ function CalendarDateTimeControl({
|
|
|
88
84
|
(newDate) => {
|
|
89
85
|
let dateTimeValue;
|
|
90
86
|
if (newDate) {
|
|
91
|
-
|
|
87
|
+
const wpDate = (0, import_date.dateI18n)("Y-m-d", newDate);
|
|
88
|
+
let wpTime;
|
|
92
89
|
if (value) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
finalDateTime.setHours(currentDateTime.getHours());
|
|
97
|
-
finalDateTime.setMinutes(
|
|
98
|
-
currentDateTime.getMinutes()
|
|
99
|
-
);
|
|
100
|
-
}
|
|
90
|
+
wpTime = (0, import_date.dateI18n)("H:i", (0, import_date.getDate)(value));
|
|
91
|
+
} else {
|
|
92
|
+
wpTime = (0, import_date.dateI18n)("H:i", newDate);
|
|
101
93
|
}
|
|
94
|
+
const finalDateTime = (0, import_date.getDate)(`${wpDate}T${wpTime}`);
|
|
102
95
|
dateTimeValue = finalDateTime.toISOString();
|
|
103
96
|
onChangeCallback(dateTimeValue);
|
|
104
97
|
if (validationTimeoutRef.current) {
|
|
@@ -124,7 +117,7 @@ function CalendarDateTimeControl({
|
|
|
124
117
|
const handleManualDateTimeChange = (0, import_element.useCallback)(
|
|
125
118
|
(newValue) => {
|
|
126
119
|
if (newValue) {
|
|
127
|
-
const dateTime =
|
|
120
|
+
const dateTime = (0, import_date.getDate)(newValue);
|
|
128
121
|
onChangeCallback(dateTime.toISOString());
|
|
129
122
|
const parsedDate = (0, import_parse_date_time.default)(dateTime.toISOString());
|
|
130
123
|
if (parsedDate) {
|
|
@@ -177,9 +170,7 @@ function CalendarDateTimeControl({
|
|
|
177
170
|
type: "datetime-local",
|
|
178
171
|
label: (0, import_i18n.__)("Date time"),
|
|
179
172
|
hideLabelFromVision: true,
|
|
180
|
-
value:
|
|
181
|
-
(0, import_parse_date_time.default)(value) || void 0
|
|
182
|
-
) : "",
|
|
173
|
+
value: formatDateTime(value),
|
|
183
174
|
onChange: handleManualDateTimeChange
|
|
184
175
|
}
|
|
185
176
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dataform-controls/datetime.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n *
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { dateI18n, getDate, getSettings } from '@wordpress/date';\nimport { Stack } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport type { DataFormControlProps, FormatDatetime } from '../../types';\nimport { OPERATOR_IN_THE_PAST, OPERATOR_OVER } from '../../constants';\nimport RelativeDateControl from './utils/relative-date-control';\nimport getCustomValidity from './utils/get-custom-validity';\nimport parseDateTime from '../../field-types/utils/parse-date-time';\nimport { unlock } from '../../lock-unlock';\n\nconst { DateCalendar, ValidatedInputControl } = unlock( componentsPrivateApis );\n\nconst formatDateTime = ( value?: string ): string => {\n\tif ( ! value ) {\n\t\treturn '';\n\t}\n\t// Format in WordPress timezone for datetime-local input: YYYY-MM-DDTHH:mm\n\treturn dateI18n( 'Y-m-d\\\\TH:i', getDate( value ) );\n};\n\nfunction CalendarDateTimeControl< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tmarkWhenOptional,\n\tvalidity,\n}: DataFormControlProps< Item > ) {\n\tconst { id, label, description, setValue, getValue, isValid } = field;\n\tconst fieldValue = getValue( { item: data } );\n\tconst value = typeof fieldValue === 'string' ? fieldValue : undefined;\n\n\tconst [ calendarMonth, setCalendarMonth ] = useState< Date >( () => {\n\t\tconst parsedDate = parseDateTime( value );\n\t\treturn parsedDate || new Date(); // Default to current month\n\t} );\n\n\tconst inputControlRef = useRef< HTMLInputElement >( null );\n\tconst validationTimeoutRef =\n\t\tuseRef< ReturnType< typeof setTimeout > >( undefined );\n\tconst previousFocusRef = useRef< Element | null >( null );\n\n\tconst onChangeCallback = useCallback(\n\t\t( newValue: string | undefined ) =>\n\t\t\tonChange( setValue( { item: data, value: newValue } ) ),\n\t\t[ data, onChange, setValue ]\n\t);\n\n\t// Cleanup timeout on unmount\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tif ( validationTimeoutRef.current ) {\n\t\t\t\tclearTimeout( validationTimeoutRef.current );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tconst onSelectDate = useCallback(\n\t\t( newDate: Date | undefined | null ) => {\n\t\t\tlet dateTimeValue: string | undefined;\n\t\t\tif ( newDate ) {\n\t\t\t\t// Extract the date part in WP timezone from the calendar selection\n\t\t\t\tconst wpDate = dateI18n( 'Y-m-d', newDate );\n\n\t\t\t\t// Preserve time if it exists in current value, otherwise use current time\n\t\t\t\tlet wpTime: string;\n\t\t\t\tif ( value ) {\n\t\t\t\t\twpTime = dateI18n( 'H:i', getDate( value ) );\n\t\t\t\t} else {\n\t\t\t\t\twpTime = dateI18n( 'H:i', newDate );\n\t\t\t\t}\n\n\t\t\t\t// Combine date and time in WP timezone and convert to ISO\n\t\t\t\tconst finalDateTime = getDate( `${ wpDate }T${ wpTime }` );\n\t\t\t\tdateTimeValue = finalDateTime.toISOString();\n\t\t\t\tonChangeCallback( dateTimeValue );\n\n\t\t\t\t// Clear any existing timeout\n\t\t\t\tif ( validationTimeoutRef.current ) {\n\t\t\t\t\tclearTimeout( validationTimeoutRef.current );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tonChangeCallback( undefined );\n\t\t\t}\n\t\t\t// Save the currently focused element\n\t\t\tpreviousFocusRef.current =\n\t\t\t\tinputControlRef.current &&\n\t\t\t\tinputControlRef.current.ownerDocument.activeElement;\n\n\t\t\t// Trigger validation display by simulating focus, blur, and changes.\n\t\t\t// Use a timeout to ensure it runs after the value update.\n\t\t\tvalidationTimeoutRef.current = setTimeout( () => {\n\t\t\t\tif ( inputControlRef.current ) {\n\t\t\t\t\tinputControlRef.current.focus();\n\t\t\t\t\tinputControlRef.current.blur();\n\t\t\t\t\tonChangeCallback( dateTimeValue );\n\n\t\t\t\t\t// Restore focus to the previously focused element\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreviousFocusRef.current &&\n\t\t\t\t\t\tpreviousFocusRef.current instanceof HTMLElement\n\t\t\t\t\t) {\n\t\t\t\t\t\tpreviousFocusRef.current.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0 );\n\t\t},\n\t\t[ onChangeCallback, value ]\n\t);\n\n\tconst handleManualDateTimeChange = useCallback(\n\t\t( newValue?: string ) => {\n\t\t\tif ( newValue ) {\n\t\t\t\t// Interpret the datetime-local value in WordPress timezone\n\t\t\t\tconst dateTime = getDate( newValue );\n\t\t\t\tonChangeCallback( dateTime.toISOString() );\n\n\t\t\t\t// Update calendar month to match\n\t\t\t\tconst parsedDate = parseDateTime( dateTime.toISOString() );\n\t\t\t\tif ( parsedDate ) {\n\t\t\t\t\tsetCalendarMonth( parsedDate );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tonChangeCallback( undefined );\n\t\t\t}\n\t\t},\n\t\t[ onChangeCallback ]\n\t);\n\n\tconst { format: fieldFormat } = field;\n\tconst weekStartsOn =\n\t\t( fieldFormat as FormatDatetime ).weekStartsOn ??\n\t\tgetSettings().l10n.startOfWeek;\n\tconst {\n\t\ttimezone: { string: timezoneString },\n\t} = getSettings();\n\n\tlet displayLabel = label;\n\tif ( isValid?.required && ! markWhenOptional && ! hideLabelFromVision ) {\n\t\tdisplayLabel = `${ label } (${ __( 'Required' ) })`;\n\t} else if (\n\t\t! isValid?.required &&\n\t\tmarkWhenOptional &&\n\t\t! hideLabelFromVision\n\t) {\n\t\tdisplayLabel = `${ label } (${ __( 'Optional' ) })`;\n\t}\n\n\treturn (\n\t\t<BaseControl\n\t\t\tid={ id }\n\t\t\tlabel={ displayLabel }\n\t\t\thelp={ description }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t>\n\t\t\t<Stack direction=\"column\" gap=\"lg\">\n\t\t\t\t{ /* Calendar widget */ }\n\t\t\t\t<DateCalendar\n\t\t\t\t\tstyle={ { width: '100%' } }\n\t\t\t\t\tselected={\n\t\t\t\t\t\tvalue ? parseDateTime( value ) || undefined : undefined\n\t\t\t\t\t}\n\t\t\t\t\tonSelect={ onSelectDate }\n\t\t\t\t\tmonth={ calendarMonth }\n\t\t\t\t\tonMonthChange={ setCalendarMonth }\n\t\t\t\t\ttimeZone={ timezoneString || undefined }\n\t\t\t\t\tweekStartsOn={ weekStartsOn }\n\t\t\t\t/>\n\t\t\t\t{ /* Manual datetime input */ }\n\t\t\t\t<ValidatedInputControl\n\t\t\t\t\tref={ inputControlRef }\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\trequired={ !! isValid?.required }\n\t\t\t\t\tcustomValidity={ getCustomValidity( isValid, validity ) }\n\t\t\t\t\ttype=\"datetime-local\"\n\t\t\t\t\tlabel={ __( 'Date time' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tvalue={ formatDateTime( value ) }\n\t\t\t\t\tonChange={ handleManualDateTimeChange }\n\t\t\t\t/>\n\t\t\t</Stack>\n\t\t</BaseControl>\n\t);\n}\n\nexport default function DateTime< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tmarkWhenOptional,\n\toperator,\n\tvalidity,\n}: DataFormControlProps< Item > ) {\n\tif ( operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER ) {\n\t\treturn (\n\t\t\t<RelativeDateControl\n\t\t\t\tclassName=\"dataviews-controls__datetime\"\n\t\t\t\tdata={ data }\n\t\t\t\tfield={ field }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\toperator={ operator }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<CalendarDateTimeControl\n\t\t\tdata={ data }\n\t\t\tfield={ field }\n\t\t\tonChange={ onChange }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tvalidity={ validity }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;A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