@chobantonov/jsonforms-react-extended-renderers 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +17 -2
- package/lib/AgGridControlRenderer.impl-BO-Z1x0Y.js +2 -0
- package/lib/AgGridControlRenderer.impl-BO-Z1x0Y.js.map +1 -0
- package/lib/AgGridControlRenderer.impl-BZS8_ocu.mjs +429 -0
- package/lib/AgGridControlRenderer.impl-BZS8_ocu.mjs.map +1 -0
- package/lib/DynamicJSXRenderer-Cyw40Kz0.js +2 -0
- package/lib/DynamicJSXRenderer-Cyw40Kz0.js.map +1 -0
- package/lib/DynamicJSXRenderer-DyB3ZpZV.mjs +109 -0
- package/lib/DynamicJSXRenderer-DyB3ZpZV.mjs.map +1 -0
- package/lib/MarkupLabelRenderer.impl-CWfdcUuH.mjs +12 -0
- package/lib/MarkupLabelRenderer.impl-CWfdcUuH.mjs.map +1 -0
- package/lib/MarkupLabelRenderer.impl-DnuzIPQg.js +2 -0
- package/lib/MarkupLabelRenderer.impl-DnuzIPQg.js.map +1 -0
- package/lib/MonacoControlRenderer.impl-BwgLGNMK.js +3 -0
- package/lib/MonacoControlRenderer.impl-BwgLGNMK.js.map +1 -0
- package/lib/MonacoControlRenderer.impl-CyjMHbOd.mjs +186 -0
- package/lib/MonacoControlRenderer.impl-CyjMHbOd.mjs.map +1 -0
- package/lib/RactiveTemplate-7L44A38e.js +2 -0
- package/lib/RactiveTemplate-7L44A38e.js.map +1 -0
- package/lib/RactiveTemplate-Cat7CxUp.mjs +74 -0
- package/lib/RactiveTemplate-Cat7CxUp.mjs.map +1 -0
- package/lib/ajv-localizers.cjs.js +2 -0
- package/lib/ajv-localizers.cjs.js.map +1 -0
- package/lib/ajv-localizers.esm.js +7 -0
- package/lib/ajv-localizers.esm.js.map +1 -0
- package/lib/ajvI18n-2UTyJv5g.js +2 -0
- package/lib/ajvI18n-2UTyJv5g.js.map +1 -0
- package/lib/ajvI18n-DO8FFvx1.mjs +227 -0
- package/lib/ajvI18n-DO8FFvx1.mjs.map +1 -0
- package/lib/celTemplate-Cl0alaCz.js +3 -0
- package/lib/celTemplate-Cl0alaCz.js.map +1 -0
- package/lib/celTemplate-D_AGhaIL.mjs +137 -0
- package/lib/celTemplate-D_AGhaIL.mjs.map +1 -0
- package/lib/components/DynamicJSXRenderer.d.ts +7 -0
- package/lib/components/ExtendedJsonForms.d.ts +80 -0
- package/lib/components/GenericAdditionalProperties.d.ts +4 -0
- package/lib/components/InterpolatedText.d.ts +34 -0
- package/lib/components/RactiveTemplate.d.ts +37 -0
- package/lib/components/editorRendererTypes.d.ts +139 -0
- package/lib/components/elementRender.d.ts +15 -0
- package/lib/configNamespaces-BFclHtB8.mjs +1 -0
- package/lib/configNamespaces-sboXDudL.js +1 -0
- package/lib/core/ajv.d.ts +82 -0
- package/lib/core/ajvI18n/bg.d.ts +2 -0
- package/lib/core/ajvI18n/index.d.ts +118 -0
- package/lib/core/ajvI18n/localizers.d.ts +20 -0
- package/lib/core/dynamicDefaults.d.ts +34 -0
- package/lib/core/keywords.d.ts +24 -0
- package/lib/core/transform.d.ts +29 -0
- package/lib/core/uiSchema.d.ts +48 -0
- package/lib/elementRender-Dbp2e-Cc.js +2 -0
- package/lib/elementRender-Dbp2e-Cc.js.map +1 -0
- package/lib/elementRender-y8MK9CCE.mjs +5 -0
- package/lib/elementRender-y8MK9CCE.mjs.map +1 -0
- package/lib/index.d.ts +41 -0
- package/lib/jsonforms-react-extended.cjs.js +16 -0
- package/lib/jsonforms-react-extended.cjs.js.map +1 -0
- package/lib/jsonforms-react-extended.esm.js +2335 -0
- package/lib/jsonforms-react-extended.esm.js.map +1 -0
- package/lib/locale/bg.d.ts +14 -0
- package/lib/markdown-C_y73Q0w.mjs +123 -0
- package/lib/markdown-C_y73Q0w.mjs.map +1 -0
- package/lib/markdown-CuqtpGVd.js +2 -0
- package/lib/markdown-CuqtpGVd.js.map +1 -0
- package/lib/objectWithoutProperties-6zedhz76.js +2 -0
- package/lib/objectWithoutProperties-6zedhz76.js.map +1 -0
- package/lib/objectWithoutProperties-yjQMyZ0y.mjs +58 -0
- package/lib/objectWithoutProperties-yjQMyZ0y.mjs.map +1 -0
- package/lib/renderers/AgGridControlRenderer.d.ts +10 -0
- package/lib/renderers/AgGridControlRenderer.impl.d.ts +4 -0
- package/lib/renderers/ButtonRenderer.d.ts +83 -0
- package/lib/renderers/GenericMixedRenderer.d.ts +9 -0
- package/lib/renderers/HorizontalLayoutRenderer.d.ts +5 -0
- package/lib/renderers/ImageViewRenderer.d.ts +48 -0
- package/lib/renderers/LinkRenderer.d.ts +23 -0
- package/lib/renderers/MarkupLabelRenderer.d.ts +35 -0
- package/lib/renderers/MarkupLabelRenderer.impl.d.ts +17 -0
- package/lib/renderers/MonacoControlRenderer.d.ts +8 -0
- package/lib/renderers/MonacoControlRenderer.impl.d.ts +4 -0
- package/lib/renderers/RactiveTemplateLayoutRenderer.d.ts +6 -0
- package/lib/renderers/SeparatorRenderer.d.ts +17 -0
- package/lib/renderers/SlotRenderer.d.ts +5 -0
- package/lib/renderers/SpacerRenderer.d.ts +5 -0
- package/lib/renderers/SplitLayoutRenderer.d.ts +18 -0
- package/lib/renderers/TemplateLayoutRenderer.d.ts +13 -0
- package/lib/renderers/TemplateRenderer.d.ts +17 -0
- package/lib/renderers/TsxTemplateLayoutRenderer.d.ts +111 -0
- package/lib/renderers/index.d.ts +13 -0
- package/lib/renderers/templateEngines.d.ts +43 -0
- package/lib/util/actionContext.d.ts +23 -0
- package/lib/util/additionalErrors.d.ts +77 -0
- package/lib/util/celEnvironment.d.ts +23 -0
- package/lib/util/celTemplate.d.ts +47 -0
- package/lib/util/childNames.d.ts +46 -0
- package/lib/util/configNamespaces.d.ts +1 -0
- package/lib/util/cron.d.ts +122 -0
- package/lib/util/editorControls.d.ts +8 -0
- package/lib/util/editorDiagnostics.d.ts +56 -0
- package/lib/util/extendedControls.d.ts +4 -0
- package/lib/util/extendedLocale.d.ts +32 -0
- package/lib/util/fileFilterValue.d.ts +3 -0
- package/lib/util/formContext.d.ts +54 -0
- package/lib/util/gridColumns.d.ts +6 -0
- package/lib/util/horizontalLayout.d.ts +10 -0
- package/lib/util/i18nDefaults.d.ts +45 -0
- package/lib/util/interpolate.d.ts +105 -0
- package/lib/util/labelFilterValue.d.ts +2 -0
- package/lib/util/lazyControl.d.ts +36 -0
- package/lib/util/lazyTemplate.d.ts +18 -0
- package/lib/util/markdown.d.ts +55 -0
- package/lib/util/markdownEscape.d.ts +27 -0
- package/lib/util/markup.d.ts +74 -0
- package/lib/util/maskControls.d.ts +2 -0
- package/lib/util/templateLang.d.ts +87 -0
- package/lib/util/templateUrls.d.ts +40 -0
- package/lib/util/urlPolicy.d.ts +42 -0
- package/lib/util/useCronPicker.d.ts +24 -0
- package/lib/util/useDurationControl.d.ts +99 -0
- package/lib/util/useEditorAppearance.d.ts +21 -0
- package/lib/util/useExtendedTranslator.d.ts +10 -0
- package/lib/util/useMonacoShadowStyles.d.ts +2 -0
- package/package.json +110 -3
- package/src/components/DynamicJSXRenderer.tsx +274 -0
- package/src/components/ExtendedJsonForms.tsx +329 -0
- package/src/components/GenericAdditionalProperties.tsx +362 -0
- package/src/components/InterpolatedText.tsx +114 -0
- package/src/components/RactiveTemplate.tsx +161 -0
- package/src/components/editorRendererTypes.ts +135 -0
- package/src/components/elementRender.ts +15 -0
- package/src/core/ajv.ts +177 -0
- package/src/core/ajvI18n/bg.ts +203 -0
- package/src/core/ajvI18n/index.ts +267 -0
- package/src/core/ajvI18n/localizers.ts +25 -0
- package/src/core/dynamicDefaults.ts +170 -0
- package/src/core/keywords.ts +71 -0
- package/src/core/transform.ts +137 -0
- package/src/core/uiSchema.ts +53 -0
- package/src/index.tsx +196 -0
- package/src/locale/bg.ts +51 -0
- package/src/renderers/AgGridControlRenderer.impl.tsx +788 -0
- package/src/renderers/AgGridControlRenderer.tsx +24 -0
- package/src/renderers/ButtonRenderer.tsx +328 -0
- package/src/renderers/GenericMixedRenderer.tsx +224 -0
- package/src/renderers/HorizontalLayoutRenderer.tsx +93 -0
- package/src/renderers/ImageViewRenderer.tsx +328 -0
- package/src/renderers/LinkRenderer.tsx +92 -0
- package/src/renderers/MarkupLabelRenderer.impl.tsx +26 -0
- package/src/renderers/MarkupLabelRenderer.tsx +327 -0
- package/src/renderers/MonacoControlRenderer.impl.tsx +351 -0
- package/src/renderers/MonacoControlRenderer.tsx +24 -0
- package/src/renderers/RactiveTemplateLayoutRenderer.tsx +172 -0
- package/src/renderers/SeparatorRenderer.tsx +55 -0
- package/src/renderers/SlotRenderer.tsx +34 -0
- package/src/renderers/SpacerRenderer.tsx +69 -0
- package/src/renderers/SplitLayoutRenderer.tsx +220 -0
- package/src/renderers/TemplateLayoutRenderer.tsx +394 -0
- package/src/renderers/TemplateRenderer.tsx +71 -0
- package/src/renderers/TsxTemplateLayoutRenderer.tsx +258 -0
- package/src/renderers/index.ts +14 -0
- package/src/renderers/templateEngines.tsx +100 -0
- package/src/util/actionContext.ts +29 -0
- package/src/util/additionalErrors.tsx +391 -0
- package/src/util/celEnvironment.ts +300 -0
- package/src/util/celTemplate.ts +267 -0
- package/src/util/childNames.ts +135 -0
- package/src/util/configNamespaces.ts +6 -0
- package/src/util/cron.ts +433 -0
- package/src/util/editorControls.ts +58 -0
- package/src/util/editorDiagnostics.ts +103 -0
- package/src/util/extendedControls.ts +34 -0
- package/src/util/extendedLocale.ts +67 -0
- package/src/util/fileFilterValue.ts +28 -0
- package/src/util/formContext.ts +74 -0
- package/src/util/gridColumns.ts +80 -0
- package/src/util/horizontalLayout.ts +59 -0
- package/src/util/i18nDefaults.ts +80 -0
- package/src/util/interpolate.ts +218 -0
- package/src/util/labelFilterValue.ts +49 -0
- package/src/util/lazyControl.tsx +66 -0
- package/src/util/lazyTemplate.tsx +110 -0
- package/src/util/markdown.tsx +345 -0
- package/src/util/markdownEscape.ts +29 -0
- package/src/util/markup.ts +144 -0
- package/src/util/maskControls.ts +6 -0
- package/src/util/templateLang.ts +145 -0
- package/src/util/templateUrls.ts +274 -0
- package/src/util/urlPolicy.ts +115 -0
- package/src/util/useCronPicker.ts +102 -0
- package/src/util/useDurationControl.ts +272 -0
- package/src/util/useEditorAppearance.ts +86 -0
- package/src/util/useExtendedTranslator.ts +25 -0
- package/src/util/useMonacoShadowStyles.ts +47 -0
|
@@ -0,0 +1,2335 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./ajvI18n-DO8FFvx1.mjs";
|
|
2
|
+
import { i as c, n as l, r as u, t as d } from "./configNamespaces-BFclHtB8.mjs";
|
|
3
|
+
import { t as f } from "./elementRender-y8MK9CCE.mjs";
|
|
4
|
+
import { a as p, i as m, n as h, o as g, r as _, s as v, t as y } from "./objectWithoutProperties-yjQMyZ0y.mjs";
|
|
5
|
+
import { useI18n as b, useTranslator as x } from "@chobantonov/jsonforms-react-renderer-common/locale/translate";
|
|
6
|
+
import { useEffectiveElements as S } from "@chobantonov/jsonforms-react-renderer-common/layout/layoutContext";
|
|
7
|
+
import { Actions as C, Generate as w, Resolve as T, and as E, composePaths as D, createAjv as O, createDefaultValue as k, deriveLabelForUISchemaElement as A, findUISchema as ee, formatIs as te, getAjv as ne, getConfig as re, isControl as ie, isStringControl as ae, isVisible as oe, optionIs as j, or as se, rankWith as M, resolveSchema as ce, schemaTypeIs as le, toDataPath as ue, uiTypeIs as N } from "@jsonforms/core";
|
|
8
|
+
import { JsonFormsDispatch as P, JsonFormsStateProvider as de, useJsonForms as F, withJsonFormsControlProps as fe, withJsonFormsLabelProps as pe, withJsonFormsLayoutProps as I, withTranslateProps as me } from "@jsonforms/react";
|
|
9
|
+
import L, { Suspense as he, createContext as ge, lazy as _e, useCallback as ve, useContext as ye, useEffect as R, useLayoutEffect as be, useMemo as z, useRef as xe, useState as B } from "react";
|
|
10
|
+
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
11
|
+
import { DynamicUiProvider as Se, dynamicAuthoredElement as Ce, useDynamicElements as we, useDynamicExternal as Te, withDynamicCells as Ee, withDynamicRenderers as De } from "@chobantonov/jsonforms-react-renderer-common/dynamic/DynamicUiProvider";
|
|
12
|
+
import { proxy as Oe } from "valtio";
|
|
13
|
+
import { findMixedDetailUiSchema as ke } from "@chobantonov/jsonforms-react-renderer-common/core/detailUiSchema";
|
|
14
|
+
import { ANY_TYPES as Ae, getJsonDataType as je, getSchemaTypes as Me, mixedControlFor as Ne, removeInapplicableKeywords as Pe, resolveMixedArrayItems as Fe } from "@chobantonov/jsonforms-react-renderer-common/mixed/mixedSchema";
|
|
15
|
+
import { useAdditionalPropertyItems as Ie } from "@chobantonov/jsonforms-react-renderer-common/objects/useAdditionalPropertyEntries";
|
|
16
|
+
import { renamePropertyKey as Le, toAdditionalPropertyItem as Re, toObjectSchema as ze } from "@chobantonov/jsonforms-react-renderer-common/objects/additionalProperties";
|
|
17
|
+
import Be from "ajv-errors";
|
|
18
|
+
import Ve from "ajv-keywords";
|
|
19
|
+
import He from "ajv-keywords/dist/definitions/dynamicDefaults";
|
|
20
|
+
import { _ as Ue, getProperty as We, stringify as Ge } from "ajv/dist/compile/codegen";
|
|
21
|
+
import Ke from "lodash/capitalize";
|
|
22
|
+
import qe from "lodash/startCase";
|
|
23
|
+
import W from "dayjs";
|
|
24
|
+
import Je from "dayjs/plugin/customParseFormat";
|
|
25
|
+
import Ye from "dayjs/plugin/duration";
|
|
26
|
+
import Xe from "dayjs/plugin/timezone";
|
|
27
|
+
import Ze from "dayjs/plugin/utc";
|
|
28
|
+
import Qe from "lodash/get";
|
|
29
|
+
import $e from "lodash/isEqual";
|
|
30
|
+
import { extendedMaskTester as et, hasMaskPattern as tt, isMaskPattern as nt } from "@chobantonov/jsonforms-react-renderer-common/formats/maskControls";
|
|
31
|
+
import { formatDurationComponents as rt } from "@chobantonov/jsonforms-react-renderer-common/formats/duration";
|
|
32
|
+
import { TRUST_DYNAMIC_FUNCTIONS as it } from "@chobantonov/jsonforms-react-renderer-common/dynamic/dynamicConfig";
|
|
33
|
+
// src/renderers/SplitLayoutRenderer.tsx
|
|
34
|
+
var at = M(4, E(se(N("HorizontalLayout"), N("VerticalLayout")), (e) => {
|
|
35
|
+
var t, n;
|
|
36
|
+
return String((t = (n = e.options) == null ? void 0 : n.variant) == null ? "" : t).toLowerCase() === "splitter";
|
|
37
|
+
})), ot = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 ? `${e}px` : typeof e == "string" && e.trim() ? e.trim() : void 0, st = (e) => {
|
|
38
|
+
let t = e.map((e) => {
|
|
39
|
+
var t;
|
|
40
|
+
let n = e == null || (t = e.options) == null || (t = t.layout) == null ? void 0 : t.weight;
|
|
41
|
+
return typeof n == "number" && Number.isFinite(n) && n > 0 ? n : 1;
|
|
42
|
+
}), n = t.reduce((e, t) => e + t, 0);
|
|
43
|
+
return t.map((e) => e / n * 100);
|
|
44
|
+
}, ct = (e) => {
|
|
45
|
+
var t, n;
|
|
46
|
+
let r = b(), i = e.uischema, a = i.type === "HorizontalLayout", s = S(i.elements, e.path, e.config), c = s.length, [l, u] = L.useState([]), d = l.length === c ? l : st(s), f = o(o({}, e.config), i.options).resizable !== !1, p = ((t = i.options) == null ? void 0 : t.wrap) === !0, m = L.useRef(), h = o(o({}, e.config), i.options), g = (e, t, n = d) => {
|
|
47
|
+
let r = Math.max(1 - n[e], Math.min(n[e + 1] - 1, t));
|
|
48
|
+
u(n.map((t, n) => n === e ? t + r : n === e + 1 ? t - r : t));
|
|
49
|
+
};
|
|
50
|
+
return e.visible ? /* @__PURE__ */ H("div", o(o({}, p ? { "data-layout-diagnostic": "`wrap` is not supported together with the splitter variant; ignored." } : {}), {}, {
|
|
51
|
+
style: {
|
|
52
|
+
display: "flex",
|
|
53
|
+
flexDirection: a ? "row" : "column",
|
|
54
|
+
width: "100%",
|
|
55
|
+
minWidth: 0,
|
|
56
|
+
height: a ? void 0 : (n = ot(h.height)) == null ? "20rem" : n,
|
|
57
|
+
minHeight: a ? void 0 : ot(h.minHeight)
|
|
58
|
+
},
|
|
59
|
+
children: s.map((t, n) => /* @__PURE__ */ U(L.Fragment, { children: [/* @__PURE__ */ H("div", {
|
|
60
|
+
style: {
|
|
61
|
+
boxSizing: "border-box",
|
|
62
|
+
flex: `${d[n]} 1 0`,
|
|
63
|
+
minWidth: 0,
|
|
64
|
+
minHeight: 0,
|
|
65
|
+
overflow: "auto",
|
|
66
|
+
padding: 8
|
|
67
|
+
},
|
|
68
|
+
children: /* @__PURE__ */ H(P, {
|
|
69
|
+
schema: e.schema,
|
|
70
|
+
uischema: t,
|
|
71
|
+
path: e.path,
|
|
72
|
+
enabled: e.enabled,
|
|
73
|
+
renderers: e.renderers,
|
|
74
|
+
cells: e.cells
|
|
75
|
+
})
|
|
76
|
+
}), n < c - 1 && /* @__PURE__ */ H("div", o(o({ role: "separator" }, f ? { tabIndex: 0 } : { "aria-disabled": !0 }), {}, {
|
|
77
|
+
"aria-label": r("layout.resizePane", { index: n + 1 }),
|
|
78
|
+
"aria-orientation": a ? "vertical" : "horizontal",
|
|
79
|
+
"aria-valuemin": 1,
|
|
80
|
+
"aria-valuemax": d[n] + d[n + 1] - 1,
|
|
81
|
+
"aria-valuenow": Math.round(d[n]),
|
|
82
|
+
style: {
|
|
83
|
+
flex: "0 0 6px",
|
|
84
|
+
background: "rgba(128,128,128,0.3)",
|
|
85
|
+
cursor: f ? a ? "col-resize" : "row-resize" : "default",
|
|
86
|
+
touchAction: "none"
|
|
87
|
+
},
|
|
88
|
+
onKeyDown: (e) => {
|
|
89
|
+
if (!f) return;
|
|
90
|
+
let t = e.key === (a ? "ArrowRight" : "ArrowDown") ? 2 : e.key === (a ? "ArrowLeft" : "ArrowUp") ? -2 : 0;
|
|
91
|
+
t && (e.preventDefault(), g(n, t));
|
|
92
|
+
},
|
|
93
|
+
onPointerDown: (e) => {
|
|
94
|
+
if (!f) return;
|
|
95
|
+
let t = e.currentTarget.parentElement.getBoundingClientRect(), r = a ? t.width : t.height;
|
|
96
|
+
r && (e.preventDefault(), m.current = {
|
|
97
|
+
index: n,
|
|
98
|
+
start: a ? e.clientX : e.clientY,
|
|
99
|
+
total: r,
|
|
100
|
+
sizes: d
|
|
101
|
+
}, e.currentTarget.setPointerCapture(e.pointerId));
|
|
102
|
+
},
|
|
103
|
+
onPointerMove: (e) => {
|
|
104
|
+
let t = m.current;
|
|
105
|
+
t && g(t.index, ((a ? e.clientX : e.clientY) - t.start) / t.total * 100, t.sizes);
|
|
106
|
+
},
|
|
107
|
+
onPointerUp: () => {
|
|
108
|
+
m.current = void 0;
|
|
109
|
+
},
|
|
110
|
+
onPointerCancel: () => {
|
|
111
|
+
m.current = void 0;
|
|
112
|
+
},
|
|
113
|
+
onLostPointerCapture: () => {
|
|
114
|
+
m.current = void 0;
|
|
115
|
+
}
|
|
116
|
+
}))] }, n))
|
|
117
|
+
})) : null;
|
|
118
|
+
}, lt = I(ct), ut = (e) => {
|
|
119
|
+
let t = e == null ? [] : e, n = Array.from({ length: t.length }, () => void 0), r = {}, i = [];
|
|
120
|
+
return t.forEach((e, t) => {
|
|
121
|
+
let a = e ? Ce(e).name : void 0;
|
|
122
|
+
typeof a == "string" && a !== "" && (r[a] === void 0 ? (r[a] = t, n[t] = a) : i.push(`template.duplicateChildName: children ${r[a]} and ${t} are both named ${JSON.stringify(a)}; the first one keeps the name.`));
|
|
123
|
+
}), t.forEach((e, t) => {
|
|
124
|
+
if (n[t] !== void 0) return;
|
|
125
|
+
let a = String(t);
|
|
126
|
+
r[a] === void 0 ? (r[a] = t, n[t] = a) : i.push(`template.childNameCollision: child ${t} has no name and its index ${JSON.stringify(a)} is already the name of child ${r[a]}, so it cannot be placed. Give it a name.`);
|
|
127
|
+
}), {
|
|
128
|
+
names: n,
|
|
129
|
+
byName: r,
|
|
130
|
+
diagnostics: i
|
|
131
|
+
};
|
|
132
|
+
}, dt = /\s([a-zA-Z](?:(?!-in-out)[-a-zA-Z_0-9])*-(?:in|out|in-out))(?=[\s/>=])/g, ft = (e) => {
|
|
133
|
+
let t = /* @__PURE__ */ new Set(), n;
|
|
134
|
+
for (dt.lastIndex = 0; (n = dt.exec(e)) !== null;) t.add(n[1]);
|
|
135
|
+
return [...t];
|
|
136
|
+
};
|
|
137
|
+
function pt(e) {
|
|
138
|
+
let t = z(() => e == null ? [] : e, [e]), n = z(() => ut(t), [t]);
|
|
139
|
+
return o({ children: t }, n);
|
|
140
|
+
}
|
|
141
|
+
// src/util/formContext.ts
|
|
142
|
+
var mt = ({ ctx: e, schema: t, uischema: n, fireActionEvent: r, external: i }) => {
|
|
143
|
+
var a, o, s, c, l, u, d, f;
|
|
144
|
+
return {
|
|
145
|
+
external: i,
|
|
146
|
+
config: e.config,
|
|
147
|
+
readonly: e.readonly === !0,
|
|
148
|
+
locale: (a = e.i18n) == null ? void 0 : a.locale,
|
|
149
|
+
translate: (o = e.i18n) == null ? void 0 : o.translate,
|
|
150
|
+
data: (s = e.core) == null ? void 0 : s.data,
|
|
151
|
+
schema: t == null ? (c = e.core) == null ? void 0 : c.schema : t,
|
|
152
|
+
uischema: n,
|
|
153
|
+
errors: (l = (u = e.core) == null ? void 0 : u.errors) == null ? [] : l,
|
|
154
|
+
additionalErrors: (d = (f = e.core) == null ? void 0 : f.additionalErrors) == null ? [] : d,
|
|
155
|
+
fireActionEvent: r
|
|
156
|
+
};
|
|
157
|
+
}, ht = ["ractive", "jsx"], gt = "ractive", _t = (e) => typeof e == "string" && ht.includes(e.toLowerCase()) ? e.toLowerCase() : void 0, vt = (e) => {
|
|
158
|
+
var t;
|
|
159
|
+
let n = (t = u(e)) == null ? void 0 : t.security;
|
|
160
|
+
return !!n && typeof n == "object" && n.allowScriptEvaluation === !0;
|
|
161
|
+
}, yt = (e, t) => {
|
|
162
|
+
let n = e == null ? void 0 : e.lang;
|
|
163
|
+
if (n !== void 0) {
|
|
164
|
+
let e = _t(n);
|
|
165
|
+
return e ? { lang: e } : {
|
|
166
|
+
requested: String(n),
|
|
167
|
+
diagnostic: "unsupported"
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
let r = u(t), i = r == null ? void 0 : r.defaultTemplateLang;
|
|
171
|
+
if (i !== void 0) {
|
|
172
|
+
let e = _t(i);
|
|
173
|
+
return e ? { lang: e } : {
|
|
174
|
+
requested: String(i),
|
|
175
|
+
diagnostic: "unsupported"
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return { lang: gt };
|
|
179
|
+
}, bt = (e, t) => {
|
|
180
|
+
let n = yt(e, t);
|
|
181
|
+
return n.lang && !vt(t) ? o(o({}, n), {}, { diagnostic: "evaluation-disabled" }) : n;
|
|
182
|
+
}, xt = (e) => M(2, (t, n, r) => N("TemplateLayout")(t, n, r) ? yt(t, r == null ? void 0 : r.config).lang === e : !1), St = M(1, N("TemplateLayout")), Ct = {
|
|
183
|
+
border: "1px solid currentColor",
|
|
184
|
+
borderRadius: 4,
|
|
185
|
+
padding: "0.75rem 1rem",
|
|
186
|
+
opacity: .85,
|
|
187
|
+
fontSize: "0.9rem"
|
|
188
|
+
}, wt = ({ uischema: e, config: t, visible: n }) => {
|
|
189
|
+
let r = b(), i = bt(e, t);
|
|
190
|
+
if (n === !1 || !i.diagnostic) return null;
|
|
191
|
+
let a = i.diagnostic === "unsupported" ? r("template.unsupported", { language: JSON.stringify(i.requested) }) : r("template.disabled");
|
|
192
|
+
return /* @__PURE__ */ H("div", {
|
|
193
|
+
role: "alert",
|
|
194
|
+
"data-template-diagnostic": i.diagnostic,
|
|
195
|
+
style: Ct,
|
|
196
|
+
children: a
|
|
197
|
+
});
|
|
198
|
+
}, Tt = {
|
|
199
|
+
"array.addRow": "Add row",
|
|
200
|
+
"array.removeSelected": "Remove selected",
|
|
201
|
+
"grid.loading": "Loading data grid...",
|
|
202
|
+
"grid.loadError": "Unable to load the data grid.",
|
|
203
|
+
"editor.loading": "Loading editor...",
|
|
204
|
+
"editor.loadError": "Unable to load the editor.",
|
|
205
|
+
"editor.maximize": "Maximize editor",
|
|
206
|
+
"editor.restore": "Restore editor",
|
|
207
|
+
"editor.invalidJson": "Enter valid JSON.",
|
|
208
|
+
"editor.languageErrors": "Code contains {count} errors. Review the marked locations in the editor.",
|
|
209
|
+
"editor.languageError": "Code contains 1 error. Review the marked location in the editor.",
|
|
210
|
+
"editor.chooseColor": "Choose a color",
|
|
211
|
+
"editor.chooseDuration": "Choose a duration",
|
|
212
|
+
"color.placeholder.hex": "#RRGGBB",
|
|
213
|
+
"color.placeholder.hex3": "#RGB",
|
|
214
|
+
"color.placeholder.rgb": "rgb(r, g, b)",
|
|
215
|
+
"color.placeholder.hsb": "hsb(h, s%, b%)",
|
|
216
|
+
"color.hex3Transparency": "Three-digit hex cannot store transparency. Enter an opaque color, or clear the value.",
|
|
217
|
+
"additionalProperties.add": "Add",
|
|
218
|
+
"additionalProperties.addLabel": "Add property",
|
|
219
|
+
"additionalProperties.addTo": "Add property to {label}",
|
|
220
|
+
"additionalProperties.namePlaceholder": "Property name",
|
|
221
|
+
"additionalProperties.rename": "Rename",
|
|
222
|
+
"additionalProperties.renameNamed": "Rename {name}",
|
|
223
|
+
"additionalProperties.save": "Save",
|
|
224
|
+
"additionalProperties.cancel": "Cancel",
|
|
225
|
+
"additionalProperties.delete": "Delete",
|
|
226
|
+
"additionalProperties.nameTaken": "Property '{name}' already defined",
|
|
227
|
+
"additionalProperties.nameInvalid": "Property name '{name}' is invalid",
|
|
228
|
+
"additionalProperties.namePattern": "Property name must match pattern: {pattern}",
|
|
229
|
+
"template.loading": "Loading template engine…",
|
|
230
|
+
"template.loadError": "The template engine could not be loaded.",
|
|
231
|
+
"template.renderError": "The template could not be rendered.",
|
|
232
|
+
"editor.ariaLabel": "Code editor",
|
|
233
|
+
"duration.invalid": "Enter an ISO 8601 duration, for example P2DT3H or P2W.",
|
|
234
|
+
"markup.markdownDisabled": "Markdown is turned off for this form, so this text is shown as written.",
|
|
235
|
+
"markup.unsupported": "Unsupported markup {markup}. This renderer set implements \"plain\" and \"markdown\".",
|
|
236
|
+
"markup.interpolationFailed": "Could not resolve: {detail}"
|
|
237
|
+
}, Et = {
|
|
238
|
+
"array.addRow": "Добавяне на ред",
|
|
239
|
+
"array.removeSelected": "Премахване на избраните",
|
|
240
|
+
"grid.loading": "Таблицата се зарежда...",
|
|
241
|
+
"grid.loadError": "Таблицата не може да бъде заредена.",
|
|
242
|
+
"editor.loading": "Редакторът се зарежда...",
|
|
243
|
+
"editor.loadError": "Редакторът не може да бъде зареден.",
|
|
244
|
+
"editor.maximize": "Максимизиране на редактора",
|
|
245
|
+
"editor.restore": "Възстановяване на редактора",
|
|
246
|
+
"editor.invalidJson": "Въведете валиден JSON.",
|
|
247
|
+
"editor.chooseColor": "Изберете цвят",
|
|
248
|
+
"editor.chooseDuration": "Изберете продължителност",
|
|
249
|
+
"template.loading": "Шаблонният механизъм се зарежда…",
|
|
250
|
+
"template.loadError": "Шаблонният механизъм не може да бъде зареден.",
|
|
251
|
+
"template.renderError": "Шаблонът не може да бъде изобразен.",
|
|
252
|
+
"editor.ariaLabel": "Редактор на код",
|
|
253
|
+
"duration.invalid": "Въведете продължителност по ISO 8601, например P2DT3H или P2W.",
|
|
254
|
+
"additionalProperties.add": "Добавяне",
|
|
255
|
+
"additionalProperties.addLabel": "Добавяне на свойство",
|
|
256
|
+
"additionalProperties.addTo": "Добавяне на свойство към {label}",
|
|
257
|
+
"additionalProperties.namePlaceholder": "Име на свойството",
|
|
258
|
+
"additionalProperties.rename": "Преименуване",
|
|
259
|
+
"additionalProperties.renameNamed": "Преименуване на {name}",
|
|
260
|
+
"additionalProperties.save": "Запазване",
|
|
261
|
+
"additionalProperties.cancel": "Отказ",
|
|
262
|
+
"additionalProperties.delete": "Изтриване",
|
|
263
|
+
"additionalProperties.nameTaken": "Свойството „{name}“ вече е дефинирано",
|
|
264
|
+
"additionalProperties.nameInvalid": "Името „{name}“ не е допустимо",
|
|
265
|
+
"additionalProperties.namePattern": "Името на свойството трябва да съответства на шаблона: {pattern}",
|
|
266
|
+
"markup.markdownDisabled": "Markdown е изключен за тази форма, затова текстът се показва както е написан.",
|
|
267
|
+
"markup.unsupported": "Неподдържано маркиране {markup}. Този набор от рендери поддържа „plain“ и „markdown“.",
|
|
268
|
+
"markup.interpolationFailed": "Неуспешно изчисляване: {detail}"
|
|
269
|
+
}, Dt = {
|
|
270
|
+
en: {},
|
|
271
|
+
bg: Et
|
|
272
|
+
}, G = Dt, Ot = (e) => {
|
|
273
|
+
G = e;
|
|
274
|
+
}, kt = () => G, At = (e) => e.toLowerCase().replace(/_/g, "-"), jt = (e, t) => {
|
|
275
|
+
G = o(o({}, G), {}, { [At(e)]: t });
|
|
276
|
+
}, Mt = (e) => {
|
|
277
|
+
var t;
|
|
278
|
+
if (!e) return;
|
|
279
|
+
let n = At(e);
|
|
280
|
+
return (t = G[n]) == null ? G[n.split("-")[0]] : t;
|
|
281
|
+
}, Nt = (e, t) => {
|
|
282
|
+
var n, r;
|
|
283
|
+
return (n = (r = Mt(e)) == null ? void 0 : r[t]) == null ? Tt[t] : n;
|
|
284
|
+
}, K = () => {
|
|
285
|
+
var e, t;
|
|
286
|
+
let n = F(), r = (e = n.i18n) == null ? void 0 : e.translate, i = (t = n.i18n) == null ? void 0 : t.locale;
|
|
287
|
+
return (e, t) => {
|
|
288
|
+
let n = Nt(i, e), a = r ? r(e, n, t) : n;
|
|
289
|
+
return Object.entries(t == null ? {} : t).reduce((e, [t, n]) => e.replace(`{${t}}`, String(n)), a == null ? n : a);
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/asyncToGenerator.js
|
|
293
|
+
function Pt(e, t, n, r, i, a, o) {
|
|
294
|
+
try {
|
|
295
|
+
var s = e[a](o), c = s.value;
|
|
296
|
+
} catch (e) {
|
|
297
|
+
n(e);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
301
|
+
}
|
|
302
|
+
function q(e) {
|
|
303
|
+
return function() {
|
|
304
|
+
var t = this, n = arguments;
|
|
305
|
+
return new Promise(function(r, i) {
|
|
306
|
+
var a = e.apply(t, n);
|
|
307
|
+
function o(e) {
|
|
308
|
+
Pt(a, r, i, o, s, "next", e);
|
|
309
|
+
}
|
|
310
|
+
function s(e) {
|
|
311
|
+
Pt(a, r, i, o, s, "throw", e);
|
|
312
|
+
}
|
|
313
|
+
o(void 0);
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
// src/util/lazyTemplate.tsx
|
|
318
|
+
var Ft = class extends L.Component {
|
|
319
|
+
constructor(...e) {
|
|
320
|
+
super(...e), t(this, "state", { failed: !1 });
|
|
321
|
+
}
|
|
322
|
+
static getDerivedStateFromError() {
|
|
323
|
+
return { failed: !0 };
|
|
324
|
+
}
|
|
325
|
+
componentDidCatch(e) {
|
|
326
|
+
console.error("template.failed:", e);
|
|
327
|
+
}
|
|
328
|
+
render() {
|
|
329
|
+
return this.state.failed ? this.props.describe() : this.props.children;
|
|
330
|
+
}
|
|
331
|
+
}, It = (e, t) => {
|
|
332
|
+
let n = !1, r = _e(q(function* () {
|
|
333
|
+
let t = yield e();
|
|
334
|
+
return n = !0, { default: t };
|
|
335
|
+
})), i = (e) => {
|
|
336
|
+
let i = K();
|
|
337
|
+
return /* @__PURE__ */ H(Ft, {
|
|
338
|
+
describe: () => {
|
|
339
|
+
var e;
|
|
340
|
+
return /* @__PURE__ */ H("div", {
|
|
341
|
+
role: "alert",
|
|
342
|
+
"data-template-load-error": !n || void 0,
|
|
343
|
+
"data-template-render-error": n ? !0 : void 0,
|
|
344
|
+
children: i(n ? (e = t.renderError) == null ? "template.renderError" : e : t.error)
|
|
345
|
+
});
|
|
346
|
+
},
|
|
347
|
+
children: /* @__PURE__ */ H(he, {
|
|
348
|
+
fallback: /* @__PURE__ */ H("div", {
|
|
349
|
+
"aria-busy": "true",
|
|
350
|
+
"aria-live": "polite",
|
|
351
|
+
"data-template-loading": !0,
|
|
352
|
+
children: i(t.loading)
|
|
353
|
+
}),
|
|
354
|
+
children: /* @__PURE__ */ H(r, o({}, e))
|
|
355
|
+
})
|
|
356
|
+
});
|
|
357
|
+
};
|
|
358
|
+
return i.displayName = "LazyTemplate", i;
|
|
359
|
+
}, J = {
|
|
360
|
+
allowedSchemes: [
|
|
361
|
+
"https",
|
|
362
|
+
"http",
|
|
363
|
+
"mailto"
|
|
364
|
+
],
|
|
365
|
+
allowRelative: !0,
|
|
366
|
+
allowImageDataUrls: !1
|
|
367
|
+
}, Y = (e) => {
|
|
368
|
+
let t = e == null ? void 0 : e[l], n = t == null ? void 0 : t.security, r = n == null ? void 0 : n.urlPolicy;
|
|
369
|
+
return r ? {
|
|
370
|
+
allowedSchemes: Array.isArray(r.allowedSchemes) ? r.allowedSchemes.map((e) => String(e).toLowerCase()) : J.allowedSchemes,
|
|
371
|
+
allowRelative: r.allowRelative === void 0 ? J.allowRelative : r.allowRelative === !0,
|
|
372
|
+
allowImageDataUrls: r.allowImageDataUrls === void 0 ? J.allowImageDataUrls : r.allowImageDataUrls === !0
|
|
373
|
+
} : J;
|
|
374
|
+
}, Lt = /^([a-zA-Z][a-zA-Z0-9+.-]*):/, Rt = (e, t = J) => {
|
|
375
|
+
var n;
|
|
376
|
+
if (typeof e != "string") return !1;
|
|
377
|
+
let r = e.replace(/[\u0000- ]/g, "");
|
|
378
|
+
if (r === "") return !0;
|
|
379
|
+
if (r.startsWith("//")) return !1;
|
|
380
|
+
let i = (n = Lt.exec(r)) == null || (n = n[1]) == null ? void 0 : n.toLowerCase();
|
|
381
|
+
return i === void 0 ? t.allowRelative : t.allowedSchemes.includes(i);
|
|
382
|
+
}, zt = /^data:image\/[a-zA-Z0-9.+-]+[;,]/, Bt = (e, t = J) => t.allowImageDataUrls && typeof e == "string" && zt.test(e.replace(/[\u0000- ]/g, "")) ? !0 : Rt(e, t), Vt = It(q(function* () {
|
|
383
|
+
return (yield import("./DynamicJSXRenderer-DyB3ZpZV.mjs")).default;
|
|
384
|
+
}), {
|
|
385
|
+
loading: "template.loading",
|
|
386
|
+
error: "template.loadError",
|
|
387
|
+
renderError: "template.renderError"
|
|
388
|
+
}), Ht = M(1, N("TemplateLayout")), Ut = L.memo(function(e) {
|
|
389
|
+
return /* @__PURE__ */ H(P, o({}, e));
|
|
390
|
+
}), Wt = ({ path: e, enabled: t, schema: n, uischema: r, visible: i, renderers: a, cells: s, config: c, components: l = {} }) => {
|
|
391
|
+
var u, d, p, m;
|
|
392
|
+
let h = bt(r, c), g = r.template, _ = we((u = r.elements) == null ? [] : u, e == null ? "" : e), { names: v, diagnostics: y } = z(() => ut(r.elements), [r.elements]);
|
|
393
|
+
R(() => {
|
|
394
|
+
for (let e of y) console.warn(e);
|
|
395
|
+
}, [y]);
|
|
396
|
+
let b = z(() => _.map((r, i) => {
|
|
397
|
+
let c = v[i], l = c == null ? `\u0000unnamed:${i}` : c;
|
|
398
|
+
return o(o({}, r), {}, { [f]: function() {
|
|
399
|
+
return /* @__PURE__ */ H(Ut, {
|
|
400
|
+
path: e,
|
|
401
|
+
schema: n,
|
|
402
|
+
enabled: t,
|
|
403
|
+
renderers: a,
|
|
404
|
+
cells: s,
|
|
405
|
+
uischema: r
|
|
406
|
+
}, l);
|
|
407
|
+
} });
|
|
408
|
+
}), [
|
|
409
|
+
s,
|
|
410
|
+
t,
|
|
411
|
+
a,
|
|
412
|
+
n,
|
|
413
|
+
_,
|
|
414
|
+
v,
|
|
415
|
+
e
|
|
416
|
+
]), x = z(() => {
|
|
417
|
+
let e = {};
|
|
418
|
+
return b.forEach((t, n) => {
|
|
419
|
+
let r = v[n];
|
|
420
|
+
r !== void 0 && (e[r] = t);
|
|
421
|
+
}), e;
|
|
422
|
+
}, [b, v]), S = z(() => new Proxy(b, { get(e, t) {
|
|
423
|
+
return typeof t == "string" && x[t] ? x[t] : Reflect.get(e, t);
|
|
424
|
+
} }), [b, x]), C = F(), w = Te(), [{ dataProxy: T, errorsProxy: E, additionalErrorsProxy: D }] = L.useState(() => {
|
|
425
|
+
var e, t, n;
|
|
426
|
+
return {
|
|
427
|
+
dataProxy: Oe({ __val__: (e = C.core) == null ? void 0 : e.data }),
|
|
428
|
+
errorsProxy: Oe({ __val__: (t = C.core) == null ? void 0 : t.errors }),
|
|
429
|
+
additionalErrorsProxy: Oe({ __val__: (n = C.core) == null ? void 0 : n.additionalErrors })
|
|
430
|
+
};
|
|
431
|
+
});
|
|
432
|
+
R(() => {
|
|
433
|
+
var e, t, n;
|
|
434
|
+
let r = (e, t) => {
|
|
435
|
+
if (t == null || e.__val__ === null || e.__val__ === void 0) {
|
|
436
|
+
e.__val__ = t;
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
let n = (e, t) => {
|
|
440
|
+
if (t != null) {
|
|
441
|
+
if (Array.isArray(t)) {
|
|
442
|
+
if (!Array.isArray(e)) return t;
|
|
443
|
+
t.forEach((t, r) => {
|
|
444
|
+
if (t && typeof t == "object" && !Array.isArray(t)) {
|
|
445
|
+
(!e[r] || typeof e[r] != "object" || Array.isArray(e[r])) && (e[r] = {});
|
|
446
|
+
let i = n(e[r], t);
|
|
447
|
+
i !== void 0 && (e[r] = i);
|
|
448
|
+
} else if (Array.isArray(t)) {
|
|
449
|
+
Array.isArray(e[r]) || (e[r] = []);
|
|
450
|
+
let i = n(e[r], t);
|
|
451
|
+
i !== void 0 && (e[r] = i);
|
|
452
|
+
} else e[r] = t;
|
|
453
|
+
}), e.length > t.length && e.splice(t.length);
|
|
454
|
+
} else if (typeof t == "object" && !Array.isArray(t)) {
|
|
455
|
+
if (typeof e != "object" || Array.isArray(e)) return t;
|
|
456
|
+
Object.keys(t).forEach((r) => {
|
|
457
|
+
if (t[r] && typeof t[r] == "object" && !Array.isArray(t[r])) {
|
|
458
|
+
(!e[r] || typeof e[r] != "object" || Array.isArray(e[r])) && (e[r] = {});
|
|
459
|
+
let i = n(e[r], t[r]);
|
|
460
|
+
i !== void 0 && (e[r] = i);
|
|
461
|
+
} else e[r] = t[r];
|
|
462
|
+
});
|
|
463
|
+
} else return t;
|
|
464
|
+
}
|
|
465
|
+
}, r = n(e.__val__, t);
|
|
466
|
+
r !== void 0 && (e.__val__ = r);
|
|
467
|
+
};
|
|
468
|
+
r(T, (e = C.core) == null ? void 0 : e.data), r(E, (t = C.core) == null ? void 0 : t.errors), r(D, (n = C.core) == null ? void 0 : n.additionalErrors);
|
|
469
|
+
}, [
|
|
470
|
+
(d = C.core) == null ? void 0 : d.data,
|
|
471
|
+
(p = C.core) == null ? void 0 : p.errors,
|
|
472
|
+
(m = C.core) == null ? void 0 : m.additionalErrors,
|
|
473
|
+
T,
|
|
474
|
+
E,
|
|
475
|
+
D
|
|
476
|
+
]);
|
|
477
|
+
let O = z(() => {
|
|
478
|
+
var e, t;
|
|
479
|
+
return o({
|
|
480
|
+
elements: S,
|
|
481
|
+
schema: n,
|
|
482
|
+
uischema: r,
|
|
483
|
+
data: T,
|
|
484
|
+
errors: E,
|
|
485
|
+
additionalErrors: D,
|
|
486
|
+
translate: (e = C.i18n) == null ? void 0 : e.translate,
|
|
487
|
+
locale: (t = C.i18n) == null ? void 0 : t.locale,
|
|
488
|
+
context: mt({
|
|
489
|
+
ctx: C,
|
|
490
|
+
schema: n,
|
|
491
|
+
uischema: r,
|
|
492
|
+
external: w
|
|
493
|
+
})
|
|
494
|
+
}, l);
|
|
495
|
+
}, [
|
|
496
|
+
S,
|
|
497
|
+
n,
|
|
498
|
+
r,
|
|
499
|
+
T,
|
|
500
|
+
E,
|
|
501
|
+
D,
|
|
502
|
+
C,
|
|
503
|
+
l,
|
|
504
|
+
w
|
|
505
|
+
]);
|
|
506
|
+
if (!i) return null;
|
|
507
|
+
let k = `
|
|
508
|
+
function Template(props) {
|
|
509
|
+
${`const { ${Object.keys(O).filter((e) => ![
|
|
510
|
+
"data",
|
|
511
|
+
"errors",
|
|
512
|
+
"additionalErrors"
|
|
513
|
+
].includes(e)).join(", ")} } = props;`}
|
|
514
|
+
|
|
515
|
+
const data = useTrackedSnapshot(props.data);
|
|
516
|
+
const errors = useTrackedSnapshot(props.errors);
|
|
517
|
+
const additionalErrors = useTrackedSnapshot(props.additionalErrors);
|
|
518
|
+
|
|
519
|
+
return (
|
|
520
|
+
<React.Fragment>
|
|
521
|
+
${g.replace(/<\s*\/\s*React\.Fragment\s*>/g, "")}
|
|
522
|
+
</React.Fragment>
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
`;
|
|
526
|
+
return h.diagnostic ? /* @__PURE__ */ H(wt, {
|
|
527
|
+
uischema: r,
|
|
528
|
+
config: c,
|
|
529
|
+
visible: i
|
|
530
|
+
}) : /* @__PURE__ */ H(Vt, {
|
|
531
|
+
jsxTemplate: k,
|
|
532
|
+
props: O,
|
|
533
|
+
urlPolicy: Y(c)
|
|
534
|
+
});
|
|
535
|
+
}, Gt = It(q(function* () {
|
|
536
|
+
return (yield import("./RactiveTemplate-Cat7CxUp.mjs")).RactiveTemplate;
|
|
537
|
+
}), {
|
|
538
|
+
loading: "template.loading",
|
|
539
|
+
error: "template.loadError",
|
|
540
|
+
renderError: "template.renderError"
|
|
541
|
+
}), Kt = "data-jsonforms-slot", qt = (e) => {
|
|
542
|
+
var t;
|
|
543
|
+
let { uischema: n, schema: r, path: i, enabled: a, visible: o, renderers: s, cells: c, config: l } = e, u = F(), d = Te(), f = bt(n, l), { children: p, names: m, diagnostics: h } = pt(n.elements), g = JSON.stringify(m);
|
|
544
|
+
R(() => {
|
|
545
|
+
for (let e of h) console.warn(e);
|
|
546
|
+
}, [h]);
|
|
547
|
+
let _ = (t = n.template) == null ? "" : t;
|
|
548
|
+
R(() => {
|
|
549
|
+
let e = ft(_);
|
|
550
|
+
e.length > 0 && console.warn(`template.ractiveTransitionAttribute: ${JSON.stringify(e)} end in -in, -out or -in-out, which Ractive parses as transition directives. This profile registers no transitions, so they are dropped from the DOM. Rename them.`);
|
|
551
|
+
}, [_]);
|
|
552
|
+
let v = z(() => {
|
|
553
|
+
let e = {};
|
|
554
|
+
for (let t of JSON.parse(g)) t !== null && (e[t] = `<div ${Kt}="${t}"></div>`);
|
|
555
|
+
return e;
|
|
556
|
+
}, [g]), y = z(() => {
|
|
557
|
+
let e = {}, t = ut(p).names;
|
|
558
|
+
return p.forEach((n, o) => {
|
|
559
|
+
let l = t[o];
|
|
560
|
+
l !== void 0 && (e[l] = /* @__PURE__ */ H(P, {
|
|
561
|
+
uischema: n,
|
|
562
|
+
schema: r,
|
|
563
|
+
path: i,
|
|
564
|
+
enabled: a,
|
|
565
|
+
renderers: s,
|
|
566
|
+
cells: c
|
|
567
|
+
}));
|
|
568
|
+
}), e;
|
|
569
|
+
}, [
|
|
570
|
+
p,
|
|
571
|
+
r,
|
|
572
|
+
i,
|
|
573
|
+
a,
|
|
574
|
+
s,
|
|
575
|
+
c
|
|
576
|
+
]), b = z(() => {
|
|
577
|
+
var e, t, i;
|
|
578
|
+
return {
|
|
579
|
+
data: (e = u.core) == null ? void 0 : e.data,
|
|
580
|
+
errors: (t = u.core) == null ? void 0 : t.errors,
|
|
581
|
+
context: mt({
|
|
582
|
+
ctx: u,
|
|
583
|
+
schema: r,
|
|
584
|
+
uischema: n,
|
|
585
|
+
external: d
|
|
586
|
+
}),
|
|
587
|
+
elements: ut((i = n.elements) == null ? [] : i).names.filter((e) => e !== void 0).map((e) => ({ name: e })),
|
|
588
|
+
translate: (e, t) => {
|
|
589
|
+
var n, r, i, a;
|
|
590
|
+
return (n = (r = (i = u.i18n) == null || (a = i.translate) == null ? void 0 : a.call(i, e, t)) == null ? t : r) == null ? e : n;
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
}, [
|
|
594
|
+
u,
|
|
595
|
+
r,
|
|
596
|
+
n,
|
|
597
|
+
d
|
|
598
|
+
]);
|
|
599
|
+
return o === !1 ? null : f.diagnostic ? /* @__PURE__ */ H(wt, {
|
|
600
|
+
uischema: n,
|
|
601
|
+
config: l,
|
|
602
|
+
visible: o
|
|
603
|
+
}) : /* @__PURE__ */ H(Gt, {
|
|
604
|
+
template: _,
|
|
605
|
+
partials: v,
|
|
606
|
+
data: b,
|
|
607
|
+
slots: y,
|
|
608
|
+
urlPolicy: Y(l)
|
|
609
|
+
});
|
|
610
|
+
}, Jt = L.createContext(void 0), Yt = () => L.useContext(Jt), Xt = M(5, E(N("TemplateLayout"), (e) => typeof (e == null ? void 0 : e.template) == "function")), Zt = L.createContext(void 0), Qt = ({ name: e, children: t }) => {
|
|
611
|
+
let n = L.useContext(Zt), r = n == null ? void 0 : n.byName[e];
|
|
612
|
+
if (!n || !r) {
|
|
613
|
+
var i;
|
|
614
|
+
return console.warn(`template.unknownSlot: no child is named ${JSON.stringify(e)}; known names are ${JSON.stringify(Object.keys((i = n == null ? void 0 : n.byName) == null ? {} : i))}.`), /* @__PURE__ */ H(V, { children: t == null ? null : t });
|
|
615
|
+
}
|
|
616
|
+
return /* @__PURE__ */ H(P, {
|
|
617
|
+
uischema: r,
|
|
618
|
+
schema: n.schema,
|
|
619
|
+
path: n.path,
|
|
620
|
+
enabled: n.enabled,
|
|
621
|
+
renderers: n.renderers,
|
|
622
|
+
cells: n.cells
|
|
623
|
+
});
|
|
624
|
+
}, $t = (e) => {
|
|
625
|
+
var t, n, r, i, a;
|
|
626
|
+
let { uischema: o, schema: s, path: c, enabled: l, visible: u, renderers: d, cells: f } = e, p = F(), m = Te(), h = Yt(), { children: g, names: _, diagnostics: v } = pt(o.elements);
|
|
627
|
+
R(() => {
|
|
628
|
+
for (let e of v) console.warn(e);
|
|
629
|
+
}, [v]);
|
|
630
|
+
let y = we(g, c == null ? "" : c), b = z(() => {
|
|
631
|
+
let e = {};
|
|
632
|
+
return y.forEach((t, n) => {
|
|
633
|
+
let r = _[n];
|
|
634
|
+
r !== void 0 && (e[r] = t);
|
|
635
|
+
}), e;
|
|
636
|
+
}, [y, _]), x = ve((e, t) => {
|
|
637
|
+
var n;
|
|
638
|
+
l !== !1 && ((n = p.dispatch) == null || n.call(p, C.update(e, () => t)));
|
|
639
|
+
}, [p, l]);
|
|
640
|
+
if (u === !1) return null;
|
|
641
|
+
let S = o.template;
|
|
642
|
+
return typeof S == "function" ? /* @__PURE__ */ H(Zt.Provider, {
|
|
643
|
+
value: {
|
|
644
|
+
byName: b,
|
|
645
|
+
schema: s,
|
|
646
|
+
path: c,
|
|
647
|
+
enabled: l,
|
|
648
|
+
renderers: d,
|
|
649
|
+
cells: f
|
|
650
|
+
},
|
|
651
|
+
children: S({
|
|
652
|
+
data: (t = p.core) == null ? void 0 : t.data,
|
|
653
|
+
path: c == null ? "" : c,
|
|
654
|
+
errors: (n = (r = p.core) == null ? void 0 : r.errors) == null ? [] : n,
|
|
655
|
+
schema: s,
|
|
656
|
+
uischema: o,
|
|
657
|
+
elements: b,
|
|
658
|
+
Slot: Qt,
|
|
659
|
+
enabled: l !== !1,
|
|
660
|
+
readonly: p.readonly === !0,
|
|
661
|
+
handleChange: x,
|
|
662
|
+
translate: (i = (a = p.i18n) == null ? void 0 : a.translate) == null ? ((e) => e) : i,
|
|
663
|
+
urlPolicy: Y(p.config),
|
|
664
|
+
context: mt({
|
|
665
|
+
ctx: p,
|
|
666
|
+
schema: s,
|
|
667
|
+
uischema: o,
|
|
668
|
+
fireActionEvent: h,
|
|
669
|
+
external: m
|
|
670
|
+
})
|
|
671
|
+
})
|
|
672
|
+
}) : null;
|
|
673
|
+
}, en = I($t), tn = function() {
|
|
674
|
+
var e = q(function* (e, t) {
|
|
675
|
+
if (typeof e == "function") {
|
|
676
|
+
yield e.call(t, t);
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
let n = Object.getPrototypeOf(q(function* () {})).constructor;
|
|
680
|
+
yield new n(e).call(t);
|
|
681
|
+
});
|
|
682
|
+
return function(t, n) {
|
|
683
|
+
return e.apply(this, arguments);
|
|
684
|
+
};
|
|
685
|
+
}(), nn = M(2, N("Button")), rn = {
|
|
686
|
+
border: "1px solid currentColor",
|
|
687
|
+
borderRadius: 4,
|
|
688
|
+
padding: "0.5rem 0.75rem",
|
|
689
|
+
opacity: .85,
|
|
690
|
+
fontSize: "0.85rem"
|
|
691
|
+
}, an = ({ withProps: e = !0, ButtonComponent: t = "button", buttonProps: n = {}, getButtonProps: r } = {}) => {
|
|
692
|
+
let i = (e) => {
|
|
693
|
+
var i, a, s, c, l, u;
|
|
694
|
+
let { enabled: d, uischema: f, visible: p, config: m, t: h } = e, g = b(), _ = Yt(), v = F(), [y, x] = B(!1), S = xe(!1), C = f, w = (i = (a = (s = (c = A(C, h)) == null ? C.label : c) == null ? C.text : s) == null ? C.name : a) == null ? g("button.action") : i, T = C.script, E = (l = C.action) == null ? T === void 0 ? C.name : void 0 : l, D = z(() => {
|
|
695
|
+
var e;
|
|
696
|
+
return (e = C.params) == null ? {} : e;
|
|
697
|
+
}, [C.params]), O = ve(q(function* () {
|
|
698
|
+
if (S.current) return;
|
|
699
|
+
S.current = !0, x(!0);
|
|
700
|
+
let e = {
|
|
701
|
+
action: E == null ? "" : E,
|
|
702
|
+
label: w,
|
|
703
|
+
params: D,
|
|
704
|
+
element: C,
|
|
705
|
+
context: v
|
|
706
|
+
};
|
|
707
|
+
try {
|
|
708
|
+
T !== void 0 && E === void 0 ? yield tn(T, e) : yield _ == null ? void 0 : _(e);
|
|
709
|
+
} finally {
|
|
710
|
+
S.current = !1, x(!1);
|
|
711
|
+
}
|
|
712
|
+
}), [
|
|
713
|
+
E,
|
|
714
|
+
w,
|
|
715
|
+
D,
|
|
716
|
+
T,
|
|
717
|
+
C,
|
|
718
|
+
_,
|
|
719
|
+
v
|
|
720
|
+
]);
|
|
721
|
+
if (R(() => {
|
|
722
|
+
C.action !== void 0 && C.script !== void 0 && console.warn(`action.conflict: ${JSON.stringify(w)} declares both an action and a script, which are mutually exclusive. The action is used.`);
|
|
723
|
+
}, [
|
|
724
|
+
C.action,
|
|
725
|
+
C.script,
|
|
726
|
+
w
|
|
727
|
+
]), !p) return null;
|
|
728
|
+
if (typeof T == "string" && !vt(m)) return /* @__PURE__ */ H("div", {
|
|
729
|
+
role: "alert",
|
|
730
|
+
"data-button-diagnostic": "script.evaluationDisabled",
|
|
731
|
+
style: rn,
|
|
732
|
+
children: g("button.scriptDisabled", { label: w })
|
|
733
|
+
});
|
|
734
|
+
let k = !d || ((u = C.options) == null ? void 0 : u.disabled) === !0 || y, ee = r == null ? void 0 : r(o(o({}, e), {}, {
|
|
735
|
+
pending: y,
|
|
736
|
+
color: C.color,
|
|
737
|
+
icon: C.icon
|
|
738
|
+
}));
|
|
739
|
+
return /* @__PURE__ */ H(t, o(o(o({ type: "button" }, n), ee), {}, {
|
|
740
|
+
disabled: k,
|
|
741
|
+
"aria-busy": y || void 0,
|
|
742
|
+
"data-button-pending": y || void 0,
|
|
743
|
+
onClick: O,
|
|
744
|
+
children: w
|
|
745
|
+
}));
|
|
746
|
+
};
|
|
747
|
+
return e ? I(me(i)) : i;
|
|
748
|
+
}, on = an(), sn = L.createContext({}), cn = (e) => typeof e.name == "string", ln = M(2, E(N("Template"), cn)), un = (e) => {
|
|
749
|
+
var t;
|
|
750
|
+
let n = F(), r = L.useContext(sn), i = e.uischema, a = L.useMemo(() => {
|
|
751
|
+
var e;
|
|
752
|
+
return o(o({}, r), ((e = i.elements) == null ? [] : e).reduce((e, t) => {
|
|
753
|
+
let n = t.name;
|
|
754
|
+
return n && (e[n] = t), e;
|
|
755
|
+
}, {}));
|
|
756
|
+
}, [i.elements, r]), s = (t = n.uischemas) == null || (t = t.find((e) => e.uischema.name === i.name)) == null ? void 0 : t.uischema;
|
|
757
|
+
return !e.visible || !s ? null : /* @__PURE__ */ H(sn.Provider, {
|
|
758
|
+
value: a,
|
|
759
|
+
children: /* @__PURE__ */ H(P, {
|
|
760
|
+
schema: e.schema,
|
|
761
|
+
uischema: s,
|
|
762
|
+
path: e.path,
|
|
763
|
+
enabled: e.enabled,
|
|
764
|
+
renderers: e.renderers,
|
|
765
|
+
cells: e.cells
|
|
766
|
+
})
|
|
767
|
+
});
|
|
768
|
+
}, dn = I(un), fn = M(2, N("Slot")), pn = (e) => {
|
|
769
|
+
var t, n;
|
|
770
|
+
let r = L.useContext(sn), i = e.uischema, a = (t = i.elements) == null ? void 0 : t[0], o = i.name ? (n = r[i.name]) == null ? a : n : a;
|
|
771
|
+
return !e.visible || !o ? null : /* @__PURE__ */ H(P, {
|
|
772
|
+
schema: e.schema,
|
|
773
|
+
uischema: o,
|
|
774
|
+
path: e.path,
|
|
775
|
+
enabled: e.enabled,
|
|
776
|
+
renderers: e.renderers,
|
|
777
|
+
cells: e.cells
|
|
778
|
+
});
|
|
779
|
+
}, mn = I(pn), hn = M(1, N("Spacer")), gn = 32, _n = (e) => typeof e == "number" ? `${e}px` : e, vn = (e) => {
|
|
780
|
+
let t = e == null ? void 0 : e.size;
|
|
781
|
+
return typeof t == "number" && Number.isFinite(t) ? Math.max(0, t) : typeof t == "string" && t.trim().length > 0 ? t : gn;
|
|
782
|
+
}, yn = ({ uischema: e, visible: t }) => {
|
|
783
|
+
var n;
|
|
784
|
+
let r = vn(e), i = e == null || (n = e.options) == null || (n = n.layout) == null ? void 0 : n.weight;
|
|
785
|
+
return t ? /* @__PURE__ */ H("div", {
|
|
786
|
+
"aria-hidden": "true",
|
|
787
|
+
"data-spacer": !0,
|
|
788
|
+
style: typeof i == "number" && Number.isFinite(i) && i > 0 ? {
|
|
789
|
+
flex: `${i} 1 0`,
|
|
790
|
+
minWidth: 0,
|
|
791
|
+
minHeight: 0
|
|
792
|
+
} : {
|
|
793
|
+
flexShrink: 0,
|
|
794
|
+
height: _n(r),
|
|
795
|
+
width: "100%"
|
|
796
|
+
}
|
|
797
|
+
}) : null;
|
|
798
|
+
}, bn = I(yn), xn = M(1, N("ImageView")), Sn = (e) => {
|
|
799
|
+
if (e === void 0) return !1;
|
|
800
|
+
let t = e.type;
|
|
801
|
+
return t === void 0 ? !0 : Array.isArray(t) ? t.includes("string") : t === "string";
|
|
802
|
+
}, Cn = (e, t) => {
|
|
803
|
+
var n, r;
|
|
804
|
+
let i = [], a = e.src, o = e.alt;
|
|
805
|
+
o === void 0 && i.push({
|
|
806
|
+
code: "image.missingAlt",
|
|
807
|
+
severity: "warning",
|
|
808
|
+
message: "ImageView requires a top-level `alt`. Use `alt: \"\"` to mark the image decorative."
|
|
809
|
+
});
|
|
810
|
+
let s = o == null ? "" : o, c = Y(t.config), l = (e) => {
|
|
811
|
+
if (e !== "") {
|
|
812
|
+
if (!Bt(e, c)) i.push({
|
|
813
|
+
code: "image.urlRefused",
|
|
814
|
+
severity: "error",
|
|
815
|
+
message: "The image source is blocked by the configured URL policy. Use an allowed image URL or adjust the image URL policy."
|
|
816
|
+
});
|
|
817
|
+
else return e;
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
if (a !== void 0) return {
|
|
821
|
+
src: l(a),
|
|
822
|
+
alt: s,
|
|
823
|
+
diagnostics: i
|
|
824
|
+
};
|
|
825
|
+
if (e.scope === void 0) return i.push({
|
|
826
|
+
code: "image.noSource",
|
|
827
|
+
severity: "error",
|
|
828
|
+
message: "ImageView requires at least one of `src` and `scope`."
|
|
829
|
+
}), {
|
|
830
|
+
alt: s,
|
|
831
|
+
diagnostics: i
|
|
832
|
+
};
|
|
833
|
+
if (!Sn(T.schema((n = t.schema) == null ? t.rootSchema : n, e.scope, t.rootSchema))) return i.push({
|
|
834
|
+
code: "image.scopeNotString",
|
|
835
|
+
severity: "error",
|
|
836
|
+
message: `The schema at ${e.scope} does not permit strings.`,
|
|
837
|
+
values: { scope: e.scope }
|
|
838
|
+
}), {
|
|
839
|
+
alt: s,
|
|
840
|
+
diagnostics: i
|
|
841
|
+
};
|
|
842
|
+
let u = D((r = t.path) == null ? "" : r, ue(e.scope)), d = T.data(t.data, u);
|
|
843
|
+
return d == null || d === "" ? {
|
|
844
|
+
alt: s,
|
|
845
|
+
diagnostics: i
|
|
846
|
+
} : typeof d == "string" ? {
|
|
847
|
+
src: l(d),
|
|
848
|
+
alt: s,
|
|
849
|
+
diagnostics: i
|
|
850
|
+
} : (i.push({
|
|
851
|
+
code: "image.nonStringSource",
|
|
852
|
+
severity: "error",
|
|
853
|
+
message: `The value at ${e.scope} is a ${typeof d}, not a URL string.`,
|
|
854
|
+
values: {
|
|
855
|
+
scope: e.scope,
|
|
856
|
+
type: typeof d
|
|
857
|
+
}
|
|
858
|
+
}), {
|
|
859
|
+
alt: s,
|
|
860
|
+
diagnostics: i
|
|
861
|
+
});
|
|
862
|
+
}, wn = {
|
|
863
|
+
border: "1px solid currentColor",
|
|
864
|
+
borderRadius: 4,
|
|
865
|
+
padding: "0.5rem 0.75rem",
|
|
866
|
+
boxSizing: "border-box",
|
|
867
|
+
minWidth: 0,
|
|
868
|
+
maxWidth: "100%",
|
|
869
|
+
display: "flex",
|
|
870
|
+
alignItems: "center",
|
|
871
|
+
gap: "0.5rem",
|
|
872
|
+
overflowWrap: "anywhere",
|
|
873
|
+
fontSize: "0.85rem"
|
|
874
|
+
}, Tn = ({ diagnostic: e }) => {
|
|
875
|
+
let t = b(), [n, r] = L.useState(!1), i = L.useId();
|
|
876
|
+
return /* @__PURE__ */ U("div", {
|
|
877
|
+
role: "alert",
|
|
878
|
+
"data-image-diagnostic": e.code,
|
|
879
|
+
style: wn,
|
|
880
|
+
children: [/* @__PURE__ */ U("span", {
|
|
881
|
+
style: {
|
|
882
|
+
position: "relative",
|
|
883
|
+
display: "inline-flex",
|
|
884
|
+
flexShrink: 0
|
|
885
|
+
},
|
|
886
|
+
onMouseEnter: () => r(!0),
|
|
887
|
+
onMouseLeave: () => r(!1),
|
|
888
|
+
children: [/* @__PURE__ */ H("button", {
|
|
889
|
+
type: "button",
|
|
890
|
+
"aria-label": t("image.warningDetails"),
|
|
891
|
+
"aria-describedby": n ? i : void 0,
|
|
892
|
+
onFocus: () => r(!0),
|
|
893
|
+
onBlur: () => r(!1),
|
|
894
|
+
onClick: () => r(!0),
|
|
895
|
+
onKeyDown: (e) => {
|
|
896
|
+
e.key === "Escape" && r(!1);
|
|
897
|
+
},
|
|
898
|
+
style: {
|
|
899
|
+
display: "inline-flex",
|
|
900
|
+
padding: 0,
|
|
901
|
+
border: 0,
|
|
902
|
+
background: "transparent",
|
|
903
|
+
color: "inherit",
|
|
904
|
+
cursor: "help"
|
|
905
|
+
},
|
|
906
|
+
children: /* @__PURE__ */ U("svg", {
|
|
907
|
+
width: "18",
|
|
908
|
+
height: "18",
|
|
909
|
+
viewBox: "0 0 24 24",
|
|
910
|
+
fill: "none",
|
|
911
|
+
stroke: "currentColor",
|
|
912
|
+
strokeWidth: "1.75",
|
|
913
|
+
"aria-hidden": "true",
|
|
914
|
+
children: [
|
|
915
|
+
/* @__PURE__ */ H("path", { d: "M12 3 2 21h20L12 3Z" }),
|
|
916
|
+
/* @__PURE__ */ H("path", { d: "M12 9v5" }),
|
|
917
|
+
/* @__PURE__ */ H("circle", {
|
|
918
|
+
cx: "12",
|
|
919
|
+
cy: "17",
|
|
920
|
+
r: ".75"
|
|
921
|
+
})
|
|
922
|
+
]
|
|
923
|
+
})
|
|
924
|
+
}), n && /* @__PURE__ */ H("span", {
|
|
925
|
+
id: i,
|
|
926
|
+
role: "tooltip",
|
|
927
|
+
style: {
|
|
928
|
+
position: "absolute",
|
|
929
|
+
top: "100%",
|
|
930
|
+
left: 0,
|
|
931
|
+
zIndex: 10,
|
|
932
|
+
width: "min(22rem, 70vw)",
|
|
933
|
+
boxSizing: "border-box",
|
|
934
|
+
padding: "0.5rem 0.75rem",
|
|
935
|
+
background: "Canvas",
|
|
936
|
+
color: "CanvasText",
|
|
937
|
+
border: "1px solid currentColor",
|
|
938
|
+
borderRadius: 4,
|
|
939
|
+
overflowWrap: "anywhere",
|
|
940
|
+
fontWeight: "normal"
|
|
941
|
+
},
|
|
942
|
+
children: t(e.code, e.values)
|
|
943
|
+
})]
|
|
944
|
+
}), /* @__PURE__ */ H("span", { children: e.code === "image.urlRefused" ? t("image.blocked") : t("image.configurationWarning") })]
|
|
945
|
+
});
|
|
946
|
+
}, En = ({ config: e, uischema: t, schema: n, path: r, visible: i }) => {
|
|
947
|
+
var a, o;
|
|
948
|
+
let s = F(), c = Cn(t, {
|
|
949
|
+
schema: n,
|
|
950
|
+
rootSchema: (a = s.core) == null ? void 0 : a.schema,
|
|
951
|
+
data: (o = s.core) == null ? void 0 : o.data,
|
|
952
|
+
path: r,
|
|
953
|
+
config: e
|
|
954
|
+
});
|
|
955
|
+
return i === !1 ? null : /* @__PURE__ */ U(V, { children: [c.src !== void 0 && /* @__PURE__ */ H("img", {
|
|
956
|
+
src: c.src,
|
|
957
|
+
alt: c.alt,
|
|
958
|
+
style: {
|
|
959
|
+
maxWidth: "100%",
|
|
960
|
+
height: "auto"
|
|
961
|
+
}
|
|
962
|
+
}), c.diagnostics.map((e) => /* @__PURE__ */ H(Tn, { diagnostic: e }, e.code))] });
|
|
963
|
+
}, Dn = I(En), On = M(1, N("Separator")), kn = ({ uischema: e, visible: t }) => {
|
|
964
|
+
var n;
|
|
965
|
+
return t === !1 ? null : ((n = e.options) == null ? void 0 : n.vertical) === !0 ? /* @__PURE__ */ H("hr", {
|
|
966
|
+
"aria-orientation": "vertical",
|
|
967
|
+
"data-separator": "vertical",
|
|
968
|
+
style: {
|
|
969
|
+
alignSelf: "stretch",
|
|
970
|
+
width: 0,
|
|
971
|
+
height: "auto",
|
|
972
|
+
margin: 0,
|
|
973
|
+
borderLeft: "1px solid currentColor",
|
|
974
|
+
borderTop: 0,
|
|
975
|
+
opacity: .3
|
|
976
|
+
}
|
|
977
|
+
}) : /* @__PURE__ */ H("hr", {
|
|
978
|
+
"aria-orientation": "horizontal",
|
|
979
|
+
"data-separator": "horizontal"
|
|
980
|
+
});
|
|
981
|
+
}, An = I(kn), jn = M(1, N("Link")), Mn = (e, t) => {
|
|
982
|
+
let n = (t == null ? "" : t).split(/\s+/).filter(Boolean);
|
|
983
|
+
if (e === "_blank") for (let e of ["noopener", "noreferrer"]) n.includes(e) || n.push(e);
|
|
984
|
+
return n.length > 0 ? n.join(" ") : void 0;
|
|
985
|
+
}, Nn = ({ uischema: e, visible: t, config: n, t: r }) => {
|
|
986
|
+
var i, a;
|
|
987
|
+
let o = e;
|
|
988
|
+
if (!t) return null;
|
|
989
|
+
let s = (i = (a = A(o, r)) == null ? o.label : a) == null ? o.href : i, c = o.href;
|
|
990
|
+
return typeof c == "string" && c !== "" && Rt(c, Y(n)) ? /* @__PURE__ */ H("a", {
|
|
991
|
+
href: c,
|
|
992
|
+
target: o.target,
|
|
993
|
+
rel: Mn(o.target, o.rel),
|
|
994
|
+
children: s
|
|
995
|
+
}) : /* @__PURE__ */ H("span", {
|
|
996
|
+
"data-link-inert": !0,
|
|
997
|
+
children: s
|
|
998
|
+
});
|
|
999
|
+
}, Pn = me(I(Nn)), Fn = ({ label: e }) => /* @__PURE__ */ H("div", {
|
|
1000
|
+
"aria-busy": "true",
|
|
1001
|
+
"aria-live": "polite",
|
|
1002
|
+
style: { minHeight: "4rem" },
|
|
1003
|
+
children: e
|
|
1004
|
+
}), In = ({ label: e }) => /* @__PURE__ */ H("div", {
|
|
1005
|
+
role: "alert",
|
|
1006
|
+
children: e
|
|
1007
|
+
}), Ln = class extends L.Component {
|
|
1008
|
+
constructor(...e) {
|
|
1009
|
+
super(...e), t(this, "state", { failed: !1 });
|
|
1010
|
+
}
|
|
1011
|
+
static getDerivedStateFromError() {
|
|
1012
|
+
return { failed: !0 };
|
|
1013
|
+
}
|
|
1014
|
+
render() {
|
|
1015
|
+
return this.state.failed ? this.props.fallback : this.props.children;
|
|
1016
|
+
}
|
|
1017
|
+
}, Rn = (e, t, n) => {
|
|
1018
|
+
var r, i;
|
|
1019
|
+
let a = (r = t.Loading) == null ? Fn : r, s = (i = t.LoadError) == null ? In : i, c = _e(q(function* () {
|
|
1020
|
+
return { default: yield e() };
|
|
1021
|
+
})), l = (e) => {
|
|
1022
|
+
let t = K();
|
|
1023
|
+
return /* @__PURE__ */ H(Ln, {
|
|
1024
|
+
fallback: /* @__PURE__ */ H(s, { label: t(n.error) }),
|
|
1025
|
+
children: /* @__PURE__ */ H(he, {
|
|
1026
|
+
fallback: /* @__PURE__ */ H(a, { label: t(n.loading) }),
|
|
1027
|
+
children: /* @__PURE__ */ H(c, o({}, e))
|
|
1028
|
+
})
|
|
1029
|
+
});
|
|
1030
|
+
};
|
|
1031
|
+
return l.displayName = `LazyControl(${n.loading})`, l;
|
|
1032
|
+
}, zn = (e) => {
|
|
1033
|
+
let t = [], n = "", r = 0, i = () => {
|
|
1034
|
+
n && (t.push({
|
|
1035
|
+
kind: "literal",
|
|
1036
|
+
text: n
|
|
1037
|
+
}), n = "");
|
|
1038
|
+
};
|
|
1039
|
+
for (; r < e.length;) {
|
|
1040
|
+
let a = e[r];
|
|
1041
|
+
if (a === "{" && e[r + 1] === "{") {
|
|
1042
|
+
n += "{", r += 2;
|
|
1043
|
+
continue;
|
|
1044
|
+
}
|
|
1045
|
+
if (a === "}" && e[r + 1] === "}") {
|
|
1046
|
+
n += "}", r += 2;
|
|
1047
|
+
continue;
|
|
1048
|
+
}
|
|
1049
|
+
if (a !== "{") {
|
|
1050
|
+
n += a, r += 1;
|
|
1051
|
+
continue;
|
|
1052
|
+
}
|
|
1053
|
+
let o = r + 1, s, c = !1;
|
|
1054
|
+
for (; o < e.length;) {
|
|
1055
|
+
let t = e[o];
|
|
1056
|
+
if (s) {
|
|
1057
|
+
if (t === "\\") {
|
|
1058
|
+
o += 2;
|
|
1059
|
+
continue;
|
|
1060
|
+
}
|
|
1061
|
+
t === s && (s = void 0);
|
|
1062
|
+
} else if (t === "\"" || t === "'") s = t;
|
|
1063
|
+
else if (t === "}") {
|
|
1064
|
+
c = !0;
|
|
1065
|
+
break;
|
|
1066
|
+
}
|
|
1067
|
+
o += 1;
|
|
1068
|
+
}
|
|
1069
|
+
if (!c) {
|
|
1070
|
+
n += e.slice(r);
|
|
1071
|
+
break;
|
|
1072
|
+
}
|
|
1073
|
+
i(), t.push({
|
|
1074
|
+
kind: "expression",
|
|
1075
|
+
source: e.slice(r + 1, o)
|
|
1076
|
+
}), r = o + 1;
|
|
1077
|
+
}
|
|
1078
|
+
return i(), t;
|
|
1079
|
+
}, Bn = (e) => e.some((e) => e.kind === "expression"), Vn = (e) => /\{\{\s*[A-Za-z_$][\w$]*(\.[\w$]+|\[[^\]]*\])*\s*\}\}/.test(e), Hn = (e) => e == null ? void 0 : e[l], Un = (e) => {
|
|
1080
|
+
var t;
|
|
1081
|
+
return ((t = Hn(e)) == null || (t = t.dynamicValues) == null ? void 0 : t.enabled) === !0;
|
|
1082
|
+
}, Wn = [
|
|
1083
|
+
"data",
|
|
1084
|
+
"item",
|
|
1085
|
+
"config",
|
|
1086
|
+
"context"
|
|
1087
|
+
], Gn = (e) => {
|
|
1088
|
+
var t;
|
|
1089
|
+
let n = { locale: (t = e.locale) == null ? "en" : t };
|
|
1090
|
+
if (e.dynamicAllowed) {
|
|
1091
|
+
var r, i, a;
|
|
1092
|
+
n.data = (r = e.data) == null ? {} : r, Object.defineProperty(n, "item", {
|
|
1093
|
+
enumerable: !0,
|
|
1094
|
+
get: () => e.item
|
|
1095
|
+
}), n.config = (i = e.config) == null ? {} : i, n.context = (a = e.context) == null ? {} : a;
|
|
1096
|
+
}
|
|
1097
|
+
return n;
|
|
1098
|
+
}, Kn = ["locale"], qn = (e, t) => o(o({}, e), {}, { locale: t == null ? "en" : t }), Jn = (e) => Object.keys(e == null ? {} : e).filter((e) => Kn.includes(e)), Yn = (e) => (e == null ? void 0 : e.interpolate) === !0, Xn = _e(q(function* () {
|
|
1099
|
+
let { renderTemplate: e, resolveTextParams: t } = yield import("./celTemplate-D_AGhaIL.mjs").then((e) => e.t);
|
|
1100
|
+
return { default: ({ segments: n, textParams: r, namespaceScope: i, locale: a, translate: o, escape: s, children: c }) => {
|
|
1101
|
+
let l = t(r, i, a, o), u = e(n, qn(l.params, a), s, a, o);
|
|
1102
|
+
return /* @__PURE__ */ H(V, { children: c({
|
|
1103
|
+
text: u.text,
|
|
1104
|
+
failures: [...l.failures, ...u.failures]
|
|
1105
|
+
}) });
|
|
1106
|
+
} };
|
|
1107
|
+
})), Zn = ({ segments: e, textParams: t, namespaceScope: n, locale: r, translate: i, escape: a, children: o, fallback: s }) => /* @__PURE__ */ H(Ln, {
|
|
1108
|
+
fallback: s,
|
|
1109
|
+
children: /* @__PURE__ */ H(he, {
|
|
1110
|
+
fallback: /* @__PURE__ */ H("span", {
|
|
1111
|
+
role: "status",
|
|
1112
|
+
"aria-busy": "true",
|
|
1113
|
+
children: "…"
|
|
1114
|
+
}),
|
|
1115
|
+
children: /* @__PURE__ */ H(Xn, {
|
|
1116
|
+
segments: e,
|
|
1117
|
+
textParams: t,
|
|
1118
|
+
namespaceScope: n,
|
|
1119
|
+
locale: r,
|
|
1120
|
+
translate: i,
|
|
1121
|
+
escape: a,
|
|
1122
|
+
children: o
|
|
1123
|
+
})
|
|
1124
|
+
})
|
|
1125
|
+
}), Qn = (e) => {
|
|
1126
|
+
let t = e.options, n = t == null ? void 0 : t.markup;
|
|
1127
|
+
return Yn(t) || n !== void 0 && n !== "plain";
|
|
1128
|
+
}, $n = M(3, (e, t, n) => N("Label")(e, t, n) && Qn(e)), er = _e(q(function* () {
|
|
1129
|
+
return { default: (yield import("./MarkupLabelRenderer.impl-CWfdcUuH.mjs")).MarkdownText };
|
|
1130
|
+
})), tr = {
|
|
1131
|
+
display: "block",
|
|
1132
|
+
fontSize: "0.85em",
|
|
1133
|
+
opacity: .85
|
|
1134
|
+
}, nr = ({ uischema: e, text: t, visible: n, config: r, typography: i }) => {
|
|
1135
|
+
var a, o, s, c;
|
|
1136
|
+
let l = K(), u = b(), d = F();
|
|
1137
|
+
if (n === !1) return null;
|
|
1138
|
+
let f = e == null ? void 0 : e.options, p = m(f, r), h = t == null ? "" : t, g = p.diagnostic ? /* @__PURE__ */ H("span", {
|
|
1139
|
+
role: "alert",
|
|
1140
|
+
"data-markup-diagnostic": p.diagnostic,
|
|
1141
|
+
style: tr,
|
|
1142
|
+
children: p.diagnostic === "markdownDisabled" ? l("markup.markdownDisabled") : l("markup.unsupported", { markup: JSON.stringify(f == null ? void 0 : f.markup) })
|
|
1143
|
+
}) : null, y = p.typography ? i : void 0, x = p.interpolate ? zn(h) : void 0, S = x && Bn(x) ? x : void 0, C = x ? x.map((e) => e.kind === "literal" ? e.text : "").join("") : h, w = f == null ? void 0 : f.textParams, T = S ? Gn({
|
|
1144
|
+
data: (a = d.core) == null ? void 0 : a.data,
|
|
1145
|
+
get item() {
|
|
1146
|
+
return d.item;
|
|
1147
|
+
},
|
|
1148
|
+
locale: (o = d.i18n) == null ? void 0 : o.locale,
|
|
1149
|
+
config: r,
|
|
1150
|
+
dynamicAllowed: Un(r)
|
|
1151
|
+
}) : {}, E = Jn(w);
|
|
1152
|
+
if (!p.markdown && !S) return /* @__PURE__ */ U("label", {
|
|
1153
|
+
"data-markup-label": "plain",
|
|
1154
|
+
children: [y ? /* @__PURE__ */ H(y, {
|
|
1155
|
+
block: !1,
|
|
1156
|
+
children: C
|
|
1157
|
+
}) : C, g]
|
|
1158
|
+
});
|
|
1159
|
+
let D = (e) => /* @__PURE__ */ H(Ln, {
|
|
1160
|
+
fallback: e,
|
|
1161
|
+
children: /* @__PURE__ */ H(he, {
|
|
1162
|
+
fallback: e,
|
|
1163
|
+
children: /* @__PURE__ */ H(er, {
|
|
1164
|
+
text: e,
|
|
1165
|
+
profile: _(r),
|
|
1166
|
+
urlPolicy: Y(r)
|
|
1167
|
+
})
|
|
1168
|
+
})
|
|
1169
|
+
}), O = (e) => p.markdown ? D(e) : e;
|
|
1170
|
+
return ((e, t) => {
|
|
1171
|
+
let n = y ? /* @__PURE__ */ H(y, {
|
|
1172
|
+
block: p.markdown,
|
|
1173
|
+
children: e
|
|
1174
|
+
}) : e;
|
|
1175
|
+
return p.markdown ? /* @__PURE__ */ U("div", {
|
|
1176
|
+
"data-markup-label": "markdown",
|
|
1177
|
+
children: [n, t]
|
|
1178
|
+
}) : /* @__PURE__ */ U("label", {
|
|
1179
|
+
"data-markup-label": "interpolated",
|
|
1180
|
+
children: [n, t]
|
|
1181
|
+
});
|
|
1182
|
+
})(S ? /* @__PURE__ */ H(Zn, {
|
|
1183
|
+
segments: S,
|
|
1184
|
+
textParams: w,
|
|
1185
|
+
namespaceScope: T,
|
|
1186
|
+
locale: (s = d.i18n) == null ? void 0 : s.locale,
|
|
1187
|
+
translate: (c = d.i18n) == null ? void 0 : c.translate,
|
|
1188
|
+
escape: p.markdown ? v : void 0,
|
|
1189
|
+
fallback: C,
|
|
1190
|
+
children: (e) => /* @__PURE__ */ U(V, { children: [O(e.text), e.failures.length > 0 || E.length > 0 ? /* @__PURE__ */ H("span", {
|
|
1191
|
+
role: "alert",
|
|
1192
|
+
"data-markup-diagnostic": "interpolationFailed",
|
|
1193
|
+
style: tr,
|
|
1194
|
+
children: l("markup.interpolationFailed", { detail: [...E.map((e) => u("markup.reservedParam", { name: e })), ...e.failures].join("; ") })
|
|
1195
|
+
}) : null] })
|
|
1196
|
+
}) : O(C), g);
|
|
1197
|
+
}, rr = pe(nr), ir = (e) => pe((t) => /* @__PURE__ */ H(nr, o(o({}, t), {}, { typography: e }))), ar = (e, t, n) => {
|
|
1198
|
+
let r = o(o({}, typeof e == "object" ? e : {}), {}, { type: t });
|
|
1199
|
+
if (delete r.anyOf, delete r.oneOf, delete r.allOf, Pe(r, t), t === "object") {
|
|
1200
|
+
var i;
|
|
1201
|
+
r.additionalProperties = (i = r.additionalProperties) == null || i;
|
|
1202
|
+
} else if (t === "array") {
|
|
1203
|
+
let e = Fe(r.items, n);
|
|
1204
|
+
r.items = e && typeof e == "object" ? e : { type: Ae };
|
|
1205
|
+
}
|
|
1206
|
+
return r;
|
|
1207
|
+
}, or = ({ cells: e, data: t, enabled: n, handleChange: r, label: i, path: a, renderers: o, readonly: s, rootSchema: c, schema: l, uischema: u, visible: d }) => {
|
|
1208
|
+
let f = b(), p = x(), m = F(), h = z(() => {
|
|
1209
|
+
var e;
|
|
1210
|
+
return (e = m.uischemas) == null ? [] : e;
|
|
1211
|
+
}, [m.uischemas]), g = z(() => Me(l), [l]), _ = je(t), v = _ && g.includes(_) ? _ : _ === "integer" && g.includes("number") ? "number" : null, y = z(() => v ? ar(l, v, c) : void 0, [
|
|
1212
|
+
c,
|
|
1213
|
+
l,
|
|
1214
|
+
v
|
|
1215
|
+
]), S = z(() => y ? ke(y, u, a, c, h == null ? [] : h, ee) : void 0, [
|
|
1216
|
+
a,
|
|
1217
|
+
c,
|
|
1218
|
+
y,
|
|
1219
|
+
u,
|
|
1220
|
+
h
|
|
1221
|
+
]);
|
|
1222
|
+
if (!d) return null;
|
|
1223
|
+
let C = v !== "null" && y && S ? /* @__PURE__ */ H(P, {
|
|
1224
|
+
schema: y,
|
|
1225
|
+
uischema: S,
|
|
1226
|
+
path: a,
|
|
1227
|
+
enabled: n,
|
|
1228
|
+
renderers: o,
|
|
1229
|
+
cells: e,
|
|
1230
|
+
readonly: s
|
|
1231
|
+
}) : null, w = v === "object" || v === "array";
|
|
1232
|
+
return /* @__PURE__ */ U("div", {
|
|
1233
|
+
className: "jsonforms-mixed-renderer",
|
|
1234
|
+
children: [/* @__PURE__ */ U("label", {
|
|
1235
|
+
className: "jsonforms-mixed-renderer-type",
|
|
1236
|
+
children: [i ? /* @__PURE__ */ H("span", { children: i }) : null, /* @__PURE__ */ U("select", {
|
|
1237
|
+
disabled: !n,
|
|
1238
|
+
value: v == null ? "" : v,
|
|
1239
|
+
onChange: (e) => {
|
|
1240
|
+
let t = e.currentTarget.value, n = ar(l, t, c);
|
|
1241
|
+
r(a, k(n, c));
|
|
1242
|
+
},
|
|
1243
|
+
children: [/* @__PURE__ */ H("option", {
|
|
1244
|
+
disabled: !0,
|
|
1245
|
+
value: "",
|
|
1246
|
+
children: f("mixed.typePlaceholder")
|
|
1247
|
+
}), g.map((e) => /* @__PURE__ */ H("option", {
|
|
1248
|
+
value: e,
|
|
1249
|
+
children: p(`mixed.type.${e}`, e)
|
|
1250
|
+
}, p(`mixed.type.${e}`, e)))]
|
|
1251
|
+
})]
|
|
1252
|
+
}), w ? /* @__PURE__ */ U("details", {
|
|
1253
|
+
className: "jsonforms-mixed-renderer-detail",
|
|
1254
|
+
open: !0,
|
|
1255
|
+
children: [/* @__PURE__ */ H("summary", { children: v }), C]
|
|
1256
|
+
}, v) : C]
|
|
1257
|
+
});
|
|
1258
|
+
}, sr = (e, t, n) => {
|
|
1259
|
+
if (t && typeof t == "boolean") return !0;
|
|
1260
|
+
if (!t || typeof t != "object") return !1;
|
|
1261
|
+
if (Array.isArray(t.type) || t.type === void 0 && ie(e)) return !0;
|
|
1262
|
+
if (t.type === "object") {
|
|
1263
|
+
let r = e.scope;
|
|
1264
|
+
if (r) {
|
|
1265
|
+
let e = ce(t, r, n == null ? void 0 : n.rootSchema);
|
|
1266
|
+
return Array.isArray(e == null ? void 0 : e.type);
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
return !1;
|
|
1270
|
+
}, cr = Ne(sr), lr = M(20, cr), ur = fe(or), dr = 16, fr = (e) => e == null || e === "auto" || typeof e == "number" && Number.isInteger(e) && e >= 2 && e <= 16, pr = (e, t = "1rem") => {
|
|
1271
|
+
let n = e.map((e) => typeof e == "number" && fr(e) ? e : void 0), r = [[]], i = n.every((e) => e === void 0), a = 0;
|
|
1272
|
+
return n.forEach((e, t) => {
|
|
1273
|
+
let n = e == null ? 2 : e;
|
|
1274
|
+
!i && a + n > 16 && (r.push([]), a = 0), r[r.length - 1].push(t), a += n;
|
|
1275
|
+
}), r.flatMap((r, i) => {
|
|
1276
|
+
let a = r.reduce((e, t) => {
|
|
1277
|
+
var r;
|
|
1278
|
+
return e + ((r = n[t]) == null ? 0 : r);
|
|
1279
|
+
}, 0), o = r.filter((e) => n[e] === void 0).length;
|
|
1280
|
+
return r.map((s) => {
|
|
1281
|
+
var c;
|
|
1282
|
+
let l = (c = n[s]) == null ? (16 - a) / o : c, u = l / 16;
|
|
1283
|
+
return {
|
|
1284
|
+
row: i,
|
|
1285
|
+
columns: l,
|
|
1286
|
+
style: {
|
|
1287
|
+
flex: `0 0 calc(${u * 100}% - ${t} * ${(r.length - 1) * u})`,
|
|
1288
|
+
minWidth: 0
|
|
1289
|
+
},
|
|
1290
|
+
diagnostic: fr(e[s]) ? void 0 : "Columns must be Auto or an integer from 2 through 16."
|
|
1291
|
+
};
|
|
1292
|
+
});
|
|
1293
|
+
});
|
|
1294
|
+
}, mr = M(3, N("HorizontalLayout")), hr = (e) => {
|
|
1295
|
+
var t;
|
|
1296
|
+
let n = F(), r = { jsonforms: n }, i = ((t = e.uischema.elements) == null ? [] : t).map((e, t) => ({
|
|
1297
|
+
element: e,
|
|
1298
|
+
index: t
|
|
1299
|
+
})).filter(({ element: t }) => {
|
|
1300
|
+
var i;
|
|
1301
|
+
return oe(t, (i = n.core) == null ? void 0 : i.data, e.path, ne(r), re(r));
|
|
1302
|
+
}), a = "1rem", o = pr(i.map(({ element: e }) => {
|
|
1303
|
+
var t;
|
|
1304
|
+
return (t = e.options) == null ? void 0 : t.columns;
|
|
1305
|
+
}), a);
|
|
1306
|
+
return e.visible ? /* @__PURE__ */ H("div", {
|
|
1307
|
+
style: {
|
|
1308
|
+
display: "flex",
|
|
1309
|
+
flexDirection: "column",
|
|
1310
|
+
gap: a,
|
|
1311
|
+
width: "100%",
|
|
1312
|
+
minWidth: 0
|
|
1313
|
+
},
|
|
1314
|
+
children: Array.from(new Set(o.map(({ row: e }) => e))).map((t) => /* @__PURE__ */ H("div", {
|
|
1315
|
+
"data-columns-row": t,
|
|
1316
|
+
style: {
|
|
1317
|
+
display: "flex",
|
|
1318
|
+
gap: a,
|
|
1319
|
+
minWidth: 0
|
|
1320
|
+
},
|
|
1321
|
+
children: i.map(({ element: n, index: r }, i) => {
|
|
1322
|
+
let a = o[i];
|
|
1323
|
+
return a.row === t ? /* @__PURE__ */ H("div", {
|
|
1324
|
+
style: a.style,
|
|
1325
|
+
"data-columns": a.columns,
|
|
1326
|
+
"data-columns-diagnostic": a.diagnostic,
|
|
1327
|
+
children: /* @__PURE__ */ H(P, {
|
|
1328
|
+
schema: e.schema,
|
|
1329
|
+
uischema: n,
|
|
1330
|
+
path: e.path,
|
|
1331
|
+
enabled: e.enabled,
|
|
1332
|
+
renderers: e.renderers,
|
|
1333
|
+
cells: e.cells
|
|
1334
|
+
})
|
|
1335
|
+
}, `${e.path}-${r}`) : null;
|
|
1336
|
+
})
|
|
1337
|
+
}, t))
|
|
1338
|
+
}) : null;
|
|
1339
|
+
}, gr = I(hr), _r = (e, t) => {
|
|
1340
|
+
let n = ze(e), r = n.propertyNames;
|
|
1341
|
+
if (typeof r == "object" && typeof r.$ref == "string") {
|
|
1342
|
+
var i;
|
|
1343
|
+
r = (i = ce(t, r.$ref, t)) == null ? r : i;
|
|
1344
|
+
}
|
|
1345
|
+
if (typeof r == "object" && r.pattern) return r.pattern;
|
|
1346
|
+
if (n.additionalProperties === !1 && n.patternProperties) {
|
|
1347
|
+
let e = Object.keys(n.patternProperties);
|
|
1348
|
+
return e.length > 0 ? e.join("|") : void 0;
|
|
1349
|
+
}
|
|
1350
|
+
}, vr = (e, t, n, r, i, a) => {
|
|
1351
|
+
if (!t) return;
|
|
1352
|
+
if (typeof n == "object" && n && Object.prototype.hasOwnProperty.call(n, t) && t !== a) return e("additionalProperties.nameTaken", { name: t });
|
|
1353
|
+
if (t.includes("[") || t.includes("]") || t.includes(".")) return e("additionalProperties.nameInvalid", { name: t });
|
|
1354
|
+
let o = _r(r, i);
|
|
1355
|
+
if (o && !new RegExp(o).test(t)) return e("additionalProperties.namePattern", { pattern: o });
|
|
1356
|
+
}, yr = ({ cells: e, config: t, data: n, enabled: r, handleChange: i, label: a, path: s, readonly: c, renderers: l, rootSchema: u, schema: d, uischema: f }) => {
|
|
1357
|
+
let p = K(), [m, h] = B(""), [g, _] = B(null), [v, y] = B(""), { maxPropertiesReached: b, minPropertiesReached: x, appliedOptions: S, objectData: C, allowIfMissing: w, additionalPropertyItems: T, shouldShow: E } = Ie({
|
|
1358
|
+
data: n,
|
|
1359
|
+
schema: d,
|
|
1360
|
+
rootSchema: u,
|
|
1361
|
+
path: s,
|
|
1362
|
+
uischema: f,
|
|
1363
|
+
config: t
|
|
1364
|
+
});
|
|
1365
|
+
if (!E) return null;
|
|
1366
|
+
let D = m.trim(), O = vr(p, D, n, d, u), A = !r || c || S.restrict && b || !!O || !D, ee = !r || c || S.restrict && x, te = () => {
|
|
1367
|
+
if (A) return;
|
|
1368
|
+
let e = Re(D, s, d, u, w), t = C ? o({}, C) : {};
|
|
1369
|
+
t[D] = k(e.schema, u), i(s, t), h("");
|
|
1370
|
+
}, ne = (e) => {
|
|
1371
|
+
if (ee || !C) return;
|
|
1372
|
+
let t = o({}, C);
|
|
1373
|
+
delete t[e], i(s, t);
|
|
1374
|
+
}, re = (e) => {
|
|
1375
|
+
let t = v.trim();
|
|
1376
|
+
!vr(p, t, n, d, u, e) && t && t !== e && C && (i(s, Le(C, e, t)), _(null), y(""));
|
|
1377
|
+
};
|
|
1378
|
+
return /* @__PURE__ */ U("div", {
|
|
1379
|
+
className: "jsonforms-additional-properties",
|
|
1380
|
+
children: [
|
|
1381
|
+
/* @__PURE__ */ U("div", {
|
|
1382
|
+
className: "jsonforms-additional-properties-add",
|
|
1383
|
+
children: [/* @__PURE__ */ H("input", {
|
|
1384
|
+
"aria-label": a ? p("additionalProperties.addTo", { label: a }) : p("additionalProperties.addLabel"),
|
|
1385
|
+
disabled: !r || c,
|
|
1386
|
+
placeholder: p("additionalProperties.namePlaceholder"),
|
|
1387
|
+
type: "text",
|
|
1388
|
+
value: m,
|
|
1389
|
+
onChange: (e) => h(e.currentTarget.value),
|
|
1390
|
+
onKeyDown: (e) => {
|
|
1391
|
+
e.key === "Enter" && te();
|
|
1392
|
+
}
|
|
1393
|
+
}), /* @__PURE__ */ H("button", {
|
|
1394
|
+
disabled: A,
|
|
1395
|
+
type: "button",
|
|
1396
|
+
onClick: te,
|
|
1397
|
+
children: p("additionalProperties.add")
|
|
1398
|
+
})]
|
|
1399
|
+
}),
|
|
1400
|
+
O ? /* @__PURE__ */ H("div", {
|
|
1401
|
+
className: "jsonforms-additional-properties-error",
|
|
1402
|
+
children: O
|
|
1403
|
+
}) : null,
|
|
1404
|
+
/* @__PURE__ */ H("div", {
|
|
1405
|
+
className: "jsonforms-additional-properties-list",
|
|
1406
|
+
children: T.map((t) => {
|
|
1407
|
+
let i = g === t.propertyName, a = vr(p, v.trim(), n, d, u, t.propertyName), o = !r || c || !!a || !v.trim() || v.trim() === t.propertyName;
|
|
1408
|
+
return /* @__PURE__ */ U("div", {
|
|
1409
|
+
className: "jsonforms-additional-property",
|
|
1410
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1411
|
+
className: "jsonforms-additional-property-control",
|
|
1412
|
+
children: /* @__PURE__ */ H(P, {
|
|
1413
|
+
schema: t.schema,
|
|
1414
|
+
uischema: t.uischema,
|
|
1415
|
+
path: t.path,
|
|
1416
|
+
enabled: r,
|
|
1417
|
+
renderers: l,
|
|
1418
|
+
cells: e,
|
|
1419
|
+
readonly: c
|
|
1420
|
+
})
|
|
1421
|
+
}), r ? /* @__PURE__ */ H("div", {
|
|
1422
|
+
className: "jsonforms-additional-property-actions",
|
|
1423
|
+
children: i ? /* @__PURE__ */ U(V, { children: [
|
|
1424
|
+
/* @__PURE__ */ H("input", {
|
|
1425
|
+
"aria-label": p("additionalProperties.renameNamed", { name: t.propertyName }),
|
|
1426
|
+
autoFocus: !0,
|
|
1427
|
+
disabled: c,
|
|
1428
|
+
type: "text",
|
|
1429
|
+
value: v,
|
|
1430
|
+
onChange: (e) => y(e.currentTarget.value),
|
|
1431
|
+
onKeyDown: (e) => {
|
|
1432
|
+
e.key === "Enter" ? re(t.propertyName) : e.key === "Escape" && (_(null), y(""));
|
|
1433
|
+
}
|
|
1434
|
+
}),
|
|
1435
|
+
/* @__PURE__ */ H("button", {
|
|
1436
|
+
disabled: o,
|
|
1437
|
+
type: "button",
|
|
1438
|
+
onClick: () => re(t.propertyName),
|
|
1439
|
+
children: p("additionalProperties.save")
|
|
1440
|
+
}),
|
|
1441
|
+
/* @__PURE__ */ H("button", {
|
|
1442
|
+
type: "button",
|
|
1443
|
+
onClick: () => {
|
|
1444
|
+
_(null), y("");
|
|
1445
|
+
},
|
|
1446
|
+
children: p("additionalProperties.cancel")
|
|
1447
|
+
}),
|
|
1448
|
+
a ? /* @__PURE__ */ H("div", {
|
|
1449
|
+
className: "jsonforms-additional-properties-error",
|
|
1450
|
+
children: a
|
|
1451
|
+
}) : null
|
|
1452
|
+
] }) : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("button", {
|
|
1453
|
+
disabled: c,
|
|
1454
|
+
type: "button",
|
|
1455
|
+
onClick: () => {
|
|
1456
|
+
_(t.propertyName), y(t.propertyName);
|
|
1457
|
+
},
|
|
1458
|
+
children: p("additionalProperties.rename")
|
|
1459
|
+
}), /* @__PURE__ */ H("button", {
|
|
1460
|
+
disabled: ee,
|
|
1461
|
+
type: "button",
|
|
1462
|
+
onClick: () => ne(t.propertyName),
|
|
1463
|
+
children: p("additionalProperties.delete")
|
|
1464
|
+
})] })
|
|
1465
|
+
}) : null]
|
|
1466
|
+
}, t.propertyName);
|
|
1467
|
+
})
|
|
1468
|
+
})
|
|
1469
|
+
]
|
|
1470
|
+
});
|
|
1471
|
+
}, br = {
|
|
1472
|
+
trimStart: (e) => e.trimStart(),
|
|
1473
|
+
trimEnd: (e) => e.trimEnd(),
|
|
1474
|
+
trimLeft: (e) => e.trimStart(),
|
|
1475
|
+
trimRight: (e) => e.trimEnd(),
|
|
1476
|
+
trim: (e) => e.trim(),
|
|
1477
|
+
toLowerCase: (e) => e.toLowerCase(),
|
|
1478
|
+
toUpperCase: (e) => e.toUpperCase(),
|
|
1479
|
+
toEnumCase: (e, t) => (t == null ? void 0 : t.hash[wr(e)]) || e,
|
|
1480
|
+
capitalize: (e) => Ke(e),
|
|
1481
|
+
startCase: (e) => qe(e)
|
|
1482
|
+
}, xr = Object.assign(Sr, { transform: br });
|
|
1483
|
+
function Sr() {
|
|
1484
|
+
return {
|
|
1485
|
+
keyword: "transform",
|
|
1486
|
+
schemaType: "array",
|
|
1487
|
+
before: "enum",
|
|
1488
|
+
code(e) {
|
|
1489
|
+
let { gen: t, data: n, schema: r, parentSchema: i, it: a } = e, { parentData: o, parentDataProperty: s } = a, c = r;
|
|
1490
|
+
if (!c.length) return;
|
|
1491
|
+
let l;
|
|
1492
|
+
if (c.includes("toEnumCase")) {
|
|
1493
|
+
let e = Cr(i);
|
|
1494
|
+
l = t.scopeValue("obj", {
|
|
1495
|
+
ref: e,
|
|
1496
|
+
code: Ge(e)
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
t.if(Ue`typeof ${n} == "string" && ${o} !== undefined`, () => {
|
|
1500
|
+
t.assign(n, u(c.slice())), t.assign(Ue`${o}[${s}]`, n);
|
|
1501
|
+
});
|
|
1502
|
+
function u(e) {
|
|
1503
|
+
if (!e.length) return n;
|
|
1504
|
+
let r = e.pop();
|
|
1505
|
+
if (!(r in br)) throw Error(`transform: unknown transformation ${r}`);
|
|
1506
|
+
let i = t.scopeValue("func", {
|
|
1507
|
+
ref: br[r],
|
|
1508
|
+
code: Ue`require("ajv-keywords/dist/definitions/transform").transform${We(r)}`
|
|
1509
|
+
}), a = u(e);
|
|
1510
|
+
return l && r === "toEnumCase" ? Ue`${i}(${a}, ${l})` : Ue`${i}(${a})`;
|
|
1511
|
+
}
|
|
1512
|
+
},
|
|
1513
|
+
metaSchema: {
|
|
1514
|
+
type: "array",
|
|
1515
|
+
items: {
|
|
1516
|
+
type: "string",
|
|
1517
|
+
enum: Object.keys(br)
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
function Cr(e) {
|
|
1523
|
+
let t = { hash: {} };
|
|
1524
|
+
if (!e.enum) throw Error("transform: \"toEnumCase\" requires \"enum\"");
|
|
1525
|
+
for (let n of e.enum) {
|
|
1526
|
+
if (typeof n != "string") continue;
|
|
1527
|
+
let e = wr(n);
|
|
1528
|
+
if (t.hash[e]) throw Error("transform: \"toEnumCase\" requires all lowercased \"enum\" values to be unique");
|
|
1529
|
+
t.hash[e] = n;
|
|
1530
|
+
}
|
|
1531
|
+
return t;
|
|
1532
|
+
}
|
|
1533
|
+
function wr(e) {
|
|
1534
|
+
return e.toLowerCase();
|
|
1535
|
+
}
|
|
1536
|
+
W.extend(Je), W.extend(Ze), W.extend(Xe), W.extend(Ye);
|
|
1537
|
+
var X = (e, t) => {
|
|
1538
|
+
let n = e == null ? void 0 : e[t];
|
|
1539
|
+
return typeof n == "string" ? n : void 0;
|
|
1540
|
+
}, Tr = (e) => (t) => {
|
|
1541
|
+
let n = X(t, "func");
|
|
1542
|
+
if (!n) throw Error("missing argument 'func' for dynamicDefaults func 'dynamic'");
|
|
1543
|
+
if (!e()) return console.warn("dynamicDefaults.evaluationDisabled: the 'dynamic' default compiles a function from the schema, which requires jsonformsExtended.security.allowScriptEvaluation. No default was applied."), () => void 0;
|
|
1544
|
+
try {
|
|
1545
|
+
let e = Function("args", `const func = ${n}; return func(args);`);
|
|
1546
|
+
return () => {
|
|
1547
|
+
try {
|
|
1548
|
+
return e(t);
|
|
1549
|
+
} catch (e) {
|
|
1550
|
+
console.error(`Error at dynamicDefaults 'dynamic': ${e}`);
|
|
1551
|
+
return;
|
|
1552
|
+
}
|
|
1553
|
+
};
|
|
1554
|
+
} catch (e) {
|
|
1555
|
+
return console.error(`Error at dynamicDefaults 'dynamic': ${e}`), () => void 0;
|
|
1556
|
+
}
|
|
1557
|
+
}, Er = (e) => {
|
|
1558
|
+
var t;
|
|
1559
|
+
let n = X(e, "param");
|
|
1560
|
+
if (!n || typeof window > "u" || !window.location) return () => void 0;
|
|
1561
|
+
let r = new URL(window.location.href), i = (t = r.searchParams.get(n)) == null ? void 0 : t;
|
|
1562
|
+
if (i === void 0) {
|
|
1563
|
+
let e = r.hash, t = e.indexOf("?");
|
|
1564
|
+
if (t > 0 && t < e.length - 1) {
|
|
1565
|
+
var a;
|
|
1566
|
+
i = (a = new URLSearchParams(e.substring(t + 1)).get(n)) == null ? void 0 : a;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
return () => i;
|
|
1570
|
+
}, Dr = (e) => {
|
|
1571
|
+
let t = X(e, "duration"), n = X(e, "date"), r = n && n !== "now" ? n : /* @__PURE__ */ new Date(), i = X(e, "op"), a = i === "subtract" || i === "substract", o = W(r);
|
|
1572
|
+
if (o.isValid() && t) {
|
|
1573
|
+
let e = W.duration(t);
|
|
1574
|
+
o = a ? o.subtract(e) : o.add(e);
|
|
1575
|
+
}
|
|
1576
|
+
return o;
|
|
1577
|
+
}, Or = (e) => (t) => {
|
|
1578
|
+
let n = Dr(t), r = n.isValid() ? n.local().format(e) : void 0;
|
|
1579
|
+
return () => r;
|
|
1580
|
+
}, kr = Or("YYYY-MM-DDTHH:mm:ss.SSS"), Ar = Or("HH:mm:ss.SSS"), jr = Or("YYYY-MM-DD"), Mr = (e) => {
|
|
1581
|
+
var t;
|
|
1582
|
+
let n = Dr(e);
|
|
1583
|
+
if (!n.isValid()) return () => void 0;
|
|
1584
|
+
let r = (t = X(e, "unit")) == null ? "millisecond" : t, i = n.local().get(r);
|
|
1585
|
+
return () => i;
|
|
1586
|
+
}, Nr = (e, t = {}) => {
|
|
1587
|
+
var n;
|
|
1588
|
+
Ve(e), e.getKeyword("transform") && e.removeKeyword("transform"), e.addKeyword(xr());
|
|
1589
|
+
let r = He.DEFAULTS;
|
|
1590
|
+
return r.dynamic = Tr((n = t.allowScriptEvaluation) == null ? (() => !1) : n), r.searchParams = Er, r.datetime = kr, r.date = jr, r.time = Ar, r.dateUnit = Mr, e;
|
|
1591
|
+
}, Pr = "0 0/15 * * * *", Z = [
|
|
1592
|
+
"second",
|
|
1593
|
+
"minute",
|
|
1594
|
+
"hour",
|
|
1595
|
+
"dayOfMonth",
|
|
1596
|
+
"month",
|
|
1597
|
+
"dayOfWeek"
|
|
1598
|
+
], Fr = [
|
|
1599
|
+
"SUN",
|
|
1600
|
+
"MON",
|
|
1601
|
+
"TUE",
|
|
1602
|
+
"WED",
|
|
1603
|
+
"THU",
|
|
1604
|
+
"FRI",
|
|
1605
|
+
"SAT"
|
|
1606
|
+
], Ir = [
|
|
1607
|
+
"JAN",
|
|
1608
|
+
"FEB",
|
|
1609
|
+
"MAR",
|
|
1610
|
+
"APR",
|
|
1611
|
+
"MAY",
|
|
1612
|
+
"JUN",
|
|
1613
|
+
"JUL",
|
|
1614
|
+
"AUG",
|
|
1615
|
+
"SEP",
|
|
1616
|
+
"OCT",
|
|
1617
|
+
"NOV",
|
|
1618
|
+
"DEC"
|
|
1619
|
+
], Q = {
|
|
1620
|
+
second: [0, 59],
|
|
1621
|
+
minute: [0, 59],
|
|
1622
|
+
hour: [0, 23],
|
|
1623
|
+
dayOfMonth: [1, 31],
|
|
1624
|
+
month: [1, 12],
|
|
1625
|
+
dayOfWeek: [0, 6]
|
|
1626
|
+
};
|
|
1627
|
+
function Lr(e) {
|
|
1628
|
+
if (e === "dayOfWeek") return Fr;
|
|
1629
|
+
if (e === "month") return Ir;
|
|
1630
|
+
}
|
|
1631
|
+
var Rr = {
|
|
1632
|
+
"@yearly": "0 0 0 1 1 *",
|
|
1633
|
+
"@annually": "0 0 0 1 1 *",
|
|
1634
|
+
"@monthly": "0 0 0 1 * *",
|
|
1635
|
+
"@weekly": "0 0 0 * * 0",
|
|
1636
|
+
"@daily": "0 0 0 * * *",
|
|
1637
|
+
"@midnight": "0 0 0 * * *",
|
|
1638
|
+
"@hourly": "0 0 * * * *"
|
|
1639
|
+
};
|
|
1640
|
+
function $(e) {
|
|
1641
|
+
var t;
|
|
1642
|
+
let n = e.trim();
|
|
1643
|
+
if (n === "") return;
|
|
1644
|
+
let r = ((t = Rr[n.toLowerCase()]) == null ? n : t).split(/\s+/);
|
|
1645
|
+
return r.length === 6 ? r : void 0;
|
|
1646
|
+
}
|
|
1647
|
+
function zr(e) {
|
|
1648
|
+
return e.join(" ");
|
|
1649
|
+
}
|
|
1650
|
+
function Br(e, t) {
|
|
1651
|
+
let n = Lr(t);
|
|
1652
|
+
if (n) {
|
|
1653
|
+
let r = n.indexOf(e.toUpperCase());
|
|
1654
|
+
if (r >= 0) return t === "month" ? r + 1 : r;
|
|
1655
|
+
}
|
|
1656
|
+
if (!/^\d+$/.test(e)) return;
|
|
1657
|
+
let r = Number(e);
|
|
1658
|
+
if (t === "dayOfWeek" && r === 7) return 0;
|
|
1659
|
+
let [i, a] = Q[t];
|
|
1660
|
+
return r >= i && r <= a ? r : void 0;
|
|
1661
|
+
}
|
|
1662
|
+
function Vr(e, t) {
|
|
1663
|
+
let [n, r] = Q[t], i = () => Array.from({ length: r - n + 1 }, (e, t) => n + t), a = e.trim();
|
|
1664
|
+
if (a === "") return;
|
|
1665
|
+
if (a === "*") return i();
|
|
1666
|
+
if (a === "?") return t === "dayOfMonth" || t === "dayOfWeek" ? i() : void 0;
|
|
1667
|
+
let o = /* @__PURE__ */ new Set();
|
|
1668
|
+
for (let e of a.split(",")) {
|
|
1669
|
+
let [i, a, ...s] = e.split("/");
|
|
1670
|
+
if (s.length > 0) return;
|
|
1671
|
+
let c = 1;
|
|
1672
|
+
if (a !== void 0) {
|
|
1673
|
+
if (!/^\d+$/.test(a) || Number(a) < 1) return;
|
|
1674
|
+
c = Number(a);
|
|
1675
|
+
}
|
|
1676
|
+
let l, u;
|
|
1677
|
+
if (i === "*" || i === "?") [l, u] = [n, r];
|
|
1678
|
+
else {
|
|
1679
|
+
let [e, n, ...o] = i.split("-");
|
|
1680
|
+
if (o.length > 0) return;
|
|
1681
|
+
let s = Br(e, t);
|
|
1682
|
+
if (s === void 0) return;
|
|
1683
|
+
if (n === void 0) [l, u] = a === void 0 ? [s, s] : [s, r];
|
|
1684
|
+
else {
|
|
1685
|
+
let e = Br(n, t);
|
|
1686
|
+
if (e === void 0 || e < s) return;
|
|
1687
|
+
[l, u] = [s, e];
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
for (let e = l; e <= u; e += c) o.add(e);
|
|
1691
|
+
}
|
|
1692
|
+
return [...o].sort((e, t) => e - t);
|
|
1693
|
+
}
|
|
1694
|
+
function Hr(e, t) {
|
|
1695
|
+
let n = Lr(t);
|
|
1696
|
+
return n ? t === "month" ? n[e - 1] : n[e] : String(e);
|
|
1697
|
+
}
|
|
1698
|
+
function Ur(e, t) {
|
|
1699
|
+
let [n, r] = Q[t], i = [...new Set(e)].filter((e) => e >= n && e <= r).sort((e, t) => e - t);
|
|
1700
|
+
if (i.length === 0 || i.length === r - n + 1) return "*";
|
|
1701
|
+
if (Lr(t) === void 0 && i.length > 2) {
|
|
1702
|
+
let e = i[1] - i[0];
|
|
1703
|
+
if (i.every((t, n) => n === 0 || t - i[n - 1] === e) && e > 1 && i[i.length - 1] + e > r) return i[0] === n ? `*/${e}` : `${i[0]}/${e}`;
|
|
1704
|
+
}
|
|
1705
|
+
let a = [], o = 0;
|
|
1706
|
+
for (; o < i.length;) {
|
|
1707
|
+
let e = o;
|
|
1708
|
+
for (; e + 1 < i.length && i[e + 1] === i[e] + 1;) e += 1;
|
|
1709
|
+
let n = Hr(i[o], t);
|
|
1710
|
+
if (e - o >= 2) a.push(`${n}-${Hr(i[e], t)}`);
|
|
1711
|
+
else for (let n = o; n <= e; n += 1) a.push(Hr(i[n], t));
|
|
1712
|
+
o = e + 1;
|
|
1713
|
+
}
|
|
1714
|
+
return a.join(",");
|
|
1715
|
+
}
|
|
1716
|
+
function Wr(e, t) {
|
|
1717
|
+
if (Vr(e, t) !== void 0 || t === "dayOfMonth" && (e === "L" || e === "LW" || /^L-\d+$/.test(e) || /^\d+W$/.test(e)) || t === "dayOfWeek" && (/^\d?L$/.test(e) || /^[A-Za-z]{3}L$/.test(e) || /^(?:\d|[A-Za-z]{3})#[1-5]$/.test(e))) return !0;
|
|
1718
|
+
let [n, r] = e.split("-");
|
|
1719
|
+
return r !== void 0 && Br(n, t) !== void 0 && Br(r, t) !== void 0;
|
|
1720
|
+
}
|
|
1721
|
+
function Gr(e) {
|
|
1722
|
+
let t = $(e);
|
|
1723
|
+
if (!t) return "sixFields";
|
|
1724
|
+
let n = Z.findIndex((e, n) => !Wr(t[n], e));
|
|
1725
|
+
return n < 0 ? void 0 : Z[n];
|
|
1726
|
+
}
|
|
1727
|
+
var Kr = [
|
|
1728
|
+
["year", "month"],
|
|
1729
|
+
["month", "dayOfMonth"],
|
|
1730
|
+
["week", "dayOfWeek"],
|
|
1731
|
+
["day", "hour"],
|
|
1732
|
+
["hour", "minute"],
|
|
1733
|
+
["minute", "second"]
|
|
1734
|
+
];
|
|
1735
|
+
function qr(e, t) {
|
|
1736
|
+
let n = Vr(e, t), [r, i] = Q[t];
|
|
1737
|
+
return n !== void 0 && n.length === i - r + 1;
|
|
1738
|
+
}
|
|
1739
|
+
function Jr(e) {
|
|
1740
|
+
for (let [t, n] of Kr) if (!qr(e[Z.indexOf(n)], n)) return t;
|
|
1741
|
+
return "second";
|
|
1742
|
+
}
|
|
1743
|
+
function Yr(e) {
|
|
1744
|
+
let t = Kr.findIndex(([t]) => t === e);
|
|
1745
|
+
return t < 0 ? [] : Kr.slice(t).map(([, e]) => e).filter((t) => e !== "week" || t !== "dayOfMonth");
|
|
1746
|
+
}
|
|
1747
|
+
function Xr(e, t) {
|
|
1748
|
+
if (e.trim() === t.trim()) return !0;
|
|
1749
|
+
let n = $(e), r = $(t);
|
|
1750
|
+
return !n || !r ? !1 : Z.every((e, t) => {
|
|
1751
|
+
let i = Vr(n[t], e), a = Vr(r[t], e);
|
|
1752
|
+
return i === void 0 || a === void 0 ? n[t] === r[t] : i.length === a.length && i.every((e, t) => e === a[t]);
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
var Zr = [
|
|
1756
|
+
"*",
|
|
1757
|
+
"*",
|
|
1758
|
+
"*",
|
|
1759
|
+
"*",
|
|
1760
|
+
"*",
|
|
1761
|
+
"*"
|
|
1762
|
+
], Qr = {
|
|
1763
|
+
month: 0,
|
|
1764
|
+
dayOfMonth: 1,
|
|
1765
|
+
dayOfWeek: 1,
|
|
1766
|
+
hour: 2,
|
|
1767
|
+
minute: 3,
|
|
1768
|
+
second: 4
|
|
1769
|
+
};
|
|
1770
|
+
function $r(e, t) {
|
|
1771
|
+
let n = new Set(Yr(t));
|
|
1772
|
+
return Z.map((t, r) => {
|
|
1773
|
+
var i;
|
|
1774
|
+
return n.has(t) ? (i = e[r]) == null ? "*" : i : "*";
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
function ei(e, t) {
|
|
1778
|
+
let n = Qr[t];
|
|
1779
|
+
return Z.map((t, r) => {
|
|
1780
|
+
var i;
|
|
1781
|
+
let a = (i = e[r]) == null ? "*" : i;
|
|
1782
|
+
return t !== "hour" && t !== "minute" && t !== "second" || Qr[t] <= n || !qr(a, t) ? a : Ur([Q[t][0]], t);
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
// src/core/ajv.ts
|
|
1786
|
+
var ti = [
|
|
1787
|
+
"formats",
|
|
1788
|
+
"extendedKeywords",
|
|
1789
|
+
"errorMessages",
|
|
1790
|
+
"allowScriptEvaluation",
|
|
1791
|
+
"i18n",
|
|
1792
|
+
"localizers"
|
|
1793
|
+
], ni = /^(#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|rgba?\(.*\)|hsla?\(.*\)|hsb\(.*\)|transparent)$/i, ri = (e = {}) => {
|
|
1794
|
+
let { formats: t, extendedKeywords: n = !0, errorMessages: i = !0, allowScriptEvaluation: a = !1, i18n: s, localizers: c } = e, l = y(e, ti), u = O(o(o({
|
|
1795
|
+
useDefaults: !0,
|
|
1796
|
+
$data: !0,
|
|
1797
|
+
discriminator: !0
|
|
1798
|
+
}, i ? { allErrors: !0 } : {}), l));
|
|
1799
|
+
u.addFormat("color", {
|
|
1800
|
+
type: "string",
|
|
1801
|
+
validate: (e) => ni.test(e)
|
|
1802
|
+
}), u.addFormat("cron", {
|
|
1803
|
+
type: "string",
|
|
1804
|
+
validate: (e) => Gr(e) === void 0
|
|
1805
|
+
});
|
|
1806
|
+
for (let [e, n] of Object.entries(t == null ? {} : t)) u.addFormat(e, {
|
|
1807
|
+
type: "string",
|
|
1808
|
+
validate: n
|
|
1809
|
+
});
|
|
1810
|
+
if (n && Nr(u, { allowScriptEvaluation: typeof a == "function" ? a : () => a === !0 }), i) {
|
|
1811
|
+
var d;
|
|
1812
|
+
(d = u.opts) != null && d.allErrors ? Be(u) : console.warn("ajv.errorMessagesNeedAllErrors: `errorMessage` support was requested but `allErrors` is off, which ajv-errors requires. Schema-authored messages will not be applied.");
|
|
1813
|
+
}
|
|
1814
|
+
return (s || c) && r(u, {
|
|
1815
|
+
i18n: s,
|
|
1816
|
+
localizers: c
|
|
1817
|
+
}), u;
|
|
1818
|
+
}, ii = (e) => typeof (e == null ? void 0 : e.name) == "string" && e.name !== "", ai = "template.urlRefused", oi = {
|
|
1819
|
+
href: "link",
|
|
1820
|
+
src: "link",
|
|
1821
|
+
srcSet: "image",
|
|
1822
|
+
poster: "image",
|
|
1823
|
+
background: "image",
|
|
1824
|
+
action: "link",
|
|
1825
|
+
formAction: "link",
|
|
1826
|
+
cite: "link",
|
|
1827
|
+
ping: "link",
|
|
1828
|
+
manifest: "link",
|
|
1829
|
+
profile: "link",
|
|
1830
|
+
longDesc: "link",
|
|
1831
|
+
codeBase: "link",
|
|
1832
|
+
classID: "link",
|
|
1833
|
+
xlinkHref: "link"
|
|
1834
|
+
}, si = {
|
|
1835
|
+
href: "link",
|
|
1836
|
+
src: "link",
|
|
1837
|
+
srcset: "image",
|
|
1838
|
+
poster: "image",
|
|
1839
|
+
background: "image",
|
|
1840
|
+
action: "link",
|
|
1841
|
+
formaction: "link",
|
|
1842
|
+
cite: "link",
|
|
1843
|
+
ping: "link",
|
|
1844
|
+
manifest: "link",
|
|
1845
|
+
profile: "link",
|
|
1846
|
+
longdesc: "link",
|
|
1847
|
+
codebase: "link",
|
|
1848
|
+
classid: "link",
|
|
1849
|
+
"xlink:href": "link"
|
|
1850
|
+
}, ci = /* @__PURE__ */ new Set([
|
|
1851
|
+
"img",
|
|
1852
|
+
"image",
|
|
1853
|
+
"source",
|
|
1854
|
+
"input"
|
|
1855
|
+
]), li = (e, t, n) => {
|
|
1856
|
+
if (t !== "src") return n;
|
|
1857
|
+
let r = typeof e == "string" ? e.toLowerCase() : "";
|
|
1858
|
+
return ci.has(r) ? "image" : "link";
|
|
1859
|
+
}, ui = (e, t, n) => t === "image" ? Bt(e, n) : Rt(e, n), di = (e, t) => e === "ping" ? t.split(/\s+/).filter(Boolean) : t.split(",").map((e) => e.trim().split(/\s+/)[0]).filter(Boolean), fi = (e) => e === "srcSet" || e === "srcset" || e === "ping", pi = (e, t, n) => {
|
|
1860
|
+
let r = `${ai}: ${t}=${JSON.stringify(String(n))} is not permitted by the URL policy; the attribute was dropped.`;
|
|
1861
|
+
e ? e(r) : console.warn(r);
|
|
1862
|
+
}, mi = (e, t) => typeof e == "string" || typeof t == "string", hi = (e, t, n, r, i) => {
|
|
1863
|
+
let a = li(e, t, n);
|
|
1864
|
+
return fi(t) && typeof r == "string" ? di(t, r).every((e) => ui(e, a, i)) : ui(r, a, i);
|
|
1865
|
+
}, gi = (e, t, n = J, r) => {
|
|
1866
|
+
var i;
|
|
1867
|
+
if (!t) return t;
|
|
1868
|
+
let a;
|
|
1869
|
+
for (let [i, c] of Object.entries(oi)) {
|
|
1870
|
+
var s;
|
|
1871
|
+
if (!Object.prototype.hasOwnProperty.call(t, i)) continue;
|
|
1872
|
+
let l = t[i];
|
|
1873
|
+
l != null && mi(e, l) && (hi(e, i, c, String(l), n) || (a = (s = a) == null ? o({}, t) : s, delete a[i], pi(r, i, l)));
|
|
1874
|
+
}
|
|
1875
|
+
if (typeof e == "string" && e.toLowerCase() === "object" && typeof t.data == "string" && !Rt(t.data, n)) {
|
|
1876
|
+
var c;
|
|
1877
|
+
a = (c = a) == null ? o({}, t) : c, delete a.data, pi(r, "data", t.data);
|
|
1878
|
+
}
|
|
1879
|
+
return (i = a) == null ? t : i;
|
|
1880
|
+
}, _i = (e, t = J, n) => {
|
|
1881
|
+
var r;
|
|
1882
|
+
if (!e) return 0;
|
|
1883
|
+
let i = 0, a = Object.keys(si), o = a.map((e) => `[${e.replace(":", "\\:")}]`).join(","), s = [...(r = e.matches) != null && r.call(e, o) ? [e] : [], ...Array.from(e.querySelectorAll(o))];
|
|
1884
|
+
for (let e of s) {
|
|
1885
|
+
let r = e.tagName.toLowerCase();
|
|
1886
|
+
for (let o of a) {
|
|
1887
|
+
let a = e.getAttribute(o);
|
|
1888
|
+
a !== null && (hi(r, o, si[o], a, t) || (e.removeAttribute(o), i += 1, pi(n, o, a)));
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
return i;
|
|
1892
|
+
}, vi = Symbol.for("jsonforms.additionalError.owner"), yi = (e) => e[vi] !== void 0, bi = (e) => e[vi], xi = "additionalErrors.noStore", Si = (e) => e.replace(/^\//, "").split("/").join("."), Ci = (e, t) => t === "" || t === "/" ? e : Qe(e, Si(t)), wi = () => {
|
|
1893
|
+
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), n = [], r = () => {
|
|
1894
|
+
let r = [];
|
|
1895
|
+
return e.forEach((e) => r.push(...e.errors)), !$e(r, n) && (n = r, t.forEach((e) => e()), !0);
|
|
1896
|
+
}, i = (t, n, i) => {
|
|
1897
|
+
if (n.length === 0) {
|
|
1898
|
+
e.delete(t) && r();
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
let a = n.map((e) => {
|
|
1902
|
+
let n = o({}, e);
|
|
1903
|
+
return n[vi] = t, n;
|
|
1904
|
+
});
|
|
1905
|
+
e.set(t, {
|
|
1906
|
+
errors: a,
|
|
1907
|
+
clearOnChange: (i == null ? void 0 : i.clearOnChange) !== !1
|
|
1908
|
+
}), r();
|
|
1909
|
+
}, a = (t) => {
|
|
1910
|
+
e.delete(t) && r();
|
|
1911
|
+
}, s = () => {
|
|
1912
|
+
e.size > 0 && (e.clear(), r());
|
|
1913
|
+
}, c = (t, n) => {
|
|
1914
|
+
let i = !1;
|
|
1915
|
+
e.forEach((r, a) => {
|
|
1916
|
+
if (!r.clearOnChange) return;
|
|
1917
|
+
let s = r.errors.filter((e) => {
|
|
1918
|
+
var r, i;
|
|
1919
|
+
return $e(Ci(t, (r = e.instancePath) == null ? "" : r), Ci(n, (i = e.instancePath) == null ? "" : i));
|
|
1920
|
+
});
|
|
1921
|
+
s.length !== r.errors.length && (i = !0, s.length === 0 ? e.delete(a) : e.set(a, o(o({}, r), {}, { errors: s })));
|
|
1922
|
+
}), i && r();
|
|
1923
|
+
};
|
|
1924
|
+
return {
|
|
1925
|
+
publish: i,
|
|
1926
|
+
clear: a,
|
|
1927
|
+
clearAll: s,
|
|
1928
|
+
all: () => n,
|
|
1929
|
+
subscribe: (e) => (t.add(e), () => t.delete(e)),
|
|
1930
|
+
middleware: (e, t, r) => {
|
|
1931
|
+
var i, a;
|
|
1932
|
+
let s = r(e, t);
|
|
1933
|
+
(t == null ? void 0 : t.type) === "jsonforms/UPDATE" && e !== s && c(e == null ? void 0 : e.data, s.data);
|
|
1934
|
+
let l = n, u = ((i = s.additionalErrors) == null ? [] : i).filter((e) => !yi(e)), d = l.length === 0 ? u : [...u, ...l];
|
|
1935
|
+
return d.length === ((a = s.additionalErrors) == null ? [] : a).length && d.every((e, t) => {
|
|
1936
|
+
var n;
|
|
1937
|
+
return e === ((n = s.additionalErrors) == null ? void 0 : n[t]);
|
|
1938
|
+
}) ? s : o(o({}, s), {}, { additionalErrors: d });
|
|
1939
|
+
}
|
|
1940
|
+
};
|
|
1941
|
+
}, Ti = (e) => bi(e), Ei = ge({
|
|
1942
|
+
inert: !0,
|
|
1943
|
+
publish: () => void 0,
|
|
1944
|
+
clear: () => void 0,
|
|
1945
|
+
clearAll: () => void 0,
|
|
1946
|
+
all: () => [],
|
|
1947
|
+
subscribe: () => () => void 0,
|
|
1948
|
+
middleware: (e, t, n) => n(e, t)
|
|
1949
|
+
}), Di = ({ store: e, children: t }) => /* @__PURE__ */ H(Ei.Provider, {
|
|
1950
|
+
value: e,
|
|
1951
|
+
children: t
|
|
1952
|
+
}), Oi = () => ye(Ei), ki = (e, t, n) => {
|
|
1953
|
+
let r = Oi(), i = t.length > 0;
|
|
1954
|
+
L.useEffect(() => {
|
|
1955
|
+
r.inert && i && console.warn(`${xi}: ${JSON.stringify(e)} has errors to publish, but this form installed no additional-error store, so they will not appear. Render the form with <ExtendedJsonForms>, or pass useAdditionalErrorProps(store) to <JsonForms> and wrap it in <AdditionalErrorStoreProvider>.`);
|
|
1956
|
+
}, [
|
|
1957
|
+
r,
|
|
1958
|
+
e,
|
|
1959
|
+
i
|
|
1960
|
+
]);
|
|
1961
|
+
let a = xe({
|
|
1962
|
+
errors: t,
|
|
1963
|
+
options: n
|
|
1964
|
+
});
|
|
1965
|
+
be(() => {
|
|
1966
|
+
a.current = {
|
|
1967
|
+
errors: t,
|
|
1968
|
+
options: n
|
|
1969
|
+
};
|
|
1970
|
+
}, [t, n]);
|
|
1971
|
+
let o = t.map((e) => `${e.instancePath}|${e.keyword}|${e.message}`).join("\0"), s = (n == null ? void 0 : n.clearOnChange) !== !1;
|
|
1972
|
+
L.useEffect(() => {
|
|
1973
|
+
r.publish(e, a.current.errors, a.current.options);
|
|
1974
|
+
}, [
|
|
1975
|
+
r,
|
|
1976
|
+
e,
|
|
1977
|
+
o,
|
|
1978
|
+
s
|
|
1979
|
+
]), L.useEffect(() => () => {
|
|
1980
|
+
r.clear(e);
|
|
1981
|
+
}, [r, e]);
|
|
1982
|
+
}, Ai = () => {
|
|
1983
|
+
let e = Oi();
|
|
1984
|
+
return L.useSyncExternalStore(e.subscribe, e.all, e.all);
|
|
1985
|
+
}, ji = ["readOnly"], Mi = (e) => {
|
|
1986
|
+
if (Array.isArray(e)) return e.map(Mi);
|
|
1987
|
+
if (typeof e != "object" || !e || Object.getPrototypeOf(e) !== Object.prototype) return e;
|
|
1988
|
+
let t = Object.entries(e), n = !1, r = {};
|
|
1989
|
+
for (let [i, a] of t) if (i === "options" && typeof e.type == "string" && a && typeof a == "object" && !Array.isArray(a) && Object.prototype.hasOwnProperty.call(a, "readOnly")) {
|
|
1990
|
+
let { readOnly: e } = a;
|
|
1991
|
+
r[i] = Mi(y(a, ji)), n = !0;
|
|
1992
|
+
} else {
|
|
1993
|
+
let e = Mi(a);
|
|
1994
|
+
r[i] = e, n || (n = e !== a);
|
|
1995
|
+
}
|
|
1996
|
+
return n ? r : e;
|
|
1997
|
+
}, Ni = (e) => e && Object.prototype.hasOwnProperty.call(e, "readOnly") ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== "readOnly")) : e, Pi = ({ store: e }) => {
|
|
1998
|
+
let t = F(), n = t.dispatch, r = xe(t.core);
|
|
1999
|
+
return be(() => {
|
|
2000
|
+
r.current = t.core;
|
|
2001
|
+
}, [t.core]), R(() => {
|
|
2002
|
+
if (n) return e.subscribe(() => {
|
|
2003
|
+
let e = r.current;
|
|
2004
|
+
e && n(C.updateCore(e.data, e.schema, e.uischema, {
|
|
2005
|
+
ajv: e.ajv,
|
|
2006
|
+
validationMode: e.validationMode
|
|
2007
|
+
}));
|
|
2008
|
+
});
|
|
2009
|
+
}, [e, n]), null;
|
|
2010
|
+
}, Fi = ({ external: e, store: t, onAction: n, ajv: r, data: i, schema: a, uischema: o, renderers: s, cells: c, config: l, uischemas: u, readonly: d, validationMode: f, i18n: p, additionalErrors: m, middleware: h, onChange: g }) => {
|
|
2011
|
+
let [_] = B(wi), v = Oi(), y = Yt(), b = t == null ? v.inert ? _ : v : t, x = z(() => a === void 0 ? w.jsonSchema(i) : a, [a, i]), S = z(() => typeof o == "object" ? Mi(o) : w.uiSchema(x, void 0, void 0, x), [o, x]), C = z(() => h ? (e, t, n) => b.middleware(e, t, ((e, t) => h(e, t, n))) : b.middleware, [b, h]), T = z(() => Ni(l), [l]), E = z(() => De(s), [s]), D = z(() => Ee(c), [c]), O = /* @__PURE__ */ U(de, {
|
|
2012
|
+
initState: {
|
|
2013
|
+
core: {
|
|
2014
|
+
ajv: r,
|
|
2015
|
+
data: i,
|
|
2016
|
+
schema: x,
|
|
2017
|
+
uischema: S,
|
|
2018
|
+
validationMode: f,
|
|
2019
|
+
additionalErrors: m
|
|
2020
|
+
},
|
|
2021
|
+
config: T,
|
|
2022
|
+
uischemas: u,
|
|
2023
|
+
renderers: E,
|
|
2024
|
+
cells: D,
|
|
2025
|
+
readonly: d,
|
|
2026
|
+
i18n: p
|
|
2027
|
+
},
|
|
2028
|
+
onChange: g,
|
|
2029
|
+
middleware: C,
|
|
2030
|
+
children: [/* @__PURE__ */ H(Pi, { store: b }), /* @__PURE__ */ H(P, {})]
|
|
2031
|
+
}), k = /* @__PURE__ */ H(Di, {
|
|
2032
|
+
store: b,
|
|
2033
|
+
children: /* @__PURE__ */ H(Se, {
|
|
2034
|
+
config: l,
|
|
2035
|
+
external: e,
|
|
2036
|
+
locale: p == null ? void 0 : p.locale,
|
|
2037
|
+
translate: p == null ? void 0 : p.translate,
|
|
2038
|
+
children: O
|
|
2039
|
+
})
|
|
2040
|
+
}), A = n == null ? y : n;
|
|
2041
|
+
return A === y ? k : /* @__PURE__ */ H(Jt.Provider, {
|
|
2042
|
+
value: A,
|
|
2043
|
+
children: k
|
|
2044
|
+
});
|
|
2045
|
+
}, Ii = "editor.language", Li = 8, Ri = (e) => (e == null ? [] : e).filter((e) => {
|
|
2046
|
+
var t;
|
|
2047
|
+
return ((t = e == null ? void 0 : e.severity) == null ? 0 : t) >= 8;
|
|
2048
|
+
}).length, zi = (e, t) => {
|
|
2049
|
+
let n = e == null ? void 0 : e.propagateErrors;
|
|
2050
|
+
if (n !== void 0) return n === !0;
|
|
2051
|
+
let r = u(t);
|
|
2052
|
+
return (r == null ? void 0 : r.propagateErrors) !== void 0 && r.propagateErrors === !0;
|
|
2053
|
+
}, Bi = (e) => e ? `/${e.split(".").join("/")}` : "", Vi = ({ owner: e, path: t, language: n, errorCount: r, message: i }) => ({
|
|
2054
|
+
instancePath: Bi(t),
|
|
2055
|
+
schemaPath: "",
|
|
2056
|
+
keyword: Ii,
|
|
2057
|
+
message: i,
|
|
2058
|
+
params: {
|
|
2059
|
+
source: "monaco",
|
|
2060
|
+
language: n,
|
|
2061
|
+
errorCount: r,
|
|
2062
|
+
owner: e
|
|
2063
|
+
}
|
|
2064
|
+
}), Hi = M(3, E(ae, se(te("color"), j("format", "color")))), Ui = M(3, E(ae, se(te("duration"), j("format", "duration")))), Wi = M(3, E(N("Control"), le("null"))), Gi = (e) => typeof e == "string" ? /^#[a-f\d]{6}$/i.test(e) ? e : /^#[a-f\d]{3}$/i.test(e) ? "#" + Array.from(e.slice(1), (e) => e + e).join("") : /^#[a-f\d]{8}$/i.test(e) ? e.slice(0, 7) : "#000000" : "#000000", Ki = (e) => {
|
|
2065
|
+
var t;
|
|
2066
|
+
let n = b(), r = typeof e.data == "string" ? e.data : "", [i, a] = B(!1), [s, c] = B(""), [l, u] = B(), [d, f] = B(!1), p = o(o({}, e.config), e.uischema.options), m = p.showActions !== !1, h = !e.enabled || !!e.readonly, g = r.trim() === "" ? void 0 : Gr(r), _ = g ? n(`cron.error.${g}`) : "", v = (t) => {
|
|
2067
|
+
h || Xr(t, r) || e.handleChange(e.path, t);
|
|
2068
|
+
}, y = (t = $(s)) == null ? Zr : t, x = (e) => {
|
|
2069
|
+
c(e), f(!0), m || v(e);
|
|
2070
|
+
}, S = (e, t) => {
|
|
2071
|
+
let n = [...y], r = t.trim() !== "" && t !== "*";
|
|
2072
|
+
n[Z.indexOf(e)] = r ? t : "*", x(zr(r ? ei(n, e) : n));
|
|
2073
|
+
}, C = (e) => {
|
|
2074
|
+
let t = $(e);
|
|
2075
|
+
t && u(Jr(t)), x(e);
|
|
2076
|
+
}, w = (e) => {
|
|
2077
|
+
h || e === l || (u(e), e === "second" ? x(zr(Zr)) : $(s) && x(zr($r(y, e))));
|
|
2078
|
+
}, T = s.trim() === "" ? void 0 : Gr(s), E = l ? Yr(l) : [];
|
|
2079
|
+
return {
|
|
2080
|
+
label: n,
|
|
2081
|
+
expression: r,
|
|
2082
|
+
open: i,
|
|
2083
|
+
setOpen: a,
|
|
2084
|
+
text: s,
|
|
2085
|
+
period: l,
|
|
2086
|
+
options: p,
|
|
2087
|
+
showActions: m,
|
|
2088
|
+
disabled: h,
|
|
2089
|
+
localError: _,
|
|
2090
|
+
draft: y,
|
|
2091
|
+
changeField: S,
|
|
2092
|
+
changeText: C,
|
|
2093
|
+
changePeriod: w,
|
|
2094
|
+
editedProblem: T,
|
|
2095
|
+
shownFields: E,
|
|
2096
|
+
hasCustomField: E.some((e) => {
|
|
2097
|
+
var t;
|
|
2098
|
+
return Vr((t = y[Z.indexOf(e)]) == null ? "*" : t, e) === void 0;
|
|
2099
|
+
}),
|
|
2100
|
+
openOn: (e) => {
|
|
2101
|
+
if (!h) {
|
|
2102
|
+
if (e) {
|
|
2103
|
+
let e = $(r);
|
|
2104
|
+
c(r), u(e ? Jr(e) : void 0), f(!1);
|
|
2105
|
+
}
|
|
2106
|
+
a(e);
|
|
2107
|
+
}
|
|
2108
|
+
},
|
|
2109
|
+
accept: () => {
|
|
2110
|
+
d && v(s), a(!1);
|
|
2111
|
+
}
|
|
2112
|
+
};
|
|
2113
|
+
}, qi = {
|
|
2114
|
+
weeks: 0,
|
|
2115
|
+
years: 0,
|
|
2116
|
+
months: 0,
|
|
2117
|
+
days: 0,
|
|
2118
|
+
hours: 0,
|
|
2119
|
+
minutes: 0,
|
|
2120
|
+
seconds: 0
|
|
2121
|
+
}, Ji = Object.keys(qi), Yi = Ji.filter((e) => e !== "weeks"), Xi = (e) => typeof e == "string" && /^P\d+W$/i.test(e.trim()), Zi = "hours", Qi = 9007199254740991, $i = (e) => {
|
|
2122
|
+
if (typeof e != "string") return null;
|
|
2123
|
+
let t = e.trim(), n = /^P(\d+)W$/i.exec(t);
|
|
2124
|
+
if (n) return o(o({}, qi), {}, { weeks: Number(n[1]) });
|
|
2125
|
+
let r = /^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/i.exec(t);
|
|
2126
|
+
if (!r || !r.slice(1).some(Boolean) || /T$/i.test(t)) return null;
|
|
2127
|
+
let [, i, a, s, c, l, u] = r, d = {
|
|
2128
|
+
weeks: 0,
|
|
2129
|
+
years: Number(i || 0),
|
|
2130
|
+
months: Number(a || 0),
|
|
2131
|
+
days: Number(s || 0),
|
|
2132
|
+
hours: Number(c || 0),
|
|
2133
|
+
minutes: Number(l || 0),
|
|
2134
|
+
seconds: Number(u || 0)
|
|
2135
|
+
};
|
|
2136
|
+
return Object.values(d).every(Number.isFinite) ? d : null;
|
|
2137
|
+
}, ea = (e) => {
|
|
2138
|
+
let t = Object.fromEntries(Object.entries(e).map(([e, t]) => [e, Number.isFinite(t) ? Math.max(0, Math.floor(t)) : 0]));
|
|
2139
|
+
return t.weeks ? `P${t.weeks}W` : rt(t);
|
|
2140
|
+
}, ta = (e) => {
|
|
2141
|
+
let t = K(), [n, r] = B(!1), [i, a] = B(o({}, qi)), [s, c] = B([]), [l, u] = B("components"), d = o(o({}, e.config), e.uischema.options), f = !e.enabled || !!e.readonly, p = typeof e.data == "string" ? e.data : "", m = (t) => {
|
|
2142
|
+
f || e.handleChange(e.path, t);
|
|
2143
|
+
}, h = (e) => {
|
|
2144
|
+
let t = $i(p);
|
|
2145
|
+
return t !== null && Ji.every((n) => t[n] === e[n]);
|
|
2146
|
+
}, g = (e) => {
|
|
2147
|
+
h(e) || m(ea(e));
|
|
2148
|
+
}, _ = (e) => {
|
|
2149
|
+
d.showActions === !1 && g(e);
|
|
2150
|
+
}, v = l === "weeks" ? ["weeks"] : Yi.filter((e) => s.includes(e)), y = (e) => {
|
|
2151
|
+
let t = Yi.filter((t) => e[t] > 0);
|
|
2152
|
+
return t.length ? t : [Zi];
|
|
2153
|
+
};
|
|
2154
|
+
return {
|
|
2155
|
+
open: n,
|
|
2156
|
+
draft: i,
|
|
2157
|
+
options: d,
|
|
2158
|
+
disabled: f,
|
|
2159
|
+
value: p,
|
|
2160
|
+
mode: l,
|
|
2161
|
+
activeFields: v,
|
|
2162
|
+
addableFields: l === "weeks" ? [] : Yi.filter((e) => !s.includes(e)),
|
|
2163
|
+
error: e.errors || (p && !$i(p) ? t("duration.invalid") : ""),
|
|
2164
|
+
showActions: d.showActions !== !1,
|
|
2165
|
+
openPicker: () => {
|
|
2166
|
+
if (!f) {
|
|
2167
|
+
var e;
|
|
2168
|
+
let t = (e = $i(p)) == null ? o({}, qi) : e;
|
|
2169
|
+
a(t), u(Xi(p) ? "weeks" : "components"), c(y(t)), r(!0);
|
|
2170
|
+
}
|
|
2171
|
+
},
|
|
2172
|
+
close: () => r(!1),
|
|
2173
|
+
apply: () => {
|
|
2174
|
+
g(i), r(!1);
|
|
2175
|
+
},
|
|
2176
|
+
changeText: (e) => m(e || void 0),
|
|
2177
|
+
setMode: (e) => {
|
|
2178
|
+
if (f || e === l) return;
|
|
2179
|
+
let t = o({}, qi);
|
|
2180
|
+
u(e), a(t), c(e === "weeks" ? [] : y(t)), _(t);
|
|
2181
|
+
},
|
|
2182
|
+
addField: (e) => {
|
|
2183
|
+
f || e === "weeks" || c((t) => t.includes(e) ? t : [...t, e]);
|
|
2184
|
+
},
|
|
2185
|
+
removeField: (e) => {
|
|
2186
|
+
if (f) return;
|
|
2187
|
+
c((t) => {
|
|
2188
|
+
let n = t.filter((t) => t !== e);
|
|
2189
|
+
return n.length ? n : [Zi];
|
|
2190
|
+
});
|
|
2191
|
+
let t = o(o({}, i), {}, { [e]: 0 });
|
|
2192
|
+
a(t), _(t);
|
|
2193
|
+
},
|
|
2194
|
+
changePart: (e, t) => {
|
|
2195
|
+
if (f) return;
|
|
2196
|
+
let n = o(o({}, i), {}, { [e]: Math.max(0, Math.min(Qi, Math.floor(t || 0))) });
|
|
2197
|
+
a(n), _(n);
|
|
2198
|
+
}
|
|
2199
|
+
};
|
|
2200
|
+
}, na = M(25, E(N("Control"), j("format", "code"), se(E(ae, (e) => {
|
|
2201
|
+
var t, n;
|
|
2202
|
+
return typeof ((t = e.options) == null ? void 0 : t.language) == "string" || typeof ((n = e.options) == null ? void 0 : n[":language"]) == "string";
|
|
2203
|
+
}), E(j("language", "json"), j("convertJson", !0))))), ra = M(25, E(N("Control"), le("array"), j("variant", "ag-grid"))), ia = (e, t) => {
|
|
2204
|
+
let n = typeof e[":language"] == "string" ? T.data(t, e[":language"]) : void 0;
|
|
2205
|
+
return typeof n == "string" && n ? n : e.language || "plaintext";
|
|
2206
|
+
}, aa = (e, t) => e == null ? "" : t ? JSON.stringify(e, null, 2) : String(e), oa = (e, t) => {
|
|
2207
|
+
if (!t) return {
|
|
2208
|
+
valid: !0,
|
|
2209
|
+
value: e || void 0
|
|
2210
|
+
};
|
|
2211
|
+
try {
|
|
2212
|
+
return {
|
|
2213
|
+
valid: !0,
|
|
2214
|
+
value: JSON.parse(e)
|
|
2215
|
+
};
|
|
2216
|
+
} catch (t) {
|
|
2217
|
+
return {
|
|
2218
|
+
valid: !1,
|
|
2219
|
+
value: e
|
|
2220
|
+
};
|
|
2221
|
+
}
|
|
2222
|
+
}, sa = (e, t, n) => {
|
|
2223
|
+
let [r, i] = B(!1);
|
|
2224
|
+
return R(() => {
|
|
2225
|
+
var t, n;
|
|
2226
|
+
let r = e.current;
|
|
2227
|
+
if (!r) return;
|
|
2228
|
+
let a = [], o = r;
|
|
2229
|
+
for (; o;) {
|
|
2230
|
+
var s;
|
|
2231
|
+
a.push(o);
|
|
2232
|
+
let e = o.getRootNode();
|
|
2233
|
+
o = (s = o.parentElement) == null ? e instanceof ShadowRoot ? e.host : null : s;
|
|
2234
|
+
}
|
|
2235
|
+
let c = (t = (n = window).matchMedia) == null ? void 0 : t.call(n, "(prefers-color-scheme: dark)"), l = () => {
|
|
2236
|
+
for (let t of a) {
|
|
2237
|
+
var e;
|
|
2238
|
+
let n = (e = getComputedStyle(t).backgroundColor.match(/[\d.]+/g)) == null ? void 0 : e.map(Number);
|
|
2239
|
+
if (n && n.length >= 3 && (n.length < 4 || n[3] > .5)) {
|
|
2240
|
+
i(n[0] * .299 + n[1] * .587 + n[2] * .114 < 128);
|
|
2241
|
+
return;
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
i(!!(c != null && c.matches));
|
|
2245
|
+
}, u = new MutationObserver(l);
|
|
2246
|
+
return a.forEach((e) => u.observe(e, {
|
|
2247
|
+
attributes: !0,
|
|
2248
|
+
attributeFilter: [
|
|
2249
|
+
"class",
|
|
2250
|
+
"style",
|
|
2251
|
+
"mode",
|
|
2252
|
+
"dark"
|
|
2253
|
+
]
|
|
2254
|
+
})), c == null || c.addEventListener("change", l), l(), () => {
|
|
2255
|
+
u.disconnect(), c == null || c.removeEventListener("change", l);
|
|
2256
|
+
};
|
|
2257
|
+
}, [e]), {
|
|
2258
|
+
customTheme: t && ![
|
|
2259
|
+
"light",
|
|
2260
|
+
"dark",
|
|
2261
|
+
"system"
|
|
2262
|
+
].includes(t) ? t : void 0,
|
|
2263
|
+
isDark: t === "dark" ? !0 : t === "light" ? !1 : t !== "system" && n !== void 0 ? n : r
|
|
2264
|
+
};
|
|
2265
|
+
}, ca = (e) => fe(Rn(q(function* () {
|
|
2266
|
+
return (yield import("./MonacoControlRenderer.impl-CyjMHbOd.mjs")).createMonacoControl(e);
|
|
2267
|
+
}), e, {
|
|
2268
|
+
loading: "editor.loading",
|
|
2269
|
+
error: "editor.loadError"
|
|
2270
|
+
})), la = (e) => Rn(q(function* () {
|
|
2271
|
+
return (yield import("./AgGridControlRenderer.impl-BZS8_ocu.mjs")).createAgGridControl(e);
|
|
2272
|
+
}), e, {
|
|
2273
|
+
loading: "grid.loading",
|
|
2274
|
+
error: "grid.loadError"
|
|
2275
|
+
}), ua = (e) => fe(la(e)), da = (e) => {
|
|
2276
|
+
var t;
|
|
2277
|
+
let n = e && "components" in e ? e : { components: e }, r = n.components, i = (t = n.includeButtonRenderer) == null || t, a = I((e) => /* @__PURE__ */ L.createElement(Wt, o(o({}, e), {}, { components: r })));
|
|
2278
|
+
return [
|
|
2279
|
+
{
|
|
2280
|
+
tester: at,
|
|
2281
|
+
renderer: lt
|
|
2282
|
+
},
|
|
2283
|
+
{
|
|
2284
|
+
tester: hn,
|
|
2285
|
+
renderer: bn
|
|
2286
|
+
},
|
|
2287
|
+
{
|
|
2288
|
+
tester: xn,
|
|
2289
|
+
renderer: Dn
|
|
2290
|
+
},
|
|
2291
|
+
{
|
|
2292
|
+
tester: On,
|
|
2293
|
+
renderer: An
|
|
2294
|
+
},
|
|
2295
|
+
{
|
|
2296
|
+
tester: jn,
|
|
2297
|
+
renderer: Pn
|
|
2298
|
+
},
|
|
2299
|
+
{
|
|
2300
|
+
tester: $n,
|
|
2301
|
+
renderer: rr
|
|
2302
|
+
},
|
|
2303
|
+
...i ? [{
|
|
2304
|
+
tester: nn,
|
|
2305
|
+
renderer: on
|
|
2306
|
+
}] : [],
|
|
2307
|
+
{
|
|
2308
|
+
tester: Xt,
|
|
2309
|
+
renderer: en
|
|
2310
|
+
},
|
|
2311
|
+
{
|
|
2312
|
+
tester: xt("jsx"),
|
|
2313
|
+
renderer: a
|
|
2314
|
+
},
|
|
2315
|
+
{
|
|
2316
|
+
tester: xt("ractive"),
|
|
2317
|
+
renderer: I(qt)
|
|
2318
|
+
},
|
|
2319
|
+
{
|
|
2320
|
+
tester: St,
|
|
2321
|
+
renderer: I(wt)
|
|
2322
|
+
},
|
|
2323
|
+
{
|
|
2324
|
+
tester: ln,
|
|
2325
|
+
renderer: dn
|
|
2326
|
+
},
|
|
2327
|
+
{
|
|
2328
|
+
tester: fn,
|
|
2329
|
+
renderer: mn
|
|
2330
|
+
}
|
|
2331
|
+
];
|
|
2332
|
+
};
|
|
2333
|
+
export { Di as AdditionalErrorStoreProvider, on as ButtonRenderer, Z as CRON_FIELDS, Fr as DAY_NAMES, Pr as DEFAULT_CRON, Wn as DYNAMIC_NAMESPACES, Ii as EDITOR_DIAGNOSTIC_KEYWORD, Fi as ExtendedJsonForms, Q as FIELD_RANGE, yr as GenericAdditionalProperties, ur as GenericMixedRenderer, or as GenericMixedRendererComponent, dr as HORIZONTAL_COLUMNS, Jt as HandleActionContext, gr as HorizontalColumnsLayoutRenderer, hr as HorizontalColumnsLayoutRendererComponent, Dn as ImageViewRenderer, En as ImageViewRendererComponent, d as JSONFORMS_CONFIG_KEY, l as JSONFORMS_EXTENDED_CONFIG_KEY, Pn as LinkRenderer, Nn as LinkRendererComponent, Li as MONACO_SEVERITY_ERROR, Ir as MONTH_NAMES, rr as MarkupLabelRenderer, nr as MarkupLabelRendererComponent, Zr as NOTHING_CHOSEN, xi as NO_STORE_DIAGNOSTIC, Kn as RESERVED_TEXT_NAMES, s as SCHEMA_MESSAGE, An as SeparatorRenderer, kn as SeparatorRendererComponent, ct as SharedSplitLayout, lt as SharedSplitLayoutRenderer, mn as SlotRenderer, pn as SlotRendererComponent, bn as SpacerRenderer, yn as SpacerRendererComponent, it as TRUST_DYNAMIC_FUNCTIONS, Wt as TemplateLayoutRenderer, dn as TemplateRenderer, un as TemplateRendererComponent, sn as TemplateSlotsContext, en as TsxTemplateLayoutRenderer, $t as TsxTemplateLayoutRendererComponent, ai as URL_REFUSED_DIAGNOSTIC, Ti as additionalErrorOwner, r as ajvTranslations, Et as bgExtendedLocale, Gn as buildNamespaceScope, qn as buildTextScope, nn as buttonRendererTester, Mi as canonicalUiOptions, Gi as colorPickerValue, Ri as countBlockingMarkers, wi as createAdditionalErrorStore, la as createAgGridControl, ua as createAgGridControlRenderer, a as createAjvErrorTranslator, an as createButtonRenderer, da as createExtendedRenderers, ri as createFormsAjv, ir as createMarkupLabelRenderer, ca as createMonacoControlRenderer, Gr as cronProblem, jr as dateOffset, Mr as dateUnit, kr as datetimeOffset, oa as decodeEditorValue, Dt as defaultExtendedLocales, J as defaultUrlPolicy, Yi as durationComponentFields, Qi as durationFieldMax, Ji as durationFields, Un as dynamicValuesEnabled, Vi as editorSummaryError, qi as emptyDurationParts, aa as encodeEditorValue, v as escapeMarkdown, ra as extendedAgGridTester, Hi as extendedColorTester, u as extendedConfig, Nt as extendedDefault, Ui as extendedDurationTester, Tt as extendedI18nDefaults, et as extendedMaskTester, Wi as extendedNullTester, xr as extendedTransformKeyword, Yr as fieldsForPeriod, ea as formatExtendedDuration, Ur as formatField, lr as genericMixedControlTester, kt as getExtendedLocales, Bn as hasExpressions, tt as hasMaskPattern, cn as hasTemplateName, mr as horizontalColumnsLayoutTester, pr as horizontalLayoutWidths, xn as imageViewRendererTester, st as initialSplitSizes, Bt as isAllowedImageUrl, Rt as isAllowedUrl, qr as isEvery, nt as isMaskPattern, cr as isMixedControl, sr as isMixedSchema, ii as isNamedUISchemaElement, fr as isValidColumns, Xi as isWeeksDuration, zr as joinCron, Hr as labelFor, Mn as linkRel, jn as linkRendererTester, n as localizeBg, Vn as looksLikeMustache, Tr as makeDynamic, h as markdownEnabled, _ as markdownProfile, $n as markupLabelTester, na as monacoControlTester, ln as namedTemplateTester, $i as parseExtendedDuration, Vr as parseField, Jr as periodOf, Bi as pointerFor, Nr as registerAjvKeywords, jt as registerExtendedLocale, Jn as reservedParamNames, ia as resolveEditorLanguage, Mt as resolveExtendedLocale, c as resolveExtendedOption, Cn as resolveImageView, m as resolveMarkup, zi as resolvePropagateErrors, Y as resolveUrlPolicy, Xr as sameExpression, _i as sanitizeUrlAttributes, gi as sanitizeUrlProps, ar as schemaForType, e as schemaMessageKey, Er as searchParams, On as separatorRendererTester, Ot as setExtendedLocales, at as sharedSplitLayoutTester, fn as slotRendererTester, hn as spacerRendererTester, $ as splitCron, ot as splitCssSize, zn as splitTemplate, $r as standDown, Ht as templateRendererTester, Ar as timeOffset, Xt as tsxTemplateLayoutTester, p as typographyEnabled, i as unwrapErrorMessageErrors, Oi as useAdditionalErrorStore, Ai as useAdditionalErrors, Ki as useCronPicker, ta as useDurationControl, sa as useEditorAppearance, K as useExtendedTranslator, Yt as useHandleAction, ki as useOwnedAdditionalErrors, Yn as wantsInterpolation, g as wantsMarkup, ei as withTimeDefaults };
|
|
2334
|
+
|
|
2335
|
+
//# sourceMappingURL=jsonforms-react-extended.esm.js.map
|