@wordpress/dataviews 15.0.0 → 16.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/build/components/dataform-controls/datetime.cjs.map +2 -2
- package/build/components/dataviews-context/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/index.cjs +9 -0
- package/build/components/dataviews-layouts/index.cjs.map +3 -3
- package/build/components/dataviews-layouts/picker-activity/index.cjs +304 -0
- package/build/components/dataviews-layouts/picker-activity/index.cjs.map +7 -0
- package/build/components/dataviews-layouts/table/use-scroll-state.cjs.map +1 -1
- package/build/components/dataviews-layouts/utils/item-click-wrapper.cjs.map +2 -2
- package/build/components/dataviews-view-config/index.cjs +1 -0
- package/build/components/dataviews-view-config/index.cjs.map +2 -2
- package/build/constants.cjs +3 -0
- package/build/constants.cjs.map +2 -2
- package/build/hooks/use-form-validity.cjs.map +1 -1
- package/build/types/dataviews.cjs.map +1 -1
- package/build-module/components/dataform-controls/datetime.mjs.map +2 -2
- package/build-module/components/dataviews-context/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/index.mjs +11 -1
- package/build-module/components/dataviews-layouts/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/picker-activity/index.mjs +273 -0
- package/build-module/components/dataviews-layouts/picker-activity/index.mjs.map +7 -0
- package/build-module/components/dataviews-layouts/table/use-scroll-state.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/utils/item-click-wrapper.mjs.map +2 -2
- package/build-module/components/dataviews-view-config/index.mjs +1 -0
- package/build-module/components/dataviews-view-config/index.mjs.map +2 -2
- package/build-module/constants.mjs +2 -0
- package/build-module/constants.mjs.map +2 -2
- package/build-module/hooks/use-form-validity.mjs.map +1 -1
- package/build-style/style-rtl.css +199 -13
- package/build-style/style.css +199 -13
- package/build-types/components/dataviews-context/index.d.ts +2 -2
- package/build-types/components/dataviews-context/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/index.d.ts +8 -0
- package/build-types/components/dataviews-layouts/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/picker-activity/index.d.ts +3 -0
- package/build-types/components/dataviews-layouts/picker-activity/index.d.ts.map +1 -0
- package/build-types/components/dataviews-layouts/table/use-scroll-state.d.ts +5 -9
- package/build-types/components/dataviews-layouts/table/use-scroll-state.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/utils/item-click-wrapper.d.ts.map +1 -1
- package/build-types/components/dataviews-view-config/index.d.ts.map +1 -1
- package/build-types/constants.d.ts +1 -0
- package/build-types/constants.d.ts.map +1 -1
- package/build-types/dataform/stories/index.story.d.ts +1 -0
- package/build-types/dataform/stories/index.story.d.ts.map +1 -1
- package/build-types/dataviews/stories/index.story.d.ts.map +1 -1
- package/build-types/dataviews-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/types/dataviews.d.ts +16 -2
- package/build-types/types/dataviews.d.ts.map +1 -1
- package/build-wp/index.js +1088 -820
- package/package.json +24 -21
- package/src/components/dataform-controls/datetime.tsx +1 -1
- package/src/components/dataviews-context/index.ts +4 -2
- package/src/components/dataviews-layouts/index.ts +10 -0
- package/src/components/dataviews-layouts/picker-activity/index.tsx +359 -0
- package/src/components/dataviews-layouts/picker-activity/style.scss +227 -0
- package/src/components/dataviews-layouts/table/use-scroll-state.ts +6 -6
- package/src/components/dataviews-layouts/utils/item-click-wrapper.tsx +1 -3
- package/src/components/dataviews-view-config/index.tsx +1 -0
- package/src/constants.ts +1 -0
- package/src/dataform/stories/content.story.tsx +1 -1
- package/src/dataform/stories/index.story.tsx +1 -0
- package/src/dataviews/stories/index.story.tsx +1 -0
- package/src/dataviews-picker/stories/index.story.tsx +6 -0
- package/src/dataviews-picker/test/dataviews-picker.tsx +5 -0
- package/src/hooks/use-form-validity.ts +2 -2
- package/src/style.scss +1 -0
- package/src/types/dataviews.ts +21 -1
package/build-wp/index.js
CHANGED
|
@@ -5,11 +5,10 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/dataviews/index.tsx
|
|
8
|
-
import
|
|
8
|
+
import clsx53 from "clsx";
|
|
9
9
|
|
|
10
10
|
// ../element/build-module/react.mjs
|
|
11
11
|
import {
|
|
12
|
-
Activity,
|
|
13
12
|
Children,
|
|
14
13
|
cloneElement,
|
|
15
14
|
Component,
|
|
@@ -22,20 +21,16 @@ import {
|
|
|
22
21
|
memo,
|
|
23
22
|
PureComponent,
|
|
24
23
|
StrictMode,
|
|
25
|
-
use,
|
|
26
|
-
useActionState,
|
|
27
24
|
useCallback,
|
|
28
25
|
useContext,
|
|
29
26
|
useDebugValue,
|
|
30
27
|
useDeferredValue,
|
|
31
28
|
useEffect,
|
|
32
|
-
useEffectEvent,
|
|
33
29
|
useId,
|
|
34
30
|
useMemo,
|
|
35
31
|
useImperativeHandle,
|
|
36
32
|
useInsertionEffect,
|
|
37
33
|
useLayoutEffect,
|
|
38
|
-
useOptimistic,
|
|
39
34
|
useReducer,
|
|
40
35
|
useRef,
|
|
41
36
|
useState,
|
|
@@ -212,14 +207,11 @@ var create_interpolate_element_default = createInterpolateElement;
|
|
|
212
207
|
// ../element/build-module/react-platform.mjs
|
|
213
208
|
import {
|
|
214
209
|
createPortal,
|
|
210
|
+
findDOMNode,
|
|
215
211
|
flushSync,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
preinitModule,
|
|
220
|
-
preload,
|
|
221
|
-
preloadModule,
|
|
222
|
-
useFormStatus
|
|
212
|
+
render,
|
|
213
|
+
hydrate,
|
|
214
|
+
unmountComponentAtNode
|
|
223
215
|
} from "react-dom";
|
|
224
216
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
225
217
|
|
|
@@ -234,26 +226,6 @@ var isEmptyElement = (element) => {
|
|
|
234
226
|
return !element;
|
|
235
227
|
};
|
|
236
228
|
|
|
237
|
-
// ../deprecated/build-module/index.mjs
|
|
238
|
-
import { doAction } from "@wordpress/hooks";
|
|
239
|
-
var logged = /* @__PURE__ */ Object.create(null);
|
|
240
|
-
function deprecated(feature, options2 = {}) {
|
|
241
|
-
const { since, version, alternative, plugin, link, hint } = options2;
|
|
242
|
-
const pluginMessage = plugin ? ` from ${plugin}` : "";
|
|
243
|
-
const sinceMessage = since ? ` since version ${since}` : "";
|
|
244
|
-
const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : "";
|
|
245
|
-
const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : "";
|
|
246
|
-
const linkMessage = link ? ` See: ${link}` : "";
|
|
247
|
-
const hintMessage = hint ? ` Note: ${hint}` : "";
|
|
248
|
-
const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`;
|
|
249
|
-
if (message in logged) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
doAction("deprecated", feature, options2, message);
|
|
253
|
-
console.warn(message);
|
|
254
|
-
logged[message] = true;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
229
|
// ../compose/build-module/utils/create-higher-order-component/index.mjs
|
|
258
230
|
import { pascalCase } from "change-case";
|
|
259
231
|
function createHigherOrderComponent(mapComponent, modifierName) {
|
|
@@ -471,6 +443,7 @@ var CORE_MODULES_USING_PRIVATE_APIS = [
|
|
|
471
443
|
"@wordpress/route",
|
|
472
444
|
"@wordpress/router",
|
|
473
445
|
"@wordpress/routes",
|
|
446
|
+
"@wordpress/storybook",
|
|
474
447
|
"@wordpress/sync",
|
|
475
448
|
"@wordpress/theme",
|
|
476
449
|
"@wordpress/dataviews",
|
|
@@ -582,6 +555,26 @@ function isShallowEqual(a, b) {
|
|
|
582
555
|
return a === b;
|
|
583
556
|
}
|
|
584
557
|
|
|
558
|
+
// ../deprecated/build-module/index.mjs
|
|
559
|
+
import { doAction } from "@wordpress/hooks";
|
|
560
|
+
var logged = /* @__PURE__ */ Object.create(null);
|
|
561
|
+
function deprecated(feature, options2 = {}) {
|
|
562
|
+
const { since, version, alternative, plugin, link, hint } = options2;
|
|
563
|
+
const pluginMessage = plugin ? ` from ${plugin}` : "";
|
|
564
|
+
const sinceMessage = since ? ` since version ${since}` : "";
|
|
565
|
+
const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : "";
|
|
566
|
+
const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : "";
|
|
567
|
+
const linkMessage = link ? ` See: ${link}` : "";
|
|
568
|
+
const hintMessage = hint ? ` Note: ${hint}` : "";
|
|
569
|
+
const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`;
|
|
570
|
+
if (message in logged) {
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
doAction("deprecated", feature, options2, message);
|
|
574
|
+
console.warn(message);
|
|
575
|
+
logged[message] = true;
|
|
576
|
+
}
|
|
577
|
+
|
|
585
578
|
// ../compose/build-module/hooks/use-instance-id/index.mjs
|
|
586
579
|
var instanceMap = /* @__PURE__ */ new WeakMap();
|
|
587
580
|
function createId(object) {
|
|
@@ -1054,25 +1047,40 @@ function useFocusOutside(onFocusOutside) {
|
|
|
1054
1047
|
// ../compose/build-module/hooks/use-merge-refs/index.mjs
|
|
1055
1048
|
function assignRef(ref, value) {
|
|
1056
1049
|
if (typeof ref === "function") {
|
|
1057
|
-
ref(value);
|
|
1050
|
+
const returned = ref(value);
|
|
1051
|
+
return typeof returned === "function" ? returned : void 0;
|
|
1058
1052
|
} else if (ref && ref.hasOwnProperty("current")) {
|
|
1059
1053
|
ref.current = value;
|
|
1060
1054
|
}
|
|
1055
|
+
return void 0;
|
|
1056
|
+
}
|
|
1057
|
+
function detachRef(ref, index, cleanups) {
|
|
1058
|
+
const cleanup = cleanups[index];
|
|
1059
|
+
if (cleanup) {
|
|
1060
|
+
cleanups[index] = void 0;
|
|
1061
|
+
cleanup();
|
|
1062
|
+
} else {
|
|
1063
|
+
assignRef(ref, null);
|
|
1064
|
+
}
|
|
1061
1065
|
}
|
|
1062
1066
|
function useMergeRefs(refs) {
|
|
1063
|
-
const
|
|
1067
|
+
const elementRef = useRef(null);
|
|
1064
1068
|
const isAttachedRef = useRef(false);
|
|
1065
1069
|
const didElementChangeRef = useRef(false);
|
|
1066
1070
|
const previousRefsRef = useRef([]);
|
|
1067
1071
|
const currentRefsRef = useRef(refs);
|
|
1072
|
+
const cleanupsRef = useRef([]);
|
|
1068
1073
|
currentRefsRef.current = refs;
|
|
1069
1074
|
useLayoutEffect(() => {
|
|
1070
1075
|
if (didElementChangeRef.current === false && isAttachedRef.current === true) {
|
|
1071
1076
|
refs.forEach((ref, index) => {
|
|
1072
1077
|
const previousRef = previousRefsRef.current[index];
|
|
1073
1078
|
if (ref !== previousRef) {
|
|
1074
|
-
|
|
1075
|
-
assignRef(
|
|
1079
|
+
detachRef(previousRef, index, cleanupsRef.current);
|
|
1080
|
+
cleanupsRef.current[index] = assignRef(
|
|
1081
|
+
ref,
|
|
1082
|
+
elementRef.current
|
|
1083
|
+
);
|
|
1076
1084
|
}
|
|
1077
1085
|
});
|
|
1078
1086
|
}
|
|
@@ -1082,12 +1090,17 @@ function useMergeRefs(refs) {
|
|
|
1082
1090
|
didElementChangeRef.current = false;
|
|
1083
1091
|
});
|
|
1084
1092
|
return useCallback((value) => {
|
|
1085
|
-
|
|
1093
|
+
elementRef.current = value;
|
|
1086
1094
|
didElementChangeRef.current = true;
|
|
1087
1095
|
isAttachedRef.current = value !== null;
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1096
|
+
if (value === null) {
|
|
1097
|
+
previousRefsRef.current.forEach((ref, index) => {
|
|
1098
|
+
detachRef(ref, index, cleanupsRef.current);
|
|
1099
|
+
});
|
|
1100
|
+
} else {
|
|
1101
|
+
currentRefsRef.current.forEach((ref, index) => {
|
|
1102
|
+
cleanupsRef.current[index] = assignRef(ref, value);
|
|
1103
|
+
});
|
|
1091
1104
|
}
|
|
1092
1105
|
}, []);
|
|
1093
1106
|
}
|
|
@@ -1171,7 +1184,7 @@ var EMPTY_SUBSCRIBER = {
|
|
|
1171
1184
|
getValue: () => false
|
|
1172
1185
|
};
|
|
1173
1186
|
function getMQLSubscriber(view, query) {
|
|
1174
|
-
if (!query || typeof view
|
|
1187
|
+
if (!view || !query || typeof view.matchMedia !== "function") {
|
|
1175
1188
|
return EMPTY_SUBSCRIBER;
|
|
1176
1189
|
}
|
|
1177
1190
|
let queryCache = perWindowCache.get(view);
|
|
@@ -1210,7 +1223,7 @@ function getMQLSubscriber(view, query) {
|
|
|
1210
1223
|
queryCache.set(query, subscriber);
|
|
1211
1224
|
return subscriber;
|
|
1212
1225
|
}
|
|
1213
|
-
function useMediaQuery(query, view = window) {
|
|
1226
|
+
function useMediaQuery(query, view = typeof window !== "undefined" ? window : void 0) {
|
|
1214
1227
|
const source = getMQLSubscriber(view, query);
|
|
1215
1228
|
return useSyncExternalStore(
|
|
1216
1229
|
source.subscribe,
|
|
@@ -1256,7 +1269,7 @@ var ViewportMatchWidthContext = createContext(
|
|
|
1256
1269
|
null
|
|
1257
1270
|
);
|
|
1258
1271
|
ViewportMatchWidthContext.displayName = "ViewportMatchWidthContext";
|
|
1259
|
-
var useViewportMatch = (breakpoint2, operator = ">=", view = window) => {
|
|
1272
|
+
var useViewportMatch = (breakpoint2, operator = ">=", view = typeof window !== "undefined" ? window : void 0) => {
|
|
1260
1273
|
const simulatedWidth = useContext(ViewportMatchWidthContext);
|
|
1261
1274
|
const mediaQuery = !simulatedWidth && `(${CONDITIONS[operator]}: ${BREAKPOINTS[breakpoint2]}px)`;
|
|
1262
1275
|
const mediaQueryResult = useMediaQuery(mediaQuery || void 0, view);
|
|
@@ -1476,16 +1489,16 @@ function registerStyle(hash, css27) {
|
|
|
1476
1489
|
}
|
|
1477
1490
|
}
|
|
1478
1491
|
if (typeof process === "undefined" || true) {
|
|
1479
|
-
registerStyle("
|
|
1492
|
+
registerStyle("0c5702ddca", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
|
|
1480
1493
|
}
|
|
1481
1494
|
var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" };
|
|
1482
1495
|
if (typeof process === "undefined" || true) {
|
|
1483
|
-
registerStyle("
|
|
1496
|
+
registerStyle("d5c1b736fd", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}");
|
|
1484
1497
|
}
|
|
1485
1498
|
var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a" };
|
|
1486
|
-
var Text = forwardRef(function Text2({ variant = "body-md", render:
|
|
1499
|
+
var Text = forwardRef(function Text2({ variant = "body-md", render: render5, className: className2, ...props }, ref) {
|
|
1487
1500
|
const element = useRender({
|
|
1488
|
-
render:
|
|
1501
|
+
render: render5,
|
|
1489
1502
|
defaultTagName: "span",
|
|
1490
1503
|
ref,
|
|
1491
1504
|
props: mergeProps(props, {
|
|
@@ -1584,7 +1597,7 @@ function registerStyle2(hash, css27) {
|
|
|
1584
1597
|
}
|
|
1585
1598
|
}
|
|
1586
1599
|
if (typeof process === "undefined" || true) {
|
|
1587
|
-
registerStyle2("
|
|
1600
|
+
registerStyle2("9d817a6077", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);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,#fde6be);color:var(--wpds-color-fg-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution,#fee995);color:var(--wpds-color-fg-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success,#c6f7cd);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,#f4f4f4);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,#dbdbdb);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))}}}");
|
|
1588
1601
|
}
|
|
1589
1602
|
var style_default2 = { "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" };
|
|
1590
1603
|
var Badge = forwardRef(function Badge2({ intent = "none", className: className2, ...props }, ref) {
|
|
@@ -1849,18 +1862,18 @@ function registerStyle3(hash, css27) {
|
|
|
1849
1862
|
}
|
|
1850
1863
|
}
|
|
1851
1864
|
if (typeof process === "undefined" || true) {
|
|
1852
|
-
registerStyle3("
|
|
1865
|
+
registerStyle3("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
|
|
1853
1866
|
}
|
|
1854
1867
|
var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
|
|
1855
1868
|
if (typeof process === "undefined" || true) {
|
|
1856
|
-
registerStyle3("
|
|
1869
|
+
registerStyle3("66ab1fd35b", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._02872bf298eadc43__root{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);--wp-ui-card-header-content-gap:var(--wpds-dimension-gap-xl,24px);--wp-ui-card-header-content-margin:calc(var(--wp-ui-card-header-content-gap) - var(--wp-ui-card-padding));background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:var(--wpds-border-radius-lg,8px);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:column;overflow:clip}._5dffdaf2a6e669ac__content,.bbccc92e6ba5662d__header{padding:var(--wp-ui-card-padding);&:not(:first-child):not(:last-child){padding-block-end:0}}.bbccc92e6ba5662d__header+._5dffdaf2a6e669ac__content{margin-block-start:var(--wp-ui-card-header-content-margin);padding-block-start:0}.c1fa192587e1b4a6__fullbleed{margin-inline:calc(var(--wp-ui-card-padding)*-1);width:calc(100% + var(--wp-ui-card-padding)*2)}._02872bf298eadc43__root>:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):first-child>.c1fa192587e1b4a6__fullbleed:first-child{margin-block-start:calc(var(--wp-ui-card-padding)*-1)}:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):last-child>.c1fa192587e1b4a6__fullbleed:last-child{margin-block-end:calc(var(--wp-ui-card-padding)*-1)}}}");
|
|
1857
1870
|
}
|
|
1858
1871
|
var style_default3 = { "root": "_02872bf298eadc43__root", "header": "bbccc92e6ba5662d__header", "content": "_5dffdaf2a6e669ac__content", "fullbleed": "c1fa192587e1b4a6__fullbleed" };
|
|
1859
|
-
var Root = forwardRef(function Card({ render:
|
|
1872
|
+
var Root = forwardRef(function Card({ render: render5, ...restProps }, ref) {
|
|
1860
1873
|
const mergedClassName = clsx4(style_default3.root, resets_default["box-sizing"]);
|
|
1861
1874
|
const element = useRender2({
|
|
1862
1875
|
defaultTagName: "div",
|
|
1863
|
-
render:
|
|
1876
|
+
render: render5,
|
|
1864
1877
|
ref,
|
|
1865
1878
|
props: mergeProps2({ className: mergedClassName }, restProps)
|
|
1866
1879
|
});
|
|
@@ -1950,14 +1963,14 @@ function registerStyle4(hash, css27) {
|
|
|
1950
1963
|
}
|
|
1951
1964
|
}
|
|
1952
1965
|
if (typeof process === "undefined" || true) {
|
|
1953
|
-
registerStyle4("
|
|
1966
|
+
registerStyle4("66ab1fd35b", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._02872bf298eadc43__root{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);--wp-ui-card-header-content-gap:var(--wpds-dimension-gap-xl,24px);--wp-ui-card-header-content-margin:calc(var(--wp-ui-card-header-content-gap) - var(--wp-ui-card-padding));background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:var(--wpds-border-radius-lg,8px);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:column;overflow:clip}._5dffdaf2a6e669ac__content,.bbccc92e6ba5662d__header{padding:var(--wp-ui-card-padding);&:not(:first-child):not(:last-child){padding-block-end:0}}.bbccc92e6ba5662d__header+._5dffdaf2a6e669ac__content{margin-block-start:var(--wp-ui-card-header-content-margin);padding-block-start:0}.c1fa192587e1b4a6__fullbleed{margin-inline:calc(var(--wp-ui-card-padding)*-1);width:calc(100% + var(--wp-ui-card-padding)*2)}._02872bf298eadc43__root>:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):first-child>.c1fa192587e1b4a6__fullbleed:first-child{margin-block-start:calc(var(--wp-ui-card-padding)*-1)}:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):last-child>.c1fa192587e1b4a6__fullbleed:last-child{margin-block-end:calc(var(--wp-ui-card-padding)*-1)}}}");
|
|
1954
1967
|
}
|
|
1955
1968
|
var style_default4 = { "root": "_02872bf298eadc43__root", "header": "bbccc92e6ba5662d__header", "content": "_5dffdaf2a6e669ac__content", "fullbleed": "c1fa192587e1b4a6__fullbleed" };
|
|
1956
1969
|
var Header = forwardRef(
|
|
1957
|
-
function CardHeader({ render:
|
|
1970
|
+
function CardHeader({ render: render5, ...props }, ref) {
|
|
1958
1971
|
const element = useRender3({
|
|
1959
1972
|
defaultTagName: "div",
|
|
1960
|
-
render:
|
|
1973
|
+
render: render5,
|
|
1961
1974
|
ref,
|
|
1962
1975
|
props: mergeProps3({ className: style_default4.header }, props)
|
|
1963
1976
|
});
|
|
@@ -2048,14 +2061,14 @@ function registerStyle5(hash, css27) {
|
|
|
2048
2061
|
}
|
|
2049
2062
|
}
|
|
2050
2063
|
if (typeof process === "undefined" || true) {
|
|
2051
|
-
registerStyle5("
|
|
2064
|
+
registerStyle5("66ab1fd35b", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._02872bf298eadc43__root{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);--wp-ui-card-header-content-gap:var(--wpds-dimension-gap-xl,24px);--wp-ui-card-header-content-margin:calc(var(--wp-ui-card-header-content-gap) - var(--wp-ui-card-padding));background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:var(--wpds-border-radius-lg,8px);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:column;overflow:clip}._5dffdaf2a6e669ac__content,.bbccc92e6ba5662d__header{padding:var(--wp-ui-card-padding);&:not(:first-child):not(:last-child){padding-block-end:0}}.bbccc92e6ba5662d__header+._5dffdaf2a6e669ac__content{margin-block-start:var(--wp-ui-card-header-content-margin);padding-block-start:0}.c1fa192587e1b4a6__fullbleed{margin-inline:calc(var(--wp-ui-card-padding)*-1);width:calc(100% + var(--wp-ui-card-padding)*2)}._02872bf298eadc43__root>:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):first-child>.c1fa192587e1b4a6__fullbleed:first-child{margin-block-start:calc(var(--wp-ui-card-padding)*-1)}:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):last-child>.c1fa192587e1b4a6__fullbleed:last-child{margin-block-end:calc(var(--wp-ui-card-padding)*-1)}}}");
|
|
2052
2065
|
}
|
|
2053
2066
|
var style_default5 = { "root": "_02872bf298eadc43__root", "header": "bbccc92e6ba5662d__header", "content": "_5dffdaf2a6e669ac__content", "fullbleed": "c1fa192587e1b4a6__fullbleed" };
|
|
2054
2067
|
var Content = forwardRef(
|
|
2055
|
-
function CardContent({ render:
|
|
2068
|
+
function CardContent({ render: render5, ...props }, ref) {
|
|
2056
2069
|
const element = useRender4({
|
|
2057
2070
|
defaultTagName: "div",
|
|
2058
|
-
render:
|
|
2071
|
+
render: render5,
|
|
2059
2072
|
ref,
|
|
2060
2073
|
props: mergeProps4({ className: style_default5.content }, props)
|
|
2061
2074
|
});
|
|
@@ -2146,14 +2159,14 @@ function registerStyle6(hash, css27) {
|
|
|
2146
2159
|
}
|
|
2147
2160
|
}
|
|
2148
2161
|
if (typeof process === "undefined" || true) {
|
|
2149
|
-
registerStyle6("
|
|
2162
|
+
registerStyle6("66ab1fd35b", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._02872bf298eadc43__root{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);--wp-ui-card-header-content-gap:var(--wpds-dimension-gap-xl,24px);--wp-ui-card-header-content-margin:calc(var(--wp-ui-card-header-content-gap) - var(--wp-ui-card-padding));background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:var(--wpds-border-radius-lg,8px);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:column;overflow:clip}._5dffdaf2a6e669ac__content,.bbccc92e6ba5662d__header{padding:var(--wp-ui-card-padding);&:not(:first-child):not(:last-child){padding-block-end:0}}.bbccc92e6ba5662d__header+._5dffdaf2a6e669ac__content{margin-block-start:var(--wp-ui-card-header-content-margin);padding-block-start:0}.c1fa192587e1b4a6__fullbleed{margin-inline:calc(var(--wp-ui-card-padding)*-1);width:calc(100% + var(--wp-ui-card-padding)*2)}._02872bf298eadc43__root>:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):first-child>.c1fa192587e1b4a6__fullbleed:first-child{margin-block-start:calc(var(--wp-ui-card-padding)*-1)}:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):last-child>.c1fa192587e1b4a6__fullbleed:last-child{margin-block-end:calc(var(--wp-ui-card-padding)*-1)}}}");
|
|
2150
2163
|
}
|
|
2151
2164
|
var style_default6 = { "root": "_02872bf298eadc43__root", "header": "bbccc92e6ba5662d__header", "content": "_5dffdaf2a6e669ac__content", "fullbleed": "c1fa192587e1b4a6__fullbleed" };
|
|
2152
2165
|
var FullBleed = forwardRef(
|
|
2153
|
-
function CardFullBleed({ render:
|
|
2166
|
+
function CardFullBleed({ render: render5, ...props }, ref) {
|
|
2154
2167
|
const element = useRender5({
|
|
2155
2168
|
defaultTagName: "div",
|
|
2156
|
-
render:
|
|
2169
|
+
render: render5,
|
|
2157
2170
|
ref,
|
|
2158
2171
|
props: mergeProps5(
|
|
2159
2172
|
{ className: style_default6.fullbleed },
|
|
@@ -2168,13 +2181,13 @@ var FullBleed = forwardRef(
|
|
|
2168
2181
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
2169
2182
|
var DEFAULT_TAG = /* @__PURE__ */ jsx5("div", {});
|
|
2170
2183
|
var Title = forwardRef(
|
|
2171
|
-
function CardTitle({ render:
|
|
2184
|
+
function CardTitle({ render: render5 = DEFAULT_TAG, children, ...props }, ref) {
|
|
2172
2185
|
return /* @__PURE__ */ jsx5(
|
|
2173
2186
|
Text,
|
|
2174
2187
|
{
|
|
2175
2188
|
ref,
|
|
2176
2189
|
variant: "heading-lg",
|
|
2177
|
-
render:
|
|
2190
|
+
render: render5,
|
|
2178
2191
|
...props,
|
|
2179
2192
|
children
|
|
2180
2193
|
}
|
|
@@ -2221,12 +2234,12 @@ __export(collapsible_card_exports, {
|
|
|
2221
2234
|
// ../ui/build-module/collapsible-card/root.mjs
|
|
2222
2235
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
2223
2236
|
var Root3 = forwardRef(
|
|
2224
|
-
function CollapsibleCardRoot({ render:
|
|
2237
|
+
function CollapsibleCardRoot({ render: render5, ...restProps }, ref) {
|
|
2225
2238
|
return /* @__PURE__ */ jsx9(
|
|
2226
2239
|
Root2,
|
|
2227
2240
|
{
|
|
2228
2241
|
ref,
|
|
2229
|
-
render: /* @__PURE__ */ jsx9(Root, { render:
|
|
2242
|
+
render: /* @__PURE__ */ jsx9(Root, { render: render5 }),
|
|
2230
2243
|
...restProps
|
|
2231
2244
|
}
|
|
2232
2245
|
);
|
|
@@ -2240,15 +2253,12 @@ import clsx5 from "clsx";
|
|
|
2240
2253
|
// ../icons/build-module/icon/index.mjs
|
|
2241
2254
|
var icon_default = forwardRef(
|
|
2242
2255
|
({ icon, size: size3 = 24, ...props }, ref) => {
|
|
2243
|
-
return cloneElement(
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
ref
|
|
2250
|
-
}
|
|
2251
|
-
);
|
|
2256
|
+
return cloneElement(icon, {
|
|
2257
|
+
width: size3,
|
|
2258
|
+
height: size3,
|
|
2259
|
+
...props,
|
|
2260
|
+
ref
|
|
2261
|
+
});
|
|
2252
2262
|
}
|
|
2253
2263
|
);
|
|
2254
2264
|
|
|
@@ -2477,19 +2487,19 @@ function registerStyle7(hash, css27) {
|
|
|
2477
2487
|
}
|
|
2478
2488
|
}
|
|
2479
2489
|
if (typeof process === "undefined" || true) {
|
|
2480
|
-
registerStyle7("
|
|
2490
|
+
registerStyle7("2072cdf420", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._626190151275d6d3__heading-wrapper{--_gcd-heading-color:inherit;--_gcd-heading-font-size:inherit;--_gcd-heading-font-weight:inherit;--_gcd-heading-margin:0;font-family:inherit;line-height:inherit}.cab17c7a373cb60d__header-content{flex:1;min-width:0}.dd89d27c4f15912d__header-trigger-positioner{align-self:center;flex-shrink:0;max-height:0;overflow:visible}.bcfab5f2448bafef__header-trigger-wrapper{border-radius:var(--wpds-border-radius-sm,2px);display:flex;translate:0 -50%}._3106f8d2b0330faa__header-trigger{@media not (prefers-reduced-motion){transition:rotate .15s ease-out}}._5d2dfcb4085c6d0f__header[data-panel-open] ._3106f8d2b0330faa__header-trigger{rotate:180deg}._5d2dfcb4085c6d0f__header[data-disabled] ._3106f8d2b0330faa__header-trigger{color:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}.e34cf37ccd0d81e0__content{height:var(--collapsible-panel-height);margin-block-start:var(--wp-ui-card-header-content-margin);overflow:hidden;&._165c4572592944b2__overflowVisible{overflow:visible}&[hidden]:not([hidden=until-found]){display:none}&[data-ending-style],&[data-starting-style]{height:0}@media not (prefers-reduced-motion){transition:all .15s ease-out}}}@layer compositions{._41bfdbf7b6c087c2__content-inner{padding-block-start:0}._5d2dfcb4085c6d0f__header{align-items:stretch;display:flex;flex-direction:row;gap:var(--wpds-dimension-gap-sm,8px);outline:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}}}}");
|
|
2481
2491
|
}
|
|
2482
2492
|
var style_default7 = { "heading-wrapper": "_626190151275d6d3__heading-wrapper", "header-content": "cab17c7a373cb60d__header-content", "header-trigger-positioner": "dd89d27c4f15912d__header-trigger-positioner", "header-trigger-wrapper": "bcfab5f2448bafef__header-trigger-wrapper", "header-trigger": "_3106f8d2b0330faa__header-trigger", "header": "_5d2dfcb4085c6d0f__header", "content": "e34cf37ccd0d81e0__content", "overflowVisible": "_165c4572592944b2__overflowVisible", "content-inner": "_41bfdbf7b6c087c2__content-inner" };
|
|
2483
2493
|
if (typeof process === "undefined" || true) {
|
|
2484
|
-
registerStyle7("
|
|
2494
|
+
registerStyle7("d5c1b736fd", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}");
|
|
2485
2495
|
}
|
|
2486
2496
|
var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a" };
|
|
2487
2497
|
if (typeof process === "undefined" || true) {
|
|
2488
|
-
registerStyle7("
|
|
2498
|
+
registerStyle7("693cd16544", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._08e8a2e44959f892__outset-ring--focus,._970d04df7376df67__outset-ring--focus-within-except-active,.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible,.cd83dfc2126a0846__outset-ring--focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active,.ecadb9e080e2dfa5__outset-ring--focus-parent-visible{@media not (prefers-reduced-motion){--_gcd-a-transition:outline 0.1s ease-out;transition:outline .1s ease-out}outline:0 solid transparent;outline-offset:1px}._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9))}}}");
|
|
2489
2499
|
}
|
|
2490
2500
|
var focus_default = { "outset-ring--focus": "_08e8a2e44959f892__outset-ring--focus", "outset-ring--focus-except-active": "e25b2bdd7aa21721__outset-ring--focus-except-active", "outset-ring--focus-visible": "d0541bc9dd9dc7b6__outset-ring--focus-visible", "outset-ring--focus-within": "cd83dfc2126a0846__outset-ring--focus-within", "outset-ring--focus-within-except-active": "_970d04df7376df67__outset-ring--focus-within-except-active", "outset-ring--focus-within-visible": "c5cb3ee4bddaa8e4__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "ecadb9e080e2dfa5__outset-ring--focus-parent-visible" };
|
|
2491
2501
|
var Header2 = forwardRef(
|
|
2492
|
-
function CollapsibleCardHeader({ children, className: className2, render:
|
|
2502
|
+
function CollapsibleCardHeader({ children, className: className2, render: render5, ...restProps }, ref) {
|
|
2493
2503
|
const [descriptionId, setDescriptionId] = useState();
|
|
2494
2504
|
const contextValue = useMemo(
|
|
2495
2505
|
() => ({ setDescriptionId }),
|
|
@@ -2497,7 +2507,7 @@ var Header2 = forwardRef(
|
|
|
2497
2507
|
);
|
|
2498
2508
|
return useRender6({
|
|
2499
2509
|
defaultTagName: "div",
|
|
2500
|
-
render:
|
|
2510
|
+
render: render5,
|
|
2501
2511
|
ref,
|
|
2502
2512
|
props: mergeProps6(restProps, {
|
|
2503
2513
|
className: clsx5(
|
|
@@ -2656,11 +2666,11 @@ function registerStyle8(hash, css27) {
|
|
|
2656
2666
|
}
|
|
2657
2667
|
}
|
|
2658
2668
|
if (typeof process === "undefined" || true) {
|
|
2659
|
-
registerStyle8("
|
|
2669
|
+
registerStyle8("2072cdf420", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._626190151275d6d3__heading-wrapper{--_gcd-heading-color:inherit;--_gcd-heading-font-size:inherit;--_gcd-heading-font-weight:inherit;--_gcd-heading-margin:0;font-family:inherit;line-height:inherit}.cab17c7a373cb60d__header-content{flex:1;min-width:0}.dd89d27c4f15912d__header-trigger-positioner{align-self:center;flex-shrink:0;max-height:0;overflow:visible}.bcfab5f2448bafef__header-trigger-wrapper{border-radius:var(--wpds-border-radius-sm,2px);display:flex;translate:0 -50%}._3106f8d2b0330faa__header-trigger{@media not (prefers-reduced-motion){transition:rotate .15s ease-out}}._5d2dfcb4085c6d0f__header[data-panel-open] ._3106f8d2b0330faa__header-trigger{rotate:180deg}._5d2dfcb4085c6d0f__header[data-disabled] ._3106f8d2b0330faa__header-trigger{color:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}.e34cf37ccd0d81e0__content{height:var(--collapsible-panel-height);margin-block-start:var(--wp-ui-card-header-content-margin);overflow:hidden;&._165c4572592944b2__overflowVisible{overflow:visible}&[hidden]:not([hidden=until-found]){display:none}&[data-ending-style],&[data-starting-style]{height:0}@media not (prefers-reduced-motion){transition:all .15s ease-out}}}@layer compositions{._41bfdbf7b6c087c2__content-inner{padding-block-start:0}._5d2dfcb4085c6d0f__header{align-items:stretch;display:flex;flex-direction:row;gap:var(--wpds-dimension-gap-sm,8px);outline:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}}}}");
|
|
2660
2670
|
}
|
|
2661
2671
|
var style_default8 = { "heading-wrapper": "_626190151275d6d3__heading-wrapper", "header-content": "cab17c7a373cb60d__header-content", "header-trigger-positioner": "dd89d27c4f15912d__header-trigger-positioner", "header-trigger-wrapper": "bcfab5f2448bafef__header-trigger-wrapper", "header-trigger": "_3106f8d2b0330faa__header-trigger", "header": "_5d2dfcb4085c6d0f__header", "content": "e34cf37ccd0d81e0__content", "overflowVisible": "_165c4572592944b2__overflowVisible", "content-inner": "_41bfdbf7b6c087c2__content-inner" };
|
|
2662
2672
|
var Content2 = forwardRef(
|
|
2663
|
-
function CollapsibleCardContent({ className: className2, render:
|
|
2673
|
+
function CollapsibleCardContent({ className: className2, render: render5, children, hiddenUntilFound = true, ...restProps }, ref) {
|
|
2664
2674
|
return /* @__PURE__ */ jsx46(
|
|
2665
2675
|
Panel,
|
|
2666
2676
|
{
|
|
@@ -2676,7 +2686,7 @@ var Content2 = forwardRef(
|
|
|
2676
2686
|
Content,
|
|
2677
2687
|
{
|
|
2678
2688
|
className: style_default8["content-inner"],
|
|
2679
|
-
render:
|
|
2689
|
+
render: render5,
|
|
2680
2690
|
children
|
|
2681
2691
|
}
|
|
2682
2692
|
)
|
|
@@ -2881,7 +2891,7 @@ var ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS = {
|
|
|
2881
2891
|
var CONTRAST_EPSILON = 4e-3;
|
|
2882
2892
|
var MAX_BISECTION_ITERATIONS = 10;
|
|
2883
2893
|
var DEFAULT_SEED_COLORS = {
|
|
2884
|
-
|
|
2894
|
+
background: "#fcfcfc",
|
|
2885
2895
|
primary: "#3858e9",
|
|
2886
2896
|
info: "#0090ff",
|
|
2887
2897
|
success: "#4ab866",
|
|
@@ -3534,7 +3544,7 @@ var BG_RAMP_CONFIG = {
|
|
|
3534
3544
|
contrast: {
|
|
3535
3545
|
reference: "stroke3",
|
|
3536
3546
|
followDirection: "opposite",
|
|
3537
|
-
target: 2.
|
|
3547
|
+
target: 2.9
|
|
3538
3548
|
},
|
|
3539
3549
|
taperChromaOptions: STROKE_TAPER_CHROMA
|
|
3540
3550
|
},
|
|
@@ -3851,29 +3861,29 @@ function useThemeProviderStyles({
|
|
|
3851
3861
|
} = {}) {
|
|
3852
3862
|
const { resolvedSettings: inheritedSettings } = useContext(ThemeContext);
|
|
3853
3863
|
const primary = color.primary ?? inheritedSettings.color?.primary ?? DEFAULT_SEED_COLORS.primary;
|
|
3854
|
-
const
|
|
3864
|
+
const background = color.background ?? inheritedSettings.color?.background ?? DEFAULT_SEED_COLORS.background;
|
|
3855
3865
|
const cursorControl = cursor?.control ?? inheritedSettings.cursor?.control;
|
|
3856
3866
|
const resolvedSettings = useMemo(
|
|
3857
3867
|
() => ({
|
|
3858
3868
|
color: {
|
|
3859
3869
|
primary,
|
|
3860
|
-
|
|
3870
|
+
background
|
|
3861
3871
|
},
|
|
3862
3872
|
cursor: cursorControl ? { control: cursorControl } : void 0
|
|
3863
3873
|
}),
|
|
3864
|
-
[primary,
|
|
3874
|
+
[primary, background, cursorControl]
|
|
3865
3875
|
);
|
|
3866
3876
|
const colorStyles = useMemo(() => {
|
|
3867
3877
|
const seeds = {
|
|
3868
3878
|
...DEFAULT_SEED_COLORS,
|
|
3869
|
-
|
|
3879
|
+
background,
|
|
3870
3880
|
primary
|
|
3871
3881
|
};
|
|
3872
3882
|
const computedColorRamps = /* @__PURE__ */ new Map();
|
|
3873
|
-
const bgRamp = getCachedBgRamp(seeds.
|
|
3883
|
+
const bgRamp = getCachedBgRamp(seeds.background);
|
|
3874
3884
|
Object.entries(seeds).forEach(([rampName, seed]) => {
|
|
3875
|
-
if (rampName === "
|
|
3876
|
-
computedColorRamps.set(
|
|
3885
|
+
if (rampName === "background") {
|
|
3886
|
+
computedColorRamps.set("bg", bgRamp);
|
|
3877
3887
|
} else {
|
|
3878
3888
|
computedColorRamps.set(
|
|
3879
3889
|
rampName,
|
|
@@ -3885,7 +3895,7 @@ function useThemeProviderStyles({
|
|
|
3885
3895
|
primary: seeds.primary,
|
|
3886
3896
|
computedColorRamps
|
|
3887
3897
|
});
|
|
3888
|
-
}, [primary,
|
|
3898
|
+
}, [primary, background]);
|
|
3889
3899
|
const themeProviderStyles = useMemo(
|
|
3890
3900
|
() => ({
|
|
3891
3901
|
...colorStyles,
|
|
@@ -4009,8 +4019,7 @@ var ThemeProvider = ({
|
|
|
4009
4019
|
children,
|
|
4010
4020
|
color = {},
|
|
4011
4021
|
cursor,
|
|
4012
|
-
isRoot = false
|
|
4013
|
-
density
|
|
4022
|
+
isRoot = false
|
|
4014
4023
|
}) => {
|
|
4015
4024
|
const instanceId = useId();
|
|
4016
4025
|
const { themeProviderStyles, resolvedSettings } = useThemeProviderStyles({
|
|
@@ -4033,7 +4042,6 @@ var ThemeProvider = ({
|
|
|
4033
4042
|
{
|
|
4034
4043
|
"data-wpds-theme-provider-id": instanceId,
|
|
4035
4044
|
"data-wpds-root-provider": isRoot,
|
|
4036
|
-
"data-wpds-density": density,
|
|
4037
4045
|
className: style_default9.root,
|
|
4038
4046
|
children: /* @__PURE__ */ jsx47(ThemeContext.Provider, { value: contextValue, children })
|
|
4039
4047
|
}
|
|
@@ -4050,10 +4058,7 @@ lock2(privateApis, {
|
|
|
4050
4058
|
|
|
4051
4059
|
// ../ui/build-module/utils/render-slot-with-children.mjs
|
|
4052
4060
|
function renderSlotWithChildren(slot, defaultSlot, children) {
|
|
4053
|
-
return cloneElement(
|
|
4054
|
-
slot ?? defaultSlot,
|
|
4055
|
-
{ children }
|
|
4056
|
-
);
|
|
4061
|
+
return cloneElement(slot ?? defaultSlot, { children });
|
|
4057
4062
|
}
|
|
4058
4063
|
|
|
4059
4064
|
// ../ui/build-module/lock-unlock.mjs
|
|
@@ -4145,7 +4150,7 @@ function registerStyle10(hash, css27) {
|
|
|
4145
4150
|
}
|
|
4146
4151
|
}
|
|
4147
4152
|
if (typeof process === "undefined" || true) {
|
|
4148
|
-
registerStyle10("
|
|
4153
|
+
registerStyle10("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
|
|
4149
4154
|
}
|
|
4150
4155
|
var style_default10 = { "stack": "_19ce0419607e1896__stack" };
|
|
4151
4156
|
var gapTokens = {
|
|
@@ -4157,7 +4162,7 @@ var gapTokens = {
|
|
|
4157
4162
|
"2xl": "var(--wpds-dimension-gap-2xl, 32px)",
|
|
4158
4163
|
"3xl": "var(--wpds-dimension-gap-3xl, 40px)"
|
|
4159
4164
|
};
|
|
4160
|
-
var Stack = forwardRef(function Stack2({ direction, gap, align, justify, wrap, render:
|
|
4165
|
+
var Stack = forwardRef(function Stack2({ direction, gap, align, justify, wrap, render: render5, ...props }, ref) {
|
|
4161
4166
|
const style = {
|
|
4162
4167
|
gap: gap && gapTokens[gap],
|
|
4163
4168
|
alignItems: align,
|
|
@@ -4166,7 +4171,7 @@ var Stack = forwardRef(function Stack2({ direction, gap, align, justify, wrap, r
|
|
|
4166
4171
|
flexWrap: wrap
|
|
4167
4172
|
};
|
|
4168
4173
|
const element = useRender7({
|
|
4169
|
-
render:
|
|
4174
|
+
render: render5,
|
|
4170
4175
|
ref,
|
|
4171
4176
|
props: mergeProps7(props, { style, className: style_default10.stack })
|
|
4172
4177
|
});
|
|
@@ -4273,7 +4278,7 @@ function registerStyle11(hash, css27) {
|
|
|
4273
4278
|
}
|
|
4274
4279
|
}
|
|
4275
4280
|
if (typeof process === "undefined" || true) {
|
|
4276
|
-
registerStyle11("
|
|
4281
|
+
registerStyle11("be37f31c1e", "._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}");
|
|
4277
4282
|
}
|
|
4278
4283
|
var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" };
|
|
4279
4284
|
var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot";
|
|
@@ -4427,11 +4432,11 @@ function registerStyle12(hash, css27) {
|
|
|
4427
4432
|
}
|
|
4428
4433
|
}
|
|
4429
4434
|
if (typeof process === "undefined" || true) {
|
|
4430
|
-
registerStyle12("
|
|
4435
|
+
registerStyle12("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
|
|
4431
4436
|
}
|
|
4432
4437
|
var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
|
|
4433
4438
|
if (typeof process === "undefined" || true) {
|
|
4434
|
-
registerStyle12("
|
|
4439
|
+
registerStyle12("4811d023d1", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-sm,0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
|
|
4435
4440
|
}
|
|
4436
4441
|
var style_default11 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" };
|
|
4437
4442
|
var Positioner = forwardRef(
|
|
@@ -4537,32 +4542,21 @@ function registerStyle13(hash, css27) {
|
|
|
4537
4542
|
}
|
|
4538
4543
|
}
|
|
4539
4544
|
if (typeof process === "undefined" || true) {
|
|
4540
|
-
registerStyle13("
|
|
4545
|
+
registerStyle13("4811d023d1", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-sm,0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
|
|
4541
4546
|
}
|
|
4542
4547
|
var style_default12 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" };
|
|
4543
4548
|
var ThemeProvider2 = unlock3(privateApis).ThemeProvider;
|
|
4549
|
+
var POPUP_COLOR = { background: "#1e1e1e" };
|
|
4544
4550
|
var Popup = forwardRef(function TooltipPopup({ portal, positioner, children, className: className2, ...props }, ref) {
|
|
4545
|
-
const popupContent = (
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
* below
|
|
4555
|
-
*/
|
|
4556
|
-
/* @__PURE__ */ jsx50(ThemeProvider2, { color: { bg: "#1e1e1e" }, children: /* @__PURE__ */ jsx50(
|
|
4557
|
-
_Tooltip3.Popup,
|
|
4558
|
-
{
|
|
4559
|
-
ref,
|
|
4560
|
-
className: clsx8(style_default12.popup, className2),
|
|
4561
|
-
...props,
|
|
4562
|
-
children
|
|
4563
|
-
}
|
|
4564
|
-
) })
|
|
4565
|
-
);
|
|
4551
|
+
const popupContent = /* @__PURE__ */ jsx50(ThemeProvider2, { color: POPUP_COLOR, children: /* @__PURE__ */ jsx50(
|
|
4552
|
+
_Tooltip3.Popup,
|
|
4553
|
+
{
|
|
4554
|
+
ref,
|
|
4555
|
+
className: clsx8(style_default12.popup, className2),
|
|
4556
|
+
...props,
|
|
4557
|
+
children
|
|
4558
|
+
}
|
|
4559
|
+
) });
|
|
4566
4560
|
const positionedPopup = renderSlotWithChildren(
|
|
4567
4561
|
positioner,
|
|
4568
4562
|
/* @__PURE__ */ jsx50(Positioner, {}),
|
|
@@ -4677,13 +4671,13 @@ function registerStyle14(hash, css27) {
|
|
|
4677
4671
|
}
|
|
4678
4672
|
}
|
|
4679
4673
|
if (typeof process === "undefined" || true) {
|
|
4680
|
-
registerStyle14("
|
|
4674
|
+
registerStyle14("fa606a57ae", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}");
|
|
4681
4675
|
}
|
|
4682
4676
|
var style_default13 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
|
|
4683
4677
|
var VisuallyHidden = forwardRef(
|
|
4684
|
-
function VisuallyHidden2({ render:
|
|
4678
|
+
function VisuallyHidden2({ render: render5, ...restProps }, ref) {
|
|
4685
4679
|
const element = useRender8({
|
|
4686
|
-
render:
|
|
4680
|
+
render: render5,
|
|
4687
4681
|
ref,
|
|
4688
4682
|
props: mergeProps8(
|
|
4689
4683
|
{ className: style_default13["visually-hidden"] },
|
|
@@ -4739,6 +4733,7 @@ var LAYOUT_LIST = "list";
|
|
|
4739
4733
|
var LAYOUT_ACTIVITY = "activity";
|
|
4740
4734
|
var LAYOUT_PICKER_GRID = "pickerGrid";
|
|
4741
4735
|
var LAYOUT_PICKER_TABLE = "pickerTable";
|
|
4736
|
+
var LAYOUT_PICKER_ACTIVITY = "pickerActivity";
|
|
4742
4737
|
|
|
4743
4738
|
// src/components/dataviews-context/index.ts
|
|
4744
4739
|
var DataViewsContext = createContext({
|
|
@@ -4779,7 +4774,7 @@ DataViewsContext.displayName = "DataViewsContext";
|
|
|
4779
4774
|
var dataviews_context_default = DataViewsContext;
|
|
4780
4775
|
|
|
4781
4776
|
// src/components/dataviews-layouts/index.ts
|
|
4782
|
-
import { __ as
|
|
4777
|
+
import { __ as __36, isRTL as isRTL12 } from "@wordpress/i18n";
|
|
4783
4778
|
|
|
4784
4779
|
// src/components/dataviews-layouts/table/index.tsx
|
|
4785
4780
|
import clsx38 from "clsx";
|
|
@@ -5785,8 +5780,7 @@ function UnforwardedTooltip(props, ref) {
|
|
|
5785
5780
|
render: children
|
|
5786
5781
|
}) : children;
|
|
5787
5782
|
}
|
|
5788
|
-
function addDescribedById(
|
|
5789
|
-
const element = el;
|
|
5783
|
+
function addDescribedById(element) {
|
|
5790
5784
|
return describedById && mounted && element.props["aria-describedby"] === void 0 && element.props["aria-label"] !== text ? cloneElement(element, {
|
|
5791
5785
|
"aria-describedby": describedById
|
|
5792
5786
|
}) : element;
|
|
@@ -7165,39 +7159,42 @@ function InputBase(props, ref) {
|
|
|
7165
7159
|
}
|
|
7166
7160
|
};
|
|
7167
7161
|
}, [__next40pxDefaultSize, size3]);
|
|
7168
|
-
return
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
labelPosition,
|
|
7186
|
-
children: [/* @__PURE__ */ _jsxs2(ContextSystemProvider, {
|
|
7187
|
-
value: prefixSuffixContextValue,
|
|
7188
|
-
children: [prefix && /* @__PURE__ */ _jsx22(Prefix, {
|
|
7189
|
-
className: "components-input-control__prefix",
|
|
7190
|
-
children: prefix
|
|
7191
|
-
}), children, suffix && /* @__PURE__ */ _jsx22(Suffix, {
|
|
7192
|
-
className: "components-input-control__suffix",
|
|
7193
|
-
children: suffix
|
|
7194
|
-
})]
|
|
7195
|
-
}), /* @__PURE__ */ _jsx22(backdrop_default, {
|
|
7162
|
+
return (
|
|
7163
|
+
// @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions.
|
|
7164
|
+
/* @__PURE__ */ _jsxs2(Root5, {
|
|
7165
|
+
...restProps,
|
|
7166
|
+
...getUIFlexProps(labelPosition),
|
|
7167
|
+
className: className2,
|
|
7168
|
+
gap: 2,
|
|
7169
|
+
ref,
|
|
7170
|
+
children: [/* @__PURE__ */ _jsx22(Label2, {
|
|
7171
|
+
className: "components-input-control__label",
|
|
7172
|
+
hideLabelFromVision,
|
|
7173
|
+
labelPosition,
|
|
7174
|
+
htmlFor: id,
|
|
7175
|
+
children: label
|
|
7176
|
+
}), /* @__PURE__ */ _jsxs2(Container, {
|
|
7177
|
+
__unstableInputWidth,
|
|
7178
|
+
className: "components-input-control__container",
|
|
7196
7179
|
disabled,
|
|
7197
|
-
|
|
7180
|
+
hideLabel,
|
|
7181
|
+
labelPosition,
|
|
7182
|
+
children: [/* @__PURE__ */ _jsxs2(ContextSystemProvider, {
|
|
7183
|
+
value: prefixSuffixContextValue,
|
|
7184
|
+
children: [prefix && /* @__PURE__ */ _jsx22(Prefix, {
|
|
7185
|
+
className: "components-input-control__prefix",
|
|
7186
|
+
children: prefix
|
|
7187
|
+
}), children, suffix && /* @__PURE__ */ _jsx22(Suffix, {
|
|
7188
|
+
className: "components-input-control__suffix",
|
|
7189
|
+
children: suffix
|
|
7190
|
+
})]
|
|
7191
|
+
}), /* @__PURE__ */ _jsx22(backdrop_default, {
|
|
7192
|
+
disabled,
|
|
7193
|
+
isBorderless
|
|
7194
|
+
})]
|
|
7198
7195
|
})]
|
|
7199
|
-
})
|
|
7200
|
-
|
|
7196
|
+
})
|
|
7197
|
+
);
|
|
7201
7198
|
}
|
|
7202
7199
|
var input_base_default = contextConnect(InputBase, "InputBase");
|
|
7203
7200
|
|
|
@@ -14752,7 +14749,7 @@ var Tab3 = forwardRef(function Tab22({
|
|
|
14752
14749
|
children,
|
|
14753
14750
|
tabId,
|
|
14754
14751
|
disabled,
|
|
14755
|
-
render:
|
|
14752
|
+
render: render5,
|
|
14756
14753
|
...otherProps
|
|
14757
14754
|
}, ref) {
|
|
14758
14755
|
const {
|
|
@@ -14769,7 +14766,7 @@ var Tab3 = forwardRef(function Tab22({
|
|
|
14769
14766
|
store,
|
|
14770
14767
|
id: instancedTabId,
|
|
14771
14768
|
disabled,
|
|
14772
|
-
render:
|
|
14769
|
+
render: render5,
|
|
14773
14770
|
...otherProps,
|
|
14774
14771
|
children: [/* @__PURE__ */ _jsx98(TabChildren, {
|
|
14775
14772
|
children
|
|
@@ -20395,79 +20392,341 @@ function ViewPickerTable({
|
|
|
20395
20392
|
}
|
|
20396
20393
|
var picker_table_default = ViewPickerTable;
|
|
20397
20394
|
|
|
20398
|
-
// src/components/dataviews-layouts/
|
|
20399
|
-
import
|
|
20400
|
-
import {
|
|
20401
|
-
|
|
20402
|
-
|
|
20403
|
-
|
|
20404
|
-
|
|
20405
|
-
|
|
20395
|
+
// src/components/dataviews-layouts/picker-activity/index.tsx
|
|
20396
|
+
import clsx47 from "clsx";
|
|
20397
|
+
import { __ as __33, sprintf as sprintf14 } from "@wordpress/i18n";
|
|
20398
|
+
import { Fragment as Fragment12, jsx as jsx74, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
20399
|
+
function isDefined5(item2) {
|
|
20400
|
+
return !!item2;
|
|
20401
|
+
}
|
|
20402
|
+
function PickerActivityItem({
|
|
20403
|
+
view,
|
|
20404
|
+
multiselect,
|
|
20405
|
+
selection,
|
|
20406
|
+
onChangeSelection,
|
|
20407
|
+
getItemId,
|
|
20408
|
+
item: item2,
|
|
20409
|
+
titleField,
|
|
20410
|
+
mediaField,
|
|
20411
|
+
descriptionField,
|
|
20412
|
+
otherFields,
|
|
20413
|
+
posinset,
|
|
20414
|
+
setsize
|
|
20415
|
+
}) {
|
|
20416
|
+
const elementRef = useRef(null);
|
|
20417
|
+
useIntersectionObserver(elementRef, posinset);
|
|
20418
|
+
const { showTitle = true, showMedia = true, showDescription = true } = view;
|
|
20419
|
+
const id = getItemId(item2);
|
|
20420
|
+
const isSelected = selection.includes(id);
|
|
20421
|
+
const density = view.layout?.density ?? "balanced";
|
|
20422
|
+
const mediaContent = showMedia && density !== "compact" && mediaField?.render ? /* @__PURE__ */ jsx74(
|
|
20423
|
+
mediaField.render,
|
|
20406
20424
|
{
|
|
20407
|
-
|
|
20408
|
-
|
|
20409
|
-
|
|
20410
|
-
|
|
20411
|
-
|
|
20412
|
-
|
|
20413
|
-
|
|
20414
|
-
|
|
20415
|
-
|
|
20416
|
-
|
|
20417
|
-
|
|
20425
|
+
item: item2,
|
|
20426
|
+
field: mediaField,
|
|
20427
|
+
config: {
|
|
20428
|
+
sizes: density === "comfortable" ? "32px" : "24px"
|
|
20429
|
+
}
|
|
20430
|
+
}
|
|
20431
|
+
) : null;
|
|
20432
|
+
const renderedMediaField = /* @__PURE__ */ jsx74("div", { className: "dataviews-view-picker-activity__item-type-icon", children: mediaContent || /* @__PURE__ */ jsx74(
|
|
20433
|
+
"span",
|
|
20434
|
+
{
|
|
20435
|
+
className: "dataviews-view-picker-activity__item-bullet",
|
|
20436
|
+
"aria-hidden": "true"
|
|
20437
|
+
}
|
|
20438
|
+
) });
|
|
20439
|
+
const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ jsx74(titleField.render, { item: item2, field: titleField }) : null;
|
|
20440
|
+
const renderedDescriptionField = showDescription && descriptionField?.render ? /* @__PURE__ */ jsx74(descriptionField.render, { item: item2, field: descriptionField }) : null;
|
|
20441
|
+
const verticalGap = useMemo(() => {
|
|
20442
|
+
switch (density) {
|
|
20443
|
+
case "comfortable":
|
|
20444
|
+
return "md";
|
|
20445
|
+
default:
|
|
20446
|
+
return "sm";
|
|
20447
|
+
}
|
|
20448
|
+
}, [density]);
|
|
20449
|
+
return /* @__PURE__ */ jsx74(
|
|
20450
|
+
Composite2.Item,
|
|
20451
|
+
{
|
|
20452
|
+
ref: elementRef,
|
|
20453
|
+
role: "option",
|
|
20454
|
+
"aria-label": titleField ? titleField.getValue({ item: item2 }) || void 0 : void 0,
|
|
20455
|
+
"aria-posinset": posinset,
|
|
20456
|
+
"aria-setsize": setsize,
|
|
20457
|
+
"aria-selected": isSelected,
|
|
20458
|
+
className: clsx47(
|
|
20459
|
+
"dataviews-view-picker-activity__item",
|
|
20460
|
+
density === "compact" && "is-compact",
|
|
20461
|
+
density === "balanced" && "is-balanced",
|
|
20462
|
+
density === "comfortable" && "is-comfortable",
|
|
20463
|
+
isSelected && "is-selected"
|
|
20464
|
+
),
|
|
20465
|
+
onClick: () => {
|
|
20466
|
+
if (isSelected) {
|
|
20467
|
+
onChangeSelection(
|
|
20468
|
+
selection.filter((itemId) => id !== itemId)
|
|
20469
|
+
);
|
|
20470
|
+
} else {
|
|
20471
|
+
const newSelection = multiselect ? [...selection, id] : [id];
|
|
20472
|
+
onChangeSelection(newSelection);
|
|
20473
|
+
}
|
|
20418
20474
|
},
|
|
20419
|
-
|
|
20420
|
-
children: [
|
|
20421
|
-
/* @__PURE__ */ jsx74(
|
|
20422
|
-
component_default12,
|
|
20423
|
-
{
|
|
20424
|
-
value: "comfortable",
|
|
20425
|
-
label: _x2(
|
|
20426
|
-
"Comfortable",
|
|
20427
|
-
"Density option for DataView layout"
|
|
20428
|
-
)
|
|
20429
|
-
},
|
|
20430
|
-
"comfortable"
|
|
20431
|
-
),
|
|
20475
|
+
render: /* @__PURE__ */ jsx74("div", {}),
|
|
20476
|
+
children: /* @__PURE__ */ jsxs19(Stack, { direction: "row", gap: "lg", justify: "start", align: "flex-start", children: [
|
|
20432
20477
|
/* @__PURE__ */ jsx74(
|
|
20433
|
-
|
|
20478
|
+
Stack,
|
|
20434
20479
|
{
|
|
20435
|
-
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
|
|
20480
|
+
direction: "column",
|
|
20481
|
+
gap: "xs",
|
|
20482
|
+
align: "center",
|
|
20483
|
+
className: "dataviews-view-picker-activity__item-type",
|
|
20484
|
+
children: renderedMediaField
|
|
20485
|
+
}
|
|
20439
20486
|
),
|
|
20440
|
-
/* @__PURE__ */
|
|
20441
|
-
|
|
20487
|
+
/* @__PURE__ */ jsxs19(
|
|
20488
|
+
Stack,
|
|
20442
20489
|
{
|
|
20443
|
-
|
|
20444
|
-
|
|
20445
|
-
|
|
20446
|
-
|
|
20490
|
+
direction: "column",
|
|
20491
|
+
gap: verticalGap,
|
|
20492
|
+
align: "flex-start",
|
|
20493
|
+
className: "dataviews-view-picker-activity__item-content",
|
|
20494
|
+
children: [
|
|
20495
|
+
renderedTitleField && /* @__PURE__ */ jsx74("div", { className: "dataviews-view-picker-activity__item-title", children: renderedTitleField }),
|
|
20496
|
+
renderedDescriptionField && /* @__PURE__ */ jsx74("div", { className: "dataviews-view-picker-activity__item-description", children: renderedDescriptionField }),
|
|
20497
|
+
/* @__PURE__ */ jsx74("div", { className: "dataviews-view-picker-activity__item-fields", children: otherFields.map((field) => /* @__PURE__ */ jsxs19(
|
|
20498
|
+
"div",
|
|
20499
|
+
{
|
|
20500
|
+
className: "dataviews-view-picker-activity__item-field",
|
|
20501
|
+
children: [
|
|
20502
|
+
/* @__PURE__ */ jsx74(
|
|
20503
|
+
VisuallyHidden,
|
|
20504
|
+
{
|
|
20505
|
+
render: /* @__PURE__ */ jsx74("span", {}),
|
|
20506
|
+
className: "dataviews-view-picker-activity__item-field-label",
|
|
20507
|
+
children: field.label
|
|
20508
|
+
}
|
|
20509
|
+
),
|
|
20510
|
+
/* @__PURE__ */ jsx74("span", { className: "dataviews-view-picker-activity__item-field-value", children: /* @__PURE__ */ jsx74(
|
|
20511
|
+
field.render,
|
|
20512
|
+
{
|
|
20513
|
+
item: item2,
|
|
20514
|
+
field
|
|
20515
|
+
}
|
|
20516
|
+
) })
|
|
20517
|
+
]
|
|
20518
|
+
},
|
|
20519
|
+
field.id
|
|
20520
|
+
)) })
|
|
20521
|
+
]
|
|
20522
|
+
}
|
|
20447
20523
|
)
|
|
20448
|
-
]
|
|
20524
|
+
] })
|
|
20449
20525
|
}
|
|
20450
20526
|
);
|
|
20451
20527
|
}
|
|
20452
|
-
|
|
20453
|
-
|
|
20454
|
-
|
|
20455
|
-
|
|
20456
|
-
|
|
20457
|
-
|
|
20458
|
-
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
|
|
20462
|
-
|
|
20463
|
-
|
|
20464
|
-
|
|
20465
|
-
|
|
20466
|
-
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20470
|
-
|
|
20528
|
+
function PickerActivityGroup({
|
|
20529
|
+
groupName,
|
|
20530
|
+
groupField,
|
|
20531
|
+
showLabel = true,
|
|
20532
|
+
children
|
|
20533
|
+
}) {
|
|
20534
|
+
const headerId = use_instance_id_default(
|
|
20535
|
+
PickerActivityGroup,
|
|
20536
|
+
"dataviews-view-picker-activity-group__header"
|
|
20537
|
+
);
|
|
20538
|
+
return /* @__PURE__ */ jsxs19(
|
|
20539
|
+
Stack,
|
|
20540
|
+
{
|
|
20541
|
+
direction: "column",
|
|
20542
|
+
role: "group",
|
|
20543
|
+
"aria-labelledby": headerId,
|
|
20544
|
+
className: "dataviews-view-picker-activity-group",
|
|
20545
|
+
children: [
|
|
20546
|
+
/* @__PURE__ */ jsx74(
|
|
20547
|
+
"h3",
|
|
20548
|
+
{
|
|
20549
|
+
className: "dataviews-view-picker-activity-group__header",
|
|
20550
|
+
id: headerId,
|
|
20551
|
+
children: showLabel ? sprintf14(
|
|
20552
|
+
// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
|
|
20553
|
+
__33("%1$s: %2$s"),
|
|
20554
|
+
groupField.label,
|
|
20555
|
+
groupName
|
|
20556
|
+
) : groupName
|
|
20557
|
+
}
|
|
20558
|
+
),
|
|
20559
|
+
children
|
|
20560
|
+
]
|
|
20561
|
+
}
|
|
20562
|
+
);
|
|
20563
|
+
}
|
|
20564
|
+
function ViewPickerActivity({
|
|
20565
|
+
data,
|
|
20566
|
+
fields,
|
|
20567
|
+
getItemId,
|
|
20568
|
+
isLoading,
|
|
20569
|
+
onChangeSelection,
|
|
20570
|
+
selection,
|
|
20571
|
+
view,
|
|
20572
|
+
actions,
|
|
20573
|
+
className: className2,
|
|
20574
|
+
empty
|
|
20575
|
+
}) {
|
|
20576
|
+
const { itemListLabel, paginationInfo } = useContext(dataviews_context_default);
|
|
20577
|
+
const isMultiselect = useIsMultiselectPicker(actions);
|
|
20578
|
+
const titleField = fields.find(
|
|
20579
|
+
(field) => field.id === view?.titleField
|
|
20580
|
+
);
|
|
20581
|
+
const mediaField = fields.find(
|
|
20582
|
+
(field) => field.id === view?.mediaField
|
|
20583
|
+
);
|
|
20584
|
+
const descriptionField = fields.find(
|
|
20585
|
+
(field) => field.id === view?.descriptionField
|
|
20586
|
+
);
|
|
20587
|
+
const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f) => fieldId === f.id)).filter(isDefined5);
|
|
20588
|
+
const groupField = view.groupBy?.field ? fields.find((f) => f.id === view.groupBy?.field) : null;
|
|
20589
|
+
const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
|
|
20590
|
+
const isInfiniteScroll = (view.infiniteScrollEnabled && !dataByGroup) ?? false;
|
|
20591
|
+
const setsize = isInfiniteScroll ? paginationInfo?.totalItems : void 0;
|
|
20592
|
+
const hasData = !!data?.length;
|
|
20593
|
+
const isGrouped = !!(groupField && dataByGroup);
|
|
20594
|
+
const renderItem = (item2) => /* @__PURE__ */ jsx74(
|
|
20595
|
+
PickerActivityItem,
|
|
20596
|
+
{
|
|
20597
|
+
view,
|
|
20598
|
+
multiselect: isMultiselect,
|
|
20599
|
+
selection,
|
|
20600
|
+
onChangeSelection,
|
|
20601
|
+
getItemId,
|
|
20602
|
+
item: item2,
|
|
20603
|
+
titleField,
|
|
20604
|
+
mediaField,
|
|
20605
|
+
descriptionField,
|
|
20606
|
+
otherFields,
|
|
20607
|
+
posinset: item2.position,
|
|
20608
|
+
setsize
|
|
20609
|
+
},
|
|
20610
|
+
getItemId(item2)
|
|
20611
|
+
);
|
|
20612
|
+
if (!hasData) {
|
|
20613
|
+
return /* @__PURE__ */ jsx74(
|
|
20614
|
+
"div",
|
|
20615
|
+
{
|
|
20616
|
+
className: clsx47({
|
|
20617
|
+
"dataviews-loading": isLoading,
|
|
20618
|
+
"dataviews-no-results": !isLoading
|
|
20619
|
+
}),
|
|
20620
|
+
children: isLoading ? /* @__PURE__ */ jsx74("p", { children: /* @__PURE__ */ jsx74(spinner_default, {}) }) : empty
|
|
20621
|
+
}
|
|
20622
|
+
);
|
|
20623
|
+
}
|
|
20624
|
+
return /* @__PURE__ */ jsxs19(Fragment12, { children: [
|
|
20625
|
+
/* @__PURE__ */ jsx74(
|
|
20626
|
+
Composite2,
|
|
20627
|
+
{
|
|
20628
|
+
virtualFocus: true,
|
|
20629
|
+
orientation: "vertical",
|
|
20630
|
+
role: "listbox",
|
|
20631
|
+
"aria-multiselectable": isMultiselect,
|
|
20632
|
+
"aria-label": itemListLabel,
|
|
20633
|
+
"aria-busy": isLoading,
|
|
20634
|
+
render: isGrouped ? /* @__PURE__ */ jsx74(Stack, { direction: "column", gap: "sm" }) : void 0,
|
|
20635
|
+
className: clsx47(
|
|
20636
|
+
"dataviews-view-picker-activity",
|
|
20637
|
+
className2
|
|
20638
|
+
),
|
|
20639
|
+
children: isGrouped && dataByGroup ? Array.from(dataByGroup.entries()).map(
|
|
20640
|
+
([groupName, groupItems]) => /* @__PURE__ */ jsx74(
|
|
20641
|
+
PickerActivityGroup,
|
|
20642
|
+
{
|
|
20643
|
+
groupName,
|
|
20644
|
+
groupField,
|
|
20645
|
+
showLabel: view.groupBy?.showLabel !== false,
|
|
20646
|
+
children: groupItems.map(renderItem)
|
|
20647
|
+
},
|
|
20648
|
+
groupName
|
|
20649
|
+
)
|
|
20650
|
+
) : data.map(renderItem)
|
|
20651
|
+
}
|
|
20652
|
+
),
|
|
20653
|
+
isLoading && /* @__PURE__ */ jsx74("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ jsx74(spinner_default, {}) })
|
|
20654
|
+
] });
|
|
20655
|
+
}
|
|
20656
|
+
|
|
20657
|
+
// src/components/dataviews-layouts/utils/density-picker.tsx
|
|
20658
|
+
import { __ as __34, _x as _x2 } from "@wordpress/i18n";
|
|
20659
|
+
import { jsx as jsx75, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
20660
|
+
function DensityPicker() {
|
|
20661
|
+
const context = useContext(dataviews_context_default);
|
|
20662
|
+
const view = context.view;
|
|
20663
|
+
return /* @__PURE__ */ jsxs20(
|
|
20664
|
+
component_default10,
|
|
20665
|
+
{
|
|
20666
|
+
size: "__unstable-large",
|
|
20667
|
+
label: __34("Density"),
|
|
20668
|
+
value: view.layout?.density || "balanced",
|
|
20669
|
+
onChange: (value) => {
|
|
20670
|
+
context.onChangeView({
|
|
20671
|
+
...view,
|
|
20672
|
+
layout: {
|
|
20673
|
+
...view.layout,
|
|
20674
|
+
density: value
|
|
20675
|
+
}
|
|
20676
|
+
});
|
|
20677
|
+
},
|
|
20678
|
+
isBlock: true,
|
|
20679
|
+
children: [
|
|
20680
|
+
/* @__PURE__ */ jsx75(
|
|
20681
|
+
component_default12,
|
|
20682
|
+
{
|
|
20683
|
+
value: "comfortable",
|
|
20684
|
+
label: _x2(
|
|
20685
|
+
"Comfortable",
|
|
20686
|
+
"Density option for DataView layout"
|
|
20687
|
+
)
|
|
20688
|
+
},
|
|
20689
|
+
"comfortable"
|
|
20690
|
+
),
|
|
20691
|
+
/* @__PURE__ */ jsx75(
|
|
20692
|
+
component_default12,
|
|
20693
|
+
{
|
|
20694
|
+
value: "balanced",
|
|
20695
|
+
label: _x2("Balanced", "Density option for DataView layout")
|
|
20696
|
+
},
|
|
20697
|
+
"balanced"
|
|
20698
|
+
),
|
|
20699
|
+
/* @__PURE__ */ jsx75(
|
|
20700
|
+
component_default12,
|
|
20701
|
+
{
|
|
20702
|
+
value: "compact",
|
|
20703
|
+
label: _x2("Compact", "Density option for DataView layout")
|
|
20704
|
+
},
|
|
20705
|
+
"compact"
|
|
20706
|
+
)
|
|
20707
|
+
]
|
|
20708
|
+
}
|
|
20709
|
+
);
|
|
20710
|
+
}
|
|
20711
|
+
|
|
20712
|
+
// src/components/dataviews-layouts/utils/preview-size-picker.tsx
|
|
20713
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
20714
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
20715
|
+
var imageSizes2 = [
|
|
20716
|
+
{
|
|
20717
|
+
value: 120,
|
|
20718
|
+
breakpoint: 1
|
|
20719
|
+
},
|
|
20720
|
+
{
|
|
20721
|
+
value: 170,
|
|
20722
|
+
breakpoint: 1
|
|
20723
|
+
},
|
|
20724
|
+
{
|
|
20725
|
+
value: 230,
|
|
20726
|
+
breakpoint: 1
|
|
20727
|
+
},
|
|
20728
|
+
{
|
|
20729
|
+
value: 290,
|
|
20471
20730
|
breakpoint: 1112
|
|
20472
20731
|
// at minimum image width, 4 images display at this container size
|
|
20473
20732
|
},
|
|
@@ -20495,12 +20754,12 @@ function PreviewSizePicker() {
|
|
|
20495
20754
|
value: index
|
|
20496
20755
|
};
|
|
20497
20756
|
});
|
|
20498
|
-
return /* @__PURE__ */
|
|
20757
|
+
return /* @__PURE__ */ jsx76(
|
|
20499
20758
|
range_control_default,
|
|
20500
20759
|
{
|
|
20501
20760
|
__next40pxDefaultSize: true,
|
|
20502
20761
|
showTooltip: false,
|
|
20503
|
-
label:
|
|
20762
|
+
label: __35("Preview size"),
|
|
20504
20763
|
value: previewSizeToUse,
|
|
20505
20764
|
min: 0,
|
|
20506
20765
|
max: breakValues.length - 1,
|
|
@@ -20521,11 +20780,11 @@ function PreviewSizePicker() {
|
|
|
20521
20780
|
}
|
|
20522
20781
|
|
|
20523
20782
|
// src/components/dataviews-layouts/utils/grid-config-options.tsx
|
|
20524
|
-
import { Fragment as
|
|
20783
|
+
import { Fragment as Fragment13, jsx as jsx77, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
20525
20784
|
function GridConfigOptions() {
|
|
20526
|
-
return /* @__PURE__ */
|
|
20527
|
-
/* @__PURE__ */
|
|
20528
|
-
/* @__PURE__ */
|
|
20785
|
+
return /* @__PURE__ */ jsxs21(Fragment13, { children: [
|
|
20786
|
+
/* @__PURE__ */ jsx77(DensityPicker, {}),
|
|
20787
|
+
/* @__PURE__ */ jsx77(PreviewSizePicker, {})
|
|
20529
20788
|
] });
|
|
20530
20789
|
}
|
|
20531
20790
|
|
|
@@ -20533,35 +20792,35 @@ function GridConfigOptions() {
|
|
|
20533
20792
|
var VIEW_LAYOUTS = [
|
|
20534
20793
|
{
|
|
20535
20794
|
type: LAYOUT_TABLE,
|
|
20536
|
-
label:
|
|
20795
|
+
label: __36("Table"),
|
|
20537
20796
|
component: table_default,
|
|
20538
20797
|
icon: block_table_default,
|
|
20539
20798
|
viewConfigOptions: DensityPicker
|
|
20540
20799
|
},
|
|
20541
20800
|
{
|
|
20542
20801
|
type: LAYOUT_GRID,
|
|
20543
|
-
label:
|
|
20802
|
+
label: __36("Grid"),
|
|
20544
20803
|
component: grid_default,
|
|
20545
20804
|
icon: category_default,
|
|
20546
20805
|
viewConfigOptions: GridConfigOptions
|
|
20547
20806
|
},
|
|
20548
20807
|
{
|
|
20549
20808
|
type: LAYOUT_LIST,
|
|
20550
|
-
label:
|
|
20809
|
+
label: __36("List"),
|
|
20551
20810
|
component: ViewList,
|
|
20552
20811
|
icon: isRTL12() ? format_list_bullets_rtl_default : format_list_bullets_default,
|
|
20553
20812
|
viewConfigOptions: DensityPicker
|
|
20554
20813
|
},
|
|
20555
20814
|
{
|
|
20556
20815
|
type: LAYOUT_ACTIVITY,
|
|
20557
|
-
label:
|
|
20816
|
+
label: __36("Activity"),
|
|
20558
20817
|
component: ViewActivity,
|
|
20559
20818
|
icon: scheduled_default,
|
|
20560
20819
|
viewConfigOptions: DensityPicker
|
|
20561
20820
|
},
|
|
20562
20821
|
{
|
|
20563
20822
|
type: LAYOUT_PICKER_GRID,
|
|
20564
|
-
label:
|
|
20823
|
+
label: __36("Grid"),
|
|
20565
20824
|
component: picker_grid_default,
|
|
20566
20825
|
icon: category_default,
|
|
20567
20826
|
viewConfigOptions: GridConfigOptions,
|
|
@@ -20569,23 +20828,31 @@ var VIEW_LAYOUTS = [
|
|
|
20569
20828
|
},
|
|
20570
20829
|
{
|
|
20571
20830
|
type: LAYOUT_PICKER_TABLE,
|
|
20572
|
-
label:
|
|
20831
|
+
label: __36("Table"),
|
|
20573
20832
|
component: picker_table_default,
|
|
20574
20833
|
icon: block_table_default,
|
|
20575
20834
|
viewConfigOptions: DensityPicker,
|
|
20576
20835
|
isPicker: true
|
|
20836
|
+
},
|
|
20837
|
+
{
|
|
20838
|
+
type: LAYOUT_PICKER_ACTIVITY,
|
|
20839
|
+
label: __36("Activity"),
|
|
20840
|
+
component: ViewPickerActivity,
|
|
20841
|
+
icon: scheduled_default,
|
|
20842
|
+
viewConfigOptions: DensityPicker,
|
|
20843
|
+
isPicker: true
|
|
20577
20844
|
}
|
|
20578
20845
|
];
|
|
20579
20846
|
|
|
20580
20847
|
// src/components/dataviews-filters/filter.tsx
|
|
20581
|
-
import
|
|
20582
|
-
import { __ as
|
|
20848
|
+
import clsx49 from "clsx";
|
|
20849
|
+
import { __ as __39, sprintf as sprintf17 } from "@wordpress/i18n";
|
|
20583
20850
|
|
|
20584
20851
|
// src/components/dataviews-filters/search-widget.tsx
|
|
20585
20852
|
import * as Ariakit21 from "@ariakit/react";
|
|
20586
20853
|
import removeAccents2 from "remove-accents";
|
|
20587
|
-
import
|
|
20588
|
-
import { __ as
|
|
20854
|
+
import clsx48 from "clsx";
|
|
20855
|
+
import { __ as __37, sprintf as sprintf15 } from "@wordpress/i18n";
|
|
20589
20856
|
|
|
20590
20857
|
// src/components/dataviews-filters/utils.ts
|
|
20591
20858
|
var EMPTY_ARRAY3 = [];
|
|
@@ -20643,7 +20910,7 @@ function useElements({
|
|
|
20643
20910
|
}
|
|
20644
20911
|
|
|
20645
20912
|
// src/components/dataviews-filters/search-widget.tsx
|
|
20646
|
-
import { jsx as
|
|
20913
|
+
import { jsx as jsx78, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
20647
20914
|
function normalizeSearchInput(input = "") {
|
|
20648
20915
|
return removeAccents2(input.trim().toLowerCase());
|
|
20649
20916
|
}
|
|
@@ -20660,22 +20927,22 @@ function generateFilterElementCompositeItemId(prefix, filterElementValue) {
|
|
|
20660
20927
|
return `${prefix}-${filterElementValue}`;
|
|
20661
20928
|
}
|
|
20662
20929
|
var MultiSelectionOption = ({ selected }) => {
|
|
20663
|
-
return /* @__PURE__ */
|
|
20930
|
+
return /* @__PURE__ */ jsx78(
|
|
20664
20931
|
"span",
|
|
20665
20932
|
{
|
|
20666
|
-
className:
|
|
20933
|
+
className: clsx48(
|
|
20667
20934
|
"dataviews-filters__search-widget-listitem-multi-selection",
|
|
20668
20935
|
{ "is-selected": selected }
|
|
20669
20936
|
),
|
|
20670
|
-
children: selected && /* @__PURE__ */
|
|
20937
|
+
children: selected && /* @__PURE__ */ jsx78(icon_default2, { icon: check_default })
|
|
20671
20938
|
}
|
|
20672
20939
|
);
|
|
20673
20940
|
};
|
|
20674
20941
|
var SingleSelectionOption = ({ selected }) => {
|
|
20675
|
-
return /* @__PURE__ */
|
|
20942
|
+
return /* @__PURE__ */ jsx78(
|
|
20676
20943
|
"span",
|
|
20677
20944
|
{
|
|
20678
|
-
className:
|
|
20945
|
+
className: clsx48(
|
|
20679
20946
|
"dataviews-filters__search-widget-listitem-single-selection",
|
|
20680
20947
|
{ "is-selected": selected }
|
|
20681
20948
|
)
|
|
@@ -20697,7 +20964,7 @@ function ListBox({ view, filter, onChangeView }) {
|
|
|
20697
20964
|
(f) => f.field === filter.field
|
|
20698
20965
|
);
|
|
20699
20966
|
const currentValue = getCurrentValue(filter, currentFilter);
|
|
20700
|
-
return /* @__PURE__ */
|
|
20967
|
+
return /* @__PURE__ */ jsx78(
|
|
20701
20968
|
Composite2,
|
|
20702
20969
|
{
|
|
20703
20970
|
virtualFocus: true,
|
|
@@ -20706,9 +20973,9 @@ function ListBox({ view, filter, onChangeView }) {
|
|
|
20706
20973
|
setActiveId: setActiveCompositeId,
|
|
20707
20974
|
role: "listbox",
|
|
20708
20975
|
className: "dataviews-filters__search-widget-listbox",
|
|
20709
|
-
"aria-label":
|
|
20976
|
+
"aria-label": sprintf15(
|
|
20710
20977
|
/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
|
|
20711
|
-
|
|
20978
|
+
__37("List of: %1$s"),
|
|
20712
20979
|
filter.name
|
|
20713
20980
|
),
|
|
20714
20981
|
onFocusVisible: () => {
|
|
@@ -20721,18 +20988,18 @@ function ListBox({ view, filter, onChangeView }) {
|
|
|
20721
20988
|
);
|
|
20722
20989
|
}
|
|
20723
20990
|
},
|
|
20724
|
-
render: /* @__PURE__ */
|
|
20725
|
-
children: filter.elements.map((element) => /* @__PURE__ */
|
|
20991
|
+
render: /* @__PURE__ */ jsx78(Composite2.Typeahead, {}),
|
|
20992
|
+
children: filter.elements.map((element) => /* @__PURE__ */ jsxs22(
|
|
20726
20993
|
Composite2.Hover,
|
|
20727
20994
|
{
|
|
20728
|
-
render: /* @__PURE__ */
|
|
20995
|
+
render: /* @__PURE__ */ jsx78(
|
|
20729
20996
|
Composite2.Item,
|
|
20730
20997
|
{
|
|
20731
20998
|
id: generateFilterElementCompositeItemId(
|
|
20732
20999
|
baseId,
|
|
20733
21000
|
element.value
|
|
20734
21001
|
),
|
|
20735
|
-
render: /* @__PURE__ */
|
|
21002
|
+
render: /* @__PURE__ */ jsx78(
|
|
20736
21003
|
"div",
|
|
20737
21004
|
{
|
|
20738
21005
|
"aria-label": element.label,
|
|
@@ -20779,19 +21046,19 @@ function ListBox({ view, filter, onChangeView }) {
|
|
|
20779
21046
|
}
|
|
20780
21047
|
),
|
|
20781
21048
|
children: [
|
|
20782
|
-
filter.singleSelection && /* @__PURE__ */
|
|
21049
|
+
filter.singleSelection && /* @__PURE__ */ jsx78(
|
|
20783
21050
|
SingleSelectionOption,
|
|
20784
21051
|
{
|
|
20785
21052
|
selected: currentValue === element.value
|
|
20786
21053
|
}
|
|
20787
21054
|
),
|
|
20788
|
-
!filter.singleSelection && /* @__PURE__ */
|
|
21055
|
+
!filter.singleSelection && /* @__PURE__ */ jsx78(
|
|
20789
21056
|
MultiSelectionOption,
|
|
20790
21057
|
{
|
|
20791
21058
|
selected: currentValue.includes(element.value)
|
|
20792
21059
|
}
|
|
20793
21060
|
),
|
|
20794
|
-
/* @__PURE__ */
|
|
21061
|
+
/* @__PURE__ */ jsx78(
|
|
20795
21062
|
"span",
|
|
20796
21063
|
{
|
|
20797
21064
|
className: "dataviews-filters__search-widget-listitem-value",
|
|
@@ -20819,7 +21086,7 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
20819
21086
|
(item2) => normalizeSearchInput(item2.label).includes(normalizedSearch)
|
|
20820
21087
|
);
|
|
20821
21088
|
}, [filter.elements, deferredSearchValue]);
|
|
20822
|
-
return /* @__PURE__ */
|
|
21089
|
+
return /* @__PURE__ */ jsxs22(
|
|
20823
21090
|
Ariakit21.ComboboxProvider,
|
|
20824
21091
|
{
|
|
20825
21092
|
selectedValue: currentValue,
|
|
@@ -20851,26 +21118,26 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
20851
21118
|
},
|
|
20852
21119
|
setValue: setSearchValue,
|
|
20853
21120
|
children: [
|
|
20854
|
-
/* @__PURE__ */
|
|
20855
|
-
/* @__PURE__ */
|
|
20856
|
-
/* @__PURE__ */
|
|
21121
|
+
/* @__PURE__ */ jsxs22("div", { className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [
|
|
21122
|
+
/* @__PURE__ */ jsx78(VisuallyHidden, { render: /* @__PURE__ */ jsx78(Ariakit21.ComboboxLabel, {}), children: __37("Search items") }),
|
|
21123
|
+
/* @__PURE__ */ jsx78(
|
|
20857
21124
|
Ariakit21.Combobox,
|
|
20858
21125
|
{
|
|
20859
21126
|
autoSelect: "always",
|
|
20860
|
-
placeholder:
|
|
21127
|
+
placeholder: __37("Search"),
|
|
20861
21128
|
className: "dataviews-filters__search-widget-filter-combobox__input"
|
|
20862
21129
|
}
|
|
20863
21130
|
),
|
|
20864
|
-
/* @__PURE__ */
|
|
21131
|
+
/* @__PURE__ */ jsx78("div", { className: "dataviews-filters__search-widget-filter-combobox__icon", children: /* @__PURE__ */ jsx78(icon_default2, { icon: search_default }) })
|
|
20865
21132
|
] }),
|
|
20866
|
-
/* @__PURE__ */
|
|
21133
|
+
/* @__PURE__ */ jsxs22(
|
|
20867
21134
|
Ariakit21.ComboboxList,
|
|
20868
21135
|
{
|
|
20869
21136
|
className: "dataviews-filters__search-widget-filter-combobox-list",
|
|
20870
21137
|
alwaysVisible: true,
|
|
20871
21138
|
children: [
|
|
20872
21139
|
matches.map((element) => {
|
|
20873
|
-
return /* @__PURE__ */
|
|
21140
|
+
return /* @__PURE__ */ jsxs22(
|
|
20874
21141
|
Ariakit21.ComboboxItem,
|
|
20875
21142
|
{
|
|
20876
21143
|
resetValueOnSelect: false,
|
|
@@ -20880,13 +21147,13 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
20880
21147
|
setValueOnClick: false,
|
|
20881
21148
|
focusOnHover: true,
|
|
20882
21149
|
children: [
|
|
20883
|
-
filter.singleSelection && /* @__PURE__ */
|
|
21150
|
+
filter.singleSelection && /* @__PURE__ */ jsx78(
|
|
20884
21151
|
SingleSelectionOption,
|
|
20885
21152
|
{
|
|
20886
21153
|
selected: currentValue === element.value
|
|
20887
21154
|
}
|
|
20888
21155
|
),
|
|
20889
|
-
!filter.singleSelection && /* @__PURE__ */
|
|
21156
|
+
!filter.singleSelection && /* @__PURE__ */ jsx78(
|
|
20890
21157
|
MultiSelectionOption,
|
|
20891
21158
|
{
|
|
20892
21159
|
selected: currentValue.includes(
|
|
@@ -20894,20 +21161,20 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
20894
21161
|
)
|
|
20895
21162
|
}
|
|
20896
21163
|
),
|
|
20897
|
-
/* @__PURE__ */
|
|
21164
|
+
/* @__PURE__ */ jsxs22(
|
|
20898
21165
|
"span",
|
|
20899
21166
|
{
|
|
20900
21167
|
className: "dataviews-filters__search-widget-listitem-value",
|
|
20901
21168
|
title: element.label,
|
|
20902
21169
|
children: [
|
|
20903
|
-
/* @__PURE__ */
|
|
21170
|
+
/* @__PURE__ */ jsx78(
|
|
20904
21171
|
Ariakit21.ComboboxItemValue,
|
|
20905
21172
|
{
|
|
20906
21173
|
className: "dataviews-filters__search-widget-filter-combobox-item-value",
|
|
20907
21174
|
value: element.label
|
|
20908
21175
|
}
|
|
20909
21176
|
),
|
|
20910
|
-
!!element.description && /* @__PURE__ */
|
|
21177
|
+
!!element.description && /* @__PURE__ */ jsx78("span", { className: "dataviews-filters__search-widget-listitem-description", children: element.description })
|
|
20911
21178
|
]
|
|
20912
21179
|
}
|
|
20913
21180
|
)
|
|
@@ -20916,7 +21183,7 @@ function ComboboxList2({ view, filter, onChangeView }) {
|
|
|
20916
21183
|
element.value
|
|
20917
21184
|
);
|
|
20918
21185
|
}),
|
|
20919
|
-
!matches.length && /* @__PURE__ */
|
|
21186
|
+
!matches.length && /* @__PURE__ */ jsx78("p", { children: __37("No results found") })
|
|
20920
21187
|
]
|
|
20921
21188
|
}
|
|
20922
21189
|
)
|
|
@@ -20930,18 +21197,18 @@ function SearchWidget(props) {
|
|
|
20930
21197
|
getElements: props.filter.getElements
|
|
20931
21198
|
});
|
|
20932
21199
|
if (isLoading) {
|
|
20933
|
-
return /* @__PURE__ */
|
|
21200
|
+
return /* @__PURE__ */ jsx78("div", { className: "dataviews-filters__search-widget-no-elements", children: /* @__PURE__ */ jsx78(spinner_default, {}) });
|
|
20934
21201
|
}
|
|
20935
21202
|
if (elements.length === 0) {
|
|
20936
|
-
return /* @__PURE__ */
|
|
21203
|
+
return /* @__PURE__ */ jsx78("div", { className: "dataviews-filters__search-widget-no-elements", children: __37("No elements found") });
|
|
20937
21204
|
}
|
|
20938
21205
|
const Widget = elements.length > 10 ? ComboboxList2 : ListBox;
|
|
20939
|
-
return /* @__PURE__ */
|
|
21206
|
+
return /* @__PURE__ */ jsx78(Widget, { ...props, filter: { ...props.filter, elements } });
|
|
20940
21207
|
}
|
|
20941
21208
|
|
|
20942
21209
|
// src/components/dataviews-filters/input-widget.tsx
|
|
20943
21210
|
import fastDeepEqual2 from "fast-deep-equal/es6/index.js";
|
|
20944
|
-
import { jsx as
|
|
21211
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
20945
21212
|
function InputWidget({
|
|
20946
21213
|
filter,
|
|
20947
21214
|
view,
|
|
@@ -21009,13 +21276,13 @@ function InputWidget({
|
|
|
21009
21276
|
if (!field || !field.Edit || !currentFilter) {
|
|
21010
21277
|
return null;
|
|
21011
21278
|
}
|
|
21012
|
-
return /* @__PURE__ */
|
|
21279
|
+
return /* @__PURE__ */ jsx79(
|
|
21013
21280
|
component_default3,
|
|
21014
21281
|
{
|
|
21015
21282
|
className: "dataviews-filters__user-input-widget",
|
|
21016
21283
|
gap: 2.5,
|
|
21017
21284
|
direction: "column",
|
|
21018
|
-
children: /* @__PURE__ */
|
|
21285
|
+
children: /* @__PURE__ */ jsx79(
|
|
21019
21286
|
field.Edit,
|
|
21020
21287
|
{
|
|
21021
21288
|
hideLabelFromVision: true,
|
|
@@ -21031,12 +21298,12 @@ function InputWidget({
|
|
|
21031
21298
|
|
|
21032
21299
|
// src/utils/operators.tsx
|
|
21033
21300
|
import { subDays, subWeeks, subMonths, subYears } from "date-fns";
|
|
21034
|
-
import { __ as
|
|
21301
|
+
import { __ as __38, sprintf as sprintf16 } from "@wordpress/i18n";
|
|
21035
21302
|
import { getDate } from "@wordpress/date";
|
|
21036
|
-
import { jsx as
|
|
21303
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
21037
21304
|
var filterTextWrappers = {
|
|
21038
|
-
Name: /* @__PURE__ */
|
|
21039
|
-
Value: /* @__PURE__ */
|
|
21305
|
+
Name: /* @__PURE__ */ jsx80("span", { className: "dataviews-filters__summary-filter-text-name" }),
|
|
21306
|
+
Value: /* @__PURE__ */ jsx80("span", { className: "dataviews-filters__summary-filter-text-value" })
|
|
21040
21307
|
};
|
|
21041
21308
|
function getRelativeDate(value, unit) {
|
|
21042
21309
|
switch (unit) {
|
|
@@ -21054,11 +21321,11 @@ function getRelativeDate(value, unit) {
|
|
|
21054
21321
|
}
|
|
21055
21322
|
var isNoneOperatorDefinition = {
|
|
21056
21323
|
/* translators: DataViews operator name */
|
|
21057
|
-
label:
|
|
21324
|
+
label: __38("Is none of"),
|
|
21058
21325
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21059
|
-
|
|
21326
|
+
sprintf16(
|
|
21060
21327
|
/* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is none of: Admin, Editor". */
|
|
21061
|
-
|
|
21328
|
+
__38("<Name>%1$s is none of: </Name><Value>%2$s</Value>"),
|
|
21062
21329
|
filter.name,
|
|
21063
21330
|
activeElements.map((element) => element.label).join(", ")
|
|
21064
21331
|
),
|
|
@@ -21084,11 +21351,11 @@ var OPERATORS = [
|
|
|
21084
21351
|
{
|
|
21085
21352
|
name: OPERATOR_IS_ANY,
|
|
21086
21353
|
/* translators: DataViews operator name */
|
|
21087
|
-
label:
|
|
21354
|
+
label: __38("Includes"),
|
|
21088
21355
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21089
|
-
|
|
21356
|
+
sprintf16(
|
|
21090
21357
|
/* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is any: Admin, Editor". */
|
|
21091
|
-
|
|
21358
|
+
__38("<Name>%1$s includes: </Name><Value>%2$s</Value>"),
|
|
21092
21359
|
filter.name,
|
|
21093
21360
|
activeElements.map((element) => element.label).join(", ")
|
|
21094
21361
|
),
|
|
@@ -21117,11 +21384,11 @@ var OPERATORS = [
|
|
|
21117
21384
|
{
|
|
21118
21385
|
name: OPERATOR_IS_ALL,
|
|
21119
21386
|
/* translators: DataViews operator name */
|
|
21120
|
-
label:
|
|
21387
|
+
label: __38("Includes all"),
|
|
21121
21388
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21122
|
-
|
|
21389
|
+
sprintf16(
|
|
21123
21390
|
/* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author includes all: Admin, Editor". */
|
|
21124
|
-
|
|
21391
|
+
__38("<Name>%1$s includes all: </Name><Value>%2$s</Value>"),
|
|
21125
21392
|
filter.name,
|
|
21126
21393
|
activeElements.map((element) => element.label).join(", ")
|
|
21127
21394
|
),
|
|
@@ -21144,11 +21411,11 @@ var OPERATORS = [
|
|
|
21144
21411
|
{
|
|
21145
21412
|
name: OPERATOR_BETWEEN,
|
|
21146
21413
|
/* translators: DataViews operator name */
|
|
21147
|
-
label:
|
|
21414
|
+
label: __38("Between (inc)"),
|
|
21148
21415
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21149
|
-
|
|
21416
|
+
sprintf16(
|
|
21150
21417
|
/* translators: 1: Filter name (e.g. "Item count"). 2: Filter value min. 3: Filter value max. e.g.: "Item count between (inc): 10 and 180". */
|
|
21151
|
-
|
|
21418
|
+
__38(
|
|
21152
21419
|
"<Name>%1$s between (inc): </Name><Value>%2$s and %3$s</Value>"
|
|
21153
21420
|
),
|
|
21154
21421
|
filter.name,
|
|
@@ -21172,11 +21439,11 @@ var OPERATORS = [
|
|
|
21172
21439
|
{
|
|
21173
21440
|
name: OPERATOR_IN_THE_PAST,
|
|
21174
21441
|
/* translators: DataViews operator name */
|
|
21175
|
-
label:
|
|
21442
|
+
label: __38("In the past"),
|
|
21176
21443
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21177
|
-
|
|
21444
|
+
sprintf16(
|
|
21178
21445
|
/* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is in the past: 7 days". */
|
|
21179
|
-
|
|
21446
|
+
__38(
|
|
21180
21447
|
"<Name>%1$s is in the past: </Name><Value>%2$s</Value>"
|
|
21181
21448
|
),
|
|
21182
21449
|
filter.name,
|
|
@@ -21200,11 +21467,11 @@ var OPERATORS = [
|
|
|
21200
21467
|
{
|
|
21201
21468
|
name: OPERATOR_OVER,
|
|
21202
21469
|
/* translators: DataViews operator name */
|
|
21203
|
-
label:
|
|
21470
|
+
label: __38("Over"),
|
|
21204
21471
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21205
|
-
|
|
21472
|
+
sprintf16(
|
|
21206
21473
|
/* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is over: 7 days". */
|
|
21207
|
-
|
|
21474
|
+
__38("<Name>%1$s is over: </Name><Value>%2$s</Value>"),
|
|
21208
21475
|
filter.name,
|
|
21209
21476
|
`${activeElements[0].value.value} ${activeElements[0].value.unit}`
|
|
21210
21477
|
),
|
|
@@ -21226,11 +21493,11 @@ var OPERATORS = [
|
|
|
21226
21493
|
{
|
|
21227
21494
|
name: OPERATOR_IS,
|
|
21228
21495
|
/* translators: DataViews operator name */
|
|
21229
|
-
label:
|
|
21496
|
+
label: __38("Is"),
|
|
21230
21497
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21231
|
-
|
|
21498
|
+
sprintf16(
|
|
21232
21499
|
/* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is: Admin". */
|
|
21233
|
-
|
|
21500
|
+
__38("<Name>%1$s is: </Name><Value>%2$s</Value>"),
|
|
21234
21501
|
filter.name,
|
|
21235
21502
|
activeElements[0].label
|
|
21236
21503
|
),
|
|
@@ -21244,11 +21511,11 @@ var OPERATORS = [
|
|
|
21244
21511
|
{
|
|
21245
21512
|
name: OPERATOR_IS_NOT,
|
|
21246
21513
|
/* translators: DataViews operator name */
|
|
21247
|
-
label:
|
|
21514
|
+
label: __38("Is not"),
|
|
21248
21515
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21249
|
-
|
|
21516
|
+
sprintf16(
|
|
21250
21517
|
/* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is not: Admin". */
|
|
21251
|
-
|
|
21518
|
+
__38("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
|
|
21252
21519
|
filter.name,
|
|
21253
21520
|
activeElements[0].label
|
|
21254
21521
|
),
|
|
@@ -21262,11 +21529,11 @@ var OPERATORS = [
|
|
|
21262
21529
|
{
|
|
21263
21530
|
name: OPERATOR_LESS_THAN,
|
|
21264
21531
|
/* translators: DataViews operator name */
|
|
21265
|
-
label:
|
|
21532
|
+
label: __38("Less than"),
|
|
21266
21533
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21267
|
-
|
|
21534
|
+
sprintf16(
|
|
21268
21535
|
/* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than: 10". */
|
|
21269
|
-
|
|
21536
|
+
__38("<Name>%1$s is less than: </Name><Value>%2$s</Value>"),
|
|
21270
21537
|
filter.name,
|
|
21271
21538
|
activeElements[0].label
|
|
21272
21539
|
),
|
|
@@ -21284,11 +21551,11 @@ var OPERATORS = [
|
|
|
21284
21551
|
{
|
|
21285
21552
|
name: OPERATOR_GREATER_THAN,
|
|
21286
21553
|
/* translators: DataViews operator name */
|
|
21287
|
-
label:
|
|
21554
|
+
label: __38("Greater than"),
|
|
21288
21555
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21289
|
-
|
|
21556
|
+
sprintf16(
|
|
21290
21557
|
/* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than: 10". */
|
|
21291
|
-
|
|
21558
|
+
__38(
|
|
21292
21559
|
"<Name>%1$s is greater than: </Name><Value>%2$s</Value>"
|
|
21293
21560
|
),
|
|
21294
21561
|
filter.name,
|
|
@@ -21308,11 +21575,11 @@ var OPERATORS = [
|
|
|
21308
21575
|
{
|
|
21309
21576
|
name: OPERATOR_LESS_THAN_OR_EQUAL,
|
|
21310
21577
|
/* translators: DataViews operator name */
|
|
21311
|
-
label:
|
|
21578
|
+
label: __38("Less than or equal"),
|
|
21312
21579
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21313
|
-
|
|
21580
|
+
sprintf16(
|
|
21314
21581
|
/* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than or equal to: 10". */
|
|
21315
|
-
|
|
21582
|
+
__38(
|
|
21316
21583
|
"<Name>%1$s is less than or equal to: </Name><Value>%2$s</Value>"
|
|
21317
21584
|
),
|
|
21318
21585
|
filter.name,
|
|
@@ -21332,11 +21599,11 @@ var OPERATORS = [
|
|
|
21332
21599
|
{
|
|
21333
21600
|
name: OPERATOR_GREATER_THAN_OR_EQUAL,
|
|
21334
21601
|
/* translators: DataViews operator name */
|
|
21335
|
-
label:
|
|
21602
|
+
label: __38("Greater than or equal"),
|
|
21336
21603
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21337
|
-
|
|
21604
|
+
sprintf16(
|
|
21338
21605
|
/* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than or equal to: 10". */
|
|
21339
|
-
|
|
21606
|
+
__38(
|
|
21340
21607
|
"<Name>%1$s is greater than or equal to: </Name><Value>%2$s</Value>"
|
|
21341
21608
|
),
|
|
21342
21609
|
filter.name,
|
|
@@ -21356,11 +21623,11 @@ var OPERATORS = [
|
|
|
21356
21623
|
{
|
|
21357
21624
|
name: OPERATOR_BEFORE,
|
|
21358
21625
|
/* translators: DataViews operator name */
|
|
21359
|
-
label:
|
|
21626
|
+
label: __38("Before"),
|
|
21360
21627
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21361
|
-
|
|
21628
|
+
sprintf16(
|
|
21362
21629
|
/* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is before: 2024-01-01". */
|
|
21363
|
-
|
|
21630
|
+
__38("<Name>%1$s is before: </Name><Value>%2$s</Value>"),
|
|
21364
21631
|
filter.name,
|
|
21365
21632
|
activeElements[0].label
|
|
21366
21633
|
),
|
|
@@ -21379,11 +21646,11 @@ var OPERATORS = [
|
|
|
21379
21646
|
{
|
|
21380
21647
|
name: OPERATOR_AFTER,
|
|
21381
21648
|
/* translators: DataViews operator name */
|
|
21382
|
-
label:
|
|
21649
|
+
label: __38("After"),
|
|
21383
21650
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21384
|
-
|
|
21651
|
+
sprintf16(
|
|
21385
21652
|
/* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is after: 2024-01-01". */
|
|
21386
|
-
|
|
21653
|
+
__38("<Name>%1$s is after: </Name><Value>%2$s</Value>"),
|
|
21387
21654
|
filter.name,
|
|
21388
21655
|
activeElements[0].label
|
|
21389
21656
|
),
|
|
@@ -21402,11 +21669,11 @@ var OPERATORS = [
|
|
|
21402
21669
|
{
|
|
21403
21670
|
name: OPERATOR_BEFORE_INC,
|
|
21404
21671
|
/* translators: DataViews operator name */
|
|
21405
|
-
label:
|
|
21672
|
+
label: __38("Before (inc)"),
|
|
21406
21673
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21407
|
-
|
|
21674
|
+
sprintf16(
|
|
21408
21675
|
/* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or before: 2024-01-01". */
|
|
21409
|
-
|
|
21676
|
+
__38(
|
|
21410
21677
|
"<Name>%1$s is on or before: </Name><Value>%2$s</Value>"
|
|
21411
21678
|
),
|
|
21412
21679
|
filter.name,
|
|
@@ -21427,11 +21694,11 @@ var OPERATORS = [
|
|
|
21427
21694
|
{
|
|
21428
21695
|
name: OPERATOR_AFTER_INC,
|
|
21429
21696
|
/* translators: DataViews operator name */
|
|
21430
|
-
label:
|
|
21697
|
+
label: __38("After (inc)"),
|
|
21431
21698
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21432
|
-
|
|
21699
|
+
sprintf16(
|
|
21433
21700
|
/* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or after: 2024-01-01". */
|
|
21434
|
-
|
|
21701
|
+
__38(
|
|
21435
21702
|
"<Name>%1$s is on or after: </Name><Value>%2$s</Value>"
|
|
21436
21703
|
),
|
|
21437
21704
|
filter.name,
|
|
@@ -21452,11 +21719,11 @@ var OPERATORS = [
|
|
|
21452
21719
|
{
|
|
21453
21720
|
name: OPERATOR_CONTAINS,
|
|
21454
21721
|
/* translators: DataViews operator name */
|
|
21455
|
-
label:
|
|
21722
|
+
label: __38("Contains"),
|
|
21456
21723
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21457
|
-
|
|
21724
|
+
sprintf16(
|
|
21458
21725
|
/* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title contains: Hello". */
|
|
21459
|
-
|
|
21726
|
+
__38("<Name>%1$s contains: </Name><Value>%2$s</Value>"),
|
|
21460
21727
|
filter.name,
|
|
21461
21728
|
activeElements[0].label
|
|
21462
21729
|
),
|
|
@@ -21474,11 +21741,11 @@ var OPERATORS = [
|
|
|
21474
21741
|
{
|
|
21475
21742
|
name: OPERATOR_NOT_CONTAINS,
|
|
21476
21743
|
/* translators: DataViews operator name */
|
|
21477
|
-
label:
|
|
21744
|
+
label: __38("Doesn't contain"),
|
|
21478
21745
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21479
|
-
|
|
21746
|
+
sprintf16(
|
|
21480
21747
|
/* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title doesn't contain: Hello". */
|
|
21481
|
-
|
|
21748
|
+
__38(
|
|
21482
21749
|
"<Name>%1$s doesn't contain: </Name><Value>%2$s</Value>"
|
|
21483
21750
|
),
|
|
21484
21751
|
filter.name,
|
|
@@ -21498,11 +21765,11 @@ var OPERATORS = [
|
|
|
21498
21765
|
{
|
|
21499
21766
|
name: OPERATOR_STARTS_WITH,
|
|
21500
21767
|
/* translators: DataViews operator name */
|
|
21501
|
-
label:
|
|
21768
|
+
label: __38("Starts with"),
|
|
21502
21769
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21503
|
-
|
|
21770
|
+
sprintf16(
|
|
21504
21771
|
/* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title starts with: Hello". */
|
|
21505
|
-
|
|
21772
|
+
__38("<Name>%1$s starts with: </Name><Value>%2$s</Value>"),
|
|
21506
21773
|
filter.name,
|
|
21507
21774
|
activeElements[0].label
|
|
21508
21775
|
),
|
|
@@ -21520,11 +21787,11 @@ var OPERATORS = [
|
|
|
21520
21787
|
{
|
|
21521
21788
|
name: OPERATOR_ON,
|
|
21522
21789
|
/* translators: DataViews operator name */
|
|
21523
|
-
label:
|
|
21790
|
+
label: __38("On"),
|
|
21524
21791
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21525
|
-
|
|
21792
|
+
sprintf16(
|
|
21526
21793
|
/* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is: 2024-01-01". */
|
|
21527
|
-
|
|
21794
|
+
__38("<Name>%1$s is: </Name><Value>%2$s</Value>"),
|
|
21528
21795
|
filter.name,
|
|
21529
21796
|
activeElements[0].label
|
|
21530
21797
|
),
|
|
@@ -21543,11 +21810,11 @@ var OPERATORS = [
|
|
|
21543
21810
|
{
|
|
21544
21811
|
name: OPERATOR_NOT_ON,
|
|
21545
21812
|
/* translators: DataViews operator name */
|
|
21546
|
-
label:
|
|
21813
|
+
label: __38("Not on"),
|
|
21547
21814
|
filterText: (filter, activeElements) => create_interpolate_element_default(
|
|
21548
|
-
|
|
21815
|
+
sprintf16(
|
|
21549
21816
|
/* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is not: 2024-01-01". */
|
|
21550
|
-
|
|
21817
|
+
__38("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
|
|
21551
21818
|
filter.name,
|
|
21552
21819
|
activeElements[0].label
|
|
21553
21820
|
),
|
|
@@ -21572,7 +21839,7 @@ var isSingleSelectionOperator = (name) => OPERATORS.filter((op) => op.selection
|
|
|
21572
21839
|
var isRegisteredOperator = (name) => OPERATORS.some((op) => op.name === name);
|
|
21573
21840
|
|
|
21574
21841
|
// src/components/dataviews-filters/filter.tsx
|
|
21575
|
-
import { jsx as
|
|
21842
|
+
import { jsx as jsx81, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
21576
21843
|
var ENTER = "Enter";
|
|
21577
21844
|
var SPACE = " ";
|
|
21578
21845
|
var FilterText = ({
|
|
@@ -21587,9 +21854,9 @@ var FilterText = ({
|
|
|
21587
21854
|
if (operator !== void 0) {
|
|
21588
21855
|
return operator.filterText(filter, activeElements);
|
|
21589
21856
|
}
|
|
21590
|
-
return
|
|
21857
|
+
return sprintf17(
|
|
21591
21858
|
/* translators: 1: Filter name e.g.: "Unknown status for Author". */
|
|
21592
|
-
|
|
21859
|
+
__39("Unknown status for %1$s"),
|
|
21593
21860
|
filter.name
|
|
21594
21861
|
);
|
|
21595
21862
|
};
|
|
@@ -21606,7 +21873,7 @@ function OperatorSelector({
|
|
|
21606
21873
|
(_filter) => _filter.field === filter.field
|
|
21607
21874
|
);
|
|
21608
21875
|
const value = currentFilter?.operator || filter.operators[0];
|
|
21609
|
-
return operatorOptions.length > 1 && /* @__PURE__ */
|
|
21876
|
+
return operatorOptions.length > 1 && /* @__PURE__ */ jsxs23(
|
|
21610
21877
|
Stack,
|
|
21611
21878
|
{
|
|
21612
21879
|
direction: "row",
|
|
@@ -21615,12 +21882,12 @@ function OperatorSelector({
|
|
|
21615
21882
|
className: "dataviews-filters__summary-operators-container",
|
|
21616
21883
|
align: "center",
|
|
21617
21884
|
children: [
|
|
21618
|
-
/* @__PURE__ */
|
|
21619
|
-
/* @__PURE__ */
|
|
21885
|
+
/* @__PURE__ */ jsx81(component_default4, { className: "dataviews-filters__summary-operators-filter-name", children: filter.name }),
|
|
21886
|
+
/* @__PURE__ */ jsx81(
|
|
21620
21887
|
select_control_default,
|
|
21621
21888
|
{
|
|
21622
21889
|
className: "dataviews-filters__summary-operators-filter-select",
|
|
21623
|
-
label:
|
|
21890
|
+
label: __39("Conditions"),
|
|
21624
21891
|
value,
|
|
21625
21892
|
options: operatorOptions,
|
|
21626
21893
|
onChange: (newValue) => {
|
|
@@ -21742,8 +22009,8 @@ function Filter({
|
|
|
21742
22009
|
const isLocked = filterInView?.isLocked;
|
|
21743
22010
|
const hasValues = !isLocked && filterInView?.value !== void 0;
|
|
21744
22011
|
const canResetOrRemove = !isLocked && (!isPrimary || hasValues);
|
|
21745
|
-
const resetOrRemoveLabel = isPrimary ?
|
|
21746
|
-
return /* @__PURE__ */
|
|
22012
|
+
const resetOrRemoveLabel = isPrimary ? __39("Reset") : __39("Remove");
|
|
22013
|
+
return /* @__PURE__ */ jsx81(
|
|
21747
22014
|
dropdown_default,
|
|
21748
22015
|
{
|
|
21749
22016
|
defaultOpen: openedFilter === filter.field,
|
|
@@ -21752,15 +22019,15 @@ function Filter({
|
|
|
21752
22019
|
onClose: () => {
|
|
21753
22020
|
toggleRef.current?.focus();
|
|
21754
22021
|
},
|
|
21755
|
-
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */
|
|
21756
|
-
/* @__PURE__ */
|
|
21757
|
-
/* @__PURE__ */
|
|
22022
|
+
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ jsxs23("div", { className: "dataviews-filters__summary-chip-container", children: [
|
|
22023
|
+
/* @__PURE__ */ jsxs23(tooltip_exports.Root, { children: [
|
|
22024
|
+
/* @__PURE__ */ jsx81(
|
|
21758
22025
|
tooltip_exports.Trigger,
|
|
21759
22026
|
{
|
|
21760
|
-
render: /* @__PURE__ */
|
|
22027
|
+
render: /* @__PURE__ */ jsx81(
|
|
21761
22028
|
"div",
|
|
21762
22029
|
{
|
|
21763
|
-
className:
|
|
22030
|
+
className: clsx49(
|
|
21764
22031
|
"dataviews-filters__summary-chip",
|
|
21765
22032
|
{
|
|
21766
22033
|
"has-reset": canResetOrRemove,
|
|
@@ -21787,7 +22054,7 @@ function Filter({
|
|
|
21787
22054
|
"aria-pressed": isOpen,
|
|
21788
22055
|
"aria-expanded": isOpen,
|
|
21789
22056
|
ref: toggleRef,
|
|
21790
|
-
children: /* @__PURE__ */
|
|
22057
|
+
children: /* @__PURE__ */ jsx81(
|
|
21791
22058
|
FilterText,
|
|
21792
22059
|
{
|
|
21793
22060
|
activeElements,
|
|
@@ -21799,20 +22066,20 @@ function Filter({
|
|
|
21799
22066
|
)
|
|
21800
22067
|
}
|
|
21801
22068
|
),
|
|
21802
|
-
/* @__PURE__ */
|
|
22069
|
+
/* @__PURE__ */ jsx81(tooltip_exports.Popup, { children: sprintf17(
|
|
21803
22070
|
/* translators: 1: Filter name. */
|
|
21804
|
-
|
|
22071
|
+
__39("Filter by: %1$s"),
|
|
21805
22072
|
filter.name.toLowerCase()
|
|
21806
22073
|
) })
|
|
21807
22074
|
] }),
|
|
21808
|
-
canResetOrRemove && /* @__PURE__ */
|
|
21809
|
-
/* @__PURE__ */
|
|
22075
|
+
canResetOrRemove && /* @__PURE__ */ jsxs23(tooltip_exports.Root, { children: [
|
|
22076
|
+
/* @__PURE__ */ jsx81(
|
|
21810
22077
|
tooltip_exports.Trigger,
|
|
21811
22078
|
{
|
|
21812
|
-
render: /* @__PURE__ */
|
|
22079
|
+
render: /* @__PURE__ */ jsx81(
|
|
21813
22080
|
"button",
|
|
21814
22081
|
{
|
|
21815
|
-
className:
|
|
22082
|
+
className: clsx49(
|
|
21816
22083
|
"dataviews-filters__summary-chip-remove",
|
|
21817
22084
|
{ "has-values": hasValues }
|
|
21818
22085
|
),
|
|
@@ -21831,18 +22098,18 @@ function Filter({
|
|
|
21831
22098
|
toggleRef.current?.focus();
|
|
21832
22099
|
}
|
|
21833
22100
|
},
|
|
21834
|
-
children: /* @__PURE__ */
|
|
22101
|
+
children: /* @__PURE__ */ jsx81(icon_default2, { icon: close_small_default })
|
|
21835
22102
|
}
|
|
21836
22103
|
)
|
|
21837
22104
|
}
|
|
21838
22105
|
),
|
|
21839
|
-
/* @__PURE__ */
|
|
22106
|
+
/* @__PURE__ */ jsx81(tooltip_exports.Popup, { children: resetOrRemoveLabel })
|
|
21840
22107
|
] })
|
|
21841
22108
|
] }),
|
|
21842
22109
|
renderContent: () => {
|
|
21843
|
-
return /* @__PURE__ */
|
|
21844
|
-
/* @__PURE__ */
|
|
21845
|
-
commonProps.filter.hasElements ? /* @__PURE__ */
|
|
22110
|
+
return /* @__PURE__ */ jsxs23(Stack, { direction: "column", justify: "flex-start", children: [
|
|
22111
|
+
/* @__PURE__ */ jsx81(OperatorSelector, { ...commonProps }),
|
|
22112
|
+
commonProps.filter.hasElements ? /* @__PURE__ */ jsx81(
|
|
21846
22113
|
SearchWidget,
|
|
21847
22114
|
{
|
|
21848
22115
|
...commonProps,
|
|
@@ -21851,7 +22118,7 @@ function Filter({
|
|
|
21851
22118
|
elements
|
|
21852
22119
|
}
|
|
21853
22120
|
}
|
|
21854
|
-
) : /* @__PURE__ */
|
|
22121
|
+
) : /* @__PURE__ */ jsx81(InputWidget, { ...commonProps, fields })
|
|
21855
22122
|
] });
|
|
21856
22123
|
}
|
|
21857
22124
|
}
|
|
@@ -21859,8 +22126,8 @@ function Filter({
|
|
|
21859
22126
|
}
|
|
21860
22127
|
|
|
21861
22128
|
// src/components/dataviews-filters/add-filter.tsx
|
|
21862
|
-
import { __ as
|
|
21863
|
-
import { jsx as
|
|
22129
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
22130
|
+
import { jsx as jsx82, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
21864
22131
|
var { Menu: Menu7 } = unlock5(privateApis2);
|
|
21865
22132
|
function AddFilterMenu({
|
|
21866
22133
|
filters,
|
|
@@ -21870,10 +22137,10 @@ function AddFilterMenu({
|
|
|
21870
22137
|
triggerProps
|
|
21871
22138
|
}) {
|
|
21872
22139
|
const inactiveFilters = filters.filter((filter) => !filter.isVisible);
|
|
21873
|
-
return /* @__PURE__ */
|
|
21874
|
-
/* @__PURE__ */
|
|
21875
|
-
/* @__PURE__ */
|
|
21876
|
-
return /* @__PURE__ */
|
|
22140
|
+
return /* @__PURE__ */ jsxs24(Menu7, { children: [
|
|
22141
|
+
/* @__PURE__ */ jsx82(Menu7.TriggerButton, { ...triggerProps }),
|
|
22142
|
+
/* @__PURE__ */ jsx82(Menu7.Popover, { children: inactiveFilters.map((filter) => {
|
|
22143
|
+
return /* @__PURE__ */ jsx82(
|
|
21877
22144
|
Menu7.Item,
|
|
21878
22145
|
{
|
|
21879
22146
|
onClick: () => {
|
|
@@ -21891,7 +22158,7 @@ function AddFilterMenu({
|
|
|
21891
22158
|
]
|
|
21892
22159
|
});
|
|
21893
22160
|
},
|
|
21894
|
-
children: /* @__PURE__ */
|
|
22161
|
+
children: /* @__PURE__ */ jsx82(Menu7.ItemLabel, { children: filter.name })
|
|
21895
22162
|
},
|
|
21896
22163
|
filter.field
|
|
21897
22164
|
);
|
|
@@ -21903,11 +22170,11 @@ function AddFilter({ filters, view, onChangeView, setOpenedFilter }, ref) {
|
|
|
21903
22170
|
return null;
|
|
21904
22171
|
}
|
|
21905
22172
|
const inactiveFilters = filters.filter((filter) => !filter.isVisible);
|
|
21906
|
-
return /* @__PURE__ */
|
|
22173
|
+
return /* @__PURE__ */ jsx82(
|
|
21907
22174
|
AddFilterMenu,
|
|
21908
22175
|
{
|
|
21909
22176
|
triggerProps: {
|
|
21910
|
-
render: /* @__PURE__ */
|
|
22177
|
+
render: /* @__PURE__ */ jsx82(
|
|
21911
22178
|
button_default,
|
|
21912
22179
|
{
|
|
21913
22180
|
accessibleWhenDisabled: true,
|
|
@@ -21918,7 +22185,7 @@ function AddFilter({ filters, view, onChangeView, setOpenedFilter }, ref) {
|
|
|
21918
22185
|
ref
|
|
21919
22186
|
}
|
|
21920
22187
|
),
|
|
21921
|
-
children:
|
|
22188
|
+
children: __40("Add filter")
|
|
21922
22189
|
},
|
|
21923
22190
|
...{ filters, view, onChangeView, setOpenedFilter }
|
|
21924
22191
|
}
|
|
@@ -21927,8 +22194,8 @@ function AddFilter({ filters, view, onChangeView, setOpenedFilter }, ref) {
|
|
|
21927
22194
|
var add_filter_default = forwardRef(AddFilter);
|
|
21928
22195
|
|
|
21929
22196
|
// src/components/dataviews-filters/reset-filters.tsx
|
|
21930
|
-
import { __ as
|
|
21931
|
-
import { jsx as
|
|
22197
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
22198
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
21932
22199
|
function ResetFilter({
|
|
21933
22200
|
filters,
|
|
21934
22201
|
view,
|
|
@@ -21940,7 +22207,7 @@ function ResetFilter({
|
|
|
21940
22207
|
const isDisabled = !view.search && !view.filters?.some(
|
|
21941
22208
|
(_filter) => !_filter.isLocked && (_filter.value !== void 0 || !isPrimary(_filter.field))
|
|
21942
22209
|
);
|
|
21943
|
-
return /* @__PURE__ */
|
|
22210
|
+
return /* @__PURE__ */ jsx83(
|
|
21944
22211
|
button_default,
|
|
21945
22212
|
{
|
|
21946
22213
|
disabled: isDisabled,
|
|
@@ -21956,7 +22223,7 @@ function ResetFilter({
|
|
|
21956
22223
|
filters: view.filters?.filter((f) => !!f.isLocked) || []
|
|
21957
22224
|
});
|
|
21958
22225
|
},
|
|
21959
|
-
children:
|
|
22226
|
+
children: __41("Reset")
|
|
21960
22227
|
}
|
|
21961
22228
|
);
|
|
21962
22229
|
}
|
|
@@ -22012,12 +22279,12 @@ function useFilters(fields, view) {
|
|
|
22012
22279
|
var use_filters_default = useFilters;
|
|
22013
22280
|
|
|
22014
22281
|
// src/components/dataviews-filters/filters.tsx
|
|
22015
|
-
import { jsx as
|
|
22282
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
22016
22283
|
function Filters({ className: className2 }) {
|
|
22017
22284
|
const { fields, view, onChangeView, openedFilter, setOpenedFilter } = useContext(dataviews_context_default);
|
|
22018
22285
|
const addFilterRef = useRef(null);
|
|
22019
22286
|
const filters = use_filters_default(fields, view);
|
|
22020
|
-
const addFilter = /* @__PURE__ */
|
|
22287
|
+
const addFilter = /* @__PURE__ */ jsx84(
|
|
22021
22288
|
add_filter_default,
|
|
22022
22289
|
{
|
|
22023
22290
|
filters,
|
|
@@ -22034,7 +22301,7 @@ function Filters({ className: className2 }) {
|
|
|
22034
22301
|
}
|
|
22035
22302
|
const filterComponents = [
|
|
22036
22303
|
...visibleFilters.map((filter) => {
|
|
22037
|
-
return /* @__PURE__ */
|
|
22304
|
+
return /* @__PURE__ */ jsx84(
|
|
22038
22305
|
Filter,
|
|
22039
22306
|
{
|
|
22040
22307
|
filter,
|
|
@@ -22050,7 +22317,7 @@ function Filters({ className: className2 }) {
|
|
|
22050
22317
|
addFilter
|
|
22051
22318
|
];
|
|
22052
22319
|
filterComponents.push(
|
|
22053
|
-
/* @__PURE__ */
|
|
22320
|
+
/* @__PURE__ */ jsx84(
|
|
22054
22321
|
ResetFilter,
|
|
22055
22322
|
{
|
|
22056
22323
|
filters,
|
|
@@ -22060,7 +22327,7 @@ function Filters({ className: className2 }) {
|
|
|
22060
22327
|
"reset-filters"
|
|
22061
22328
|
)
|
|
22062
22329
|
);
|
|
22063
|
-
return /* @__PURE__ */
|
|
22330
|
+
return /* @__PURE__ */ jsx84(
|
|
22064
22331
|
Stack,
|
|
22065
22332
|
{
|
|
22066
22333
|
direction: "row",
|
|
@@ -22076,8 +22343,8 @@ function Filters({ className: className2 }) {
|
|
|
22076
22343
|
var filters_default = memo(Filters);
|
|
22077
22344
|
|
|
22078
22345
|
// src/components/dataviews-filters/toggle.tsx
|
|
22079
|
-
import { __ as
|
|
22080
|
-
import { Fragment as
|
|
22346
|
+
import { __ as __42, _x as _x3 } from "@wordpress/i18n";
|
|
22347
|
+
import { Fragment as Fragment14, jsx as jsx85, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
22081
22348
|
function FiltersToggle() {
|
|
22082
22349
|
const {
|
|
22083
22350
|
filters,
|
|
@@ -22100,7 +22367,7 @@ function FiltersToggle() {
|
|
|
22100
22367
|
}
|
|
22101
22368
|
const hasVisibleFilters = filters.some((filter) => filter.isVisible);
|
|
22102
22369
|
const addFilterButtonProps = {
|
|
22103
|
-
label:
|
|
22370
|
+
label: __42("Add filter"),
|
|
22104
22371
|
"aria-expanded": false,
|
|
22105
22372
|
isPressed: false
|
|
22106
22373
|
};
|
|
@@ -22118,7 +22385,7 @@ function FiltersToggle() {
|
|
|
22118
22385
|
const hasPrimaryOrLockedFilters = filters.some(
|
|
22119
22386
|
(filter) => filter.isPrimary || filter.isLocked
|
|
22120
22387
|
);
|
|
22121
|
-
const buttonComponent = /* @__PURE__ */
|
|
22388
|
+
const buttonComponent = /* @__PURE__ */ jsx85(
|
|
22122
22389
|
button_default,
|
|
22123
22390
|
{
|
|
22124
22391
|
ref: buttonRef,
|
|
@@ -22130,7 +22397,7 @@ function FiltersToggle() {
|
|
|
22130
22397
|
...hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps
|
|
22131
22398
|
}
|
|
22132
22399
|
);
|
|
22133
|
-
return /* @__PURE__ */
|
|
22400
|
+
return /* @__PURE__ */ jsx85("div", { className: "dataviews-filters__container-visibility-toggle", children: !hasVisibleFilters ? /* @__PURE__ */ jsx85(
|
|
22134
22401
|
AddFilterMenu,
|
|
22135
22402
|
{
|
|
22136
22403
|
filters,
|
|
@@ -22139,7 +22406,7 @@ function FiltersToggle() {
|
|
|
22139
22406
|
setOpenedFilter,
|
|
22140
22407
|
triggerProps: { render: buttonComponent }
|
|
22141
22408
|
}
|
|
22142
|
-
) : /* @__PURE__ */
|
|
22409
|
+
) : /* @__PURE__ */ jsx85(
|
|
22143
22410
|
FilterVisibilityToggle,
|
|
22144
22411
|
{
|
|
22145
22412
|
buttonRef,
|
|
@@ -22159,27 +22426,27 @@ function FilterVisibilityToggle({
|
|
|
22159
22426
|
},
|
|
22160
22427
|
[buttonRef]
|
|
22161
22428
|
);
|
|
22162
|
-
return /* @__PURE__ */
|
|
22429
|
+
return /* @__PURE__ */ jsxs25(Fragment14, { children: [
|
|
22163
22430
|
children,
|
|
22164
|
-
!!filtersCount && /* @__PURE__ */
|
|
22431
|
+
!!filtersCount && /* @__PURE__ */ jsx85("span", { className: "dataviews-filters-toggle__count", children: filtersCount })
|
|
22165
22432
|
] });
|
|
22166
22433
|
}
|
|
22167
22434
|
var toggle_default = FiltersToggle;
|
|
22168
22435
|
|
|
22169
22436
|
// src/components/dataviews-filters/filters-toggled.tsx
|
|
22170
|
-
import { jsx as
|
|
22437
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
22171
22438
|
function FiltersToggled(props) {
|
|
22172
22439
|
const { isShowingFilter } = useContext(dataviews_context_default);
|
|
22173
22440
|
if (!isShowingFilter) {
|
|
22174
22441
|
return null;
|
|
22175
22442
|
}
|
|
22176
|
-
return /* @__PURE__ */
|
|
22443
|
+
return /* @__PURE__ */ jsx86(filters_default, { ...props });
|
|
22177
22444
|
}
|
|
22178
22445
|
var filters_toggled_default = FiltersToggled;
|
|
22179
22446
|
|
|
22180
22447
|
// src/components/dataviews-layout/index.tsx
|
|
22181
|
-
import { __ as
|
|
22182
|
-
import { jsx as
|
|
22448
|
+
import { __ as __43 } from "@wordpress/i18n";
|
|
22449
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
22183
22450
|
function DataViewsLayout({ className: className2 }) {
|
|
22184
22451
|
const {
|
|
22185
22452
|
actions = [],
|
|
@@ -22199,7 +22466,7 @@ function DataViewsLayout({ className: className2 }) {
|
|
|
22199
22466
|
renderItemLink,
|
|
22200
22467
|
defaultLayouts,
|
|
22201
22468
|
containerRef,
|
|
22202
|
-
empty = /* @__PURE__ */
|
|
22469
|
+
empty = /* @__PURE__ */ jsx87("p", { children: __43("No results") })
|
|
22203
22470
|
} = useContext(dataviews_context_default);
|
|
22204
22471
|
const isDelayedInitialLoading = useDelayedLoading(!hasInitiallyLoaded, {
|
|
22205
22472
|
delay: 200
|
|
@@ -22208,12 +22475,12 @@ function DataViewsLayout({ className: className2 }) {
|
|
|
22208
22475
|
if (!isDelayedInitialLoading) {
|
|
22209
22476
|
return null;
|
|
22210
22477
|
}
|
|
22211
|
-
return /* @__PURE__ */
|
|
22478
|
+
return /* @__PURE__ */ jsx87("div", { className: "dataviews-loading", children: /* @__PURE__ */ jsx87("p", { children: /* @__PURE__ */ jsx87(spinner_default, {}) }) });
|
|
22212
22479
|
}
|
|
22213
22480
|
const ViewComponent = VIEW_LAYOUTS.find(
|
|
22214
22481
|
(v) => v.type === view.type && defaultLayouts[v.type]
|
|
22215
22482
|
)?.component;
|
|
22216
|
-
return /* @__PURE__ */
|
|
22483
|
+
return /* @__PURE__ */ jsx87("div", { className: "dataviews-layout__container", ref: containerRef, children: /* @__PURE__ */ jsx87(
|
|
22217
22484
|
ViewComponent,
|
|
22218
22485
|
{
|
|
22219
22486
|
className: className2,
|
|
@@ -22237,8 +22504,8 @@ function DataViewsLayout({ className: className2 }) {
|
|
|
22237
22504
|
}
|
|
22238
22505
|
|
|
22239
22506
|
// src/components/dataviews-footer/index.tsx
|
|
22240
|
-
import
|
|
22241
|
-
import { jsx as
|
|
22507
|
+
import clsx50 from "clsx";
|
|
22508
|
+
import { jsx as jsx88, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
22242
22509
|
var EMPTY_ARRAY5 = [];
|
|
22243
22510
|
function DataViewsFooter() {
|
|
22244
22511
|
const {
|
|
@@ -22255,24 +22522,24 @@ function DataViewsFooter() {
|
|
|
22255
22522
|
if (!isRefreshing && (!totalItems || !totalPages || totalPages <= 1 && !hasBulkActions)) {
|
|
22256
22523
|
return null;
|
|
22257
22524
|
}
|
|
22258
|
-
return (!!totalItems || isRefreshing) && /* @__PURE__ */
|
|
22525
|
+
return (!!totalItems || isRefreshing) && /* @__PURE__ */ jsx88(
|
|
22259
22526
|
"div",
|
|
22260
22527
|
{
|
|
22261
22528
|
className: "dataviews-footer",
|
|
22262
22529
|
inert: isRefreshing ? "true" : void 0,
|
|
22263
|
-
children: /* @__PURE__ */
|
|
22530
|
+
children: /* @__PURE__ */ jsxs26(
|
|
22264
22531
|
Stack,
|
|
22265
22532
|
{
|
|
22266
22533
|
direction: "row",
|
|
22267
22534
|
justify: "end",
|
|
22268
22535
|
align: "center",
|
|
22269
|
-
className:
|
|
22536
|
+
className: clsx50("dataviews-footer__content", {
|
|
22270
22537
|
"is-refreshing": isDelayedRefreshing
|
|
22271
22538
|
}),
|
|
22272
22539
|
gap: "sm",
|
|
22273
22540
|
children: [
|
|
22274
|
-
hasBulkActions && /* @__PURE__ */
|
|
22275
|
-
/* @__PURE__ */
|
|
22541
|
+
hasBulkActions && /* @__PURE__ */ jsx88(BulkActionsFooter, {}),
|
|
22542
|
+
/* @__PURE__ */ jsx88(dataviews_pagination_default, {})
|
|
22276
22543
|
]
|
|
22277
22544
|
}
|
|
22278
22545
|
)
|
|
@@ -22281,8 +22548,8 @@ function DataViewsFooter() {
|
|
|
22281
22548
|
}
|
|
22282
22549
|
|
|
22283
22550
|
// src/components/dataviews-search/index.tsx
|
|
22284
|
-
import { __ as
|
|
22285
|
-
import { jsx as
|
|
22551
|
+
import { __ as __44 } from "@wordpress/i18n";
|
|
22552
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
22286
22553
|
var DataViewsSearch = memo(function Search({ label }) {
|
|
22287
22554
|
const { view, onChangeView } = useContext(dataviews_context_default);
|
|
22288
22555
|
const [search, setSearch, debouncedSearch] = useDebouncedInput(
|
|
@@ -22309,8 +22576,8 @@ var DataViewsSearch = memo(function Search({ label }) {
|
|
|
22309
22576
|
});
|
|
22310
22577
|
}
|
|
22311
22578
|
}, [debouncedSearch]);
|
|
22312
|
-
const searchLabel = label ||
|
|
22313
|
-
return /* @__PURE__ */
|
|
22579
|
+
const searchLabel = label || __44("Search");
|
|
22580
|
+
return /* @__PURE__ */ jsx89(
|
|
22314
22581
|
search_control_default,
|
|
22315
22582
|
{
|
|
22316
22583
|
className: "dataviews-search",
|
|
@@ -22325,8 +22592,8 @@ var DataViewsSearch = memo(function Search({ label }) {
|
|
|
22325
22592
|
var dataviews_search_default = DataViewsSearch;
|
|
22326
22593
|
|
|
22327
22594
|
// src/components/dataviews-view-config/index.tsx
|
|
22328
|
-
import { __ as
|
|
22329
|
-
import { Fragment as
|
|
22595
|
+
import { __ as __45, _x as _x4 } from "@wordpress/i18n";
|
|
22596
|
+
import { Fragment as Fragment15, jsx as jsx90, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
22330
22597
|
var { Menu: Menu8 } = unlock5(privateApis2);
|
|
22331
22598
|
var DATAVIEWS_CONFIG_POPOVER_PROPS = {
|
|
22332
22599
|
className: "dataviews-config__popover",
|
|
@@ -22340,28 +22607,28 @@ function ViewTypeMenu() {
|
|
|
22340
22607
|
return null;
|
|
22341
22608
|
}
|
|
22342
22609
|
const activeView = VIEW_LAYOUTS.find((v) => view.type === v.type);
|
|
22343
|
-
return /* @__PURE__ */
|
|
22344
|
-
/* @__PURE__ */
|
|
22610
|
+
return /* @__PURE__ */ jsxs27(Menu8, { children: [
|
|
22611
|
+
/* @__PURE__ */ jsx90(
|
|
22345
22612
|
Menu8.TriggerButton,
|
|
22346
22613
|
{
|
|
22347
|
-
render: /* @__PURE__ */
|
|
22614
|
+
render: /* @__PURE__ */ jsx90(
|
|
22348
22615
|
button_default,
|
|
22349
22616
|
{
|
|
22350
22617
|
size: "compact",
|
|
22351
22618
|
icon: activeView?.icon,
|
|
22352
|
-
label:
|
|
22619
|
+
label: __45("Layout")
|
|
22353
22620
|
}
|
|
22354
22621
|
)
|
|
22355
22622
|
}
|
|
22356
22623
|
),
|
|
22357
|
-
/* @__PURE__ */
|
|
22624
|
+
/* @__PURE__ */ jsx90(Menu8.Popover, { children: availableLayouts.map((layout) => {
|
|
22358
22625
|
const config = VIEW_LAYOUTS.find(
|
|
22359
22626
|
(v) => v.type === layout
|
|
22360
22627
|
);
|
|
22361
22628
|
if (!config) {
|
|
22362
22629
|
return null;
|
|
22363
22630
|
}
|
|
22364
|
-
return /* @__PURE__ */
|
|
22631
|
+
return /* @__PURE__ */ jsx90(
|
|
22365
22632
|
Menu8.RadioItem,
|
|
22366
22633
|
{
|
|
22367
22634
|
value: layout,
|
|
@@ -22375,6 +22642,7 @@ function ViewTypeMenu() {
|
|
|
22375
22642
|
case "table":
|
|
22376
22643
|
case "pickerGrid":
|
|
22377
22644
|
case "pickerTable":
|
|
22645
|
+
case "pickerActivity":
|
|
22378
22646
|
case "activity":
|
|
22379
22647
|
const viewWithoutLayout = { ...view };
|
|
22380
22648
|
if ("layout" in viewWithoutLayout) {
|
|
@@ -22388,7 +22656,7 @@ function ViewTypeMenu() {
|
|
|
22388
22656
|
}
|
|
22389
22657
|
warning("Invalid dataview");
|
|
22390
22658
|
},
|
|
22391
|
-
children: /* @__PURE__ */
|
|
22659
|
+
children: /* @__PURE__ */ jsx90(Menu8.ItemLabel, { children: config.label })
|
|
22392
22660
|
},
|
|
22393
22661
|
layout
|
|
22394
22662
|
);
|
|
@@ -22408,11 +22676,11 @@ function SortFieldControl() {
|
|
|
22408
22676
|
};
|
|
22409
22677
|
});
|
|
22410
22678
|
}, [fields]);
|
|
22411
|
-
return /* @__PURE__ */
|
|
22679
|
+
return /* @__PURE__ */ jsx90(
|
|
22412
22680
|
select_control_default,
|
|
22413
22681
|
{
|
|
22414
22682
|
__next40pxDefaultSize: true,
|
|
22415
|
-
label:
|
|
22683
|
+
label: __45("Sort by"),
|
|
22416
22684
|
value: view.sort?.field,
|
|
22417
22685
|
options: orderOptions,
|
|
22418
22686
|
onChange: (value) => {
|
|
@@ -22440,13 +22708,13 @@ function SortDirectionControl() {
|
|
|
22440
22708
|
if (!value && view.sort?.field) {
|
|
22441
22709
|
value = "desc";
|
|
22442
22710
|
}
|
|
22443
|
-
return /* @__PURE__ */
|
|
22711
|
+
return /* @__PURE__ */ jsx90(
|
|
22444
22712
|
component_default10,
|
|
22445
22713
|
{
|
|
22446
22714
|
className: "dataviews-view-config__sort-direction",
|
|
22447
22715
|
__next40pxDefaultSize: true,
|
|
22448
22716
|
isBlock: true,
|
|
22449
|
-
label:
|
|
22717
|
+
label: __45("Order"),
|
|
22450
22718
|
value,
|
|
22451
22719
|
onChange: (newDirection) => {
|
|
22452
22720
|
if (newDirection === "asc" || newDirection === "desc") {
|
|
@@ -22466,7 +22734,7 @@ function SortDirectionControl() {
|
|
|
22466
22734
|
warning("Invalid direction");
|
|
22467
22735
|
},
|
|
22468
22736
|
children: SORTING_DIRECTIONS.map((direction) => {
|
|
22469
|
-
return /* @__PURE__ */
|
|
22737
|
+
return /* @__PURE__ */ jsx90(
|
|
22470
22738
|
component_default13,
|
|
22471
22739
|
{
|
|
22472
22740
|
value: direction,
|
|
@@ -22485,12 +22753,12 @@ function ItemsPerPageControl() {
|
|
|
22485
22753
|
if (!config || !config.perPageSizes || config.perPageSizes.length < 2 || config.perPageSizes.length > 6 || infiniteScrollEnabled) {
|
|
22486
22754
|
return null;
|
|
22487
22755
|
}
|
|
22488
|
-
return /* @__PURE__ */
|
|
22756
|
+
return /* @__PURE__ */ jsx90(
|
|
22489
22757
|
component_default10,
|
|
22490
22758
|
{
|
|
22491
22759
|
__next40pxDefaultSize: true,
|
|
22492
22760
|
isBlock: true,
|
|
22493
|
-
label:
|
|
22761
|
+
label: __45("Items per page"),
|
|
22494
22762
|
value: view.perPage || 10,
|
|
22495
22763
|
disabled: !view?.sort?.field,
|
|
22496
22764
|
onChange: (newItemsPerPage) => {
|
|
@@ -22502,7 +22770,7 @@ function ItemsPerPageControl() {
|
|
|
22502
22770
|
});
|
|
22503
22771
|
},
|
|
22504
22772
|
children: config.perPageSizes.map((value) => {
|
|
22505
|
-
return /* @__PURE__ */
|
|
22773
|
+
return /* @__PURE__ */ jsx90(
|
|
22506
22774
|
component_default12,
|
|
22507
22775
|
{
|
|
22508
22776
|
value,
|
|
@@ -22520,7 +22788,7 @@ function ResetViewButton() {
|
|
|
22520
22788
|
return null;
|
|
22521
22789
|
}
|
|
22522
22790
|
const isDisabled = onReset === false;
|
|
22523
|
-
return /* @__PURE__ */
|
|
22791
|
+
return /* @__PURE__ */ jsx90(
|
|
22524
22792
|
button_default,
|
|
22525
22793
|
{
|
|
22526
22794
|
variant: "tertiary",
|
|
@@ -22533,7 +22801,7 @@ function ResetViewButton() {
|
|
|
22533
22801
|
onReset();
|
|
22534
22802
|
}
|
|
22535
22803
|
},
|
|
22536
|
-
children:
|
|
22804
|
+
children: __45("Reset view")
|
|
22537
22805
|
}
|
|
22538
22806
|
);
|
|
22539
22807
|
}
|
|
@@ -22547,7 +22815,7 @@ function DataviewsViewConfigDropdown() {
|
|
|
22547
22815
|
(layout) => layout.type === view.type
|
|
22548
22816
|
);
|
|
22549
22817
|
const isModified = typeof onReset === "function";
|
|
22550
|
-
return /* @__PURE__ */
|
|
22818
|
+
return /* @__PURE__ */ jsx90(
|
|
22551
22819
|
dropdown_default,
|
|
22552
22820
|
{
|
|
22553
22821
|
expandOnMobile: true,
|
|
@@ -22556,8 +22824,8 @@ function DataviewsViewConfigDropdown() {
|
|
|
22556
22824
|
id: popoverId
|
|
22557
22825
|
},
|
|
22558
22826
|
renderToggle: ({ onToggle, isOpen }) => {
|
|
22559
|
-
return /* @__PURE__ */
|
|
22560
|
-
/* @__PURE__ */
|
|
22827
|
+
return /* @__PURE__ */ jsxs27("div", { className: "dataviews-view-config__toggle-wrapper", children: [
|
|
22828
|
+
/* @__PURE__ */ jsx90(
|
|
22561
22829
|
button_default,
|
|
22562
22830
|
{
|
|
22563
22831
|
size: "compact",
|
|
@@ -22571,22 +22839,22 @@ function DataviewsViewConfigDropdown() {
|
|
|
22571
22839
|
"aria-controls": popoverId
|
|
22572
22840
|
}
|
|
22573
22841
|
),
|
|
22574
|
-
isModified && /* @__PURE__ */
|
|
22842
|
+
isModified && /* @__PURE__ */ jsx90("span", { className: "dataviews-view-config__modified-indicator" })
|
|
22575
22843
|
] });
|
|
22576
22844
|
},
|
|
22577
|
-
renderContent: () => /* @__PURE__ */
|
|
22845
|
+
renderContent: () => /* @__PURE__ */ jsx90(
|
|
22578
22846
|
dropdown_content_wrapper_default,
|
|
22579
22847
|
{
|
|
22580
22848
|
paddingSize: "medium",
|
|
22581
22849
|
className: "dataviews-config__popover-content-wrapper",
|
|
22582
|
-
children: /* @__PURE__ */
|
|
22850
|
+
children: /* @__PURE__ */ jsxs27(
|
|
22583
22851
|
Stack,
|
|
22584
22852
|
{
|
|
22585
22853
|
direction: "column",
|
|
22586
22854
|
className: "dataviews-view-config",
|
|
22587
22855
|
gap: "xl",
|
|
22588
22856
|
children: [
|
|
22589
|
-
/* @__PURE__ */
|
|
22857
|
+
/* @__PURE__ */ jsxs27(
|
|
22590
22858
|
Stack,
|
|
22591
22859
|
{
|
|
22592
22860
|
direction: "row",
|
|
@@ -22594,34 +22862,34 @@ function DataviewsViewConfigDropdown() {
|
|
|
22594
22862
|
align: "center",
|
|
22595
22863
|
className: "dataviews-view-config__header",
|
|
22596
22864
|
children: [
|
|
22597
|
-
/* @__PURE__ */
|
|
22865
|
+
/* @__PURE__ */ jsx90(
|
|
22598
22866
|
component_default16,
|
|
22599
22867
|
{
|
|
22600
22868
|
level: 2,
|
|
22601
22869
|
className: "dataviews-settings-section__title",
|
|
22602
|
-
children:
|
|
22870
|
+
children: __45("Appearance")
|
|
22603
22871
|
}
|
|
22604
22872
|
),
|
|
22605
|
-
/* @__PURE__ */
|
|
22873
|
+
/* @__PURE__ */ jsx90(ResetViewButton, {})
|
|
22606
22874
|
]
|
|
22607
22875
|
}
|
|
22608
22876
|
),
|
|
22609
|
-
/* @__PURE__ */
|
|
22610
|
-
/* @__PURE__ */
|
|
22877
|
+
/* @__PURE__ */ jsxs27(Stack, { direction: "column", gap: "lg", children: [
|
|
22878
|
+
/* @__PURE__ */ jsxs27(
|
|
22611
22879
|
Stack,
|
|
22612
22880
|
{
|
|
22613
22881
|
direction: "row",
|
|
22614
22882
|
gap: "sm",
|
|
22615
22883
|
className: "dataviews-view-config__sort-controls",
|
|
22616
22884
|
children: [
|
|
22617
|
-
/* @__PURE__ */
|
|
22618
|
-
/* @__PURE__ */
|
|
22885
|
+
/* @__PURE__ */ jsx90(SortFieldControl, {}),
|
|
22886
|
+
/* @__PURE__ */ jsx90(SortDirectionControl, {})
|
|
22619
22887
|
]
|
|
22620
22888
|
}
|
|
22621
22889
|
),
|
|
22622
|
-
!!activeLayout?.viewConfigOptions && /* @__PURE__ */
|
|
22623
|
-
/* @__PURE__ */
|
|
22624
|
-
/* @__PURE__ */
|
|
22890
|
+
!!activeLayout?.viewConfigOptions && /* @__PURE__ */ jsx90(activeLayout.viewConfigOptions, {}),
|
|
22891
|
+
/* @__PURE__ */ jsx90(ItemsPerPageControl, {}),
|
|
22892
|
+
/* @__PURE__ */ jsx90(PropertiesSection, {})
|
|
22625
22893
|
] })
|
|
22626
22894
|
]
|
|
22627
22895
|
}
|
|
@@ -22632,9 +22900,9 @@ function DataviewsViewConfigDropdown() {
|
|
|
22632
22900
|
);
|
|
22633
22901
|
}
|
|
22634
22902
|
function _DataViewsViewConfig() {
|
|
22635
|
-
return /* @__PURE__ */
|
|
22636
|
-
/* @__PURE__ */
|
|
22637
|
-
/* @__PURE__ */
|
|
22903
|
+
return /* @__PURE__ */ jsxs27(Fragment15, { children: [
|
|
22904
|
+
/* @__PURE__ */ jsx90(ViewTypeMenu, {}),
|
|
22905
|
+
/* @__PURE__ */ jsx90(DataviewsViewConfigDropdown, {})
|
|
22638
22906
|
] });
|
|
22639
22907
|
}
|
|
22640
22908
|
var DataViewsViewConfig = memo(_DataViewsViewConfig);
|
|
@@ -22664,7 +22932,7 @@ function getCustomValidity(isValid, validity) {
|
|
|
22664
22932
|
}
|
|
22665
22933
|
|
|
22666
22934
|
// src/components/dataform-controls/checkbox.tsx
|
|
22667
|
-
import { jsx as
|
|
22935
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
22668
22936
|
var { ValidatedCheckboxControl: ValidatedCheckboxControl2 } = unlock5(privateApis2);
|
|
22669
22937
|
function Checkbox({
|
|
22670
22938
|
field,
|
|
@@ -22681,7 +22949,7 @@ function Checkbox({
|
|
|
22681
22949
|
setValue({ item: data, value: !getValue({ item: data }) })
|
|
22682
22950
|
);
|
|
22683
22951
|
}, [data, getValue, onChange, setValue]);
|
|
22684
|
-
return /* @__PURE__ */
|
|
22952
|
+
return /* @__PURE__ */ jsx91(
|
|
22685
22953
|
ValidatedCheckboxControl2,
|
|
22686
22954
|
{
|
|
22687
22955
|
required: !!field.isValid?.required,
|
|
@@ -22698,7 +22966,7 @@ function Checkbox({
|
|
|
22698
22966
|
}
|
|
22699
22967
|
|
|
22700
22968
|
// src/components/dataform-controls/combobox.tsx
|
|
22701
|
-
import { jsx as
|
|
22969
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
22702
22970
|
var { ValidatedComboboxControl: ValidatedComboboxControl2 } = unlock5(privateApis2);
|
|
22703
22971
|
function Combobox2({
|
|
22704
22972
|
data,
|
|
@@ -22718,9 +22986,9 @@ function Combobox2({
|
|
|
22718
22986
|
getElements: field.getElements
|
|
22719
22987
|
});
|
|
22720
22988
|
if (isLoading) {
|
|
22721
|
-
return /* @__PURE__ */
|
|
22989
|
+
return /* @__PURE__ */ jsx92(spinner_default, {});
|
|
22722
22990
|
}
|
|
22723
|
-
return /* @__PURE__ */
|
|
22991
|
+
return /* @__PURE__ */ jsx92(
|
|
22724
22992
|
ValidatedComboboxControl2,
|
|
22725
22993
|
{
|
|
22726
22994
|
required: !!field.isValid?.required,
|
|
@@ -22739,25 +23007,25 @@ function Combobox2({
|
|
|
22739
23007
|
}
|
|
22740
23008
|
|
|
22741
23009
|
// src/components/dataform-controls/datetime.tsx
|
|
22742
|
-
import { __ as
|
|
23010
|
+
import { __ as __47 } from "@wordpress/i18n";
|
|
22743
23011
|
import { dateI18n, getDate as getDate3, getSettings } from "@wordpress/date";
|
|
22744
23012
|
|
|
22745
23013
|
// src/components/dataform-controls/utils/relative-date-control.tsx
|
|
22746
|
-
import
|
|
22747
|
-
import { __ as
|
|
22748
|
-
import { jsx as
|
|
23014
|
+
import clsx51 from "clsx";
|
|
23015
|
+
import { __ as __46 } from "@wordpress/i18n";
|
|
23016
|
+
import { jsx as jsx93, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
22749
23017
|
var TIME_UNITS_OPTIONS = {
|
|
22750
23018
|
[OPERATOR_IN_THE_PAST]: [
|
|
22751
|
-
{ value: "days", label:
|
|
22752
|
-
{ value: "weeks", label:
|
|
22753
|
-
{ value: "months", label:
|
|
22754
|
-
{ value: "years", label:
|
|
23019
|
+
{ value: "days", label: __46("Days") },
|
|
23020
|
+
{ value: "weeks", label: __46("Weeks") },
|
|
23021
|
+
{ value: "months", label: __46("Months") },
|
|
23022
|
+
{ value: "years", label: __46("Years") }
|
|
22755
23023
|
],
|
|
22756
23024
|
[OPERATOR_OVER]: [
|
|
22757
|
-
{ value: "days", label:
|
|
22758
|
-
{ value: "weeks", label:
|
|
22759
|
-
{ value: "months", label:
|
|
22760
|
-
{ value: "years", label:
|
|
23025
|
+
{ value: "days", label: __46("Days ago") },
|
|
23026
|
+
{ value: "weeks", label: __46("Weeks ago") },
|
|
23027
|
+
{ value: "months", label: __46("Months ago") },
|
|
23028
|
+
{ value: "years", label: __46("Years ago") }
|
|
22761
23029
|
]
|
|
22762
23030
|
};
|
|
22763
23031
|
function RelativeDateControl({
|
|
@@ -22791,16 +23059,16 @@ function RelativeDateControl({
|
|
|
22791
23059
|
),
|
|
22792
23060
|
[onChange, setValue, data, relValue]
|
|
22793
23061
|
);
|
|
22794
|
-
return /* @__PURE__ */
|
|
23062
|
+
return /* @__PURE__ */ jsx93(
|
|
22795
23063
|
base_control_default,
|
|
22796
23064
|
{
|
|
22797
23065
|
id,
|
|
22798
|
-
className:
|
|
23066
|
+
className: clsx51(className2, "dataviews-controls__relative-date"),
|
|
22799
23067
|
label,
|
|
22800
23068
|
hideLabelFromVision,
|
|
22801
23069
|
help: description,
|
|
22802
|
-
children: /* @__PURE__ */
|
|
22803
|
-
/* @__PURE__ */
|
|
23070
|
+
children: /* @__PURE__ */ jsxs28(Stack, { direction: "row", gap: "sm", children: [
|
|
23071
|
+
/* @__PURE__ */ jsx93(
|
|
22804
23072
|
number_control_default,
|
|
22805
23073
|
{
|
|
22806
23074
|
__next40pxDefaultSize: true,
|
|
@@ -22813,12 +23081,12 @@ function RelativeDateControl({
|
|
|
22813
23081
|
disabled
|
|
22814
23082
|
}
|
|
22815
23083
|
),
|
|
22816
|
-
/* @__PURE__ */
|
|
23084
|
+
/* @__PURE__ */ jsx93(
|
|
22817
23085
|
select_control_default,
|
|
22818
23086
|
{
|
|
22819
23087
|
className: "dataviews-controls__relative-date-unit",
|
|
22820
23088
|
__next40pxDefaultSize: true,
|
|
22821
|
-
label:
|
|
23089
|
+
label: __46("Unit"),
|
|
22822
23090
|
value: unit,
|
|
22823
23091
|
options: options2,
|
|
22824
23092
|
onChange: onChangeUnit,
|
|
@@ -22866,7 +23134,7 @@ function parseDateTime(dateTimeString) {
|
|
|
22866
23134
|
}
|
|
22867
23135
|
|
|
22868
23136
|
// src/components/dataform-controls/datetime.tsx
|
|
22869
|
-
import { jsx as
|
|
23137
|
+
import { jsx as jsx94, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
22870
23138
|
var { DateCalendar: DateCalendar2, ValidatedInputControl: ValidatedInputControl2 } = unlock5(privateApis2);
|
|
22871
23139
|
var formatDateTime = (value) => {
|
|
22872
23140
|
if (!value) {
|
|
@@ -22963,19 +23231,19 @@ function CalendarDateTimeControl({
|
|
|
22963
23231
|
} = getSettings();
|
|
22964
23232
|
let displayLabel = label;
|
|
22965
23233
|
if (isValid?.required && !markWhenOptional && !hideLabelFromVision) {
|
|
22966
|
-
displayLabel = `${label} (${
|
|
23234
|
+
displayLabel = `${label} (${__47("Required")})`;
|
|
22967
23235
|
} else if (!isValid?.required && markWhenOptional && !hideLabelFromVision) {
|
|
22968
|
-
displayLabel = `${label} (${
|
|
23236
|
+
displayLabel = `${label} (${__47("Optional")})`;
|
|
22969
23237
|
}
|
|
22970
|
-
return /* @__PURE__ */
|
|
23238
|
+
return /* @__PURE__ */ jsx94(
|
|
22971
23239
|
base_control_default,
|
|
22972
23240
|
{
|
|
22973
23241
|
id,
|
|
22974
23242
|
label: displayLabel,
|
|
22975
23243
|
help: description,
|
|
22976
23244
|
hideLabelFromVision,
|
|
22977
|
-
children: /* @__PURE__ */
|
|
22978
|
-
/* @__PURE__ */
|
|
23245
|
+
children: /* @__PURE__ */ jsxs29(Stack, { direction: "column", gap: "lg", children: [
|
|
23246
|
+
/* @__PURE__ */ jsx94(
|
|
22979
23247
|
ValidatedInputControl2,
|
|
22980
23248
|
{
|
|
22981
23249
|
ref: inputControlRef,
|
|
@@ -22983,7 +23251,7 @@ function CalendarDateTimeControl({
|
|
|
22983
23251
|
required: !!isValid?.required,
|
|
22984
23252
|
customValidity: getCustomValidity(isValid, validity),
|
|
22985
23253
|
type: "datetime-local",
|
|
22986
|
-
label:
|
|
23254
|
+
label: __47("Date time"),
|
|
22987
23255
|
hideLabelFromVision: true,
|
|
22988
23256
|
value: formatDateTime(value),
|
|
22989
23257
|
onChange: handleManualDateTimeChange,
|
|
@@ -22992,7 +23260,7 @@ function CalendarDateTimeControl({
|
|
|
22992
23260
|
max: maxConstraint ? formatDateTime(maxConstraint) : void 0
|
|
22993
23261
|
}
|
|
22994
23262
|
),
|
|
22995
|
-
!compact && /* @__PURE__ */
|
|
23263
|
+
!compact && /* @__PURE__ */ jsx94(
|
|
22996
23264
|
DateCalendar2,
|
|
22997
23265
|
{
|
|
22998
23266
|
style: { width: "100%" },
|
|
@@ -23020,7 +23288,7 @@ function DateTime({
|
|
|
23020
23288
|
config
|
|
23021
23289
|
}) {
|
|
23022
23290
|
if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
|
|
23023
|
-
return /* @__PURE__ */
|
|
23291
|
+
return /* @__PURE__ */ jsx94(
|
|
23024
23292
|
RelativeDateControl,
|
|
23025
23293
|
{
|
|
23026
23294
|
className: "dataviews-controls__datetime",
|
|
@@ -23032,7 +23300,7 @@ function DateTime({
|
|
|
23032
23300
|
}
|
|
23033
23301
|
);
|
|
23034
23302
|
}
|
|
23035
|
-
return /* @__PURE__ */
|
|
23303
|
+
return /* @__PURE__ */ jsx94(
|
|
23036
23304
|
CalendarDateTimeControl,
|
|
23037
23305
|
{
|
|
23038
23306
|
data,
|
|
@@ -23047,7 +23315,7 @@ function DateTime({
|
|
|
23047
23315
|
}
|
|
23048
23316
|
|
|
23049
23317
|
// src/components/dataform-controls/date.tsx
|
|
23050
|
-
import
|
|
23318
|
+
import clsx52 from "clsx";
|
|
23051
23319
|
import {
|
|
23052
23320
|
format,
|
|
23053
23321
|
isValid as isValidDate2,
|
|
@@ -23057,19 +23325,19 @@ import {
|
|
|
23057
23325
|
startOfMonth,
|
|
23058
23326
|
startOfYear
|
|
23059
23327
|
} from "date-fns";
|
|
23060
|
-
import { __ as
|
|
23328
|
+
import { __ as __48 } from "@wordpress/i18n";
|
|
23061
23329
|
import { getDate as getDate4, getSettings as getSettings2 } from "@wordpress/date";
|
|
23062
|
-
import { jsx as
|
|
23330
|
+
import { jsx as jsx95, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
23063
23331
|
var { DateCalendar: DateCalendar3, DateRangeCalendar: DateRangeCalendar2 } = unlock5(privateApis2);
|
|
23064
23332
|
var DATE_PRESETS = [
|
|
23065
23333
|
{
|
|
23066
23334
|
id: "today",
|
|
23067
|
-
label:
|
|
23335
|
+
label: __48("Today"),
|
|
23068
23336
|
getValue: () => getDate4(null)
|
|
23069
23337
|
},
|
|
23070
23338
|
{
|
|
23071
23339
|
id: "yesterday",
|
|
23072
|
-
label:
|
|
23340
|
+
label: __48("Yesterday"),
|
|
23073
23341
|
getValue: () => {
|
|
23074
23342
|
const today = getDate4(null);
|
|
23075
23343
|
return subDays2(today, 1);
|
|
@@ -23077,7 +23345,7 @@ var DATE_PRESETS = [
|
|
|
23077
23345
|
},
|
|
23078
23346
|
{
|
|
23079
23347
|
id: "past-week",
|
|
23080
|
-
label:
|
|
23348
|
+
label: __48("Past week"),
|
|
23081
23349
|
getValue: () => {
|
|
23082
23350
|
const today = getDate4(null);
|
|
23083
23351
|
return subDays2(today, 7);
|
|
@@ -23085,7 +23353,7 @@ var DATE_PRESETS = [
|
|
|
23085
23353
|
},
|
|
23086
23354
|
{
|
|
23087
23355
|
id: "past-month",
|
|
23088
|
-
label:
|
|
23356
|
+
label: __48("Past month"),
|
|
23089
23357
|
getValue: () => {
|
|
23090
23358
|
const today = getDate4(null);
|
|
23091
23359
|
return subMonths2(today, 1);
|
|
@@ -23095,7 +23363,7 @@ var DATE_PRESETS = [
|
|
|
23095
23363
|
var DATE_RANGE_PRESETS = [
|
|
23096
23364
|
{
|
|
23097
23365
|
id: "last-7-days",
|
|
23098
|
-
label:
|
|
23366
|
+
label: __48("Last 7 days"),
|
|
23099
23367
|
getValue: () => {
|
|
23100
23368
|
const today = getDate4(null);
|
|
23101
23369
|
return [subDays2(today, 7), today];
|
|
@@ -23103,7 +23371,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
23103
23371
|
},
|
|
23104
23372
|
{
|
|
23105
23373
|
id: "last-30-days",
|
|
23106
|
-
label:
|
|
23374
|
+
label: __48("Last 30 days"),
|
|
23107
23375
|
getValue: () => {
|
|
23108
23376
|
const today = getDate4(null);
|
|
23109
23377
|
return [subDays2(today, 30), today];
|
|
@@ -23111,7 +23379,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
23111
23379
|
},
|
|
23112
23380
|
{
|
|
23113
23381
|
id: "month-to-date",
|
|
23114
|
-
label:
|
|
23382
|
+
label: __48("Month to date"),
|
|
23115
23383
|
getValue: () => {
|
|
23116
23384
|
const today = getDate4(null);
|
|
23117
23385
|
return [startOfMonth(today), today];
|
|
@@ -23119,7 +23387,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
23119
23387
|
},
|
|
23120
23388
|
{
|
|
23121
23389
|
id: "last-year",
|
|
23122
|
-
label:
|
|
23390
|
+
label: __48("Last year"),
|
|
23123
23391
|
getValue: () => {
|
|
23124
23392
|
const today = getDate4(null);
|
|
23125
23393
|
return [subYears2(today, 1), today];
|
|
@@ -23127,7 +23395,7 @@ var DATE_RANGE_PRESETS = [
|
|
|
23127
23395
|
},
|
|
23128
23396
|
{
|
|
23129
23397
|
id: "year-to-date",
|
|
23130
|
-
label:
|
|
23398
|
+
label: __48("Year to date"),
|
|
23131
23399
|
getValue: () => {
|
|
23132
23400
|
const today = getDate4(null);
|
|
23133
23401
|
return [startOfYear(today), today];
|
|
@@ -23217,17 +23485,17 @@ function ValidatedDateControl({
|
|
|
23217
23485
|
setIsTouched(true);
|
|
23218
23486
|
}
|
|
23219
23487
|
};
|
|
23220
|
-
return /* @__PURE__ */
|
|
23488
|
+
return /* @__PURE__ */ jsxs30("div", { onBlur, children: [
|
|
23221
23489
|
children,
|
|
23222
|
-
/* @__PURE__ */
|
|
23490
|
+
/* @__PURE__ */ jsx95("div", { "aria-live": "polite", children: customValidity && /* @__PURE__ */ jsxs30(
|
|
23223
23491
|
"p",
|
|
23224
23492
|
{
|
|
23225
|
-
className:
|
|
23493
|
+
className: clsx52(
|
|
23226
23494
|
"components-validated-control__indicator",
|
|
23227
23495
|
customValidity.type === "invalid" ? "is-invalid" : void 0
|
|
23228
23496
|
),
|
|
23229
23497
|
children: [
|
|
23230
|
-
/* @__PURE__ */
|
|
23498
|
+
/* @__PURE__ */ jsx95(
|
|
23231
23499
|
icon_default2,
|
|
23232
23500
|
{
|
|
23233
23501
|
className: "components-validated-control__indicator-icon",
|
|
@@ -23316,11 +23584,11 @@ function CalendarDateControl({
|
|
|
23316
23584
|
} = getSettings2();
|
|
23317
23585
|
let displayLabel = label;
|
|
23318
23586
|
if (isValid?.required && !markWhenOptional) {
|
|
23319
|
-
displayLabel = `${label} (${
|
|
23587
|
+
displayLabel = `${label} (${__48("Required")})`;
|
|
23320
23588
|
} else if (!isValid?.required && markWhenOptional) {
|
|
23321
|
-
displayLabel = `${label} (${
|
|
23589
|
+
displayLabel = `${label} (${__48("Optional")})`;
|
|
23322
23590
|
}
|
|
23323
|
-
return /* @__PURE__ */
|
|
23591
|
+
return /* @__PURE__ */ jsx95(
|
|
23324
23592
|
ValidatedDateControl,
|
|
23325
23593
|
{
|
|
23326
23594
|
field,
|
|
@@ -23328,7 +23596,7 @@ function CalendarDateControl({
|
|
|
23328
23596
|
inputRefs: validityTargetRef,
|
|
23329
23597
|
isTouched,
|
|
23330
23598
|
setIsTouched,
|
|
23331
|
-
children: /* @__PURE__ */
|
|
23599
|
+
children: /* @__PURE__ */ jsx95(
|
|
23332
23600
|
base_control_default,
|
|
23333
23601
|
{
|
|
23334
23602
|
id,
|
|
@@ -23336,8 +23604,8 @@ function CalendarDateControl({
|
|
|
23336
23604
|
label: displayLabel,
|
|
23337
23605
|
help: description,
|
|
23338
23606
|
hideLabelFromVision,
|
|
23339
|
-
children: /* @__PURE__ */
|
|
23340
|
-
/* @__PURE__ */
|
|
23607
|
+
children: /* @__PURE__ */ jsxs30(Stack, { direction: "column", gap: "lg", children: [
|
|
23608
|
+
/* @__PURE__ */ jsxs30(
|
|
23341
23609
|
Stack,
|
|
23342
23610
|
{
|
|
23343
23611
|
direction: "row",
|
|
@@ -23347,7 +23615,7 @@ function CalendarDateControl({
|
|
|
23347
23615
|
children: [
|
|
23348
23616
|
DATE_PRESETS.map((preset) => {
|
|
23349
23617
|
const isSelected = selectedPresetId === preset.id;
|
|
23350
|
-
return /* @__PURE__ */
|
|
23618
|
+
return /* @__PURE__ */ jsx95(
|
|
23351
23619
|
button_default,
|
|
23352
23620
|
{
|
|
23353
23621
|
className: "dataviews-controls__date-preset",
|
|
@@ -23362,7 +23630,7 @@ function CalendarDateControl({
|
|
|
23362
23630
|
preset.id
|
|
23363
23631
|
);
|
|
23364
23632
|
}),
|
|
23365
|
-
/* @__PURE__ */
|
|
23633
|
+
/* @__PURE__ */ jsx95(
|
|
23366
23634
|
button_default,
|
|
23367
23635
|
{
|
|
23368
23636
|
className: "dataviews-controls__date-preset",
|
|
@@ -23371,19 +23639,19 @@ function CalendarDateControl({
|
|
|
23371
23639
|
size: "small",
|
|
23372
23640
|
disabled: !!selectedPresetId || disabled,
|
|
23373
23641
|
accessibleWhenDisabled: true,
|
|
23374
|
-
children:
|
|
23642
|
+
children: __48("Custom")
|
|
23375
23643
|
}
|
|
23376
23644
|
)
|
|
23377
23645
|
]
|
|
23378
23646
|
}
|
|
23379
23647
|
),
|
|
23380
|
-
/* @__PURE__ */
|
|
23648
|
+
/* @__PURE__ */ jsx95(
|
|
23381
23649
|
input_control_default,
|
|
23382
23650
|
{
|
|
23383
23651
|
__next40pxDefaultSize: true,
|
|
23384
23652
|
ref: validityTargetRef,
|
|
23385
23653
|
type: "date",
|
|
23386
|
-
label:
|
|
23654
|
+
label: __48("Date"),
|
|
23387
23655
|
hideLabelFromVision: true,
|
|
23388
23656
|
value,
|
|
23389
23657
|
onChange: handleManualDateChange,
|
|
@@ -23393,7 +23661,7 @@ function CalendarDateControl({
|
|
|
23393
23661
|
max: maxConstraint
|
|
23394
23662
|
}
|
|
23395
23663
|
),
|
|
23396
|
-
/* @__PURE__ */
|
|
23664
|
+
/* @__PURE__ */ jsx95(
|
|
23397
23665
|
DateCalendar3,
|
|
23398
23666
|
{
|
|
23399
23667
|
style: { width: "100%" },
|
|
@@ -23522,11 +23790,11 @@ function CalendarDateRangeControl({
|
|
|
23522
23790
|
const { timezone } = getSettings2();
|
|
23523
23791
|
let displayLabel = label;
|
|
23524
23792
|
if (field.isValid?.required && !markWhenOptional) {
|
|
23525
|
-
displayLabel = `${label} (${
|
|
23793
|
+
displayLabel = `${label} (${__48("Required")})`;
|
|
23526
23794
|
} else if (!field.isValid?.required && markWhenOptional) {
|
|
23527
|
-
displayLabel = `${label} (${
|
|
23795
|
+
displayLabel = `${label} (${__48("Optional")})`;
|
|
23528
23796
|
}
|
|
23529
|
-
return /* @__PURE__ */
|
|
23797
|
+
return /* @__PURE__ */ jsx95(
|
|
23530
23798
|
ValidatedDateControl,
|
|
23531
23799
|
{
|
|
23532
23800
|
field,
|
|
@@ -23534,7 +23802,7 @@ function CalendarDateRangeControl({
|
|
|
23534
23802
|
inputRefs: [fromInputRef, toInputRef],
|
|
23535
23803
|
isTouched,
|
|
23536
23804
|
setIsTouched,
|
|
23537
|
-
children: /* @__PURE__ */
|
|
23805
|
+
children: /* @__PURE__ */ jsx95(
|
|
23538
23806
|
base_control_default,
|
|
23539
23807
|
{
|
|
23540
23808
|
id,
|
|
@@ -23542,8 +23810,8 @@ function CalendarDateRangeControl({
|
|
|
23542
23810
|
label: displayLabel,
|
|
23543
23811
|
help: description,
|
|
23544
23812
|
hideLabelFromVision,
|
|
23545
|
-
children: /* @__PURE__ */
|
|
23546
|
-
/* @__PURE__ */
|
|
23813
|
+
children: /* @__PURE__ */ jsxs30(Stack, { direction: "column", gap: "lg", children: [
|
|
23814
|
+
/* @__PURE__ */ jsxs30(
|
|
23547
23815
|
Stack,
|
|
23548
23816
|
{
|
|
23549
23817
|
direction: "row",
|
|
@@ -23553,7 +23821,7 @@ function CalendarDateRangeControl({
|
|
|
23553
23821
|
children: [
|
|
23554
23822
|
DATE_RANGE_PRESETS.map((preset) => {
|
|
23555
23823
|
const isSelected = selectedPresetId === preset.id;
|
|
23556
|
-
return /* @__PURE__ */
|
|
23824
|
+
return /* @__PURE__ */ jsx95(
|
|
23557
23825
|
button_default,
|
|
23558
23826
|
{
|
|
23559
23827
|
className: "dataviews-controls__date-preset",
|
|
@@ -23568,7 +23836,7 @@ function CalendarDateRangeControl({
|
|
|
23568
23836
|
preset.id
|
|
23569
23837
|
);
|
|
23570
23838
|
}),
|
|
23571
|
-
/* @__PURE__ */
|
|
23839
|
+
/* @__PURE__ */ jsx95(
|
|
23572
23840
|
button_default,
|
|
23573
23841
|
{
|
|
23574
23842
|
className: "dataviews-controls__date-preset",
|
|
@@ -23577,13 +23845,13 @@ function CalendarDateRangeControl({
|
|
|
23577
23845
|
size: "small",
|
|
23578
23846
|
accessibleWhenDisabled: true,
|
|
23579
23847
|
disabled: !!selectedPresetId || disabled,
|
|
23580
|
-
children:
|
|
23848
|
+
children: __48("Custom")
|
|
23581
23849
|
}
|
|
23582
23850
|
)
|
|
23583
23851
|
]
|
|
23584
23852
|
}
|
|
23585
23853
|
),
|
|
23586
|
-
/* @__PURE__ */
|
|
23854
|
+
/* @__PURE__ */ jsxs30(
|
|
23587
23855
|
Stack,
|
|
23588
23856
|
{
|
|
23589
23857
|
direction: "row",
|
|
@@ -23591,13 +23859,13 @@ function CalendarDateRangeControl({
|
|
|
23591
23859
|
justify: "space-between",
|
|
23592
23860
|
className: "dataviews-controls__date-range-inputs",
|
|
23593
23861
|
children: [
|
|
23594
|
-
/* @__PURE__ */
|
|
23862
|
+
/* @__PURE__ */ jsx95(
|
|
23595
23863
|
input_control_default,
|
|
23596
23864
|
{
|
|
23597
23865
|
__next40pxDefaultSize: true,
|
|
23598
23866
|
ref: fromInputRef,
|
|
23599
23867
|
type: "date",
|
|
23600
|
-
label:
|
|
23868
|
+
label: __48("From"),
|
|
23601
23869
|
hideLabelFromVision: true,
|
|
23602
23870
|
value: value?.[0],
|
|
23603
23871
|
onChange: (newValue) => handleManualDateChange("from", newValue),
|
|
@@ -23607,13 +23875,13 @@ function CalendarDateRangeControl({
|
|
|
23607
23875
|
max: maxConstraint
|
|
23608
23876
|
}
|
|
23609
23877
|
),
|
|
23610
|
-
/* @__PURE__ */
|
|
23878
|
+
/* @__PURE__ */ jsx95(
|
|
23611
23879
|
input_control_default,
|
|
23612
23880
|
{
|
|
23613
23881
|
__next40pxDefaultSize: true,
|
|
23614
23882
|
ref: toInputRef,
|
|
23615
23883
|
type: "date",
|
|
23616
|
-
label:
|
|
23884
|
+
label: __48("To"),
|
|
23617
23885
|
hideLabelFromVision: true,
|
|
23618
23886
|
value: value?.[1],
|
|
23619
23887
|
onChange: (newValue) => handleManualDateChange("to", newValue),
|
|
@@ -23626,7 +23894,7 @@ function CalendarDateRangeControl({
|
|
|
23626
23894
|
]
|
|
23627
23895
|
}
|
|
23628
23896
|
),
|
|
23629
|
-
/* @__PURE__ */
|
|
23897
|
+
/* @__PURE__ */ jsx95(
|
|
23630
23898
|
DateRangeCalendar2,
|
|
23631
23899
|
{
|
|
23632
23900
|
style: { width: "100%" },
|
|
@@ -23655,7 +23923,7 @@ function DateControl({
|
|
|
23655
23923
|
validity
|
|
23656
23924
|
}) {
|
|
23657
23925
|
if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
|
|
23658
|
-
return /* @__PURE__ */
|
|
23926
|
+
return /* @__PURE__ */ jsx95(
|
|
23659
23927
|
RelativeDateControl,
|
|
23660
23928
|
{
|
|
23661
23929
|
className: "dataviews-controls__date",
|
|
@@ -23668,7 +23936,7 @@ function DateControl({
|
|
|
23668
23936
|
);
|
|
23669
23937
|
}
|
|
23670
23938
|
if (operator === OPERATOR_BETWEEN) {
|
|
23671
|
-
return /* @__PURE__ */
|
|
23939
|
+
return /* @__PURE__ */ jsx95(
|
|
23672
23940
|
CalendarDateRangeControl,
|
|
23673
23941
|
{
|
|
23674
23942
|
data,
|
|
@@ -23680,7 +23948,7 @@ function DateControl({
|
|
|
23680
23948
|
}
|
|
23681
23949
|
);
|
|
23682
23950
|
}
|
|
23683
|
-
return /* @__PURE__ */
|
|
23951
|
+
return /* @__PURE__ */ jsx95(
|
|
23684
23952
|
CalendarDateControl,
|
|
23685
23953
|
{
|
|
23686
23954
|
data,
|
|
@@ -23694,7 +23962,7 @@ function DateControl({
|
|
|
23694
23962
|
}
|
|
23695
23963
|
|
|
23696
23964
|
// src/components/dataform-controls/select.tsx
|
|
23697
|
-
import { jsx as
|
|
23965
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
23698
23966
|
var { ValidatedSelectControl: ValidatedSelectControl2 } = unlock5(privateApis2);
|
|
23699
23967
|
function Select2({
|
|
23700
23968
|
data,
|
|
@@ -23717,9 +23985,9 @@ function Select2({
|
|
|
23717
23985
|
getElements: field.getElements
|
|
23718
23986
|
});
|
|
23719
23987
|
if (isLoading) {
|
|
23720
|
-
return /* @__PURE__ */
|
|
23988
|
+
return /* @__PURE__ */ jsx96(spinner_default, {});
|
|
23721
23989
|
}
|
|
23722
|
-
return /* @__PURE__ */
|
|
23990
|
+
return /* @__PURE__ */ jsx96(
|
|
23723
23991
|
ValidatedSelectControl2,
|
|
23724
23992
|
{
|
|
23725
23993
|
required: !!field.isValid?.required,
|
|
@@ -23739,7 +24007,7 @@ function Select2({
|
|
|
23739
24007
|
}
|
|
23740
24008
|
|
|
23741
24009
|
// src/components/dataform-controls/adaptive-select.tsx
|
|
23742
|
-
import { jsx as
|
|
24010
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
23743
24011
|
var ELEMENTS_THRESHOLD = 10;
|
|
23744
24012
|
function AdaptiveSelect(props) {
|
|
23745
24013
|
const { field } = props;
|
|
@@ -23748,13 +24016,13 @@ function AdaptiveSelect(props) {
|
|
|
23748
24016
|
getElements: field.getElements
|
|
23749
24017
|
});
|
|
23750
24018
|
if (elements.length >= ELEMENTS_THRESHOLD) {
|
|
23751
|
-
return /* @__PURE__ */
|
|
24019
|
+
return /* @__PURE__ */ jsx97(Combobox2, { ...props });
|
|
23752
24020
|
}
|
|
23753
|
-
return /* @__PURE__ */
|
|
24021
|
+
return /* @__PURE__ */ jsx97(Select2, { ...props });
|
|
23754
24022
|
}
|
|
23755
24023
|
|
|
23756
24024
|
// src/components/dataform-controls/utils/validated-input.tsx
|
|
23757
|
-
import { jsx as
|
|
24025
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
23758
24026
|
var { ValidatedInputControl: ValidatedInputControl3 } = unlock5(privateApis2);
|
|
23759
24027
|
function ValidatedText({
|
|
23760
24028
|
data,
|
|
@@ -23779,7 +24047,7 @@ function ValidatedText({
|
|
|
23779
24047
|
),
|
|
23780
24048
|
[data, setValue, onChange]
|
|
23781
24049
|
);
|
|
23782
|
-
return /* @__PURE__ */
|
|
24050
|
+
return /* @__PURE__ */ jsx98(
|
|
23783
24051
|
ValidatedInputControl3,
|
|
23784
24052
|
{
|
|
23785
24053
|
required: !!isValid.required,
|
|
@@ -23804,7 +24072,7 @@ function ValidatedText({
|
|
|
23804
24072
|
}
|
|
23805
24073
|
|
|
23806
24074
|
// src/components/dataform-controls/email.tsx
|
|
23807
|
-
import { jsx as
|
|
24075
|
+
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
23808
24076
|
function Email({
|
|
23809
24077
|
data,
|
|
23810
24078
|
field,
|
|
@@ -23813,7 +24081,7 @@ function Email({
|
|
|
23813
24081
|
markWhenOptional,
|
|
23814
24082
|
validity
|
|
23815
24083
|
}) {
|
|
23816
|
-
return /* @__PURE__ */
|
|
24084
|
+
return /* @__PURE__ */ jsx99(
|
|
23817
24085
|
ValidatedText,
|
|
23818
24086
|
{
|
|
23819
24087
|
...{
|
|
@@ -23824,14 +24092,14 @@ function Email({
|
|
|
23824
24092
|
markWhenOptional,
|
|
23825
24093
|
validity,
|
|
23826
24094
|
type: "email",
|
|
23827
|
-
prefix: /* @__PURE__ */
|
|
24095
|
+
prefix: /* @__PURE__ */ jsx99(input_prefix_wrapper_default, { variant: "icon", children: /* @__PURE__ */ jsx99(icon_default2, { icon: envelope_default }) })
|
|
23828
24096
|
}
|
|
23829
24097
|
}
|
|
23830
24098
|
);
|
|
23831
24099
|
}
|
|
23832
24100
|
|
|
23833
24101
|
// src/components/dataform-controls/telephone.tsx
|
|
23834
|
-
import { jsx as
|
|
24102
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
23835
24103
|
function Telephone({
|
|
23836
24104
|
data,
|
|
23837
24105
|
field,
|
|
@@ -23840,7 +24108,7 @@ function Telephone({
|
|
|
23840
24108
|
markWhenOptional,
|
|
23841
24109
|
validity
|
|
23842
24110
|
}) {
|
|
23843
|
-
return /* @__PURE__ */
|
|
24111
|
+
return /* @__PURE__ */ jsx100(
|
|
23844
24112
|
ValidatedText,
|
|
23845
24113
|
{
|
|
23846
24114
|
...{
|
|
@@ -23851,14 +24119,14 @@ function Telephone({
|
|
|
23851
24119
|
markWhenOptional,
|
|
23852
24120
|
validity,
|
|
23853
24121
|
type: "tel",
|
|
23854
|
-
prefix: /* @__PURE__ */
|
|
24122
|
+
prefix: /* @__PURE__ */ jsx100(input_prefix_wrapper_default, { variant: "icon", children: /* @__PURE__ */ jsx100(icon_default2, { icon: mobile_default }) })
|
|
23855
24123
|
}
|
|
23856
24124
|
}
|
|
23857
24125
|
);
|
|
23858
24126
|
}
|
|
23859
24127
|
|
|
23860
24128
|
// src/components/dataform-controls/url.tsx
|
|
23861
|
-
import { jsx as
|
|
24129
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
23862
24130
|
function Url({
|
|
23863
24131
|
data,
|
|
23864
24132
|
field,
|
|
@@ -23867,7 +24135,7 @@ function Url({
|
|
|
23867
24135
|
markWhenOptional,
|
|
23868
24136
|
validity
|
|
23869
24137
|
}) {
|
|
23870
|
-
return /* @__PURE__ */
|
|
24138
|
+
return /* @__PURE__ */ jsx101(
|
|
23871
24139
|
ValidatedText,
|
|
23872
24140
|
{
|
|
23873
24141
|
...{
|
|
@@ -23878,15 +24146,15 @@ function Url({
|
|
|
23878
24146
|
markWhenOptional,
|
|
23879
24147
|
validity,
|
|
23880
24148
|
type: "url",
|
|
23881
|
-
prefix: /* @__PURE__ */
|
|
24149
|
+
prefix: /* @__PURE__ */ jsx101(input_prefix_wrapper_default, { variant: "icon", children: /* @__PURE__ */ jsx101(icon_default2, { icon: link_default }) })
|
|
23882
24150
|
}
|
|
23883
24151
|
}
|
|
23884
24152
|
);
|
|
23885
24153
|
}
|
|
23886
24154
|
|
|
23887
24155
|
// src/components/dataform-controls/utils/validated-number.tsx
|
|
23888
|
-
import { __ as
|
|
23889
|
-
import { jsx as
|
|
24156
|
+
import { __ as __49 } from "@wordpress/i18n";
|
|
24157
|
+
import { jsx as jsx102, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
23890
24158
|
var { ValidatedNumberControl: ValidatedNumberControl2 } = unlock5(privateApis2);
|
|
23891
24159
|
function toNumberOrEmpty(value) {
|
|
23892
24160
|
if (value === "" || value === void 0) {
|
|
@@ -23910,15 +24178,15 @@ function BetweenControls({
|
|
|
23910
24178
|
(newValue) => onChange([min, toNumberOrEmpty(newValue)]),
|
|
23911
24179
|
[onChange, min]
|
|
23912
24180
|
);
|
|
23913
|
-
return /* @__PURE__ */
|
|
24181
|
+
return /* @__PURE__ */ jsx102(
|
|
23914
24182
|
base_control_default,
|
|
23915
24183
|
{
|
|
23916
|
-
help:
|
|
23917
|
-
children: /* @__PURE__ */
|
|
23918
|
-
/* @__PURE__ */
|
|
24184
|
+
help: __49("The max. value must be greater than the min. value."),
|
|
24185
|
+
children: /* @__PURE__ */ jsxs31(component_default3, { direction: "row", gap: 4, children: [
|
|
24186
|
+
/* @__PURE__ */ jsx102(
|
|
23919
24187
|
number_control_default,
|
|
23920
24188
|
{
|
|
23921
|
-
label:
|
|
24189
|
+
label: __49("Min."),
|
|
23922
24190
|
value: min,
|
|
23923
24191
|
max: max ? Number(max) - step : void 0,
|
|
23924
24192
|
onChange: onChangeMin,
|
|
@@ -23927,10 +24195,10 @@ function BetweenControls({
|
|
|
23927
24195
|
step
|
|
23928
24196
|
}
|
|
23929
24197
|
),
|
|
23930
|
-
/* @__PURE__ */
|
|
24198
|
+
/* @__PURE__ */ jsx102(
|
|
23931
24199
|
number_control_default,
|
|
23932
24200
|
{
|
|
23933
|
-
label:
|
|
24201
|
+
label: __49("Max."),
|
|
23934
24202
|
value: max,
|
|
23935
24203
|
min: min ? Number(min) + step : void 0,
|
|
23936
24204
|
onChange: onChangeMax,
|
|
@@ -23989,7 +24257,7 @@ function ValidatedNumber({
|
|
|
23989
24257
|
)) {
|
|
23990
24258
|
valueBetween = value;
|
|
23991
24259
|
}
|
|
23992
|
-
return /* @__PURE__ */
|
|
24260
|
+
return /* @__PURE__ */ jsx102(
|
|
23993
24261
|
BetweenControls,
|
|
23994
24262
|
{
|
|
23995
24263
|
value: valueBetween,
|
|
@@ -23999,7 +24267,7 @@ function ValidatedNumber({
|
|
|
23999
24267
|
}
|
|
24000
24268
|
);
|
|
24001
24269
|
}
|
|
24002
|
-
return /* @__PURE__ */
|
|
24270
|
+
return /* @__PURE__ */ jsx102(
|
|
24003
24271
|
ValidatedNumberControl2,
|
|
24004
24272
|
{
|
|
24005
24273
|
required: !!isValid.required,
|
|
@@ -24020,19 +24288,19 @@ function ValidatedNumber({
|
|
|
24020
24288
|
}
|
|
24021
24289
|
|
|
24022
24290
|
// src/components/dataform-controls/integer.tsx
|
|
24023
|
-
import { jsx as
|
|
24291
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
24024
24292
|
function Integer(props) {
|
|
24025
|
-
return /* @__PURE__ */
|
|
24293
|
+
return /* @__PURE__ */ jsx103(ValidatedNumber, { ...props });
|
|
24026
24294
|
}
|
|
24027
24295
|
|
|
24028
24296
|
// src/components/dataform-controls/number.tsx
|
|
24029
|
-
import { jsx as
|
|
24297
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
24030
24298
|
function Number2(props) {
|
|
24031
|
-
return /* @__PURE__ */
|
|
24299
|
+
return /* @__PURE__ */ jsx104(ValidatedNumber, { ...props });
|
|
24032
24300
|
}
|
|
24033
24301
|
|
|
24034
24302
|
// src/components/dataform-controls/radio.tsx
|
|
24035
|
-
import { jsx as
|
|
24303
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
24036
24304
|
var { ValidatedRadioControl: ValidatedRadioControl2 } = unlock5(privateApis2);
|
|
24037
24305
|
function Radio2({
|
|
24038
24306
|
data,
|
|
@@ -24054,9 +24322,9 @@ function Radio2({
|
|
|
24054
24322
|
[data, onChange, setValue]
|
|
24055
24323
|
);
|
|
24056
24324
|
if (isLoading) {
|
|
24057
|
-
return /* @__PURE__ */
|
|
24325
|
+
return /* @__PURE__ */ jsx105(spinner_default, {});
|
|
24058
24326
|
}
|
|
24059
|
-
return /* @__PURE__ */
|
|
24327
|
+
return /* @__PURE__ */ jsx105(
|
|
24060
24328
|
ValidatedRadioControl2,
|
|
24061
24329
|
{
|
|
24062
24330
|
required: !!field.isValid?.required,
|
|
@@ -24074,7 +24342,7 @@ function Radio2({
|
|
|
24074
24342
|
}
|
|
24075
24343
|
|
|
24076
24344
|
// src/components/dataform-controls/text.tsx
|
|
24077
|
-
import { jsx as
|
|
24345
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
24078
24346
|
function Text5({
|
|
24079
24347
|
data,
|
|
24080
24348
|
field,
|
|
@@ -24085,7 +24353,7 @@ function Text5({
|
|
|
24085
24353
|
validity
|
|
24086
24354
|
}) {
|
|
24087
24355
|
const { prefix, suffix } = config || {};
|
|
24088
|
-
return /* @__PURE__ */
|
|
24356
|
+
return /* @__PURE__ */ jsx106(
|
|
24089
24357
|
ValidatedText,
|
|
24090
24358
|
{
|
|
24091
24359
|
...{
|
|
@@ -24103,7 +24371,7 @@ function Text5({
|
|
|
24103
24371
|
}
|
|
24104
24372
|
|
|
24105
24373
|
// src/components/dataform-controls/toggle.tsx
|
|
24106
|
-
import { jsx as
|
|
24374
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
24107
24375
|
var { ValidatedToggleControl: ValidatedToggleControl2 } = unlock5(privateApis2);
|
|
24108
24376
|
function Toggle({
|
|
24109
24377
|
field,
|
|
@@ -24120,7 +24388,7 @@ function Toggle({
|
|
|
24120
24388
|
setValue({ item: data, value: !getValue({ item: data }) })
|
|
24121
24389
|
);
|
|
24122
24390
|
}, [onChange, setValue, data, getValue]);
|
|
24123
|
-
return /* @__PURE__ */
|
|
24391
|
+
return /* @__PURE__ */ jsx107(
|
|
24124
24392
|
ValidatedToggleControl2,
|
|
24125
24393
|
{
|
|
24126
24394
|
required: !!isValid.required,
|
|
@@ -24137,7 +24405,7 @@ function Toggle({
|
|
|
24137
24405
|
}
|
|
24138
24406
|
|
|
24139
24407
|
// src/components/dataform-controls/textarea.tsx
|
|
24140
|
-
import { jsx as
|
|
24408
|
+
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
24141
24409
|
var { ValidatedTextareaControl: ValidatedTextareaControl2 } = unlock5(privateApis2);
|
|
24142
24410
|
function Textarea({
|
|
24143
24411
|
data,
|
|
@@ -24156,7 +24424,7 @@ function Textarea({
|
|
|
24156
24424
|
(newValue) => onChange(setValue({ item: data, value: newValue })),
|
|
24157
24425
|
[data, onChange, setValue]
|
|
24158
24426
|
);
|
|
24159
|
-
return /* @__PURE__ */
|
|
24427
|
+
return /* @__PURE__ */ jsx108(
|
|
24160
24428
|
ValidatedTextareaControl2,
|
|
24161
24429
|
{
|
|
24162
24430
|
required: !!isValid.required,
|
|
@@ -24178,7 +24446,7 @@ function Textarea({
|
|
|
24178
24446
|
}
|
|
24179
24447
|
|
|
24180
24448
|
// src/components/dataform-controls/toggle-group.tsx
|
|
24181
|
-
import { jsx as
|
|
24449
|
+
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
24182
24450
|
var { ValidatedToggleGroupControl: ValidatedToggleGroupControl2 } = unlock5(privateApis2);
|
|
24183
24451
|
function ToggleGroup({
|
|
24184
24452
|
data,
|
|
@@ -24200,13 +24468,13 @@ function ToggleGroup({
|
|
|
24200
24468
|
getElements: field.getElements
|
|
24201
24469
|
});
|
|
24202
24470
|
if (isLoading) {
|
|
24203
|
-
return /* @__PURE__ */
|
|
24471
|
+
return /* @__PURE__ */ jsx109(spinner_default, {});
|
|
24204
24472
|
}
|
|
24205
24473
|
if (elements.length === 0) {
|
|
24206
24474
|
return null;
|
|
24207
24475
|
}
|
|
24208
24476
|
const selectedOption = elements.find((el) => el.value === value);
|
|
24209
|
-
return /* @__PURE__ */
|
|
24477
|
+
return /* @__PURE__ */ jsx109(
|
|
24210
24478
|
ValidatedToggleGroupControl2,
|
|
24211
24479
|
{
|
|
24212
24480
|
required: !!field.isValid?.required,
|
|
@@ -24219,7 +24487,7 @@ function ToggleGroup({
|
|
|
24219
24487
|
onChange: onChangeControl,
|
|
24220
24488
|
value,
|
|
24221
24489
|
hideLabelFromVision,
|
|
24222
|
-
children: elements.map((el) => /* @__PURE__ */
|
|
24490
|
+
children: elements.map((el) => /* @__PURE__ */ jsx109(
|
|
24223
24491
|
component_default12,
|
|
24224
24492
|
{
|
|
24225
24493
|
label: el.label,
|
|
@@ -24233,7 +24501,7 @@ function ToggleGroup({
|
|
|
24233
24501
|
}
|
|
24234
24502
|
|
|
24235
24503
|
// src/components/dataform-controls/array.tsx
|
|
24236
|
-
import { jsx as
|
|
24504
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
24237
24505
|
var { ValidatedFormTokenField: ValidatedFormTokenField2 } = unlock5(privateApis2);
|
|
24238
24506
|
function ArrayControl({
|
|
24239
24507
|
data,
|
|
@@ -24272,9 +24540,9 @@ function ArrayControl({
|
|
|
24272
24540
|
[onChange, setValue, data]
|
|
24273
24541
|
);
|
|
24274
24542
|
if (isLoading) {
|
|
24275
|
-
return /* @__PURE__ */
|
|
24543
|
+
return /* @__PURE__ */ jsx110(spinner_default, {});
|
|
24276
24544
|
}
|
|
24277
|
-
return /* @__PURE__ */
|
|
24545
|
+
return /* @__PURE__ */ jsx110(
|
|
24278
24546
|
ValidatedFormTokenField2,
|
|
24279
24547
|
{
|
|
24280
24548
|
required: !!isValid?.required,
|
|
@@ -24313,9 +24581,9 @@ function ArrayControl({
|
|
|
24313
24581
|
const element = elements.find(
|
|
24314
24582
|
(el) => el.value === item2
|
|
24315
24583
|
);
|
|
24316
|
-
return /* @__PURE__ */
|
|
24584
|
+
return /* @__PURE__ */ jsx110("span", { children: element?.label || item2 });
|
|
24317
24585
|
}
|
|
24318
|
-
return /* @__PURE__ */
|
|
24586
|
+
return /* @__PURE__ */ jsx110("span", { children: item2 });
|
|
24319
24587
|
}
|
|
24320
24588
|
}
|
|
24321
24589
|
);
|
|
@@ -24323,8 +24591,8 @@ function ArrayControl({
|
|
|
24323
24591
|
|
|
24324
24592
|
// src/components/dataform-controls/color.tsx
|
|
24325
24593
|
import { colord as colord7 } from "colord";
|
|
24326
|
-
import { __ as
|
|
24327
|
-
import { jsx as
|
|
24594
|
+
import { __ as __50 } from "@wordpress/i18n";
|
|
24595
|
+
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
24328
24596
|
var { ValidatedInputControl: ValidatedInputControl4 } = unlock5(privateApis2);
|
|
24329
24597
|
var ColorPickerDropdown = ({
|
|
24330
24598
|
color,
|
|
@@ -24332,23 +24600,23 @@ var ColorPickerDropdown = ({
|
|
|
24332
24600
|
disabled
|
|
24333
24601
|
}) => {
|
|
24334
24602
|
const validColor = color && colord7(color).isValid() ? color : "#ffffff";
|
|
24335
|
-
return /* @__PURE__ */
|
|
24603
|
+
return /* @__PURE__ */ jsx111(
|
|
24336
24604
|
dropdown_default,
|
|
24337
24605
|
{
|
|
24338
24606
|
className: "dataviews-controls__color-picker-dropdown",
|
|
24339
24607
|
popoverProps: { resize: false },
|
|
24340
|
-
renderToggle: ({ onToggle }) => /* @__PURE__ */
|
|
24608
|
+
renderToggle: ({ onToggle }) => /* @__PURE__ */ jsx111(
|
|
24341
24609
|
button_default,
|
|
24342
24610
|
{
|
|
24343
24611
|
onClick: onToggle,
|
|
24344
|
-
"aria-label":
|
|
24612
|
+
"aria-label": __50("Open color picker"),
|
|
24345
24613
|
size: "small",
|
|
24346
24614
|
disabled,
|
|
24347
24615
|
accessibleWhenDisabled: true,
|
|
24348
|
-
icon: () => /* @__PURE__ */
|
|
24616
|
+
icon: () => /* @__PURE__ */ jsx111(color_indicator_default, { colorValue: validColor })
|
|
24349
24617
|
}
|
|
24350
24618
|
),
|
|
24351
|
-
renderContent: () => /* @__PURE__ */
|
|
24619
|
+
renderContent: () => /* @__PURE__ */ jsx111(dropdown_content_wrapper_default, { paddingSize: "none", children: /* @__PURE__ */ jsx111(
|
|
24352
24620
|
LegacyAdapter,
|
|
24353
24621
|
{
|
|
24354
24622
|
color: validColor,
|
|
@@ -24382,7 +24650,7 @@ function Color({
|
|
|
24382
24650
|
},
|
|
24383
24651
|
[data, onChange, setValue]
|
|
24384
24652
|
);
|
|
24385
|
-
return /* @__PURE__ */
|
|
24653
|
+
return /* @__PURE__ */ jsx111(
|
|
24386
24654
|
ValidatedInputControl4,
|
|
24387
24655
|
{
|
|
24388
24656
|
required: !!field.isValid?.required,
|
|
@@ -24396,7 +24664,7 @@ function Color({
|
|
|
24396
24664
|
hideLabelFromVision,
|
|
24397
24665
|
type: "text",
|
|
24398
24666
|
disabled,
|
|
24399
|
-
prefix: /* @__PURE__ */
|
|
24667
|
+
prefix: /* @__PURE__ */ jsx111(input_prefix_wrapper_default, { variant: "control", children: /* @__PURE__ */ jsx111(
|
|
24400
24668
|
ColorPickerDropdown,
|
|
24401
24669
|
{
|
|
24402
24670
|
color: value,
|
|
@@ -24409,8 +24677,8 @@ function Color({
|
|
|
24409
24677
|
}
|
|
24410
24678
|
|
|
24411
24679
|
// src/components/dataform-controls/password.tsx
|
|
24412
|
-
import { __ as
|
|
24413
|
-
import { jsx as
|
|
24680
|
+
import { __ as __51 } from "@wordpress/i18n";
|
|
24681
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
24414
24682
|
function Password({
|
|
24415
24683
|
data,
|
|
24416
24684
|
field,
|
|
@@ -24424,7 +24692,7 @@ function Password({
|
|
|
24424
24692
|
const toggleVisibility = useCallback(() => {
|
|
24425
24693
|
setIsVisible((prev) => !prev);
|
|
24426
24694
|
}, []);
|
|
24427
|
-
return /* @__PURE__ */
|
|
24695
|
+
return /* @__PURE__ */ jsx112(
|
|
24428
24696
|
ValidatedText,
|
|
24429
24697
|
{
|
|
24430
24698
|
...{
|
|
@@ -24435,13 +24703,13 @@ function Password({
|
|
|
24435
24703
|
markWhenOptional,
|
|
24436
24704
|
validity,
|
|
24437
24705
|
type: isVisible2 ? "text" : "password",
|
|
24438
|
-
suffix: /* @__PURE__ */
|
|
24706
|
+
suffix: /* @__PURE__ */ jsx112(input_suffix_wrapper_default, { variant: "control", children: /* @__PURE__ */ jsx112(
|
|
24439
24707
|
button_default,
|
|
24440
24708
|
{
|
|
24441
24709
|
icon: isVisible2 ? unseen_default : seen_default,
|
|
24442
24710
|
onClick: toggleVisibility,
|
|
24443
24711
|
size: "small",
|
|
24444
|
-
label: isVisible2 ?
|
|
24712
|
+
label: isVisible2 ? __51("Hide password") : __51("Show password"),
|
|
24445
24713
|
disabled,
|
|
24446
24714
|
accessibleWhenDisabled: true
|
|
24447
24715
|
}
|
|
@@ -24457,7 +24725,7 @@ function hasElements(field) {
|
|
|
24457
24725
|
}
|
|
24458
24726
|
|
|
24459
24727
|
// src/components/dataform-controls/index.tsx
|
|
24460
|
-
import { jsx as
|
|
24728
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
24461
24729
|
var FORM_CONTROLS = {
|
|
24462
24730
|
adaptiveSelect: AdaptiveSelect,
|
|
24463
24731
|
array: ArrayControl,
|
|
@@ -24489,7 +24757,7 @@ function createConfiguredControl(config) {
|
|
|
24489
24757
|
return null;
|
|
24490
24758
|
}
|
|
24491
24759
|
return function ConfiguredControl(props) {
|
|
24492
|
-
return /* @__PURE__ */
|
|
24760
|
+
return /* @__PURE__ */ jsx113(BaseControlType, { ...props, config: controlConfig });
|
|
24493
24761
|
};
|
|
24494
24762
|
}
|
|
24495
24763
|
function getControl(field, fallback) {
|
|
@@ -24565,7 +24833,7 @@ var setValueFromId = (id) => ({ value }) => {
|
|
|
24565
24833
|
var set_value_from_id_default = setValueFromId;
|
|
24566
24834
|
|
|
24567
24835
|
// src/field-types/email.tsx
|
|
24568
|
-
import { __ as
|
|
24836
|
+
import { __ as __52 } from "@wordpress/i18n";
|
|
24569
24837
|
|
|
24570
24838
|
// src/field-types/utils/render-from-elements.tsx
|
|
24571
24839
|
function RenderFromElements({
|
|
@@ -24587,13 +24855,13 @@ function RenderFromElements({
|
|
|
24587
24855
|
}
|
|
24588
24856
|
|
|
24589
24857
|
// src/field-types/utils/render-default.tsx
|
|
24590
|
-
import { jsx as
|
|
24591
|
-
function
|
|
24858
|
+
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
24859
|
+
function render2({
|
|
24592
24860
|
item: item2,
|
|
24593
24861
|
field
|
|
24594
24862
|
}) {
|
|
24595
24863
|
if (field.hasElements) {
|
|
24596
|
-
return /* @__PURE__ */
|
|
24864
|
+
return /* @__PURE__ */ jsx114(RenderFromElements, { item: item2, field });
|
|
24597
24865
|
}
|
|
24598
24866
|
return field.getValueFormatted({ item: item2, field });
|
|
24599
24867
|
}
|
|
@@ -24675,13 +24943,13 @@ var emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{
|
|
|
24675
24943
|
function isValidCustom(item2, field) {
|
|
24676
24944
|
const value = field.getValue({ item: item2 });
|
|
24677
24945
|
if (![void 0, "", null].includes(value) && !emailRegex.test(value)) {
|
|
24678
|
-
return
|
|
24946
|
+
return __52("Value must be a valid email address.");
|
|
24679
24947
|
}
|
|
24680
24948
|
return null;
|
|
24681
24949
|
}
|
|
24682
24950
|
var email_default = {
|
|
24683
24951
|
type: "email",
|
|
24684
|
-
render,
|
|
24952
|
+
render: render2,
|
|
24685
24953
|
Edit: "email",
|
|
24686
24954
|
sort: sort_text_default,
|
|
24687
24955
|
enableSorting: true,
|
|
@@ -24712,7 +24980,7 @@ var email_default = {
|
|
|
24712
24980
|
};
|
|
24713
24981
|
|
|
24714
24982
|
// src/field-types/integer.tsx
|
|
24715
|
-
import { __ as
|
|
24983
|
+
import { __ as __53 } from "@wordpress/i18n";
|
|
24716
24984
|
|
|
24717
24985
|
// src/field-types/utils/sort-number.ts
|
|
24718
24986
|
var sort_number_default = (a, b, direction) => {
|
|
@@ -24778,13 +25046,13 @@ function getValueFormatted2({
|
|
|
24778
25046
|
function isValidCustom2(item2, field) {
|
|
24779
25047
|
const value = field.getValue({ item: item2 });
|
|
24780
25048
|
if (![void 0, "", null].includes(value) && !Number.isInteger(value)) {
|
|
24781
|
-
return
|
|
25049
|
+
return __53("Value must be an integer.");
|
|
24782
25050
|
}
|
|
24783
25051
|
return null;
|
|
24784
25052
|
}
|
|
24785
25053
|
var integer_default = {
|
|
24786
25054
|
type: "integer",
|
|
24787
|
-
render,
|
|
25055
|
+
render: render2,
|
|
24788
25056
|
Edit: "integer",
|
|
24789
25057
|
sort: sort_number_default,
|
|
24790
25058
|
enableSorting: true,
|
|
@@ -24825,7 +25093,7 @@ var integer_default = {
|
|
|
24825
25093
|
};
|
|
24826
25094
|
|
|
24827
25095
|
// src/field-types/number.tsx
|
|
24828
|
-
import { __ as
|
|
25096
|
+
import { __ as __54 } from "@wordpress/i18n";
|
|
24829
25097
|
var format3 = {
|
|
24830
25098
|
separatorThousand: ",",
|
|
24831
25099
|
separatorDecimal: ".",
|
|
@@ -24861,13 +25129,13 @@ function isEmpty(value) {
|
|
|
24861
25129
|
function isValidCustom3(item2, field) {
|
|
24862
25130
|
const value = field.getValue({ item: item2 });
|
|
24863
25131
|
if (!isEmpty(value) && !Number.isFinite(value)) {
|
|
24864
|
-
return
|
|
25132
|
+
return __54("Value must be a number.");
|
|
24865
25133
|
}
|
|
24866
25134
|
return null;
|
|
24867
25135
|
}
|
|
24868
25136
|
var number_default = {
|
|
24869
25137
|
type: "number",
|
|
24870
|
-
render,
|
|
25138
|
+
render: render2,
|
|
24871
25139
|
Edit: "number",
|
|
24872
25140
|
sort: sort_number_default,
|
|
24873
25141
|
enableSorting: true,
|
|
@@ -24910,7 +25178,7 @@ var number_default = {
|
|
|
24910
25178
|
// src/field-types/text.tsx
|
|
24911
25179
|
var text_default = {
|
|
24912
25180
|
type: "text",
|
|
24913
|
-
render,
|
|
25181
|
+
render: render2,
|
|
24914
25182
|
Edit: "text",
|
|
24915
25183
|
sort: sort_text_default,
|
|
24916
25184
|
enableSorting: true,
|
|
@@ -25005,7 +25273,7 @@ var sort = (a, b, direction) => {
|
|
|
25005
25273
|
};
|
|
25006
25274
|
var datetime_default = {
|
|
25007
25275
|
type: "datetime",
|
|
25008
|
-
render,
|
|
25276
|
+
render: render2,
|
|
25009
25277
|
Edit: "datetime",
|
|
25010
25278
|
sort,
|
|
25011
25279
|
enableSorting: true,
|
|
@@ -25069,7 +25337,7 @@ var sort2 = (a, b, direction) => {
|
|
|
25069
25337
|
};
|
|
25070
25338
|
var date_default = {
|
|
25071
25339
|
type: "date",
|
|
25072
|
-
render,
|
|
25340
|
+
render: render2,
|
|
25073
25341
|
Edit: "date",
|
|
25074
25342
|
sort: sort2,
|
|
25075
25343
|
enableSorting: true,
|
|
@@ -25107,7 +25375,7 @@ var date_default = {
|
|
|
25107
25375
|
};
|
|
25108
25376
|
|
|
25109
25377
|
// src/field-types/boolean.tsx
|
|
25110
|
-
import { __ as
|
|
25378
|
+
import { __ as __55 } from "@wordpress/i18n";
|
|
25111
25379
|
|
|
25112
25380
|
// src/field-types/utils/is-valid-required-for-bool.ts
|
|
25113
25381
|
function isValidRequiredForBool(item2, field) {
|
|
@@ -25122,17 +25390,17 @@ function getValueFormatted6({
|
|
|
25122
25390
|
}) {
|
|
25123
25391
|
const value = field.getValue({ item: item2 });
|
|
25124
25392
|
if (value === true) {
|
|
25125
|
-
return
|
|
25393
|
+
return __55("True");
|
|
25126
25394
|
}
|
|
25127
25395
|
if (value === false) {
|
|
25128
|
-
return
|
|
25396
|
+
return __55("False");
|
|
25129
25397
|
}
|
|
25130
25398
|
return "";
|
|
25131
25399
|
}
|
|
25132
25400
|
function isValidCustom4(item2, field) {
|
|
25133
25401
|
const value = field.getValue({ item: item2 });
|
|
25134
25402
|
if (![void 0, "", null].includes(value) && ![true, false].includes(value)) {
|
|
25135
|
-
return
|
|
25403
|
+
return __55("Value must be true, false, or undefined");
|
|
25136
25404
|
}
|
|
25137
25405
|
return null;
|
|
25138
25406
|
}
|
|
@@ -25149,7 +25417,7 @@ var sort3 = (a, b, direction) => {
|
|
|
25149
25417
|
};
|
|
25150
25418
|
var boolean_default = {
|
|
25151
25419
|
type: "boolean",
|
|
25152
|
-
render,
|
|
25420
|
+
render: render2,
|
|
25153
25421
|
Edit: "checkbox",
|
|
25154
25422
|
sort: sort3,
|
|
25155
25423
|
validate: {
|
|
@@ -25184,7 +25452,7 @@ var media_default = {
|
|
|
25184
25452
|
};
|
|
25185
25453
|
|
|
25186
25454
|
// src/field-types/array.tsx
|
|
25187
|
-
import { __ as
|
|
25455
|
+
import { __ as __56 } from "@wordpress/i18n";
|
|
25188
25456
|
|
|
25189
25457
|
// src/field-types/utils/is-valid-required-for-array.ts
|
|
25190
25458
|
function isValidRequiredForArray(item2, field) {
|
|
@@ -25203,16 +25471,16 @@ function getValueFormatted7({
|
|
|
25203
25471
|
const arr = Array.isArray(value) ? value : [];
|
|
25204
25472
|
return arr.join(", ");
|
|
25205
25473
|
}
|
|
25206
|
-
function
|
|
25474
|
+
function render3({ item: item2, field }) {
|
|
25207
25475
|
return getValueFormatted7({ item: item2, field });
|
|
25208
25476
|
}
|
|
25209
25477
|
function isValidCustom5(item2, field) {
|
|
25210
25478
|
const value = field.getValue({ item: item2 });
|
|
25211
25479
|
if (![void 0, "", null].includes(value) && !Array.isArray(value)) {
|
|
25212
|
-
return
|
|
25480
|
+
return __56("Value must be an array.");
|
|
25213
25481
|
}
|
|
25214
25482
|
if (!value.every((v) => typeof v === "string")) {
|
|
25215
|
-
return
|
|
25483
|
+
return __56("Every value must be a string.");
|
|
25216
25484
|
}
|
|
25217
25485
|
return null;
|
|
25218
25486
|
}
|
|
@@ -25228,7 +25496,7 @@ var sort4 = (a, b, direction) => {
|
|
|
25228
25496
|
};
|
|
25229
25497
|
var array_default = {
|
|
25230
25498
|
type: "array",
|
|
25231
|
-
render:
|
|
25499
|
+
render: render3,
|
|
25232
25500
|
Edit: "array",
|
|
25233
25501
|
sort: sort4,
|
|
25234
25502
|
enableSorting: true,
|
|
@@ -25258,7 +25526,7 @@ function getValueFormatted8({
|
|
|
25258
25526
|
}
|
|
25259
25527
|
var password_default = {
|
|
25260
25528
|
type: "password",
|
|
25261
|
-
render,
|
|
25529
|
+
render: render2,
|
|
25262
25530
|
Edit: "password",
|
|
25263
25531
|
sort: () => 0,
|
|
25264
25532
|
// Passwords should not be sortable for security reasons
|
|
@@ -25280,7 +25548,7 @@ var password_default = {
|
|
|
25280
25548
|
// src/field-types/telephone.tsx
|
|
25281
25549
|
var telephone_default = {
|
|
25282
25550
|
type: "telephone",
|
|
25283
|
-
render,
|
|
25551
|
+
render: render2,
|
|
25284
25552
|
Edit: "telephone",
|
|
25285
25553
|
sort: sort_text_default,
|
|
25286
25554
|
enableSorting: true,
|
|
@@ -25311,18 +25579,18 @@ var telephone_default = {
|
|
|
25311
25579
|
|
|
25312
25580
|
// src/field-types/color.tsx
|
|
25313
25581
|
import { colord as colord8 } from "colord";
|
|
25314
|
-
import { __ as
|
|
25315
|
-
import { jsx as
|
|
25316
|
-
function
|
|
25582
|
+
import { __ as __57 } from "@wordpress/i18n";
|
|
25583
|
+
import { jsx as jsx115, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
25584
|
+
function render4({ item: item2, field }) {
|
|
25317
25585
|
if (field.hasElements) {
|
|
25318
|
-
return /* @__PURE__ */
|
|
25586
|
+
return /* @__PURE__ */ jsx115(RenderFromElements, { item: item2, field });
|
|
25319
25587
|
}
|
|
25320
25588
|
const value = get_value_formatted_default_default({ item: item2, field });
|
|
25321
25589
|
if (!value || !colord8(value).isValid()) {
|
|
25322
25590
|
return value;
|
|
25323
25591
|
}
|
|
25324
|
-
return /* @__PURE__ */
|
|
25325
|
-
/* @__PURE__ */
|
|
25592
|
+
return /* @__PURE__ */ jsxs32("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
25593
|
+
/* @__PURE__ */ jsx115(
|
|
25326
25594
|
"div",
|
|
25327
25595
|
{
|
|
25328
25596
|
style: {
|
|
@@ -25335,13 +25603,13 @@ function render3({ item: item2, field }) {
|
|
|
25335
25603
|
}
|
|
25336
25604
|
}
|
|
25337
25605
|
),
|
|
25338
|
-
/* @__PURE__ */
|
|
25606
|
+
/* @__PURE__ */ jsx115("span", { children: value })
|
|
25339
25607
|
] });
|
|
25340
25608
|
}
|
|
25341
25609
|
function isValidCustom6(item2, field) {
|
|
25342
25610
|
const value = field.getValue({ item: item2 });
|
|
25343
25611
|
if (![void 0, "", null].includes(value) && !colord8(value).isValid()) {
|
|
25344
|
-
return
|
|
25612
|
+
return __57("Value must be a valid color.");
|
|
25345
25613
|
}
|
|
25346
25614
|
return null;
|
|
25347
25615
|
}
|
|
@@ -25369,7 +25637,7 @@ var sort5 = (a, b, direction) => {
|
|
|
25369
25637
|
};
|
|
25370
25638
|
var color_default = {
|
|
25371
25639
|
type: "color",
|
|
25372
|
-
render:
|
|
25640
|
+
render: render4,
|
|
25373
25641
|
Edit: "color",
|
|
25374
25642
|
sort: sort5,
|
|
25375
25643
|
enableSorting: true,
|
|
@@ -25393,7 +25661,7 @@ var color_default = {
|
|
|
25393
25661
|
// src/field-types/url.tsx
|
|
25394
25662
|
var url_default = {
|
|
25395
25663
|
type: "url",
|
|
25396
|
-
render,
|
|
25664
|
+
render: render2,
|
|
25397
25665
|
Edit: "url",
|
|
25398
25666
|
sort: sort_text_default,
|
|
25399
25667
|
enableSorting: true,
|
|
@@ -25431,7 +25699,7 @@ var sort6 = (a, b, direction) => {
|
|
|
25431
25699
|
};
|
|
25432
25700
|
var no_type_default = {
|
|
25433
25701
|
// type: no type for this one
|
|
25434
|
-
render,
|
|
25702
|
+
render: render2,
|
|
25435
25703
|
Edit: null,
|
|
25436
25704
|
sort: sort6,
|
|
25437
25705
|
enableSorting: true,
|
|
@@ -25939,7 +26207,7 @@ function useInfiniteScroll({
|
|
|
25939
26207
|
}
|
|
25940
26208
|
|
|
25941
26209
|
// src/dataviews/index.tsx
|
|
25942
|
-
import { Fragment as
|
|
26210
|
+
import { Fragment as Fragment16, jsx as jsx116, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
25943
26211
|
var defaultGetItemId = (item2) => item2.id;
|
|
25944
26212
|
var defaultIsItemClickable = () => true;
|
|
25945
26213
|
var EMPTY_ARRAY6 = [];
|
|
@@ -25954,19 +26222,19 @@ function DefaultUI({
|
|
|
25954
26222
|
}) {
|
|
25955
26223
|
const { view } = useContext(dataviews_context_default);
|
|
25956
26224
|
const isInfiniteScroll = view.infiniteScrollEnabled;
|
|
25957
|
-
return /* @__PURE__ */
|
|
25958
|
-
/* @__PURE__ */
|
|
26225
|
+
return /* @__PURE__ */ jsxs33(Fragment16, { children: [
|
|
26226
|
+
/* @__PURE__ */ jsxs33(
|
|
25959
26227
|
Stack,
|
|
25960
26228
|
{
|
|
25961
26229
|
direction: "row",
|
|
25962
26230
|
align: "top",
|
|
25963
26231
|
justify: "space-between",
|
|
25964
|
-
className:
|
|
26232
|
+
className: clsx53("dataviews__view-actions", {
|
|
25965
26233
|
"dataviews__view-actions--infinite-scroll": isInfiniteScroll
|
|
25966
26234
|
}),
|
|
25967
26235
|
gap: "xs",
|
|
25968
26236
|
children: [
|
|
25969
|
-
/* @__PURE__ */
|
|
26237
|
+
/* @__PURE__ */ jsxs33(
|
|
25970
26238
|
Stack,
|
|
25971
26239
|
{
|
|
25972
26240
|
direction: "row",
|
|
@@ -25974,21 +26242,21 @@ function DefaultUI({
|
|
|
25974
26242
|
gap: "sm",
|
|
25975
26243
|
className: "dataviews__search",
|
|
25976
26244
|
children: [
|
|
25977
|
-
search && /* @__PURE__ */
|
|
25978
|
-
/* @__PURE__ */
|
|
26245
|
+
search && /* @__PURE__ */ jsx116(dataviews_search_default, { label: searchLabel }),
|
|
26246
|
+
/* @__PURE__ */ jsx116(toggle_default, {})
|
|
25979
26247
|
]
|
|
25980
26248
|
}
|
|
25981
26249
|
),
|
|
25982
|
-
/* @__PURE__ */
|
|
25983
|
-
/* @__PURE__ */
|
|
26250
|
+
/* @__PURE__ */ jsxs33(Stack, { direction: "row", gap: "xs", style: { flexShrink: 0 }, children: [
|
|
26251
|
+
/* @__PURE__ */ jsx116(dataviews_view_config_default, {}),
|
|
25984
26252
|
header
|
|
25985
26253
|
] })
|
|
25986
26254
|
]
|
|
25987
26255
|
}
|
|
25988
26256
|
),
|
|
25989
|
-
/* @__PURE__ */
|
|
25990
|
-
/* @__PURE__ */
|
|
25991
|
-
/* @__PURE__ */
|
|
26257
|
+
/* @__PURE__ */ jsx116(filters_toggled_default, { className: "dataviews-filters__container" }),
|
|
26258
|
+
/* @__PURE__ */ jsx116(DataViewsLayout, {}),
|
|
26259
|
+
/* @__PURE__ */ jsx116(DataViewsFooter, {})
|
|
25992
26260
|
] });
|
|
25993
26261
|
}
|
|
25994
26262
|
function DataViews({
|
|
@@ -26099,7 +26367,7 @@ function DataViews({
|
|
|
26099
26367
|
if (!defaultLayouts[view.type]) {
|
|
26100
26368
|
return null;
|
|
26101
26369
|
}
|
|
26102
|
-
return /* @__PURE__ */
|
|
26370
|
+
return /* @__PURE__ */ jsx116(
|
|
26103
26371
|
dataviews_context_default.Provider,
|
|
26104
26372
|
{
|
|
26105
26373
|
value: {
|
|
@@ -26132,7 +26400,7 @@ function DataViews({
|
|
|
26132
26400
|
onReset,
|
|
26133
26401
|
intersectionObserver
|
|
26134
26402
|
},
|
|
26135
|
-
children: /* @__PURE__ */
|
|
26403
|
+
children: /* @__PURE__ */ jsx116("div", { className: "dataviews-wrapper", children: children ?? /* @__PURE__ */ jsx116(
|
|
26136
26404
|
DefaultUI,
|
|
26137
26405
|
{
|
|
26138
26406
|
header,
|
|
@@ -26157,8 +26425,8 @@ DataViewsSubComponents.Footer = DataViewsFooter;
|
|
|
26157
26425
|
var dataviews_default = DataViewsSubComponents;
|
|
26158
26426
|
|
|
26159
26427
|
// src/dataviews-picker/index.tsx
|
|
26160
|
-
import
|
|
26161
|
-
import { Fragment as
|
|
26428
|
+
import clsx54 from "clsx";
|
|
26429
|
+
import { Fragment as Fragment17, jsx as jsx117, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
26162
26430
|
var isItemClickable = () => false;
|
|
26163
26431
|
var dataViewsPickerLayouts = VIEW_LAYOUTS.filter(
|
|
26164
26432
|
(viewLayout) => viewLayout.isPicker
|
|
@@ -26175,19 +26443,19 @@ function DefaultUI2({
|
|
|
26175
26443
|
}) {
|
|
26176
26444
|
const { view } = useContext(dataviews_context_default);
|
|
26177
26445
|
const isInfiniteScroll = view.infiniteScrollEnabled;
|
|
26178
|
-
return /* @__PURE__ */
|
|
26179
|
-
/* @__PURE__ */
|
|
26446
|
+
return /* @__PURE__ */ jsxs34(Fragment17, { children: [
|
|
26447
|
+
/* @__PURE__ */ jsxs34(
|
|
26180
26448
|
Stack,
|
|
26181
26449
|
{
|
|
26182
26450
|
direction: "row",
|
|
26183
26451
|
align: "top",
|
|
26184
26452
|
justify: "space-between",
|
|
26185
|
-
className:
|
|
26453
|
+
className: clsx54("dataviews__view-actions", {
|
|
26186
26454
|
"dataviews__view-actions--infinite-scroll": isInfiniteScroll
|
|
26187
26455
|
}),
|
|
26188
26456
|
gap: "xs",
|
|
26189
26457
|
children: [
|
|
26190
|
-
/* @__PURE__ */
|
|
26458
|
+
/* @__PURE__ */ jsxs34(
|
|
26191
26459
|
Stack,
|
|
26192
26460
|
{
|
|
26193
26461
|
direction: "row",
|
|
@@ -26195,18 +26463,18 @@ function DefaultUI2({
|
|
|
26195
26463
|
justify: "start",
|
|
26196
26464
|
className: "dataviews__search",
|
|
26197
26465
|
children: [
|
|
26198
|
-
search && /* @__PURE__ */
|
|
26199
|
-
/* @__PURE__ */
|
|
26466
|
+
search && /* @__PURE__ */ jsx117(dataviews_search_default, { label: searchLabel }),
|
|
26467
|
+
/* @__PURE__ */ jsx117(toggle_default, {})
|
|
26200
26468
|
]
|
|
26201
26469
|
}
|
|
26202
26470
|
),
|
|
26203
|
-
/* @__PURE__ */
|
|
26471
|
+
/* @__PURE__ */ jsx117(Stack, { direction: "row", gap: "xs", style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx117(dataviews_view_config_default, {}) })
|
|
26204
26472
|
]
|
|
26205
26473
|
}
|
|
26206
26474
|
),
|
|
26207
|
-
/* @__PURE__ */
|
|
26208
|
-
/* @__PURE__ */
|
|
26209
|
-
/* @__PURE__ */
|
|
26475
|
+
/* @__PURE__ */ jsx117(filters_toggled_default, { className: "dataviews-filters__container" }),
|
|
26476
|
+
/* @__PURE__ */ jsx117(DataViewsLayout, {}),
|
|
26477
|
+
/* @__PURE__ */ jsx117(DataViewsPickerFooter, {})
|
|
26210
26478
|
] });
|
|
26211
26479
|
}
|
|
26212
26480
|
function DataViewsPicker({
|
|
@@ -26293,7 +26561,7 @@ function DataViewsPicker({
|
|
|
26293
26561
|
if (!defaultLayouts[view.type]) {
|
|
26294
26562
|
return null;
|
|
26295
26563
|
}
|
|
26296
|
-
return /* @__PURE__ */
|
|
26564
|
+
return /* @__PURE__ */ jsx117(
|
|
26297
26565
|
dataviews_context_default.Provider,
|
|
26298
26566
|
{
|
|
26299
26567
|
value: {
|
|
@@ -26324,7 +26592,7 @@ function DataViewsPicker({
|
|
|
26324
26592
|
hasInitiallyLoaded: true,
|
|
26325
26593
|
intersectionObserver
|
|
26326
26594
|
},
|
|
26327
|
-
children: /* @__PURE__ */
|
|
26595
|
+
children: /* @__PURE__ */ jsx117("div", { className: "dataviews-picker-wrapper", children: children ?? /* @__PURE__ */ jsx117(DefaultUI2, { search, searchLabel }) })
|
|
26328
26596
|
}
|
|
26329
26597
|
);
|
|
26330
26598
|
}
|
|
@@ -26341,7 +26609,7 @@ DataViewsPickerSubComponents.ViewConfig = DataviewsViewConfigDropdown;
|
|
|
26341
26609
|
var dataviews_picker_default = DataViewsPickerSubComponents;
|
|
26342
26610
|
|
|
26343
26611
|
// src/components/dataform-context/index.tsx
|
|
26344
|
-
import { jsx as
|
|
26612
|
+
import { jsx as jsx118 } from "react/jsx-runtime";
|
|
26345
26613
|
var DataFormContext = createContext({
|
|
26346
26614
|
fields: []
|
|
26347
26615
|
});
|
|
@@ -26350,15 +26618,15 @@ function DataFormProvider({
|
|
|
26350
26618
|
fields,
|
|
26351
26619
|
children
|
|
26352
26620
|
}) {
|
|
26353
|
-
return /* @__PURE__ */
|
|
26621
|
+
return /* @__PURE__ */ jsx118(DataFormContext.Provider, { value: { fields }, children });
|
|
26354
26622
|
}
|
|
26355
26623
|
var dataform_context_default = DataFormContext;
|
|
26356
26624
|
|
|
26357
26625
|
// src/components/dataform-layouts/regular/index.tsx
|
|
26358
|
-
import
|
|
26626
|
+
import clsx55 from "clsx";
|
|
26359
26627
|
|
|
26360
26628
|
// src/components/dataform-layouts/normalize-form.ts
|
|
26361
|
-
import { __ as
|
|
26629
|
+
import { __ as __58 } from "@wordpress/i18n";
|
|
26362
26630
|
var DEFAULT_LAYOUT = {
|
|
26363
26631
|
type: "regular",
|
|
26364
26632
|
labelPosition: "top"
|
|
@@ -26389,14 +26657,14 @@ function normalizeLayout(layout) {
|
|
|
26389
26657
|
if (typeof openAs === "object" && openAs.type === "modal") {
|
|
26390
26658
|
normalizedOpenAs = {
|
|
26391
26659
|
type: "modal",
|
|
26392
|
-
applyLabel: openAs.applyLabel?.trim() ||
|
|
26393
|
-
cancelLabel: openAs.cancelLabel?.trim() ||
|
|
26660
|
+
applyLabel: openAs.applyLabel?.trim() || __58("Apply"),
|
|
26661
|
+
cancelLabel: openAs.cancelLabel?.trim() || __58("Cancel")
|
|
26394
26662
|
};
|
|
26395
26663
|
} else if (openAs === "modal") {
|
|
26396
26664
|
normalizedOpenAs = {
|
|
26397
26665
|
type: "modal",
|
|
26398
|
-
applyLabel:
|
|
26399
|
-
cancelLabel:
|
|
26666
|
+
applyLabel: __58("Apply"),
|
|
26667
|
+
cancelLabel: __58("Cancel")
|
|
26400
26668
|
};
|
|
26401
26669
|
} else {
|
|
26402
26670
|
normalizedOpenAs = { type: "dropdown" };
|
|
@@ -26476,15 +26744,15 @@ function normalizeForm(form) {
|
|
|
26476
26744
|
var normalize_form_default = normalizeForm;
|
|
26477
26745
|
|
|
26478
26746
|
// src/components/dataform-layouts/regular/index.tsx
|
|
26479
|
-
import { Fragment as
|
|
26747
|
+
import { Fragment as Fragment18, jsx as jsx119, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
26480
26748
|
function Header3({ title }) {
|
|
26481
|
-
return /* @__PURE__ */
|
|
26749
|
+
return /* @__PURE__ */ jsx119(
|
|
26482
26750
|
Stack,
|
|
26483
26751
|
{
|
|
26484
26752
|
direction: "column",
|
|
26485
26753
|
className: "dataforms-layouts-regular__header",
|
|
26486
26754
|
gap: "lg",
|
|
26487
|
-
children: /* @__PURE__ */
|
|
26755
|
+
children: /* @__PURE__ */ jsx119(Stack, { direction: "row", align: "center", children: /* @__PURE__ */ jsx119(component_default16, { level: 2, size: 13, children: title }) })
|
|
26488
26756
|
}
|
|
26489
26757
|
);
|
|
26490
26758
|
}
|
|
@@ -26506,9 +26774,9 @@ function FormRegularField({
|
|
|
26506
26774
|
[field]
|
|
26507
26775
|
);
|
|
26508
26776
|
if (!!field.children) {
|
|
26509
|
-
return /* @__PURE__ */
|
|
26510
|
-
!hideLabelFromVision && field.label && /* @__PURE__ */
|
|
26511
|
-
/* @__PURE__ */
|
|
26777
|
+
return /* @__PURE__ */ jsxs35(Fragment18, { children: [
|
|
26778
|
+
!hideLabelFromVision && field.label && /* @__PURE__ */ jsx119(Header3, { title: field.label }),
|
|
26779
|
+
/* @__PURE__ */ jsx119(
|
|
26512
26780
|
DataFormLayout,
|
|
26513
26781
|
{
|
|
26514
26782
|
data,
|
|
@@ -26527,30 +26795,30 @@ function FormRegularField({
|
|
|
26527
26795
|
return null;
|
|
26528
26796
|
}
|
|
26529
26797
|
if (labelPosition === "side") {
|
|
26530
|
-
return /* @__PURE__ */
|
|
26798
|
+
return /* @__PURE__ */ jsxs35(
|
|
26531
26799
|
Stack,
|
|
26532
26800
|
{
|
|
26533
26801
|
direction: "row",
|
|
26534
26802
|
className: "dataforms-layouts-regular__field",
|
|
26535
26803
|
gap: "sm",
|
|
26536
26804
|
children: [
|
|
26537
|
-
/* @__PURE__ */
|
|
26805
|
+
/* @__PURE__ */ jsx119(
|
|
26538
26806
|
"div",
|
|
26539
26807
|
{
|
|
26540
|
-
className:
|
|
26808
|
+
className: clsx55(
|
|
26541
26809
|
"dataforms-layouts-regular__field-label",
|
|
26542
26810
|
`dataforms-layouts-regular__field-label--label-position-${labelPosition}`
|
|
26543
26811
|
),
|
|
26544
|
-
children: /* @__PURE__ */
|
|
26812
|
+
children: /* @__PURE__ */ jsx119(base_control_default.VisualLabel, { children: fieldDefinition.label })
|
|
26545
26813
|
}
|
|
26546
26814
|
),
|
|
26547
|
-
/* @__PURE__ */
|
|
26815
|
+
/* @__PURE__ */ jsx119("div", { className: "dataforms-layouts-regular__field-control", children: fieldDefinition.readOnly === true ? /* @__PURE__ */ jsx119(
|
|
26548
26816
|
fieldDefinition.render,
|
|
26549
26817
|
{
|
|
26550
26818
|
item: data,
|
|
26551
26819
|
field: fieldDefinition
|
|
26552
26820
|
}
|
|
26553
|
-
) : /* @__PURE__ */
|
|
26821
|
+
) : /* @__PURE__ */ jsx119(
|
|
26554
26822
|
fieldDefinition.Edit,
|
|
26555
26823
|
{
|
|
26556
26824
|
data,
|
|
@@ -26566,16 +26834,16 @@ function FormRegularField({
|
|
|
26566
26834
|
}
|
|
26567
26835
|
);
|
|
26568
26836
|
}
|
|
26569
|
-
return /* @__PURE__ */
|
|
26570
|
-
!hideLabelFromVision && labelPosition !== "none" && /* @__PURE__ */
|
|
26571
|
-
/* @__PURE__ */
|
|
26837
|
+
return /* @__PURE__ */ jsx119("div", { className: "dataforms-layouts-regular__field", children: fieldDefinition.readOnly === true ? /* @__PURE__ */ jsx119(Fragment18, { children: /* @__PURE__ */ jsxs35(Fragment18, { children: [
|
|
26838
|
+
!hideLabelFromVision && labelPosition !== "none" && /* @__PURE__ */ jsx119(base_control_default.VisualLabel, { children: fieldDefinition.label }),
|
|
26839
|
+
/* @__PURE__ */ jsx119(
|
|
26572
26840
|
fieldDefinition.render,
|
|
26573
26841
|
{
|
|
26574
26842
|
item: data,
|
|
26575
26843
|
field: fieldDefinition
|
|
26576
26844
|
}
|
|
26577
26845
|
)
|
|
26578
|
-
] }) }) : /* @__PURE__ */
|
|
26846
|
+
] }) }) : /* @__PURE__ */ jsx119(
|
|
26579
26847
|
fieldDefinition.Edit,
|
|
26580
26848
|
{
|
|
26581
26849
|
data,
|
|
@@ -26592,13 +26860,13 @@ function FormRegularField({
|
|
|
26592
26860
|
import deepMerge2 from "deepmerge";
|
|
26593
26861
|
|
|
26594
26862
|
// src/components/dataform-layouts/panel/summary-button.tsx
|
|
26595
|
-
import
|
|
26596
|
-
import { sprintf as
|
|
26863
|
+
import clsx57 from "clsx";
|
|
26864
|
+
import { sprintf as sprintf18, _x as _x5 } from "@wordpress/i18n";
|
|
26597
26865
|
|
|
26598
26866
|
// src/components/dataform-layouts/panel/utils/get-label-classname.ts
|
|
26599
|
-
import
|
|
26867
|
+
import clsx56 from "clsx";
|
|
26600
26868
|
function getLabelClassName(labelPosition, showError) {
|
|
26601
|
-
return
|
|
26869
|
+
return clsx56(
|
|
26602
26870
|
"dataforms-layouts-panel__field-label",
|
|
26603
26871
|
`dataforms-layouts-panel__field-label--label-position-${labelPosition}`,
|
|
26604
26872
|
{ "has-error": showError }
|
|
@@ -26607,15 +26875,15 @@ function getLabelClassName(labelPosition, showError) {
|
|
|
26607
26875
|
var get_label_classname_default = getLabelClassName;
|
|
26608
26876
|
|
|
26609
26877
|
// src/components/dataform-layouts/panel/utils/get-label-content.tsx
|
|
26610
|
-
import { jsx as
|
|
26878
|
+
import { jsx as jsx120, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
26611
26879
|
function getLabelContent(showError, errorMessage, fieldLabel) {
|
|
26612
|
-
return showError ? /* @__PURE__ */
|
|
26613
|
-
/* @__PURE__ */
|
|
26880
|
+
return showError ? /* @__PURE__ */ jsxs36(tooltip_exports.Root, { children: [
|
|
26881
|
+
/* @__PURE__ */ jsx120(
|
|
26614
26882
|
tooltip_exports.Trigger,
|
|
26615
26883
|
{
|
|
26616
|
-
render: /* @__PURE__ */
|
|
26617
|
-
/* @__PURE__ */
|
|
26618
|
-
/* @__PURE__ */
|
|
26884
|
+
render: /* @__PURE__ */ jsxs36("span", { className: "dataforms-layouts-panel__field-label-error-content", children: [
|
|
26885
|
+
/* @__PURE__ */ jsx120(icon_default2, { icon: error_default, size: 16 }),
|
|
26886
|
+
/* @__PURE__ */ jsxs36(VisuallyHidden, { children: [
|
|
26619
26887
|
errorMessage,
|
|
26620
26888
|
": "
|
|
26621
26889
|
] }),
|
|
@@ -26623,7 +26891,7 @@ function getLabelContent(showError, errorMessage, fieldLabel) {
|
|
|
26623
26891
|
] })
|
|
26624
26892
|
}
|
|
26625
26893
|
),
|
|
26626
|
-
/* @__PURE__ */
|
|
26894
|
+
/* @__PURE__ */ jsx120(tooltip_exports.Popup, { children: errorMessage })
|
|
26627
26895
|
] }) : fieldLabel;
|
|
26628
26896
|
}
|
|
26629
26897
|
var get_label_content_default = getLabelContent;
|
|
@@ -26664,7 +26932,7 @@ function getFirstValidationError(validity) {
|
|
|
26664
26932
|
var get_first_validation_error_default = getFirstValidationError;
|
|
26665
26933
|
|
|
26666
26934
|
// src/components/dataform-layouts/panel/summary-button.tsx
|
|
26667
|
-
import { jsx as
|
|
26935
|
+
import { jsx as jsx121, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
26668
26936
|
function SummaryButton({
|
|
26669
26937
|
data,
|
|
26670
26938
|
field,
|
|
@@ -26681,7 +26949,7 @@ function SummaryButton({
|
|
|
26681
26949
|
const showError = touched && !!errorMessage;
|
|
26682
26950
|
const labelClassName = get_label_classname_default(labelPosition, showError);
|
|
26683
26951
|
const labelContent = get_label_content_default(showError, errorMessage, fieldLabel);
|
|
26684
|
-
const className2 =
|
|
26952
|
+
const className2 = clsx57(
|
|
26685
26953
|
"dataforms-layouts-panel__field-trigger",
|
|
26686
26954
|
`dataforms-layouts-panel__field-trigger--label-${labelPosition}`,
|
|
26687
26955
|
{
|
|
@@ -26693,11 +26961,11 @@ function SummaryButton({
|
|
|
26693
26961
|
SummaryButton,
|
|
26694
26962
|
"dataforms-layouts-panel__field-control"
|
|
26695
26963
|
);
|
|
26696
|
-
const ariaLabel = showError ?
|
|
26964
|
+
const ariaLabel = showError ? sprintf18(
|
|
26697
26965
|
// translators: %s: Field name.
|
|
26698
26966
|
_x5("Edit %s (has errors)", "field"),
|
|
26699
26967
|
fieldLabel || ""
|
|
26700
|
-
) :
|
|
26968
|
+
) : sprintf18(
|
|
26701
26969
|
// translators: %s: Field name.
|
|
26702
26970
|
_x5("Edit %s", "field"),
|
|
26703
26971
|
fieldLabel || ""
|
|
@@ -26716,7 +26984,7 @@ function SummaryButton({
|
|
|
26716
26984
|
onClick();
|
|
26717
26985
|
}
|
|
26718
26986
|
};
|
|
26719
|
-
return /* @__PURE__ */
|
|
26987
|
+
return /* @__PURE__ */ jsxs37(
|
|
26720
26988
|
"div",
|
|
26721
26989
|
{
|
|
26722
26990
|
ref: rowRef,
|
|
@@ -26724,30 +26992,30 @@ function SummaryButton({
|
|
|
26724
26992
|
onClick: !disabled ? handleRowClick : void 0,
|
|
26725
26993
|
onKeyDown: !disabled ? handleKeyDown : void 0,
|
|
26726
26994
|
children: [
|
|
26727
|
-
labelPosition !== "none" && /* @__PURE__ */
|
|
26728
|
-
labelPosition === "none" && showError && /* @__PURE__ */
|
|
26729
|
-
/* @__PURE__ */
|
|
26995
|
+
labelPosition !== "none" && /* @__PURE__ */ jsx121("span", { className: labelClassName, children: labelContent }),
|
|
26996
|
+
labelPosition === "none" && showError && /* @__PURE__ */ jsxs37(tooltip_exports.Root, { children: [
|
|
26997
|
+
/* @__PURE__ */ jsx121(
|
|
26730
26998
|
tooltip_exports.Trigger,
|
|
26731
26999
|
{
|
|
26732
|
-
render: /* @__PURE__ */
|
|
27000
|
+
render: /* @__PURE__ */ jsx121(
|
|
26733
27001
|
"span",
|
|
26734
27002
|
{
|
|
26735
27003
|
className: "dataforms-layouts-panel__field-label-error-content",
|
|
26736
27004
|
role: "img",
|
|
26737
27005
|
"aria-label": errorMessage,
|
|
26738
|
-
children: /* @__PURE__ */
|
|
27006
|
+
children: /* @__PURE__ */ jsx121(icon_default2, { icon: error_default, size: 16 })
|
|
26739
27007
|
}
|
|
26740
27008
|
)
|
|
26741
27009
|
}
|
|
26742
27010
|
),
|
|
26743
|
-
/* @__PURE__ */
|
|
27011
|
+
/* @__PURE__ */ jsx121(tooltip_exports.Popup, { children: errorMessage })
|
|
26744
27012
|
] }),
|
|
26745
|
-
/* @__PURE__ */
|
|
27013
|
+
/* @__PURE__ */ jsx121(
|
|
26746
27014
|
"span",
|
|
26747
27015
|
{
|
|
26748
27016
|
id: `${controlId}`,
|
|
26749
27017
|
className: "dataforms-layouts-panel__field-control",
|
|
26750
|
-
children: summaryFields.length > 1 ? /* @__PURE__ */
|
|
27018
|
+
children: summaryFields.length > 1 ? /* @__PURE__ */ jsx121(
|
|
26751
27019
|
"span",
|
|
26752
27020
|
{
|
|
26753
27021
|
style: {
|
|
@@ -26757,11 +27025,11 @@ function SummaryButton({
|
|
|
26757
27025
|
width: "100%",
|
|
26758
27026
|
gap: "2px"
|
|
26759
27027
|
},
|
|
26760
|
-
children: summaryFields.map((summaryField) => /* @__PURE__ */
|
|
27028
|
+
children: summaryFields.map((summaryField) => /* @__PURE__ */ jsx121(
|
|
26761
27029
|
"span",
|
|
26762
27030
|
{
|
|
26763
27031
|
style: { width: "100%" },
|
|
26764
|
-
children: /* @__PURE__ */
|
|
27032
|
+
children: /* @__PURE__ */ jsx121(
|
|
26765
27033
|
summaryField.render,
|
|
26766
27034
|
{
|
|
26767
27035
|
item: data,
|
|
@@ -26772,7 +27040,7 @@ function SummaryButton({
|
|
|
26772
27040
|
summaryField.id
|
|
26773
27041
|
))
|
|
26774
27042
|
}
|
|
26775
|
-
) : summaryFields.map((summaryField) => /* @__PURE__ */
|
|
27043
|
+
) : summaryFields.map((summaryField) => /* @__PURE__ */ jsx121(
|
|
26776
27044
|
summaryField.render,
|
|
26777
27045
|
{
|
|
26778
27046
|
item: data,
|
|
@@ -26782,7 +27050,7 @@ function SummaryButton({
|
|
|
26782
27050
|
))
|
|
26783
27051
|
}
|
|
26784
27052
|
),
|
|
26785
|
-
!disabled && /* @__PURE__ */
|
|
27053
|
+
!disabled && /* @__PURE__ */ jsx121(
|
|
26786
27054
|
button_default,
|
|
26787
27055
|
{
|
|
26788
27056
|
className: "dataforms-layouts-panel__field-trigger-icon",
|
|
@@ -26802,7 +27070,7 @@ function SummaryButton({
|
|
|
26802
27070
|
// src/hooks/use-form-validity.ts
|
|
26803
27071
|
import deepMerge from "deepmerge";
|
|
26804
27072
|
import fastDeepEqual3 from "fast-deep-equal/es6/index.js";
|
|
26805
|
-
import { __ as
|
|
27073
|
+
import { __ as __59 } from "@wordpress/i18n";
|
|
26806
27074
|
function isFormValid(formValidity) {
|
|
26807
27075
|
if (!formValidity) {
|
|
26808
27076
|
return true;
|
|
@@ -26932,7 +27200,7 @@ function handleElementsValidationAsync(promise, formField, promiseHandler) {
|
|
|
26932
27200
|
{
|
|
26933
27201
|
elements: {
|
|
26934
27202
|
type: "invalid",
|
|
26935
|
-
message:
|
|
27203
|
+
message: __59("Could not validate elements.")
|
|
26936
27204
|
}
|
|
26937
27205
|
},
|
|
26938
27206
|
[...path, formField.id]
|
|
@@ -26951,7 +27219,7 @@ function handleElementsValidationAsync(promise, formField, promiseHandler) {
|
|
|
26951
27219
|
{
|
|
26952
27220
|
elements: {
|
|
26953
27221
|
type: "invalid",
|
|
26954
|
-
message:
|
|
27222
|
+
message: __59(
|
|
26955
27223
|
"Value must be one of the elements."
|
|
26956
27224
|
)
|
|
26957
27225
|
}
|
|
@@ -26977,7 +27245,7 @@ function handleElementsValidationAsync(promise, formField, promiseHandler) {
|
|
|
26977
27245
|
if (error instanceof Error) {
|
|
26978
27246
|
errorMessage = error.message;
|
|
26979
27247
|
} else {
|
|
26980
|
-
errorMessage = String(error) ||
|
|
27248
|
+
errorMessage = String(error) || __59(
|
|
26981
27249
|
"Unknown error when running elements validation asynchronously."
|
|
26982
27250
|
);
|
|
26983
27251
|
}
|
|
@@ -27036,7 +27304,7 @@ function handleCustomValidationAsync(promise, formField, promiseHandler) {
|
|
|
27036
27304
|
{
|
|
27037
27305
|
custom: {
|
|
27038
27306
|
type: "invalid",
|
|
27039
|
-
message:
|
|
27307
|
+
message: __59("Validation could not be processed.")
|
|
27040
27308
|
}
|
|
27041
27309
|
},
|
|
27042
27310
|
[...path, formField.id]
|
|
@@ -27051,7 +27319,7 @@ function handleCustomValidationAsync(promise, formField, promiseHandler) {
|
|
|
27051
27319
|
if (error instanceof Error) {
|
|
27052
27320
|
errorMessage = error.message;
|
|
27053
27321
|
} else {
|
|
27054
|
-
errorMessage = String(error) ||
|
|
27322
|
+
errorMessage = String(error) || __59(
|
|
27055
27323
|
"Unknown error when running custom validation asynchronously."
|
|
27056
27324
|
);
|
|
27057
27325
|
}
|
|
@@ -27080,7 +27348,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
27080
27348
|
return {
|
|
27081
27349
|
pattern: {
|
|
27082
27350
|
type: "invalid",
|
|
27083
|
-
message:
|
|
27351
|
+
message: __59("Value does not match the required pattern.")
|
|
27084
27352
|
}
|
|
27085
27353
|
};
|
|
27086
27354
|
}
|
|
@@ -27088,7 +27356,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
27088
27356
|
return {
|
|
27089
27357
|
min: {
|
|
27090
27358
|
type: "invalid",
|
|
27091
|
-
message:
|
|
27359
|
+
message: __59("Value is below the minimum.")
|
|
27092
27360
|
}
|
|
27093
27361
|
};
|
|
27094
27362
|
}
|
|
@@ -27096,7 +27364,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
27096
27364
|
return {
|
|
27097
27365
|
max: {
|
|
27098
27366
|
type: "invalid",
|
|
27099
|
-
message:
|
|
27367
|
+
message: __59("Value is above the maximum.")
|
|
27100
27368
|
}
|
|
27101
27369
|
};
|
|
27102
27370
|
}
|
|
@@ -27104,7 +27372,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
27104
27372
|
return {
|
|
27105
27373
|
minLength: {
|
|
27106
27374
|
type: "invalid",
|
|
27107
|
-
message:
|
|
27375
|
+
message: __59("Value is too short.")
|
|
27108
27376
|
}
|
|
27109
27377
|
};
|
|
27110
27378
|
}
|
|
@@ -27112,7 +27380,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
27112
27380
|
return {
|
|
27113
27381
|
maxLength: {
|
|
27114
27382
|
type: "invalid",
|
|
27115
|
-
message:
|
|
27383
|
+
message: __59("Value is too long.")
|
|
27116
27384
|
}
|
|
27117
27385
|
};
|
|
27118
27386
|
}
|
|
@@ -27120,7 +27388,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
27120
27388
|
return {
|
|
27121
27389
|
elements: {
|
|
27122
27390
|
type: "invalid",
|
|
27123
|
-
message:
|
|
27391
|
+
message: __59("Value must be one of the elements.")
|
|
27124
27392
|
}
|
|
27125
27393
|
};
|
|
27126
27394
|
}
|
|
@@ -27143,7 +27411,7 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
27143
27411
|
if (error instanceof Error) {
|
|
27144
27412
|
errorMessage = error.message;
|
|
27145
27413
|
} else {
|
|
27146
|
-
errorMessage = String(error) ||
|
|
27414
|
+
errorMessage = String(error) || __59("Unknown error when running custom validation.");
|
|
27147
27415
|
}
|
|
27148
27416
|
return {
|
|
27149
27417
|
custom: {
|
|
@@ -27170,14 +27438,14 @@ function validateFormField(item2, formField, promiseHandler) {
|
|
|
27170
27438
|
);
|
|
27171
27439
|
fieldValidity.elements = {
|
|
27172
27440
|
type: "validating",
|
|
27173
|
-
message:
|
|
27441
|
+
message: __59("Validating\u2026")
|
|
27174
27442
|
};
|
|
27175
27443
|
}
|
|
27176
27444
|
if (customError instanceof Promise) {
|
|
27177
27445
|
handleCustomValidationAsync(customError, formField, promiseHandler);
|
|
27178
27446
|
fieldValidity.custom = {
|
|
27179
27447
|
type: "validating",
|
|
27180
|
-
message:
|
|
27448
|
+
message: __59("Validating\u2026")
|
|
27181
27449
|
};
|
|
27182
27450
|
}
|
|
27183
27451
|
if (Object.keys(fieldValidity).length > 0) {
|
|
@@ -27369,7 +27637,7 @@ function useFieldFromFormField(field) {
|
|
|
27369
27637
|
var use_field_from_form_field_default = useFieldFromFormField;
|
|
27370
27638
|
|
|
27371
27639
|
// src/components/dataform-layouts/panel/modal.tsx
|
|
27372
|
-
import { Fragment as
|
|
27640
|
+
import { Fragment as Fragment19, jsx as jsx122, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
27373
27641
|
function ModalContent({
|
|
27374
27642
|
data,
|
|
27375
27643
|
field,
|
|
@@ -27426,7 +27694,7 @@ function ModalContent({
|
|
|
27426
27694
|
const contentRef = useRef(null);
|
|
27427
27695
|
const mergedRef = useMergeRefs([focusOnMountRef, contentRef]);
|
|
27428
27696
|
useReportValidity(contentRef, touched);
|
|
27429
|
-
return /* @__PURE__ */
|
|
27697
|
+
return /* @__PURE__ */ jsxs38(
|
|
27430
27698
|
modal_default,
|
|
27431
27699
|
{
|
|
27432
27700
|
className: "dataforms-layouts-panel__modal",
|
|
@@ -27435,14 +27703,14 @@ function ModalContent({
|
|
|
27435
27703
|
title: fieldLabel,
|
|
27436
27704
|
size: "medium",
|
|
27437
27705
|
children: [
|
|
27438
|
-
/* @__PURE__ */
|
|
27706
|
+
/* @__PURE__ */ jsx122("div", { ref: mergedRef, children: /* @__PURE__ */ jsx122(
|
|
27439
27707
|
DataFormLayout,
|
|
27440
27708
|
{
|
|
27441
27709
|
data: modalData,
|
|
27442
27710
|
form,
|
|
27443
27711
|
onChange: handleOnChange,
|
|
27444
27712
|
validity,
|
|
27445
|
-
children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */
|
|
27713
|
+
children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */ jsx122(
|
|
27446
27714
|
FieldLayout,
|
|
27447
27715
|
{
|
|
27448
27716
|
data: modalData,
|
|
@@ -27456,15 +27724,15 @@ function ModalContent({
|
|
|
27456
27724
|
)
|
|
27457
27725
|
}
|
|
27458
27726
|
) }),
|
|
27459
|
-
/* @__PURE__ */
|
|
27727
|
+
/* @__PURE__ */ jsxs38(
|
|
27460
27728
|
Stack,
|
|
27461
27729
|
{
|
|
27462
27730
|
direction: "row",
|
|
27463
27731
|
className: "dataforms-layouts-panel__modal-footer",
|
|
27464
27732
|
gap: "md",
|
|
27465
27733
|
children: [
|
|
27466
|
-
/* @__PURE__ */
|
|
27467
|
-
/* @__PURE__ */
|
|
27734
|
+
/* @__PURE__ */ jsx122(component_default6, { style: { flex: 1 } }),
|
|
27735
|
+
/* @__PURE__ */ jsx122(
|
|
27468
27736
|
button_default,
|
|
27469
27737
|
{
|
|
27470
27738
|
variant: "tertiary",
|
|
@@ -27473,7 +27741,7 @@ function ModalContent({
|
|
|
27473
27741
|
children: cancelLabel
|
|
27474
27742
|
}
|
|
27475
27743
|
),
|
|
27476
|
-
/* @__PURE__ */
|
|
27744
|
+
/* @__PURE__ */ jsx122(
|
|
27477
27745
|
button_default,
|
|
27478
27746
|
{
|
|
27479
27747
|
variant: "primary",
|
|
@@ -27505,8 +27773,8 @@ function PanelModal({
|
|
|
27505
27773
|
setIsOpen(false);
|
|
27506
27774
|
setTouched(true);
|
|
27507
27775
|
};
|
|
27508
|
-
return /* @__PURE__ */
|
|
27509
|
-
/* @__PURE__ */
|
|
27776
|
+
return /* @__PURE__ */ jsxs38(Fragment19, { children: [
|
|
27777
|
+
/* @__PURE__ */ jsx122(
|
|
27510
27778
|
SummaryButton,
|
|
27511
27779
|
{
|
|
27512
27780
|
data,
|
|
@@ -27520,7 +27788,7 @@ function PanelModal({
|
|
|
27520
27788
|
"aria-expanded": isOpen
|
|
27521
27789
|
}
|
|
27522
27790
|
),
|
|
27523
|
-
isOpen && /* @__PURE__ */
|
|
27791
|
+
isOpen && /* @__PURE__ */ jsx122(
|
|
27524
27792
|
ModalContent,
|
|
27525
27793
|
{
|
|
27526
27794
|
data,
|
|
@@ -27536,25 +27804,25 @@ function PanelModal({
|
|
|
27536
27804
|
var modal_default2 = PanelModal;
|
|
27537
27805
|
|
|
27538
27806
|
// src/components/dataform-layouts/panel/dropdown.tsx
|
|
27539
|
-
import { __ as
|
|
27540
|
-
import { jsx as
|
|
27807
|
+
import { __ as __60 } from "@wordpress/i18n";
|
|
27808
|
+
import { jsx as jsx123, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
27541
27809
|
function DropdownHeader({
|
|
27542
27810
|
title,
|
|
27543
27811
|
onClose
|
|
27544
27812
|
}) {
|
|
27545
|
-
return /* @__PURE__ */
|
|
27813
|
+
return /* @__PURE__ */ jsx123(
|
|
27546
27814
|
Stack,
|
|
27547
27815
|
{
|
|
27548
27816
|
direction: "column",
|
|
27549
27817
|
className: "dataforms-layouts-panel__dropdown-header",
|
|
27550
27818
|
gap: "lg",
|
|
27551
|
-
children: /* @__PURE__ */
|
|
27552
|
-
title && /* @__PURE__ */
|
|
27553
|
-
/* @__PURE__ */
|
|
27554
|
-
onClose && /* @__PURE__ */
|
|
27819
|
+
children: /* @__PURE__ */ jsxs39(Stack, { direction: "row", gap: "sm", align: "center", children: [
|
|
27820
|
+
title && /* @__PURE__ */ jsx123(component_default16, { level: 2, size: 13, children: title }),
|
|
27821
|
+
/* @__PURE__ */ jsx123(component_default6, { style: { flex: 1 } }),
|
|
27822
|
+
onClose && /* @__PURE__ */ jsx123(
|
|
27555
27823
|
button_default,
|
|
27556
27824
|
{
|
|
27557
|
-
label:
|
|
27825
|
+
label: __60("Close"),
|
|
27558
27826
|
icon: close_small_default,
|
|
27559
27827
|
onClick: onClose,
|
|
27560
27828
|
size: "small"
|
|
@@ -27570,7 +27838,7 @@ function DropdownContentWithValidation({
|
|
|
27570
27838
|
}) {
|
|
27571
27839
|
const ref = useRef(null);
|
|
27572
27840
|
useReportValidity(ref, touched);
|
|
27573
|
-
return /* @__PURE__ */
|
|
27841
|
+
return /* @__PURE__ */ jsx123("div", { ref, children });
|
|
27574
27842
|
}
|
|
27575
27843
|
function PanelDropdown({
|
|
27576
27844
|
data,
|
|
@@ -27619,12 +27887,12 @@ function PanelDropdown({
|
|
|
27619
27887
|
if (!fieldDefinition) {
|
|
27620
27888
|
return null;
|
|
27621
27889
|
}
|
|
27622
|
-
return /* @__PURE__ */
|
|
27890
|
+
return /* @__PURE__ */ jsx123(
|
|
27623
27891
|
"div",
|
|
27624
27892
|
{
|
|
27625
27893
|
ref: setPopoverAnchor,
|
|
27626
27894
|
className: "dataforms-layouts-panel__field-dropdown-anchor",
|
|
27627
|
-
children: /* @__PURE__ */
|
|
27895
|
+
children: /* @__PURE__ */ jsx123(
|
|
27628
27896
|
dropdown_default,
|
|
27629
27897
|
{
|
|
27630
27898
|
contentClassName: "dataforms-layouts-panel__field-dropdown",
|
|
@@ -27635,7 +27903,7 @@ function PanelDropdown({
|
|
|
27635
27903
|
setTouched(true);
|
|
27636
27904
|
}
|
|
27637
27905
|
},
|
|
27638
|
-
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */
|
|
27906
|
+
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ jsx123(
|
|
27639
27907
|
SummaryButton,
|
|
27640
27908
|
{
|
|
27641
27909
|
data,
|
|
@@ -27649,22 +27917,22 @@ function PanelDropdown({
|
|
|
27649
27917
|
"aria-expanded": isOpen
|
|
27650
27918
|
}
|
|
27651
27919
|
),
|
|
27652
|
-
renderContent: ({ onClose }) => /* @__PURE__ */
|
|
27653
|
-
/* @__PURE__ */
|
|
27920
|
+
renderContent: ({ onClose }) => /* @__PURE__ */ jsx123(DropdownContentWithValidation, { touched, children: /* @__PURE__ */ jsxs39("div", { ref: dialogRef, ...dialogProps, children: [
|
|
27921
|
+
/* @__PURE__ */ jsx123(
|
|
27654
27922
|
DropdownHeader,
|
|
27655
27923
|
{
|
|
27656
27924
|
title: fieldLabel,
|
|
27657
27925
|
onClose
|
|
27658
27926
|
}
|
|
27659
27927
|
),
|
|
27660
|
-
/* @__PURE__ */
|
|
27928
|
+
/* @__PURE__ */ jsx123(
|
|
27661
27929
|
DataFormLayout,
|
|
27662
27930
|
{
|
|
27663
27931
|
data,
|
|
27664
27932
|
form,
|
|
27665
27933
|
onChange,
|
|
27666
27934
|
validity: formValidity,
|
|
27667
|
-
children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */
|
|
27935
|
+
children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */ jsx123(
|
|
27668
27936
|
FieldLayout,
|
|
27669
27937
|
{
|
|
27670
27938
|
data,
|
|
@@ -27687,7 +27955,7 @@ function PanelDropdown({
|
|
|
27687
27955
|
var dropdown_default2 = PanelDropdown;
|
|
27688
27956
|
|
|
27689
27957
|
// src/components/dataform-layouts/panel/index.tsx
|
|
27690
|
-
import { jsx as
|
|
27958
|
+
import { jsx as jsx124 } from "react/jsx-runtime";
|
|
27691
27959
|
function FormPanelField({
|
|
27692
27960
|
data,
|
|
27693
27961
|
field,
|
|
@@ -27696,7 +27964,7 @@ function FormPanelField({
|
|
|
27696
27964
|
}) {
|
|
27697
27965
|
const layout = field.layout;
|
|
27698
27966
|
if (layout.openAs.type === "modal") {
|
|
27699
|
-
return /* @__PURE__ */
|
|
27967
|
+
return /* @__PURE__ */ jsx124(
|
|
27700
27968
|
modal_default2,
|
|
27701
27969
|
{
|
|
27702
27970
|
data,
|
|
@@ -27706,7 +27974,7 @@ function FormPanelField({
|
|
|
27706
27974
|
}
|
|
27707
27975
|
);
|
|
27708
27976
|
}
|
|
27709
|
-
return /* @__PURE__ */
|
|
27977
|
+
return /* @__PURE__ */ jsx124(
|
|
27710
27978
|
dropdown_default2,
|
|
27711
27979
|
{
|
|
27712
27980
|
data,
|
|
@@ -27718,8 +27986,8 @@ function FormPanelField({
|
|
|
27718
27986
|
}
|
|
27719
27987
|
|
|
27720
27988
|
// src/components/dataform-layouts/validation-badge.tsx
|
|
27721
|
-
import { sprintf as
|
|
27722
|
-
import { jsx as
|
|
27989
|
+
import { sprintf as sprintf19, _n as _n4 } from "@wordpress/i18n";
|
|
27990
|
+
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
27723
27991
|
function countInvalidFields(validity) {
|
|
27724
27992
|
if (!validity) {
|
|
27725
27993
|
return 0;
|
|
@@ -27748,7 +28016,7 @@ function ValidationBadge({
|
|
|
27748
28016
|
if (invalidCount === 0) {
|
|
27749
28017
|
return null;
|
|
27750
28018
|
}
|
|
27751
|
-
return /* @__PURE__ */
|
|
28019
|
+
return /* @__PURE__ */ jsx125(Badge, { intent: "high", children: sprintf19(
|
|
27752
28020
|
/* translators: %d: Number of fields that need attention */
|
|
27753
28021
|
_n4(
|
|
27754
28022
|
"%d field needs attention",
|
|
@@ -27760,7 +28028,7 @@ function ValidationBadge({
|
|
|
27760
28028
|
}
|
|
27761
28029
|
|
|
27762
28030
|
// src/components/dataform-layouts/card/index.tsx
|
|
27763
|
-
import { Fragment as
|
|
28031
|
+
import { Fragment as Fragment20, jsx as jsx126, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
27764
28032
|
function isSummaryFieldVisible(summaryField, summaryConfig, isOpen) {
|
|
27765
28033
|
if (!summaryConfig || Array.isArray(summaryConfig) && summaryConfig.length === 0) {
|
|
27766
28034
|
return false;
|
|
@@ -27801,17 +28069,17 @@ function HeaderContent({
|
|
|
27801
28069
|
);
|
|
27802
28070
|
const hasBadge = touched && layout.isCollapsible;
|
|
27803
28071
|
const hasSummary = visibleSummaryFields.length > 0 && layout.withHeader;
|
|
27804
|
-
return /* @__PURE__ */
|
|
28072
|
+
return /* @__PURE__ */ jsxs40(
|
|
27805
28073
|
Stack,
|
|
27806
28074
|
{
|
|
27807
28075
|
align: "center",
|
|
27808
28076
|
justify: "space-between",
|
|
27809
28077
|
className: "dataforms-layouts-card__field-header-content",
|
|
27810
28078
|
children: [
|
|
27811
|
-
/* @__PURE__ */
|
|
27812
|
-
(hasBadge || hasSummary) && /* @__PURE__ */
|
|
27813
|
-
hasBadge && /* @__PURE__ */
|
|
27814
|
-
hasSummary && /* @__PURE__ */
|
|
28079
|
+
/* @__PURE__ */ jsx126(card_exports.Title, { children: label }),
|
|
28080
|
+
(hasBadge || hasSummary) && /* @__PURE__ */ jsxs40(collapsible_card_exports.HeaderDescription, { className: "dataforms-layouts-card__field-header-content-description", children: [
|
|
28081
|
+
hasBadge && /* @__PURE__ */ jsx126(ValidationBadge, { validity }),
|
|
28082
|
+
hasSummary && /* @__PURE__ */ jsx126("div", { className: "dataforms-layouts-card__field-summary", children: visibleSummaryFields.map((summaryField) => /* @__PURE__ */ jsx126(
|
|
27815
28083
|
summaryField.render,
|
|
27816
28084
|
{
|
|
27817
28085
|
item: data,
|
|
@@ -27835,9 +28103,9 @@ function BodyContent({
|
|
|
27835
28103
|
withHeader
|
|
27836
28104
|
}) {
|
|
27837
28105
|
if (field.children) {
|
|
27838
|
-
return /* @__PURE__ */
|
|
27839
|
-
field.description && /* @__PURE__ */
|
|
27840
|
-
/* @__PURE__ */
|
|
28106
|
+
return /* @__PURE__ */ jsxs40(Fragment20, { children: [
|
|
28107
|
+
field.description && /* @__PURE__ */ jsx126("div", { className: "dataforms-layouts-card__field-description", children: field.description }),
|
|
28108
|
+
/* @__PURE__ */ jsx126(
|
|
27841
28109
|
DataFormLayout,
|
|
27842
28110
|
{
|
|
27843
28111
|
data,
|
|
@@ -27852,7 +28120,7 @@ function BodyContent({
|
|
|
27852
28120
|
if (!SingleFieldLayout) {
|
|
27853
28121
|
return null;
|
|
27854
28122
|
}
|
|
27855
|
-
return /* @__PURE__ */
|
|
28123
|
+
return /* @__PURE__ */ jsx126(
|
|
27856
28124
|
SingleFieldLayout,
|
|
27857
28125
|
{
|
|
27858
28126
|
data,
|
|
@@ -27915,7 +28183,7 @@ function FormCardField({
|
|
|
27915
28183
|
label = fieldDefinition.label;
|
|
27916
28184
|
withHeader = !!label && layout.withHeader;
|
|
27917
28185
|
}
|
|
27918
|
-
const bodyContent = /* @__PURE__ */
|
|
28186
|
+
const bodyContent = /* @__PURE__ */ jsx126(
|
|
27919
28187
|
BodyContent,
|
|
27920
28188
|
{
|
|
27921
28189
|
data,
|
|
@@ -27928,7 +28196,7 @@ function FormCardField({
|
|
|
27928
28196
|
withHeader
|
|
27929
28197
|
}
|
|
27930
28198
|
);
|
|
27931
|
-
const headerContent = /* @__PURE__ */
|
|
28199
|
+
const headerContent = /* @__PURE__ */ jsx126(
|
|
27932
28200
|
HeaderContent,
|
|
27933
28201
|
{
|
|
27934
28202
|
data,
|
|
@@ -27941,15 +28209,15 @@ function FormCardField({
|
|
|
27941
28209
|
}
|
|
27942
28210
|
);
|
|
27943
28211
|
if (withHeader && isCollapsible) {
|
|
27944
|
-
return /* @__PURE__ */
|
|
28212
|
+
return /* @__PURE__ */ jsxs40(
|
|
27945
28213
|
collapsible_card_exports.Root,
|
|
27946
28214
|
{
|
|
27947
28215
|
className: "dataforms-layouts-card__field",
|
|
27948
28216
|
open: isOpen,
|
|
27949
28217
|
onOpenChange: handleOpenChange,
|
|
27950
28218
|
children: [
|
|
27951
|
-
/* @__PURE__ */
|
|
27952
|
-
/* @__PURE__ */
|
|
28219
|
+
/* @__PURE__ */ jsx126(collapsible_card_exports.Header, { children: headerContent }),
|
|
28220
|
+
/* @__PURE__ */ jsx126(
|
|
27953
28221
|
collapsible_card_exports.Content,
|
|
27954
28222
|
{
|
|
27955
28223
|
ref: contentRef,
|
|
@@ -27961,26 +28229,26 @@ function FormCardField({
|
|
|
27961
28229
|
}
|
|
27962
28230
|
);
|
|
27963
28231
|
}
|
|
27964
|
-
return /* @__PURE__ */
|
|
27965
|
-
withHeader && /* @__PURE__ */
|
|
27966
|
-
/* @__PURE__ */
|
|
28232
|
+
return /* @__PURE__ */ jsxs40(card_exports.Root, { className: "dataforms-layouts-card__field", children: [
|
|
28233
|
+
withHeader && /* @__PURE__ */ jsx126(card_exports.Header, { children: headerContent }),
|
|
28234
|
+
/* @__PURE__ */ jsx126(card_exports.Content, { ref: contentRef, onBlur: handleBlur, children: bodyContent })
|
|
27967
28235
|
] });
|
|
27968
28236
|
}
|
|
27969
28237
|
|
|
27970
28238
|
// src/components/dataform-layouts/row/index.tsx
|
|
27971
|
-
import { Fragment as
|
|
28239
|
+
import { Fragment as Fragment21, jsx as jsx127, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
27972
28240
|
function Header4({ title }) {
|
|
27973
|
-
return /* @__PURE__ */
|
|
28241
|
+
return /* @__PURE__ */ jsx127(
|
|
27974
28242
|
Stack,
|
|
27975
28243
|
{
|
|
27976
28244
|
direction: "column",
|
|
27977
28245
|
className: "dataforms-layouts-row__header",
|
|
27978
28246
|
gap: "lg",
|
|
27979
|
-
children: /* @__PURE__ */
|
|
28247
|
+
children: /* @__PURE__ */ jsx127(Stack, { direction: "row", align: "center", children: /* @__PURE__ */ jsx127(component_default16, { level: 2, size: 13, children: title }) })
|
|
27980
28248
|
}
|
|
27981
28249
|
);
|
|
27982
28250
|
}
|
|
27983
|
-
var EMPTY_WRAPPER = ({ children }) => /* @__PURE__ */
|
|
28251
|
+
var EMPTY_WRAPPER = ({ children }) => /* @__PURE__ */ jsx127(Fragment21, { children });
|
|
27984
28252
|
function FormRowField({
|
|
27985
28253
|
data,
|
|
27986
28254
|
field,
|
|
@@ -27995,9 +28263,9 @@ function FormRowField({
|
|
|
27995
28263
|
layout: DEFAULT_LAYOUT,
|
|
27996
28264
|
fields: field.children
|
|
27997
28265
|
};
|
|
27998
|
-
return /* @__PURE__ */
|
|
27999
|
-
!hideLabelFromVision && field.label && /* @__PURE__ */
|
|
28000
|
-
/* @__PURE__ */
|
|
28266
|
+
return /* @__PURE__ */ jsxs41("div", { className: "dataforms-layouts-row__field", children: [
|
|
28267
|
+
!hideLabelFromVision && field.label && /* @__PURE__ */ jsx127(Header4, { title: field.label }),
|
|
28268
|
+
/* @__PURE__ */ jsx127(Stack, { direction: "row", align: layout.alignment, gap: "lg", children: /* @__PURE__ */ jsx127(
|
|
28001
28269
|
DataFormLayout,
|
|
28002
28270
|
{
|
|
28003
28271
|
data,
|
|
@@ -28005,12 +28273,12 @@ function FormRowField({
|
|
|
28005
28273
|
onChange,
|
|
28006
28274
|
validity: validity?.children,
|
|
28007
28275
|
as: EMPTY_WRAPPER,
|
|
28008
|
-
children: (FieldLayout, childField, childFieldValidity) => /* @__PURE__ */
|
|
28276
|
+
children: (FieldLayout, childField, childFieldValidity) => /* @__PURE__ */ jsx127(
|
|
28009
28277
|
"div",
|
|
28010
28278
|
{
|
|
28011
28279
|
className: "dataforms-layouts-row__field-control",
|
|
28012
28280
|
style: layout.styles[childField.id],
|
|
28013
|
-
children: /* @__PURE__ */
|
|
28281
|
+
children: /* @__PURE__ */ jsx127(
|
|
28014
28282
|
FieldLayout,
|
|
28015
28283
|
{
|
|
28016
28284
|
data,
|
|
@@ -28032,7 +28300,7 @@ function FormRowField({
|
|
|
28032
28300
|
if (!RegularLayout) {
|
|
28033
28301
|
return null;
|
|
28034
28302
|
}
|
|
28035
|
-
return /* @__PURE__ */
|
|
28303
|
+
return /* @__PURE__ */ jsx127(Fragment21, { children: /* @__PURE__ */ jsx127("div", { className: "dataforms-layouts-row__field-control", children: /* @__PURE__ */ jsx127(
|
|
28036
28304
|
RegularLayout,
|
|
28037
28305
|
{
|
|
28038
28306
|
data,
|
|
@@ -28045,8 +28313,8 @@ function FormRowField({
|
|
|
28045
28313
|
}
|
|
28046
28314
|
|
|
28047
28315
|
// src/components/dataform-layouts/details/index.tsx
|
|
28048
|
-
import { __ as
|
|
28049
|
-
import { jsx as
|
|
28316
|
+
import { __ as __61 } from "@wordpress/i18n";
|
|
28317
|
+
import { jsx as jsx128, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
28050
28318
|
function FormDetailsField({
|
|
28051
28319
|
data,
|
|
28052
28320
|
field,
|
|
@@ -28093,17 +28361,17 @@ function FormDetailsField({
|
|
|
28093
28361
|
const summaryField = summaryFieldId ? fields.find((fieldDef) => fieldDef.id === summaryFieldId) : void 0;
|
|
28094
28362
|
let summaryContent;
|
|
28095
28363
|
if (summaryField && summaryField.render) {
|
|
28096
|
-
summaryContent = /* @__PURE__ */
|
|
28364
|
+
summaryContent = /* @__PURE__ */ jsx128(summaryField.render, { item: data, field: summaryField });
|
|
28097
28365
|
} else {
|
|
28098
|
-
summaryContent = field.label ||
|
|
28366
|
+
summaryContent = field.label || __61("More details");
|
|
28099
28367
|
}
|
|
28100
|
-
return /* @__PURE__ */
|
|
28368
|
+
return /* @__PURE__ */ jsxs42(
|
|
28101
28369
|
"details",
|
|
28102
28370
|
{
|
|
28103
28371
|
ref: detailsRef,
|
|
28104
28372
|
className: "dataforms-layouts-details__details",
|
|
28105
28373
|
children: [
|
|
28106
|
-
/* @__PURE__ */
|
|
28374
|
+
/* @__PURE__ */ jsx128("summary", { className: "dataforms-layouts-details__summary", children: /* @__PURE__ */ jsxs42(
|
|
28107
28375
|
Stack,
|
|
28108
28376
|
{
|
|
28109
28377
|
direction: "row",
|
|
@@ -28112,17 +28380,17 @@ function FormDetailsField({
|
|
|
28112
28380
|
className: "dataforms-layouts-details__summary-content",
|
|
28113
28381
|
children: [
|
|
28114
28382
|
summaryContent,
|
|
28115
|
-
touched && /* @__PURE__ */
|
|
28383
|
+
touched && /* @__PURE__ */ jsx128(ValidationBadge, { validity })
|
|
28116
28384
|
]
|
|
28117
28385
|
}
|
|
28118
28386
|
) }),
|
|
28119
|
-
/* @__PURE__ */
|
|
28387
|
+
/* @__PURE__ */ jsx128(
|
|
28120
28388
|
"div",
|
|
28121
28389
|
{
|
|
28122
28390
|
ref: contentRef,
|
|
28123
28391
|
className: "dataforms-layouts-details__content",
|
|
28124
28392
|
onBlur: handleBlur,
|
|
28125
|
-
children: /* @__PURE__ */
|
|
28393
|
+
children: /* @__PURE__ */ jsx128(
|
|
28126
28394
|
DataFormLayout,
|
|
28127
28395
|
{
|
|
28128
28396
|
data,
|
|
@@ -28139,12 +28407,12 @@ function FormDetailsField({
|
|
|
28139
28407
|
}
|
|
28140
28408
|
|
|
28141
28409
|
// src/components/dataform-layouts/index.tsx
|
|
28142
|
-
import { jsx as
|
|
28410
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
28143
28411
|
var FORM_FIELD_LAYOUTS = [
|
|
28144
28412
|
{
|
|
28145
28413
|
type: "regular",
|
|
28146
28414
|
component: FormRegularField,
|
|
28147
|
-
wrapper: ({ children }) => /* @__PURE__ */
|
|
28415
|
+
wrapper: ({ children }) => /* @__PURE__ */ jsx129(
|
|
28148
28416
|
Stack,
|
|
28149
28417
|
{
|
|
28150
28418
|
direction: "column",
|
|
@@ -28157,7 +28425,7 @@ var FORM_FIELD_LAYOUTS = [
|
|
|
28157
28425
|
{
|
|
28158
28426
|
type: "panel",
|
|
28159
28427
|
component: FormPanelField,
|
|
28160
|
-
wrapper: ({ children }) => /* @__PURE__ */
|
|
28428
|
+
wrapper: ({ children }) => /* @__PURE__ */ jsx129(
|
|
28161
28429
|
Stack,
|
|
28162
28430
|
{
|
|
28163
28431
|
direction: "column",
|
|
@@ -28170,7 +28438,7 @@ var FORM_FIELD_LAYOUTS = [
|
|
|
28170
28438
|
{
|
|
28171
28439
|
type: "card",
|
|
28172
28440
|
component: FormCardField,
|
|
28173
|
-
wrapper: ({ children }) => /* @__PURE__ */
|
|
28441
|
+
wrapper: ({ children }) => /* @__PURE__ */ jsx129(
|
|
28174
28442
|
Stack,
|
|
28175
28443
|
{
|
|
28176
28444
|
direction: "column",
|
|
@@ -28186,13 +28454,13 @@ var FORM_FIELD_LAYOUTS = [
|
|
|
28186
28454
|
wrapper: ({
|
|
28187
28455
|
children,
|
|
28188
28456
|
layout
|
|
28189
|
-
}) => /* @__PURE__ */
|
|
28457
|
+
}) => /* @__PURE__ */ jsx129(
|
|
28190
28458
|
Stack,
|
|
28191
28459
|
{
|
|
28192
28460
|
direction: "column",
|
|
28193
28461
|
className: "dataforms-layouts__wrapper",
|
|
28194
28462
|
gap: "lg",
|
|
28195
|
-
children: /* @__PURE__ */
|
|
28463
|
+
children: /* @__PURE__ */ jsx129("div", { className: "dataforms-layouts-row__field", children: /* @__PURE__ */ jsx129(
|
|
28196
28464
|
Stack,
|
|
28197
28465
|
{
|
|
28198
28466
|
direction: "row",
|
|
@@ -28214,8 +28482,8 @@ function getFormFieldLayout(type) {
|
|
|
28214
28482
|
}
|
|
28215
28483
|
|
|
28216
28484
|
// src/components/dataform-layouts/data-form-layout.tsx
|
|
28217
|
-
import { jsx as
|
|
28218
|
-
var DEFAULT_WRAPPER = ({ children }) => /* @__PURE__ */
|
|
28485
|
+
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
28486
|
+
var DEFAULT_WRAPPER = ({ children }) => /* @__PURE__ */ jsx130(Stack, { direction: "column", className: "dataforms-layouts__wrapper", gap: "lg", children });
|
|
28219
28487
|
function DataFormLayout({
|
|
28220
28488
|
data,
|
|
28221
28489
|
form,
|
|
@@ -28238,7 +28506,7 @@ function DataFormLayout({
|
|
|
28238
28506
|
);
|
|
28239
28507
|
}
|
|
28240
28508
|
const Wrapper4 = as ?? getFormFieldLayout(form.layout.type)?.wrapper ?? DEFAULT_WRAPPER;
|
|
28241
|
-
return /* @__PURE__ */
|
|
28509
|
+
return /* @__PURE__ */ jsx130(Wrapper4, { layout: form.layout, children: form.fields.map((formField) => {
|
|
28242
28510
|
const FieldLayout = getFormFieldLayout(formField.layout.type)?.component;
|
|
28243
28511
|
if (!FieldLayout) {
|
|
28244
28512
|
return null;
|
|
@@ -28255,7 +28523,7 @@ function DataFormLayout({
|
|
|
28255
28523
|
markWhenOptional
|
|
28256
28524
|
);
|
|
28257
28525
|
}
|
|
28258
|
-
return /* @__PURE__ */
|
|
28526
|
+
return /* @__PURE__ */ jsx130(
|
|
28259
28527
|
FieldLayout,
|
|
28260
28528
|
{
|
|
28261
28529
|
data,
|
|
@@ -28270,7 +28538,7 @@ function DataFormLayout({
|
|
|
28270
28538
|
}
|
|
28271
28539
|
|
|
28272
28540
|
// src/dataform/index.tsx
|
|
28273
|
-
import { jsx as
|
|
28541
|
+
import { jsx as jsx131 } from "react/jsx-runtime";
|
|
28274
28542
|
function DataForm({
|
|
28275
28543
|
data,
|
|
28276
28544
|
form,
|
|
@@ -28286,7 +28554,7 @@ function DataForm({
|
|
|
28286
28554
|
if (!form.fields) {
|
|
28287
28555
|
return null;
|
|
28288
28556
|
}
|
|
28289
|
-
return /* @__PURE__ */
|
|
28557
|
+
return /* @__PURE__ */ jsx131(DataFormProvider, { fields: normalizedFields, children: /* @__PURE__ */ jsx131(
|
|
28290
28558
|
DataFormLayout,
|
|
28291
28559
|
{
|
|
28292
28560
|
data,
|