@wordpress/dataviews 13.0.0 → 13.1.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 +25 -0
- package/README.md +2 -1
- 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-layout/index.cjs +12 -3
- package/build/components/dataviews-layout/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/grid/composite-grid.cjs +5 -1
- package/build/components/dataviews-layouts/grid/composite-grid.cjs.map +2 -2
- package/build/components/dataviews-layouts/index.cjs +3 -3
- package/build/components/dataviews-layouts/index.cjs.map +3 -3
- package/build/components/dataviews-layouts/picker-grid/index.cjs +13 -2
- package/build/components/dataviews-layouts/picker-grid/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/table/index.cjs +98 -89
- package/build/components/dataviews-layouts/table/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/table/{use-is-horizontal-scroll-end.cjs → use-scroll-state.cjs} +29 -33
- package/build/components/dataviews-layouts/table/use-scroll-state.cjs.map +7 -0
- package/build/components/dataviews-layouts/utils/density-picker.cjs.map +2 -2
- package/build/components/dataviews-layouts/utils/grid-config-options.cjs +45 -0
- package/build/components/dataviews-layouts/utils/grid-config-options.cjs.map +7 -0
- package/build/dataviews/index.cjs +12 -8
- package/build/dataviews/index.cjs.map +2 -2
- package/build/dataviews-picker/index.cjs +1 -1
- package/build/dataviews-picker/index.cjs.map +2 -2
- package/build/types/dataform.cjs.map +1 -1
- package/build/types/dataviews.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-layout/index.mjs +12 -3
- package/build-module/components/dataviews-layout/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs +5 -1
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/index.mjs +3 -3
- package/build-module/components/dataviews-layouts/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/picker-grid/index.mjs +13 -2
- package/build-module/components/dataviews-layouts/picker-grid/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/table/index.mjs +98 -89
- package/build-module/components/dataviews-layouts/table/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/table/use-scroll-state.mjs +46 -0
- package/build-module/components/dataviews-layouts/table/use-scroll-state.mjs.map +7 -0
- package/build-module/components/dataviews-layouts/utils/density-picker.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/utils/grid-config-options.mjs +14 -0
- package/build-module/components/dataviews-layouts/utils/grid-config-options.mjs.map +7 -0
- package/build-module/dataviews/index.mjs +12 -8
- package/build-module/dataviews/index.mjs.map +2 -2
- package/build-module/dataviews-picker/index.mjs +1 -1
- package/build-module/dataviews-picker/index.mjs.map +2 -2
- package/build-style/style-rtl.css +47 -5
- package/build-style/style.css +47 -5
- 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/components/dataviews-layout/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/grid/composite-grid.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/index.d.ts +3 -3
- package/build-types/components/dataviews-layouts/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/picker-grid/index.d.ts.map +1 -1
- 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/density-picker.d.ts.map +1 -1
- 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/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/dataviews/index.d.ts.map +1 -1
- package/build-types/dataviews/stories/empty.d.ts +1 -2
- package/build-types/dataviews/stories/empty.d.ts.map +1 -1
- package/build-types/dataviews/stories/free-composition.d.ts.map +1 -1
- package/build-types/dataviews/stories/index.story.d.ts +18 -10
- package/build-types/dataviews/stories/index.story.d.ts.map +1 -1
- package/build-types/dataviews/stories/infinite-scroll.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-activity.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-custom.d.ts +3 -1
- package/build-types/dataviews/stories/layout-custom.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-grid.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-list.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-table.d.ts.map +1 -1
- package/build-types/dataviews/stories/with-card.d.ts +3 -1
- package/build-types/dataviews/stories/with-card.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-types/types/dataviews.d.ts +8 -0
- package/build-types/types/dataviews.d.ts.map +1 -1
- package/build-wp/index.js +883 -866
- package/package.json +19 -19
- 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-layout/index.tsx +41 -19
- package/src/components/dataviews-layout/style.scss +8 -0
- package/src/components/dataviews-layouts/grid/composite-grid.tsx +7 -1
- package/src/components/dataviews-layouts/grid/style.scss +18 -2
- package/src/components/dataviews-layouts/index.ts +3 -3
- package/src/components/dataviews-layouts/picker-grid/index.tsx +17 -2
- package/src/components/dataviews-layouts/picker-grid/style.scss +10 -0
- package/src/components/dataviews-layouts/table/index.tsx +11 -5
- package/src/components/dataviews-layouts/table/style.scss +13 -0
- package/src/components/dataviews-layouts/table/use-scroll-state.ts +79 -0
- package/src/components/dataviews-layouts/utils/density-picker.tsx +12 -2
- package/src/components/dataviews-layouts/utils/grid-config-options.tsx +14 -0
- package/src/components/dataviews-layouts/utils/grid-items.scss +9 -1
- package/src/dataform/stories/index.story.tsx +15 -0
- package/src/dataform/stories/layout-panel.tsx +19 -4
- package/src/dataviews/index.tsx +17 -9
- package/src/dataviews/stories/empty.tsx +1 -3
- package/src/dataviews/stories/free-composition.tsx +32 -34
- package/src/dataviews/stories/index.story.tsx +31 -8
- package/src/dataviews/stories/infinite-scroll.tsx +0 -6
- package/src/dataviews/stories/layout-activity.tsx +1 -0
- package/src/dataviews/stories/layout-custom.tsx +7 -3
- package/src/dataviews/stories/layout-grid.tsx +1 -0
- package/src/dataviews/stories/layout-list.tsx +1 -0
- package/src/dataviews/stories/layout-table.tsx +1 -0
- package/src/dataviews/stories/style.css +0 -5
- package/src/dataviews/stories/with-card.tsx +6 -2
- package/src/dataviews/style.scss +0 -1
- package/src/dataviews/test/dataviews.tsx +42 -1
- package/src/dataviews-picker/index.tsx +1 -1
- package/src/style.scss +1 -0
- package/src/types/dataform.ts +15 -2
- package/src/types/dataviews.ts +10 -0
- package/build/components/dataviews-layouts/table/use-is-horizontal-scroll-end.cjs.map +0 -7
- package/build-module/components/dataviews-layouts/table/use-is-horizontal-scroll-end.mjs +0 -50
- package/build-module/components/dataviews-layouts/table/use-is-horizontal-scroll-end.mjs.map +0 -7
- package/build-types/components/dataviews-layouts/table/use-is-horizontal-scroll-end.d.ts +0 -19
- package/build-types/components/dataviews-layouts/table/use-is-horizontal-scroll-end.d.ts.map +0 -1
- package/src/components/dataviews-layouts/table/use-is-horizontal-scroll-end.ts +0 -82
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
|
}
|
|
@@ -1036,27 +1075,30 @@ function useEvent(callback) {
|
|
|
1036
1075
|
}
|
|
1037
1076
|
|
|
1038
1077
|
// ../compose/build-module/hooks/use-media-query/index.mjs
|
|
1039
|
-
var
|
|
1040
|
-
function getMediaQueryList(query) {
|
|
1078
|
+
var perWindowCache = /* @__PURE__ */ new WeakMap();
|
|
1079
|
+
function getMediaQueryList(view, query) {
|
|
1041
1080
|
if (!query) {
|
|
1042
1081
|
return null;
|
|
1043
1082
|
}
|
|
1083
|
+
const matchMediaCache = perWindowCache.get(view) ?? /* @__PURE__ */ new Map();
|
|
1084
|
+
if (!perWindowCache.has(view)) {
|
|
1085
|
+
perWindowCache.set(view, matchMediaCache);
|
|
1086
|
+
}
|
|
1044
1087
|
let match = matchMediaCache.get(query);
|
|
1045
1088
|
if (match) {
|
|
1046
1089
|
return match;
|
|
1047
1090
|
}
|
|
1048
|
-
if (typeof
|
|
1049
|
-
match =
|
|
1091
|
+
if (typeof view?.matchMedia === "function") {
|
|
1092
|
+
match = view.matchMedia(query);
|
|
1050
1093
|
matchMediaCache.set(query, match);
|
|
1051
1094
|
return match;
|
|
1052
1095
|
}
|
|
1053
1096
|
return null;
|
|
1054
1097
|
}
|
|
1055
|
-
function useMediaQuery(query) {
|
|
1098
|
+
function useMediaQuery(query, view = window) {
|
|
1056
1099
|
const source = useMemo(() => {
|
|
1057
|
-
const mediaQueryList = getMediaQueryList(query);
|
|
1100
|
+
const mediaQueryList = getMediaQueryList(view, query);
|
|
1058
1101
|
return {
|
|
1059
|
-
/** @type {(onStoreChange: () => void) => () => void} */
|
|
1060
1102
|
subscribe(onStoreChange) {
|
|
1061
1103
|
if (!mediaQueryList) {
|
|
1062
1104
|
return () => {
|
|
@@ -1074,7 +1116,7 @@ function useMediaQuery(query) {
|
|
|
1074
1116
|
return mediaQueryList?.matches ?? false;
|
|
1075
1117
|
}
|
|
1076
1118
|
};
|
|
1077
|
-
}, [query]);
|
|
1119
|
+
}, [view, query]);
|
|
1078
1120
|
return useSyncExternalStore(
|
|
1079
1121
|
source.subscribe,
|
|
1080
1122
|
source.getValue,
|
|
@@ -1119,10 +1161,10 @@ var ViewportMatchWidthContext = createContext(
|
|
|
1119
1161
|
null
|
|
1120
1162
|
);
|
|
1121
1163
|
ViewportMatchWidthContext.displayName = "ViewportMatchWidthContext";
|
|
1122
|
-
var useViewportMatch = (breakpoint2, operator = ">=") => {
|
|
1164
|
+
var useViewportMatch = (breakpoint2, operator = ">=", view = window) => {
|
|
1123
1165
|
const simulatedWidth = useContext(ViewportMatchWidthContext);
|
|
1124
1166
|
const mediaQuery = !simulatedWidth && `(${CONDITIONS[operator]}: ${BREAKPOINTS[breakpoint2]}px)`;
|
|
1125
|
-
const mediaQueryResult = useMediaQuery(mediaQuery || void 0);
|
|
1167
|
+
const mediaQueryResult = useMediaQuery(mediaQuery || void 0, view);
|
|
1126
1168
|
if (simulatedWidth) {
|
|
1127
1169
|
return OPERATOR_EVALUATORS[operator](
|
|
1128
1170
|
BREAKPOINTS[breakpoint2],
|
|
@@ -1255,10 +1297,10 @@ function useObservableValue(map, name) {
|
|
|
1255
1297
|
// ../ui/build-module/badge/badge.mjs
|
|
1256
1298
|
import { useRender, mergeProps } from "@base-ui/react";
|
|
1257
1299
|
import clsx from "clsx";
|
|
1258
|
-
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='
|
|
1300
|
+
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='d16010fae9']")) {
|
|
1259
1301
|
const style = document.createElement("style");
|
|
1260
|
-
style.setAttribute("data-wp-hash", "
|
|
1261
|
-
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-sm,12px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-xs,16px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wpds-dimension-padding-sm,8px)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error,#f6e6e3);color:var(--wpds-color-fg-content-error,#470000)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning,#fde6bd);color:var(--wpds-color-fg-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution,#fee994);color:var(--wpds-color-fg-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success,#c5f7cc);color:var(--wpds-color-fg-content-success,#002900)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info,#deebfa);color:var(--wpds-color-fg-content-info,#001b4f)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral,#
|
|
1302
|
+
style.setAttribute("data-wp-hash", "d16010fae9");
|
|
1303
|
+
style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-sm,12px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-xs,16px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wpds-dimension-padding-sm,8px)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error,#f6e6e3);color:var(--wpds-color-fg-content-error,#470000)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning,#fde6bd);color:var(--wpds-color-fg-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution,#fee994);color:var(--wpds-color-fg-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success,#c5f7cc);color:var(--wpds-color-fg-content-success,#002900)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info,#deebfa);color:var(--wpds-color-fg-content-info,#001b4f)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#d8d8d8);color:var(--wpds-color-fg-content-neutral,#1e1e1e);padding-block:calc(var(--wpds-dimension-padding-xs, 4px) - var(--wpds-border-width-xs, 1px));padding-inline:calc(var(--wpds-dimension-padding-sm, 8px) - var(--wpds-border-width-xs, 1px))}}'));
|
|
1262
1304
|
document.head.appendChild(style);
|
|
1263
1305
|
}
|
|
1264
1306
|
var style_default = { "badge": "_96e6251aad1a6136__badge", "is-high-intent": "_99f7158cb520f750__is-high-intent", "is-medium-intent": "c20ebef2365bc8b7__is-medium-intent", "is-low-intent": "_365e1626c6202e52__is-low-intent", "is-stable-intent": "_33f8198127ddf4ef__is-stable-intent", "is-informational-intent": "_04c1aca8fc449412__is-informational-intent", "is-draft-intent": "_90726e69d495ec19__is-draft-intent", "is-none-intent": "_898f4a544993bd39__is-none-intent" };
|
|
@@ -1298,7 +1340,7 @@ function addContainer(ariaLive = "polite") {
|
|
|
1298
1340
|
container.className = "a11y-speak-region";
|
|
1299
1341
|
container.setAttribute(
|
|
1300
1342
|
"style",
|
|
1301
|
-
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
|
1343
|
+
"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
1344
|
);
|
|
1303
1345
|
container.setAttribute("aria-live", ariaLive);
|
|
1304
1346
|
container.setAttribute("aria-relevant", "additions text");
|
|
@@ -1319,7 +1361,7 @@ function addIntroText() {
|
|
|
1319
1361
|
introText.textContent = __2("Notifications");
|
|
1320
1362
|
introText.setAttribute(
|
|
1321
1363
|
"style",
|
|
1322
|
-
"position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"
|
|
1364
|
+
"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
1365
|
);
|
|
1324
1366
|
introText.setAttribute("hidden", "");
|
|
1325
1367
|
const { body } = document;
|
|
@@ -1569,6 +1611,7 @@ var unseen_default = /* @__PURE__ */ jsx37(SVG, { xmlns: "http://www.w3.org/2000
|
|
|
1569
1611
|
|
|
1570
1612
|
// ../private-apis/build-module/implementation.mjs
|
|
1571
1613
|
var CORE_MODULES_USING_PRIVATE_APIS = [
|
|
1614
|
+
"@wordpress/admin-ui",
|
|
1572
1615
|
"@wordpress/block-directory",
|
|
1573
1616
|
"@wordpress/block-editor",
|
|
1574
1617
|
"@wordpress/block-library",
|
|
@@ -1765,7 +1808,7 @@ var dataviews_context_default = DataViewsContext;
|
|
|
1765
1808
|
import { __ as __35, isRTL as isRTL12 } from "@wordpress/i18n";
|
|
1766
1809
|
|
|
1767
1810
|
// src/components/dataviews-layouts/table/index.tsx
|
|
1768
|
-
import
|
|
1811
|
+
import clsx32 from "clsx";
|
|
1769
1812
|
import { __ as __23, sprintf as sprintf6, isRTL as isRTL10 } from "@wordpress/i18n";
|
|
1770
1813
|
|
|
1771
1814
|
// ../components/build-module/composite/index.mjs
|
|
@@ -2753,7 +2796,7 @@ function UnforwardedTooltip(props, ref) {
|
|
|
2753
2796
|
alternative: "`placement` prop"
|
|
2754
2797
|
});
|
|
2755
2798
|
}
|
|
2756
|
-
computedPlacement = computedPlacement || "
|
|
2799
|
+
computedPlacement = computedPlacement || "top";
|
|
2757
2800
|
const tooltipStore = Ariakit8.useTooltipStore({
|
|
2758
2801
|
placement: computedPlacement,
|
|
2759
2802
|
showTimeout: delay
|
|
@@ -2989,7 +3032,8 @@ var visuallyHidden = {
|
|
|
2989
3032
|
padding: 0,
|
|
2990
3033
|
position: "absolute",
|
|
2991
3034
|
width: "1px",
|
|
2992
|
-
wordWrap: "normal"
|
|
3035
|
+
wordWrap: "normal",
|
|
3036
|
+
wordBreak: "normal"
|
|
2993
3037
|
};
|
|
2994
3038
|
|
|
2995
3039
|
// ../components/build-module/view/component.mjs
|
|
@@ -12371,97 +12415,9 @@ var {
|
|
|
12371
12415
|
unlock: unlock2
|
|
12372
12416
|
} = __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
12417
|
|
|
12374
|
-
// ../components/build-module/
|
|
12418
|
+
// ../components/build-module/badge/index.mjs
|
|
12375
12419
|
import clsx30 from "clsx";
|
|
12376
12420
|
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
12421
|
function contextBasedIcon(intent = "default") {
|
|
12466
12422
|
switch (intent) {
|
|
12467
12423
|
case "info":
|
|
@@ -12484,20 +12440,20 @@ function Badge3({
|
|
|
12484
12440
|
}) {
|
|
12485
12441
|
const icon = contextBasedIcon(intent);
|
|
12486
12442
|
const hasIcon = !!icon;
|
|
12487
|
-
return /* @__PURE__ */
|
|
12488
|
-
className:
|
|
12443
|
+
return /* @__PURE__ */ _jsx107("span", {
|
|
12444
|
+
className: clsx30("components-badge", className2, {
|
|
12489
12445
|
[`is-${intent}`]: intent,
|
|
12490
12446
|
"has-icon": hasIcon
|
|
12491
12447
|
}),
|
|
12492
12448
|
...props,
|
|
12493
|
-
children: /* @__PURE__ */
|
|
12449
|
+
children: /* @__PURE__ */ _jsxs32("span", {
|
|
12494
12450
|
className: "components-badge__flex-wrapper",
|
|
12495
|
-
children: [hasIcon && /* @__PURE__ */
|
|
12451
|
+
children: [hasIcon && /* @__PURE__ */ _jsx107(icon_default2, {
|
|
12496
12452
|
icon,
|
|
12497
12453
|
size: 16,
|
|
12498
12454
|
fill: "currentColor",
|
|
12499
12455
|
className: "components-badge__icon"
|
|
12500
|
-
}), /* @__PURE__ */
|
|
12456
|
+
}), /* @__PURE__ */ _jsx107("span", {
|
|
12501
12457
|
className: "components-badge__content",
|
|
12502
12458
|
children
|
|
12503
12459
|
})]
|
|
@@ -12514,9 +12470,9 @@ import { DayPicker } from "react-day-picker";
|
|
|
12514
12470
|
import { enUS } from "react-day-picker/locale";
|
|
12515
12471
|
|
|
12516
12472
|
// ../components/build-module/calendar/utils/day-cell.mjs
|
|
12517
|
-
import { jsx as
|
|
12473
|
+
import { jsx as _jsx108, jsxs as _jsxs33 } from "react/jsx-runtime";
|
|
12518
12474
|
var PreviewDashStartAndEnd = () => {
|
|
12519
|
-
return /* @__PURE__ */
|
|
12475
|
+
return /* @__PURE__ */ _jsx108("svg", {
|
|
12520
12476
|
viewBox: "0 0 32 32",
|
|
12521
12477
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12522
12478
|
fill: "none",
|
|
@@ -12524,13 +12480,13 @@ var PreviewDashStartAndEnd = () => {
|
|
|
12524
12480
|
strokeDasharray: "3.7677",
|
|
12525
12481
|
strokeDashoffset: "3.2",
|
|
12526
12482
|
strokeWidth: "1",
|
|
12527
|
-
children: /* @__PURE__ */
|
|
12483
|
+
children: /* @__PURE__ */ _jsx108("path", {
|
|
12528
12484
|
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
12485
|
})
|
|
12530
12486
|
});
|
|
12531
12487
|
};
|
|
12532
12488
|
var PreviewDashStart = () => {
|
|
12533
|
-
return /* @__PURE__ */
|
|
12489
|
+
return /* @__PURE__ */ _jsx108("svg", {
|
|
12534
12490
|
viewBox: "0 0 32 32",
|
|
12535
12491
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12536
12492
|
fill: "none",
|
|
@@ -12538,13 +12494,13 @@ var PreviewDashStart = () => {
|
|
|
12538
12494
|
strokeDasharray: "3.84516",
|
|
12539
12495
|
strokeDashoffset: "1.9226",
|
|
12540
12496
|
strokeWidth: "1",
|
|
12541
|
-
children: /* @__PURE__ */
|
|
12497
|
+
children: /* @__PURE__ */ _jsx108("path", {
|
|
12542
12498
|
d: "M32,0.5 h-29.5 a2,2 0 0 0 -2,2 v27 a2,2 0 0 0 2,2 h30"
|
|
12543
12499
|
})
|
|
12544
12500
|
});
|
|
12545
12501
|
};
|
|
12546
12502
|
var PreviewDashMiddle = () => {
|
|
12547
|
-
return /* @__PURE__ */
|
|
12503
|
+
return /* @__PURE__ */ _jsxs33("svg", {
|
|
12548
12504
|
viewBox: "0 0 32 32",
|
|
12549
12505
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12550
12506
|
fill: "none",
|
|
@@ -12552,12 +12508,12 @@ var PreviewDashMiddle = () => {
|
|
|
12552
12508
|
strokeDasharray: "3.9 4",
|
|
12553
12509
|
strokeDashoffset: "2",
|
|
12554
12510
|
strokeWidth: "1",
|
|
12555
|
-
children: [/* @__PURE__ */
|
|
12511
|
+
children: [/* @__PURE__ */ _jsx108("line", {
|
|
12556
12512
|
x1: "0",
|
|
12557
12513
|
y1: "0.5",
|
|
12558
12514
|
x2: "100",
|
|
12559
12515
|
y2: "0.5"
|
|
12560
|
-
}), /* @__PURE__ */
|
|
12516
|
+
}), /* @__PURE__ */ _jsx108("line", {
|
|
12561
12517
|
x1: "0",
|
|
12562
12518
|
y1: "31.5",
|
|
12563
12519
|
x2: "100",
|
|
@@ -12566,7 +12522,7 @@ var PreviewDashMiddle = () => {
|
|
|
12566
12522
|
});
|
|
12567
12523
|
};
|
|
12568
12524
|
var PreviewDashEnd = () => {
|
|
12569
|
-
return /* @__PURE__ */
|
|
12525
|
+
return /* @__PURE__ */ _jsx108("svg", {
|
|
12570
12526
|
viewBox: "0 0 32 32",
|
|
12571
12527
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12572
12528
|
fill: "none",
|
|
@@ -12574,7 +12530,7 @@ var PreviewDashEnd = () => {
|
|
|
12574
12530
|
strokeDasharray: "3.84516",
|
|
12575
12531
|
strokeDashoffset: "1.9226",
|
|
12576
12532
|
strokeWidth: "1",
|
|
12577
|
-
children: /* @__PURE__ */
|
|
12533
|
+
children: /* @__PURE__ */ _jsx108("path", {
|
|
12578
12534
|
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
12535
|
})
|
|
12580
12536
|
});
|
|
@@ -12596,9 +12552,9 @@ function Day(props) {
|
|
|
12596
12552
|
} else if (modifiers.preview) {
|
|
12597
12553
|
PreviewDash = PreviewDashMiddle;
|
|
12598
12554
|
}
|
|
12599
|
-
return /* @__PURE__ */
|
|
12555
|
+
return /* @__PURE__ */ _jsxs33("td", {
|
|
12600
12556
|
...tdProps,
|
|
12601
|
-
children: [PreviewDash && /* @__PURE__ */
|
|
12557
|
+
children: [PreviewDash && /* @__PURE__ */ _jsx108(PreviewDash, {}), children]
|
|
12602
12558
|
});
|
|
12603
12559
|
}
|
|
12604
12560
|
|
|
@@ -12607,6 +12563,7 @@ var CLASSNAMES = {
|
|
|
12607
12563
|
root: "components-calendar",
|
|
12608
12564
|
day: "components-calendar__day",
|
|
12609
12565
|
day_button: "components-calendar__day-button",
|
|
12566
|
+
outside: "components-calendar__day--outside",
|
|
12610
12567
|
caption_label: "components-calendar__caption-label",
|
|
12611
12568
|
button_next: "components-calendar__button-next",
|
|
12612
12569
|
button_previous: "components-calendar__button-previous",
|
|
@@ -12794,7 +12751,7 @@ var useLocalizationProps = ({
|
|
|
12794
12751
|
};
|
|
12795
12752
|
|
|
12796
12753
|
// ../components/build-module/calendar/date-calendar/index.mjs
|
|
12797
|
-
import { jsx as
|
|
12754
|
+
import { jsx as _jsx109 } from "react/jsx-runtime";
|
|
12798
12755
|
var DateCalendar = ({
|
|
12799
12756
|
defaultSelected,
|
|
12800
12757
|
selected: selectedProp,
|
|
@@ -12817,7 +12774,7 @@ var DateCalendar = ({
|
|
|
12817
12774
|
value: selectedProp,
|
|
12818
12775
|
onChange
|
|
12819
12776
|
});
|
|
12820
|
-
return /* @__PURE__ */
|
|
12777
|
+
return /* @__PURE__ */ _jsx109(DayPicker, {
|
|
12821
12778
|
...COMMON_PROPS,
|
|
12822
12779
|
...localizationProps,
|
|
12823
12780
|
...props,
|
|
@@ -12832,7 +12789,7 @@ var DateCalendar = ({
|
|
|
12832
12789
|
import { differenceInCalendarDays } from "date-fns";
|
|
12833
12790
|
import { DayPicker as DayPicker2, rangeContainsModifiers } from "react-day-picker";
|
|
12834
12791
|
import { enUS as enUS2 } from "react-day-picker/locale";
|
|
12835
|
-
import { jsx as
|
|
12792
|
+
import { jsx as _jsx110 } from "react/jsx-runtime";
|
|
12836
12793
|
function usePreviewRange({
|
|
12837
12794
|
selected,
|
|
12838
12795
|
hoveredDate,
|
|
@@ -12938,7 +12895,7 @@ var DateRangeCalendar = ({
|
|
|
12938
12895
|
preview_end: previewRange?.to
|
|
12939
12896
|
};
|
|
12940
12897
|
}, [previewRange]);
|
|
12941
|
-
return /* @__PURE__ */
|
|
12898
|
+
return /* @__PURE__ */ _jsx110(DayPicker2, {
|
|
12942
12899
|
...COMMON_PROPS,
|
|
12943
12900
|
...localizationProps,
|
|
12944
12901
|
...props,
|
|
@@ -12961,8 +12918,8 @@ var DateRangeCalendar = ({
|
|
|
12961
12918
|
import { __ as __17 } from "@wordpress/i18n";
|
|
12962
12919
|
|
|
12963
12920
|
// ../components/build-module/validated-form-controls/validity-indicator.mjs
|
|
12964
|
-
import
|
|
12965
|
-
import { jsx as
|
|
12921
|
+
import clsx31 from "clsx";
|
|
12922
|
+
import { jsx as _jsx111, jsxs as _jsxs34 } from "react/jsx-runtime";
|
|
12966
12923
|
function ValidityIndicator({
|
|
12967
12924
|
type,
|
|
12968
12925
|
message
|
|
@@ -12971,11 +12928,11 @@ function ValidityIndicator({
|
|
|
12971
12928
|
valid: published_default,
|
|
12972
12929
|
invalid: error_default
|
|
12973
12930
|
};
|
|
12974
|
-
return /* @__PURE__ */
|
|
12975
|
-
className:
|
|
12976
|
-
children: [type === "validating" ? /* @__PURE__ */
|
|
12931
|
+
return /* @__PURE__ */ _jsxs34("p", {
|
|
12932
|
+
className: clsx31("components-validated-control__indicator", `is-${type}`),
|
|
12933
|
+
children: [type === "validating" ? /* @__PURE__ */ _jsx111(spinner_default, {
|
|
12977
12934
|
className: "components-validated-control__indicator-spinner"
|
|
12978
|
-
}) : /* @__PURE__ */
|
|
12935
|
+
}) : /* @__PURE__ */ _jsx111(icon_default2, {
|
|
12979
12936
|
className: "components-validated-control__indicator-icon",
|
|
12980
12937
|
icon: ICON[type],
|
|
12981
12938
|
size: 16,
|
|
@@ -12985,15 +12942,15 @@ function ValidityIndicator({
|
|
|
12985
12942
|
}
|
|
12986
12943
|
|
|
12987
12944
|
// ../components/build-module/validated-form-controls/control-with-error.mjs
|
|
12988
|
-
import { Fragment as _Fragment13, jsxs as
|
|
12945
|
+
import { Fragment as _Fragment13, jsxs as _jsxs35, jsx as _jsx112 } from "react/jsx-runtime";
|
|
12989
12946
|
function appendRequiredIndicator(label, required, markWhenOptional) {
|
|
12990
12947
|
if (required && !markWhenOptional) {
|
|
12991
|
-
return /* @__PURE__ */
|
|
12948
|
+
return /* @__PURE__ */ _jsxs35(_Fragment13, {
|
|
12992
12949
|
children: [label, " ", `(${__17("Required")})`]
|
|
12993
12950
|
});
|
|
12994
12951
|
}
|
|
12995
12952
|
if (!required && markWhenOptional) {
|
|
12996
|
-
return /* @__PURE__ */
|
|
12953
|
+
return /* @__PURE__ */ _jsxs35(_Fragment13, {
|
|
12997
12954
|
children: [label, " ", `(${__17("Optional")})`]
|
|
12998
12955
|
});
|
|
12999
12956
|
}
|
|
@@ -13097,27 +13054,27 @@ function UnforwardedControlWithError({
|
|
|
13097
13054
|
};
|
|
13098
13055
|
const message = () => {
|
|
13099
13056
|
if (errorMessage) {
|
|
13100
|
-
return /* @__PURE__ */
|
|
13057
|
+
return /* @__PURE__ */ _jsx112(ValidityIndicator, {
|
|
13101
13058
|
type: "invalid",
|
|
13102
13059
|
message: errorMessage
|
|
13103
13060
|
});
|
|
13104
13061
|
}
|
|
13105
13062
|
if (statusMessage?.type) {
|
|
13106
|
-
return /* @__PURE__ */
|
|
13063
|
+
return /* @__PURE__ */ _jsx112(ValidityIndicator, {
|
|
13107
13064
|
type: statusMessage.type,
|
|
13108
13065
|
message: statusMessage.message
|
|
13109
13066
|
});
|
|
13110
13067
|
}
|
|
13111
13068
|
return null;
|
|
13112
13069
|
};
|
|
13113
|
-
return /* @__PURE__ */
|
|
13070
|
+
return /* @__PURE__ */ _jsxs35("div", {
|
|
13114
13071
|
className,
|
|
13115
13072
|
ref: forwardedRef,
|
|
13116
13073
|
onBlur,
|
|
13117
13074
|
children: [cloneElement(children, {
|
|
13118
13075
|
label: appendRequiredIndicator(children.props.label, required, markWhenOptional),
|
|
13119
13076
|
required
|
|
13120
|
-
}), /* @__PURE__ */
|
|
13077
|
+
}), /* @__PURE__ */ _jsx112("div", {
|
|
13121
13078
|
"aria-live": "polite",
|
|
13122
13079
|
children: showMessage && message()
|
|
13123
13080
|
})]
|
|
@@ -13127,7 +13084,7 @@ var ControlWithError = forwardRef(UnforwardedControlWithError);
|
|
|
13127
13084
|
ControlWithError.displayName = "ControlWithError";
|
|
13128
13085
|
|
|
13129
13086
|
// ../components/build-module/validated-form-controls/components/checkbox-control.mjs
|
|
13130
|
-
import { jsx as
|
|
13087
|
+
import { jsx as _jsx113 } from "react/jsx-runtime";
|
|
13131
13088
|
var UnforwardedValidatedCheckboxControl = ({
|
|
13132
13089
|
required,
|
|
13133
13090
|
customValidity,
|
|
@@ -13136,13 +13093,13 @@ var UnforwardedValidatedCheckboxControl = ({
|
|
|
13136
13093
|
}, forwardedRef) => {
|
|
13137
13094
|
const validityTargetRef = useRef(null);
|
|
13138
13095
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13139
|
-
return /* @__PURE__ */
|
|
13096
|
+
return /* @__PURE__ */ _jsx113(ControlWithError, {
|
|
13140
13097
|
required,
|
|
13141
13098
|
markWhenOptional,
|
|
13142
13099
|
ref: mergedRefs,
|
|
13143
13100
|
customValidity,
|
|
13144
13101
|
getValidityTarget: () => validityTargetRef.current?.querySelector('input[type="checkbox"]'),
|
|
13145
|
-
children: /* @__PURE__ */
|
|
13102
|
+
children: /* @__PURE__ */ _jsx113(
|
|
13146
13103
|
checkbox_control_default,
|
|
13147
13104
|
{
|
|
13148
13105
|
...restProps
|
|
@@ -13154,7 +13111,7 @@ var ValidatedCheckboxControl = forwardRef(UnforwardedValidatedCheckboxControl);
|
|
|
13154
13111
|
ValidatedCheckboxControl.displayName = "ValidatedCheckboxControl";
|
|
13155
13112
|
|
|
13156
13113
|
// ../components/build-module/validated-form-controls/components/combobox-control.mjs
|
|
13157
|
-
import { jsx as
|
|
13114
|
+
import { jsx as _jsx114 } from "react/jsx-runtime";
|
|
13158
13115
|
var UnforwardedValidatedComboboxControl = ({
|
|
13159
13116
|
required,
|
|
13160
13117
|
customValidity,
|
|
@@ -13171,13 +13128,13 @@ var UnforwardedValidatedComboboxControl = ({
|
|
|
13171
13128
|
}, [required]);
|
|
13172
13129
|
return (
|
|
13173
13130
|
// TODO: Bug - Missing value error is not cleared immediately on change, waits for blur.
|
|
13174
|
-
/* @__PURE__ */
|
|
13131
|
+
/* @__PURE__ */ _jsx114(ControlWithError, {
|
|
13175
13132
|
required,
|
|
13176
13133
|
markWhenOptional,
|
|
13177
13134
|
ref: mergedRefs,
|
|
13178
13135
|
customValidity,
|
|
13179
13136
|
getValidityTarget: () => validityTargetRef.current?.querySelector('input[role="combobox"]'),
|
|
13180
|
-
children: /* @__PURE__ */
|
|
13137
|
+
children: /* @__PURE__ */ _jsx114(combobox_control_default, {
|
|
13181
13138
|
__next40pxDefaultSize: true,
|
|
13182
13139
|
...restProps
|
|
13183
13140
|
})
|
|
@@ -13188,7 +13145,7 @@ var ValidatedComboboxControl = forwardRef(UnforwardedValidatedComboboxControl);
|
|
|
13188
13145
|
ValidatedComboboxControl.displayName = "ValidatedComboboxControl";
|
|
13189
13146
|
|
|
13190
13147
|
// ../components/build-module/validated-form-controls/components/form-token-field.mjs
|
|
13191
|
-
import { jsx as
|
|
13148
|
+
import { jsx as _jsx115, jsxs as _jsxs36 } from "react/jsx-runtime";
|
|
13192
13149
|
var UnforwardedValidatedFormTokenField = ({
|
|
13193
13150
|
required,
|
|
13194
13151
|
customValidity,
|
|
@@ -13196,19 +13153,19 @@ var UnforwardedValidatedFormTokenField = ({
|
|
|
13196
13153
|
...restProps
|
|
13197
13154
|
}, forwardedRef) => {
|
|
13198
13155
|
const validityTargetRef = useRef(null);
|
|
13199
|
-
return /* @__PURE__ */
|
|
13156
|
+
return /* @__PURE__ */ _jsxs36("div", {
|
|
13200
13157
|
className: "components-validated-control__wrapper-with-error-delegate",
|
|
13201
13158
|
ref: forwardedRef,
|
|
13202
|
-
children: [/* @__PURE__ */
|
|
13159
|
+
children: [/* @__PURE__ */ _jsx115(ControlWithError, {
|
|
13203
13160
|
required,
|
|
13204
13161
|
markWhenOptional,
|
|
13205
13162
|
customValidity,
|
|
13206
13163
|
getValidityTarget: () => validityTargetRef.current,
|
|
13207
|
-
children: /* @__PURE__ */
|
|
13164
|
+
children: /* @__PURE__ */ _jsx115(FormTokenField, {
|
|
13208
13165
|
__next40pxDefaultSize: true,
|
|
13209
13166
|
...restProps
|
|
13210
13167
|
})
|
|
13211
|
-
}), /* @__PURE__ */
|
|
13168
|
+
}), /* @__PURE__ */ _jsx115("input", {
|
|
13212
13169
|
className: "components-validated-control__error-delegate",
|
|
13213
13170
|
type: "text",
|
|
13214
13171
|
ref: validityTargetRef,
|
|
@@ -13227,7 +13184,7 @@ var ValidatedFormTokenField = forwardRef(UnforwardedValidatedFormTokenField);
|
|
|
13227
13184
|
ValidatedFormTokenField.displayName = "ValidatedFormTokenField";
|
|
13228
13185
|
|
|
13229
13186
|
// ../components/build-module/validated-form-controls/components/input-control.mjs
|
|
13230
|
-
import { jsx as
|
|
13187
|
+
import { jsx as _jsx116 } from "react/jsx-runtime";
|
|
13231
13188
|
var UnforwardedValidatedInputControl = ({
|
|
13232
13189
|
required,
|
|
13233
13190
|
customValidity,
|
|
@@ -13236,12 +13193,12 @@ var UnforwardedValidatedInputControl = ({
|
|
|
13236
13193
|
}, forwardedRef) => {
|
|
13237
13194
|
const validityTargetRef = useRef(null);
|
|
13238
13195
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13239
|
-
return /* @__PURE__ */
|
|
13196
|
+
return /* @__PURE__ */ _jsx116(ControlWithError, {
|
|
13240
13197
|
required,
|
|
13241
13198
|
markWhenOptional,
|
|
13242
13199
|
customValidity,
|
|
13243
13200
|
getValidityTarget: () => validityTargetRef.current,
|
|
13244
|
-
children: /* @__PURE__ */
|
|
13201
|
+
children: /* @__PURE__ */ _jsx116(input_control_default, {
|
|
13245
13202
|
__next40pxDefaultSize: true,
|
|
13246
13203
|
ref: mergedRefs,
|
|
13247
13204
|
...restProps
|
|
@@ -13252,7 +13209,7 @@ var ValidatedInputControl = forwardRef(UnforwardedValidatedInputControl);
|
|
|
13252
13209
|
ValidatedInputControl.displayName = "ValidatedInputControl";
|
|
13253
13210
|
|
|
13254
13211
|
// ../components/build-module/validated-form-controls/components/number-control.mjs
|
|
13255
|
-
import { jsx as
|
|
13212
|
+
import { jsx as _jsx117 } from "react/jsx-runtime";
|
|
13256
13213
|
var UnforwardedValidatedNumberControl = ({
|
|
13257
13214
|
required,
|
|
13258
13215
|
customValidity,
|
|
@@ -13261,12 +13218,12 @@ var UnforwardedValidatedNumberControl = ({
|
|
|
13261
13218
|
}, forwardedRef) => {
|
|
13262
13219
|
const validityTargetRef = useRef(null);
|
|
13263
13220
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13264
|
-
return /* @__PURE__ */
|
|
13221
|
+
return /* @__PURE__ */ _jsx117(ControlWithError, {
|
|
13265
13222
|
required,
|
|
13266
13223
|
markWhenOptional,
|
|
13267
13224
|
customValidity,
|
|
13268
13225
|
getValidityTarget: () => validityTargetRef.current,
|
|
13269
|
-
children: /* @__PURE__ */
|
|
13226
|
+
children: /* @__PURE__ */ _jsx117(number_control_default, {
|
|
13270
13227
|
__next40pxDefaultSize: true,
|
|
13271
13228
|
ref: mergedRefs,
|
|
13272
13229
|
...restProps
|
|
@@ -13277,7 +13234,7 @@ var ValidatedNumberControl = forwardRef(UnforwardedValidatedNumberControl);
|
|
|
13277
13234
|
ValidatedNumberControl.displayName = "ValidatedNumberControl";
|
|
13278
13235
|
|
|
13279
13236
|
// ../components/build-module/validated-form-controls/components/radio-control.mjs
|
|
13280
|
-
import { jsx as
|
|
13237
|
+
import { jsx as _jsx118 } from "react/jsx-runtime";
|
|
13281
13238
|
var UnforwardedValidatedRadioControl = ({
|
|
13282
13239
|
required,
|
|
13283
13240
|
customValidity,
|
|
@@ -13286,13 +13243,13 @@ var UnforwardedValidatedRadioControl = ({
|
|
|
13286
13243
|
}, forwardedRef) => {
|
|
13287
13244
|
const validityTargetRef = useRef(null);
|
|
13288
13245
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13289
|
-
return /* @__PURE__ */
|
|
13246
|
+
return /* @__PURE__ */ _jsx118(ControlWithError, {
|
|
13290
13247
|
required,
|
|
13291
13248
|
markWhenOptional,
|
|
13292
13249
|
ref: mergedRefs,
|
|
13293
13250
|
customValidity,
|
|
13294
13251
|
getValidityTarget: () => validityTargetRef.current?.querySelector('input[type="radio"]'),
|
|
13295
|
-
children: /* @__PURE__ */
|
|
13252
|
+
children: /* @__PURE__ */ _jsx118(radio_control_default, {
|
|
13296
13253
|
...restProps
|
|
13297
13254
|
})
|
|
13298
13255
|
});
|
|
@@ -13301,7 +13258,7 @@ var ValidatedRadioControl = forwardRef(UnforwardedValidatedRadioControl);
|
|
|
13301
13258
|
ValidatedRadioControl.displayName = "ValidatedRadioControl";
|
|
13302
13259
|
|
|
13303
13260
|
// ../components/build-module/validated-form-controls/components/select-control.mjs
|
|
13304
|
-
import { jsx as
|
|
13261
|
+
import { jsx as _jsx119 } from "react/jsx-runtime";
|
|
13305
13262
|
var UnforwardedValidatedSelectControl = ({
|
|
13306
13263
|
required,
|
|
13307
13264
|
customValidity,
|
|
@@ -13310,12 +13267,12 @@ var UnforwardedValidatedSelectControl = ({
|
|
|
13310
13267
|
}, forwardedRef) => {
|
|
13311
13268
|
const validityTargetRef = useRef(null);
|
|
13312
13269
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13313
|
-
return /* @__PURE__ */
|
|
13270
|
+
return /* @__PURE__ */ _jsx119(ControlWithError, {
|
|
13314
13271
|
required,
|
|
13315
13272
|
markWhenOptional,
|
|
13316
13273
|
customValidity,
|
|
13317
13274
|
getValidityTarget: () => validityTargetRef.current,
|
|
13318
|
-
children: /* @__PURE__ */
|
|
13275
|
+
children: /* @__PURE__ */ _jsx119(select_control_default, {
|
|
13319
13276
|
__next40pxDefaultSize: true,
|
|
13320
13277
|
ref: mergedRefs,
|
|
13321
13278
|
...restProps
|
|
@@ -13326,7 +13283,7 @@ var ValidatedSelectControl = forwardRef(UnforwardedValidatedSelectControl);
|
|
|
13326
13283
|
ValidatedSelectControl.displayName = "ValidatedSelectControl";
|
|
13327
13284
|
|
|
13328
13285
|
// ../components/build-module/validated-form-controls/components/text-control.mjs
|
|
13329
|
-
import { jsx as
|
|
13286
|
+
import { jsx as _jsx120 } from "react/jsx-runtime";
|
|
13330
13287
|
var UnforwardedValidatedTextControl = ({
|
|
13331
13288
|
required,
|
|
13332
13289
|
customValidity,
|
|
@@ -13335,12 +13292,12 @@ var UnforwardedValidatedTextControl = ({
|
|
|
13335
13292
|
}, forwardedRef) => {
|
|
13336
13293
|
const validityTargetRef = useRef(null);
|
|
13337
13294
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13338
|
-
return /* @__PURE__ */
|
|
13295
|
+
return /* @__PURE__ */ _jsx120(ControlWithError, {
|
|
13339
13296
|
required,
|
|
13340
13297
|
markWhenOptional,
|
|
13341
13298
|
customValidity,
|
|
13342
13299
|
getValidityTarget: () => validityTargetRef.current,
|
|
13343
|
-
children: /* @__PURE__ */
|
|
13300
|
+
children: /* @__PURE__ */ _jsx120(text_control_default, {
|
|
13344
13301
|
__next40pxDefaultSize: true,
|
|
13345
13302
|
ref: mergedRefs,
|
|
13346
13303
|
...restProps
|
|
@@ -13351,7 +13308,7 @@ var ValidatedTextControl = forwardRef(UnforwardedValidatedTextControl);
|
|
|
13351
13308
|
ValidatedTextControl.displayName = "ValidatedTextControl";
|
|
13352
13309
|
|
|
13353
13310
|
// ../components/build-module/validated-form-controls/components/textarea-control.mjs
|
|
13354
|
-
import { jsx as
|
|
13311
|
+
import { jsx as _jsx121 } from "react/jsx-runtime";
|
|
13355
13312
|
var UnforwardedValidatedTextareaControl = ({
|
|
13356
13313
|
required,
|
|
13357
13314
|
customValidity,
|
|
@@ -13360,12 +13317,12 @@ var UnforwardedValidatedTextareaControl = ({
|
|
|
13360
13317
|
}, forwardedRef) => {
|
|
13361
13318
|
const validityTargetRef = useRef(null);
|
|
13362
13319
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13363
|
-
return /* @__PURE__ */
|
|
13320
|
+
return /* @__PURE__ */ _jsx121(ControlWithError, {
|
|
13364
13321
|
required,
|
|
13365
13322
|
markWhenOptional,
|
|
13366
13323
|
customValidity,
|
|
13367
13324
|
getValidityTarget: () => validityTargetRef.current,
|
|
13368
|
-
children: /* @__PURE__ */
|
|
13325
|
+
children: /* @__PURE__ */ _jsx121(textarea_control_default, {
|
|
13369
13326
|
ref: mergedRefs,
|
|
13370
13327
|
...restProps
|
|
13371
13328
|
})
|
|
@@ -13375,7 +13332,7 @@ var ValidatedTextareaControl = forwardRef(UnforwardedValidatedTextareaControl);
|
|
|
13375
13332
|
ValidatedTextareaControl.displayName = "ValidatedTextareaControl";
|
|
13376
13333
|
|
|
13377
13334
|
// ../components/build-module/validated-form-controls/components/toggle-control.mjs
|
|
13378
|
-
import { jsx as
|
|
13335
|
+
import { jsx as _jsx122 } from "react/jsx-runtime";
|
|
13379
13336
|
var UnforwardedValidatedToggleControl = ({
|
|
13380
13337
|
required,
|
|
13381
13338
|
customValidity,
|
|
@@ -13384,12 +13341,12 @@ var UnforwardedValidatedToggleControl = ({
|
|
|
13384
13341
|
}, forwardedRef) => {
|
|
13385
13342
|
const validityTargetRef = useRef(null);
|
|
13386
13343
|
const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
|
|
13387
|
-
return /* @__PURE__ */
|
|
13344
|
+
return /* @__PURE__ */ _jsx122(ControlWithError, {
|
|
13388
13345
|
required,
|
|
13389
13346
|
markWhenOptional,
|
|
13390
13347
|
customValidity,
|
|
13391
13348
|
getValidityTarget: () => validityTargetRef.current,
|
|
13392
|
-
children: /* @__PURE__ */
|
|
13349
|
+
children: /* @__PURE__ */ _jsx122(toggle_control_default, {
|
|
13393
13350
|
ref: mergedRefs,
|
|
13394
13351
|
required,
|
|
13395
13352
|
...restProps
|
|
@@ -13400,7 +13357,7 @@ var ValidatedToggleControl = forwardRef(UnforwardedValidatedToggleControl);
|
|
|
13400
13357
|
ValidatedToggleControl.displayName = "ValidatedToggleControl";
|
|
13401
13358
|
|
|
13402
13359
|
// ../components/build-module/validated-form-controls/components/toggle-group-control.mjs
|
|
13403
|
-
import { jsx as
|
|
13360
|
+
import { jsx as _jsx123, jsxs as _jsxs37 } from "react/jsx-runtime";
|
|
13404
13361
|
var UnforwardedValidatedToggleGroupControl = ({
|
|
13405
13362
|
required,
|
|
13406
13363
|
customValidity,
|
|
@@ -13409,19 +13366,19 @@ var UnforwardedValidatedToggleGroupControl = ({
|
|
|
13409
13366
|
}, forwardedRef) => {
|
|
13410
13367
|
const validityTargetRef = useRef(null);
|
|
13411
13368
|
const nameAttr = useId();
|
|
13412
|
-
return /* @__PURE__ */
|
|
13369
|
+
return /* @__PURE__ */ _jsxs37("div", {
|
|
13413
13370
|
className: "components-validated-control__wrapper-with-error-delegate",
|
|
13414
|
-
children: [/* @__PURE__ */
|
|
13371
|
+
children: [/* @__PURE__ */ _jsx123(ControlWithError, {
|
|
13415
13372
|
required,
|
|
13416
13373
|
markWhenOptional,
|
|
13417
13374
|
customValidity,
|
|
13418
13375
|
getValidityTarget: () => validityTargetRef.current,
|
|
13419
|
-
children: /* @__PURE__ */
|
|
13376
|
+
children: /* @__PURE__ */ _jsx123(component_default10, {
|
|
13420
13377
|
__next40pxDefaultSize: true,
|
|
13421
13378
|
ref: forwardedRef,
|
|
13422
13379
|
...restProps
|
|
13423
13380
|
})
|
|
13424
|
-
}), /* @__PURE__ */
|
|
13381
|
+
}), /* @__PURE__ */ _jsx123("input", {
|
|
13425
13382
|
className: "components-validated-control__error-delegate",
|
|
13426
13383
|
type: "radio",
|
|
13427
13384
|
ref: validityTargetRef,
|
|
@@ -13444,8 +13401,6 @@ ValidatedToggleGroupControl.displayName = "ValidatedToggleGroupControl";
|
|
|
13444
13401
|
var privateApis = {};
|
|
13445
13402
|
lock2(privateApis, {
|
|
13446
13403
|
__experimentalPopoverLegacyPositionToPlacement: positionToPlacement,
|
|
13447
|
-
Avatar: component_default24,
|
|
13448
|
-
AvatarGroup: component_default25,
|
|
13449
13404
|
ComponentsContext,
|
|
13450
13405
|
Tabs,
|
|
13451
13406
|
Theme: theme_default,
|
|
@@ -14498,7 +14453,7 @@ function ColumnPrimary({
|
|
|
14498
14453
|
}
|
|
14499
14454
|
var column_primary_default = ColumnPrimary;
|
|
14500
14455
|
|
|
14501
|
-
// src/components/dataviews-layouts/table/use-
|
|
14456
|
+
// src/components/dataviews-layouts/table/use-scroll-state.ts
|
|
14502
14457
|
import { isRTL as isRTL9 } from "@wordpress/i18n";
|
|
14503
14458
|
var isScrolledToEnd = (element) => {
|
|
14504
14459
|
if (isRTL9()) {
|
|
@@ -14507,40 +14462,37 @@ var isScrolledToEnd = (element) => {
|
|
|
14507
14462
|
}
|
|
14508
14463
|
return element.scrollLeft + element.clientWidth >= element.scrollWidth - 1;
|
|
14509
14464
|
};
|
|
14510
|
-
function
|
|
14465
|
+
function useScrollState({
|
|
14511
14466
|
scrollContainerRef,
|
|
14512
|
-
|
|
14467
|
+
enabledHorizontal = false
|
|
14513
14468
|
}) {
|
|
14514
14469
|
const [isHorizontalScrollEnd, setIsHorizontalScrollEnd] = useState(false);
|
|
14515
|
-
const
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
|
|
14523
|
-
|
|
14470
|
+
const [isVerticallyScrolled, setIsVerticallyScrolled] = useState(false);
|
|
14471
|
+
const handleScroll = useCallback(() => {
|
|
14472
|
+
const scrollContainer = scrollContainerRef.current;
|
|
14473
|
+
if (!scrollContainer) {
|
|
14474
|
+
return;
|
|
14475
|
+
}
|
|
14476
|
+
if (enabledHorizontal) {
|
|
14477
|
+
setIsHorizontalScrollEnd(isScrolledToEnd(scrollContainer));
|
|
14478
|
+
}
|
|
14479
|
+
setIsVerticallyScrolled(scrollContainer.scrollTop > 0);
|
|
14480
|
+
}, [scrollContainerRef, enabledHorizontal]);
|
|
14524
14481
|
useEffect(() => {
|
|
14525
|
-
if (typeof window === "undefined" || !
|
|
14482
|
+
if (typeof window === "undefined" || !scrollContainerRef.current) {
|
|
14526
14483
|
return () => {
|
|
14527
14484
|
};
|
|
14528
14485
|
}
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
|
|
14533
|
-
);
|
|
14534
|
-
window.addEventListener("resize", handleIsHorizontalScrollEnd);
|
|
14486
|
+
const scrollContainer = scrollContainerRef.current;
|
|
14487
|
+
handleScroll();
|
|
14488
|
+
scrollContainer.addEventListener("scroll", handleScroll);
|
|
14489
|
+
window.addEventListener("resize", handleScroll);
|
|
14535
14490
|
return () => {
|
|
14536
|
-
|
|
14537
|
-
|
|
14538
|
-
handleIsHorizontalScrollEnd
|
|
14539
|
-
);
|
|
14540
|
-
window.removeEventListener("resize", handleIsHorizontalScrollEnd);
|
|
14491
|
+
scrollContainer.removeEventListener("scroll", handleScroll);
|
|
14492
|
+
window.removeEventListener("resize", handleScroll);
|
|
14541
14493
|
};
|
|
14542
|
-
}, [scrollContainerRef,
|
|
14543
|
-
return isHorizontalScrollEnd;
|
|
14494
|
+
}, [scrollContainerRef, enabledHorizontal, handleScroll]);
|
|
14495
|
+
return { isHorizontalScrollEnd, isVerticallyScrolled };
|
|
14544
14496
|
}
|
|
14545
14497
|
|
|
14546
14498
|
// src/components/dataviews-layouts/utils/get-data-by-group.ts
|
|
@@ -14701,7 +14653,7 @@ function TableColumnField({
|
|
|
14701
14653
|
if (!field) {
|
|
14702
14654
|
return null;
|
|
14703
14655
|
}
|
|
14704
|
-
const className2 =
|
|
14656
|
+
const className2 = clsx32("dataviews-view-table__cell-content-wrapper", {
|
|
14705
14657
|
"dataviews-view-table__cell-align-end": align === "end",
|
|
14706
14658
|
"dataviews-view-table__cell-align-center": align === "center"
|
|
14707
14659
|
});
|
|
@@ -14742,7 +14694,7 @@ function TableRow({
|
|
|
14742
14694
|
return /* @__PURE__ */ jsxs6(
|
|
14743
14695
|
"tr",
|
|
14744
14696
|
{
|
|
14745
|
-
className:
|
|
14697
|
+
className: clsx32("dataviews-view-table__row", {
|
|
14746
14698
|
"is-selected": hasPossibleBulkAction && isSelected,
|
|
14747
14699
|
"has-bulk-actions": hasPossibleBulkAction
|
|
14748
14700
|
}),
|
|
@@ -14828,7 +14780,7 @@ function TableRow({
|
|
|
14828
14780
|
/* @__PURE__ */ jsx45(
|
|
14829
14781
|
"td",
|
|
14830
14782
|
{
|
|
14831
|
-
className:
|
|
14783
|
+
className: clsx32("dataviews-view-table__actions-column", {
|
|
14832
14784
|
"dataviews-view-table__actions-column--sticky": true,
|
|
14833
14785
|
"dataviews-view-table__actions-column--stuck": isActionsColumnSticky
|
|
14834
14786
|
}),
|
|
@@ -14871,9 +14823,9 @@ function ViewTable({
|
|
|
14871
14823
|
}
|
|
14872
14824
|
});
|
|
14873
14825
|
const tableNoticeId = useId();
|
|
14874
|
-
const isHorizontalScrollEnd =
|
|
14826
|
+
const { isHorizontalScrollEnd, isVerticallyScrolled } = useScrollState({
|
|
14875
14827
|
scrollContainerRef: containerRef,
|
|
14876
|
-
|
|
14828
|
+
enabledHorizontal: !!actions?.length
|
|
14877
14829
|
});
|
|
14878
14830
|
const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data);
|
|
14879
14831
|
if (nextHeaderMenuToFocus) {
|
|
@@ -14933,7 +14885,7 @@ function ViewTable({
|
|
|
14933
14885
|
return /* @__PURE__ */ jsx45(
|
|
14934
14886
|
"div",
|
|
14935
14887
|
{
|
|
14936
|
-
className:
|
|
14888
|
+
className: clsx32("dataviews-no-results", {
|
|
14937
14889
|
"is-refreshing": isDelayedLoading
|
|
14938
14890
|
}),
|
|
14939
14891
|
id: tableNoticeId,
|
|
@@ -14945,7 +14897,7 @@ function ViewTable({
|
|
|
14945
14897
|
/* @__PURE__ */ jsxs6(
|
|
14946
14898
|
"table",
|
|
14947
14899
|
{
|
|
14948
|
-
className:
|
|
14900
|
+
className: clsx32("dataviews-view-table", className2, {
|
|
14949
14901
|
[`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
|
|
14950
14902
|
view.layout.density
|
|
14951
14903
|
),
|
|
@@ -14963,10 +14915,10 @@ function ViewTable({
|
|
|
14963
14915
|
columns.map((column, index) => /* @__PURE__ */ jsx45(
|
|
14964
14916
|
"col",
|
|
14965
14917
|
{
|
|
14966
|
-
className:
|
|
14918
|
+
className: clsx32(
|
|
14967
14919
|
`dataviews-view-table__col-${column}`,
|
|
14968
14920
|
{
|
|
14969
|
-
"dataviews-view-table__col-
|
|
14921
|
+
"dataviews-view-table__col-expand": !hasPrimaryColumn && index === columns.length - 1
|
|
14970
14922
|
}
|
|
14971
14923
|
)
|
|
14972
14924
|
},
|
|
@@ -14983,97 +14935,106 @@ function ViewTable({
|
|
|
14983
14935
|
children: /* @__PURE__ */ jsx45(PropertiesSection, { showLabel: false })
|
|
14984
14936
|
}
|
|
14985
14937
|
),
|
|
14986
|
-
/* @__PURE__ */ jsx45(
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
{
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
|
|
14938
|
+
/* @__PURE__ */ jsx45(
|
|
14939
|
+
"thead",
|
|
14940
|
+
{
|
|
14941
|
+
className: clsx32({
|
|
14942
|
+
"dataviews-view-table__thead--stuck": isVerticallyScrolled
|
|
14943
|
+
}),
|
|
14944
|
+
onContextMenu: handleHeaderContextMenu,
|
|
14945
|
+
children: /* @__PURE__ */ jsxs6("tr", { className: "dataviews-view-table__row", children: [
|
|
14946
|
+
hasBulkActions && /* @__PURE__ */ jsx45(
|
|
14947
|
+
"th",
|
|
14995
14948
|
{
|
|
14996
|
-
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
15000
|
-
|
|
14949
|
+
className: "dataviews-view-table__checkbox-column",
|
|
14950
|
+
scope: "col",
|
|
14951
|
+
onContextMenu: handleHeaderContextMenu,
|
|
14952
|
+
children: /* @__PURE__ */ jsx45(
|
|
14953
|
+
BulkSelectionCheckbox,
|
|
14954
|
+
{
|
|
14955
|
+
selection,
|
|
14956
|
+
onChangeSelection,
|
|
14957
|
+
data,
|
|
14958
|
+
actions,
|
|
14959
|
+
getItemId
|
|
14960
|
+
}
|
|
14961
|
+
)
|
|
15001
14962
|
}
|
|
15002
|
-
)
|
|
15003
|
-
}
|
|
15004
|
-
),
|
|
15005
|
-
hasPrimaryColumn && /* @__PURE__ */ jsx45("th", { scope: "col", children: titleField && /* @__PURE__ */ jsx45(
|
|
15006
|
-
column_header_menu_default,
|
|
15007
|
-
{
|
|
15008
|
-
ref: headerMenuRef(
|
|
15009
|
-
titleField.id,
|
|
15010
|
-
0
|
|
15011
14963
|
),
|
|
15012
|
-
|
|
15013
|
-
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15017
|
-
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
|
|
15021
|
-
|
|
15022
|
-
|
|
15023
|
-
|
|
15024
|
-
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15029
|
-
|
|
15030
|
-
|
|
15031
|
-
|
|
15032
|
-
|
|
15033
|
-
|
|
15034
|
-
|
|
15035
|
-
|
|
15036
|
-
|
|
15037
|
-
|
|
15038
|
-
|
|
15039
|
-
|
|
15040
|
-
|
|
15041
|
-
|
|
15042
|
-
"aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0,
|
|
15043
|
-
scope: "col",
|
|
15044
|
-
children: /* @__PURE__ */ jsx45(
|
|
15045
|
-
column_header_menu_default,
|
|
14964
|
+
hasPrimaryColumn && /* @__PURE__ */ jsx45("th", { scope: "col", children: titleField && /* @__PURE__ */ jsx45(
|
|
14965
|
+
column_header_menu_default,
|
|
14966
|
+
{
|
|
14967
|
+
ref: headerMenuRef(
|
|
14968
|
+
titleField.id,
|
|
14969
|
+
0
|
|
14970
|
+
),
|
|
14971
|
+
fieldId: titleField.id,
|
|
14972
|
+
view,
|
|
14973
|
+
fields,
|
|
14974
|
+
onChangeView,
|
|
14975
|
+
onHide,
|
|
14976
|
+
setOpenedFilter,
|
|
14977
|
+
canMove: false,
|
|
14978
|
+
canInsertLeft: isRtl ? view.layout?.enableMoving ?? true : false,
|
|
14979
|
+
canInsertRight: isRtl ? false : view.layout?.enableMoving ?? true
|
|
14980
|
+
}
|
|
14981
|
+
) }),
|
|
14982
|
+
columns.map((column, index) => {
|
|
14983
|
+
const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
|
|
14984
|
+
const field = fields.find(
|
|
14985
|
+
(f) => f.id === column
|
|
14986
|
+
);
|
|
14987
|
+
const effectiveAlign = getEffectiveAlign(
|
|
14988
|
+
align,
|
|
14989
|
+
field?.type
|
|
14990
|
+
);
|
|
14991
|
+
const canInsertOrMove = view.layout?.enableMoving ?? true;
|
|
14992
|
+
return /* @__PURE__ */ jsx45(
|
|
14993
|
+
"th",
|
|
15046
14994
|
{
|
|
15047
|
-
|
|
15048
|
-
|
|
15049
|
-
|
|
15050
|
-
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15055
|
-
|
|
15056
|
-
|
|
15057
|
-
|
|
15058
|
-
|
|
15059
|
-
|
|
15060
|
-
|
|
15061
|
-
|
|
15062
|
-
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
15066
|
-
|
|
15067
|
-
|
|
14995
|
+
style: {
|
|
14996
|
+
width,
|
|
14997
|
+
maxWidth,
|
|
14998
|
+
minWidth,
|
|
14999
|
+
textAlign: effectiveAlign
|
|
15000
|
+
},
|
|
15001
|
+
"aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0,
|
|
15002
|
+
scope: "col",
|
|
15003
|
+
children: /* @__PURE__ */ jsx45(
|
|
15004
|
+
column_header_menu_default,
|
|
15005
|
+
{
|
|
15006
|
+
ref: headerMenuRef(column, index),
|
|
15007
|
+
fieldId: column,
|
|
15008
|
+
view,
|
|
15009
|
+
fields,
|
|
15010
|
+
onChangeView,
|
|
15011
|
+
onHide,
|
|
15012
|
+
setOpenedFilter,
|
|
15013
|
+
canMove: canInsertOrMove,
|
|
15014
|
+
canInsertLeft: canInsertOrMove,
|
|
15015
|
+
canInsertRight: canInsertOrMove
|
|
15016
|
+
}
|
|
15017
|
+
)
|
|
15018
|
+
},
|
|
15019
|
+
column
|
|
15020
|
+
);
|
|
15021
|
+
}),
|
|
15022
|
+
!!actions?.length && /* @__PURE__ */ jsx45(
|
|
15023
|
+
"th",
|
|
15068
15024
|
{
|
|
15069
|
-
|
|
15070
|
-
|
|
15025
|
+
className: clsx32(
|
|
15026
|
+
"dataviews-view-table__actions-column",
|
|
15027
|
+
{
|
|
15028
|
+
"dataviews-view-table__actions-column--sticky": true,
|
|
15029
|
+
"dataviews-view-table__actions-column--stuck": !isHorizontalScrollEnd
|
|
15030
|
+
}
|
|
15031
|
+
),
|
|
15032
|
+
children: /* @__PURE__ */ jsx45("span", { className: "dataviews-view-table-header", children: __23("Actions") })
|
|
15071
15033
|
}
|
|
15072
|
-
)
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
] }) }),
|
|
15034
|
+
)
|
|
15035
|
+
] })
|
|
15036
|
+
}
|
|
15037
|
+
),
|
|
15077
15038
|
hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
|
|
15078
15039
|
([groupName, groupItems]) => /* @__PURE__ */ jsxs6("tbody", { children: [
|
|
15079
15040
|
/* @__PURE__ */ jsx45("tr", { className: "dataviews-view-table__group-header-row", children: /* @__PURE__ */ jsx45(
|
|
@@ -15146,11 +15107,11 @@ function ViewTable({
|
|
|
15146
15107
|
var table_default = ViewTable;
|
|
15147
15108
|
|
|
15148
15109
|
// src/components/dataviews-layouts/grid/index.tsx
|
|
15149
|
-
import
|
|
15110
|
+
import clsx34 from "clsx";
|
|
15150
15111
|
import { __ as __26, sprintf as sprintf8 } from "@wordpress/i18n";
|
|
15151
15112
|
|
|
15152
15113
|
// src/components/dataviews-layouts/grid/composite-grid.tsx
|
|
15153
|
-
import
|
|
15114
|
+
import clsx33 from "clsx";
|
|
15154
15115
|
import { __ as __25, sprintf as sprintf7 } from "@wordpress/i18n";
|
|
15155
15116
|
|
|
15156
15117
|
// src/components/dataviews-layouts/grid/preview-size-picker.tsx
|
|
@@ -15267,7 +15228,7 @@ var GridItem = forwardRef(function GridItem2({
|
|
|
15267
15228
|
direction: "column",
|
|
15268
15229
|
...props,
|
|
15269
15230
|
ref,
|
|
15270
|
-
className:
|
|
15231
|
+
className: clsx33(
|
|
15271
15232
|
props.className,
|
|
15272
15233
|
"dataviews-view-grid__row__gridcell",
|
|
15273
15234
|
"dataviews-view-grid__card",
|
|
@@ -15296,7 +15257,7 @@ var GridItem = forwardRef(function GridItem2({
|
|
|
15296
15257
|
isItemClickable: isItemClickable2,
|
|
15297
15258
|
onClickItem,
|
|
15298
15259
|
renderItemLink,
|
|
15299
|
-
className:
|
|
15260
|
+
className: clsx33("dataviews-view-grid__media", {
|
|
15300
15261
|
"dataviews-view-grid__media--placeholder": !rendersMediaField
|
|
15301
15262
|
}),
|
|
15302
15263
|
...mediaA11yProps,
|
|
@@ -15457,7 +15418,11 @@ function CompositeGrid({
|
|
|
15457
15418
|
Composite2,
|
|
15458
15419
|
{
|
|
15459
15420
|
role: isInfiniteScroll ? "feed" : "grid",
|
|
15460
|
-
className:
|
|
15421
|
+
className: clsx33("dataviews-view-grid", className2, {
|
|
15422
|
+
[`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
|
|
15423
|
+
view.layout.density
|
|
15424
|
+
)
|
|
15425
|
+
}),
|
|
15461
15426
|
focusWrap: true,
|
|
15462
15427
|
"aria-busy": isLoading,
|
|
15463
15428
|
"aria-rowcount": isInfiniteScroll ? void 0 : totalRows,
|
|
@@ -15551,7 +15516,7 @@ function ViewGrid({
|
|
|
15551
15516
|
return /* @__PURE__ */ jsx48(
|
|
15552
15517
|
"div",
|
|
15553
15518
|
{
|
|
15554
|
-
className:
|
|
15519
|
+
className: clsx34("dataviews-no-results", {
|
|
15555
15520
|
"is-refreshing": isDelayedLoading
|
|
15556
15521
|
}),
|
|
15557
15522
|
children: empty
|
|
@@ -15559,7 +15524,7 @@ function ViewGrid({
|
|
|
15559
15524
|
);
|
|
15560
15525
|
}
|
|
15561
15526
|
const gridProps = {
|
|
15562
|
-
className:
|
|
15527
|
+
className: clsx34(className2, {
|
|
15563
15528
|
"is-refreshing": !isInfiniteScroll && isDelayedLoading
|
|
15564
15529
|
}),
|
|
15565
15530
|
inert: !isInfiniteScroll && !!isLoading ? "true" : void 0,
|
|
@@ -15619,7 +15584,7 @@ function ViewGrid({
|
|
|
15619
15584
|
var grid_default = ViewGrid;
|
|
15620
15585
|
|
|
15621
15586
|
// src/components/dataviews-layouts/list/index.tsx
|
|
15622
|
-
import
|
|
15587
|
+
import clsx35 from "clsx";
|
|
15623
15588
|
import { __ as __27, sprintf as sprintf9 } from "@wordpress/i18n";
|
|
15624
15589
|
import { useRegistry as useRegistry3 } from "@wordpress/data";
|
|
15625
15590
|
import { Fragment as Fragment7, jsx as jsx49, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
@@ -15831,7 +15796,7 @@ function ListItem({
|
|
|
15831
15796
|
)
|
|
15832
15797
|
),
|
|
15833
15798
|
role: infiniteScrollEnabled ? "article" : "row",
|
|
15834
|
-
className:
|
|
15799
|
+
className: clsx35({
|
|
15835
15800
|
"is-selected": isSelected,
|
|
15836
15801
|
"is-hovered": isHovered
|
|
15837
15802
|
}),
|
|
@@ -16046,7 +16011,7 @@ function ViewList(props) {
|
|
|
16046
16011
|
return /* @__PURE__ */ jsx49(
|
|
16047
16012
|
"div",
|
|
16048
16013
|
{
|
|
16049
|
-
className:
|
|
16014
|
+
className: clsx35("dataviews-no-results", {
|
|
16050
16015
|
"is-refreshing": isDelayedLoading
|
|
16051
16016
|
}),
|
|
16052
16017
|
children: empty
|
|
@@ -16069,7 +16034,7 @@ function ViewList(props) {
|
|
|
16069
16034
|
{
|
|
16070
16035
|
direction: "column",
|
|
16071
16036
|
gap: "lg",
|
|
16072
|
-
className:
|
|
16037
|
+
className: clsx35("dataviews-view-list", className2),
|
|
16073
16038
|
children: Array.from(dataByGroup.entries()).map(
|
|
16074
16039
|
([groupName, groupItems]) => /* @__PURE__ */ jsxs9(
|
|
16075
16040
|
Stack,
|
|
@@ -16120,7 +16085,7 @@ function ViewList(props) {
|
|
|
16120
16085
|
ref: compositeRef,
|
|
16121
16086
|
id: baseId,
|
|
16122
16087
|
render: /* @__PURE__ */ jsx49("div", {}),
|
|
16123
|
-
className:
|
|
16088
|
+
className: clsx35("dataviews-view-list", className2, {
|
|
16124
16089
|
[`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
|
|
16125
16090
|
view.layout.density
|
|
16126
16091
|
),
|
|
@@ -16158,7 +16123,7 @@ function ViewList(props) {
|
|
|
16158
16123
|
}
|
|
16159
16124
|
|
|
16160
16125
|
// src/components/dataviews-layouts/activity/index.tsx
|
|
16161
|
-
import
|
|
16126
|
+
import clsx37 from "clsx";
|
|
16162
16127
|
|
|
16163
16128
|
// src/components/dataviews-layouts/activity/activity-group.tsx
|
|
16164
16129
|
import { __ as __28, sprintf as sprintf10 } from "@wordpress/i18n";
|
|
@@ -16198,7 +16163,7 @@ function ActivityGroup({
|
|
|
16198
16163
|
}
|
|
16199
16164
|
|
|
16200
16165
|
// src/components/dataviews-layouts/activity/activity-item.tsx
|
|
16201
|
-
import
|
|
16166
|
+
import clsx36 from "clsx";
|
|
16202
16167
|
import { useRegistry as useRegistry4 } from "@wordpress/data";
|
|
16203
16168
|
import { jsx as jsx51, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
16204
16169
|
function ActivityItem(props) {
|
|
@@ -16271,7 +16236,7 @@ function ActivityItem(props) {
|
|
|
16271
16236
|
role: infiniteScrollEnabled ? "article" : void 0,
|
|
16272
16237
|
"aria-posinset": posinset,
|
|
16273
16238
|
"aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
|
|
16274
|
-
className:
|
|
16239
|
+
className: clsx36(
|
|
16275
16240
|
"dataviews-view-activity__item",
|
|
16276
16241
|
density === "compact" && "is-compact",
|
|
16277
16242
|
density === "balanced" && "is-balanced",
|
|
@@ -16410,7 +16375,7 @@ function ViewActivity(props) {
|
|
|
16410
16375
|
return /* @__PURE__ */ jsx52(
|
|
16411
16376
|
"div",
|
|
16412
16377
|
{
|
|
16413
|
-
className:
|
|
16378
|
+
className: clsx37("dataviews-no-results", {
|
|
16414
16379
|
"is-refreshing": isDelayedLoading
|
|
16415
16380
|
}),
|
|
16416
16381
|
children: empty
|
|
@@ -16418,7 +16383,7 @@ function ViewActivity(props) {
|
|
|
16418
16383
|
);
|
|
16419
16384
|
}
|
|
16420
16385
|
const isInert = !isInfiniteScroll && !!isLoading;
|
|
16421
|
-
const wrapperClassName =
|
|
16386
|
+
const wrapperClassName = clsx37("dataviews-view-activity", className2, {
|
|
16422
16387
|
"is-refreshing": !isInfiniteScroll && isDelayedLoading
|
|
16423
16388
|
});
|
|
16424
16389
|
const groupedEntries = dataByGroup ? Array.from(dataByGroup.entries()) : [];
|
|
@@ -16467,7 +16432,7 @@ function ViewActivity(props) {
|
|
|
16467
16432
|
}
|
|
16468
16433
|
|
|
16469
16434
|
// src/components/dataviews-layouts/picker-grid/index.tsx
|
|
16470
|
-
import
|
|
16435
|
+
import clsx39 from "clsx";
|
|
16471
16436
|
import { __ as __31, sprintf as sprintf12 } from "@wordpress/i18n";
|
|
16472
16437
|
|
|
16473
16438
|
// src/components/dataviews-picker-footer/index.tsx
|
|
@@ -16735,14 +16700,14 @@ function DataViewsPickerFooter() {
|
|
|
16735
16700
|
}
|
|
16736
16701
|
|
|
16737
16702
|
// src/components/dataviews-layouts/utils/grid-items.tsx
|
|
16738
|
-
import
|
|
16703
|
+
import clsx38 from "clsx";
|
|
16739
16704
|
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
16740
16705
|
var GridItems = forwardRef(({ className: className2, previewSize, ...props }, ref) => {
|
|
16741
16706
|
return /* @__PURE__ */ jsx55(
|
|
16742
16707
|
"div",
|
|
16743
16708
|
{
|
|
16744
16709
|
ref,
|
|
16745
|
-
className:
|
|
16710
|
+
className: clsx38("dataviews-view-grid-items", className2),
|
|
16746
16711
|
style: {
|
|
16747
16712
|
gridTemplateColumns: previewSize && `repeat(auto-fill, minmax(${previewSize}px, 1fr))`
|
|
16748
16713
|
},
|
|
@@ -16790,7 +16755,7 @@ function GridItem3({
|
|
|
16790
16755
|
role: "option",
|
|
16791
16756
|
"aria-posinset": posinset,
|
|
16792
16757
|
"aria-setsize": setsize,
|
|
16793
|
-
className:
|
|
16758
|
+
className: clsx39("dataviews-view-picker-grid__card", {
|
|
16794
16759
|
"is-selected": isSelected
|
|
16795
16760
|
}),
|
|
16796
16761
|
"aria-selected": isSelected,
|
|
@@ -17000,9 +16965,14 @@ function ViewPickerGrid({
|
|
|
17000
16965
|
orientation: "horizontal",
|
|
17001
16966
|
role: "listbox",
|
|
17002
16967
|
"aria-multiselectable": isMultiselect,
|
|
17003
|
-
className:
|
|
16968
|
+
className: clsx39(
|
|
17004
16969
|
"dataviews-view-picker-grid",
|
|
17005
|
-
className2
|
|
16970
|
+
className2,
|
|
16971
|
+
{
|
|
16972
|
+
[`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
|
|
16973
|
+
view.layout.density
|
|
16974
|
+
)
|
|
16975
|
+
}
|
|
17006
16976
|
),
|
|
17007
16977
|
"aria-label": itemListLabel,
|
|
17008
16978
|
render: ({ children, ...props }) => /* @__PURE__ */ jsx56(
|
|
@@ -17070,9 +17040,15 @@ function ViewPickerGrid({
|
|
|
17070
17040
|
render: /* @__PURE__ */ jsx56(
|
|
17071
17041
|
GridItems,
|
|
17072
17042
|
{
|
|
17073
|
-
className:
|
|
17043
|
+
className: clsx39(
|
|
17074
17044
|
"dataviews-view-picker-grid",
|
|
17075
|
-
className2
|
|
17045
|
+
className2,
|
|
17046
|
+
{
|
|
17047
|
+
[`has-${view.layout?.density}-density`]: view.layout?.density && [
|
|
17048
|
+
"compact",
|
|
17049
|
+
"comfortable"
|
|
17050
|
+
].includes(view.layout.density)
|
|
17051
|
+
}
|
|
17076
17052
|
),
|
|
17077
17053
|
previewSize: usedPreviewSize,
|
|
17078
17054
|
"aria-busy": isLoading,
|
|
@@ -17118,7 +17094,7 @@ function ViewPickerGrid({
|
|
|
17118
17094
|
!hasData && /* @__PURE__ */ jsx56(
|
|
17119
17095
|
"div",
|
|
17120
17096
|
{
|
|
17121
|
-
className:
|
|
17097
|
+
className: clsx39({
|
|
17122
17098
|
"dataviews-loading": isLoading,
|
|
17123
17099
|
"dataviews-no-results": !isLoading
|
|
17124
17100
|
}),
|
|
@@ -17132,7 +17108,7 @@ function ViewPickerGrid({
|
|
|
17132
17108
|
var picker_grid_default = ViewPickerGrid;
|
|
17133
17109
|
|
|
17134
17110
|
// src/components/dataviews-layouts/picker-table/index.tsx
|
|
17135
|
-
import
|
|
17111
|
+
import clsx40 from "clsx";
|
|
17136
17112
|
import { __ as __32, sprintf as sprintf13 } from "@wordpress/i18n";
|
|
17137
17113
|
import { Fragment as Fragment10, jsx as jsx57, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
17138
17114
|
function TableColumnField2({
|
|
@@ -17145,7 +17121,7 @@ function TableColumnField2({
|
|
|
17145
17121
|
if (!field) {
|
|
17146
17122
|
return null;
|
|
17147
17123
|
}
|
|
17148
|
-
const className2 =
|
|
17124
|
+
const className2 = clsx40("dataviews-view-table__cell-content-wrapper", {
|
|
17149
17125
|
"dataviews-view-table__cell-align-end": align === "end",
|
|
17150
17126
|
"dataviews-view-table__cell-align-center": align === "center"
|
|
17151
17127
|
});
|
|
@@ -17188,7 +17164,7 @@ function TableRow2({
|
|
|
17188
17164
|
render: ({ children, ...props }) => /* @__PURE__ */ jsx57(
|
|
17189
17165
|
"tr",
|
|
17190
17166
|
{
|
|
17191
|
-
className:
|
|
17167
|
+
className: clsx40("dataviews-view-table__row", {
|
|
17192
17168
|
"is-selected": isSelected,
|
|
17193
17169
|
"is-hovered": isHovered
|
|
17194
17170
|
}),
|
|
@@ -17333,7 +17309,7 @@ function ViewPickerTable({
|
|
|
17333
17309
|
/* @__PURE__ */ jsxs16(
|
|
17334
17310
|
"table",
|
|
17335
17311
|
{
|
|
17336
|
-
className:
|
|
17312
|
+
className: clsx40(
|
|
17337
17313
|
"dataviews-view-table",
|
|
17338
17314
|
"dataviews-view-picker-table",
|
|
17339
17315
|
className2,
|
|
@@ -17494,7 +17470,7 @@ function ViewPickerTable({
|
|
|
17494
17470
|
/* @__PURE__ */ jsxs16(
|
|
17495
17471
|
"div",
|
|
17496
17472
|
{
|
|
17497
|
-
className:
|
|
17473
|
+
className: clsx40({
|
|
17498
17474
|
"dataviews-loading": isLoading,
|
|
17499
17475
|
"dataviews-no-results": !hasData && !isLoading
|
|
17500
17476
|
}),
|
|
@@ -17509,9 +17485,64 @@ function ViewPickerTable({
|
|
|
17509
17485
|
}
|
|
17510
17486
|
var picker_table_default = ViewPickerTable;
|
|
17511
17487
|
|
|
17488
|
+
// src/components/dataviews-layouts/utils/density-picker.tsx
|
|
17489
|
+
import { __ as __33, _x as _x2 } from "@wordpress/i18n";
|
|
17490
|
+
import { jsx as jsx58, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
17491
|
+
function DensityPicker() {
|
|
17492
|
+
const context = useContext(dataviews_context_default);
|
|
17493
|
+
const view = context.view;
|
|
17494
|
+
return /* @__PURE__ */ jsxs17(
|
|
17495
|
+
component_default10,
|
|
17496
|
+
{
|
|
17497
|
+
size: "__unstable-large",
|
|
17498
|
+
label: __33("Density"),
|
|
17499
|
+
value: view.layout?.density || "balanced",
|
|
17500
|
+
onChange: (value) => {
|
|
17501
|
+
context.onChangeView({
|
|
17502
|
+
...view,
|
|
17503
|
+
layout: {
|
|
17504
|
+
...view.layout,
|
|
17505
|
+
density: value
|
|
17506
|
+
}
|
|
17507
|
+
});
|
|
17508
|
+
},
|
|
17509
|
+
isBlock: true,
|
|
17510
|
+
children: [
|
|
17511
|
+
/* @__PURE__ */ jsx58(
|
|
17512
|
+
component_default12,
|
|
17513
|
+
{
|
|
17514
|
+
value: "comfortable",
|
|
17515
|
+
label: _x2(
|
|
17516
|
+
"Comfortable",
|
|
17517
|
+
"Density option for DataView layout"
|
|
17518
|
+
)
|
|
17519
|
+
},
|
|
17520
|
+
"comfortable"
|
|
17521
|
+
),
|
|
17522
|
+
/* @__PURE__ */ jsx58(
|
|
17523
|
+
component_default12,
|
|
17524
|
+
{
|
|
17525
|
+
value: "balanced",
|
|
17526
|
+
label: _x2("Balanced", "Density option for DataView layout")
|
|
17527
|
+
},
|
|
17528
|
+
"balanced"
|
|
17529
|
+
),
|
|
17530
|
+
/* @__PURE__ */ jsx58(
|
|
17531
|
+
component_default12,
|
|
17532
|
+
{
|
|
17533
|
+
value: "compact",
|
|
17534
|
+
label: _x2("Compact", "Density option for DataView layout")
|
|
17535
|
+
},
|
|
17536
|
+
"compact"
|
|
17537
|
+
)
|
|
17538
|
+
]
|
|
17539
|
+
}
|
|
17540
|
+
);
|
|
17541
|
+
}
|
|
17542
|
+
|
|
17512
17543
|
// src/components/dataviews-layouts/utils/preview-size-picker.tsx
|
|
17513
|
-
import { __ as
|
|
17514
|
-
import { jsx as
|
|
17544
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
17545
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
17515
17546
|
var imageSizes2 = [
|
|
17516
17547
|
{
|
|
17517
17548
|
value: 120,
|
|
@@ -17554,12 +17585,12 @@ function PreviewSizePicker() {
|
|
|
17554
17585
|
value: index
|
|
17555
17586
|
};
|
|
17556
17587
|
});
|
|
17557
|
-
return /* @__PURE__ */
|
|
17588
|
+
return /* @__PURE__ */ jsx59(
|
|
17558
17589
|
range_control_default,
|
|
17559
17590
|
{
|
|
17560
17591
|
__next40pxDefaultSize: true,
|
|
17561
17592
|
showTooltip: false,
|
|
17562
|
-
label:
|
|
17593
|
+
label: __34("Preview size"),
|
|
17563
17594
|
value: previewSizeToUse,
|
|
17564
17595
|
min: 0,
|
|
17565
17596
|
max: breakValues.length - 1,
|
|
@@ -17579,59 +17610,13 @@ function PreviewSizePicker() {
|
|
|
17579
17610
|
);
|
|
17580
17611
|
}
|
|
17581
17612
|
|
|
17582
|
-
// src/components/dataviews-layouts/utils/
|
|
17583
|
-
import {
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
|
|
17588
|
-
|
|
17589
|
-
component_default10,
|
|
17590
|
-
{
|
|
17591
|
-
size: "__unstable-large",
|
|
17592
|
-
label: __34("Density"),
|
|
17593
|
-
value: view.layout?.density || "balanced",
|
|
17594
|
-
onChange: (value) => {
|
|
17595
|
-
context.onChangeView({
|
|
17596
|
-
...view,
|
|
17597
|
-
layout: {
|
|
17598
|
-
...view.layout,
|
|
17599
|
-
density: value
|
|
17600
|
-
}
|
|
17601
|
-
});
|
|
17602
|
-
},
|
|
17603
|
-
isBlock: true,
|
|
17604
|
-
children: [
|
|
17605
|
-
/* @__PURE__ */ jsx59(
|
|
17606
|
-
component_default12,
|
|
17607
|
-
{
|
|
17608
|
-
value: "comfortable",
|
|
17609
|
-
label: _x2(
|
|
17610
|
-
"Comfortable",
|
|
17611
|
-
"Density option for DataView layout"
|
|
17612
|
-
)
|
|
17613
|
-
},
|
|
17614
|
-
"comfortable"
|
|
17615
|
-
),
|
|
17616
|
-
/* @__PURE__ */ jsx59(
|
|
17617
|
-
component_default12,
|
|
17618
|
-
{
|
|
17619
|
-
value: "balanced",
|
|
17620
|
-
label: _x2("Balanced", "Density option for DataView layout")
|
|
17621
|
-
},
|
|
17622
|
-
"balanced"
|
|
17623
|
-
),
|
|
17624
|
-
/* @__PURE__ */ jsx59(
|
|
17625
|
-
component_default12,
|
|
17626
|
-
{
|
|
17627
|
-
value: "compact",
|
|
17628
|
-
label: _x2("Compact", "Density option for DataView layout")
|
|
17629
|
-
},
|
|
17630
|
-
"compact"
|
|
17631
|
-
)
|
|
17632
|
-
]
|
|
17633
|
-
}
|
|
17634
|
-
);
|
|
17613
|
+
// src/components/dataviews-layouts/utils/grid-config-options.tsx
|
|
17614
|
+
import { Fragment as Fragment11, jsx as jsx60, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
17615
|
+
function GridConfigOptions() {
|
|
17616
|
+
return /* @__PURE__ */ jsxs18(Fragment11, { children: [
|
|
17617
|
+
/* @__PURE__ */ jsx60(DensityPicker, {}),
|
|
17618
|
+
/* @__PURE__ */ jsx60(PreviewSizePicker, {})
|
|
17619
|
+
] });
|
|
17635
17620
|
}
|
|
17636
17621
|
|
|
17637
17622
|
// src/components/dataviews-layouts/index.ts
|
|
@@ -17648,7 +17633,7 @@ var VIEW_LAYOUTS = [
|
|
|
17648
17633
|
label: __35("Grid"),
|
|
17649
17634
|
component: grid_default,
|
|
17650
17635
|
icon: category_default,
|
|
17651
|
-
viewConfigOptions:
|
|
17636
|
+
viewConfigOptions: GridConfigOptions
|
|
17652
17637
|
},
|
|
17653
17638
|
{
|
|
17654
17639
|
type: LAYOUT_LIST,
|
|
@@ -17669,7 +17654,7 @@ var VIEW_LAYOUTS = [
|
|
|
17669
17654
|
label: __35("Grid"),
|
|
17670
17655
|
component: picker_grid_default,
|
|
17671
17656
|
icon: category_default,
|
|
17672
|
-
viewConfigOptions:
|
|
17657
|
+
viewConfigOptions: GridConfigOptions,
|
|
17673
17658
|
isPicker: true
|
|
17674
17659
|
},
|
|
17675
17660
|
{
|
|
@@ -17683,13 +17668,13 @@ var VIEW_LAYOUTS = [
|
|
|
17683
17668
|
];
|
|
17684
17669
|
|
|
17685
17670
|
// src/components/dataviews-filters/filter.tsx
|
|
17686
|
-
import
|
|
17671
|
+
import clsx42 from "clsx";
|
|
17687
17672
|
import { __ as __38, sprintf as sprintf16 } from "@wordpress/i18n";
|
|
17688
17673
|
|
|
17689
17674
|
// src/components/dataviews-filters/search-widget.tsx
|
|
17690
17675
|
import * as Ariakit21 from "@ariakit/react";
|
|
17691
17676
|
import removeAccents2 from "remove-accents";
|
|
17692
|
-
import
|
|
17677
|
+
import clsx41 from "clsx";
|
|
17693
17678
|
import { __ as __36, sprintf as sprintf14 } from "@wordpress/i18n";
|
|
17694
17679
|
|
|
17695
17680
|
// src/components/dataviews-filters/utils.ts
|
|
@@ -17748,7 +17733,7 @@ function useElements({
|
|
|
17748
17733
|
}
|
|
17749
17734
|
|
|
17750
17735
|
// src/components/dataviews-filters/search-widget.tsx
|
|
17751
|
-
import { jsx as
|
|
17736
|
+
import { jsx as jsx61, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
17752
17737
|
function normalizeSearchInput(input = "") {
|
|
17753
17738
|
return removeAccents2(input.trim().toLowerCase());
|
|
17754
17739
|
}
|
|
@@ -17765,22 +17750,22 @@ function generateFilterElementCompositeItemId(prefix, filterElementValue) {
|
|
|
17765
17750
|
return `${prefix}-${filterElementValue}`;
|
|
17766
17751
|
}
|
|
17767
17752
|
var MultiSelectionOption = ({ selected }) => {
|
|
17768
|
-
return /* @__PURE__ */
|
|
17753
|
+
return /* @__PURE__ */ jsx61(
|
|
17769
17754
|
"span",
|
|
17770
17755
|
{
|
|
17771
|
-
className:
|
|
17756
|
+
className: clsx41(
|
|
17772
17757
|
"dataviews-filters__search-widget-listitem-multi-selection",
|
|
17773
17758
|
{ "is-selected": selected }
|
|
17774
17759
|
),
|
|
17775
|
-
children: selected && /* @__PURE__ */
|
|
17760
|
+
children: selected && /* @__PURE__ */ jsx61(icon_default2, { icon: check_default })
|
|
17776
17761
|
}
|
|
17777
17762
|
);
|
|
17778
17763
|
};
|
|
17779
17764
|
var SingleSelectionOption = ({ selected }) => {
|
|
17780
|
-
return /* @__PURE__ */
|
|
17765
|
+
return /* @__PURE__ */ jsx61(
|
|
17781
17766
|
"span",
|
|
17782
17767
|
{
|
|
17783
|
-
className:
|
|
17768
|
+
className: clsx41(
|
|
17784
17769
|
"dataviews-filters__search-widget-listitem-single-selection",
|
|
17785
17770
|
{ "is-selected": selected }
|
|
17786
17771
|
)
|
|
@@ -17802,7 +17787,7 @@ function ListBox({ view, filter, onChangeView }) {
|
|
|
17802
17787
|
(f) => f.field === filter.field
|
|
17803
17788
|
);
|
|
17804
17789
|
const currentValue = getCurrentValue(filter, currentFilter);
|
|
17805
|
-
return /* @__PURE__ */
|
|
17790
|
+
return /* @__PURE__ */ jsx61(
|
|
17806
17791
|
Composite2,
|
|
17807
17792
|
{
|
|
17808
17793
|
virtualFocus: true,
|
|
@@ -17826,18 +17811,18 @@ function ListBox({ view, filter, onChangeView }) {
|
|
|
17826
17811
|
);
|
|
17827
17812
|
}
|
|
17828
17813
|
},
|
|
17829
|
-
render: /* @__PURE__ */
|
|
17830
|
-
children: filter.elements.map((element) => /* @__PURE__ */
|
|
17814
|
+
render: /* @__PURE__ */ jsx61(Composite2.Typeahead, {}),
|
|
17815
|
+
children: filter.elements.map((element) => /* @__PURE__ */ jsxs19(
|
|
17831
17816
|
Composite2.Hover,
|
|
17832
17817
|
{
|
|
17833
|
-
render: /* @__PURE__ */
|
|
17818
|
+
render: /* @__PURE__ */ jsx61(
|
|
17834
17819
|
Composite2.Item,
|
|
17835
17820
|
{
|
|
17836
17821
|
id: generateFilterElementCompositeItemId(
|
|
17837
17822
|
baseId,
|
|
17838
17823
|
element.value
|
|
17839
17824
|
),
|
|
17840
|
-
render: /* @__PURE__ */
|
|
17825
|
+
render: /* @__PURE__ */ jsx61(
|
|
17841
17826
|
"div",
|
|
17842
17827
|
{
|
|
17843
17828
|
"aria-label": element.label,
|
|
@@ -17884,19 +17869,19 @@ function ListBox({ view, filter, onChangeView }) {
|
|
|
17884
17869
|
}
|
|
17885
17870
|
),
|
|
17886
17871
|
children: [
|
|
17887
|
-
filter.singleSelection && /* @__PURE__ */
|
|
17872
|
+
filter.singleSelection && /* @__PURE__ */ jsx61(
|
|
17888
17873
|
SingleSelectionOption,
|
|
17889
17874
|
{
|
|
17890
17875
|
selected: currentValue === element.value
|
|
17891
17876
|
}
|
|
17892
17877
|
),
|
|
17893
|
-
!filter.singleSelection && /* @__PURE__ */
|
|
17878
|
+
!filter.singleSelection && /* @__PURE__ */ jsx61(
|
|
17894
17879
|
MultiSelectionOption,
|
|
17895
17880
|
{
|
|
17896
17881
|
selected: currentValue.includes(element.value)
|
|
17897
17882
|
}
|
|
17898
17883
|
),
|
|
17899
|
-
/* @__PURE__ */
|
|
17884
|
+
/* @__PURE__ */ jsx61(
|
|
17900
17885
|
"span",
|
|
17901
17886
|
{
|
|
17902
17887
|
className: "dataviews-filters__search-widget-listitem-value",
|
|
@@ -17924,7 +17909,7 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
17924
17909
|
(item2) => normalizeSearchInput(item2.label).includes(normalizedSearch)
|
|
17925
17910
|
);
|
|
17926
17911
|
}, [filter.elements, deferredSearchValue]);
|
|
17927
|
-
return /* @__PURE__ */
|
|
17912
|
+
return /* @__PURE__ */ jsxs19(
|
|
17928
17913
|
Ariakit21.ComboboxProvider,
|
|
17929
17914
|
{
|
|
17930
17915
|
selectedValue: currentValue,
|
|
@@ -17956,15 +17941,15 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
17956
17941
|
},
|
|
17957
17942
|
setValue: setSearchValue,
|
|
17958
17943
|
children: [
|
|
17959
|
-
/* @__PURE__ */
|
|
17960
|
-
/* @__PURE__ */
|
|
17944
|
+
/* @__PURE__ */ jsxs19("div", { className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [
|
|
17945
|
+
/* @__PURE__ */ jsx61(
|
|
17961
17946
|
Ariakit21.ComboboxLabel,
|
|
17962
17947
|
{
|
|
17963
|
-
render: /* @__PURE__ */
|
|
17948
|
+
render: /* @__PURE__ */ jsx61(component_default2, { children: __36("Search items") }),
|
|
17964
17949
|
children: __36("Search items")
|
|
17965
17950
|
}
|
|
17966
17951
|
),
|
|
17967
|
-
/* @__PURE__ */
|
|
17952
|
+
/* @__PURE__ */ jsx61(
|
|
17968
17953
|
Ariakit21.Combobox,
|
|
17969
17954
|
{
|
|
17970
17955
|
autoSelect: "always",
|
|
@@ -17972,16 +17957,16 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
17972
17957
|
className: "dataviews-filters__search-widget-filter-combobox__input"
|
|
17973
17958
|
}
|
|
17974
17959
|
),
|
|
17975
|
-
/* @__PURE__ */
|
|
17960
|
+
/* @__PURE__ */ jsx61("div", { className: "dataviews-filters__search-widget-filter-combobox__icon", children: /* @__PURE__ */ jsx61(icon_default2, { icon: search_default }) })
|
|
17976
17961
|
] }),
|
|
17977
|
-
/* @__PURE__ */
|
|
17962
|
+
/* @__PURE__ */ jsxs19(
|
|
17978
17963
|
Ariakit21.ComboboxList,
|
|
17979
17964
|
{
|
|
17980
17965
|
className: "dataviews-filters__search-widget-filter-combobox-list",
|
|
17981
17966
|
alwaysVisible: true,
|
|
17982
17967
|
children: [
|
|
17983
17968
|
matches.map((element) => {
|
|
17984
|
-
return /* @__PURE__ */
|
|
17969
|
+
return /* @__PURE__ */ jsxs19(
|
|
17985
17970
|
Ariakit21.ComboboxItem,
|
|
17986
17971
|
{
|
|
17987
17972
|
resetValueOnSelect: false,
|
|
@@ -17991,13 +17976,13 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
17991
17976
|
setValueOnClick: false,
|
|
17992
17977
|
focusOnHover: true,
|
|
17993
17978
|
children: [
|
|
17994
|
-
filter.singleSelection && /* @__PURE__ */
|
|
17979
|
+
filter.singleSelection && /* @__PURE__ */ jsx61(
|
|
17995
17980
|
SingleSelectionOption,
|
|
17996
17981
|
{
|
|
17997
17982
|
selected: currentValue === element.value
|
|
17998
17983
|
}
|
|
17999
17984
|
),
|
|
18000
|
-
!filter.singleSelection && /* @__PURE__ */
|
|
17985
|
+
!filter.singleSelection && /* @__PURE__ */ jsx61(
|
|
18001
17986
|
MultiSelectionOption,
|
|
18002
17987
|
{
|
|
18003
17988
|
selected: currentValue.includes(
|
|
@@ -18005,20 +17990,20 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
18005
17990
|
)
|
|
18006
17991
|
}
|
|
18007
17992
|
),
|
|
18008
|
-
/* @__PURE__ */
|
|
17993
|
+
/* @__PURE__ */ jsxs19(
|
|
18009
17994
|
"span",
|
|
18010
17995
|
{
|
|
18011
17996
|
className: "dataviews-filters__search-widget-listitem-value",
|
|
18012
17997
|
title: element.label,
|
|
18013
17998
|
children: [
|
|
18014
|
-
/* @__PURE__ */
|
|
17999
|
+
/* @__PURE__ */ jsx61(
|
|
18015
18000
|
Ariakit21.ComboboxItemValue,
|
|
18016
18001
|
{
|
|
18017
18002
|
className: "dataviews-filters__search-widget-filter-combobox-item-value",
|
|
18018
18003
|
value: element.label
|
|
18019
18004
|
}
|
|
18020
18005
|
),
|
|
18021
|
-
!!element.description && /* @__PURE__ */
|
|
18006
|
+
!!element.description && /* @__PURE__ */ jsx61("span", { className: "dataviews-filters__search-widget-listitem-description", children: element.description })
|
|
18022
18007
|
]
|
|
18023
18008
|
}
|
|
18024
18009
|
)
|
|
@@ -18027,7 +18012,7 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
18027
18012
|
element.value
|
|
18028
18013
|
);
|
|
18029
18014
|
}),
|
|
18030
|
-
!matches.length && /* @__PURE__ */
|
|
18015
|
+
!matches.length && /* @__PURE__ */ jsx61("p", { children: __36("No results found") })
|
|
18031
18016
|
]
|
|
18032
18017
|
}
|
|
18033
18018
|
)
|
|
@@ -18041,18 +18026,18 @@ function SearchWidget(props) {
|
|
|
18041
18026
|
getElements: props.filter.getElements
|
|
18042
18027
|
});
|
|
18043
18028
|
if (isLoading) {
|
|
18044
|
-
return /* @__PURE__ */
|
|
18029
|
+
return /* @__PURE__ */ jsx61("div", { className: "dataviews-filters__search-widget-no-elements", children: /* @__PURE__ */ jsx61(spinner_default, {}) });
|
|
18045
18030
|
}
|
|
18046
18031
|
if (elements.length === 0) {
|
|
18047
|
-
return /* @__PURE__ */
|
|
18032
|
+
return /* @__PURE__ */ jsx61("div", { className: "dataviews-filters__search-widget-no-elements", children: __36("No elements found") });
|
|
18048
18033
|
}
|
|
18049
18034
|
const Widget = elements.length > 10 ? ComboboxList2 : ListBox;
|
|
18050
|
-
return /* @__PURE__ */
|
|
18035
|
+
return /* @__PURE__ */ jsx61(Widget, { ...props, filter: { ...props.filter, elements } });
|
|
18051
18036
|
}
|
|
18052
18037
|
|
|
18053
18038
|
// src/components/dataviews-filters/input-widget.tsx
|
|
18054
18039
|
import fastDeepEqual2 from "fast-deep-equal/es6/index.js";
|
|
18055
|
-
import { jsx as
|
|
18040
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
18056
18041
|
function InputWidget({
|
|
18057
18042
|
filter,
|
|
18058
18043
|
view,
|
|
@@ -18116,13 +18101,13 @@ function InputWidget({
|
|
|
18116
18101
|
if (!field || !field.Edit || !currentFilter) {
|
|
18117
18102
|
return null;
|
|
18118
18103
|
}
|
|
18119
|
-
return /* @__PURE__ */
|
|
18104
|
+
return /* @__PURE__ */ jsx62(
|
|
18120
18105
|
component_default3,
|
|
18121
18106
|
{
|
|
18122
18107
|
className: "dataviews-filters__user-input-widget",
|
|
18123
18108
|
gap: 2.5,
|
|
18124
18109
|
direction: "column",
|
|
18125
|
-
children: /* @__PURE__ */
|
|
18110
|
+
children: /* @__PURE__ */ jsx62(
|
|
18126
18111
|
field.Edit,
|
|
18127
18112
|
{
|
|
18128
18113
|
hideLabelFromVision: true,
|
|
@@ -18140,10 +18125,10 @@ function InputWidget({
|
|
|
18140
18125
|
import { subDays, subWeeks, subMonths, subYears } from "date-fns";
|
|
18141
18126
|
import { __ as __37, sprintf as sprintf15 } from "@wordpress/i18n";
|
|
18142
18127
|
import { getDate } from "@wordpress/date";
|
|
18143
|
-
import { jsx as
|
|
18128
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
18144
18129
|
var filterTextWrappers = {
|
|
18145
|
-
Name: /* @__PURE__ */
|
|
18146
|
-
Value: /* @__PURE__ */
|
|
18130
|
+
Name: /* @__PURE__ */ jsx63("span", { className: "dataviews-filters__summary-filter-text-name" }),
|
|
18131
|
+
Value: /* @__PURE__ */ jsx63("span", { className: "dataviews-filters__summary-filter-text-value" })
|
|
18147
18132
|
};
|
|
18148
18133
|
function getRelativeDate(value, unit) {
|
|
18149
18134
|
switch (unit) {
|
|
@@ -18679,7 +18664,7 @@ var isSingleSelectionOperator = (name) => OPERATORS.filter((op) => op.selection
|
|
|
18679
18664
|
var isRegisteredOperator = (name) => OPERATORS.some((op) => op.name === name);
|
|
18680
18665
|
|
|
18681
18666
|
// src/components/dataviews-filters/filter.tsx
|
|
18682
|
-
import { jsx as
|
|
18667
|
+
import { jsx as jsx64, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
18683
18668
|
var ENTER = "Enter";
|
|
18684
18669
|
var SPACE = " ";
|
|
18685
18670
|
var FilterText = ({
|
|
@@ -18713,7 +18698,7 @@ function OperatorSelector({
|
|
|
18713
18698
|
(_filter) => _filter.field === filter.field
|
|
18714
18699
|
);
|
|
18715
18700
|
const value = currentFilter?.operator || filter.operators[0];
|
|
18716
|
-
return operatorOptions.length > 1 && /* @__PURE__ */
|
|
18701
|
+
return operatorOptions.length > 1 && /* @__PURE__ */ jsxs20(
|
|
18717
18702
|
Stack,
|
|
18718
18703
|
{
|
|
18719
18704
|
direction: "row",
|
|
@@ -18722,8 +18707,8 @@ function OperatorSelector({
|
|
|
18722
18707
|
className: "dataviews-filters__summary-operators-container",
|
|
18723
18708
|
align: "center",
|
|
18724
18709
|
children: [
|
|
18725
|
-
/* @__PURE__ */
|
|
18726
|
-
/* @__PURE__ */
|
|
18710
|
+
/* @__PURE__ */ jsx64(component_default4, { className: "dataviews-filters__summary-operators-filter-name", children: filter.name }),
|
|
18711
|
+
/* @__PURE__ */ jsx64(
|
|
18727
18712
|
select_control_default,
|
|
18728
18713
|
{
|
|
18729
18714
|
className: "dataviews-filters__summary-operators-filter-select",
|
|
@@ -18849,7 +18834,7 @@ function Filter({
|
|
|
18849
18834
|
const isLocked = filterInView?.isLocked;
|
|
18850
18835
|
const hasValues = !isLocked && filterInView?.value !== void 0;
|
|
18851
18836
|
const canResetOrRemove = !isLocked && (!isPrimary || hasValues);
|
|
18852
|
-
return /* @__PURE__ */
|
|
18837
|
+
return /* @__PURE__ */ jsx64(
|
|
18853
18838
|
dropdown_default,
|
|
18854
18839
|
{
|
|
18855
18840
|
defaultOpen: openedFilter === filter.field,
|
|
@@ -18858,8 +18843,8 @@ function Filter({
|
|
|
18858
18843
|
onClose: () => {
|
|
18859
18844
|
toggleRef.current?.focus();
|
|
18860
18845
|
},
|
|
18861
|
-
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */
|
|
18862
|
-
/* @__PURE__ */
|
|
18846
|
+
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ jsxs20("div", { className: "dataviews-filters__summary-chip-container", children: [
|
|
18847
|
+
/* @__PURE__ */ jsx64(
|
|
18863
18848
|
tooltip_default,
|
|
18864
18849
|
{
|
|
18865
18850
|
text: sprintf16(
|
|
@@ -18868,10 +18853,10 @@ function Filter({
|
|
|
18868
18853
|
filter.name.toLowerCase()
|
|
18869
18854
|
),
|
|
18870
18855
|
placement: "top",
|
|
18871
|
-
children: /* @__PURE__ */
|
|
18856
|
+
children: /* @__PURE__ */ jsx64(
|
|
18872
18857
|
"div",
|
|
18873
18858
|
{
|
|
18874
|
-
className:
|
|
18859
|
+
className: clsx42(
|
|
18875
18860
|
"dataviews-filters__summary-chip",
|
|
18876
18861
|
{
|
|
18877
18862
|
"has-reset": canResetOrRemove,
|
|
@@ -18896,7 +18881,7 @@ function Filter({
|
|
|
18896
18881
|
"aria-pressed": isOpen,
|
|
18897
18882
|
"aria-expanded": isOpen,
|
|
18898
18883
|
ref: toggleRef,
|
|
18899
|
-
children: /* @__PURE__ */
|
|
18884
|
+
children: /* @__PURE__ */ jsx64(
|
|
18900
18885
|
FilterText,
|
|
18901
18886
|
{
|
|
18902
18887
|
activeElements,
|
|
@@ -18908,15 +18893,15 @@ function Filter({
|
|
|
18908
18893
|
)
|
|
18909
18894
|
}
|
|
18910
18895
|
),
|
|
18911
|
-
canResetOrRemove && /* @__PURE__ */
|
|
18896
|
+
canResetOrRemove && /* @__PURE__ */ jsx64(
|
|
18912
18897
|
tooltip_default,
|
|
18913
18898
|
{
|
|
18914
18899
|
text: isPrimary ? __38("Reset") : __38("Remove"),
|
|
18915
18900
|
placement: "top",
|
|
18916
|
-
children: /* @__PURE__ */
|
|
18901
|
+
children: /* @__PURE__ */ jsx64(
|
|
18917
18902
|
"button",
|
|
18918
18903
|
{
|
|
18919
|
-
className:
|
|
18904
|
+
className: clsx42(
|
|
18920
18905
|
"dataviews-filters__summary-chip-remove",
|
|
18921
18906
|
{ "has-values": hasValues }
|
|
18922
18907
|
),
|
|
@@ -18934,16 +18919,16 @@ function Filter({
|
|
|
18934
18919
|
toggleRef.current?.focus();
|
|
18935
18920
|
}
|
|
18936
18921
|
},
|
|
18937
|
-
children: /* @__PURE__ */
|
|
18922
|
+
children: /* @__PURE__ */ jsx64(icon_default2, { icon: close_small_default })
|
|
18938
18923
|
}
|
|
18939
18924
|
)
|
|
18940
18925
|
}
|
|
18941
18926
|
)
|
|
18942
18927
|
] }),
|
|
18943
18928
|
renderContent: () => {
|
|
18944
|
-
return /* @__PURE__ */
|
|
18945
|
-
/* @__PURE__ */
|
|
18946
|
-
commonProps.filter.hasElements ? /* @__PURE__ */
|
|
18929
|
+
return /* @__PURE__ */ jsxs20(Stack, { direction: "column", justify: "flex-start", children: [
|
|
18930
|
+
/* @__PURE__ */ jsx64(OperatorSelector, { ...commonProps }),
|
|
18931
|
+
commonProps.filter.hasElements ? /* @__PURE__ */ jsx64(
|
|
18947
18932
|
SearchWidget,
|
|
18948
18933
|
{
|
|
18949
18934
|
...commonProps,
|
|
@@ -18952,7 +18937,7 @@ function Filter({
|
|
|
18952
18937
|
elements
|
|
18953
18938
|
}
|
|
18954
18939
|
}
|
|
18955
|
-
) : /* @__PURE__ */
|
|
18940
|
+
) : /* @__PURE__ */ jsx64(InputWidget, { ...commonProps, fields })
|
|
18956
18941
|
] });
|
|
18957
18942
|
}
|
|
18958
18943
|
}
|
|
@@ -18961,7 +18946,7 @@ function Filter({
|
|
|
18961
18946
|
|
|
18962
18947
|
// src/components/dataviews-filters/add-filter.tsx
|
|
18963
18948
|
import { __ as __39 } from "@wordpress/i18n";
|
|
18964
|
-
import { jsx as
|
|
18949
|
+
import { jsx as jsx65, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
18965
18950
|
var { Menu: Menu7 } = unlock3(privateApis);
|
|
18966
18951
|
function AddFilterMenu({
|
|
18967
18952
|
filters,
|
|
@@ -18971,10 +18956,10 @@ function AddFilterMenu({
|
|
|
18971
18956
|
triggerProps
|
|
18972
18957
|
}) {
|
|
18973
18958
|
const inactiveFilters = filters.filter((filter) => !filter.isVisible);
|
|
18974
|
-
return /* @__PURE__ */
|
|
18975
|
-
/* @__PURE__ */
|
|
18976
|
-
/* @__PURE__ */
|
|
18977
|
-
return /* @__PURE__ */
|
|
18959
|
+
return /* @__PURE__ */ jsxs21(Menu7, { children: [
|
|
18960
|
+
/* @__PURE__ */ jsx65(Menu7.TriggerButton, { ...triggerProps }),
|
|
18961
|
+
/* @__PURE__ */ jsx65(Menu7.Popover, { children: inactiveFilters.map((filter) => {
|
|
18962
|
+
return /* @__PURE__ */ jsx65(
|
|
18978
18963
|
Menu7.Item,
|
|
18979
18964
|
{
|
|
18980
18965
|
onClick: () => {
|
|
@@ -18992,7 +18977,7 @@ function AddFilterMenu({
|
|
|
18992
18977
|
]
|
|
18993
18978
|
});
|
|
18994
18979
|
},
|
|
18995
|
-
children: /* @__PURE__ */
|
|
18980
|
+
children: /* @__PURE__ */ jsx65(Menu7.ItemLabel, { children: filter.name })
|
|
18996
18981
|
},
|
|
18997
18982
|
filter.field
|
|
18998
18983
|
);
|
|
@@ -19004,11 +18989,11 @@ function AddFilter({ filters, view, onChangeView, setOpenedFilter }, ref) {
|
|
|
19004
18989
|
return null;
|
|
19005
18990
|
}
|
|
19006
18991
|
const inactiveFilters = filters.filter((filter) => !filter.isVisible);
|
|
19007
|
-
return /* @__PURE__ */
|
|
18992
|
+
return /* @__PURE__ */ jsx65(
|
|
19008
18993
|
AddFilterMenu,
|
|
19009
18994
|
{
|
|
19010
18995
|
triggerProps: {
|
|
19011
|
-
render: /* @__PURE__ */
|
|
18996
|
+
render: /* @__PURE__ */ jsx65(
|
|
19012
18997
|
button_default,
|
|
19013
18998
|
{
|
|
19014
18999
|
accessibleWhenDisabled: true,
|
|
@@ -19029,7 +19014,7 @@ var add_filter_default = forwardRef(AddFilter);
|
|
|
19029
19014
|
|
|
19030
19015
|
// src/components/dataviews-filters/reset-filters.tsx
|
|
19031
19016
|
import { __ as __40 } from "@wordpress/i18n";
|
|
19032
|
-
import { jsx as
|
|
19017
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
19033
19018
|
function ResetFilter({
|
|
19034
19019
|
filters,
|
|
19035
19020
|
view,
|
|
@@ -19041,7 +19026,7 @@ function ResetFilter({
|
|
|
19041
19026
|
const isDisabled = !view.search && !view.filters?.some(
|
|
19042
19027
|
(_filter) => !_filter.isLocked && (_filter.value !== void 0 || !isPrimary(_filter.field))
|
|
19043
19028
|
);
|
|
19044
|
-
return /* @__PURE__ */
|
|
19029
|
+
return /* @__PURE__ */ jsx66(
|
|
19045
19030
|
button_default,
|
|
19046
19031
|
{
|
|
19047
19032
|
disabled: isDisabled,
|
|
@@ -19113,12 +19098,12 @@ function useFilters(fields, view) {
|
|
|
19113
19098
|
var use_filters_default = useFilters;
|
|
19114
19099
|
|
|
19115
19100
|
// src/components/dataviews-filters/filters.tsx
|
|
19116
|
-
import { jsx as
|
|
19101
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
19117
19102
|
function Filters({ className: className2 }) {
|
|
19118
19103
|
const { fields, view, onChangeView, openedFilter, setOpenedFilter } = useContext(dataviews_context_default);
|
|
19119
19104
|
const addFilterRef = useRef(null);
|
|
19120
19105
|
const filters = use_filters_default(fields, view);
|
|
19121
|
-
const addFilter = /* @__PURE__ */
|
|
19106
|
+
const addFilter = /* @__PURE__ */ jsx67(
|
|
19122
19107
|
add_filter_default,
|
|
19123
19108
|
{
|
|
19124
19109
|
filters,
|
|
@@ -19135,7 +19120,7 @@ function Filters({ className: className2 }) {
|
|
|
19135
19120
|
}
|
|
19136
19121
|
const filterComponents = [
|
|
19137
19122
|
...visibleFilters.map((filter) => {
|
|
19138
|
-
return /* @__PURE__ */
|
|
19123
|
+
return /* @__PURE__ */ jsx67(
|
|
19139
19124
|
Filter,
|
|
19140
19125
|
{
|
|
19141
19126
|
filter,
|
|
@@ -19151,7 +19136,7 @@ function Filters({ className: className2 }) {
|
|
|
19151
19136
|
addFilter
|
|
19152
19137
|
];
|
|
19153
19138
|
filterComponents.push(
|
|
19154
|
-
/* @__PURE__ */
|
|
19139
|
+
/* @__PURE__ */ jsx67(
|
|
19155
19140
|
ResetFilter,
|
|
19156
19141
|
{
|
|
19157
19142
|
filters,
|
|
@@ -19161,7 +19146,7 @@ function Filters({ className: className2 }) {
|
|
|
19161
19146
|
"reset-filters"
|
|
19162
19147
|
)
|
|
19163
19148
|
);
|
|
19164
|
-
return /* @__PURE__ */
|
|
19149
|
+
return /* @__PURE__ */ jsx67(
|
|
19165
19150
|
Stack,
|
|
19166
19151
|
{
|
|
19167
19152
|
direction: "row",
|
|
@@ -19178,7 +19163,7 @@ var filters_default = memo(Filters);
|
|
|
19178
19163
|
|
|
19179
19164
|
// src/components/dataviews-filters/toggle.tsx
|
|
19180
19165
|
import { __ as __41, _x as _x3 } from "@wordpress/i18n";
|
|
19181
|
-
import { Fragment as
|
|
19166
|
+
import { Fragment as Fragment12, jsx as jsx68, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
19182
19167
|
function FiltersToggle() {
|
|
19183
19168
|
const {
|
|
19184
19169
|
filters,
|
|
@@ -19219,7 +19204,7 @@ function FiltersToggle() {
|
|
|
19219
19204
|
const hasPrimaryOrLockedFilters = filters.some(
|
|
19220
19205
|
(filter) => filter.isPrimary || filter.isLocked
|
|
19221
19206
|
);
|
|
19222
|
-
const buttonComponent = /* @__PURE__ */
|
|
19207
|
+
const buttonComponent = /* @__PURE__ */ jsx68(
|
|
19223
19208
|
button_default,
|
|
19224
19209
|
{
|
|
19225
19210
|
ref: buttonRef,
|
|
@@ -19231,7 +19216,7 @@ function FiltersToggle() {
|
|
|
19231
19216
|
...hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps
|
|
19232
19217
|
}
|
|
19233
19218
|
);
|
|
19234
|
-
return /* @__PURE__ */
|
|
19219
|
+
return /* @__PURE__ */ jsx68("div", { className: "dataviews-filters__container-visibility-toggle", children: !hasVisibleFilters ? /* @__PURE__ */ jsx68(
|
|
19235
19220
|
AddFilterMenu,
|
|
19236
19221
|
{
|
|
19237
19222
|
filters,
|
|
@@ -19240,7 +19225,7 @@ function FiltersToggle() {
|
|
|
19240
19225
|
setOpenedFilter,
|
|
19241
19226
|
triggerProps: { render: buttonComponent }
|
|
19242
19227
|
}
|
|
19243
|
-
) : /* @__PURE__ */
|
|
19228
|
+
) : /* @__PURE__ */ jsx68(
|
|
19244
19229
|
FilterVisibilityToggle,
|
|
19245
19230
|
{
|
|
19246
19231
|
buttonRef,
|
|
@@ -19260,27 +19245,27 @@ function FilterVisibilityToggle({
|
|
|
19260
19245
|
},
|
|
19261
19246
|
[buttonRef]
|
|
19262
19247
|
);
|
|
19263
|
-
return /* @__PURE__ */
|
|
19248
|
+
return /* @__PURE__ */ jsxs22(Fragment12, { children: [
|
|
19264
19249
|
children,
|
|
19265
|
-
!!filtersCount && /* @__PURE__ */
|
|
19250
|
+
!!filtersCount && /* @__PURE__ */ jsx68("span", { className: "dataviews-filters-toggle__count", children: filtersCount })
|
|
19266
19251
|
] });
|
|
19267
19252
|
}
|
|
19268
19253
|
var toggle_default = FiltersToggle;
|
|
19269
19254
|
|
|
19270
19255
|
// src/components/dataviews-filters/filters-toggled.tsx
|
|
19271
|
-
import { jsx as
|
|
19256
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
19272
19257
|
function FiltersToggled(props) {
|
|
19273
19258
|
const { isShowingFilter } = useContext(dataviews_context_default);
|
|
19274
19259
|
if (!isShowingFilter) {
|
|
19275
19260
|
return null;
|
|
19276
19261
|
}
|
|
19277
|
-
return /* @__PURE__ */
|
|
19262
|
+
return /* @__PURE__ */ jsx69(filters_default, { ...props });
|
|
19278
19263
|
}
|
|
19279
19264
|
var filters_toggled_default = FiltersToggled;
|
|
19280
19265
|
|
|
19281
19266
|
// src/components/dataviews-layout/index.tsx
|
|
19282
19267
|
import { __ as __42 } from "@wordpress/i18n";
|
|
19283
|
-
import { jsx as
|
|
19268
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
19284
19269
|
function DataViewsLayout({ className: className2 }) {
|
|
19285
19270
|
const {
|
|
19286
19271
|
actions = [],
|
|
@@ -19299,15 +19284,22 @@ function DataViewsLayout({ className: className2 }) {
|
|
|
19299
19284
|
isItemClickable: isItemClickable2,
|
|
19300
19285
|
renderItemLink,
|
|
19301
19286
|
defaultLayouts,
|
|
19302
|
-
|
|
19287
|
+
containerRef,
|
|
19288
|
+
empty = /* @__PURE__ */ jsx70("p", { children: __42("No results") })
|
|
19303
19289
|
} = useContext(dataviews_context_default);
|
|
19290
|
+
const isDelayedInitialLoading = useDelayedLoading(!hasInitiallyLoaded, {
|
|
19291
|
+
delay: 200
|
|
19292
|
+
});
|
|
19304
19293
|
if (!hasInitiallyLoaded) {
|
|
19305
|
-
|
|
19294
|
+
if (!isDelayedInitialLoading) {
|
|
19295
|
+
return null;
|
|
19296
|
+
}
|
|
19297
|
+
return /* @__PURE__ */ jsx70("div", { className: "dataviews-loading", children: /* @__PURE__ */ jsx70("p", { children: /* @__PURE__ */ jsx70(spinner_default, {}) }) });
|
|
19306
19298
|
}
|
|
19307
19299
|
const ViewComponent = VIEW_LAYOUTS.find(
|
|
19308
19300
|
(v) => v.type === view.type && defaultLayouts[v.type]
|
|
19309
19301
|
)?.component;
|
|
19310
|
-
return /* @__PURE__ */
|
|
19302
|
+
return /* @__PURE__ */ jsx70("div", { className: "dataviews-layout__container", ref: containerRef, children: /* @__PURE__ */ jsx70(
|
|
19311
19303
|
ViewComponent,
|
|
19312
19304
|
{
|
|
19313
19305
|
className: className2,
|
|
@@ -19327,12 +19319,12 @@ function DataViewsLayout({ className: className2 }) {
|
|
|
19327
19319
|
view,
|
|
19328
19320
|
empty
|
|
19329
19321
|
}
|
|
19330
|
-
);
|
|
19322
|
+
) });
|
|
19331
19323
|
}
|
|
19332
19324
|
|
|
19333
19325
|
// src/components/dataviews-footer/index.tsx
|
|
19334
|
-
import
|
|
19335
|
-
import { jsx as
|
|
19326
|
+
import clsx43 from "clsx";
|
|
19327
|
+
import { jsx as jsx71, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
19336
19328
|
var EMPTY_ARRAY5 = [];
|
|
19337
19329
|
function DataViewsFooter() {
|
|
19338
19330
|
const {
|
|
@@ -19350,24 +19342,24 @@ function DataViewsFooter() {
|
|
|
19350
19342
|
if (!isRefreshing && (!totalItems || !totalPages || totalPages <= 1 && !hasBulkActions)) {
|
|
19351
19343
|
return null;
|
|
19352
19344
|
}
|
|
19353
|
-
return (!!totalItems || isRefreshing) && /* @__PURE__ */
|
|
19345
|
+
return (!!totalItems || isRefreshing) && /* @__PURE__ */ jsx71(
|
|
19354
19346
|
"div",
|
|
19355
19347
|
{
|
|
19356
19348
|
className: "dataviews-footer",
|
|
19357
19349
|
inert: isRefreshing ? "true" : void 0,
|
|
19358
|
-
children: /* @__PURE__ */
|
|
19350
|
+
children: /* @__PURE__ */ jsxs23(
|
|
19359
19351
|
Stack,
|
|
19360
19352
|
{
|
|
19361
19353
|
direction: "row",
|
|
19362
19354
|
justify: "end",
|
|
19363
19355
|
align: "center",
|
|
19364
|
-
className:
|
|
19356
|
+
className: clsx43("dataviews-footer__content", {
|
|
19365
19357
|
"is-refreshing": isDelayedRefreshing
|
|
19366
19358
|
}),
|
|
19367
19359
|
gap: "sm",
|
|
19368
19360
|
children: [
|
|
19369
|
-
hasBulkActions && /* @__PURE__ */
|
|
19370
|
-
/* @__PURE__ */
|
|
19361
|
+
hasBulkActions && /* @__PURE__ */ jsx71(BulkActionsFooter, {}),
|
|
19362
|
+
/* @__PURE__ */ jsx71(dataviews_pagination_default, {})
|
|
19371
19363
|
]
|
|
19372
19364
|
}
|
|
19373
19365
|
)
|
|
@@ -19377,7 +19369,7 @@ function DataViewsFooter() {
|
|
|
19377
19369
|
|
|
19378
19370
|
// src/components/dataviews-search/index.tsx
|
|
19379
19371
|
import { __ as __43 } from "@wordpress/i18n";
|
|
19380
|
-
import { jsx as
|
|
19372
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
19381
19373
|
var DataViewsSearch = memo(function Search({ label }) {
|
|
19382
19374
|
const { view, onChangeView } = useContext(dataviews_context_default);
|
|
19383
19375
|
const [search, setSearch, debouncedSearch] = useDebouncedInput(
|
|
@@ -19404,7 +19396,7 @@ var DataViewsSearch = memo(function Search({ label }) {
|
|
|
19404
19396
|
}
|
|
19405
19397
|
}, [debouncedSearch]);
|
|
19406
19398
|
const searchLabel = label || __43("Search");
|
|
19407
|
-
return /* @__PURE__ */
|
|
19399
|
+
return /* @__PURE__ */ jsx72(
|
|
19408
19400
|
search_control_default,
|
|
19409
19401
|
{
|
|
19410
19402
|
className: "dataviews-search",
|
|
@@ -19423,7 +19415,7 @@ import { __ as __45, _x as _x4 } from "@wordpress/i18n";
|
|
|
19423
19415
|
|
|
19424
19416
|
// src/components/dataviews-view-config/infinite-scroll-toggle.tsx
|
|
19425
19417
|
import { __ as __44 } from "@wordpress/i18n";
|
|
19426
|
-
import { jsx as
|
|
19418
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
19427
19419
|
function InfiniteScrollToggle() {
|
|
19428
19420
|
const context = useContext(dataviews_context_default);
|
|
19429
19421
|
const { view, onChangeView } = context;
|
|
@@ -19431,7 +19423,7 @@ function InfiniteScrollToggle() {
|
|
|
19431
19423
|
if (!context.hasInfiniteScrollHandler) {
|
|
19432
19424
|
return null;
|
|
19433
19425
|
}
|
|
19434
|
-
return /* @__PURE__ */
|
|
19426
|
+
return /* @__PURE__ */ jsx73(
|
|
19435
19427
|
toggle_control_default,
|
|
19436
19428
|
{
|
|
19437
19429
|
label: __44("Enable infinite scroll"),
|
|
@@ -19450,7 +19442,7 @@ function InfiniteScrollToggle() {
|
|
|
19450
19442
|
}
|
|
19451
19443
|
|
|
19452
19444
|
// src/components/dataviews-view-config/index.tsx
|
|
19453
|
-
import { Fragment as
|
|
19445
|
+
import { Fragment as Fragment13, jsx as jsx74, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
19454
19446
|
var { Menu: Menu8 } = unlock3(privateApis);
|
|
19455
19447
|
var DATAVIEWS_CONFIG_POPOVER_PROPS = {
|
|
19456
19448
|
className: "dataviews-config__popover",
|
|
@@ -19464,11 +19456,11 @@ function ViewTypeMenu() {
|
|
|
19464
19456
|
return null;
|
|
19465
19457
|
}
|
|
19466
19458
|
const activeView = VIEW_LAYOUTS.find((v) => view.type === v.type);
|
|
19467
|
-
return /* @__PURE__ */
|
|
19468
|
-
/* @__PURE__ */
|
|
19459
|
+
return /* @__PURE__ */ jsxs24(Menu8, { children: [
|
|
19460
|
+
/* @__PURE__ */ jsx74(
|
|
19469
19461
|
Menu8.TriggerButton,
|
|
19470
19462
|
{
|
|
19471
|
-
render: /* @__PURE__ */
|
|
19463
|
+
render: /* @__PURE__ */ jsx74(
|
|
19472
19464
|
button_default,
|
|
19473
19465
|
{
|
|
19474
19466
|
size: "compact",
|
|
@@ -19478,14 +19470,14 @@ function ViewTypeMenu() {
|
|
|
19478
19470
|
)
|
|
19479
19471
|
}
|
|
19480
19472
|
),
|
|
19481
|
-
/* @__PURE__ */
|
|
19473
|
+
/* @__PURE__ */ jsx74(Menu8.Popover, { children: availableLayouts.map((layout) => {
|
|
19482
19474
|
const config = VIEW_LAYOUTS.find(
|
|
19483
19475
|
(v) => v.type === layout
|
|
19484
19476
|
);
|
|
19485
19477
|
if (!config) {
|
|
19486
19478
|
return null;
|
|
19487
19479
|
}
|
|
19488
|
-
return /* @__PURE__ */
|
|
19480
|
+
return /* @__PURE__ */ jsx74(
|
|
19489
19481
|
Menu8.RadioItem,
|
|
19490
19482
|
{
|
|
19491
19483
|
value: layout,
|
|
@@ -19512,7 +19504,7 @@ function ViewTypeMenu() {
|
|
|
19512
19504
|
}
|
|
19513
19505
|
warning("Invalid dataview");
|
|
19514
19506
|
},
|
|
19515
|
-
children: /* @__PURE__ */
|
|
19507
|
+
children: /* @__PURE__ */ jsx74(Menu8.ItemLabel, { children: config.label })
|
|
19516
19508
|
},
|
|
19517
19509
|
layout
|
|
19518
19510
|
);
|
|
@@ -19532,7 +19524,7 @@ function SortFieldControl() {
|
|
|
19532
19524
|
};
|
|
19533
19525
|
});
|
|
19534
19526
|
}, [fields]);
|
|
19535
|
-
return /* @__PURE__ */
|
|
19527
|
+
return /* @__PURE__ */ jsx74(
|
|
19536
19528
|
select_control_default,
|
|
19537
19529
|
{
|
|
19538
19530
|
__next40pxDefaultSize: true,
|
|
@@ -19564,7 +19556,7 @@ function SortDirectionControl() {
|
|
|
19564
19556
|
if (!value && view.sort?.field) {
|
|
19565
19557
|
value = "desc";
|
|
19566
19558
|
}
|
|
19567
|
-
return /* @__PURE__ */
|
|
19559
|
+
return /* @__PURE__ */ jsx74(
|
|
19568
19560
|
component_default10,
|
|
19569
19561
|
{
|
|
19570
19562
|
className: "dataviews-view-config__sort-direction",
|
|
@@ -19590,7 +19582,7 @@ function SortDirectionControl() {
|
|
|
19590
19582
|
warning("Invalid direction");
|
|
19591
19583
|
},
|
|
19592
19584
|
children: SORTING_DIRECTIONS.map((direction) => {
|
|
19593
|
-
return /* @__PURE__ */
|
|
19585
|
+
return /* @__PURE__ */ jsx74(
|
|
19594
19586
|
component_default13,
|
|
19595
19587
|
{
|
|
19596
19588
|
value: direction,
|
|
@@ -19609,7 +19601,7 @@ function ItemsPerPageControl() {
|
|
|
19609
19601
|
if (!config || !config.perPageSizes || config.perPageSizes.length < 2 || config.perPageSizes.length > 6 || infiniteScrollEnabled) {
|
|
19610
19602
|
return null;
|
|
19611
19603
|
}
|
|
19612
|
-
return /* @__PURE__ */
|
|
19604
|
+
return /* @__PURE__ */ jsx74(
|
|
19613
19605
|
component_default10,
|
|
19614
19606
|
{
|
|
19615
19607
|
__next40pxDefaultSize: true,
|
|
@@ -19626,7 +19618,7 @@ function ItemsPerPageControl() {
|
|
|
19626
19618
|
});
|
|
19627
19619
|
},
|
|
19628
19620
|
children: config.perPageSizes.map((value) => {
|
|
19629
|
-
return /* @__PURE__ */
|
|
19621
|
+
return /* @__PURE__ */ jsx74(
|
|
19630
19622
|
component_default12,
|
|
19631
19623
|
{
|
|
19632
19624
|
value,
|
|
@@ -19644,7 +19636,7 @@ function ResetViewButton() {
|
|
|
19644
19636
|
return null;
|
|
19645
19637
|
}
|
|
19646
19638
|
const isDisabled = onReset === false;
|
|
19647
|
-
return /* @__PURE__ */
|
|
19639
|
+
return /* @__PURE__ */ jsx74(
|
|
19648
19640
|
button_default,
|
|
19649
19641
|
{
|
|
19650
19642
|
variant: "tertiary",
|
|
@@ -19671,7 +19663,7 @@ function DataviewsViewConfigDropdown() {
|
|
|
19671
19663
|
(layout) => layout.type === view.type
|
|
19672
19664
|
);
|
|
19673
19665
|
const isModified = typeof onReset === "function";
|
|
19674
|
-
return /* @__PURE__ */
|
|
19666
|
+
return /* @__PURE__ */ jsx74(
|
|
19675
19667
|
dropdown_default,
|
|
19676
19668
|
{
|
|
19677
19669
|
expandOnMobile: true,
|
|
@@ -19680,8 +19672,8 @@ function DataviewsViewConfigDropdown() {
|
|
|
19680
19672
|
id: popoverId
|
|
19681
19673
|
},
|
|
19682
19674
|
renderToggle: ({ onToggle, isOpen }) => {
|
|
19683
|
-
return /* @__PURE__ */
|
|
19684
|
-
/* @__PURE__ */
|
|
19675
|
+
return /* @__PURE__ */ jsxs24("div", { className: "dataviews-view-config__toggle-wrapper", children: [
|
|
19676
|
+
/* @__PURE__ */ jsx74(
|
|
19685
19677
|
button_default,
|
|
19686
19678
|
{
|
|
19687
19679
|
size: "compact",
|
|
@@ -19695,22 +19687,22 @@ function DataviewsViewConfigDropdown() {
|
|
|
19695
19687
|
"aria-controls": popoverId
|
|
19696
19688
|
}
|
|
19697
19689
|
),
|
|
19698
|
-
isModified && /* @__PURE__ */
|
|
19690
|
+
isModified && /* @__PURE__ */ jsx74("span", { className: "dataviews-view-config__modified-indicator" })
|
|
19699
19691
|
] });
|
|
19700
19692
|
},
|
|
19701
|
-
renderContent: () => /* @__PURE__ */
|
|
19693
|
+
renderContent: () => /* @__PURE__ */ jsx74(
|
|
19702
19694
|
dropdown_content_wrapper_default,
|
|
19703
19695
|
{
|
|
19704
19696
|
paddingSize: "medium",
|
|
19705
19697
|
className: "dataviews-config__popover-content-wrapper",
|
|
19706
|
-
children: /* @__PURE__ */
|
|
19698
|
+
children: /* @__PURE__ */ jsxs24(
|
|
19707
19699
|
Stack,
|
|
19708
19700
|
{
|
|
19709
19701
|
direction: "column",
|
|
19710
19702
|
className: "dataviews-view-config",
|
|
19711
19703
|
gap: "xl",
|
|
19712
19704
|
children: [
|
|
19713
|
-
/* @__PURE__ */
|
|
19705
|
+
/* @__PURE__ */ jsxs24(
|
|
19714
19706
|
Stack,
|
|
19715
19707
|
{
|
|
19716
19708
|
direction: "row",
|
|
@@ -19718,7 +19710,7 @@ function DataviewsViewConfigDropdown() {
|
|
|
19718
19710
|
align: "center",
|
|
19719
19711
|
className: "dataviews-view-config__header",
|
|
19720
19712
|
children: [
|
|
19721
|
-
/* @__PURE__ */
|
|
19713
|
+
/* @__PURE__ */ jsx74(
|
|
19722
19714
|
component_default16,
|
|
19723
19715
|
{
|
|
19724
19716
|
level: 2,
|
|
@@ -19726,27 +19718,27 @@ function DataviewsViewConfigDropdown() {
|
|
|
19726
19718
|
children: __45("Appearance")
|
|
19727
19719
|
}
|
|
19728
19720
|
),
|
|
19729
|
-
/* @__PURE__ */
|
|
19721
|
+
/* @__PURE__ */ jsx74(ResetViewButton, {})
|
|
19730
19722
|
]
|
|
19731
19723
|
}
|
|
19732
19724
|
),
|
|
19733
|
-
/* @__PURE__ */
|
|
19734
|
-
/* @__PURE__ */
|
|
19725
|
+
/* @__PURE__ */ jsxs24(Stack, { direction: "column", gap: "lg", children: [
|
|
19726
|
+
/* @__PURE__ */ jsxs24(
|
|
19735
19727
|
Stack,
|
|
19736
19728
|
{
|
|
19737
19729
|
direction: "row",
|
|
19738
19730
|
gap: "sm",
|
|
19739
19731
|
className: "dataviews-view-config__sort-controls",
|
|
19740
19732
|
children: [
|
|
19741
|
-
/* @__PURE__ */
|
|
19742
|
-
/* @__PURE__ */
|
|
19733
|
+
/* @__PURE__ */ jsx74(SortFieldControl, {}),
|
|
19734
|
+
/* @__PURE__ */ jsx74(SortDirectionControl, {})
|
|
19743
19735
|
]
|
|
19744
19736
|
}
|
|
19745
19737
|
),
|
|
19746
|
-
!!activeLayout?.viewConfigOptions && /* @__PURE__ */
|
|
19747
|
-
/* @__PURE__ */
|
|
19748
|
-
/* @__PURE__ */
|
|
19749
|
-
/* @__PURE__ */
|
|
19738
|
+
!!activeLayout?.viewConfigOptions && /* @__PURE__ */ jsx74(activeLayout.viewConfigOptions, {}),
|
|
19739
|
+
/* @__PURE__ */ jsx74(InfiniteScrollToggle, {}),
|
|
19740
|
+
/* @__PURE__ */ jsx74(ItemsPerPageControl, {}),
|
|
19741
|
+
/* @__PURE__ */ jsx74(PropertiesSection, {})
|
|
19750
19742
|
] })
|
|
19751
19743
|
]
|
|
19752
19744
|
}
|
|
@@ -19757,9 +19749,9 @@ function DataviewsViewConfigDropdown() {
|
|
|
19757
19749
|
);
|
|
19758
19750
|
}
|
|
19759
19751
|
function _DataViewsViewConfig() {
|
|
19760
|
-
return /* @__PURE__ */
|
|
19761
|
-
/* @__PURE__ */
|
|
19762
|
-
/* @__PURE__ */
|
|
19752
|
+
return /* @__PURE__ */ jsxs24(Fragment13, { children: [
|
|
19753
|
+
/* @__PURE__ */ jsx74(ViewTypeMenu, {}),
|
|
19754
|
+
/* @__PURE__ */ jsx74(DataviewsViewConfigDropdown, {})
|
|
19763
19755
|
] });
|
|
19764
19756
|
}
|
|
19765
19757
|
var DataViewsViewConfig = memo(_DataViewsViewConfig);
|
|
@@ -19789,7 +19781,7 @@ function getCustomValidity(isValid, validity) {
|
|
|
19789
19781
|
}
|
|
19790
19782
|
|
|
19791
19783
|
// src/components/dataform-controls/checkbox.tsx
|
|
19792
|
-
import { jsx as
|
|
19784
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
19793
19785
|
var { ValidatedCheckboxControl: ValidatedCheckboxControl2 } = unlock3(privateApis);
|
|
19794
19786
|
function Checkbox({
|
|
19795
19787
|
field,
|
|
@@ -19805,7 +19797,7 @@ function Checkbox({
|
|
|
19805
19797
|
setValue({ item: data, value: !getValue({ item: data }) })
|
|
19806
19798
|
);
|
|
19807
19799
|
}, [data, getValue, onChange, setValue]);
|
|
19808
|
-
return /* @__PURE__ */
|
|
19800
|
+
return /* @__PURE__ */ jsx75(
|
|
19809
19801
|
ValidatedCheckboxControl2,
|
|
19810
19802
|
{
|
|
19811
19803
|
required: !!field.isValid?.required,
|
|
@@ -19821,7 +19813,7 @@ function Checkbox({
|
|
|
19821
19813
|
}
|
|
19822
19814
|
|
|
19823
19815
|
// src/components/dataform-controls/combobox.tsx
|
|
19824
|
-
import { jsx as
|
|
19816
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
19825
19817
|
var { ValidatedComboboxControl: ValidatedComboboxControl2 } = unlock3(privateApis);
|
|
19826
19818
|
function Combobox2({
|
|
19827
19819
|
data,
|
|
@@ -19841,9 +19833,9 @@ function Combobox2({
|
|
|
19841
19833
|
getElements: field.getElements
|
|
19842
19834
|
});
|
|
19843
19835
|
if (isLoading) {
|
|
19844
|
-
return /* @__PURE__ */
|
|
19836
|
+
return /* @__PURE__ */ jsx76(spinner_default, {});
|
|
19845
19837
|
}
|
|
19846
|
-
return /* @__PURE__ */
|
|
19838
|
+
return /* @__PURE__ */ jsx76(
|
|
19847
19839
|
ValidatedComboboxControl2,
|
|
19848
19840
|
{
|
|
19849
19841
|
required: !!field.isValid?.required,
|
|
@@ -19862,14 +19854,13 @@ function Combobox2({
|
|
|
19862
19854
|
}
|
|
19863
19855
|
|
|
19864
19856
|
// src/components/dataform-controls/datetime.tsx
|
|
19865
|
-
import { format } from "date-fns";
|
|
19866
19857
|
import { __ as __47 } from "@wordpress/i18n";
|
|
19867
|
-
import { getSettings } from "@wordpress/date";
|
|
19858
|
+
import { dateI18n, getDate as getDate3, getSettings } from "@wordpress/date";
|
|
19868
19859
|
|
|
19869
19860
|
// src/components/dataform-controls/utils/relative-date-control.tsx
|
|
19870
|
-
import
|
|
19861
|
+
import clsx44 from "clsx";
|
|
19871
19862
|
import { __ as __46 } from "@wordpress/i18n";
|
|
19872
|
-
import { jsx as
|
|
19863
|
+
import { jsx as jsx77, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
19873
19864
|
var TIME_UNITS_OPTIONS = {
|
|
19874
19865
|
[OPERATOR_IN_THE_PAST]: [
|
|
19875
19866
|
{ value: "days", label: __46("Days") },
|
|
@@ -19893,7 +19884,7 @@ function RelativeDateControl({
|
|
|
19893
19884
|
operator
|
|
19894
19885
|
}) {
|
|
19895
19886
|
const options2 = TIME_UNITS_OPTIONS[operator === OPERATOR_IN_THE_PAST ? "inThePast" : "over"];
|
|
19896
|
-
const { id, label, getValue, setValue } = field;
|
|
19887
|
+
const { id, label, description, getValue, setValue } = field;
|
|
19897
19888
|
const fieldValue = getValue({ item: data });
|
|
19898
19889
|
const { value: relValue = "", unit = options2[0].value } = fieldValue && typeof fieldValue === "object" ? fieldValue : {};
|
|
19899
19890
|
const onChangeValue = useCallback(
|
|
@@ -19914,15 +19905,16 @@ function RelativeDateControl({
|
|
|
19914
19905
|
),
|
|
19915
19906
|
[onChange, setValue, data, relValue]
|
|
19916
19907
|
);
|
|
19917
|
-
return /* @__PURE__ */
|
|
19908
|
+
return /* @__PURE__ */ jsx77(
|
|
19918
19909
|
base_control_default,
|
|
19919
19910
|
{
|
|
19920
19911
|
id,
|
|
19921
|
-
className:
|
|
19912
|
+
className: clsx44(className2, "dataviews-controls__relative-date"),
|
|
19922
19913
|
label,
|
|
19923
19914
|
hideLabelFromVision,
|
|
19924
|
-
|
|
19925
|
-
|
|
19915
|
+
help: description,
|
|
19916
|
+
children: /* @__PURE__ */ jsxs25(Stack, { direction: "row", gap: "sm", children: [
|
|
19917
|
+
/* @__PURE__ */ jsx77(
|
|
19926
19918
|
number_control_default,
|
|
19927
19919
|
{
|
|
19928
19920
|
__next40pxDefaultSize: true,
|
|
@@ -19934,7 +19926,7 @@ function RelativeDateControl({
|
|
|
19934
19926
|
onChange: onChangeValue
|
|
19935
19927
|
}
|
|
19936
19928
|
),
|
|
19937
|
-
/* @__PURE__ */
|
|
19929
|
+
/* @__PURE__ */ jsx77(
|
|
19938
19930
|
select_control_default,
|
|
19939
19931
|
{
|
|
19940
19932
|
className: "dataviews-controls__relative-date-unit",
|
|
@@ -19963,16 +19955,13 @@ function parseDateTime(dateTimeString) {
|
|
|
19963
19955
|
}
|
|
19964
19956
|
|
|
19965
19957
|
// src/components/dataform-controls/datetime.tsx
|
|
19966
|
-
import { jsx as
|
|
19958
|
+
import { jsx as jsx78, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
19967
19959
|
var { DateCalendar: DateCalendar2, ValidatedInputControl: ValidatedInputControl2 } = unlock3(privateApis);
|
|
19968
|
-
var formatDateTime = (
|
|
19969
|
-
if (!
|
|
19960
|
+
var formatDateTime = (value) => {
|
|
19961
|
+
if (!value) {
|
|
19970
19962
|
return "";
|
|
19971
19963
|
}
|
|
19972
|
-
|
|
19973
|
-
return date;
|
|
19974
|
-
}
|
|
19975
|
-
return format(date, "yyyy-MM-dd'T'HH:mm");
|
|
19964
|
+
return dateI18n("Y-m-d\\TH:i", getDate3(value));
|
|
19976
19965
|
};
|
|
19977
19966
|
function CalendarDateTimeControl({
|
|
19978
19967
|
data,
|
|
@@ -20007,17 +19996,14 @@ function CalendarDateTimeControl({
|
|
|
20007
19996
|
(newDate) => {
|
|
20008
19997
|
let dateTimeValue;
|
|
20009
19998
|
if (newDate) {
|
|
20010
|
-
|
|
19999
|
+
const wpDate = dateI18n("Y-m-d", newDate);
|
|
20000
|
+
let wpTime;
|
|
20011
20001
|
if (value) {
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
finalDateTime.setHours(currentDateTime.getHours());
|
|
20016
|
-
finalDateTime.setMinutes(
|
|
20017
|
-
currentDateTime.getMinutes()
|
|
20018
|
-
);
|
|
20019
|
-
}
|
|
20002
|
+
wpTime = dateI18n("H:i", getDate3(value));
|
|
20003
|
+
} else {
|
|
20004
|
+
wpTime = dateI18n("H:i", newDate);
|
|
20020
20005
|
}
|
|
20006
|
+
const finalDateTime = getDate3(`${wpDate}T${wpTime}`);
|
|
20021
20007
|
dateTimeValue = finalDateTime.toISOString();
|
|
20022
20008
|
onChangeCallback(dateTimeValue);
|
|
20023
20009
|
if (validationTimeoutRef.current) {
|
|
@@ -20043,7 +20029,7 @@ function CalendarDateTimeControl({
|
|
|
20043
20029
|
const handleManualDateTimeChange = useCallback(
|
|
20044
20030
|
(newValue) => {
|
|
20045
20031
|
if (newValue) {
|
|
20046
|
-
const dateTime =
|
|
20032
|
+
const dateTime = getDate3(newValue);
|
|
20047
20033
|
onChangeCallback(dateTime.toISOString());
|
|
20048
20034
|
const parsedDate = parseDateTime(dateTime.toISOString());
|
|
20049
20035
|
if (parsedDate) {
|
|
@@ -20066,27 +20052,15 @@ function CalendarDateTimeControl({
|
|
|
20066
20052
|
} else if (!isValid?.required && markWhenOptional && !hideLabelFromVision) {
|
|
20067
20053
|
displayLabel = `${label} (${__47("Optional")})`;
|
|
20068
20054
|
}
|
|
20069
|
-
return /* @__PURE__ */
|
|
20055
|
+
return /* @__PURE__ */ jsx78(
|
|
20070
20056
|
base_control_default,
|
|
20071
20057
|
{
|
|
20072
20058
|
id,
|
|
20073
20059
|
label: displayLabel,
|
|
20074
20060
|
help: description,
|
|
20075
20061
|
hideLabelFromVision,
|
|
20076
|
-
children: /* @__PURE__ */
|
|
20077
|
-
/* @__PURE__ */
|
|
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
|
-
/* @__PURE__ */ jsx77(
|
|
20062
|
+
children: /* @__PURE__ */ jsxs26(Stack, { direction: "column", gap: "lg", children: [
|
|
20063
|
+
/* @__PURE__ */ jsx78(
|
|
20090
20064
|
ValidatedInputControl2,
|
|
20091
20065
|
{
|
|
20092
20066
|
ref: inputControlRef,
|
|
@@ -20096,11 +20070,21 @@ function CalendarDateTimeControl({
|
|
|
20096
20070
|
type: "datetime-local",
|
|
20097
20071
|
label: __47("Date time"),
|
|
20098
20072
|
hideLabelFromVision: true,
|
|
20099
|
-
value:
|
|
20100
|
-
parseDateTime(value) || void 0
|
|
20101
|
-
) : "",
|
|
20073
|
+
value: formatDateTime(value),
|
|
20102
20074
|
onChange: handleManualDateTimeChange
|
|
20103
20075
|
}
|
|
20076
|
+
),
|
|
20077
|
+
/* @__PURE__ */ jsx78(
|
|
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
|
+
}
|
|
20104
20088
|
)
|
|
20105
20089
|
] })
|
|
20106
20090
|
}
|
|
@@ -20116,7 +20100,7 @@ function DateTime({
|
|
|
20116
20100
|
validity
|
|
20117
20101
|
}) {
|
|
20118
20102
|
if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
|
|
20119
|
-
return /* @__PURE__ */
|
|
20103
|
+
return /* @__PURE__ */ jsx78(
|
|
20120
20104
|
RelativeDateControl,
|
|
20121
20105
|
{
|
|
20122
20106
|
className: "dataviews-controls__datetime",
|
|
@@ -20128,7 +20112,7 @@ function DateTime({
|
|
|
20128
20112
|
}
|
|
20129
20113
|
);
|
|
20130
20114
|
}
|
|
20131
|
-
return /* @__PURE__ */
|
|
20115
|
+
return /* @__PURE__ */ jsx78(
|
|
20132
20116
|
CalendarDateTimeControl,
|
|
20133
20117
|
{
|
|
20134
20118
|
data,
|
|
@@ -20142,9 +20126,9 @@ function DateTime({
|
|
|
20142
20126
|
}
|
|
20143
20127
|
|
|
20144
20128
|
// src/components/dataform-controls/date.tsx
|
|
20145
|
-
import
|
|
20129
|
+
import clsx45 from "clsx";
|
|
20146
20130
|
import {
|
|
20147
|
-
format
|
|
20131
|
+
format,
|
|
20148
20132
|
isValid as isValidDate2,
|
|
20149
20133
|
subMonths as subMonths2,
|
|
20150
20134
|
subDays as subDays2,
|
|
@@ -20153,20 +20137,20 @@ import {
|
|
|
20153
20137
|
startOfYear
|
|
20154
20138
|
} from "date-fns";
|
|
20155
20139
|
import { __ as __48 } from "@wordpress/i18n";
|
|
20156
|
-
import { getDate as
|
|
20157
|
-
import { jsx as
|
|
20140
|
+
import { getDate as getDate4, getSettings as getSettings2 } from "@wordpress/date";
|
|
20141
|
+
import { jsx as jsx79, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
20158
20142
|
var { DateCalendar: DateCalendar3, DateRangeCalendar: DateRangeCalendar2 } = unlock3(privateApis);
|
|
20159
20143
|
var DATE_PRESETS = [
|
|
20160
20144
|
{
|
|
20161
20145
|
id: "today",
|
|
20162
20146
|
label: __48("Today"),
|
|
20163
|
-
getValue: () =>
|
|
20147
|
+
getValue: () => getDate4(null)
|
|
20164
20148
|
},
|
|
20165
20149
|
{
|
|
20166
20150
|
id: "yesterday",
|
|
20167
20151
|
label: __48("Yesterday"),
|
|
20168
20152
|
getValue: () => {
|
|
20169
|
-
const today =
|
|
20153
|
+
const today = getDate4(null);
|
|
20170
20154
|
return subDays2(today, 1);
|
|
20171
20155
|
}
|
|
20172
20156
|
},
|
|
@@ -20174,7 +20158,7 @@ var DATE_PRESETS = [
|
|
|
20174
20158
|
id: "past-week",
|
|
20175
20159
|
label: __48("Past week"),
|
|
20176
20160
|
getValue: () => {
|
|
20177
|
-
const today =
|
|
20161
|
+
const today = getDate4(null);
|
|
20178
20162
|
return subDays2(today, 7);
|
|
20179
20163
|
}
|
|
20180
20164
|
},
|
|
@@ -20182,7 +20166,7 @@ var DATE_PRESETS = [
|
|
|
20182
20166
|
id: "past-month",
|
|
20183
20167
|
label: __48("Past month"),
|
|
20184
20168
|
getValue: () => {
|
|
20185
|
-
const today =
|
|
20169
|
+
const today = getDate4(null);
|
|
20186
20170
|
return subMonths2(today, 1);
|
|
20187
20171
|
}
|
|
20188
20172
|
}
|
|
@@ -20192,7 +20176,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20192
20176
|
id: "last-7-days",
|
|
20193
20177
|
label: __48("Last 7 days"),
|
|
20194
20178
|
getValue: () => {
|
|
20195
|
-
const today =
|
|
20179
|
+
const today = getDate4(null);
|
|
20196
20180
|
return [subDays2(today, 7), today];
|
|
20197
20181
|
}
|
|
20198
20182
|
},
|
|
@@ -20200,7 +20184,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20200
20184
|
id: "last-30-days",
|
|
20201
20185
|
label: __48("Last 30 days"),
|
|
20202
20186
|
getValue: () => {
|
|
20203
|
-
const today =
|
|
20187
|
+
const today = getDate4(null);
|
|
20204
20188
|
return [subDays2(today, 30), today];
|
|
20205
20189
|
}
|
|
20206
20190
|
},
|
|
@@ -20208,7 +20192,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20208
20192
|
id: "month-to-date",
|
|
20209
20193
|
label: __48("Month to date"),
|
|
20210
20194
|
getValue: () => {
|
|
20211
|
-
const today =
|
|
20195
|
+
const today = getDate4(null);
|
|
20212
20196
|
return [startOfMonth(today), today];
|
|
20213
20197
|
}
|
|
20214
20198
|
},
|
|
@@ -20216,7 +20200,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20216
20200
|
id: "last-year",
|
|
20217
20201
|
label: __48("Last year"),
|
|
20218
20202
|
getValue: () => {
|
|
20219
|
-
const today =
|
|
20203
|
+
const today = getDate4(null);
|
|
20220
20204
|
return [subYears2(today, 1), today];
|
|
20221
20205
|
}
|
|
20222
20206
|
},
|
|
@@ -20224,7 +20208,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
20224
20208
|
id: "year-to-date",
|
|
20225
20209
|
label: __48("Year to date"),
|
|
20226
20210
|
getValue: () => {
|
|
20227
|
-
const today =
|
|
20211
|
+
const today = getDate4(null);
|
|
20228
20212
|
return [startOfYear(today), today];
|
|
20229
20213
|
}
|
|
20230
20214
|
}
|
|
@@ -20233,14 +20217,14 @@ var parseDate = (dateString) => {
|
|
|
20233
20217
|
if (!dateString) {
|
|
20234
20218
|
return null;
|
|
20235
20219
|
}
|
|
20236
|
-
const parsed =
|
|
20220
|
+
const parsed = getDate4(dateString);
|
|
20237
20221
|
return parsed && isValidDate2(parsed) ? parsed : null;
|
|
20238
20222
|
};
|
|
20239
20223
|
var formatDate = (date) => {
|
|
20240
20224
|
if (!date) {
|
|
20241
20225
|
return "";
|
|
20242
20226
|
}
|
|
20243
|
-
return typeof date === "string" ? date :
|
|
20227
|
+
return typeof date === "string" ? date : format(date, "yyyy-MM-dd");
|
|
20244
20228
|
};
|
|
20245
20229
|
function ValidatedDateControl({
|
|
20246
20230
|
field,
|
|
@@ -20312,17 +20296,17 @@ function ValidatedDateControl({
|
|
|
20312
20296
|
setIsTouched(true);
|
|
20313
20297
|
}
|
|
20314
20298
|
};
|
|
20315
|
-
return /* @__PURE__ */
|
|
20299
|
+
return /* @__PURE__ */ jsxs27("div", { onBlur, children: [
|
|
20316
20300
|
children,
|
|
20317
|
-
/* @__PURE__ */
|
|
20301
|
+
/* @__PURE__ */ jsx79("div", { "aria-live": "polite", children: customValidity && /* @__PURE__ */ jsxs27(
|
|
20318
20302
|
"p",
|
|
20319
20303
|
{
|
|
20320
|
-
className:
|
|
20304
|
+
className: clsx45(
|
|
20321
20305
|
"components-validated-control__indicator",
|
|
20322
20306
|
customValidity.type === "invalid" ? "is-invalid" : void 0
|
|
20323
20307
|
),
|
|
20324
20308
|
children: [
|
|
20325
|
-
/* @__PURE__ */
|
|
20309
|
+
/* @__PURE__ */ jsx79(
|
|
20326
20310
|
icon_default2,
|
|
20327
20311
|
{
|
|
20328
20312
|
className: "components-validated-control__indicator-icon",
|
|
@@ -20348,6 +20332,7 @@ function CalendarDateControl({
|
|
|
20348
20332
|
const {
|
|
20349
20333
|
id,
|
|
20350
20334
|
label,
|
|
20335
|
+
description,
|
|
20351
20336
|
setValue,
|
|
20352
20337
|
getValue,
|
|
20353
20338
|
isValid,
|
|
@@ -20371,7 +20356,7 @@ function CalendarDateControl({
|
|
|
20371
20356
|
);
|
|
20372
20357
|
const onSelectDate = useCallback(
|
|
20373
20358
|
(newDate) => {
|
|
20374
|
-
const dateValue = newDate ?
|
|
20359
|
+
const dateValue = newDate ? format(newDate, "yyyy-MM-dd") : void 0;
|
|
20375
20360
|
onChangeCallback(dateValue);
|
|
20376
20361
|
setSelectedPresetId(null);
|
|
20377
20362
|
setIsTouched(true);
|
|
@@ -20412,7 +20397,7 @@ function CalendarDateControl({
|
|
|
20412
20397
|
} else if (!isValid?.required && markWhenOptional) {
|
|
20413
20398
|
displayLabel = `${label} (${__48("Optional")})`;
|
|
20414
20399
|
}
|
|
20415
|
-
return /* @__PURE__ */
|
|
20400
|
+
return /* @__PURE__ */ jsx79(
|
|
20416
20401
|
ValidatedDateControl,
|
|
20417
20402
|
{
|
|
20418
20403
|
field,
|
|
@@ -20420,15 +20405,16 @@ function CalendarDateControl({
|
|
|
20420
20405
|
inputRefs: validityTargetRef,
|
|
20421
20406
|
isTouched,
|
|
20422
20407
|
setIsTouched,
|
|
20423
|
-
children: /* @__PURE__ */
|
|
20408
|
+
children: /* @__PURE__ */ jsx79(
|
|
20424
20409
|
base_control_default,
|
|
20425
20410
|
{
|
|
20426
20411
|
id,
|
|
20427
20412
|
className: "dataviews-controls__date",
|
|
20428
20413
|
label: displayLabel,
|
|
20414
|
+
help: description,
|
|
20429
20415
|
hideLabelFromVision,
|
|
20430
|
-
children: /* @__PURE__ */
|
|
20431
|
-
/* @__PURE__ */
|
|
20416
|
+
children: /* @__PURE__ */ jsxs27(Stack, { direction: "column", gap: "lg", children: [
|
|
20417
|
+
/* @__PURE__ */ jsxs27(
|
|
20432
20418
|
Stack,
|
|
20433
20419
|
{
|
|
20434
20420
|
direction: "row",
|
|
@@ -20438,7 +20424,7 @@ function CalendarDateControl({
|
|
|
20438
20424
|
children: [
|
|
20439
20425
|
DATE_PRESETS.map((preset) => {
|
|
20440
20426
|
const isSelected = selectedPresetId === preset.id;
|
|
20441
|
-
return /* @__PURE__ */
|
|
20427
|
+
return /* @__PURE__ */ jsx79(
|
|
20442
20428
|
button_default,
|
|
20443
20429
|
{
|
|
20444
20430
|
className: "dataviews-controls__date-preset",
|
|
@@ -20451,7 +20437,7 @@ function CalendarDateControl({
|
|
|
20451
20437
|
preset.id
|
|
20452
20438
|
);
|
|
20453
20439
|
}),
|
|
20454
|
-
/* @__PURE__ */
|
|
20440
|
+
/* @__PURE__ */ jsx79(
|
|
20455
20441
|
button_default,
|
|
20456
20442
|
{
|
|
20457
20443
|
className: "dataviews-controls__date-preset",
|
|
@@ -20466,7 +20452,7 @@ function CalendarDateControl({
|
|
|
20466
20452
|
]
|
|
20467
20453
|
}
|
|
20468
20454
|
),
|
|
20469
|
-
/* @__PURE__ */
|
|
20455
|
+
/* @__PURE__ */ jsx79(
|
|
20470
20456
|
input_control_default,
|
|
20471
20457
|
{
|
|
20472
20458
|
__next40pxDefaultSize: true,
|
|
@@ -20479,7 +20465,7 @@ function CalendarDateControl({
|
|
|
20479
20465
|
required: !!field.isValid?.required
|
|
20480
20466
|
}
|
|
20481
20467
|
),
|
|
20482
|
-
/* @__PURE__ */
|
|
20468
|
+
/* @__PURE__ */ jsx79(
|
|
20483
20469
|
DateCalendar3,
|
|
20484
20470
|
{
|
|
20485
20471
|
style: { width: "100%" },
|
|
@@ -20505,7 +20491,14 @@ function CalendarDateRangeControl({
|
|
|
20505
20491
|
markWhenOptional,
|
|
20506
20492
|
validity
|
|
20507
20493
|
}) {
|
|
20508
|
-
const {
|
|
20494
|
+
const {
|
|
20495
|
+
id,
|
|
20496
|
+
label,
|
|
20497
|
+
description,
|
|
20498
|
+
getValue,
|
|
20499
|
+
setValue,
|
|
20500
|
+
format: fieldFormat
|
|
20501
|
+
} = field;
|
|
20509
20502
|
let value;
|
|
20510
20503
|
const fieldValue = getValue({ item: data });
|
|
20511
20504
|
if (Array.isArray(fieldValue) && fieldValue.length === 2 && fieldValue.every((date) => typeof date === "string")) {
|
|
@@ -20600,7 +20593,7 @@ function CalendarDateRangeControl({
|
|
|
20600
20593
|
} else if (!field.isValid?.required && markWhenOptional) {
|
|
20601
20594
|
displayLabel = `${label} (${__48("Optional")})`;
|
|
20602
20595
|
}
|
|
20603
|
-
return /* @__PURE__ */
|
|
20596
|
+
return /* @__PURE__ */ jsx79(
|
|
20604
20597
|
ValidatedDateControl,
|
|
20605
20598
|
{
|
|
20606
20599
|
field,
|
|
@@ -20608,15 +20601,16 @@ function CalendarDateRangeControl({
|
|
|
20608
20601
|
inputRefs: [fromInputRef, toInputRef],
|
|
20609
20602
|
isTouched,
|
|
20610
20603
|
setIsTouched,
|
|
20611
|
-
children: /* @__PURE__ */
|
|
20604
|
+
children: /* @__PURE__ */ jsx79(
|
|
20612
20605
|
base_control_default,
|
|
20613
20606
|
{
|
|
20614
20607
|
id,
|
|
20615
20608
|
className: "dataviews-controls__date",
|
|
20616
20609
|
label: displayLabel,
|
|
20610
|
+
help: description,
|
|
20617
20611
|
hideLabelFromVision,
|
|
20618
|
-
children: /* @__PURE__ */
|
|
20619
|
-
/* @__PURE__ */
|
|
20612
|
+
children: /* @__PURE__ */ jsxs27(Stack, { direction: "column", gap: "lg", children: [
|
|
20613
|
+
/* @__PURE__ */ jsxs27(
|
|
20620
20614
|
Stack,
|
|
20621
20615
|
{
|
|
20622
20616
|
direction: "row",
|
|
@@ -20626,7 +20620,7 @@ function CalendarDateRangeControl({
|
|
|
20626
20620
|
children: [
|
|
20627
20621
|
DATE_RANGE_PRESETS.map((preset) => {
|
|
20628
20622
|
const isSelected = selectedPresetId === preset.id;
|
|
20629
|
-
return /* @__PURE__ */
|
|
20623
|
+
return /* @__PURE__ */ jsx79(
|
|
20630
20624
|
button_default,
|
|
20631
20625
|
{
|
|
20632
20626
|
className: "dataviews-controls__date-preset",
|
|
@@ -20639,7 +20633,7 @@ function CalendarDateRangeControl({
|
|
|
20639
20633
|
preset.id
|
|
20640
20634
|
);
|
|
20641
20635
|
}),
|
|
20642
|
-
/* @__PURE__ */
|
|
20636
|
+
/* @__PURE__ */ jsx79(
|
|
20643
20637
|
button_default,
|
|
20644
20638
|
{
|
|
20645
20639
|
className: "dataviews-controls__date-preset",
|
|
@@ -20654,7 +20648,7 @@ function CalendarDateRangeControl({
|
|
|
20654
20648
|
]
|
|
20655
20649
|
}
|
|
20656
20650
|
),
|
|
20657
|
-
/* @__PURE__ */
|
|
20651
|
+
/* @__PURE__ */ jsxs27(
|
|
20658
20652
|
Stack,
|
|
20659
20653
|
{
|
|
20660
20654
|
direction: "row",
|
|
@@ -20662,7 +20656,7 @@ function CalendarDateRangeControl({
|
|
|
20662
20656
|
justify: "space-between",
|
|
20663
20657
|
className: "dataviews-controls__date-range-inputs",
|
|
20664
20658
|
children: [
|
|
20665
|
-
/* @__PURE__ */
|
|
20659
|
+
/* @__PURE__ */ jsx79(
|
|
20666
20660
|
input_control_default,
|
|
20667
20661
|
{
|
|
20668
20662
|
__next40pxDefaultSize: true,
|
|
@@ -20675,7 +20669,7 @@ function CalendarDateRangeControl({
|
|
|
20675
20669
|
required: !!field.isValid?.required
|
|
20676
20670
|
}
|
|
20677
20671
|
),
|
|
20678
|
-
/* @__PURE__ */
|
|
20672
|
+
/* @__PURE__ */ jsx79(
|
|
20679
20673
|
input_control_default,
|
|
20680
20674
|
{
|
|
20681
20675
|
__next40pxDefaultSize: true,
|
|
@@ -20691,7 +20685,7 @@ function CalendarDateRangeControl({
|
|
|
20691
20685
|
]
|
|
20692
20686
|
}
|
|
20693
20687
|
),
|
|
20694
|
-
/* @__PURE__ */
|
|
20688
|
+
/* @__PURE__ */ jsx79(
|
|
20695
20689
|
DateRangeCalendar2,
|
|
20696
20690
|
{
|
|
20697
20691
|
style: { width: "100%" },
|
|
@@ -20719,7 +20713,7 @@ function DateControl({
|
|
|
20719
20713
|
validity
|
|
20720
20714
|
}) {
|
|
20721
20715
|
if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
|
|
20722
|
-
return /* @__PURE__ */
|
|
20716
|
+
return /* @__PURE__ */ jsx79(
|
|
20723
20717
|
RelativeDateControl,
|
|
20724
20718
|
{
|
|
20725
20719
|
className: "dataviews-controls__date",
|
|
@@ -20732,7 +20726,7 @@ function DateControl({
|
|
|
20732
20726
|
);
|
|
20733
20727
|
}
|
|
20734
20728
|
if (operator === OPERATOR_BETWEEN) {
|
|
20735
|
-
return /* @__PURE__ */
|
|
20729
|
+
return /* @__PURE__ */ jsx79(
|
|
20736
20730
|
CalendarDateRangeControl,
|
|
20737
20731
|
{
|
|
20738
20732
|
data,
|
|
@@ -20744,7 +20738,7 @@ function DateControl({
|
|
|
20744
20738
|
}
|
|
20745
20739
|
);
|
|
20746
20740
|
}
|
|
20747
|
-
return /* @__PURE__ */
|
|
20741
|
+
return /* @__PURE__ */ jsx79(
|
|
20748
20742
|
CalendarDateControl,
|
|
20749
20743
|
{
|
|
20750
20744
|
data,
|
|
@@ -20758,7 +20752,7 @@ function DateControl({
|
|
|
20758
20752
|
}
|
|
20759
20753
|
|
|
20760
20754
|
// src/components/dataform-controls/select.tsx
|
|
20761
|
-
import { jsx as
|
|
20755
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
20762
20756
|
var { ValidatedSelectControl: ValidatedSelectControl2 } = unlock3(privateApis);
|
|
20763
20757
|
function Select2({
|
|
20764
20758
|
data,
|
|
@@ -20780,9 +20774,9 @@ function Select2({
|
|
|
20780
20774
|
getElements: field.getElements
|
|
20781
20775
|
});
|
|
20782
20776
|
if (isLoading) {
|
|
20783
|
-
return /* @__PURE__ */
|
|
20777
|
+
return /* @__PURE__ */ jsx80(spinner_default, {});
|
|
20784
20778
|
}
|
|
20785
|
-
return /* @__PURE__ */
|
|
20779
|
+
return /* @__PURE__ */ jsx80(
|
|
20786
20780
|
ValidatedSelectControl2,
|
|
20787
20781
|
{
|
|
20788
20782
|
required: !!field.isValid?.required,
|
|
@@ -20801,7 +20795,7 @@ function Select2({
|
|
|
20801
20795
|
}
|
|
20802
20796
|
|
|
20803
20797
|
// src/components/dataform-controls/adaptive-select.tsx
|
|
20804
|
-
import { jsx as
|
|
20798
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
20805
20799
|
var ELEMENTS_THRESHOLD = 10;
|
|
20806
20800
|
function AdaptiveSelect(props) {
|
|
20807
20801
|
const { field } = props;
|
|
@@ -20810,13 +20804,13 @@ function AdaptiveSelect(props) {
|
|
|
20810
20804
|
getElements: field.getElements
|
|
20811
20805
|
});
|
|
20812
20806
|
if (elements.length >= ELEMENTS_THRESHOLD) {
|
|
20813
|
-
return /* @__PURE__ */
|
|
20807
|
+
return /* @__PURE__ */ jsx81(Combobox2, { ...props });
|
|
20814
20808
|
}
|
|
20815
|
-
return /* @__PURE__ */
|
|
20809
|
+
return /* @__PURE__ */ jsx81(Select2, { ...props });
|
|
20816
20810
|
}
|
|
20817
20811
|
|
|
20818
20812
|
// src/components/dataform-controls/utils/validated-input.tsx
|
|
20819
|
-
import { jsx as
|
|
20813
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
20820
20814
|
var { ValidatedInputControl: ValidatedInputControl3 } = unlock3(privateApis);
|
|
20821
20815
|
function ValidatedText({
|
|
20822
20816
|
data,
|
|
@@ -20840,7 +20834,7 @@ function ValidatedText({
|
|
|
20840
20834
|
),
|
|
20841
20835
|
[data, setValue, onChange]
|
|
20842
20836
|
);
|
|
20843
|
-
return /* @__PURE__ */
|
|
20837
|
+
return /* @__PURE__ */ jsx82(
|
|
20844
20838
|
ValidatedInputControl3,
|
|
20845
20839
|
{
|
|
20846
20840
|
required: !!isValid.required,
|
|
@@ -20864,7 +20858,7 @@ function ValidatedText({
|
|
|
20864
20858
|
}
|
|
20865
20859
|
|
|
20866
20860
|
// src/components/dataform-controls/email.tsx
|
|
20867
|
-
import { jsx as
|
|
20861
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
20868
20862
|
function Email({
|
|
20869
20863
|
data,
|
|
20870
20864
|
field,
|
|
@@ -20873,7 +20867,7 @@ function Email({
|
|
|
20873
20867
|
markWhenOptional,
|
|
20874
20868
|
validity
|
|
20875
20869
|
}) {
|
|
20876
|
-
return /* @__PURE__ */
|
|
20870
|
+
return /* @__PURE__ */ jsx83(
|
|
20877
20871
|
ValidatedText,
|
|
20878
20872
|
{
|
|
20879
20873
|
...{
|
|
@@ -20884,14 +20878,14 @@ function Email({
|
|
|
20884
20878
|
markWhenOptional,
|
|
20885
20879
|
validity,
|
|
20886
20880
|
type: "email",
|
|
20887
|
-
prefix: /* @__PURE__ */
|
|
20881
|
+
prefix: /* @__PURE__ */ jsx83(input_prefix_wrapper_default, { variant: "icon", children: /* @__PURE__ */ jsx83(icon_default2, { icon: envelope_default }) })
|
|
20888
20882
|
}
|
|
20889
20883
|
}
|
|
20890
20884
|
);
|
|
20891
20885
|
}
|
|
20892
20886
|
|
|
20893
20887
|
// src/components/dataform-controls/telephone.tsx
|
|
20894
|
-
import { jsx as
|
|
20888
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
20895
20889
|
function Telephone({
|
|
20896
20890
|
data,
|
|
20897
20891
|
field,
|
|
@@ -20900,7 +20894,7 @@ function Telephone({
|
|
|
20900
20894
|
markWhenOptional,
|
|
20901
20895
|
validity
|
|
20902
20896
|
}) {
|
|
20903
|
-
return /* @__PURE__ */
|
|
20897
|
+
return /* @__PURE__ */ jsx84(
|
|
20904
20898
|
ValidatedText,
|
|
20905
20899
|
{
|
|
20906
20900
|
...{
|
|
@@ -20911,14 +20905,14 @@ function Telephone({
|
|
|
20911
20905
|
markWhenOptional,
|
|
20912
20906
|
validity,
|
|
20913
20907
|
type: "tel",
|
|
20914
|
-
prefix: /* @__PURE__ */
|
|
20908
|
+
prefix: /* @__PURE__ */ jsx84(input_prefix_wrapper_default, { variant: "icon", children: /* @__PURE__ */ jsx84(icon_default2, { icon: mobile_default }) })
|
|
20915
20909
|
}
|
|
20916
20910
|
}
|
|
20917
20911
|
);
|
|
20918
20912
|
}
|
|
20919
20913
|
|
|
20920
20914
|
// src/components/dataform-controls/url.tsx
|
|
20921
|
-
import { jsx as
|
|
20915
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
20922
20916
|
function Url({
|
|
20923
20917
|
data,
|
|
20924
20918
|
field,
|
|
@@ -20927,7 +20921,7 @@ function Url({
|
|
|
20927
20921
|
markWhenOptional,
|
|
20928
20922
|
validity
|
|
20929
20923
|
}) {
|
|
20930
|
-
return /* @__PURE__ */
|
|
20924
|
+
return /* @__PURE__ */ jsx85(
|
|
20931
20925
|
ValidatedText,
|
|
20932
20926
|
{
|
|
20933
20927
|
...{
|
|
@@ -20938,7 +20932,7 @@ function Url({
|
|
|
20938
20932
|
markWhenOptional,
|
|
20939
20933
|
validity,
|
|
20940
20934
|
type: "url",
|
|
20941
|
-
prefix: /* @__PURE__ */
|
|
20935
|
+
prefix: /* @__PURE__ */ jsx85(input_prefix_wrapper_default, { variant: "icon", children: /* @__PURE__ */ jsx85(icon_default2, { icon: link_default }) })
|
|
20942
20936
|
}
|
|
20943
20937
|
}
|
|
20944
20938
|
);
|
|
@@ -20946,7 +20940,7 @@ function Url({
|
|
|
20946
20940
|
|
|
20947
20941
|
// src/components/dataform-controls/utils/validated-number.tsx
|
|
20948
20942
|
import { __ as __49 } from "@wordpress/i18n";
|
|
20949
|
-
import { jsx as
|
|
20943
|
+
import { jsx as jsx86, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
20950
20944
|
var { ValidatedNumberControl: ValidatedNumberControl2 } = unlock3(privateApis);
|
|
20951
20945
|
function toNumberOrEmpty(value) {
|
|
20952
20946
|
if (value === "" || value === void 0) {
|
|
@@ -20970,12 +20964,12 @@ function BetweenControls({
|
|
|
20970
20964
|
(newValue) => onChange([min, toNumberOrEmpty(newValue)]),
|
|
20971
20965
|
[onChange, min]
|
|
20972
20966
|
);
|
|
20973
|
-
return /* @__PURE__ */
|
|
20967
|
+
return /* @__PURE__ */ jsx86(
|
|
20974
20968
|
base_control_default,
|
|
20975
20969
|
{
|
|
20976
20970
|
help: __49("The max. value must be greater than the min. value."),
|
|
20977
|
-
children: /* @__PURE__ */
|
|
20978
|
-
/* @__PURE__ */
|
|
20971
|
+
children: /* @__PURE__ */ jsxs28(component_default3, { direction: "row", gap: 4, children: [
|
|
20972
|
+
/* @__PURE__ */ jsx86(
|
|
20979
20973
|
number_control_default,
|
|
20980
20974
|
{
|
|
20981
20975
|
label: __49("Min."),
|
|
@@ -20987,7 +20981,7 @@ function BetweenControls({
|
|
|
20987
20981
|
step
|
|
20988
20982
|
}
|
|
20989
20983
|
),
|
|
20990
|
-
/* @__PURE__ */
|
|
20984
|
+
/* @__PURE__ */ jsx86(
|
|
20991
20985
|
number_control_default,
|
|
20992
20986
|
{
|
|
20993
20987
|
label: __49("Max."),
|
|
@@ -21048,7 +21042,7 @@ function ValidatedNumber({
|
|
|
21048
21042
|
)) {
|
|
21049
21043
|
valueBetween = value;
|
|
21050
21044
|
}
|
|
21051
|
-
return /* @__PURE__ */
|
|
21045
|
+
return /* @__PURE__ */ jsx86(
|
|
21052
21046
|
BetweenControls,
|
|
21053
21047
|
{
|
|
21054
21048
|
value: valueBetween,
|
|
@@ -21058,7 +21052,7 @@ function ValidatedNumber({
|
|
|
21058
21052
|
}
|
|
21059
21053
|
);
|
|
21060
21054
|
}
|
|
21061
|
-
return /* @__PURE__ */
|
|
21055
|
+
return /* @__PURE__ */ jsx86(
|
|
21062
21056
|
ValidatedNumberControl2,
|
|
21063
21057
|
{
|
|
21064
21058
|
required: !!isValid.required,
|
|
@@ -21078,19 +21072,19 @@ function ValidatedNumber({
|
|
|
21078
21072
|
}
|
|
21079
21073
|
|
|
21080
21074
|
// src/components/dataform-controls/integer.tsx
|
|
21081
|
-
import { jsx as
|
|
21075
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
21082
21076
|
function Integer(props) {
|
|
21083
|
-
return /* @__PURE__ */
|
|
21077
|
+
return /* @__PURE__ */ jsx87(ValidatedNumber, { ...props });
|
|
21084
21078
|
}
|
|
21085
21079
|
|
|
21086
21080
|
// src/components/dataform-controls/number.tsx
|
|
21087
|
-
import { jsx as
|
|
21081
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
21088
21082
|
function Number2(props) {
|
|
21089
|
-
return /* @__PURE__ */
|
|
21083
|
+
return /* @__PURE__ */ jsx88(ValidatedNumber, { ...props });
|
|
21090
21084
|
}
|
|
21091
21085
|
|
|
21092
21086
|
// src/components/dataform-controls/radio.tsx
|
|
21093
|
-
import { jsx as
|
|
21087
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
21094
21088
|
var { ValidatedRadioControl: ValidatedRadioControl2 } = unlock3(privateApis);
|
|
21095
21089
|
function Radio2({
|
|
21096
21090
|
data,
|
|
@@ -21111,9 +21105,9 @@ function Radio2({
|
|
|
21111
21105
|
[data, onChange, setValue]
|
|
21112
21106
|
);
|
|
21113
21107
|
if (isLoading) {
|
|
21114
|
-
return /* @__PURE__ */
|
|
21108
|
+
return /* @__PURE__ */ jsx89(spinner_default, {});
|
|
21115
21109
|
}
|
|
21116
|
-
return /* @__PURE__ */
|
|
21110
|
+
return /* @__PURE__ */ jsx89(
|
|
21117
21111
|
ValidatedRadioControl2,
|
|
21118
21112
|
{
|
|
21119
21113
|
required: !!field.isValid?.required,
|
|
@@ -21130,7 +21124,7 @@ function Radio2({
|
|
|
21130
21124
|
}
|
|
21131
21125
|
|
|
21132
21126
|
// src/components/dataform-controls/text.tsx
|
|
21133
|
-
import { jsx as
|
|
21127
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
21134
21128
|
function Text3({
|
|
21135
21129
|
data,
|
|
21136
21130
|
field,
|
|
@@ -21141,7 +21135,7 @@ function Text3({
|
|
|
21141
21135
|
validity
|
|
21142
21136
|
}) {
|
|
21143
21137
|
const { prefix, suffix } = config || {};
|
|
21144
|
-
return /* @__PURE__ */
|
|
21138
|
+
return /* @__PURE__ */ jsx90(
|
|
21145
21139
|
ValidatedText,
|
|
21146
21140
|
{
|
|
21147
21141
|
...{
|
|
@@ -21159,7 +21153,7 @@ function Text3({
|
|
|
21159
21153
|
}
|
|
21160
21154
|
|
|
21161
21155
|
// src/components/dataform-controls/toggle.tsx
|
|
21162
|
-
import { jsx as
|
|
21156
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
21163
21157
|
var { ValidatedToggleControl: ValidatedToggleControl2 } = unlock3(privateApis);
|
|
21164
21158
|
function Toggle({
|
|
21165
21159
|
field,
|
|
@@ -21175,7 +21169,7 @@ function Toggle({
|
|
|
21175
21169
|
setValue({ item: data, value: !getValue({ item: data }) })
|
|
21176
21170
|
);
|
|
21177
21171
|
}, [onChange, setValue, data, getValue]);
|
|
21178
|
-
return /* @__PURE__ */
|
|
21172
|
+
return /* @__PURE__ */ jsx91(
|
|
21179
21173
|
ValidatedToggleControl2,
|
|
21180
21174
|
{
|
|
21181
21175
|
required: !!isValid.required,
|
|
@@ -21191,7 +21185,7 @@ function Toggle({
|
|
|
21191
21185
|
}
|
|
21192
21186
|
|
|
21193
21187
|
// src/components/dataform-controls/textarea.tsx
|
|
21194
|
-
import { jsx as
|
|
21188
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
21195
21189
|
var { ValidatedTextareaControl: ValidatedTextareaControl2 } = unlock3(privateApis);
|
|
21196
21190
|
function Textarea({
|
|
21197
21191
|
data,
|
|
@@ -21209,7 +21203,7 @@ function Textarea({
|
|
|
21209
21203
|
(newValue) => onChange(setValue({ item: data, value: newValue })),
|
|
21210
21204
|
[data, onChange, setValue]
|
|
21211
21205
|
);
|
|
21212
|
-
return /* @__PURE__ */
|
|
21206
|
+
return /* @__PURE__ */ jsx92(
|
|
21213
21207
|
ValidatedTextareaControl2,
|
|
21214
21208
|
{
|
|
21215
21209
|
required: !!isValid.required,
|
|
@@ -21230,7 +21224,7 @@ function Textarea({
|
|
|
21230
21224
|
}
|
|
21231
21225
|
|
|
21232
21226
|
// src/components/dataform-controls/toggle-group.tsx
|
|
21233
|
-
import { jsx as
|
|
21227
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
21234
21228
|
var { ValidatedToggleGroupControl: ValidatedToggleGroupControl2 } = unlock3(privateApis);
|
|
21235
21229
|
function ToggleGroup({
|
|
21236
21230
|
data,
|
|
@@ -21251,13 +21245,13 @@ function ToggleGroup({
|
|
|
21251
21245
|
getElements: field.getElements
|
|
21252
21246
|
});
|
|
21253
21247
|
if (isLoading) {
|
|
21254
|
-
return /* @__PURE__ */
|
|
21248
|
+
return /* @__PURE__ */ jsx93(spinner_default, {});
|
|
21255
21249
|
}
|
|
21256
21250
|
if (elements.length === 0) {
|
|
21257
21251
|
return null;
|
|
21258
21252
|
}
|
|
21259
21253
|
const selectedOption = elements.find((el) => el.value === value);
|
|
21260
|
-
return /* @__PURE__ */
|
|
21254
|
+
return /* @__PURE__ */ jsx93(
|
|
21261
21255
|
ValidatedToggleGroupControl2,
|
|
21262
21256
|
{
|
|
21263
21257
|
required: !!field.isValid?.required,
|
|
@@ -21270,7 +21264,7 @@ function ToggleGroup({
|
|
|
21270
21264
|
onChange: onChangeControl,
|
|
21271
21265
|
value,
|
|
21272
21266
|
hideLabelFromVision,
|
|
21273
|
-
children: elements.map((el) => /* @__PURE__ */
|
|
21267
|
+
children: elements.map((el) => /* @__PURE__ */ jsx93(
|
|
21274
21268
|
component_default12,
|
|
21275
21269
|
{
|
|
21276
21270
|
label: el.label,
|
|
@@ -21283,7 +21277,7 @@ function ToggleGroup({
|
|
|
21283
21277
|
}
|
|
21284
21278
|
|
|
21285
21279
|
// src/components/dataform-controls/array.tsx
|
|
21286
|
-
import { jsx as
|
|
21280
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
21287
21281
|
var { ValidatedFormTokenField: ValidatedFormTokenField2 } = unlock3(privateApis);
|
|
21288
21282
|
function ArrayControl({
|
|
21289
21283
|
data,
|
|
@@ -21321,9 +21315,9 @@ function ArrayControl({
|
|
|
21321
21315
|
[onChange, setValue, data]
|
|
21322
21316
|
);
|
|
21323
21317
|
if (isLoading) {
|
|
21324
|
-
return /* @__PURE__ */
|
|
21318
|
+
return /* @__PURE__ */ jsx94(spinner_default, {});
|
|
21325
21319
|
}
|
|
21326
|
-
return /* @__PURE__ */
|
|
21320
|
+
return /* @__PURE__ */ jsx94(
|
|
21327
21321
|
ValidatedFormTokenField2,
|
|
21328
21322
|
{
|
|
21329
21323
|
required: !!isValid?.required,
|
|
@@ -21361,9 +21355,9 @@ function ArrayControl({
|
|
|
21361
21355
|
const element = elements.find(
|
|
21362
21356
|
(el) => el.value === item2
|
|
21363
21357
|
);
|
|
21364
|
-
return /* @__PURE__ */
|
|
21358
|
+
return /* @__PURE__ */ jsx94("span", { children: element?.label || item2 });
|
|
21365
21359
|
}
|
|
21366
|
-
return /* @__PURE__ */
|
|
21360
|
+
return /* @__PURE__ */ jsx94("span", { children: item2 });
|
|
21367
21361
|
}
|
|
21368
21362
|
}
|
|
21369
21363
|
);
|
|
@@ -21372,28 +21366,28 @@ function ArrayControl({
|
|
|
21372
21366
|
// src/components/dataform-controls/color.tsx
|
|
21373
21367
|
import { colord as colord7 } from "colord";
|
|
21374
21368
|
import { __ as __50 } from "@wordpress/i18n";
|
|
21375
|
-
import { jsx as
|
|
21369
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
21376
21370
|
var { ValidatedInputControl: ValidatedInputControl4 } = unlock3(privateApis);
|
|
21377
21371
|
var ColorPickerDropdown = ({
|
|
21378
21372
|
color,
|
|
21379
21373
|
onColorChange
|
|
21380
21374
|
}) => {
|
|
21381
21375
|
const validColor = color && colord7(color).isValid() ? color : "#ffffff";
|
|
21382
|
-
return /* @__PURE__ */
|
|
21376
|
+
return /* @__PURE__ */ jsx95(
|
|
21383
21377
|
dropdown_default,
|
|
21384
21378
|
{
|
|
21385
21379
|
className: "dataviews-controls__color-picker-dropdown",
|
|
21386
21380
|
popoverProps: { resize: false },
|
|
21387
|
-
renderToggle: ({ onToggle }) => /* @__PURE__ */
|
|
21381
|
+
renderToggle: ({ onToggle }) => /* @__PURE__ */ jsx95(
|
|
21388
21382
|
button_default,
|
|
21389
21383
|
{
|
|
21390
21384
|
onClick: onToggle,
|
|
21391
21385
|
"aria-label": __50("Open color picker"),
|
|
21392
21386
|
size: "small",
|
|
21393
|
-
icon: () => /* @__PURE__ */
|
|
21387
|
+
icon: () => /* @__PURE__ */ jsx95(color_indicator_default, { colorValue: validColor })
|
|
21394
21388
|
}
|
|
21395
21389
|
),
|
|
21396
|
-
renderContent: () => /* @__PURE__ */
|
|
21390
|
+
renderContent: () => /* @__PURE__ */ jsx95(dropdown_content_wrapper_default, { paddingSize: "none", children: /* @__PURE__ */ jsx95(
|
|
21397
21391
|
LegacyAdapter,
|
|
21398
21392
|
{
|
|
21399
21393
|
color: validColor,
|
|
@@ -21426,7 +21420,7 @@ function Color({
|
|
|
21426
21420
|
},
|
|
21427
21421
|
[data, onChange, setValue]
|
|
21428
21422
|
);
|
|
21429
|
-
return /* @__PURE__ */
|
|
21423
|
+
return /* @__PURE__ */ jsx95(
|
|
21430
21424
|
ValidatedInputControl4,
|
|
21431
21425
|
{
|
|
21432
21426
|
required: !!field.isValid?.required,
|
|
@@ -21439,7 +21433,7 @@ function Color({
|
|
|
21439
21433
|
onChange: handleInputChange,
|
|
21440
21434
|
hideLabelFromVision,
|
|
21441
21435
|
type: "text",
|
|
21442
|
-
prefix: /* @__PURE__ */
|
|
21436
|
+
prefix: /* @__PURE__ */ jsx95(input_prefix_wrapper_default, { variant: "control", children: /* @__PURE__ */ jsx95(
|
|
21443
21437
|
ColorPickerDropdown,
|
|
21444
21438
|
{
|
|
21445
21439
|
color: value,
|
|
@@ -21452,7 +21446,7 @@ function Color({
|
|
|
21452
21446
|
|
|
21453
21447
|
// src/components/dataform-controls/password.tsx
|
|
21454
21448
|
import { __ as __51 } from "@wordpress/i18n";
|
|
21455
|
-
import { jsx as
|
|
21449
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
21456
21450
|
function Password({
|
|
21457
21451
|
data,
|
|
21458
21452
|
field,
|
|
@@ -21465,7 +21459,7 @@ function Password({
|
|
|
21465
21459
|
const toggleVisibility = useCallback(() => {
|
|
21466
21460
|
setIsVisible((prev) => !prev);
|
|
21467
21461
|
}, []);
|
|
21468
|
-
return /* @__PURE__ */
|
|
21462
|
+
return /* @__PURE__ */ jsx96(
|
|
21469
21463
|
ValidatedText,
|
|
21470
21464
|
{
|
|
21471
21465
|
...{
|
|
@@ -21476,7 +21470,7 @@ function Password({
|
|
|
21476
21470
|
markWhenOptional,
|
|
21477
21471
|
validity,
|
|
21478
21472
|
type: isVisible2 ? "text" : "password",
|
|
21479
|
-
suffix: /* @__PURE__ */
|
|
21473
|
+
suffix: /* @__PURE__ */ jsx96(input_suffix_wrapper_default, { variant: "control", children: /* @__PURE__ */ jsx96(
|
|
21480
21474
|
button_default,
|
|
21481
21475
|
{
|
|
21482
21476
|
icon: isVisible2 ? unseen_default : seen_default,
|
|
@@ -21496,7 +21490,7 @@ function hasElements(field) {
|
|
|
21496
21490
|
}
|
|
21497
21491
|
|
|
21498
21492
|
// src/components/dataform-controls/index.tsx
|
|
21499
|
-
import { jsx as
|
|
21493
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
21500
21494
|
var FORM_CONTROLS = {
|
|
21501
21495
|
adaptiveSelect: AdaptiveSelect,
|
|
21502
21496
|
array: ArrayControl,
|
|
@@ -21528,7 +21522,7 @@ function createConfiguredControl(config) {
|
|
|
21528
21522
|
return null;
|
|
21529
21523
|
}
|
|
21530
21524
|
return function ConfiguredControl(props) {
|
|
21531
|
-
return /* @__PURE__ */
|
|
21525
|
+
return /* @__PURE__ */ jsx97(BaseControlType, { ...props, config: controlConfig });
|
|
21532
21526
|
};
|
|
21533
21527
|
}
|
|
21534
21528
|
function getControl(field, fallback) {
|
|
@@ -21626,13 +21620,13 @@ function RenderFromElements({
|
|
|
21626
21620
|
}
|
|
21627
21621
|
|
|
21628
21622
|
// src/field-types/utils/render-default.tsx
|
|
21629
|
-
import { jsx as
|
|
21623
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
21630
21624
|
function render2({
|
|
21631
21625
|
item: item2,
|
|
21632
21626
|
field
|
|
21633
21627
|
}) {
|
|
21634
21628
|
if (field.hasElements) {
|
|
21635
|
-
return /* @__PURE__ */
|
|
21629
|
+
return /* @__PURE__ */ jsx98(RenderFromElements, { item: item2, field });
|
|
21636
21630
|
}
|
|
21637
21631
|
return field.getValueFormatted({ item: item2, field });
|
|
21638
21632
|
}
|
|
@@ -21783,7 +21777,7 @@ function isValidMax(item2, field) {
|
|
|
21783
21777
|
}
|
|
21784
21778
|
|
|
21785
21779
|
// src/field-types/integer.tsx
|
|
21786
|
-
var
|
|
21780
|
+
var format2 = {
|
|
21787
21781
|
separatorThousand: ","
|
|
21788
21782
|
};
|
|
21789
21783
|
function getValueFormatted2({
|
|
@@ -21800,7 +21794,7 @@ function getValueFormatted2({
|
|
|
21800
21794
|
}
|
|
21801
21795
|
let formatInteger;
|
|
21802
21796
|
if (field.type !== "integer") {
|
|
21803
|
-
formatInteger =
|
|
21797
|
+
formatInteger = format2;
|
|
21804
21798
|
} else {
|
|
21805
21799
|
formatInteger = field.format;
|
|
21806
21800
|
}
|
|
@@ -21852,7 +21846,7 @@ var integer_default = {
|
|
|
21852
21846
|
OPERATOR_IS_ALL,
|
|
21853
21847
|
OPERATOR_IS_NOT_ALL
|
|
21854
21848
|
],
|
|
21855
|
-
format:
|
|
21849
|
+
format: format2,
|
|
21856
21850
|
getValueFormatted: getValueFormatted2,
|
|
21857
21851
|
validate: {
|
|
21858
21852
|
required: isValidRequired,
|
|
@@ -21865,7 +21859,7 @@ var integer_default = {
|
|
|
21865
21859
|
|
|
21866
21860
|
// src/field-types/number.tsx
|
|
21867
21861
|
import { __ as __54 } from "@wordpress/i18n";
|
|
21868
|
-
var
|
|
21862
|
+
var format3 = {
|
|
21869
21863
|
separatorThousand: ",",
|
|
21870
21864
|
separatorDecimal: ".",
|
|
21871
21865
|
decimals: 2
|
|
@@ -21884,7 +21878,7 @@ function getValueFormatted3({
|
|
|
21884
21878
|
}
|
|
21885
21879
|
let formatNumber;
|
|
21886
21880
|
if (field.type !== "number") {
|
|
21887
|
-
formatNumber =
|
|
21881
|
+
formatNumber = format3;
|
|
21888
21882
|
} else {
|
|
21889
21883
|
formatNumber = field.format;
|
|
21890
21884
|
}
|
|
@@ -21935,7 +21929,7 @@ var number_default = {
|
|
|
21935
21929
|
OPERATOR_IS_ALL,
|
|
21936
21930
|
OPERATOR_IS_NOT_ALL
|
|
21937
21931
|
],
|
|
21938
|
-
format:
|
|
21932
|
+
format: format3,
|
|
21939
21933
|
getValueFormatted: getValueFormatted3,
|
|
21940
21934
|
validate: {
|
|
21941
21935
|
required: isValidRequired,
|
|
@@ -21980,8 +21974,8 @@ var text_default = {
|
|
|
21980
21974
|
};
|
|
21981
21975
|
|
|
21982
21976
|
// src/field-types/datetime.tsx
|
|
21983
|
-
import { dateI18n, getDate as
|
|
21984
|
-
var
|
|
21977
|
+
import { dateI18n as dateI18n2, getDate as getDate5, getSettings as getSettings3 } from "@wordpress/date";
|
|
21978
|
+
var format4 = {
|
|
21985
21979
|
datetime: getSettings3().formats.datetime,
|
|
21986
21980
|
weekStartsOn: getSettings3().l10n.startOfWeek
|
|
21987
21981
|
};
|
|
@@ -21995,11 +21989,11 @@ function getValueFormatted4({
|
|
|
21995
21989
|
}
|
|
21996
21990
|
let formatDatetime;
|
|
21997
21991
|
if (field.type !== "datetime") {
|
|
21998
|
-
formatDatetime =
|
|
21992
|
+
formatDatetime = format4;
|
|
21999
21993
|
} else {
|
|
22000
21994
|
formatDatetime = field.format;
|
|
22001
21995
|
}
|
|
22002
|
-
return
|
|
21996
|
+
return dateI18n2(formatDatetime.datetime, getDate5(value));
|
|
22003
21997
|
}
|
|
22004
21998
|
var sort = (a, b, direction) => {
|
|
22005
21999
|
const timeA = new Date(a).getTime();
|
|
@@ -22033,7 +22027,7 @@ var datetime_default = {
|
|
|
22033
22027
|
OPERATOR_IN_THE_PAST,
|
|
22034
22028
|
OPERATOR_OVER
|
|
22035
22029
|
],
|
|
22036
|
-
format:
|
|
22030
|
+
format: format4,
|
|
22037
22031
|
getValueFormatted: getValueFormatted4,
|
|
22038
22032
|
validate: {
|
|
22039
22033
|
required: isValidRequired,
|
|
@@ -22042,8 +22036,8 @@ var datetime_default = {
|
|
|
22042
22036
|
};
|
|
22043
22037
|
|
|
22044
22038
|
// src/field-types/date.tsx
|
|
22045
|
-
import { dateI18n as
|
|
22046
|
-
var
|
|
22039
|
+
import { dateI18n as dateI18n3, getDate as getDate6, getSettings as getSettings4 } from "@wordpress/date";
|
|
22040
|
+
var format5 = {
|
|
22047
22041
|
date: getSettings4().formats.date,
|
|
22048
22042
|
weekStartsOn: getSettings4().l10n.startOfWeek
|
|
22049
22043
|
};
|
|
@@ -22057,11 +22051,11 @@ function getValueFormatted5({
|
|
|
22057
22051
|
}
|
|
22058
22052
|
let formatDate2;
|
|
22059
22053
|
if (field.type !== "date") {
|
|
22060
|
-
formatDate2 =
|
|
22054
|
+
formatDate2 = format5;
|
|
22061
22055
|
} else {
|
|
22062
22056
|
formatDate2 = field.format;
|
|
22063
22057
|
}
|
|
22064
|
-
return
|
|
22058
|
+
return dateI18n3(formatDate2.date, getDate6(value));
|
|
22065
22059
|
}
|
|
22066
22060
|
var sort2 = (a, b, direction) => {
|
|
22067
22061
|
const timeA = new Date(a).getTime();
|
|
@@ -22097,7 +22091,7 @@ var date_default = {
|
|
|
22097
22091
|
OPERATOR_OVER,
|
|
22098
22092
|
OPERATOR_BETWEEN
|
|
22099
22093
|
],
|
|
22100
|
-
format:
|
|
22094
|
+
format: format5,
|
|
22101
22095
|
getValueFormatted: getValueFormatted5,
|
|
22102
22096
|
validate: {
|
|
22103
22097
|
required: isValidRequired,
|
|
@@ -22311,17 +22305,17 @@ var telephone_default = {
|
|
|
22311
22305
|
// src/field-types/color.tsx
|
|
22312
22306
|
import { colord as colord8 } from "colord";
|
|
22313
22307
|
import { __ as __57 } from "@wordpress/i18n";
|
|
22314
|
-
import { jsx as
|
|
22308
|
+
import { jsx as jsx99, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
22315
22309
|
function render4({ item: item2, field }) {
|
|
22316
22310
|
if (field.hasElements) {
|
|
22317
|
-
return /* @__PURE__ */
|
|
22311
|
+
return /* @__PURE__ */ jsx99(RenderFromElements, { item: item2, field });
|
|
22318
22312
|
}
|
|
22319
22313
|
const value = get_value_formatted_default_default({ item: item2, field });
|
|
22320
22314
|
if (!value || !colord8(value).isValid()) {
|
|
22321
22315
|
return value;
|
|
22322
22316
|
}
|
|
22323
|
-
return /* @__PURE__ */
|
|
22324
|
-
/* @__PURE__ */
|
|
22317
|
+
return /* @__PURE__ */ jsxs29("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
22318
|
+
/* @__PURE__ */ jsx99(
|
|
22325
22319
|
"div",
|
|
22326
22320
|
{
|
|
22327
22321
|
style: {
|
|
@@ -22334,7 +22328,7 @@ function render4({ item: item2, field }) {
|
|
|
22334
22328
|
}
|
|
22335
22329
|
}
|
|
22336
22330
|
),
|
|
22337
|
-
/* @__PURE__ */
|
|
22331
|
+
/* @__PURE__ */ jsx99("span", { children: value })
|
|
22338
22332
|
] });
|
|
22339
22333
|
}
|
|
22340
22334
|
function isValidCustom6(item2, field) {
|
|
@@ -22617,7 +22611,7 @@ function useData(data, isLoading, paginationInfo) {
|
|
|
22617
22611
|
}
|
|
22618
22612
|
|
|
22619
22613
|
// src/dataviews/index.tsx
|
|
22620
|
-
import { Fragment as
|
|
22614
|
+
import { Fragment as Fragment14, jsx as jsx100, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
22621
22615
|
var defaultGetItemId = (item2) => item2.id;
|
|
22622
22616
|
var defaultIsItemClickable = () => true;
|
|
22623
22617
|
var EMPTY_ARRAY6 = [];
|
|
@@ -22629,8 +22623,8 @@ function DefaultUI({
|
|
|
22629
22623
|
search = true,
|
|
22630
22624
|
searchLabel = void 0
|
|
22631
22625
|
}) {
|
|
22632
|
-
return /* @__PURE__ */
|
|
22633
|
-
/* @__PURE__ */
|
|
22626
|
+
return /* @__PURE__ */ jsxs30(Fragment14, { children: [
|
|
22627
|
+
/* @__PURE__ */ jsxs30(
|
|
22634
22628
|
Stack,
|
|
22635
22629
|
{
|
|
22636
22630
|
direction: "row",
|
|
@@ -22639,7 +22633,7 @@ function DefaultUI({
|
|
|
22639
22633
|
className: "dataviews__view-actions",
|
|
22640
22634
|
gap: "xs",
|
|
22641
22635
|
children: [
|
|
22642
|
-
/* @__PURE__ */
|
|
22636
|
+
/* @__PURE__ */ jsxs30(
|
|
22643
22637
|
Stack,
|
|
22644
22638
|
{
|
|
22645
22639
|
direction: "row",
|
|
@@ -22647,21 +22641,21 @@ function DefaultUI({
|
|
|
22647
22641
|
gap: "sm",
|
|
22648
22642
|
className: "dataviews__search",
|
|
22649
22643
|
children: [
|
|
22650
|
-
search && /* @__PURE__ */
|
|
22651
|
-
/* @__PURE__ */
|
|
22644
|
+
search && /* @__PURE__ */ jsx100(dataviews_search_default, { label: searchLabel }),
|
|
22645
|
+
/* @__PURE__ */ jsx100(toggle_default, {})
|
|
22652
22646
|
]
|
|
22653
22647
|
}
|
|
22654
22648
|
),
|
|
22655
|
-
/* @__PURE__ */
|
|
22656
|
-
/* @__PURE__ */
|
|
22649
|
+
/* @__PURE__ */ jsxs30(Stack, { direction: "row", gap: "xs", style: { flexShrink: 0 }, children: [
|
|
22650
|
+
/* @__PURE__ */ jsx100(dataviews_view_config_default, {}),
|
|
22657
22651
|
header
|
|
22658
22652
|
] })
|
|
22659
22653
|
]
|
|
22660
22654
|
}
|
|
22661
22655
|
),
|
|
22662
|
-
/* @__PURE__ */
|
|
22663
|
-
/* @__PURE__ */
|
|
22664
|
-
/* @__PURE__ */
|
|
22656
|
+
/* @__PURE__ */ jsx100(filters_toggled_default, { className: "dataviews-filters__container" }),
|
|
22657
|
+
/* @__PURE__ */ jsx100(DataViewsLayout, {}),
|
|
22658
|
+
/* @__PURE__ */ jsx100(DataViewsFooter, {})
|
|
22665
22659
|
] });
|
|
22666
22660
|
}
|
|
22667
22661
|
function DataViews({
|
|
@@ -22733,8 +22727,13 @@ function DataViews({
|
|
|
22733
22727
|
setIsShowingFilter(true);
|
|
22734
22728
|
}
|
|
22735
22729
|
}, [hasPrimaryOrLockedFilters, isShowingFilter]);
|
|
22730
|
+
const {
|
|
22731
|
+
data: displayData,
|
|
22732
|
+
paginationInfo: displayPaginationInfo,
|
|
22733
|
+
hasInitiallyLoaded
|
|
22734
|
+
} = useData(data, isLoading, paginationInfo);
|
|
22736
22735
|
useEffect(() => {
|
|
22737
|
-
if (!view.infiniteScrollEnabled || !containerRef.current) {
|
|
22736
|
+
if (!hasInitiallyLoaded || !view.infiniteScrollEnabled || !containerRef.current) {
|
|
22738
22737
|
return;
|
|
22739
22738
|
}
|
|
22740
22739
|
const handleScroll = throttle((event) => {
|
|
@@ -22752,7 +22751,11 @@ function DataViews({
|
|
|
22752
22751
|
container.removeEventListener("scroll", handleScroll);
|
|
22753
22752
|
handleScroll.cancel();
|
|
22754
22753
|
};
|
|
22755
|
-
}, [
|
|
22754
|
+
}, [
|
|
22755
|
+
hasInitiallyLoaded,
|
|
22756
|
+
infiniteScrollHandler,
|
|
22757
|
+
view.infiniteScrollEnabled
|
|
22758
|
+
]);
|
|
22756
22759
|
const defaultLayouts = useMemo(
|
|
22757
22760
|
() => Object.fromEntries(
|
|
22758
22761
|
Object.entries(defaultLayoutsProperty).filter(
|
|
@@ -22765,15 +22768,10 @@ function DataViews({
|
|
|
22765
22768
|
),
|
|
22766
22769
|
[defaultLayoutsProperty]
|
|
22767
22770
|
);
|
|
22768
|
-
const {
|
|
22769
|
-
data: displayData,
|
|
22770
|
-
paginationInfo: displayPaginationInfo,
|
|
22771
|
-
hasInitiallyLoaded
|
|
22772
|
-
} = useData(data, isLoading, paginationInfo);
|
|
22773
22771
|
if (!defaultLayouts[view.type]) {
|
|
22774
22772
|
return null;
|
|
22775
22773
|
}
|
|
22776
|
-
return /* @__PURE__ */
|
|
22774
|
+
return /* @__PURE__ */ jsx100(
|
|
22777
22775
|
dataviews_context_default.Provider,
|
|
22778
22776
|
{
|
|
22779
22777
|
value: {
|
|
@@ -22806,7 +22804,7 @@ function DataViews({
|
|
|
22806
22804
|
hasInfiniteScrollHandler: !!infiniteScrollHandler,
|
|
22807
22805
|
onReset
|
|
22808
22806
|
},
|
|
22809
|
-
children: /* @__PURE__ */
|
|
22807
|
+
children: /* @__PURE__ */ jsx100("div", { className: "dataviews-wrapper", children: children ?? /* @__PURE__ */ jsx100(
|
|
22810
22808
|
DefaultUI,
|
|
22811
22809
|
{
|
|
22812
22810
|
header,
|
|
@@ -22831,7 +22829,7 @@ DataViewsSubComponents.Footer = DataViewsFooter;
|
|
|
22831
22829
|
var dataviews_default = DataViewsSubComponents;
|
|
22832
22830
|
|
|
22833
22831
|
// src/dataviews-picker/index.tsx
|
|
22834
|
-
import { Fragment as
|
|
22832
|
+
import { Fragment as Fragment15, jsx as jsx101, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
22835
22833
|
var isItemClickable = () => false;
|
|
22836
22834
|
var dataViewsPickerLayouts = VIEW_LAYOUTS.filter(
|
|
22837
22835
|
(viewLayout) => viewLayout.isPicker
|
|
@@ -22842,8 +22840,8 @@ function DefaultUI2({
|
|
|
22842
22840
|
search = true,
|
|
22843
22841
|
searchLabel = void 0
|
|
22844
22842
|
}) {
|
|
22845
|
-
return /* @__PURE__ */
|
|
22846
|
-
/* @__PURE__ */
|
|
22843
|
+
return /* @__PURE__ */ jsxs31(Fragment15, { children: [
|
|
22844
|
+
/* @__PURE__ */ jsxs31(
|
|
22847
22845
|
Stack,
|
|
22848
22846
|
{
|
|
22849
22847
|
direction: "row",
|
|
@@ -22852,7 +22850,7 @@ function DefaultUI2({
|
|
|
22852
22850
|
className: "dataviews__view-actions",
|
|
22853
22851
|
gap: "xs",
|
|
22854
22852
|
children: [
|
|
22855
|
-
/* @__PURE__ */
|
|
22853
|
+
/* @__PURE__ */ jsxs31(
|
|
22856
22854
|
Stack,
|
|
22857
22855
|
{
|
|
22858
22856
|
direction: "row",
|
|
@@ -22860,18 +22858,18 @@ function DefaultUI2({
|
|
|
22860
22858
|
justify: "start",
|
|
22861
22859
|
className: "dataviews__search",
|
|
22862
22860
|
children: [
|
|
22863
|
-
search && /* @__PURE__ */
|
|
22864
|
-
/* @__PURE__ */
|
|
22861
|
+
search && /* @__PURE__ */ jsx101(dataviews_search_default, { label: searchLabel }),
|
|
22862
|
+
/* @__PURE__ */ jsx101(toggle_default, {})
|
|
22865
22863
|
]
|
|
22866
22864
|
}
|
|
22867
22865
|
),
|
|
22868
|
-
/* @__PURE__ */
|
|
22866
|
+
/* @__PURE__ */ jsx101(Stack, { direction: "row", gap: "xs", style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx101(dataviews_view_config_default, {}) })
|
|
22869
22867
|
]
|
|
22870
22868
|
}
|
|
22871
22869
|
),
|
|
22872
|
-
/* @__PURE__ */
|
|
22873
|
-
/* @__PURE__ */
|
|
22874
|
-
/* @__PURE__ */
|
|
22870
|
+
/* @__PURE__ */ jsx101(filters_toggled_default, { className: "dataviews-filters__container" }),
|
|
22871
|
+
/* @__PURE__ */ jsx101(DataViewsLayout, {}),
|
|
22872
|
+
/* @__PURE__ */ jsx101(DataViewsPickerFooter, {})
|
|
22875
22873
|
] });
|
|
22876
22874
|
}
|
|
22877
22875
|
function DataViewsPicker({
|
|
@@ -22962,7 +22960,7 @@ function DataViewsPicker({
|
|
|
22962
22960
|
if (!defaultLayouts[view.type]) {
|
|
22963
22961
|
return null;
|
|
22964
22962
|
}
|
|
22965
|
-
return /* @__PURE__ */
|
|
22963
|
+
return /* @__PURE__ */ jsx101(
|
|
22966
22964
|
dataviews_context_default.Provider,
|
|
22967
22965
|
{
|
|
22968
22966
|
value: {
|
|
@@ -22992,7 +22990,7 @@ function DataViewsPicker({
|
|
|
22992
22990
|
hasInitiallyLoaded: true,
|
|
22993
22991
|
hasInfiniteScrollHandler: !!infiniteScrollHandler
|
|
22994
22992
|
},
|
|
22995
|
-
children: /* @__PURE__ */
|
|
22993
|
+
children: /* @__PURE__ */ jsx101("div", { className: "dataviews-picker-wrapper", children: children ?? /* @__PURE__ */ jsx101(DefaultUI2, { search, searchLabel }) })
|
|
22996
22994
|
}
|
|
22997
22995
|
);
|
|
22998
22996
|
}
|
|
@@ -23009,7 +23007,7 @@ DataViewsPickerSubComponents.ViewConfig = DataviewsViewConfigDropdown;
|
|
|
23009
23007
|
var dataviews_picker_default = DataViewsPickerSubComponents;
|
|
23010
23008
|
|
|
23011
23009
|
// src/components/dataform-context/index.tsx
|
|
23012
|
-
import { jsx as
|
|
23010
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
23013
23011
|
var DataFormContext = createContext({
|
|
23014
23012
|
fields: []
|
|
23015
23013
|
});
|
|
@@ -23018,14 +23016,15 @@ function DataFormProvider({
|
|
|
23018
23016
|
fields,
|
|
23019
23017
|
children
|
|
23020
23018
|
}) {
|
|
23021
|
-
return /* @__PURE__ */
|
|
23019
|
+
return /* @__PURE__ */ jsx102(DataFormContext.Provider, { value: { fields }, children });
|
|
23022
23020
|
}
|
|
23023
23021
|
var dataform_context_default = DataFormContext;
|
|
23024
23022
|
|
|
23025
23023
|
// src/components/dataform-layouts/regular/index.tsx
|
|
23026
|
-
import
|
|
23024
|
+
import clsx46 from "clsx";
|
|
23027
23025
|
|
|
23028
23026
|
// src/components/dataform-layouts/normalize-form.ts
|
|
23027
|
+
import { __ as __58 } from "@wordpress/i18n";
|
|
23029
23028
|
var DEFAULT_LAYOUT = {
|
|
23030
23029
|
type: "regular",
|
|
23031
23030
|
labelPosition: "top"
|
|
@@ -23051,10 +23050,27 @@ function normalizeLayout(layout) {
|
|
|
23051
23050
|
} else if (layout?.type === "panel") {
|
|
23052
23051
|
const summary = layout.summary ?? [];
|
|
23053
23052
|
const normalizedSummary = Array.isArray(summary) ? summary : [summary];
|
|
23053
|
+
const openAs = layout?.openAs;
|
|
23054
|
+
let normalizedOpenAs;
|
|
23055
|
+
if (typeof openAs === "object" && openAs.type === "modal") {
|
|
23056
|
+
normalizedOpenAs = {
|
|
23057
|
+
type: "modal",
|
|
23058
|
+
applyLabel: openAs.applyLabel?.trim() || __58("Apply"),
|
|
23059
|
+
cancelLabel: openAs.cancelLabel?.trim() || __58("Cancel")
|
|
23060
|
+
};
|
|
23061
|
+
} else if (openAs === "modal") {
|
|
23062
|
+
normalizedOpenAs = {
|
|
23063
|
+
type: "modal",
|
|
23064
|
+
applyLabel: __58("Apply"),
|
|
23065
|
+
cancelLabel: __58("Cancel")
|
|
23066
|
+
};
|
|
23067
|
+
} else {
|
|
23068
|
+
normalizedOpenAs = { type: "dropdown" };
|
|
23069
|
+
}
|
|
23054
23070
|
normalizedLayout = {
|
|
23055
23071
|
type: "panel",
|
|
23056
23072
|
labelPosition: layout?.labelPosition ?? "side",
|
|
23057
|
-
openAs:
|
|
23073
|
+
openAs: normalizedOpenAs,
|
|
23058
23074
|
summary: normalizedSummary,
|
|
23059
23075
|
editVisibility: layout?.editVisibility ?? "on-hover"
|
|
23060
23076
|
};
|
|
@@ -23126,15 +23142,15 @@ function normalizeForm(form) {
|
|
|
23126
23142
|
var normalize_form_default = normalizeForm;
|
|
23127
23143
|
|
|
23128
23144
|
// src/components/dataform-layouts/regular/index.tsx
|
|
23129
|
-
import { Fragment as
|
|
23145
|
+
import { Fragment as Fragment16, jsx as jsx103, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
23130
23146
|
function Header2({ title }) {
|
|
23131
|
-
return /* @__PURE__ */
|
|
23147
|
+
return /* @__PURE__ */ jsx103(
|
|
23132
23148
|
Stack,
|
|
23133
23149
|
{
|
|
23134
23150
|
direction: "column",
|
|
23135
23151
|
className: "dataforms-layouts-regular__header",
|
|
23136
23152
|
gap: "lg",
|
|
23137
|
-
children: /* @__PURE__ */
|
|
23153
|
+
children: /* @__PURE__ */ jsx103(Stack, { direction: "row", align: "center", children: /* @__PURE__ */ jsx103(component_default16, { level: 2, size: 13, children: title }) })
|
|
23138
23154
|
}
|
|
23139
23155
|
);
|
|
23140
23156
|
}
|
|
@@ -23156,9 +23172,9 @@ function FormRegularField({
|
|
|
23156
23172
|
[field]
|
|
23157
23173
|
);
|
|
23158
23174
|
if (!!field.children) {
|
|
23159
|
-
return /* @__PURE__ */
|
|
23160
|
-
!hideLabelFromVision && field.label && /* @__PURE__ */
|
|
23161
|
-
/* @__PURE__ */
|
|
23175
|
+
return /* @__PURE__ */ jsxs32(Fragment16, { children: [
|
|
23176
|
+
!hideLabelFromVision && field.label && /* @__PURE__ */ jsx103(Header2, { title: field.label }),
|
|
23177
|
+
/* @__PURE__ */ jsx103(
|
|
23162
23178
|
DataFormLayout,
|
|
23163
23179
|
{
|
|
23164
23180
|
data,
|
|
@@ -23177,30 +23193,30 @@ function FormRegularField({
|
|
|
23177
23193
|
return null;
|
|
23178
23194
|
}
|
|
23179
23195
|
if (labelPosition === "side") {
|
|
23180
|
-
return /* @__PURE__ */
|
|
23196
|
+
return /* @__PURE__ */ jsxs32(
|
|
23181
23197
|
Stack,
|
|
23182
23198
|
{
|
|
23183
23199
|
direction: "row",
|
|
23184
23200
|
className: "dataforms-layouts-regular__field",
|
|
23185
23201
|
gap: "sm",
|
|
23186
23202
|
children: [
|
|
23187
|
-
/* @__PURE__ */
|
|
23203
|
+
/* @__PURE__ */ jsx103(
|
|
23188
23204
|
"div",
|
|
23189
23205
|
{
|
|
23190
|
-
className:
|
|
23206
|
+
className: clsx46(
|
|
23191
23207
|
"dataforms-layouts-regular__field-label",
|
|
23192
23208
|
`dataforms-layouts-regular__field-label--label-position-${labelPosition}`
|
|
23193
23209
|
),
|
|
23194
|
-
children: /* @__PURE__ */
|
|
23210
|
+
children: /* @__PURE__ */ jsx103(base_control_default.VisualLabel, { children: fieldDefinition.label })
|
|
23195
23211
|
}
|
|
23196
23212
|
),
|
|
23197
|
-
/* @__PURE__ */
|
|
23213
|
+
/* @__PURE__ */ jsx103("div", { className: "dataforms-layouts-regular__field-control", children: fieldDefinition.readOnly === true ? /* @__PURE__ */ jsx103(
|
|
23198
23214
|
fieldDefinition.render,
|
|
23199
23215
|
{
|
|
23200
23216
|
item: data,
|
|
23201
23217
|
field: fieldDefinition
|
|
23202
23218
|
}
|
|
23203
|
-
) : /* @__PURE__ */
|
|
23219
|
+
) : /* @__PURE__ */ jsx103(
|
|
23204
23220
|
fieldDefinition.Edit,
|
|
23205
23221
|
{
|
|
23206
23222
|
data,
|
|
@@ -23216,16 +23232,16 @@ function FormRegularField({
|
|
|
23216
23232
|
}
|
|
23217
23233
|
);
|
|
23218
23234
|
}
|
|
23219
|
-
return /* @__PURE__ */
|
|
23220
|
-
!hideLabelFromVision && labelPosition !== "none" && /* @__PURE__ */
|
|
23221
|
-
/* @__PURE__ */
|
|
23235
|
+
return /* @__PURE__ */ jsx103("div", { className: "dataforms-layouts-regular__field", children: fieldDefinition.readOnly === true ? /* @__PURE__ */ jsx103(Fragment16, { children: /* @__PURE__ */ jsxs32(Fragment16, { children: [
|
|
23236
|
+
!hideLabelFromVision && labelPosition !== "none" && /* @__PURE__ */ jsx103(base_control_default.VisualLabel, { children: fieldDefinition.label }),
|
|
23237
|
+
/* @__PURE__ */ jsx103(
|
|
23222
23238
|
fieldDefinition.render,
|
|
23223
23239
|
{
|
|
23224
23240
|
item: data,
|
|
23225
23241
|
field: fieldDefinition
|
|
23226
23242
|
}
|
|
23227
23243
|
)
|
|
23228
|
-
] }) }) : /* @__PURE__ */
|
|
23244
|
+
] }) }) : /* @__PURE__ */ jsx103(
|
|
23229
23245
|
fieldDefinition.Edit,
|
|
23230
23246
|
{
|
|
23231
23247
|
data,
|
|
@@ -23240,16 +23256,15 @@ function FormRegularField({
|
|
|
23240
23256
|
|
|
23241
23257
|
// src/components/dataform-layouts/panel/modal.tsx
|
|
23242
23258
|
import deepMerge2 from "deepmerge";
|
|
23243
|
-
import { __ as __59 } from "@wordpress/i18n";
|
|
23244
23259
|
|
|
23245
23260
|
// src/components/dataform-layouts/panel/summary-button.tsx
|
|
23246
|
-
import
|
|
23261
|
+
import clsx48 from "clsx";
|
|
23247
23262
|
import { sprintf as sprintf17, _x as _x5 } from "@wordpress/i18n";
|
|
23248
23263
|
|
|
23249
23264
|
// src/components/dataform-layouts/panel/utils/get-label-classname.ts
|
|
23250
|
-
import
|
|
23265
|
+
import clsx47 from "clsx";
|
|
23251
23266
|
function getLabelClassName(labelPosition, showError) {
|
|
23252
|
-
return
|
|
23267
|
+
return clsx47(
|
|
23253
23268
|
"dataforms-layouts-panel__field-label",
|
|
23254
23269
|
`dataforms-layouts-panel__field-label--label-position-${labelPosition}`,
|
|
23255
23270
|
{ "has-error": showError }
|
|
@@ -23258,10 +23273,10 @@ function getLabelClassName(labelPosition, showError) {
|
|
|
23258
23273
|
var get_label_classname_default = getLabelClassName;
|
|
23259
23274
|
|
|
23260
23275
|
// src/components/dataform-layouts/panel/utils/get-label-content.tsx
|
|
23261
|
-
import { jsx as
|
|
23276
|
+
import { jsx as jsx104, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
23262
23277
|
function getLabelContent(showError, errorMessage, fieldLabel) {
|
|
23263
|
-
return showError ? /* @__PURE__ */
|
|
23264
|
-
/* @__PURE__ */
|
|
23278
|
+
return showError ? /* @__PURE__ */ jsx104(tooltip_default, { text: errorMessage, placement: "top", children: /* @__PURE__ */ jsxs33("span", { className: "dataforms-layouts-panel__field-label-error-content", children: [
|
|
23279
|
+
/* @__PURE__ */ jsx104(icon_default2, { icon: error_default, size: 16 }),
|
|
23265
23280
|
fieldLabel
|
|
23266
23281
|
] }) }) : fieldLabel;
|
|
23267
23282
|
}
|
|
@@ -23303,7 +23318,7 @@ function getFirstValidationError(validity) {
|
|
|
23303
23318
|
var get_first_validation_error_default = getFirstValidationError;
|
|
23304
23319
|
|
|
23305
23320
|
// src/components/dataform-layouts/panel/summary-button.tsx
|
|
23306
|
-
import { jsx as
|
|
23321
|
+
import { jsx as jsx105, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
23307
23322
|
function SummaryButton({
|
|
23308
23323
|
data,
|
|
23309
23324
|
field,
|
|
@@ -23320,7 +23335,7 @@ function SummaryButton({
|
|
|
23320
23335
|
const showError = touched && !!errorMessage;
|
|
23321
23336
|
const labelClassName = get_label_classname_default(labelPosition, showError);
|
|
23322
23337
|
const labelContent = get_label_content_default(showError, errorMessage, fieldLabel);
|
|
23323
|
-
const className2 =
|
|
23338
|
+
const className2 = clsx48(
|
|
23324
23339
|
"dataforms-layouts-panel__field-trigger",
|
|
23325
23340
|
`dataforms-layouts-panel__field-trigger--label-${labelPosition}`,
|
|
23326
23341
|
{
|
|
@@ -23355,7 +23370,7 @@ function SummaryButton({
|
|
|
23355
23370
|
onClick();
|
|
23356
23371
|
}
|
|
23357
23372
|
};
|
|
23358
|
-
return /* @__PURE__ */
|
|
23373
|
+
return /* @__PURE__ */ jsxs34(
|
|
23359
23374
|
"div",
|
|
23360
23375
|
{
|
|
23361
23376
|
ref: rowRef,
|
|
@@ -23363,14 +23378,14 @@ function SummaryButton({
|
|
|
23363
23378
|
onClick: !disabled ? handleRowClick : void 0,
|
|
23364
23379
|
onKeyDown: !disabled ? handleKeyDown : void 0,
|
|
23365
23380
|
children: [
|
|
23366
|
-
labelPosition !== "none" && /* @__PURE__ */
|
|
23367
|
-
labelPosition === "none" && showError && /* @__PURE__ */
|
|
23368
|
-
/* @__PURE__ */
|
|
23381
|
+
labelPosition !== "none" && /* @__PURE__ */ jsx105("span", { className: labelClassName, children: labelContent }),
|
|
23382
|
+
labelPosition === "none" && showError && /* @__PURE__ */ jsx105(tooltip_default, { text: errorMessage, placement: "top", children: /* @__PURE__ */ jsx105("span", { className: "dataforms-layouts-panel__field-label-error-content", children: /* @__PURE__ */ jsx105(icon_default2, { icon: error_default, size: 16 }) }) }),
|
|
23383
|
+
/* @__PURE__ */ jsx105(
|
|
23369
23384
|
"span",
|
|
23370
23385
|
{
|
|
23371
23386
|
id: `${controlId}`,
|
|
23372
23387
|
className: "dataforms-layouts-panel__field-control",
|
|
23373
|
-
children: summaryFields.length > 1 ? /* @__PURE__ */
|
|
23388
|
+
children: summaryFields.length > 1 ? /* @__PURE__ */ jsx105(
|
|
23374
23389
|
"span",
|
|
23375
23390
|
{
|
|
23376
23391
|
style: {
|
|
@@ -23380,11 +23395,11 @@ function SummaryButton({
|
|
|
23380
23395
|
width: "100%",
|
|
23381
23396
|
gap: "2px"
|
|
23382
23397
|
},
|
|
23383
|
-
children: summaryFields.map((summaryField) => /* @__PURE__ */
|
|
23398
|
+
children: summaryFields.map((summaryField) => /* @__PURE__ */ jsx105(
|
|
23384
23399
|
"span",
|
|
23385
23400
|
{
|
|
23386
23401
|
style: { width: "100%" },
|
|
23387
|
-
children: /* @__PURE__ */
|
|
23402
|
+
children: /* @__PURE__ */ jsx105(
|
|
23388
23403
|
summaryField.render,
|
|
23389
23404
|
{
|
|
23390
23405
|
item: data,
|
|
@@ -23395,7 +23410,7 @@ function SummaryButton({
|
|
|
23395
23410
|
summaryField.id
|
|
23396
23411
|
))
|
|
23397
23412
|
}
|
|
23398
|
-
) : summaryFields.map((summaryField) => /* @__PURE__ */
|
|
23413
|
+
) : summaryFields.map((summaryField) => /* @__PURE__ */ jsx105(
|
|
23399
23414
|
summaryField.render,
|
|
23400
23415
|
{
|
|
23401
23416
|
item: data,
|
|
@@ -23405,7 +23420,7 @@ function SummaryButton({
|
|
|
23405
23420
|
))
|
|
23406
23421
|
}
|
|
23407
23422
|
),
|
|
23408
|
-
!disabled && /* @__PURE__ */
|
|
23423
|
+
!disabled && /* @__PURE__ */ jsx105(
|
|
23409
23424
|
button_default,
|
|
23410
23425
|
{
|
|
23411
23426
|
className: "dataforms-layouts-panel__field-trigger-icon",
|
|
@@ -23426,7 +23441,7 @@ function SummaryButton({
|
|
|
23426
23441
|
// src/hooks/use-form-validity.ts
|
|
23427
23442
|
import deepMerge from "deepmerge";
|
|
23428
23443
|
import fastDeepEqual3 from "fast-deep-equal/es6/index.js";
|
|
23429
|
-
import { __ as
|
|
23444
|
+
import { __ as __59 } from "@wordpress/i18n";
|
|
23430
23445
|
function isFormValid(formValidity) {
|
|
23431
23446
|
if (!formValidity) {
|
|
23432
23447
|
return true;
|
|
@@ -23556,7 +23571,7 @@ function handleElementsValidationAsync(promise, formField, promiseHandler) {
|
|
|
23556
23571
|
{
|
|
23557
23572
|
elements: {
|
|
23558
23573
|
type: "invalid",
|
|
23559
|
-
message:
|
|
23574
|
+
message: __59("Could not validate elements.")
|
|
23560
23575
|
}
|
|
23561
23576
|
},
|
|
23562
23577
|
[...path, formField.id]
|
|
@@ -23575,7 +23590,7 @@ function handleElementsValidationAsync(promise, formField, promiseHandler) {
|
|
|
23575
23590
|
{
|
|
23576
23591
|
elements: {
|
|
23577
23592
|
type: "invalid",
|
|
23578
|
-
message:
|
|
23593
|
+
message: __59(
|
|
23579
23594
|
"Value must be one of the elements."
|
|
23580
23595
|
)
|
|
23581
23596
|
}
|
|
@@ -23601,7 +23616,7 @@ function handleElementsValidationAsync(promise, formField, promiseHandler) {
|
|
|
23601
23616
|
if (error instanceof Error) {
|
|
23602
23617
|
errorMessage = error.message;
|
|
23603
23618
|
} else {
|
|
23604
|
-
errorMessage = String(error) ||
|
|
23619
|
+
errorMessage = String(error) || __59(
|
|
23605
23620
|
"Unknown error when running elements validation asynchronously."
|
|
23606
23621
|
);
|
|
23607
23622
|
}
|
|
@@ -23660,7 +23675,7 @@ function handleCustomValidationAsync(promise, formField, promiseHandler) {
|
|
|
23660
23675
|
{
|
|
23661
23676
|
custom: {
|
|
23662
23677
|
type: "invalid",
|
|
23663
|
-
message:
|
|
23678
|
+
message: __59("Validation could not be processed.")
|
|
23664
23679
|
}
|
|
23665
23680
|
},
|
|
23666
23681
|
[...path, formField.id]
|
|
@@ -23675,7 +23690,7 @@ function handleCustomValidationAsync(promise, formField, promiseHandler) {
|
|
|
23675
23690
|
if (error instanceof Error) {
|
|
23676
23691
|
errorMessage = error.message;
|
|
23677
23692
|
} else {
|
|
23678
|
-
errorMessage = String(error) ||
|
|
23693
|
+
errorMessage = String(error) || __59(
|
|
23679
23694
|
"Unknown error when running custom validation asynchronously."
|
|
23680
23695
|
);
|
|
23681
23696
|
}
|
|
@@ -23704,7 +23719,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23704
23719
|
return {
|
|
23705
23720
|
pattern: {
|
|
23706
23721
|
type: "invalid",
|
|
23707
|
-
message:
|
|
23722
|
+
message: __59("Value does not match the required pattern.")
|
|
23708
23723
|
}
|
|
23709
23724
|
};
|
|
23710
23725
|
}
|
|
@@ -23712,7 +23727,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23712
23727
|
return {
|
|
23713
23728
|
min: {
|
|
23714
23729
|
type: "invalid",
|
|
23715
|
-
message:
|
|
23730
|
+
message: __59("Value is below the minimum.")
|
|
23716
23731
|
}
|
|
23717
23732
|
};
|
|
23718
23733
|
}
|
|
@@ -23720,7 +23735,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23720
23735
|
return {
|
|
23721
23736
|
max: {
|
|
23722
23737
|
type: "invalid",
|
|
23723
|
-
message:
|
|
23738
|
+
message: __59("Value is above the maximum.")
|
|
23724
23739
|
}
|
|
23725
23740
|
};
|
|
23726
23741
|
}
|
|
@@ -23728,7 +23743,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23728
23743
|
return {
|
|
23729
23744
|
minLength: {
|
|
23730
23745
|
type: "invalid",
|
|
23731
|
-
message:
|
|
23746
|
+
message: __59("Value is too short.")
|
|
23732
23747
|
}
|
|
23733
23748
|
};
|
|
23734
23749
|
}
|
|
@@ -23736,7 +23751,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23736
23751
|
return {
|
|
23737
23752
|
maxLength: {
|
|
23738
23753
|
type: "invalid",
|
|
23739
|
-
message:
|
|
23754
|
+
message: __59("Value is too long.")
|
|
23740
23755
|
}
|
|
23741
23756
|
};
|
|
23742
23757
|
}
|
|
@@ -23744,7 +23759,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23744
23759
|
return {
|
|
23745
23760
|
elements: {
|
|
23746
23761
|
type: "invalid",
|
|
23747
|
-
message:
|
|
23762
|
+
message: __59("Value must be one of the elements.")
|
|
23748
23763
|
}
|
|
23749
23764
|
};
|
|
23750
23765
|
}
|
|
@@ -23767,7 +23782,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23767
23782
|
if (error instanceof Error) {
|
|
23768
23783
|
errorMessage = error.message;
|
|
23769
23784
|
} else {
|
|
23770
|
-
errorMessage = String(error) ||
|
|
23785
|
+
errorMessage = String(error) || __59("Unknown error when running custom validation.");
|
|
23771
23786
|
}
|
|
23772
23787
|
return {
|
|
23773
23788
|
custom: {
|
|
@@ -23794,14 +23809,14 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
23794
23809
|
);
|
|
23795
23810
|
fieldValidity.elements = {
|
|
23796
23811
|
type: "validating",
|
|
23797
|
-
message:
|
|
23812
|
+
message: __59("Validating\u2026")
|
|
23798
23813
|
};
|
|
23799
23814
|
}
|
|
23800
23815
|
if (customError instanceof Promise) {
|
|
23801
23816
|
handleCustomValidationAsync(customError, formField, promiseHandler);
|
|
23802
23817
|
fieldValidity.custom = {
|
|
23803
23818
|
type: "validating",
|
|
23804
|
-
message:
|
|
23819
|
+
message: __59("Validating\u2026")
|
|
23805
23820
|
};
|
|
23806
23821
|
}
|
|
23807
23822
|
if (Object.keys(fieldValidity).length > 0) {
|
|
@@ -23993,7 +24008,7 @@ function useFieldFromFormField(field) {
|
|
|
23993
24008
|
var use_field_from_form_field_default = useFieldFromFormField;
|
|
23994
24009
|
|
|
23995
24010
|
// src/components/dataform-layouts/panel/modal.tsx
|
|
23996
|
-
import { Fragment as
|
|
24011
|
+
import { Fragment as Fragment17, jsx as jsx106, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
23997
24012
|
function ModalContent({
|
|
23998
24013
|
data,
|
|
23999
24014
|
field,
|
|
@@ -24002,6 +24017,8 @@ function ModalContent({
|
|
|
24002
24017
|
onClose,
|
|
24003
24018
|
touched
|
|
24004
24019
|
}) {
|
|
24020
|
+
const { openAs } = field.layout;
|
|
24021
|
+
const { applyLabel, cancelLabel } = openAs;
|
|
24005
24022
|
const { fields } = useContext(dataform_context_default);
|
|
24006
24023
|
const [changes, setChanges] = useState({});
|
|
24007
24024
|
const modalData = useMemo(() => {
|
|
@@ -24048,7 +24065,7 @@ function ModalContent({
|
|
|
24048
24065
|
const contentRef = useRef(null);
|
|
24049
24066
|
const mergedRef = useMergeRefs([focusOnMountRef, contentRef]);
|
|
24050
24067
|
useReportValidity(contentRef, touched);
|
|
24051
|
-
return /* @__PURE__ */
|
|
24068
|
+
return /* @__PURE__ */ jsxs35(
|
|
24052
24069
|
modal_default,
|
|
24053
24070
|
{
|
|
24054
24071
|
className: "dataforms-layouts-panel__modal",
|
|
@@ -24057,14 +24074,14 @@ function ModalContent({
|
|
|
24057
24074
|
title: fieldLabel,
|
|
24058
24075
|
size: "medium",
|
|
24059
24076
|
children: [
|
|
24060
|
-
/* @__PURE__ */
|
|
24077
|
+
/* @__PURE__ */ jsx106("div", { ref: mergedRef, children: /* @__PURE__ */ jsx106(
|
|
24061
24078
|
DataFormLayout,
|
|
24062
24079
|
{
|
|
24063
24080
|
data: modalData,
|
|
24064
24081
|
form,
|
|
24065
24082
|
onChange: handleOnChange,
|
|
24066
24083
|
validity,
|
|
24067
|
-
children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */
|
|
24084
|
+
children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */ jsx106(
|
|
24068
24085
|
FieldLayout,
|
|
24069
24086
|
{
|
|
24070
24087
|
data: modalData,
|
|
@@ -24078,30 +24095,30 @@ function ModalContent({
|
|
|
24078
24095
|
)
|
|
24079
24096
|
}
|
|
24080
24097
|
) }),
|
|
24081
|
-
/* @__PURE__ */
|
|
24098
|
+
/* @__PURE__ */ jsxs35(
|
|
24082
24099
|
Stack,
|
|
24083
24100
|
{
|
|
24084
24101
|
direction: "row",
|
|
24085
24102
|
className: "dataforms-layouts-panel__modal-footer",
|
|
24086
24103
|
gap: "md",
|
|
24087
24104
|
children: [
|
|
24088
|
-
/* @__PURE__ */
|
|
24089
|
-
/* @__PURE__ */
|
|
24105
|
+
/* @__PURE__ */ jsx106(component_default6, { style: { flex: 1 } }),
|
|
24106
|
+
/* @__PURE__ */ jsx106(
|
|
24090
24107
|
button_default,
|
|
24091
24108
|
{
|
|
24092
24109
|
variant: "tertiary",
|
|
24093
24110
|
onClick: onClose,
|
|
24094
24111
|
__next40pxDefaultSize: true,
|
|
24095
|
-
children:
|
|
24112
|
+
children: cancelLabel
|
|
24096
24113
|
}
|
|
24097
24114
|
),
|
|
24098
|
-
/* @__PURE__ */
|
|
24115
|
+
/* @__PURE__ */ jsx106(
|
|
24099
24116
|
button_default,
|
|
24100
24117
|
{
|
|
24101
24118
|
variant: "primary",
|
|
24102
24119
|
onClick: onApply,
|
|
24103
24120
|
__next40pxDefaultSize: true,
|
|
24104
|
-
children:
|
|
24121
|
+
children: applyLabel
|
|
24105
24122
|
}
|
|
24106
24123
|
)
|
|
24107
24124
|
]
|
|
@@ -24127,8 +24144,8 @@ function PanelModal({
|
|
|
24127
24144
|
setIsOpen(false);
|
|
24128
24145
|
setTouched(true);
|
|
24129
24146
|
};
|
|
24130
|
-
return /* @__PURE__ */
|
|
24131
|
-
/* @__PURE__ */
|
|
24147
|
+
return /* @__PURE__ */ jsxs35(Fragment17, { children: [
|
|
24148
|
+
/* @__PURE__ */ jsx106(
|
|
24132
24149
|
SummaryButton,
|
|
24133
24150
|
{
|
|
24134
24151
|
data,
|
|
@@ -24142,7 +24159,7 @@ function PanelModal({
|
|
|
24142
24159
|
"aria-expanded": isOpen
|
|
24143
24160
|
}
|
|
24144
24161
|
),
|
|
24145
|
-
isOpen && /* @__PURE__ */
|
|
24162
|
+
isOpen && /* @__PURE__ */ jsx106(
|
|
24146
24163
|
ModalContent,
|
|
24147
24164
|
{
|
|
24148
24165
|
data,
|
|
@@ -24159,21 +24176,21 @@ var modal_default2 = PanelModal;
|
|
|
24159
24176
|
|
|
24160
24177
|
// src/components/dataform-layouts/panel/dropdown.tsx
|
|
24161
24178
|
import { __ as __60 } from "@wordpress/i18n";
|
|
24162
|
-
import { jsx as
|
|
24179
|
+
import { jsx as jsx107, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
24163
24180
|
function DropdownHeader({
|
|
24164
24181
|
title,
|
|
24165
24182
|
onClose
|
|
24166
24183
|
}) {
|
|
24167
|
-
return /* @__PURE__ */
|
|
24184
|
+
return /* @__PURE__ */ jsx107(
|
|
24168
24185
|
Stack,
|
|
24169
24186
|
{
|
|
24170
24187
|
direction: "column",
|
|
24171
24188
|
className: "dataforms-layouts-panel__dropdown-header",
|
|
24172
24189
|
gap: "lg",
|
|
24173
|
-
children: /* @__PURE__ */
|
|
24174
|
-
title && /* @__PURE__ */
|
|
24175
|
-
/* @__PURE__ */
|
|
24176
|
-
onClose && /* @__PURE__ */
|
|
24190
|
+
children: /* @__PURE__ */ jsxs36(Stack, { direction: "row", gap: "sm", align: "center", children: [
|
|
24191
|
+
title && /* @__PURE__ */ jsx107(component_default16, { level: 2, size: 13, children: title }),
|
|
24192
|
+
/* @__PURE__ */ jsx107(component_default6, { style: { flex: 1 } }),
|
|
24193
|
+
onClose && /* @__PURE__ */ jsx107(
|
|
24177
24194
|
button_default,
|
|
24178
24195
|
{
|
|
24179
24196
|
label: __60("Close"),
|
|
@@ -24192,7 +24209,7 @@ function DropdownContentWithValidation({
|
|
|
24192
24209
|
}) {
|
|
24193
24210
|
const ref = useRef(null);
|
|
24194
24211
|
useReportValidity(ref, touched);
|
|
24195
|
-
return /* @__PURE__ */
|
|
24212
|
+
return /* @__PURE__ */ jsx107("div", { ref, children });
|
|
24196
24213
|
}
|
|
24197
24214
|
function PanelDropdown({
|
|
24198
24215
|
data,
|
|
@@ -24241,12 +24258,12 @@ function PanelDropdown({
|
|
|
24241
24258
|
if (!fieldDefinition) {
|
|
24242
24259
|
return null;
|
|
24243
24260
|
}
|
|
24244
|
-
return /* @__PURE__ */
|
|
24261
|
+
return /* @__PURE__ */ jsx107(
|
|
24245
24262
|
"div",
|
|
24246
24263
|
{
|
|
24247
24264
|
ref: setPopoverAnchor,
|
|
24248
24265
|
className: "dataforms-layouts-panel__field-dropdown-anchor",
|
|
24249
|
-
children: /* @__PURE__ */
|
|
24266
|
+
children: /* @__PURE__ */ jsx107(
|
|
24250
24267
|
dropdown_default,
|
|
24251
24268
|
{
|
|
24252
24269
|
contentClassName: "dataforms-layouts-panel__field-dropdown",
|
|
@@ -24257,7 +24274,7 @@ function PanelDropdown({
|
|
|
24257
24274
|
setTouched(true);
|
|
24258
24275
|
}
|
|
24259
24276
|
},
|
|
24260
|
-
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */
|
|
24277
|
+
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ jsx107(
|
|
24261
24278
|
SummaryButton,
|
|
24262
24279
|
{
|
|
24263
24280
|
data,
|
|
@@ -24271,22 +24288,22 @@ function PanelDropdown({
|
|
|
24271
24288
|
"aria-expanded": isOpen
|
|
24272
24289
|
}
|
|
24273
24290
|
),
|
|
24274
|
-
renderContent: ({ onClose }) => /* @__PURE__ */
|
|
24275
|
-
/* @__PURE__ */
|
|
24291
|
+
renderContent: ({ onClose }) => /* @__PURE__ */ jsx107(DropdownContentWithValidation, { touched, children: /* @__PURE__ */ jsxs36("div", { ref: dialogRef, ...dialogProps, children: [
|
|
24292
|
+
/* @__PURE__ */ jsx107(
|
|
24276
24293
|
DropdownHeader,
|
|
24277
24294
|
{
|
|
24278
24295
|
title: fieldLabel,
|
|
24279
24296
|
onClose
|
|
24280
24297
|
}
|
|
24281
24298
|
),
|
|
24282
|
-
/* @__PURE__ */
|
|
24299
|
+
/* @__PURE__ */ jsx107(
|
|
24283
24300
|
DataFormLayout,
|
|
24284
24301
|
{
|
|
24285
24302
|
data,
|
|
24286
24303
|
form,
|
|
24287
24304
|
onChange,
|
|
24288
24305
|
validity: formValidity,
|
|
24289
|
-
children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */
|
|
24306
|
+
children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */ jsx107(
|
|
24290
24307
|
FieldLayout,
|
|
24291
24308
|
{
|
|
24292
24309
|
data,
|
|
@@ -24309,7 +24326,7 @@ function PanelDropdown({
|
|
|
24309
24326
|
var dropdown_default2 = PanelDropdown;
|
|
24310
24327
|
|
|
24311
24328
|
// src/components/dataform-layouts/panel/index.tsx
|
|
24312
|
-
import { jsx as
|
|
24329
|
+
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
24313
24330
|
function FormPanelField({
|
|
24314
24331
|
data,
|
|
24315
24332
|
field,
|
|
@@ -24317,8 +24334,8 @@ function FormPanelField({
|
|
|
24317
24334
|
validity
|
|
24318
24335
|
}) {
|
|
24319
24336
|
const layout = field.layout;
|
|
24320
|
-
if (layout.openAs === "modal") {
|
|
24321
|
-
return /* @__PURE__ */
|
|
24337
|
+
if (layout.openAs.type === "modal") {
|
|
24338
|
+
return /* @__PURE__ */ jsx108(
|
|
24322
24339
|
modal_default2,
|
|
24323
24340
|
{
|
|
24324
24341
|
data,
|
|
@@ -24328,7 +24345,7 @@ function FormPanelField({
|
|
|
24328
24345
|
}
|
|
24329
24346
|
);
|
|
24330
24347
|
}
|
|
24331
|
-
return /* @__PURE__ */
|
|
24348
|
+
return /* @__PURE__ */ jsx108(
|
|
24332
24349
|
dropdown_default2,
|
|
24333
24350
|
{
|
|
24334
24351
|
data,
|
|
@@ -24341,7 +24358,7 @@ function FormPanelField({
|
|
|
24341
24358
|
|
|
24342
24359
|
// src/components/dataform-layouts/validation-badge.tsx
|
|
24343
24360
|
import { sprintf as sprintf18, _n as _n4 } from "@wordpress/i18n";
|
|
24344
|
-
import { jsx as
|
|
24361
|
+
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
24345
24362
|
function countInvalidFields(validity) {
|
|
24346
24363
|
if (!validity) {
|
|
24347
24364
|
return 0;
|
|
@@ -24370,7 +24387,7 @@ function ValidationBadge({
|
|
|
24370
24387
|
if (invalidCount === 0) {
|
|
24371
24388
|
return null;
|
|
24372
24389
|
}
|
|
24373
|
-
return /* @__PURE__ */
|
|
24390
|
+
return /* @__PURE__ */ jsx109(Badge, { intent: "high", children: sprintf18(
|
|
24374
24391
|
/* translators: %d: Number of fields that need attention */
|
|
24375
24392
|
_n4(
|
|
24376
24393
|
"%d field needs attention",
|
|
@@ -24382,7 +24399,7 @@ function ValidationBadge({
|
|
|
24382
24399
|
}
|
|
24383
24400
|
|
|
24384
24401
|
// src/components/dataform-layouts/card/index.tsx
|
|
24385
|
-
import { Fragment as
|
|
24402
|
+
import { Fragment as Fragment18, jsx as jsx110, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
24386
24403
|
function isSummaryFieldVisible(summaryField, summaryConfig, isOpen) {
|
|
24387
24404
|
if (!summaryConfig || Array.isArray(summaryConfig) && summaryConfig.length === 0) {
|
|
24388
24405
|
return false;
|
|
@@ -24452,7 +24469,7 @@ function FormCardField({
|
|
|
24452
24469
|
const visibleSummaryFields = summaryFields.filter(
|
|
24453
24470
|
(summaryField) => isSummaryFieldVisible(summaryField, layout.summary, isOpen)
|
|
24454
24471
|
);
|
|
24455
|
-
const validationBadge = touched && layout.isCollapsible ? /* @__PURE__ */
|
|
24472
|
+
const validationBadge = touched && layout.isCollapsible ? /* @__PURE__ */ jsx110(ValidationBadge, { validity }) : null;
|
|
24456
24473
|
const sizeCard = {
|
|
24457
24474
|
blockStart: "medium",
|
|
24458
24475
|
blockEnd: "medium",
|
|
@@ -24464,9 +24481,9 @@ function FormCardField({
|
|
|
24464
24481
|
let bodyContent;
|
|
24465
24482
|
if (field.children) {
|
|
24466
24483
|
withHeader = !!label && layout.withHeader;
|
|
24467
|
-
bodyContent = /* @__PURE__ */
|
|
24468
|
-
field.description && /* @__PURE__ */
|
|
24469
|
-
/* @__PURE__ */
|
|
24484
|
+
bodyContent = /* @__PURE__ */ jsxs37(Fragment18, { children: [
|
|
24485
|
+
field.description && /* @__PURE__ */ jsx110("div", { className: "dataforms-layouts-card__field-description", children: field.description }),
|
|
24486
|
+
/* @__PURE__ */ jsx110(
|
|
24470
24487
|
DataFormLayout,
|
|
24471
24488
|
{
|
|
24472
24489
|
data,
|
|
@@ -24489,7 +24506,7 @@ function FormCardField({
|
|
|
24489
24506
|
}
|
|
24490
24507
|
label = fieldDefinition.label;
|
|
24491
24508
|
withHeader = !!label && layout.withHeader;
|
|
24492
|
-
bodyContent = /* @__PURE__ */
|
|
24509
|
+
bodyContent = /* @__PURE__ */ jsx110(
|
|
24493
24510
|
SingleFieldLayout,
|
|
24494
24511
|
{
|
|
24495
24512
|
data,
|
|
@@ -24507,8 +24524,8 @@ function FormCardField({
|
|
|
24507
24524
|
inlineStart: "medium",
|
|
24508
24525
|
inlineEnd: "medium"
|
|
24509
24526
|
};
|
|
24510
|
-
return /* @__PURE__ */
|
|
24511
|
-
withHeader && /* @__PURE__ */
|
|
24527
|
+
return /* @__PURE__ */ jsxs37(component_default18, { className: "dataforms-layouts-card__field", size: sizeCard, children: [
|
|
24528
|
+
withHeader && /* @__PURE__ */ jsxs37(
|
|
24512
24529
|
component_default21,
|
|
24513
24530
|
{
|
|
24514
24531
|
className: "dataforms-layouts-card__field-header",
|
|
@@ -24518,7 +24535,7 @@ function FormCardField({
|
|
|
24518
24535
|
},
|
|
24519
24536
|
isBorderless: true,
|
|
24520
24537
|
children: [
|
|
24521
|
-
/* @__PURE__ */
|
|
24538
|
+
/* @__PURE__ */ jsxs37(
|
|
24522
24539
|
"div",
|
|
24523
24540
|
{
|
|
24524
24541
|
style: {
|
|
@@ -24531,7 +24548,7 @@ function FormCardField({
|
|
|
24531
24548
|
alignItems: "center"
|
|
24532
24549
|
},
|
|
24533
24550
|
children: [
|
|
24534
|
-
/* @__PURE__ */
|
|
24551
|
+
/* @__PURE__ */ jsx110(
|
|
24535
24552
|
"span",
|
|
24536
24553
|
{
|
|
24537
24554
|
id: titleId,
|
|
@@ -24540,8 +24557,8 @@ function FormCardField({
|
|
|
24540
24557
|
}
|
|
24541
24558
|
),
|
|
24542
24559
|
validationBadge,
|
|
24543
|
-
visibleSummaryFields.length > 0 && layout.withHeader && /* @__PURE__ */
|
|
24544
|
-
(summaryField) => /* @__PURE__ */
|
|
24560
|
+
visibleSummaryFields.length > 0 && layout.withHeader && /* @__PURE__ */ jsx110("div", { className: "dataforms-layouts-card__field-summary", children: visibleSummaryFields.map(
|
|
24561
|
+
(summaryField) => /* @__PURE__ */ jsx110(
|
|
24545
24562
|
summaryField.render,
|
|
24546
24563
|
{
|
|
24547
24564
|
item: data,
|
|
@@ -24553,7 +24570,7 @@ function FormCardField({
|
|
|
24553
24570
|
]
|
|
24554
24571
|
}
|
|
24555
24572
|
),
|
|
24556
|
-
isCollapsible && /* @__PURE__ */
|
|
24573
|
+
isCollapsible && /* @__PURE__ */ jsx110(
|
|
24557
24574
|
button_default,
|
|
24558
24575
|
{
|
|
24559
24576
|
__next40pxDefaultSize: true,
|
|
@@ -24569,7 +24586,7 @@ function FormCardField({
|
|
|
24569
24586
|
),
|
|
24570
24587
|
(isOpen || !withHeader) && // If it doesn't have a header, keep it open.
|
|
24571
24588
|
// Otherwise, the card will not be visible.
|
|
24572
|
-
/* @__PURE__ */
|
|
24589
|
+
/* @__PURE__ */ jsx110(
|
|
24573
24590
|
component_default20,
|
|
24574
24591
|
{
|
|
24575
24592
|
id: bodyId,
|
|
@@ -24584,19 +24601,19 @@ function FormCardField({
|
|
|
24584
24601
|
}
|
|
24585
24602
|
|
|
24586
24603
|
// src/components/dataform-layouts/row/index.tsx
|
|
24587
|
-
import { Fragment as
|
|
24604
|
+
import { Fragment as Fragment19, jsx as jsx111, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
24588
24605
|
function Header3({ title }) {
|
|
24589
|
-
return /* @__PURE__ */
|
|
24606
|
+
return /* @__PURE__ */ jsx111(
|
|
24590
24607
|
Stack,
|
|
24591
24608
|
{
|
|
24592
24609
|
direction: "column",
|
|
24593
24610
|
className: "dataforms-layouts-row__header",
|
|
24594
24611
|
gap: "lg",
|
|
24595
|
-
children: /* @__PURE__ */
|
|
24612
|
+
children: /* @__PURE__ */ jsx111(Stack, { direction: "row", align: "center", children: /* @__PURE__ */ jsx111(component_default16, { level: 2, size: 13, children: title }) })
|
|
24596
24613
|
}
|
|
24597
24614
|
);
|
|
24598
24615
|
}
|
|
24599
|
-
var EMPTY_WRAPPER = ({ children }) => /* @__PURE__ */
|
|
24616
|
+
var EMPTY_WRAPPER = ({ children }) => /* @__PURE__ */ jsx111(Fragment19, { children });
|
|
24600
24617
|
function FormRowField({
|
|
24601
24618
|
data,
|
|
24602
24619
|
field,
|
|
@@ -24611,9 +24628,9 @@ function FormRowField({
|
|
|
24611
24628
|
layout: DEFAULT_LAYOUT,
|
|
24612
24629
|
fields: field.children
|
|
24613
24630
|
};
|
|
24614
|
-
return /* @__PURE__ */
|
|
24615
|
-
!hideLabelFromVision && field.label && /* @__PURE__ */
|
|
24616
|
-
/* @__PURE__ */
|
|
24631
|
+
return /* @__PURE__ */ jsxs38("div", { className: "dataforms-layouts-row__field", children: [
|
|
24632
|
+
!hideLabelFromVision && field.label && /* @__PURE__ */ jsx111(Header3, { title: field.label }),
|
|
24633
|
+
/* @__PURE__ */ jsx111(Stack, { direction: "row", align: layout.alignment, gap: "lg", children: /* @__PURE__ */ jsx111(
|
|
24617
24634
|
DataFormLayout,
|
|
24618
24635
|
{
|
|
24619
24636
|
data,
|
|
@@ -24621,12 +24638,12 @@ function FormRowField({
|
|
|
24621
24638
|
onChange,
|
|
24622
24639
|
validity: validity?.children,
|
|
24623
24640
|
as: EMPTY_WRAPPER,
|
|
24624
|
-
children: (FieldLayout, childField, childFieldValidity) => /* @__PURE__ */
|
|
24641
|
+
children: (FieldLayout, childField, childFieldValidity) => /* @__PURE__ */ jsx111(
|
|
24625
24642
|
"div",
|
|
24626
24643
|
{
|
|
24627
24644
|
className: "dataforms-layouts-row__field-control",
|
|
24628
24645
|
style: layout.styles[childField.id],
|
|
24629
|
-
children: /* @__PURE__ */
|
|
24646
|
+
children: /* @__PURE__ */ jsx111(
|
|
24630
24647
|
FieldLayout,
|
|
24631
24648
|
{
|
|
24632
24649
|
data,
|
|
@@ -24648,7 +24665,7 @@ function FormRowField({
|
|
|
24648
24665
|
if (!RegularLayout) {
|
|
24649
24666
|
return null;
|
|
24650
24667
|
}
|
|
24651
|
-
return /* @__PURE__ */
|
|
24668
|
+
return /* @__PURE__ */ jsx111(Fragment19, { children: /* @__PURE__ */ jsx111("div", { className: "dataforms-layouts-row__field-control", children: /* @__PURE__ */ jsx111(
|
|
24652
24669
|
RegularLayout,
|
|
24653
24670
|
{
|
|
24654
24671
|
data,
|
|
@@ -24662,7 +24679,7 @@ function FormRowField({
|
|
|
24662
24679
|
|
|
24663
24680
|
// src/components/dataform-layouts/details/index.tsx
|
|
24664
24681
|
import { __ as __61 } from "@wordpress/i18n";
|
|
24665
|
-
import { jsx as
|
|
24682
|
+
import { jsx as jsx112, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
24666
24683
|
function FormDetailsField({
|
|
24667
24684
|
data,
|
|
24668
24685
|
field,
|
|
@@ -24709,17 +24726,17 @@ function FormDetailsField({
|
|
|
24709
24726
|
const summaryField = summaryFieldId ? fields.find((fieldDef) => fieldDef.id === summaryFieldId) : void 0;
|
|
24710
24727
|
let summaryContent;
|
|
24711
24728
|
if (summaryField && summaryField.render) {
|
|
24712
|
-
summaryContent = /* @__PURE__ */
|
|
24729
|
+
summaryContent = /* @__PURE__ */ jsx112(summaryField.render, { item: data, field: summaryField });
|
|
24713
24730
|
} else {
|
|
24714
24731
|
summaryContent = field.label || __61("More details");
|
|
24715
24732
|
}
|
|
24716
|
-
return /* @__PURE__ */
|
|
24733
|
+
return /* @__PURE__ */ jsxs39(
|
|
24717
24734
|
"details",
|
|
24718
24735
|
{
|
|
24719
24736
|
ref: detailsRef,
|
|
24720
24737
|
className: "dataforms-layouts-details__details",
|
|
24721
24738
|
children: [
|
|
24722
|
-
/* @__PURE__ */
|
|
24739
|
+
/* @__PURE__ */ jsx112("summary", { className: "dataforms-layouts-details__summary", children: /* @__PURE__ */ jsxs39(
|
|
24723
24740
|
Stack,
|
|
24724
24741
|
{
|
|
24725
24742
|
direction: "row",
|
|
@@ -24728,17 +24745,17 @@ function FormDetailsField({
|
|
|
24728
24745
|
className: "dataforms-layouts-details__summary-content",
|
|
24729
24746
|
children: [
|
|
24730
24747
|
summaryContent,
|
|
24731
|
-
touched && /* @__PURE__ */
|
|
24748
|
+
touched && /* @__PURE__ */ jsx112(ValidationBadge, { validity })
|
|
24732
24749
|
]
|
|
24733
24750
|
}
|
|
24734
24751
|
) }),
|
|
24735
|
-
/* @__PURE__ */
|
|
24752
|
+
/* @__PURE__ */ jsx112(
|
|
24736
24753
|
"div",
|
|
24737
24754
|
{
|
|
24738
24755
|
ref: contentRef,
|
|
24739
24756
|
className: "dataforms-layouts-details__content",
|
|
24740
24757
|
onBlur: handleBlur,
|
|
24741
|
-
children: /* @__PURE__ */
|
|
24758
|
+
children: /* @__PURE__ */ jsx112(
|
|
24742
24759
|
DataFormLayout,
|
|
24743
24760
|
{
|
|
24744
24761
|
data,
|
|
@@ -24755,12 +24772,12 @@ function FormDetailsField({
|
|
|
24755
24772
|
}
|
|
24756
24773
|
|
|
24757
24774
|
// src/components/dataform-layouts/index.tsx
|
|
24758
|
-
import { jsx as
|
|
24775
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
24759
24776
|
var FORM_FIELD_LAYOUTS = [
|
|
24760
24777
|
{
|
|
24761
24778
|
type: "regular",
|
|
24762
24779
|
component: FormRegularField,
|
|
24763
|
-
wrapper: ({ children }) => /* @__PURE__ */
|
|
24780
|
+
wrapper: ({ children }) => /* @__PURE__ */ jsx113(
|
|
24764
24781
|
Stack,
|
|
24765
24782
|
{
|
|
24766
24783
|
direction: "column",
|
|
@@ -24773,7 +24790,7 @@ var FORM_FIELD_LAYOUTS = [
|
|
|
24773
24790
|
{
|
|
24774
24791
|
type: "panel",
|
|
24775
24792
|
component: FormPanelField,
|
|
24776
|
-
wrapper: ({ children }) => /* @__PURE__ */
|
|
24793
|
+
wrapper: ({ children }) => /* @__PURE__ */ jsx113(
|
|
24777
24794
|
Stack,
|
|
24778
24795
|
{
|
|
24779
24796
|
direction: "column",
|
|
@@ -24786,7 +24803,7 @@ var FORM_FIELD_LAYOUTS = [
|
|
|
24786
24803
|
{
|
|
24787
24804
|
type: "card",
|
|
24788
24805
|
component: FormCardField,
|
|
24789
|
-
wrapper: ({ children }) => /* @__PURE__ */
|
|
24806
|
+
wrapper: ({ children }) => /* @__PURE__ */ jsx113(
|
|
24790
24807
|
Stack,
|
|
24791
24808
|
{
|
|
24792
24809
|
direction: "column",
|
|
@@ -24802,13 +24819,13 @@ var FORM_FIELD_LAYOUTS = [
|
|
|
24802
24819
|
wrapper: ({
|
|
24803
24820
|
children,
|
|
24804
24821
|
layout
|
|
24805
|
-
}) => /* @__PURE__ */
|
|
24822
|
+
}) => /* @__PURE__ */ jsx113(
|
|
24806
24823
|
Stack,
|
|
24807
24824
|
{
|
|
24808
24825
|
direction: "column",
|
|
24809
24826
|
className: "dataforms-layouts__wrapper",
|
|
24810
24827
|
gap: "lg",
|
|
24811
|
-
children: /* @__PURE__ */
|
|
24828
|
+
children: /* @__PURE__ */ jsx113("div", { className: "dataforms-layouts-row__field", children: /* @__PURE__ */ jsx113(
|
|
24812
24829
|
Stack,
|
|
24813
24830
|
{
|
|
24814
24831
|
direction: "row",
|
|
@@ -24830,8 +24847,8 @@ function getFormFieldLayout(type) {
|
|
|
24830
24847
|
}
|
|
24831
24848
|
|
|
24832
24849
|
// src/components/dataform-layouts/data-form-layout.tsx
|
|
24833
|
-
import { jsx as
|
|
24834
|
-
var DEFAULT_WRAPPER = ({ children }) => /* @__PURE__ */
|
|
24850
|
+
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
24851
|
+
var DEFAULT_WRAPPER = ({ children }) => /* @__PURE__ */ jsx114(Stack, { direction: "column", className: "dataforms-layouts__wrapper", gap: "lg", children });
|
|
24835
24852
|
function DataFormLayout({
|
|
24836
24853
|
data,
|
|
24837
24854
|
form,
|
|
@@ -24854,7 +24871,7 @@ function DataFormLayout({
|
|
|
24854
24871
|
);
|
|
24855
24872
|
}
|
|
24856
24873
|
const Wrapper4 = as ?? getFormFieldLayout(form.layout.type)?.wrapper ?? DEFAULT_WRAPPER;
|
|
24857
|
-
return /* @__PURE__ */
|
|
24874
|
+
return /* @__PURE__ */ jsx114(Wrapper4, { layout: form.layout, children: form.fields.map((formField) => {
|
|
24858
24875
|
const FieldLayout = getFormFieldLayout(formField.layout.type)?.component;
|
|
24859
24876
|
if (!FieldLayout) {
|
|
24860
24877
|
return null;
|
|
@@ -24871,7 +24888,7 @@ function DataFormLayout({
|
|
|
24871
24888
|
markWhenOptional
|
|
24872
24889
|
);
|
|
24873
24890
|
}
|
|
24874
|
-
return /* @__PURE__ */
|
|
24891
|
+
return /* @__PURE__ */ jsx114(
|
|
24875
24892
|
FieldLayout,
|
|
24876
24893
|
{
|
|
24877
24894
|
data,
|
|
@@ -24886,7 +24903,7 @@ function DataFormLayout({
|
|
|
24886
24903
|
}
|
|
24887
24904
|
|
|
24888
24905
|
// src/dataform/index.tsx
|
|
24889
|
-
import { jsx as
|
|
24906
|
+
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
24890
24907
|
function DataForm({
|
|
24891
24908
|
data,
|
|
24892
24909
|
form,
|
|
@@ -24902,7 +24919,7 @@ function DataForm({
|
|
|
24902
24919
|
if (!form.fields) {
|
|
24903
24920
|
return null;
|
|
24904
24921
|
}
|
|
24905
|
-
return /* @__PURE__ */
|
|
24922
|
+
return /* @__PURE__ */ jsx115(DataFormProvider, { fields: normalizedFields, children: /* @__PURE__ */ jsx115(
|
|
24906
24923
|
DataFormLayout,
|
|
24907
24924
|
{
|
|
24908
24925
|
data,
|