@wordpress/dataviews 13.0.0 → 13.1.1-next.v.202603102151.0
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 +17 -0
- package/build/components/dataform-controls/date.cjs +11 -1
- package/build/components/dataform-controls/date.cjs.map +2 -2
- package/build/components/dataform-controls/datetime.cjs +23 -32
- package/build/components/dataform-controls/datetime.cjs.map +2 -2
- package/build/components/dataform-controls/utils/relative-date-control.cjs +2 -1
- package/build/components/dataform-controls/utils/relative-date-control.cjs.map +2 -2
- package/build/components/dataform-layouts/normalize-form.cjs +19 -1
- package/build/components/dataform-layouts/normalize-form.cjs.map +2 -2
- package/build/components/dataform-layouts/panel/index.cjs +1 -1
- package/build/components/dataform-layouts/panel/index.cjs.map +2 -2
- package/build/components/dataform-layouts/panel/modal.cjs +4 -3
- package/build/components/dataform-layouts/panel/modal.cjs.map +2 -2
- package/build/components/dataviews-layouts/table/index.cjs +1 -1
- package/build/components/dataviews-layouts/table/index.cjs.map +2 -2
- package/build/types/dataform.cjs.map +1 -1
- package/build-module/components/dataform-controls/date.mjs +11 -1
- package/build-module/components/dataform-controls/date.mjs.map +2 -2
- package/build-module/components/dataform-controls/datetime.mjs +24 -33
- package/build-module/components/dataform-controls/datetime.mjs.map +2 -2
- package/build-module/components/dataform-controls/utils/relative-date-control.mjs +2 -1
- package/build-module/components/dataform-controls/utils/relative-date-control.mjs.map +2 -2
- package/build-module/components/dataform-layouts/normalize-form.mjs +19 -1
- package/build-module/components/dataform-layouts/normalize-form.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/index.mjs +1 -1
- package/build-module/components/dataform-layouts/panel/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/modal.mjs +4 -3
- package/build-module/components/dataform-layouts/panel/modal.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/table/index.mjs +1 -1
- package/build-module/components/dataviews-layouts/table/index.mjs.map +2 -2
- package/build-style/style-rtl.css +1 -1
- package/build-style/style.css +1 -1
- package/build-types/components/dataform-controls/date.d.ts.map +1 -1
- package/build-types/components/dataform-controls/datetime.d.ts.map +1 -1
- package/build-types/components/dataform-controls/utils/relative-date-control.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/modal.d.ts.map +1 -1
- package/build-types/dataform/stories/index.story.d.ts +26 -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/types/dataform.d.ts +17 -2
- package/build-types/types/dataform.d.ts.map +1 -1
- package/build-wp/index.js +290 -318
- package/package.json +16 -16
- package/src/components/dataform-controls/date.tsx +11 -1
- package/src/components/dataform-controls/datetime.tsx +28 -44
- package/src/components/dataform-controls/utils/relative-date-control.tsx +2 -1
- package/src/components/dataform-layouts/normalize-form.ts +24 -1
- package/src/components/dataform-layouts/panel/index.tsx +1 -1
- package/src/components/dataform-layouts/panel/modal.tsx +7 -3
- package/src/components/dataform-layouts/panel/style.scss +1 -1
- package/src/components/dataform-layouts/test/normalize-form.ts +98 -5
- package/src/components/dataviews-layouts/table/index.tsx +1 -1
- package/src/dataform/stories/index.story.tsx +15 -0
- package/src/dataform/stories/layout-panel.tsx +19 -4
- package/src/types/dataform.ts +15 -2
package/build-wp/index.js
CHANGED
|
@@ -734,7 +734,41 @@ function useConstrainedTabbing() {
|
|
|
734
734
|
var use_constrained_tabbing_default = useConstrainedTabbing;
|
|
735
735
|
|
|
736
736
|
// ../compose/build-module/hooks/use-copy-to-clipboard/index.mjs
|
|
737
|
-
|
|
737
|
+
async function copyToClipboard(text, trigger) {
|
|
738
|
+
if (!trigger) {
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
const { ownerDocument } = trigger;
|
|
742
|
+
if (!ownerDocument) {
|
|
743
|
+
return false;
|
|
744
|
+
}
|
|
745
|
+
const { defaultView } = ownerDocument;
|
|
746
|
+
try {
|
|
747
|
+
if (defaultView?.navigator?.clipboard?.writeText) {
|
|
748
|
+
await defaultView.navigator.clipboard.writeText(text);
|
|
749
|
+
return true;
|
|
750
|
+
}
|
|
751
|
+
const textarea = ownerDocument.createElement("textarea");
|
|
752
|
+
textarea.value = text;
|
|
753
|
+
textarea.setAttribute("readonly", "");
|
|
754
|
+
textarea.style.position = "fixed";
|
|
755
|
+
textarea.style.left = "-9999px";
|
|
756
|
+
textarea.style.top = "-9999px";
|
|
757
|
+
ownerDocument.body.appendChild(textarea);
|
|
758
|
+
textarea.select();
|
|
759
|
+
const success = ownerDocument.execCommand("copy");
|
|
760
|
+
textarea.remove();
|
|
761
|
+
return success;
|
|
762
|
+
} catch {
|
|
763
|
+
return false;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
function clearSelection(trigger) {
|
|
767
|
+
if ("focus" in trigger && typeof trigger.focus === "function") {
|
|
768
|
+
trigger.focus();
|
|
769
|
+
}
|
|
770
|
+
trigger.ownerDocument?.defaultView?.getSelection()?.removeAllRanges();
|
|
771
|
+
}
|
|
738
772
|
function useUpdatedRef(value) {
|
|
739
773
|
const ref = useRef(value);
|
|
740
774
|
useLayoutEffect(() => {
|
|
@@ -746,19 +780,24 @@ function useCopyToClipboard(text, onSuccess) {
|
|
|
746
780
|
const textRef = useUpdatedRef(text);
|
|
747
781
|
const onSuccessRef = useUpdatedRef(onSuccess);
|
|
748
782
|
return useRefEffect((node) => {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
783
|
+
let isActive = true;
|
|
784
|
+
const handleClick = async () => {
|
|
785
|
+
const textToCopy = typeof textRef.current === "function" ? textRef.current() : textRef.current || "";
|
|
786
|
+
const success = await copyToClipboard(textToCopy, node);
|
|
787
|
+
if (!isActive) {
|
|
788
|
+
return;
|
|
752
789
|
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
790
|
+
if (success) {
|
|
791
|
+
clearSelection(node);
|
|
792
|
+
if (onSuccessRef.current) {
|
|
793
|
+
onSuccessRef.current();
|
|
794
|
+
}
|
|
758
795
|
}
|
|
759
|
-
}
|
|
796
|
+
};
|
|
797
|
+
node.addEventListener("click", handleClick);
|
|
760
798
|
return () => {
|
|
761
|
-
|
|
799
|
+
isActive = false;
|
|
800
|
+
node.removeEventListener("click", handleClick);
|
|
762
801
|
};
|
|
763
802
|
}, []);
|
|
764
803
|
}
|
|
@@ -1298,7 +1337,7 @@ function addContainer(ariaLive = "polite") {
|
|
|
1298
1337
|
container.className = "a11y-speak-region";
|
|
1299
1338
|
container.setAttribute(
|
|
1300
1339
|
"style",
|
|
1301
|
-
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
|
1340
|
+
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;word-break:normal !important;"
|
|
1302
1341
|
);
|
|
1303
1342
|
container.setAttribute("aria-live", ariaLive);
|
|
1304
1343
|
container.setAttribute("aria-relevant", "additions text");
|
|
@@ -1319,7 +1358,7 @@ function addIntroText() {
|
|
|
1319
1358
|
introText.textContent = __2("Notifications");
|
|
1320
1359
|
introText.setAttribute(
|
|
1321
1360
|
"style",
|
|
1322
|
-
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
|
1361
|
+
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;word-break:normal !important;"
|
|
1323
1362
|
);
|
|
1324
1363
|
introText.setAttribute("hidden", "");
|
|
1325
1364
|
const { body } = document;
|
|
@@ -1765,7 +1804,7 @@ var dataviews_context_default = DataViewsContext;
|
|
|
1765
1804
|
import { __ as __35, isRTL as isRTL12 } from "@wordpress/i18n";
|
|
1766
1805
|
|
|
1767
1806
|
// src/components/dataviews-layouts/table/index.tsx
|
|
1768
|
-
import
|
|
1807
|
+
import clsx32 from "clsx";
|
|
1769
1808
|
import { __ as __23, sprintf as sprintf6, isRTL as isRTL10 } from "@wordpress/i18n";
|
|
1770
1809
|
|
|
1771
1810
|
// ../components/build-module/composite/index.mjs
|
|
@@ -2753,7 +2792,7 @@ function UnforwardedTooltip(props, ref) {
|
|
|
2753
2792
|
alternative: "`placement` prop"
|
|
2754
2793
|
});
|
|
2755
2794
|
}
|
|
2756
|
-
computedPlacement = computedPlacement || "
|
|
2795
|
+
computedPlacement = computedPlacement || "top";
|
|
2757
2796
|
const tooltipStore = Ariakit8.useTooltipStore({
|
|
2758
2797
|
placement: computedPlacement,
|
|
2759
2798
|
showTimeout: delay
|
|
@@ -2989,7 +3028,8 @@ var visuallyHidden = {
|
|
|
2989
3028
|
padding: 0,
|
|
2990
3029
|
position: "absolute",
|
|
2991
3030
|
width: "1px",
|
|
2992
|
-
wordWrap: "normal"
|
|
3031
|
+
wordWrap: "normal",
|
|
3032
|
+
wordBreak: "normal"
|
|
2993
3033
|
};
|
|
2994
3034
|
|
|
2995
3035
|
// ../components/build-module/view/component.mjs
|
|
@@ -12371,97 +12411,9 @@ var {
|
|
|
12371
12411
|
unlock: unlock2
|
|
12372
12412
|
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", "@wordpress/components");
|
|
12373
12413
|
|
|
12374
|
-
// ../components/build-module/
|
|
12414
|
+
// ../components/build-module/badge/index.mjs
|
|
12375
12415
|
import clsx30 from "clsx";
|
|
12376
12416
|
import { jsx as _jsx107, jsxs as _jsxs32 } from "react/jsx-runtime";
|
|
12377
|
-
function Avatar({
|
|
12378
|
-
className: className2,
|
|
12379
|
-
src,
|
|
12380
|
-
name,
|
|
12381
|
-
label,
|
|
12382
|
-
badge = false,
|
|
12383
|
-
size: size3 = "default",
|
|
12384
|
-
borderColor: borderColor2,
|
|
12385
|
-
status,
|
|
12386
|
-
statusIndicator,
|
|
12387
|
-
style,
|
|
12388
|
-
...props
|
|
12389
|
-
}) {
|
|
12390
|
-
const showBadge = badge && !!name;
|
|
12391
|
-
const initials = name ? name.split(/\s+/).slice(0, 2).map((word) => word[0]).join("").toUpperCase() : void 0;
|
|
12392
|
-
const customProperties = {
|
|
12393
|
-
...style,
|
|
12394
|
-
...src ? {
|
|
12395
|
-
"--components-avatar-url": `url(${src})`
|
|
12396
|
-
} : {},
|
|
12397
|
-
...borderColor2 ? {
|
|
12398
|
-
"--components-avatar-outline-color": borderColor2
|
|
12399
|
-
} : {}
|
|
12400
|
-
};
|
|
12401
|
-
const avatar = /* @__PURE__ */ _jsxs32("div", {
|
|
12402
|
-
className: clsx30("components-avatar", className2, {
|
|
12403
|
-
"has-avatar-border-color": !!borderColor2,
|
|
12404
|
-
"has-src": !!src,
|
|
12405
|
-
"has-badge": showBadge,
|
|
12406
|
-
"is-small": size3 === "small",
|
|
12407
|
-
"has-status": !!status,
|
|
12408
|
-
[`is-${status}`]: !!status
|
|
12409
|
-
}),
|
|
12410
|
-
style: customProperties,
|
|
12411
|
-
role: "img",
|
|
12412
|
-
"aria-label": name,
|
|
12413
|
-
...props,
|
|
12414
|
-
children: [/* @__PURE__ */ _jsxs32("span", {
|
|
12415
|
-
className: "components-avatar__image",
|
|
12416
|
-
children: [!src && initials, !!status && !!statusIndicator && /* @__PURE__ */ _jsx107("span", {
|
|
12417
|
-
className: "components-avatar__status-indicator",
|
|
12418
|
-
children: /* @__PURE__ */ _jsx107(icon_default2, {
|
|
12419
|
-
icon: statusIndicator
|
|
12420
|
-
})
|
|
12421
|
-
})]
|
|
12422
|
-
}), showBadge && /* @__PURE__ */ _jsx107("span", {
|
|
12423
|
-
className: "components-avatar__name",
|
|
12424
|
-
children: label || name
|
|
12425
|
-
})]
|
|
12426
|
-
});
|
|
12427
|
-
if (name && (!showBadge || label)) {
|
|
12428
|
-
return /* @__PURE__ */ _jsx107(tooltip_default, {
|
|
12429
|
-
text: name,
|
|
12430
|
-
children: avatar
|
|
12431
|
-
});
|
|
12432
|
-
}
|
|
12433
|
-
return avatar;
|
|
12434
|
-
}
|
|
12435
|
-
var component_default24 = Avatar;
|
|
12436
|
-
|
|
12437
|
-
// ../components/build-module/avatar-group/component.mjs
|
|
12438
|
-
import clsx31 from "clsx";
|
|
12439
|
-
import { jsx as _jsx108, jsxs as _jsxs33 } from "react/jsx-runtime";
|
|
12440
|
-
function AvatarGroup({
|
|
12441
|
-
className: className2,
|
|
12442
|
-
max = 3,
|
|
12443
|
-
children,
|
|
12444
|
-
...props
|
|
12445
|
-
}) {
|
|
12446
|
-
const childArray = Children.toArray(children);
|
|
12447
|
-
const visible = childArray.slice(0, max);
|
|
12448
|
-
const overflowCount = childArray.length - max;
|
|
12449
|
-
return /* @__PURE__ */ _jsxs33("div", {
|
|
12450
|
-
role: "group",
|
|
12451
|
-
className: clsx31("components-avatar-group", className2),
|
|
12452
|
-
...props,
|
|
12453
|
-
children: [visible, overflowCount > 0 && /* @__PURE__ */ _jsx108("span", {
|
|
12454
|
-
className: "components-avatar-group__overflow",
|
|
12455
|
-
"aria-label": `${overflowCount} more`,
|
|
12456
|
-
children: `+${overflowCount}`
|
|
12457
|
-
})]
|
|
12458
|
-
});
|
|
12459
|
-
}
|
|
12460
|
-
var component_default25 = AvatarGroup;
|
|
12461
|
-
|
|
12462
|
-
// ../components/build-module/badge/index.mjs
|
|
12463
|
-
import clsx32 from "clsx";
|
|
12464
|
-
import { jsx as _jsx109, jsxs as _jsxs34 } from "react/jsx-runtime";
|
|
12465
12417
|
function contextBasedIcon(intent = "default") {
|
|
12466
12418
|
switch (intent) {
|
|
12467
12419
|
case "info":
|
|
@@ -12484,20 +12436,20 @@ function Badge3({
|
|
|
12484
12436
|
}) {
|
|
12485
12437
|
const icon = contextBasedIcon(intent);
|
|
12486
12438
|
const hasIcon = !!icon;
|
|
12487
|
-
return /* @__PURE__ */
|
|
12488
|
-
className:
|
|
12439
|
+
return /* @__PURE__ */ _jsx107("span", {
|
|
12440
|
+
className: clsx30("components-badge", className2, {
|
|
12489
12441
|
[`is-${intent}`]: intent,
|
|
12490
12442
|
"has-icon": hasIcon
|
|
12491
12443
|
}),
|
|
12492
12444
|
...props,
|
|
12493
|
-
children: /* @__PURE__ */
|
|
12445
|
+
children: /* @__PURE__ */ _jsxs32("span", {
|
|
12494
12446
|
className: "components-badge__flex-wrapper",
|
|
12495
|
-
children: [hasIcon && /* @__PURE__ */
|
|
12447
|
+
children: [hasIcon && /* @__PURE__ */ _jsx107(icon_default2, {
|
|
12496
12448
|
icon,
|
|
12497
12449
|
size: 16,
|
|
12498
12450
|
fill: "currentColor",
|
|
12499
12451
|
className: "components-badge__icon"
|
|
12500
|
-
}), /* @__PURE__ */
|
|
12452
|
+
}), /* @__PURE__ */ _jsx107("span", {
|
|
12501
12453
|
className: "components-badge__content",
|
|
12502
12454
|
children
|
|
12503
12455
|
})]
|
|
@@ -12514,9 +12466,9 @@ import { DayPicker } from "react-day-picker";
|
|
|
12514
12466
|
import { enUS } from "react-day-picker/locale";
|
|
12515
12467
|
|
|
12516
12468
|
// ../components/build-module/calendar/utils/day-cell.mjs
|
|
12517
|
-
import { jsx as
|
|
12469
|
+
import { jsx as _jsx108, jsxs as _jsxs33 } from "react/jsx-runtime";
|
|
12518
12470
|
var PreviewDashStartAndEnd = () => {
|
|
12519
|
-
return /* @__PURE__ */
|
|
12471
|
+
return /* @__PURE__ */ _jsx108("svg", {
|
|
12520
12472
|
viewBox: "0 0 32 32",
|
|
12521
12473
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12522
12474
|
fill: "none",
|
|
@@ -12524,13 +12476,13 @@ var PreviewDashStartAndEnd = () => {
|
|
|
12524
12476
|
strokeDasharray: "3.7677",
|
|
12525
12477
|
strokeDashoffset: "3.2",
|
|
12526
12478
|
strokeWidth: "1",
|
|
12527
|
-
children: /* @__PURE__ */
|
|
12479
|
+
children: /* @__PURE__ */ _jsx108("path", {
|
|
12528
12480
|
d: "M29.5,0.5 h-27 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h27 a2,2 0 0 0 2,-2 v-27 a2,2 0 0 0 -2,-2"
|
|
12529
12481
|
})
|
|
12530
12482
|
});
|
|
12531
12483
|
};
|
|
12532
12484
|
var PreviewDashStart = () => {
|
|
12533
|
-
return /* @__PURE__ */
|
|
12485
|
+
return /* @__PURE__ */ _jsx108("svg", {
|
|
12534
12486
|
viewBox: "0 0 32 32",
|
|
12535
12487
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12536
12488
|
fill: "none",
|
|
@@ -12538,13 +12490,13 @@ var PreviewDashStart = () => {
|
|
|
12538
12490
|
strokeDasharray: "3.84516",
|
|
12539
12491
|
strokeDashoffset: "1.9226",
|
|
12540
12492
|
strokeWidth: "1",
|
|
12541
|
-
children: /* @__PURE__ */
|
|
12493
|
+
children: /* @__PURE__ */ _jsx108("path", {
|
|
12542
12494
|
d: "M32,0.5 h-29.5 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h30"
|
|
12543
12495
|
})
|
|
12544
12496
|
});
|
|
12545
12497
|
};
|
|
12546
12498
|
var PreviewDashMiddle = () => {
|
|
12547
|
-
return /* @__PURE__ */
|
|
12499
|
+
return /* @__PURE__ */ _jsxs33("svg", {
|
|
12548
12500
|
viewBox: "0 0 32 32",
|
|
12549
12501
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12550
12502
|
fill: "none",
|
|
@@ -12552,12 +12504,12 @@ var PreviewDashMiddle = () => {
|
|
|
12552
12504
|
strokeDasharray: "3.9 4",
|
|
12553
12505
|
strokeDashoffset: "2",
|
|
12554
12506
|
strokeWidth: "1",
|
|
12555
|
-
children: [/* @__PURE__ */
|
|
12507
|
+
children: [/* @__PURE__ */ _jsx108("line", {
|
|
12556
12508
|
x1: "0",
|
|
12557
12509
|
y1: "0.5",
|
|
12558
12510
|
x2: "100",
|
|
12559
12511
|
y2: "0.5"
|
|
12560
|
-
}), /* @__PURE__ */
|
|
12512
|
+
}), /* @__PURE__ */ _jsx108("line", {
|
|
12561
12513
|
x1: "0",
|
|
12562
12514
|
y1: "31.5",
|
|
12563
12515
|
x2: "100",
|
|
@@ -12566,7 +12518,7 @@ var PreviewDashMiddle = () => {
|
|
|
12566
12518
|
});
|
|
12567
12519
|
};
|
|
12568
12520
|
var PreviewDashEnd = () => {
|
|
12569
|
-
return /* @__PURE__ */
|
|
12521
|
+
return /* @__PURE__ */ _jsx108("svg", {
|
|
12570
12522
|
viewBox: "0 0 32 32",
|
|
12571
12523
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12572
12524
|
fill: "none",
|
|
@@ -12574,7 +12526,7 @@ var PreviewDashEnd = () => {
|
|
|
12574
12526
|
strokeDasharray: "3.84516",
|
|
12575
12527
|
strokeDashoffset: "1.9226",
|
|
12576
12528
|
strokeWidth: "1",
|
|
12577
|
-
children: /* @__PURE__ */
|
|
12529
|
+
children: /* @__PURE__ */ _jsx108("path", {
|
|
12578
12530
|
d: "M0,0.5 h29.5 a2,2 0 0 1 2,2 v27 a2,2 0 0 1 -2,2 h-29.5"
|
|
12579
12531
|
})
|
|
12580
12532
|
});
|
|
@@ -12596,9 +12548,9 @@ function Day(props) {
|
|
|
12596
12548
|
} else if (modifiers.preview) {
|
|
12597
12549
|
PreviewDash = PreviewDashMiddle;
|
|
12598
12550
|
}
|
|
12599
|
-
return /* @__PURE__ */
|
|
12551
|
+
return /* @__PURE__ */ _jsxs33("td", {
|
|
12600
12552
|
...tdProps,
|
|
12601
|
-
children: [PreviewDash && /* @__PURE__ */
|
|
12553
|
+
children: [PreviewDash && /* @__PURE__ */ _jsx108(PreviewDash, {}), children]
|
|
12602
12554
|
});
|
|
12603
12555
|
}
|
|
12604
12556
|
|
|
@@ -12607,6 +12559,7 @@ var CLASSNAMES = {
|
|
|
12607
12559
|
root: "components-calendar",
|
|
12608
12560
|
day: "components-calendar__day",
|
|
12609
12561
|
day_button: "components-calendar__day-button",
|
|
12562
|
+
outside: "components-calendar__day--outside",
|
|
12610
12563
|
caption_label: "components-calendar__caption-label",
|
|
12611
12564
|
button_next: "components-calendar__button-next",
|
|
12612
12565
|
button_previous: "components-calendar__button-previous",
|
|
@@ -12794,7 +12747,7 @@ var useLocalizationProps = ({
|
|
|
12794
12747
|
};
|
|
12795
12748
|
|
|
12796
12749
|
// ../components/build-module/calendar/date-calendar/index.mjs
|
|
12797
|
-
import { jsx as
|
|
12750
|
+
import { jsx as _jsx109 } from "react/jsx-runtime";
|
|
12798
12751
|
var DateCalendar = ({
|
|
12799
12752
|
defaultSelected,
|
|
12800
12753
|
selected: selectedProp,
|
|
@@ -12817,7 +12770,7 @@ var DateCalendar = ({
|
|
|
12817
12770
|
value: selectedProp,
|
|
12818
12771
|
onChange
|
|
12819
12772
|
});
|
|
12820
|
-
return /* @__PURE__ */
|
|
12773
|
+
return /* @__PURE__ */ _jsx109(DayPicker, {
|
|
12821
12774
|
...COMMON_PROPS,
|
|
12822
12775
|
...localizationProps,
|
|
12823
12776
|
...props,
|
|
@@ -12832,7 +12785,7 @@ var DateCalendar = ({
|
|
|
12832
12785
|
import { differenceInCalendarDays } from "date-fns";
|
|
12833
12786
|
import { DayPicker as DayPicker2, rangeContainsModifiers } from "react-day-picker";
|
|
12834
12787
|
import { enUS as enUS2 } from "react-day-picker/locale";
|
|
12835
|
-
import { jsx as
|
|
12788
|
+
import { jsx as _jsx110 } from "react/jsx-runtime";
|
|
12836
12789
|
function usePreviewRange({
|
|
12837
12790
|
selected,
|
|
12838
12791
|
hoveredDate,
|
|
@@ -12938,7 +12891,7 @@ var DateRangeCalendar = ({
|
|
|
12938
12891
|
preview_end: previewRange?.to
|
|
12939
12892
|
};
|
|
12940
12893
|
}, [previewRange]);
|
|
12941
|
-
return /* @__PURE__ */
|
|
12894
|
+
return /* @__PURE__ */ _jsx110(DayPicker2, {
|
|
12942
12895
|
...COMMON_PROPS,
|
|
12943
12896
|
...localizationProps,
|
|
12944
12897
|
...props,
|
|
@@ -12961,8 +12914,8 @@ var DateRangeCalendar = ({
|
|
|
12961
12914
|
import { __ as __17 } from "@wordpress/i18n";
|
|
12962
12915
|
|
|
12963
12916
|
// ../components/build-module/validated-form-controls/validity-indicator.mjs
|
|
12964
|
-
import
|
|
12965
|
-
import { jsx as
|
|
12917
|
+
import clsx31 from "clsx";
|
|
12918
|
+
import { jsx as _jsx111, jsxs as _jsxs34 } from "react/jsx-runtime";
|
|
12966
12919
|
function ValidityIndicator({
|
|
12967
12920
|
type,
|
|
12968
12921
|
message
|
|
@@ -12971,11 +12924,11 @@ function ValidityIndicator({
|
|
|
12971
12924
|
valid: published_default,
|
|
12972
12925
|
invalid: error_default
|
|
12973
12926
|
};
|
|
12974
|
-
return /* @__PURE__ */
|
|
12975
|
-
className:
|
|
12976
|
-
children: [type === "validating" ? /* @__PURE__ */
|
|
12927
|
+
return /* @__PURE__ */ _jsxs34("p", {
|
|
12928
|
+
className: clsx31("components-validated-control__indicator", `is-${type}`),
|
|
12929
|
+
children: [type === "validating" ? /* @__PURE__ */ _jsx111(spinner_default, {
|
|
12977
12930
|
className: "components-validated-control__indicator-spinner"
|
|
12978
|
-
}) : /* @__PURE__ */
|
|
12931
|
+
}) : /* @__PURE__ */ _jsx111(icon_default2, {
|
|
12979
12932
|
className: "components-validated-control__indicator-icon",
|
|
12980
12933
|
icon: ICON[type],
|
|
12981
12934
|
size: 16,
|
|
@@ -12985,15 +12938,15 @@ function ValidityIndicator({
|
|
|
12985
12938
|
}
|
|
12986
12939
|
|
|
12987
12940
|
// ../components/build-module/validated-form-controls/control-with-error.mjs
|
|
12988
|
-
import { Fragment as _Fragment13, jsxs as
|
|
12941
|
+
import { Fragment as _Fragment13, jsxs as _jsxs35, jsx as _jsx112 } from "react/jsx-runtime";
|
|
12989
12942
|
function appendRequiredIndicator(label, required, markWhenOptional) {
|
|
12990
12943
|
if (required && !markWhenOptional) {
|
|
12991
|
-
return /* @__PURE__ */
|
|
12944
|
+
return /* @__PURE__ */ _jsxs35(_Fragment13, {
|
|
12992
12945
|
children: [label, " ", `(${__17("Required")})`]
|
|
12993
12946
|
});
|
|
12994
12947
|
}
|
|
12995
12948
|
if (!required && markWhenOptional) {
|
|
12996
|
-
return /* @__PURE__ */
|
|
12949
|
+
return /* @__PURE__ */ _jsxs35(_Fragment13, {
|
|
12997
12950
|
children: [label, " ", `(${__17("Optional")})`]
|
|
12998
12951
|
});
|
|
12999
12952
|
}
|
|
@@ -13097,27 +13050,27 @@ function UnforwardedControlWithError({
|
|
|
13097
13050
|
};
|
|
13098
13051
|
const message = () => {
|
|
13099
13052
|
if (errorMessage) {
|
|
13100
|
-
return /* @__PURE__ */
|
|
13053
|
+
return /* @__PURE__ */ _jsx112(ValidityIndicator, {
|
|
13101
13054
|
type: "invalid",
|
|
13102
13055
|
message: errorMessage
|
|
13103
13056
|
});
|
|
13104
13057
|
}
|
|
13105
13058
|
if (statusMessage?.type) {
|
|
13106
|
-
return /* @__PURE__ */
|
|
13059
|
+
return /* @__PURE__ */ _jsx112(ValidityIndicator, {
|
|
13107
13060
|
type: statusMessage.type,
|
|
13108
13061
|
message: statusMessage.message
|
|
13109
13062
|
});
|
|
13110
13063
|
}
|
|
13111
13064
|
return null;
|
|
13112
13065
|
};
|
|
13113
|
-
return /* @__PURE__ */
|
|
13066
|
+
return /* @__PURE__ */ _jsxs35("div", {
|
|
13114
13067
|
className,
|
|
13115
13068
|
ref: forwardedRef,
|
|
13116
13069
|
onBlur,
|
|
13117
13070
|
children: [cloneElement(children, {
|
|
13118
13071
|
label: appendRequiredIndicator(children.props.label, required, markWhenOptional),
|
|
13119
13072
|
required
|
|
13120
|
-
}), /* @__PURE__ */
|
|
13073
|
+
}), /* @__PURE__ */ _jsx112("div", {
|
|
13121
13074
|
"aria-live": "polite",
|
|
13122
13075
|
children: showMessage && message()
|
|
13123
13076
|
})]
|
|
@@ -13127,7 +13080,7 @@ var ControlWithError = forwardRef(UnforwardedControlWithError);
|
|
|
13127
13080
|
ControlWithError.displayName = "ControlWithError";
|
|
13128
13081
|
|
|
13129
13082
|
// ../components/build-module/validated-form-controls/components/checkbox-control.mjs
|
|
13130
|
-
import { jsx as
|
|
13083
|
+
import { jsx as _jsx113 } from "react/jsx-runtime";
|
|
13131
13084
|
var UnforwardedValidatedCheckboxControl = ({
|
|
13132
13085
|
required,
|
|
13133
13086
|
customValidity,
|
|
@@ -13136,13 +13089,13 @@ var UnforwardedValidatedCheckboxControl = ({
|
|
|
13136
13089
|
}, forwardedRef) => {
|
|
13137
13090
|
const validityTargetRef = useRef(null);
|
|
13138
13091
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13139
|
-
return /* @__PURE__ */
|
|
13092
|
+
return /* @__PURE__ */ _jsx113(ControlWithError, {
|
|
13140
13093
|
required,
|
|
13141
13094
|
markWhenOptional,
|
|
13142
13095
|
ref: mergedRefs,
|
|
13143
13096
|
customValidity,
|
|
13144
13097
|
getValidityTarget: () => validityTargetRef.current?.querySelector('input[type="checkbox"]'),
|
|
13145
|
-
children: /* @__PURE__ */
|
|
13098
|
+
children: /* @__PURE__ */ _jsx113(
|
|
13146
13099
|
checkbox_control_default,
|
|
13147
13100
|
{
|
|
13148
13101
|
...restProps
|
|
@@ -13154,7 +13107,7 @@ var ValidatedCheckboxControl = forwardRef(UnforwardedValidatedCheckboxControl);
|
|
|
13154
13107
|
ValidatedCheckboxControl.displayName = "ValidatedCheckboxControl";
|
|
13155
13108
|
|
|
13156
13109
|
// ../components/build-module/validated-form-controls/components/combobox-control.mjs
|
|
13157
|
-
import { jsx as
|
|
13110
|
+
import { jsx as _jsx114 } from "react/jsx-runtime";
|
|
13158
13111
|
var UnforwardedValidatedComboboxControl = ({
|
|
13159
13112
|
required,
|
|
13160
13113
|
customValidity,
|
|
@@ -13171,13 +13124,13 @@ var UnforwardedValidatedComboboxControl = ({
|
|
|
13171
13124
|
}, [required]);
|
|
13172
13125
|
return (
|
|
13173
13126
|
// TODO: Bug - Missing value error is not cleared immediately on change, waits for blur.
|
|
13174
|
-
/* @__PURE__ */
|
|
13127
|
+
/* @__PURE__ */ _jsx114(ControlWithError, {
|
|
13175
13128
|
required,
|
|
13176
13129
|
markWhenOptional,
|
|
13177
13130
|
ref: mergedRefs,
|
|
13178
13131
|
customValidity,
|
|
13179
13132
|
getValidityTarget: () => validityTargetRef.current?.querySelector('input[role="combobox"]'),
|
|
13180
|
-
children: /* @__PURE__ */
|
|
13133
|
+
children: /* @__PURE__ */ _jsx114(combobox_control_default, {
|
|
13181
13134
|
__next40pxDefaultSize: true,
|
|
13182
13135
|
...restProps
|
|
13183
13136
|
})
|
|
@@ -13188,7 +13141,7 @@ var ValidatedComboboxControl = forwardRef(UnforwardedValidatedComboboxControl);
|
|
|
13188
13141
|
ValidatedComboboxControl.displayName = "ValidatedComboboxControl";
|
|
13189
13142
|
|
|
13190
13143
|
// ../components/build-module/validated-form-controls/components/form-token-field.mjs
|
|
13191
|
-
import { jsx as
|
|
13144
|
+
import { jsx as _jsx115, jsxs as _jsxs36 } from "react/jsx-runtime";
|
|
13192
13145
|
var UnforwardedValidatedFormTokenField = ({
|
|
13193
13146
|
required,
|
|
13194
13147
|
customValidity,
|
|
@@ -13196,19 +13149,19 @@ var UnforwardedValidatedFormTokenField = ({
|
|
|
13196
13149
|
...restProps
|
|
13197
13150
|
}, forwardedRef) => {
|
|
13198
13151
|
const validityTargetRef = useRef(null);
|
|
13199
|
-
return /* @__PURE__ */
|
|
13152
|
+
return /* @__PURE__ */ _jsxs36("div", {
|
|
13200
13153
|
className: "components-validated-control__wrapper-with-error-delegate",
|
|
13201
13154
|
ref: forwardedRef,
|
|
13202
|
-
children: [/* @__PURE__ */
|
|
13155
|
+
children: [/* @__PURE__ */ _jsx115(ControlWithError, {
|
|
13203
13156
|
required,
|
|
13204
13157
|
markWhenOptional,
|
|
13205
13158
|
customValidity,
|
|
13206
13159
|
getValidityTarget: () => validityTargetRef.current,
|
|
13207
|
-
children: /* @__PURE__ */
|
|
13160
|
+
children: /* @__PURE__ */ _jsx115(FormTokenField, {
|
|
13208
13161
|
__next40pxDefaultSize: true,
|
|
13209
13162
|
...restProps
|
|
13210
13163
|
})
|
|
13211
|
-
}), /* @__PURE__ */
|
|
13164
|
+
}), /* @__PURE__ */ _jsx115("input", {
|
|
13212
13165
|
className: "components-validated-control__error-delegate",
|
|
13213
13166
|
type: "text",
|
|
13214
13167
|
ref: validityTargetRef,
|
|
@@ -13227,7 +13180,7 @@ var ValidatedFormTokenField = forwardRef(UnforwardedValidatedFormTokenField);
|
|
|
13227
13180
|
ValidatedFormTokenField.displayName = "ValidatedFormTokenField";
|
|
13228
13181
|
|
|
13229
13182
|
// ../components/build-module/validated-form-controls/components/input-control.mjs
|
|
13230
|
-
import { jsx as
|
|
13183
|
+
import { jsx as _jsx116 } from "react/jsx-runtime";
|
|
13231
13184
|
var UnforwardedValidatedInputControl = ({
|
|
13232
13185
|
required,
|
|
13233
13186
|
customValidity,
|
|
@@ -13236,12 +13189,12 @@ var UnforwardedValidatedInputControl = ({
|
|
|
13236
13189
|
}, forwardedRef) => {
|
|
13237
13190
|
const validityTargetRef = useRef(null);
|
|
13238
13191
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13239
|
-
return /* @__PURE__ */
|
|
13192
|
+
return /* @__PURE__ */ _jsx116(ControlWithError, {
|
|
13240
13193
|
required,
|
|
13241
13194
|
markWhenOptional,
|
|
13242
13195
|
customValidity,
|
|
13243
13196
|
getValidityTarget: () => validityTargetRef.current,
|
|
13244
|
-
children: /* @__PURE__ */
|
|
13197
|
+
children: /* @__PURE__ */ _jsx116(input_control_default, {
|
|
13245
13198
|
__next40pxDefaultSize: true,
|
|
13246
13199
|
ref: mergedRefs,
|
|
13247
13200
|
...restProps
|
|
@@ -13252,7 +13205,7 @@ var ValidatedInputControl = forwardRef(UnforwardedValidatedInputControl);
|
|
|
13252
13205
|
ValidatedInputControl.displayName = "ValidatedInputControl";
|
|
13253
13206
|
|
|
13254
13207
|
// ../components/build-module/validated-form-controls/components/number-control.mjs
|
|
13255
|
-
import { jsx as
|
|
13208
|
+
import { jsx as _jsx117 } from "react/jsx-runtime";
|
|
13256
13209
|
var UnforwardedValidatedNumberControl = ({
|
|
13257
13210
|
required,
|
|
13258
13211
|
customValidity,
|
|
@@ -13261,12 +13214,12 @@ var UnforwardedValidatedNumberControl = ({
|
|
|
13261
13214
|
}, forwardedRef) => {
|
|
13262
13215
|
const validityTargetRef = useRef(null);
|
|
13263
13216
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13264
|
-
return /* @__PURE__ */
|
|
13217
|
+
return /* @__PURE__ */ _jsx117(ControlWithError, {
|
|
13265
13218
|
required,
|
|
13266
13219
|
markWhenOptional,
|
|
13267
13220
|
customValidity,
|
|
13268
13221
|
getValidityTarget: () => validityTargetRef.current,
|
|
13269
|
-
children: /* @__PURE__ */
|
|
13222
|
+
children: /* @__PURE__ */ _jsx117(number_control_default, {
|
|
13270
13223
|
__next40pxDefaultSize: true,
|
|
13271
13224
|
ref: mergedRefs,
|
|
13272
13225
|
...restProps
|
|
@@ -13277,7 +13230,7 @@ var ValidatedNumberControl = forwardRef(UnforwardedValidatedNumberControl);
|
|
|
13277
13230
|
ValidatedNumberControl.displayName = "ValidatedNumberControl";
|
|
13278
13231
|
|
|
13279
13232
|
// ../components/build-module/validated-form-controls/components/radio-control.mjs
|
|
13280
|
-
import { jsx as
|
|
13233
|
+
import { jsx as _jsx118 } from "react/jsx-runtime";
|
|
13281
13234
|
var UnforwardedValidatedRadioControl = ({
|
|
13282
13235
|
required,
|
|
13283
13236
|
customValidity,
|
|
@@ -13286,13 +13239,13 @@ var UnforwardedValidatedRadioControl = ({
|
|
|
13286
13239
|
}, forwardedRef) => {
|
|
13287
13240
|
const validityTargetRef = useRef(null);
|
|
13288
13241
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13289
|
-
return /* @__PURE__ */
|
|
13242
|
+
return /* @__PURE__ */ _jsx118(ControlWithError, {
|
|
13290
13243
|
required,
|
|
13291
13244
|
markWhenOptional,
|
|
13292
13245
|
ref: mergedRefs,
|
|
13293
13246
|
customValidity,
|
|
13294
13247
|
getValidityTarget: () => validityTargetRef.current?.querySelector('input[type="radio"]'),
|
|
13295
|
-
children: /* @__PURE__ */
|
|
13248
|
+
children: /* @__PURE__ */ _jsx118(radio_control_default, {
|
|
13296
13249
|
...restProps
|
|
13297
13250
|
})
|
|
13298
13251
|
});
|
|
@@ -13301,7 +13254,7 @@ var ValidatedRadioControl = forwardRef(UnforwardedValidatedRadioControl);
|
|
|
13301
13254
|
ValidatedRadioControl.displayName = "ValidatedRadioControl";
|
|
13302
13255
|
|
|
13303
13256
|
// ../components/build-module/validated-form-controls/components/select-control.mjs
|
|
13304
|
-
import { jsx as
|
|
13257
|
+
import { jsx as _jsx119 } from "react/jsx-runtime";
|
|
13305
13258
|
var UnforwardedValidatedSelectControl = ({
|
|
13306
13259
|
required,
|
|
13307
13260
|
customValidity,
|
|
@@ -13310,12 +13263,12 @@ var UnforwardedValidatedSelectControl = ({
|
|
|
13310
13263
|
}, forwardedRef) => {
|
|
13311
13264
|
const validityTargetRef = useRef(null);
|
|
13312
13265
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13313
|
-
return /* @__PURE__ */
|
|
13266
|
+
return /* @__PURE__ */ _jsx119(ControlWithError, {
|
|
13314
13267
|
required,
|
|
13315
13268
|
markWhenOptional,
|
|
13316
13269
|
customValidity,
|
|
13317
13270
|
getValidityTarget: () => validityTargetRef.current,
|
|
13318
|
-
children: /* @__PURE__ */
|
|
13271
|
+
children: /* @__PURE__ */ _jsx119(select_control_default, {
|
|
13319
13272
|
__next40pxDefaultSize: true,
|
|
13320
13273
|
ref: mergedRefs,
|
|
13321
13274
|
...restProps
|
|
@@ -13326,7 +13279,7 @@ var ValidatedSelectControl = forwardRef(UnforwardedValidatedSelectControl);
|
|
|
13326
13279
|
ValidatedSelectControl.displayName = "ValidatedSelectControl";
|
|
13327
13280
|
|
|
13328
13281
|
// ../components/build-module/validated-form-controls/components/text-control.mjs
|
|
13329
|
-
import { jsx as
|
|
13282
|
+
import { jsx as _jsx120 } from "react/jsx-runtime";
|
|
13330
13283
|
var UnforwardedValidatedTextControl = ({
|
|
13331
13284
|
required,
|
|
13332
13285
|
customValidity,
|
|
@@ -13335,12 +13288,12 @@ var UnforwardedValidatedTextControl = ({
|
|
|
13335
13288
|
}, forwardedRef) => {
|
|
13336
13289
|
const validityTargetRef = useRef(null);
|
|
13337
13290
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13338
|
-
return /* @__PURE__ */
|
|
13291
|
+
return /* @__PURE__ */ _jsx120(ControlWithError, {
|
|
13339
13292
|
required,
|
|
13340
13293
|
markWhenOptional,
|
|
13341
13294
|
customValidity,
|
|
13342
13295
|
getValidityTarget: () => validityTargetRef.current,
|
|
13343
|
-
children: /* @__PURE__ */
|
|
13296
|
+
children: /* @__PURE__ */ _jsx120(text_control_default, {
|
|
13344
13297
|
__next40pxDefaultSize: true,
|
|
13345
13298
|
ref: mergedRefs,
|
|
13346
13299
|
...restProps
|
|
@@ -13351,7 +13304,7 @@ var ValidatedTextControl = forwardRef(UnforwardedValidatedTextControl);
|
|
|
13351
13304
|
ValidatedTextControl.displayName = "ValidatedTextControl";
|
|
13352
13305
|
|
|
13353
13306
|
// ../components/build-module/validated-form-controls/components/textarea-control.mjs
|
|
13354
|
-
import { jsx as
|
|
13307
|
+
import { jsx as _jsx121 } from "react/jsx-runtime";
|
|
13355
13308
|
var UnforwardedValidatedTextareaControl = ({
|
|
13356
13309
|
required,
|
|
13357
13310
|
customValidity,
|
|
@@ -13360,12 +13313,12 @@ var UnforwardedValidatedTextareaControl = ({
|
|
|
13360
13313
|
}, forwardedRef) => {
|
|
13361
13314
|
const validityTargetRef = useRef(null);
|
|
13362
13315
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13363
|
-
return /* @__PURE__ */
|
|
13316
|
+
return /* @__PURE__ */ _jsx121(ControlWithError, {
|
|
13364
13317
|
required,
|
|
13365
13318
|
markWhenOptional,
|
|
13366
13319
|
customValidity,
|
|
13367
13320
|
getValidityTarget: () => validityTargetRef.current,
|
|
13368
|
-
children: /* @__PURE__ */
|
|
13321
|
+
children: /* @__PURE__ */ _jsx121(textarea_control_default, {
|
|
13369
13322
|
ref: mergedRefs,
|
|
13370
13323
|
...restProps
|
|
13371
13324
|
})
|
|
@@ -13375,7 +13328,7 @@ var ValidatedTextareaControl = forwardRef(UnforwardedValidatedTextareaControl);
|
|
|
13375
13328
|
ValidatedTextareaControl.displayName = "ValidatedTextareaControl";
|
|
13376
13329
|
|
|
13377
13330
|
// ../components/build-module/validated-form-controls/components/toggle-control.mjs
|
|
13378
|
-
import { jsx as
|
|
13331
|
+
import { jsx as _jsx122 } from "react/jsx-runtime";
|
|
13379
13332
|
var UnforwardedValidatedToggleControl = ({
|
|
13380
13333
|
required,
|
|
13381
13334
|
customValidity,
|
|
@@ -13384,12 +13337,12 @@ var UnforwardedValidatedToggleControl = ({
|
|
|
13384
13337
|
}, forwardedRef) => {
|
|
13385
13338
|
const validityTargetRef = useRef(null);
|
|
13386
13339
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13387
|
-
return /* @__PURE__ */
|
|
13340
|
+
return /* @__PURE__ */ _jsx122(ControlWithError, {
|
|
13388
13341
|
required,
|
|
13389
13342
|
markWhenOptional,
|
|
13390
13343
|
customValidity,
|
|
13391
13344
|
getValidityTarget: () => validityTargetRef.current,
|
|
13392
|
-
children: /* @__PURE__ */
|
|
13345
|
+
children: /* @__PURE__ */ _jsx122(toggle_control_default, {
|
|
13393
13346
|
ref: mergedRefs,
|
|
13394
13347
|
required,
|
|
13395
13348
|
...restProps
|
|
@@ -13400,7 +13353,7 @@ var ValidatedToggleControl = forwardRef(UnforwardedValidatedToggleControl);
|
|
|
13400
13353
|
ValidatedToggleControl.displayName = "ValidatedToggleControl";
|
|
13401
13354
|
|
|
13402
13355
|
// ../components/build-module/validated-form-controls/components/toggle-group-control.mjs
|
|
13403
|
-
import { jsx as
|
|
13356
|
+
import { jsx as _jsx123, jsxs as _jsxs37 } from "react/jsx-runtime";
|
|
13404
13357
|
var UnforwardedValidatedToggleGroupControl = ({
|
|
13405
13358
|
required,
|
|
13406
13359
|
customValidity,
|
|
@@ -13409,19 +13362,19 @@ var UnforwardedValidatedToggleGroupControl = ({
|
|
|
13409
13362
|
}, forwardedRef) => {
|
|
13410
13363
|
const validityTargetRef = useRef(null);
|
|
13411
13364
|
const nameAttr = useId();
|
|
13412
|
-
return /* @__PURE__ */
|
|
13365
|
+
return /* @__PURE__ */ _jsxs37("div", {
|
|
13413
13366
|
className: "components-validated-control__wrapper-with-error-delegate",
|
|
13414
|
-
children: [/* @__PURE__ */
|
|
13367
|
+
children: [/* @__PURE__ */ _jsx123(ControlWithError, {
|
|
13415
13368
|
required,
|
|
13416
13369
|
markWhenOptional,
|
|
13417
13370
|
customValidity,
|
|
13418
13371
|
getValidityTarget: () => validityTargetRef.current,
|
|
13419
|
-
children: /* @__PURE__ */
|
|
13372
|
+
children: /* @__PURE__ */ _jsx123(component_default10, {
|
|
13420
13373
|
__next40pxDefaultSize: true,
|
|
13421
13374
|
ref: forwardedRef,
|
|
13422
13375
|
...restProps
|
|
13423
13376
|
})
|
|
13424
|
-
}), /* @__PURE__ */
|
|
13377
|
+
}), /* @__PURE__ */ _jsx123("input", {
|
|
13425
13378
|
className: "components-validated-control__error-delegate",
|
|
13426
13379
|
type: "radio",
|
|
13427
13380
|
ref: validityTargetRef,
|
|
@@ -13444,8 +13397,6 @@ ValidatedToggleGroupControl.displayName = "ValidatedToggleGroupControl";
|
|
|
13444
13397
|
var privateApis = {};
|
|
13445
13398
|
lock2(privateApis, {
|
|
13446
13399
|
__experimentalPopoverLegacyPositionToPlacement: positionToPlacement,
|
|
13447
|
-
Avatar: component_default24,
|
|
13448
|
-
AvatarGroup: component_default25,
|
|
13449
13400
|
ComponentsContext,
|
|
13450
13401
|
Tabs,
|
|
13451
13402
|
Theme: theme_default,
|
|
@@ -14701,7 +14652,7 @@ function TableColumnField({
|
|
|
14701
14652
|
if (!field) {
|
|
14702
14653
|
return null;
|
|
14703
14654
|
}
|
|
14704
|
-
const className2 =
|
|
14655
|
+
const className2 = clsx32("dataviews-view-table__cell-content-wrapper", {
|
|
14705
14656
|
"dataviews-view-table__cell-align-end": align === "end",
|
|
14706
14657
|
"dataviews-view-table__cell-align-center": align === "center"
|
|
14707
14658
|
});
|
|
@@ -14742,7 +14693,7 @@ function TableRow({
|
|
|
14742
14693
|
return /* @__PURE__ */ jsxs6(
|
|
14743
14694
|
"tr",
|
|
14744
14695
|
{
|
|
14745
|
-
className:
|
|
14696
|
+
className: clsx32("dataviews-view-table__row", {
|
|
14746
14697
|
"is-selected": hasPossibleBulkAction && isSelected,
|
|
14747
14698
|
"has-bulk-actions": hasPossibleBulkAction
|
|
14748
14699
|
}),
|
|
@@ -14828,7 +14779,7 @@ function TableRow({
|
|
|
14828
14779
|
/* @__PURE__ */ jsx45(
|
|
14829
14780
|
"td",
|
|
14830
14781
|
{
|
|
14831
|
-
className:
|
|
14782
|
+
className: clsx32("dataviews-view-table__actions-column", {
|
|
14832
14783
|
"dataviews-view-table__actions-column--sticky": true,
|
|
14833
14784
|
"dataviews-view-table__actions-column--stuck": isActionsColumnSticky
|
|
14834
14785
|
}),
|
|
@@ -14933,7 +14884,7 @@ function ViewTable({
|
|
|
14933
14884
|
return /* @__PURE__ */ jsx45(
|
|
14934
14885
|
"div",
|
|
14935
14886
|
{
|
|
14936
|
-
className:
|
|
14887
|
+
className: clsx32("dataviews-no-results", {
|
|
14937
14888
|
"is-refreshing": isDelayedLoading
|
|
14938
14889
|
}),
|
|
14939
14890
|
id: tableNoticeId,
|
|
@@ -14945,7 +14896,7 @@ function ViewTable({
|
|
|
14945
14896
|
/* @__PURE__ */ jsxs6(
|
|
14946
14897
|
"table",
|
|
14947
14898
|
{
|
|
14948
|
-
className:
|
|
14899
|
+
className: clsx32("dataviews-view-table", className2, {
|
|
14949
14900
|
[`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
|
|
14950
14901
|
view.layout.density
|
|
14951
14902
|
),
|
|
@@ -14963,10 +14914,10 @@ function ViewTable({
|
|
|
14963
14914
|
columns.map((column, index) => /* @__PURE__ */ jsx45(
|
|
14964
14915
|
"col",
|
|
14965
14916
|
{
|
|
14966
|
-
className:
|
|
14917
|
+
className: clsx32(
|
|
14967
14918
|
`dataviews-view-table__col-${column}`,
|
|
14968
14919
|
{
|
|
14969
|
-
"dataviews-view-table__col-
|
|
14920
|
+
"dataviews-view-table__col-expand": !hasPrimaryColumn && index === columns.length - 1
|
|
14970
14921
|
}
|
|
14971
14922
|
)
|
|
14972
14923
|
},
|
|
@@ -15063,7 +15014,7 @@ function ViewTable({
|
|
|
15063
15014
|
!!actions?.length && /* @__PURE__ */ jsx45(
|
|
15064
15015
|
"th",
|
|
15065
15016
|
{
|
|
15066
|
-
className:
|
|
15017
|
+
className: clsx32(
|
|
15067
15018
|
"dataviews-view-table__actions-column",
|
|
15068
15019
|
{
|
|
15069
15020
|
"dataviews-view-table__actions-column--sticky": true,
|
|
@@ -15146,11 +15097,11 @@ function ViewTable({
|
|
|
15146
15097
|
var table_default = ViewTable;
|
|
15147
15098
|
|
|
15148
15099
|
// src/components/dataviews-layouts/grid/index.tsx
|
|
15149
|
-
import
|
|
15100
|
+
import clsx34 from "clsx";
|
|
15150
15101
|
import { __ as __26, sprintf as sprintf8 } from "@wordpress/i18n";
|
|
15151
15102
|
|
|
15152
15103
|
// src/components/dataviews-layouts/grid/composite-grid.tsx
|
|
15153
|
-
import
|
|
15104
|
+
import clsx33 from "clsx";
|
|
15154
15105
|
import { __ as __25, sprintf as sprintf7 } from "@wordpress/i18n";
|
|
15155
15106
|
|
|
15156
15107
|
// src/components/dataviews-layouts/grid/preview-size-picker.tsx
|
|
@@ -15267,7 +15218,7 @@ var GridItem = forwardRef(function GridItem2({
|
|
|
15267
15218
|
direction: "column",
|
|
15268
15219
|
...props,
|
|
15269
15220
|
ref,
|
|
15270
|
-
className:
|
|
15221
|
+
className: clsx33(
|
|
15271
15222
|
props.className,
|
|
15272
15223
|
"dataviews-view-grid__row__gridcell",
|
|
15273
15224
|
"dataviews-view-grid__card",
|
|
@@ -15296,7 +15247,7 @@ var GridItem = forwardRef(function GridItem2({
|
|
|
15296
15247
|
isItemClickable: isItemClickable2,
|
|
15297
15248
|
onClickItem,
|
|
15298
15249
|
renderItemLink,
|
|
15299
|
-
className:
|
|
15250
|
+
className: clsx33("dataviews-view-grid__media", {
|
|
15300
15251
|
"dataviews-view-grid__media--placeholder": !rendersMediaField
|
|
15301
15252
|
}),
|
|
15302
15253
|
...mediaA11yProps,
|
|
@@ -15457,7 +15408,7 @@ function CompositeGrid({
|
|
|
15457
15408
|
Composite2,
|
|
15458
15409
|
{
|
|
15459
15410
|
role: isInfiniteScroll ? "feed" : "grid",
|
|
15460
|
-
className:
|
|
15411
|
+
className: clsx33("dataviews-view-grid", className2),
|
|
15461
15412
|
focusWrap: true,
|
|
15462
15413
|
"aria-busy": isLoading,
|
|
15463
15414
|
"aria-rowcount": isInfiniteScroll ? void 0 : totalRows,
|
|
@@ -15551,7 +15502,7 @@ function ViewGrid({
|
|
|
15551
15502
|
return /* @__PURE__ */ jsx48(
|
|
15552
15503
|
"div",
|
|
15553
15504
|
{
|
|
15554
|
-
className:
|
|
15505
|
+
className: clsx34("dataviews-no-results", {
|
|
15555
15506
|
"is-refreshing": isDelayedLoading
|
|
15556
15507
|
}),
|
|
15557
15508
|
children: empty
|
|
@@ -15559,7 +15510,7 @@ function ViewGrid({
|
|
|
15559
15510
|
);
|
|
15560
15511
|
}
|
|
15561
15512
|
const gridProps = {
|
|
15562
|
-
className:
|
|
15513
|
+
className: clsx34(className2, {
|
|
15563
15514
|
"is-refreshing": !isInfiniteScroll && isDelayedLoading
|
|
15564
15515
|
}),
|
|
15565
15516
|
inert: !isInfiniteScroll && !!isLoading ? "true" : void 0,
|
|
@@ -15619,7 +15570,7 @@ function ViewGrid({
|
|
|
15619
15570
|
var grid_default = ViewGrid;
|
|
15620
15571
|
|
|
15621
15572
|
// src/components/dataviews-layouts/list/index.tsx
|
|
15622
|
-
import
|
|
15573
|
+
import clsx35 from "clsx";
|
|
15623
15574
|
import { __ as __27, sprintf as sprintf9 } from "@wordpress/i18n";
|
|
15624
15575
|
import { useRegistry as useRegistry3 } from "@wordpress/data";
|
|
15625
15576
|
import { Fragment as Fragment7, jsx as jsx49, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
@@ -15831,7 +15782,7 @@ function ListItem({
|
|
|
15831
15782
|
)
|
|
15832
15783
|
),
|
|
15833
15784
|
role: infiniteScrollEnabled ? "article" : "row",
|
|
15834
|
-
className:
|
|
15785
|
+
className: clsx35({
|
|
15835
15786
|
"is-selected": isSelected,
|
|
15836
15787
|
"is-hovered": isHovered
|
|
15837
15788
|
}),
|
|
@@ -16046,7 +15997,7 @@ function ViewList(props) {
|
|
|
16046
15997
|
return /* @__PURE__ */ jsx49(
|
|
16047
15998
|
"div",
|
|
16048
15999
|
{
|
|
16049
|
-
className:
|
|
16000
|
+
className: clsx35("dataviews-no-results", {
|
|
16050
16001
|
"is-refreshing": isDelayedLoading
|
|
16051
16002
|
}),
|
|
16052
16003
|
children: empty
|
|
@@ -16069,7 +16020,7 @@ function ViewList(props) {
|
|
|
16069
16020
|
{
|
|
16070
16021
|
direction: "column",
|
|
16071
16022
|
gap: "lg",
|
|
16072
|
-
className:
|
|
16023
|
+
className: clsx35("dataviews-view-list", className2),
|
|
16073
16024
|
children: Array.from(dataByGroup.entries()).map(
|
|
16074
16025
|
([groupName, groupItems]) => /* @__PURE__ */ jsxs9(
|
|
16075
16026
|
Stack,
|
|
@@ -16120,7 +16071,7 @@ function ViewList(props) {
|
|
|
16120
16071
|
ref: compositeRef,
|
|
16121
16072
|
id: baseId,
|
|
16122
16073
|
render: /* @__PURE__ */ jsx49("div", {}),
|
|
16123
|
-
className:
|
|
16074
|
+
className: clsx35("dataviews-view-list", className2, {
|
|
16124
16075
|
[`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
|
|
16125
16076
|
view.layout.density
|
|
16126
16077
|
),
|
|
@@ -16158,7 +16109,7 @@ function ViewList(props) {
|
|
|
16158
16109
|
}
|
|
16159
16110
|
|
|
16160
16111
|
// src/components/dataviews-layouts/activity/index.tsx
|
|
16161
|
-
import
|
|
16112
|
+
import clsx37 from "clsx";
|
|
16162
16113
|
|
|
16163
16114
|
// src/components/dataviews-layouts/activity/activity-group.tsx
|
|
16164
16115
|
import { __ as __28, sprintf as sprintf10 } from "@wordpress/i18n";
|
|
@@ -16198,7 +16149,7 @@ function ActivityGroup({
|
|
|
16198
16149
|
}
|
|
16199
16150
|
|
|
16200
16151
|
// src/components/dataviews-layouts/activity/activity-item.tsx
|
|
16201
|
-
import
|
|
16152
|
+
import clsx36 from "clsx";
|
|
16202
16153
|
import { useRegistry as useRegistry4 } from "@wordpress/data";
|
|
16203
16154
|
import { jsx as jsx51, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
16204
16155
|
function ActivityItem(props) {
|
|
@@ -16271,7 +16222,7 @@ function ActivityItem(props) {
|
|
|
16271
16222
|
role: infiniteScrollEnabled ? "article" : void 0,
|
|
16272
16223
|
"aria-posinset": posinset,
|
|
16273
16224
|
"aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
|
|
16274
|
-
className:
|
|
16225
|
+
className: clsx36(
|
|
16275
16226
|
"dataviews-view-activity__item",
|
|
16276
16227
|
density === "compact" && "is-compact",
|
|
16277
16228
|
density === "balanced" && "is-balanced",
|
|
@@ -16410,7 +16361,7 @@ function ViewActivity(props) {
|
|
|
16410
16361
|
return /* @__PURE__ */ jsx52(
|
|
16411
16362
|
"div",
|
|
16412
16363
|
{
|
|
16413
|
-
className:
|
|
16364
|
+
className: clsx37("dataviews-no-results", {
|
|
16414
16365
|
"is-refreshing": isDelayedLoading
|
|
16415
16366
|
}),
|
|
16416
16367
|
children: empty
|
|
@@ -16418,7 +16369,7 @@ function ViewActivity(props) {
|
|
|
16418
16369
|
);
|
|
16419
16370
|
}
|
|
16420
16371
|
const isInert = !isInfiniteScroll && !!isLoading;
|
|
16421
|
-
const wrapperClassName =
|
|
16372
|
+
const wrapperClassName = clsx37("dataviews-view-activity", className2, {
|
|
16422
16373
|
"is-refreshing": !isInfiniteScroll && isDelayedLoading
|
|
16423
16374
|
});
|
|
16424
16375
|
const groupedEntries = dataByGroup ? Array.from(dataByGroup.entries()) : [];
|
|
@@ -16467,7 +16418,7 @@ function ViewActivity(props) {
|
|
|
16467
16418
|
}
|
|
16468
16419
|
|
|
16469
16420
|
// src/components/dataviews-layouts/picker-grid/index.tsx
|
|
16470
|
-
import
|
|
16421
|
+
import clsx39 from "clsx";
|
|
16471
16422
|
import { __ as __31, sprintf as sprintf12 } from "@wordpress/i18n";
|
|
16472
16423
|
|
|
16473
16424
|
// src/components/dataviews-picker-footer/index.tsx
|
|
@@ -16735,14 +16686,14 @@ function DataViewsPickerFooter() {
|
|
|
16735
16686
|
}
|
|
16736
16687
|
|
|
16737
16688
|
// src/components/dataviews-layouts/utils/grid-items.tsx
|
|
16738
|
-
import
|
|
16689
|
+
import clsx38 from "clsx";
|
|
16739
16690
|
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
16740
16691
|
var GridItems = forwardRef(({ className: className2, previewSize, ...props }, ref) => {
|
|
16741
16692
|
return /* @__PURE__ */ jsx55(
|
|
16742
16693
|
"div",
|
|
16743
16694
|
{
|
|
16744
16695
|
ref,
|
|
16745
|
-
className:
|
|
16696
|
+
className: clsx38("dataviews-view-grid-items", className2),
|
|
16746
16697
|
style: {
|
|
16747
16698
|
gridTemplateColumns: previewSize && `repeat(auto-fill, minmax(${previewSize}px, 1fr))`
|
|
16748
16699
|
},
|
|
@@ -16790,7 +16741,7 @@ function GridItem3({
|
|
|
16790
16741
|
role: "option",
|
|
16791
16742
|
"aria-posinset": posinset,
|
|
16792
16743
|
"aria-setsize": setsize,
|
|
16793
|
-
className:
|
|
16744
|
+
className: clsx39("dataviews-view-picker-grid__card", {
|
|
16794
16745
|
"is-selected": isSelected
|
|
16795
16746
|
}),
|
|
16796
16747
|
"aria-selected": isSelected,
|
|
@@ -17000,7 +16951,7 @@ function ViewPickerGrid({
|
|
|
17000
16951
|
orientation: "horizontal",
|
|
17001
16952
|
role: "listbox",
|
|
17002
16953
|
"aria-multiselectable": isMultiselect,
|
|
17003
|
-
className:
|
|
16954
|
+
className: clsx39(
|
|
17004
16955
|
"dataviews-view-picker-grid",
|
|
17005
16956
|
className2
|
|
17006
16957
|
),
|
|
@@ -17070,7 +17021,7 @@ function ViewPickerGrid({
|
|
|
17070
17021
|
render: /* @__PURE__ */ jsx56(
|
|
17071
17022
|
GridItems,
|
|
17072
17023
|
{
|
|
17073
|
-
className:
|
|
17024
|
+
className: clsx39(
|
|
17074
17025
|
"dataviews-view-picker-grid",
|
|
17075
17026
|
className2
|
|
17076
17027
|
),
|
|
@@ -17118,7 +17069,7 @@ function ViewPickerGrid({
|
|
|
17118
17069
|
!hasData && /* @__PURE__ */ jsx56(
|
|
17119
17070
|
"div",
|
|
17120
17071
|
{
|
|
17121
|
-
className:
|
|
17072
|
+
className: clsx39({
|
|
17122
17073
|
"dataviews-loading": isLoading,
|
|
17123
17074
|
"dataviews-no-results": !isLoading
|
|
17124
17075
|
}),
|
|
@@ -17132,7 +17083,7 @@ function ViewPickerGrid({
|
|
|
17132
17083
|
var picker_grid_default = ViewPickerGrid;
|
|
17133
17084
|
|
|
17134
17085
|
// src/components/dataviews-layouts/picker-table/index.tsx
|
|
17135
|
-
import
|
|
17086
|
+
import clsx40 from "clsx";
|
|
17136
17087
|
import { __ as __32, sprintf as sprintf13 } from "@wordpress/i18n";
|
|
17137
17088
|
import { Fragment as Fragment10, jsx as jsx57, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
17138
17089
|
function TableColumnField2({
|
|
@@ -17145,7 +17096,7 @@ function TableColumnField2({
|
|
|
17145
17096
|
if (!field) {
|
|
17146
17097
|
return null;
|
|
17147
17098
|
}
|
|
17148
|
-
const className2 =
|
|
17099
|
+
const className2 = clsx40("dataviews-view-table__cell-content-wrapper", {
|
|
17149
17100
|
"dataviews-view-table__cell-align-end": align === "end",
|
|
17150
17101
|
"dataviews-view-table__cell-align-center": align === "center"
|
|
17151
17102
|
});
|
|
@@ -17188,7 +17139,7 @@ function TableRow2({
|
|
|
17188
17139
|
render: ({ children, ...props }) => /* @__PURE__ */ jsx57(
|
|
17189
17140
|
"tr",
|
|
17190
17141
|
{
|
|
17191
|
-
className:
|
|
17142
|
+
className: clsx40("dataviews-view-table__row", {
|
|
17192
17143
|
"is-selected": isSelected,
|
|
17193
17144
|
"is-hovered": isHovered
|
|
17194
17145
|
}),
|
|
@@ -17333,7 +17284,7 @@ function ViewPickerTable({
|
|
|
17333
17284
|
/* @__PURE__ */ jsxs16(
|
|
17334
17285
|
"table",
|
|
17335
17286
|
{
|
|
17336
|
-
className:
|
|
17287
|
+
className: clsx40(
|
|
17337
17288
|
"dataviews-view-table",
|
|
17338
17289
|
"dataviews-view-picker-table",
|
|
17339
17290
|
className2,
|
|
@@ -17494,7 +17445,7 @@ function ViewPickerTable({
|
|
|
17494
17445
|
/* @__PURE__ */ jsxs16(
|
|
17495
17446
|
"div",
|
|
17496
17447
|
{
|
|
17497
|
-
className:
|
|
17448
|
+
className: clsx40({
|
|
17498
17449
|
"dataviews-loading": isLoading,
|
|
17499
17450
|
"dataviews-no-results": !hasData && !isLoading
|
|
17500
17451
|
}),
|
|
@@ -17683,13 +17634,13 @@ var VIEW_LAYOUTS = [
|
|
|
17683
17634
|
];
|
|
17684
17635
|
|
|
17685
17636
|
// src/components/dataviews-filters/filter.tsx
|
|
17686
|
-
import
|
|
17637
|
+
import clsx42 from "clsx";
|
|
17687
17638
|
import { __ as __38, sprintf as sprintf16 } from "@wordpress/i18n";
|
|
17688
17639
|
|
|
17689
17640
|
// src/components/dataviews-filters/search-widget.tsx
|
|
17690
17641
|
import * as Ariakit21 from "@ariakit/react";
|
|
17691
17642
|
import removeAccents2 from "remove-accents";
|
|
17692
|
-
import
|
|
17643
|
+
import clsx41 from "clsx";
|
|
17693
17644
|
import { __ as __36, sprintf as sprintf14 } from "@wordpress/i18n";
|
|
17694
17645
|
|
|
17695
17646
|
// src/components/dataviews-filters/utils.ts
|
|
@@ -17768,7 +17719,7 @@ var MultiSelectionOption = ({ selected }) => {
|
|
|
17768
17719
|
return /* @__PURE__ */ jsx60(
|
|
17769
17720
|
"span",
|
|
17770
17721
|
{
|
|
17771
|
-
className:
|
|
17722
|
+
className: clsx41(
|
|
17772
17723
|
"dataviews-filters__search-widget-listitem-multi-selection",
|
|
17773
17724
|
{ "is-selected": selected }
|
|
17774
17725
|
),
|
|
@@ -17780,7 +17731,7 @@ var SingleSelectionOption = ({ selected }) => {
|
|
|
17780
17731
|
return /* @__PURE__ */ jsx60(
|
|
17781
17732
|
"span",
|
|
17782
17733
|
{
|
|
17783
|
-
className:
|
|
17734
|
+
className: clsx41(
|
|
17784
17735
|
"dataviews-filters__search-widget-listitem-single-selection",
|
|
17785
17736
|
{ "is-selected": selected }
|
|
17786
17737
|
)
|
|
@@ -18871,7 +18822,7 @@ function Filter({
|
|
|
18871
18822
|
children: /* @__PURE__ */ jsx63(
|
|
18872
18823
|
"div",
|
|
18873
18824
|
{
|
|
18874
|
-
className:
|
|
18825
|
+
className: clsx42(
|
|
18875
18826
|
"dataviews-filters__summary-chip",
|
|
18876
18827
|
{
|
|
18877
18828
|
"has-reset": canResetOrRemove,
|
|
@@ -18916,7 +18867,7 @@ function Filter({
|
|
|
18916
18867
|
children: /* @__PURE__ */ jsx63(
|
|
18917
18868
|
"button",
|
|
18918
18869
|
{
|
|
18919
|
-
className:
|
|
18870
|
+
className: clsx42(
|
|
18920
18871
|
"dataviews-filters__summary-chip-remove",
|
|
18921
18872
|
{ "has-values": hasValues }
|
|
18922
18873
|
),
|
|
@@ -19331,7 +19282,7 @@ function DataViewsLayout({ className: className2 }) {
|
|
|
19331
19282
|
}
|
|
19332
19283
|
|
|
19333
19284
|
// src/components/dataviews-footer/index.tsx
|
|
19334
|
-
import
|
|
19285
|
+
import clsx43 from "clsx";
|
|
19335
19286
|
import { jsx as jsx70, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
19336
19287
|
var EMPTY_ARRAY5 = [];
|
|
19337
19288
|
function DataViewsFooter() {
|
|
@@ -19361,7 +19312,7 @@ function DataViewsFooter() {
|
|
|
19361
19312
|
direction: "row",
|
|
19362
19313
|
justify: "end",
|
|
19363
19314
|
align: "center",
|
|
19364
|
-
className:
|
|
19315
|
+
className: clsx43("dataviews-footer__content", {
|
|
19365
19316
|
"is-refreshing": isDelayedRefreshing
|
|
19366
19317
|
}),
|
|
19367
19318
|
gap: "sm",
|
|
@@ -19862,12 +19813,11 @@ function Combobox2({
|
|
|
19862
19813
|
}
|
|
19863
19814
|
|
|
19864
19815
|
// src/components/dataform-controls/datetime.tsx
|
|
19865
|
-
import { format } from "date-fns";
|
|
19866
19816
|
import { __ as __47 } from "@wordpress/i18n";
|
|
19867
|
-
import { getSettings } from "@wordpress/date";
|
|
19817
|
+
import { dateI18n, getDate as getDate3, getSettings } from "@wordpress/date";
|
|
19868
19818
|
|
|
19869
19819
|
// src/components/dataform-controls/utils/relative-date-control.tsx
|
|
19870
|
-
import
|
|
19820
|
+
import clsx44 from "clsx";
|
|
19871
19821
|
import { __ as __46 } from "@wordpress/i18n";
|
|
19872
19822
|
import { jsx as jsx76, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
19873
19823
|
var TIME_UNITS_OPTIONS = {
|
|
@@ -19893,7 +19843,7 @@ function RelativeDateControl({
|
|
|
19893
19843
|
operator
|
|
19894
19844
|
}) {
|
|
19895
19845
|
const options2 = TIME_UNITS_OPTIONS[operator === OPERATOR_IN_THE_PAST ? "inThePast" : "over"];
|
|
19896
|
-
const { id, label, getValue, setValue } = field;
|
|
19846
|
+
const { id, label, description, getValue, setValue } = field;
|
|
19897
19847
|
const fieldValue = getValue({ item: data });
|
|
19898
19848
|
const { value: relValue = "", unit = options2[0].value } = fieldValue && typeof fieldValue === "object" ? fieldValue : {};
|
|
19899
19849
|
const onChangeValue = useCallback(
|
|
@@ -19918,9 +19868,10 @@ function RelativeDateControl({
|
|
|
19918
19868
|
base_control_default,
|
|
19919
19869
|
{
|
|
19920
19870
|
id,
|
|
19921
|
-
className:
|
|
19871
|
+
className: clsx44(className2, "dataviews-controls__relative-date"),
|
|
19922
19872
|
label,
|
|
19923
19873
|
hideLabelFromVision,
|
|
19874
|
+
help: description,
|
|
19924
19875
|
children: /* @__PURE__ */ jsxs24(Stack, { direction: "row", gap: "sm", children: [
|
|
19925
19876
|
/* @__PURE__ */ jsx76(
|
|
19926
19877
|
number_control_default,
|
|
@@ -19965,14 +19916,11 @@ function parseDateTime(dateTimeString) {
|
|
|
19965
19916
|
// src/components/dataform-controls/datetime.tsx
|
|
19966
19917
|
import { jsx as jsx77, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
19967
19918
|
var { DateCalendar: DateCalendar2, ValidatedInputControl: ValidatedInputControl2 } = unlock3(privateApis);
|
|
19968
|
-
var formatDateTime = (
|
|
19969
|
-
if (!
|
|
19919
|
+
var formatDateTime = (value) => {
|
|
19920
|
+
if (!value) {
|
|
19970
19921
|
return "";
|
|
19971
19922
|
}
|
|
19972
|
-
|
|
19973
|
-
return date;
|
|
19974
|
-
}
|
|
19975
|
-
return format(date, "yyyy-MM-dd'T'HH:mm");
|
|
19923
|
+
return dateI18n("Y-m-d\\TH:i", getDate3(value));
|
|
19976
19924
|
};
|
|
19977
19925
|
function CalendarDateTimeControl({
|
|
19978
19926
|
data,
|
|
@@ -20007,17 +19955,14 @@ function CalendarDateTimeControl({
|
|
|
20007
19955
|
(newDate) => {
|
|
20008
19956
|
let dateTimeValue;
|
|
20009
19957
|
if (newDate) {
|
|
20010
|
-
|
|
19958
|
+
const wpDate = dateI18n("Y-m-d", newDate);
|
|
19959
|
+
let wpTime;
|
|
20011
19960
|
if (value) {
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
finalDateTime.setHours(currentDateTime.getHours());
|
|
20016
|
-
finalDateTime.setMinutes(
|
|
20017
|
-
currentDateTime.getMinutes()
|
|
20018
|
-
);
|
|
20019
|
-
}
|
|
19961
|
+
wpTime = dateI18n("H:i", getDate3(value));
|
|
19962
|
+
} else {
|
|
19963
|
+
wpTime = dateI18n("H:i", newDate);
|
|
20020
19964
|
}
|
|
19965
|
+
const finalDateTime = getDate3(`${wpDate}T${wpTime}`);
|
|
20021
19966
|
dateTimeValue = finalDateTime.toISOString();
|
|
20022
19967
|
onChangeCallback(dateTimeValue);
|
|
20023
19968
|
if (validationTimeoutRef.current) {
|
|
@@ -20043,7 +19988,7 @@ function CalendarDateTimeControl({
|
|
|
20043
19988
|
const handleManualDateTimeChange = useCallback(
|
|
20044
19989
|
(newValue) => {
|
|
20045
19990
|
if (newValue) {
|
|
20046
|
-
const dateTime =
|
|
19991
|
+
const dateTime = getDate3(newValue);
|
|
20047
19992
|
onChangeCallback(dateTime.toISOString());
|
|
20048
19993
|
const parsedDate = parseDateTime(dateTime.toISOString());
|
|
20049
19994
|
if (parsedDate) {
|
|
@@ -20074,18 +20019,6 @@ function CalendarDateTimeControl({
|
|
|
20074
20019
|
help: description,
|
|
20075
20020
|
hideLabelFromVision,
|
|
20076
20021
|
children: /* @__PURE__ */ jsxs25(Stack, { direction: "column", gap: "lg", children: [
|
|
20077
|
-
/* @__PURE__ */ jsx77(
|
|
20078
|
-
DateCalendar2,
|
|
20079
|
-
{
|
|
20080
|
-
style: { width: "100%" },
|
|
20081
|
-
selected: value ? parseDateTime(value) || void 0 : void 0,
|
|
20082
|
-
onSelect: onSelectDate,
|
|
20083
|
-
month: calendarMonth,
|
|
20084
|
-
onMonthChange: setCalendarMonth,
|
|
20085
|
-
timeZone: timezoneString || void 0,
|
|
20086
|
-
weekStartsOn
|
|
20087
|
-
}
|
|
20088
|
-
),
|
|
20089
20022
|
/* @__PURE__ */ jsx77(
|
|
20090
20023
|
ValidatedInputControl2,
|
|
20091
20024
|
{
|
|
@@ -20096,11 +20029,21 @@ function CalendarDateTimeControl({
|
|
|
20096
20029
|
type: "datetime-local",
|
|
20097
20030
|
label: __47("Date time"),
|
|
20098
20031
|
hideLabelFromVision: true,
|
|
20099
|
-
value:
|
|
20100
|
-
parseDateTime(value) || void 0
|
|
20101
|
-
) : "",
|
|
20032
|
+
value: formatDateTime(value),
|
|
20102
20033
|
onChange: handleManualDateTimeChange
|
|
20103
20034
|
}
|
|
20035
|
+
),
|
|
20036
|
+
/* @__PURE__ */ jsx77(
|
|
20037
|
+
DateCalendar2,
|
|
20038
|
+
{
|
|
20039
|
+
style: { width: "100%" },
|
|
20040
|
+
selected: value ? parseDateTime(value) || void 0 : void 0,
|
|
20041
|
+
onSelect: onSelectDate,
|
|
20042
|
+
month: calendarMonth,
|
|
20043
|
+
onMonthChange: setCalendarMonth,
|
|
20044
|
+
timeZone: timezoneString || void 0,
|
|
20045
|
+
weekStartsOn
|
|
20046
|
+
}
|
|
20104
20047
|
)
|
|
20105
20048
|
] })
|
|
20106
20049
|
}
|
|
@@ -20142,9 +20085,9 @@ function DateTime({
|
|
|
20142
20085
|
}
|
|
20143
20086
|
|
|
20144
20087
|
// src/components/dataform-controls/date.tsx
|
|
20145
|
-
import
|
|
20088
|
+
import clsx45 from "clsx";
|
|
20146
20089
|
import {
|
|
20147
|
-
format
|
|
20090
|
+
format,
|
|
20148
20091
|
isValid as isValidDate2,
|
|
20149
20092
|
subMonths as subMonths2,
|
|
20150
20093
|
subDays as subDays2,
|
|
@@ -20153,20 +20096,20 @@ import {
|
|
|
20153
20096
|
startOfYear
|
|
20154
20097
|
} from "date-fns";
|
|
20155
20098
|
import { __ as __48 } from "@wordpress/i18n";
|
|
20156
|
-
import { getDate as
|
|
20099
|
+
import { getDate as getDate4, getSettings as getSettings2 } from "@wordpress/date";
|
|
20157
20100
|
import { jsx as jsx78, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
20158
20101
|
var { DateCalendar: DateCalendar3, DateRangeCalendar: DateRangeCalendar2 } = unlock3(privateApis);
|
|
20159
20102
|
var DATE_PRESETS = [
|
|
20160
20103
|
{
|
|
20161
20104
|
id: "today",
|
|
20162
20105
|
label: __48("Today"),
|
|
20163
|
-
getValue: () =>
|
|
20106
|
+
getValue: () => getDate4(null)
|
|
20164
20107
|
},
|
|
20165
20108
|
{
|
|
20166
20109
|
id: "yesterday",
|
|
20167
20110
|
label: __48("Yesterday"),
|
|
20168
20111
|
getValue: () => {
|
|
20169
|
-
const today =
|
|
20112
|
+
const today = getDate4(null);
|
|
20170
20113
|
return subDays2(today, 1);
|
|
20171
20114
|
}
|
|
20172
20115
|
},
|
|
@@ -20174,7 +20117,7 @@ var DATE_PRESETS = [
|
|
|
20174
20117
|
id: "past-week",
|
|
20175
20118
|
label: __48("Past week"),
|
|
20176
20119
|
getValue: () => {
|
|
20177
|
-
const today =
|
|
20120
|
+
const today = getDate4(null);
|
|
20178
20121
|
return subDays2(today, 7);
|
|
20179
20122
|
}
|
|
20180
20123
|
},
|
|
@@ -20182,7 +20125,7 @@ var DATE_PRESETS = [
|
|
|
20182
20125
|
id: "past-month",
|
|
20183
20126
|
label: __48("Past month"),
|
|
20184
20127
|
getValue: () => {
|
|
20185
|
-
const today =
|
|
20128
|
+
const today = getDate4(null);
|
|
20186
20129
|
return subMonths2(today, 1);
|
|
20187
20130
|
}
|
|
20188
20131
|
}
|
|
@@ -20192,7 +20135,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20192
20135
|
id: "last-7-days",
|
|
20193
20136
|
label: __48("Last 7 days"),
|
|
20194
20137
|
getValue: () => {
|
|
20195
|
-
const today =
|
|
20138
|
+
const today = getDate4(null);
|
|
20196
20139
|
return [subDays2(today, 7), today];
|
|
20197
20140
|
}
|
|
20198
20141
|
},
|
|
@@ -20200,7 +20143,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20200
20143
|
id: "last-30-days",
|
|
20201
20144
|
label: __48("Last 30 days"),
|
|
20202
20145
|
getValue: () => {
|
|
20203
|
-
const today =
|
|
20146
|
+
const today = getDate4(null);
|
|
20204
20147
|
return [subDays2(today, 30), today];
|
|
20205
20148
|
}
|
|
20206
20149
|
},
|
|
@@ -20208,7 +20151,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20208
20151
|
id: "month-to-date",
|
|
20209
20152
|
label: __48("Month to date"),
|
|
20210
20153
|
getValue: () => {
|
|
20211
|
-
const today =
|
|
20154
|
+
const today = getDate4(null);
|
|
20212
20155
|
return [startOfMonth(today), today];
|
|
20213
20156
|
}
|
|
20214
20157
|
},
|
|
@@ -20216,7 +20159,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20216
20159
|
id: "last-year",
|
|
20217
20160
|
label: __48("Last year"),
|
|
20218
20161
|
getValue: () => {
|
|
20219
|
-
const today =
|
|
20162
|
+
const today = getDate4(null);
|
|
20220
20163
|
return [subYears2(today, 1), today];
|
|
20221
20164
|
}
|
|
20222
20165
|
},
|
|
@@ -20224,7 +20167,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20224
20167
|
id: "year-to-date",
|
|
20225
20168
|
label: __48("Year to date"),
|
|
20226
20169
|
getValue: () => {
|
|
20227
|
-
const today =
|
|
20170
|
+
const today = getDate4(null);
|
|
20228
20171
|
return [startOfYear(today), today];
|
|
20229
20172
|
}
|
|
20230
20173
|
}
|
|
@@ -20233,14 +20176,14 @@ var parseDate = (dateString) => {
|
|
|
20233
20176
|
if (!dateString) {
|
|
20234
20177
|
return null;
|
|
20235
20178
|
}
|
|
20236
|
-
const parsed =
|
|
20179
|
+
const parsed = getDate4(dateString);
|
|
20237
20180
|
return parsed && isValidDate2(parsed) ? parsed : null;
|
|
20238
20181
|
};
|
|
20239
20182
|
var formatDate = (date) => {
|
|
20240
20183
|
if (!date) {
|
|
20241
20184
|
return "";
|
|
20242
20185
|
}
|
|
20243
|
-
return typeof date === "string" ? date :
|
|
20186
|
+
return typeof date === "string" ? date : format(date, "yyyy-MM-dd");
|
|
20244
20187
|
};
|
|
20245
20188
|
function ValidatedDateControl({
|
|
20246
20189
|
field,
|
|
@@ -20317,7 +20260,7 @@ function ValidatedDateControl({
|
|
|
20317
20260
|
/* @__PURE__ */ jsx78("div", { "aria-live": "polite", children: customValidity && /* @__PURE__ */ jsxs26(
|
|
20318
20261
|
"p",
|
|
20319
20262
|
{
|
|
20320
|
-
className:
|
|
20263
|
+
className: clsx45(
|
|
20321
20264
|
"components-validated-control__indicator",
|
|
20322
20265
|
customValidity.type === "invalid" ? "is-invalid" : void 0
|
|
20323
20266
|
),
|
|
@@ -20348,6 +20291,7 @@ function CalendarDateControl({
|
|
|
20348
20291
|
const {
|
|
20349
20292
|
id,
|
|
20350
20293
|
label,
|
|
20294
|
+
description,
|
|
20351
20295
|
setValue,
|
|
20352
20296
|
getValue,
|
|
20353
20297
|
isValid,
|
|
@@ -20371,7 +20315,7 @@ function CalendarDateControl({
|
|
|
20371
20315
|
);
|
|
20372
20316
|
const onSelectDate = useCallback(
|
|
20373
20317
|
(newDate) => {
|
|
20374
|
-
const dateValue = newDate ?
|
|
20318
|
+
const dateValue = newDate ? format(newDate, "yyyy-MM-dd") : void 0;
|
|
20375
20319
|
onChangeCallback(dateValue);
|
|
20376
20320
|
setSelectedPresetId(null);
|
|
20377
20321
|
setIsTouched(true);
|
|
@@ -20426,6 +20370,7 @@ function CalendarDateControl({
|
|
|
20426
20370
|
id,
|
|
20427
20371
|
className: "dataviews-controls__date",
|
|
20428
20372
|
label: displayLabel,
|
|
20373
|
+
help: description,
|
|
20429
20374
|
hideLabelFromVision,
|
|
20430
20375
|
children: /* @__PURE__ */ jsxs26(Stack, { direction: "column", gap: "lg", children: [
|
|
20431
20376
|
/* @__PURE__ */ jsxs26(
|
|
@@ -20505,7 +20450,14 @@ function CalendarDateRangeControl({
|
|
|
20505
20450
|
markWhenOptional,
|
|
20506
20451
|
validity
|
|
20507
20452
|
}) {
|
|
20508
|
-
const {
|
|
20453
|
+
const {
|
|
20454
|
+
id,
|
|
20455
|
+
label,
|
|
20456
|
+
description,
|
|
20457
|
+
getValue,
|
|
20458
|
+
setValue,
|
|
20459
|
+
format: fieldFormat
|
|
20460
|
+
} = field;
|
|
20509
20461
|
let value;
|
|
20510
20462
|
const fieldValue = getValue({ item: data });
|
|
20511
20463
|
if (Array.isArray(fieldValue) && fieldValue.length === 2 && fieldValue.every((date) => typeof date === "string")) {
|
|
@@ -20614,6 +20566,7 @@ function CalendarDateRangeControl({
|
|
|
20614
20566
|
id,
|
|
20615
20567
|
className: "dataviews-controls__date",
|
|
20616
20568
|
label: displayLabel,
|
|
20569
|
+
help: description,
|
|
20617
20570
|
hideLabelFromVision,
|
|
20618
20571
|
children: /* @__PURE__ */ jsxs26(Stack, { direction: "column", gap: "lg", children: [
|
|
20619
20572
|
/* @__PURE__ */ jsxs26(
|
|
@@ -21783,7 +21736,7 @@ function isValidMax(item2, field) {
|
|
|
21783
21736
|
}
|
|
21784
21737
|
|
|
21785
21738
|
// src/field-types/integer.tsx
|
|
21786
|
-
var
|
|
21739
|
+
var format2 = {
|
|
21787
21740
|
separatorThousand: ","
|
|
21788
21741
|
};
|
|
21789
21742
|
function getValueFormatted2({
|
|
@@ -21800,7 +21753,7 @@ function getValueFormatted2({
|
|
|
21800
21753
|
}
|
|
21801
21754
|
let formatInteger;
|
|
21802
21755
|
if (field.type !== "integer") {
|
|
21803
|
-
formatInteger =
|
|
21756
|
+
formatInteger = format2;
|
|
21804
21757
|
} else {
|
|
21805
21758
|
formatInteger = field.format;
|
|
21806
21759
|
}
|
|
@@ -21852,7 +21805,7 @@ var integer_default = {
|
|
|
21852
21805
|
OPERATOR_IS_ALL,
|
|
21853
21806
|
OPERATOR_IS_NOT_ALL
|
|
21854
21807
|
],
|
|
21855
|
-
format:
|
|
21808
|
+
format: format2,
|
|
21856
21809
|
getValueFormatted: getValueFormatted2,
|
|
21857
21810
|
validate: {
|
|
21858
21811
|
required: isValidRequired,
|
|
@@ -21865,7 +21818,7 @@ var integer_default = {
|
|
|
21865
21818
|
|
|
21866
21819
|
// src/field-types/number.tsx
|
|
21867
21820
|
import { __ as __54 } from "@wordpress/i18n";
|
|
21868
|
-
var
|
|
21821
|
+
var format3 = {
|
|
21869
21822
|
separatorThousand: ",",
|
|
21870
21823
|
separatorDecimal: ".",
|
|
21871
21824
|
decimals: 2
|
|
@@ -21884,7 +21837,7 @@ function getValueFormatted3({
|
|
|
21884
21837
|
}
|
|
21885
21838
|
let formatNumber;
|
|
21886
21839
|
if (field.type !== "number") {
|
|
21887
|
-
formatNumber =
|
|
21840
|
+
formatNumber = format3;
|
|
21888
21841
|
} else {
|
|
21889
21842
|
formatNumber = field.format;
|
|
21890
21843
|
}
|
|
@@ -21935,7 +21888,7 @@ var number_default = {
|
|
|
21935
21888
|
OPERATOR_IS_ALL,
|
|
21936
21889
|
OPERATOR_IS_NOT_ALL
|
|
21937
21890
|
],
|
|
21938
|
-
format:
|
|
21891
|
+
format: format3,
|
|
21939
21892
|
getValueFormatted: getValueFormatted3,
|
|
21940
21893
|
validate: {
|
|
21941
21894
|
required: isValidRequired,
|
|
@@ -21980,8 +21933,8 @@ var text_default = {
|
|
|
21980
21933
|
};
|
|
21981
21934
|
|
|
21982
21935
|
// src/field-types/datetime.tsx
|
|
21983
|
-
import { dateI18n, getDate as
|
|
21984
|
-
var
|
|
21936
|
+
import { dateI18n as dateI18n2, getDate as getDate5, getSettings as getSettings3 } from "@wordpress/date";
|
|
21937
|
+
var format4 = {
|
|
21985
21938
|
datetime: getSettings3().formats.datetime,
|
|
21986
21939
|
weekStartsOn: getSettings3().l10n.startOfWeek
|
|
21987
21940
|
};
|
|
@@ -21995,11 +21948,11 @@ function getValueFormatted4({
|
|
|
21995
21948
|
}
|
|
21996
21949
|
let formatDatetime;
|
|
21997
21950
|
if (field.type !== "datetime") {
|
|
21998
|
-
formatDatetime =
|
|
21951
|
+
formatDatetime = format4;
|
|
21999
21952
|
} else {
|
|
22000
21953
|
formatDatetime = field.format;
|
|
22001
21954
|
}
|
|
22002
|
-
return
|
|
21955
|
+
return dateI18n2(formatDatetime.datetime, getDate5(value));
|
|
22003
21956
|
}
|
|
22004
21957
|
var sort = (a, b, direction) => {
|
|
22005
21958
|
const timeA = new Date(a).getTime();
|
|
@@ -22033,7 +21986,7 @@ var datetime_default = {
|
|
|
22033
21986
|
OPERATOR_IN_THE_PAST,
|
|
22034
21987
|
OPERATOR_OVER
|
|
22035
21988
|
],
|
|
22036
|
-
format:
|
|
21989
|
+
format: format4,
|
|
22037
21990
|
getValueFormatted: getValueFormatted4,
|
|
22038
21991
|
validate: {
|
|
22039
21992
|
required: isValidRequired,
|
|
@@ -22042,8 +21995,8 @@ var datetime_default = {
|
|
|
22042
21995
|
};
|
|
22043
21996
|
|
|
22044
21997
|
// src/field-types/date.tsx
|
|
22045
|
-
import { dateI18n as
|
|
22046
|
-
var
|
|
21998
|
+
import { dateI18n as dateI18n3, getDate as getDate6, getSettings as getSettings4 } from "@wordpress/date";
|
|
21999
|
+
var format5 = {
|
|
22047
22000
|
date: getSettings4().formats.date,
|
|
22048
22001
|
weekStartsOn: getSettings4().l10n.startOfWeek
|
|
22049
22002
|
};
|
|
@@ -22057,11 +22010,11 @@ function getValueFormatted5({
|
|
|
22057
22010
|
}
|
|
22058
22011
|
let formatDate2;
|
|
22059
22012
|
if (field.type !== "date") {
|
|
22060
|
-
formatDate2 =
|
|
22013
|
+
formatDate2 = format5;
|
|
22061
22014
|
} else {
|
|
22062
22015
|
formatDate2 = field.format;
|
|
22063
22016
|
}
|
|
22064
|
-
return
|
|
22017
|
+
return dateI18n3(formatDate2.date, getDate6(value));
|
|
22065
22018
|
}
|
|
22066
22019
|
var sort2 = (a, b, direction) => {
|
|
22067
22020
|
const timeA = new Date(a).getTime();
|
|
@@ -22097,7 +22050,7 @@ var date_default = {
|
|
|
22097
22050
|
OPERATOR_OVER,
|
|
22098
22051
|
OPERATOR_BETWEEN
|
|
22099
22052
|
],
|
|
22100
|
-
format:
|
|
22053
|
+
format: format5,
|
|
22101
22054
|
getValueFormatted: getValueFormatted5,
|
|
22102
22055
|
validate: {
|
|
22103
22056
|
required: isValidRequired,
|
|
@@ -23023,9 +22976,10 @@ function DataFormProvider({
|
|
|
23023
22976
|
var dataform_context_default = DataFormContext;
|
|
23024
22977
|
|
|
23025
22978
|
// src/components/dataform-layouts/regular/index.tsx
|
|
23026
|
-
import
|
|
22979
|
+
import clsx46 from "clsx";
|
|
23027
22980
|
|
|
23028
22981
|
// src/components/dataform-layouts/normalize-form.ts
|
|
22982
|
+
import { __ as __58 } from "@wordpress/i18n";
|
|
23029
22983
|
var DEFAULT_LAYOUT = {
|
|
23030
22984
|
type: "regular",
|
|
23031
22985
|
labelPosition: "top"
|
|
@@ -23051,10 +23005,27 @@ function normalizeLayout(layout) {
|
|
|
23051
23005
|
} else if (layout?.type === "panel") {
|
|
23052
23006
|
const summary = layout.summary ?? [];
|
|
23053
23007
|
const normalizedSummary = Array.isArray(summary) ? summary : [summary];
|
|
23008
|
+
const openAs = layout?.openAs;
|
|
23009
|
+
let normalizedOpenAs;
|
|
23010
|
+
if (typeof openAs === "object" && openAs.type === "modal") {
|
|
23011
|
+
normalizedOpenAs = {
|
|
23012
|
+
type: "modal",
|
|
23013
|
+
applyLabel: openAs.applyLabel?.trim() || __58("Apply"),
|
|
23014
|
+
cancelLabel: openAs.cancelLabel?.trim() || __58("Cancel")
|
|
23015
|
+
};
|
|
23016
|
+
} else if (openAs === "modal") {
|
|
23017
|
+
normalizedOpenAs = {
|
|
23018
|
+
type: "modal",
|
|
23019
|
+
applyLabel: __58("Apply"),
|
|
23020
|
+
cancelLabel: __58("Cancel")
|
|
23021
|
+
};
|
|
23022
|
+
} else {
|
|
23023
|
+
normalizedOpenAs = { type: "dropdown" };
|
|
23024
|
+
}
|
|
23054
23025
|
normalizedLayout = {
|
|
23055
23026
|
type: "panel",
|
|
23056
23027
|
labelPosition: layout?.labelPosition ?? "side",
|
|
23057
|
-
openAs:
|
|
23028
|
+
openAs: normalizedOpenAs,
|
|
23058
23029
|
summary: normalizedSummary,
|
|
23059
23030
|
editVisibility: layout?.editVisibility ?? "on-hover"
|
|
23060
23031
|
};
|
|
@@ -23187,7 +23158,7 @@ function FormRegularField({
|
|
|
23187
23158
|
/* @__PURE__ */ jsx102(
|
|
23188
23159
|
"div",
|
|
23189
23160
|
{
|
|
23190
|
-
className:
|
|
23161
|
+
className: clsx46(
|
|
23191
23162
|
"dataforms-layouts-regular__field-label",
|
|
23192
23163
|
`dataforms-layouts-regular__field-label--label-position-${labelPosition}`
|
|
23193
23164
|
),
|
|
@@ -23240,16 +23211,15 @@ function FormRegularField({
|
|
|
23240
23211
|
|
|
23241
23212
|
// src/components/dataform-layouts/panel/modal.tsx
|
|
23242
23213
|
import deepMerge2 from "deepmerge";
|
|
23243
|
-
import { __ as __59 } from "@wordpress/i18n";
|
|
23244
23214
|
|
|
23245
23215
|
// src/components/dataform-layouts/panel/summary-button.tsx
|
|
23246
|
-
import
|
|
23216
|
+
import clsx48 from "clsx";
|
|
23247
23217
|
import { sprintf as sprintf17, _x as _x5 } from "@wordpress/i18n";
|
|
23248
23218
|
|
|
23249
23219
|
// src/components/dataform-layouts/panel/utils/get-label-classname.ts
|
|
23250
|
-
import
|
|
23220
|
+
import clsx47 from "clsx";
|
|
23251
23221
|
function getLabelClassName(labelPosition, showError) {
|
|
23252
|
-
return
|
|
23222
|
+
return clsx47(
|
|
23253
23223
|
"dataforms-layouts-panel__field-label",
|
|
23254
23224
|
`dataforms-layouts-panel__field-label--label-position-${labelPosition}`,
|
|
23255
23225
|
{ "has-error": showError }
|
|
@@ -23320,7 +23290,7 @@ function SummaryButton({
|
|
|
23320
23290
|
const showError = touched && !!errorMessage;
|
|
23321
23291
|
const labelClassName = get_label_classname_default(labelPosition, showError);
|
|
23322
23292
|
const labelContent = get_label_content_default(showError, errorMessage, fieldLabel);
|
|
23323
|
-
const className2 =
|
|
23293
|
+
const className2 = clsx48(
|
|
23324
23294
|
"dataforms-layouts-panel__field-trigger",
|
|
23325
23295
|
`dataforms-layouts-panel__field-trigger--label-${labelPosition}`,
|
|
23326
23296
|
{
|
|
@@ -23426,7 +23396,7 @@ function SummaryButton({
|
|
|
23426
23396
|
// src/hooks/use-form-validity.ts
|
|
23427
23397
|
import deepMerge from "deepmerge";
|
|
23428
23398
|
import fastDeepEqual3 from "fast-deep-equal/es6/index.js";
|
|
23429
|
-
import { __ as
|
|
23399
|
+
import { __ as __59 } from "@wordpress/i18n";
|
|
23430
23400
|
function isFormValid(formValidity) {
|
|
23431
23401
|
if (!formValidity) {
|
|
23432
23402
|
return true;
|
|
@@ -23556,7 +23526,7 @@ function handleElementsValidationAsync(promise, formField, promiseHandler) {
|
|
|
23556
23526
|
{
|
|
23557
23527
|
elements: {
|
|
23558
23528
|
type: "invalid",
|
|
23559
|
-
message:
|
|
23529
|
+
message: __59("Could not validate elements.")
|
|
23560
23530
|
}
|
|
23561
23531
|
},
|
|
23562
23532
|
[...path, formField.id]
|
|
@@ -23575,7 +23545,7 @@ function handleElementsValidationAsync(promise, formField, promiseHandler) {
|
|
|
23575
23545
|
{
|
|
23576
23546
|
elements: {
|
|
23577
23547
|
type: "invalid",
|
|
23578
|
-
message:
|
|
23548
|
+
message: __59(
|
|
23579
23549
|
"Value must be one of the elements."
|
|
23580
23550
|
)
|
|
23581
23551
|
}
|
|
@@ -23601,7 +23571,7 @@ function handleElementsValidationAsync(promise, formField, promiseHandler) {
|
|
|
23601
23571
|
if (error instanceof Error) {
|
|
23602
23572
|
errorMessage = error.message;
|
|
23603
23573
|
} else {
|
|
23604
|
-
errorMessage = String(error) ||
|
|
23574
|
+
errorMessage = String(error) || __59(
|
|
23605
23575
|
"Unknown error when running elements validation asynchronously."
|
|
23606
23576
|
);
|
|
23607
23577
|
}
|
|
@@ -23660,7 +23630,7 @@ function handleCustomValidationAsync(promise, formField, promiseHandler) {
|
|
|
23660
23630
|
{
|
|
23661
23631
|
custom: {
|
|
23662
23632
|
type: "invalid",
|
|
23663
|
-
message:
|
|
23633
|
+
message: __59("Validation could not be processed.")
|
|
23664
23634
|
}
|
|
23665
23635
|
},
|
|
23666
23636
|
[...path, formField.id]
|
|
@@ -23675,7 +23645,7 @@ function handleCustomValidationAsync(promise, formField, promiseHandler) {
|
|
|
23675
23645
|
if (error instanceof Error) {
|
|
23676
23646
|
errorMessage = error.message;
|
|
23677
23647
|
} else {
|
|
23678
|
-
errorMessage = String(error) ||
|
|
23648
|
+
errorMessage = String(error) || __59(
|
|
23679
23649
|
"Unknown error when running custom validation asynchronously."
|
|
23680
23650
|
);
|
|
23681
23651
|
}
|
|
@@ -23704,7 +23674,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23704
23674
|
return {
|
|
23705
23675
|
pattern: {
|
|
23706
23676
|
type: "invalid",
|
|
23707
|
-
message:
|
|
23677
|
+
message: __59("Value does not match the required pattern.")
|
|
23708
23678
|
}
|
|
23709
23679
|
};
|
|
23710
23680
|
}
|
|
@@ -23712,7 +23682,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23712
23682
|
return {
|
|
23713
23683
|
min: {
|
|
23714
23684
|
type: "invalid",
|
|
23715
|
-
message:
|
|
23685
|
+
message: __59("Value is below the minimum.")
|
|
23716
23686
|
}
|
|
23717
23687
|
};
|
|
23718
23688
|
}
|
|
@@ -23720,7 +23690,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23720
23690
|
return {
|
|
23721
23691
|
max: {
|
|
23722
23692
|
type: "invalid",
|
|
23723
|
-
message:
|
|
23693
|
+
message: __59("Value is above the maximum.")
|
|
23724
23694
|
}
|
|
23725
23695
|
};
|
|
23726
23696
|
}
|
|
@@ -23728,7 +23698,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23728
23698
|
return {
|
|
23729
23699
|
minLength: {
|
|
23730
23700
|
type: "invalid",
|
|
23731
|
-
message:
|
|
23701
|
+
message: __59("Value is too short.")
|
|
23732
23702
|
}
|
|
23733
23703
|
};
|
|
23734
23704
|
}
|
|
@@ -23736,7 +23706,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23736
23706
|
return {
|
|
23737
23707
|
maxLength: {
|
|
23738
23708
|
type: "invalid",
|
|
23739
|
-
message:
|
|
23709
|
+
message: __59("Value is too long.")
|
|
23740
23710
|
}
|
|
23741
23711
|
};
|
|
23742
23712
|
}
|
|
@@ -23744,7 +23714,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23744
23714
|
return {
|
|
23745
23715
|
elements: {
|
|
23746
23716
|
type: "invalid",
|
|
23747
|
-
message:
|
|
23717
|
+
message: __59("Value must be one of the elements.")
|
|
23748
23718
|
}
|
|
23749
23719
|
};
|
|
23750
23720
|
}
|
|
@@ -23767,7 +23737,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23767
23737
|
if (error instanceof Error) {
|
|
23768
23738
|
errorMessage = error.message;
|
|
23769
23739
|
} else {
|
|
23770
|
-
errorMessage = String(error) ||
|
|
23740
|
+
errorMessage = String(error) || __59("Unknown error when running custom validation.");
|
|
23771
23741
|
}
|
|
23772
23742
|
return {
|
|
23773
23743
|
custom: {
|
|
@@ -23794,14 +23764,14 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23794
23764
|
);
|
|
23795
23765
|
fieldValidity.elements = {
|
|
23796
23766
|
type: "validating",
|
|
23797
|
-
message:
|
|
23767
|
+
message: __59("Validating\u2026")
|
|
23798
23768
|
};
|
|
23799
23769
|
}
|
|
23800
23770
|
if (customError instanceof Promise) {
|
|
23801
23771
|
handleCustomValidationAsync(customError, formField, promiseHandler);
|
|
23802
23772
|
fieldValidity.custom = {
|
|
23803
23773
|
type: "validating",
|
|
23804
|
-
message:
|
|
23774
|
+
message: __59("Validating\u2026")
|
|
23805
23775
|
};
|
|
23806
23776
|
}
|
|
23807
23777
|
if (Object.keys(fieldValidity).length > 0) {
|
|
@@ -24002,6 +23972,8 @@ function ModalContent({
|
|
|
24002
23972
|
onClose,
|
|
24003
23973
|
touched
|
|
24004
23974
|
}) {
|
|
23975
|
+
const { openAs } = field.layout;
|
|
23976
|
+
const { applyLabel, cancelLabel } = openAs;
|
|
24005
23977
|
const { fields } = useContext(dataform_context_default);
|
|
24006
23978
|
const [changes, setChanges] = useState({});
|
|
24007
23979
|
const modalData = useMemo(() => {
|
|
@@ -24092,7 +24064,7 @@ function ModalContent({
|
|
|
24092
24064
|
variant: "tertiary",
|
|
24093
24065
|
onClick: onClose,
|
|
24094
24066
|
__next40pxDefaultSize: true,
|
|
24095
|
-
children:
|
|
24067
|
+
children: cancelLabel
|
|
24096
24068
|
}
|
|
24097
24069
|
),
|
|
24098
24070
|
/* @__PURE__ */ jsx105(
|
|
@@ -24101,7 +24073,7 @@ function ModalContent({
|
|
|
24101
24073
|
variant: "primary",
|
|
24102
24074
|
onClick: onApply,
|
|
24103
24075
|
__next40pxDefaultSize: true,
|
|
24104
|
-
children:
|
|
24076
|
+
children: applyLabel
|
|
24105
24077
|
}
|
|
24106
24078
|
)
|
|
24107
24079
|
]
|
|
@@ -24317,7 +24289,7 @@ function FormPanelField({
|
|
|
24317
24289
|
validity
|
|
24318
24290
|
}) {
|
|
24319
24291
|
const layout = field.layout;
|
|
24320
|
-
if (layout.openAs === "modal") {
|
|
24292
|
+
if (layout.openAs.type === "modal") {
|
|
24321
24293
|
return /* @__PURE__ */ jsx107(
|
|
24322
24294
|
modal_default2,
|
|
24323
24295
|
{
|