@skopon-cool/form-sdk 0.1.8 → 0.1.9
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/dist/adapter/formSchema.d.ts.map +1 -1
- package/dist/blocks/case_multiselect/adapter.d.ts.map +1 -1
- package/dist/blocks/resume_multiselect/adapter.d.ts.map +1 -1
- package/dist/catalog/skoponCaseSelect.d.ts.map +1 -1
- package/dist/catalog/skoponResumeSelect.d.ts.map +1 -1
- package/dist/catalog/useSkoponBoundField.d.ts +5 -0
- package/dist/catalog/useSkoponBoundField.d.ts.map +1 -1
- package/dist/index.js +901 -1754
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
1
|
+
import './form-sdk.css';
|
|
2
|
+
import { jsx as s, jsxs as C, Fragment as Ye } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as ze, useContext as Re, useCallback as Q, useSyncExternalStore as Nt, useMemo as B, useState as U, useRef as q, useEffect as j, forwardRef as It, useImperativeHandle as Mt } from "react";
|
|
4
|
+
import { Spin as Oe, Button as fe, Typography as D, Avatar as Ft, Tag as te, Select as Fe, Checkbox as Pt, Radio as Ut, Switch as _t, TimePicker as Et, DatePicker as zt, Upload as Se, Input as xe, InputNumber as Rt, Tooltip as ee } from "antd";
|
|
5
|
+
import { ReloadOutlined as Xe, FileTextOutlined as Ge, UserOutlined as Ot, FileImageOutlined as Bt, FileExcelOutlined as Vt, FileOutlined as We, PictureOutlined as wt, SoundOutlined as qt, VideoCameraOutlined as jt } from "@ant-design/icons";
|
|
6
|
+
import { createBinderlessComponentImplementation as V, basicCatalog as ue, A2uiSurface as Ze } from "@a2ui/react/v0_9";
|
|
7
|
+
import { z as d } from "zod";
|
|
8
|
+
import { Catalog as $t, MessageProcessor as Qe } from "@a2ui/web_core/v0_9";
|
|
9
|
+
import { injectBasicCatalogStyles as et } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
10
|
+
import { injectStyles as tt } from "@a2ui/react/styles";
|
|
11
|
+
import $e from "dayjs";
|
|
12
|
+
const oo = "v0.9", Lt = [
|
|
10
13
|
"huge",
|
|
11
14
|
"large",
|
|
12
15
|
"medium",
|
|
13
16
|
"small",
|
|
14
17
|
"icon"
|
|
15
18
|
];
|
|
16
|
-
function
|
|
19
|
+
function Pe(e) {
|
|
17
20
|
return e === "image" || e === "video" || e === "audio";
|
|
18
21
|
}
|
|
19
|
-
function
|
|
22
|
+
function Be(e) {
|
|
20
23
|
return e === "heading" || e === "paragraph";
|
|
21
24
|
}
|
|
22
25
|
function X(e) {
|
|
23
|
-
return !
|
|
26
|
+
return !Be(e) && !Pe(e);
|
|
24
27
|
}
|
|
25
|
-
function
|
|
28
|
+
function Dt() {
|
|
26
29
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
27
30
|
return crypto.randomUUID();
|
|
28
31
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
@@ -36,11 +39,11 @@ function Zt() {
|
|
|
36
39
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
37
40
|
});
|
|
38
41
|
}
|
|
39
|
-
function
|
|
40
|
-
const t =
|
|
42
|
+
function re(e) {
|
|
43
|
+
const t = Dt().replace(/-/g, "").slice(0, 8);
|
|
41
44
|
return `${e}${t}`;
|
|
42
45
|
}
|
|
43
|
-
const
|
|
46
|
+
const nt = [
|
|
44
47
|
{ value: "image/*", label: "图片" },
|
|
45
48
|
{ value: "video/*", label: "视频" },
|
|
46
49
|
{ value: "audio/*", label: "音频" },
|
|
@@ -51,7 +54,7 @@ const lt = [
|
|
|
51
54
|
{ value: "text/plain", label: "纯文本" },
|
|
52
55
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
53
56
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
54
|
-
],
|
|
57
|
+
], Kt = {
|
|
55
58
|
"image/*": ["image/*"],
|
|
56
59
|
"video/*": ["video/*"],
|
|
57
60
|
"audio/*": ["audio/*"],
|
|
@@ -71,7 +74,7 @@ const lt = [
|
|
|
71
74
|
"text/plain": ["text/plain"],
|
|
72
75
|
"application/zip": ["application/zip"],
|
|
73
76
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
74
|
-
},
|
|
77
|
+
}, Jt = {
|
|
75
78
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
76
79
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
77
80
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -82,14 +85,14 @@ const lt = [
|
|
|
82
85
|
"text/plain": [".txt"],
|
|
83
86
|
"application/zip": [".zip", ".7z"],
|
|
84
87
|
"application/x-rar-compressed": [".rar"]
|
|
85
|
-
},
|
|
88
|
+
}, Ht = {
|
|
86
89
|
"application/msword": "office/word",
|
|
87
90
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
88
91
|
"application/vnd.ms-excel": "office/excel",
|
|
89
92
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
|
|
90
93
|
"application/vnd.ms-powerpoint": "office/ppt",
|
|
91
94
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
|
|
92
|
-
},
|
|
95
|
+
}, Ve = [
|
|
93
96
|
{ value: ".jpg", label: ".jpg" },
|
|
94
97
|
{ value: ".jpeg", label: ".jpeg" },
|
|
95
98
|
{ value: ".png", label: ".png" },
|
|
@@ -115,121 +118,121 @@ const lt = [
|
|
|
115
118
|
{ value: ".zip", label: ".zip" },
|
|
116
119
|
{ value: ".rar", label: ".rar" },
|
|
117
120
|
{ value: ".7z", label: ".7z" }
|
|
118
|
-
],
|
|
119
|
-
|
|
120
|
-
),
|
|
121
|
-
|
|
122
|
-
),
|
|
123
|
-
|
|
121
|
+
], Yt = Object.fromEntries(
|
|
122
|
+
nt.map((e) => [e.value, e.label])
|
|
123
|
+
), Xt = Object.fromEntries(
|
|
124
|
+
Ve.map((e) => [e.value, e.label])
|
|
125
|
+
), Gt = new Set(nt.map((e) => e.value)), Wt = new Set(
|
|
126
|
+
Ve.map((e) => e.value)
|
|
124
127
|
);
|
|
125
|
-
function
|
|
128
|
+
function Zt(e) {
|
|
126
129
|
const t = e.trim();
|
|
127
|
-
return t ?
|
|
130
|
+
return t ? Gt.has(t) ? t : Ht[t] ?? null : null;
|
|
128
131
|
}
|
|
129
|
-
function
|
|
132
|
+
function Qt(e) {
|
|
130
133
|
return Array.isArray(e) ? e.map((t) => {
|
|
131
134
|
const n = t.trim().toLowerCase();
|
|
132
135
|
return n ? n.startsWith(".") ? n : `.${n}` : "";
|
|
133
136
|
}).filter(Boolean) : [];
|
|
134
137
|
}
|
|
135
|
-
function
|
|
138
|
+
function oe(e) {
|
|
136
139
|
if (!Array.isArray(e)) return [];
|
|
137
140
|
const t = [], n = /* @__PURE__ */ new Set();
|
|
138
141
|
for (const r of e) {
|
|
139
|
-
const o =
|
|
142
|
+
const o = Zt(r);
|
|
140
143
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
141
144
|
}
|
|
142
145
|
return t;
|
|
143
146
|
}
|
|
144
|
-
function
|
|
145
|
-
const t =
|
|
147
|
+
function en(e) {
|
|
148
|
+
const t = oe(e), n = [];
|
|
146
149
|
for (const r of t)
|
|
147
|
-
n.push(...
|
|
150
|
+
n.push(...Kt[r] ?? [r]);
|
|
148
151
|
return n;
|
|
149
152
|
}
|
|
150
|
-
function
|
|
151
|
-
const t =
|
|
153
|
+
function tn(e) {
|
|
154
|
+
const t = oe(e);
|
|
152
155
|
if (t.length === 0) return [];
|
|
153
156
|
const n = /* @__PURE__ */ new Set();
|
|
154
157
|
for (const r of t)
|
|
155
|
-
for (const o of
|
|
158
|
+
for (const o of Jt[r] ?? [])
|
|
156
159
|
n.add(o);
|
|
157
|
-
return
|
|
160
|
+
return Ve.filter((r) => n.has(r.value));
|
|
158
161
|
}
|
|
159
|
-
function
|
|
160
|
-
const n =
|
|
162
|
+
function we(e, t) {
|
|
163
|
+
const n = Qt(t), r = oe(e);
|
|
161
164
|
if (r.length === 0)
|
|
162
|
-
return n.filter((
|
|
165
|
+
return n.filter((i) => Wt.has(i));
|
|
163
166
|
const o = new Set(
|
|
164
|
-
|
|
167
|
+
tn(r).map((i) => i.value)
|
|
165
168
|
);
|
|
166
|
-
return n.filter((
|
|
169
|
+
return n.filter((i) => o.has(i));
|
|
167
170
|
}
|
|
168
|
-
function
|
|
169
|
-
const n =
|
|
171
|
+
function nn(e, t) {
|
|
172
|
+
const n = en(e), r = we(e, t), o = [...n, ...r];
|
|
170
173
|
return o.length > 0 ? o.join(",") : void 0;
|
|
171
174
|
}
|
|
172
|
-
function
|
|
173
|
-
const n =
|
|
175
|
+
function rn(e, t) {
|
|
176
|
+
const n = oe(e), r = we(
|
|
174
177
|
n,
|
|
175
178
|
t
|
|
176
179
|
), o = [
|
|
177
|
-
...n.map((
|
|
178
|
-
...r.map((
|
|
180
|
+
...n.map((i) => Yt[i] ?? i),
|
|
181
|
+
...r.map((i) => Xt[i] ?? i)
|
|
179
182
|
];
|
|
180
183
|
return o.length === 0 ? null : o.join("、");
|
|
181
184
|
}
|
|
182
|
-
const
|
|
185
|
+
const on = [
|
|
183
186
|
"video",
|
|
184
187
|
"audio",
|
|
185
188
|
"image",
|
|
186
189
|
"file",
|
|
187
190
|
"spreadsheet",
|
|
188
191
|
"document"
|
|
189
|
-
],
|
|
190
|
-
function
|
|
191
|
-
return e &&
|
|
192
|
+
], an = new Set(on);
|
|
193
|
+
function ln(e) {
|
|
194
|
+
return e && an.has(e) ? e : "file";
|
|
192
195
|
}
|
|
193
|
-
function
|
|
194
|
-
return typeof e == "string" &&
|
|
196
|
+
function ie(e) {
|
|
197
|
+
return typeof e == "string" && Lt.includes(e) ? e : "medium";
|
|
195
198
|
}
|
|
196
|
-
function
|
|
199
|
+
function sn(e, t) {
|
|
197
200
|
var o;
|
|
198
201
|
const n = Math.max(1, t);
|
|
199
202
|
let r = [];
|
|
200
|
-
return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((
|
|
203
|
+
return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
|
|
201
204
|
}
|
|
202
|
-
function
|
|
205
|
+
function cn(e) {
|
|
203
206
|
var t;
|
|
204
207
|
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
205
208
|
}
|
|
206
|
-
function
|
|
207
|
-
return `form-media-size-${
|
|
209
|
+
function un(e) {
|
|
210
|
+
return `form-media-size-${ie(e)}`;
|
|
208
211
|
}
|
|
209
|
-
function
|
|
210
|
-
return `form-media-preview form-media-list ${
|
|
212
|
+
function pn(e) {
|
|
213
|
+
return `form-media-preview form-media-list ${un(e)}`;
|
|
211
214
|
}
|
|
212
|
-
const
|
|
213
|
-
function
|
|
215
|
+
const mn = 10;
|
|
216
|
+
function qe(e) {
|
|
214
217
|
return e === !0 || e === "true";
|
|
215
218
|
}
|
|
216
|
-
function
|
|
219
|
+
function Le(e, t = 1) {
|
|
217
220
|
const n = typeof e == "number" ? e : Number(e);
|
|
218
221
|
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
|
|
219
222
|
}
|
|
220
|
-
function
|
|
223
|
+
function le(e, t = 1) {
|
|
221
224
|
const n = typeof e == "number" ? e : Number(e);
|
|
222
225
|
return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
|
|
223
226
|
}
|
|
224
|
-
function
|
|
227
|
+
function dn(e, t) {
|
|
225
228
|
if (t !== void 0)
|
|
226
|
-
return e === "toggle" ?
|
|
229
|
+
return e === "toggle" ? qe(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
|
|
227
230
|
}
|
|
228
|
-
function
|
|
229
|
-
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0,
|
|
230
|
-
return { agentKind: r, agentUniqueId: o, flowType:
|
|
231
|
+
function fn(e) {
|
|
232
|
+
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, a = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, l = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
233
|
+
return { agentKind: r, agentUniqueId: o, flowType: i, category: a, flowUniqueIds: l, pageSize: n };
|
|
231
234
|
}
|
|
232
|
-
function
|
|
235
|
+
function hn(e) {
|
|
233
236
|
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20;
|
|
234
237
|
return {
|
|
235
238
|
names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
|
|
@@ -238,51 +241,51 @@ function wn(e) {
|
|
|
238
241
|
pageSize: n
|
|
239
242
|
};
|
|
240
243
|
}
|
|
241
|
-
function
|
|
244
|
+
function gn(e) {
|
|
242
245
|
if (e.type !== "case_singleselect") return e;
|
|
243
246
|
const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
|
|
244
247
|
return { ...e, type: "case_multiselect", defaultValue: t };
|
|
245
248
|
}
|
|
246
|
-
function
|
|
247
|
-
var o,
|
|
248
|
-
const t =
|
|
249
|
+
function yn(e) {
|
|
250
|
+
var o, i;
|
|
251
|
+
const t = gn(e), n = oe(t.fileAcceptTypes), r = t.type;
|
|
249
252
|
return {
|
|
250
|
-
id: ((o = t.id) == null ? void 0 : o.trim()) ||
|
|
253
|
+
id: ((o = t.id) == null ? void 0 : o.trim()) || re("block-"),
|
|
251
254
|
type: r,
|
|
252
|
-
name: ((
|
|
255
|
+
name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
|
|
253
256
|
label: t.label ?? "",
|
|
254
257
|
placeholder: t.placeholder ?? "",
|
|
255
258
|
help: t.help ?? "",
|
|
256
259
|
required: t.required === !0,
|
|
257
|
-
mediaUrls:
|
|
258
|
-
mediaSize:
|
|
260
|
+
mediaUrls: Pe(r) ? sn(t, mn) : void 0,
|
|
261
|
+
mediaSize: Pe(r) ? ie(t.mediaSize) : void 0,
|
|
259
262
|
fileAcceptTypes: n,
|
|
260
|
-
fileAcceptExtensions:
|
|
263
|
+
fileAcceptExtensions: we(
|
|
261
264
|
n,
|
|
262
265
|
t.fileAcceptExtensions
|
|
263
266
|
),
|
|
264
|
-
filePlaceholderIcon:
|
|
265
|
-
fileMinCount: r === "file" ?
|
|
266
|
-
fileMaxCount: r === "file" ?
|
|
267
|
-
defaultValue:
|
|
268
|
-
options: Array.isArray(t.options) ? t.options.map((
|
|
267
|
+
filePlaceholderIcon: ln(t.filePlaceholderIcon),
|
|
268
|
+
fileMinCount: r === "file" ? Le(t.fileMinCount, 1) : void 0,
|
|
269
|
+
fileMaxCount: r === "file" ? Le(t.fileMaxCount, 1) : void 0,
|
|
270
|
+
defaultValue: dn(r, t.defaultValue),
|
|
271
|
+
options: Array.isArray(t.options) ? t.options.map((a, l) => {
|
|
269
272
|
var c, u;
|
|
270
273
|
return {
|
|
271
|
-
value: ((c =
|
|
272
|
-
label: ((u =
|
|
274
|
+
value: ((c = a.value) == null ? void 0 : c.trim()) || `option_${l + 1}`,
|
|
275
|
+
label: ((u = a.label) == null ? void 0 : u.trim()) || `选项 ${l + 1}`
|
|
273
276
|
};
|
|
274
277
|
}) : void 0,
|
|
275
278
|
resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
|
|
276
|
-
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ?
|
|
277
|
-
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ?
|
|
278
|
-
resumeFilter: r === "resume_multiselect" ?
|
|
279
|
+
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? le(t.resumeMinCount, 1) : void 0,
|
|
280
|
+
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? le(t.resumeMaxCount, 1) : void 0,
|
|
281
|
+
resumeFilter: r === "resume_multiselect" ? hn(t.resumeFilter) : void 0,
|
|
279
282
|
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
280
|
-
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ?
|
|
281
|
-
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ?
|
|
282
|
-
caseFilter: r === "case_multiselect" ?
|
|
283
|
+
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? le(t.caseMinCount, 1) : void 0,
|
|
284
|
+
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? le(t.caseMaxCount, 1) : void 0,
|
|
285
|
+
caseFilter: r === "case_multiselect" ? fn(t.caseFilter) : void 0
|
|
283
286
|
};
|
|
284
287
|
}
|
|
285
|
-
function
|
|
288
|
+
function pe(e) {
|
|
286
289
|
return {
|
|
287
290
|
title: e.title ?? "",
|
|
288
291
|
description: e.description ?? "",
|
|
@@ -290,38 +293,38 @@ function ye(e) {
|
|
|
290
293
|
jsonSchema: e.jsonSchema ?? {}
|
|
291
294
|
};
|
|
292
295
|
}
|
|
293
|
-
function
|
|
296
|
+
function W(e) {
|
|
294
297
|
if (!e || !Array.isArray(e.blocks))
|
|
295
|
-
return
|
|
296
|
-
const t = e.blocks.map(
|
|
297
|
-
return
|
|
298
|
+
return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
299
|
+
const t = e.blocks.map(yn);
|
|
300
|
+
return pe({
|
|
298
301
|
title: typeof e.title == "string" ? e.title : "",
|
|
299
302
|
description: typeof e.description == "string" ? e.description : "",
|
|
300
303
|
blocks: t,
|
|
301
304
|
jsonSchema: {}
|
|
302
305
|
});
|
|
303
306
|
}
|
|
304
|
-
function
|
|
305
|
-
const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0,
|
|
307
|
+
function vn(e) {
|
|
308
|
+
const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, a = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
306
309
|
return {
|
|
307
310
|
agentKind: n,
|
|
308
311
|
agentUniqueId: r,
|
|
309
312
|
flowType: o,
|
|
310
|
-
category:
|
|
311
|
-
flowUniqueIds:
|
|
313
|
+
category: i,
|
|
314
|
+
flowUniqueIds: a,
|
|
312
315
|
pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
|
|
313
316
|
};
|
|
314
317
|
}
|
|
315
|
-
function
|
|
318
|
+
function De(e) {
|
|
316
319
|
if (e == null) return;
|
|
317
320
|
const t = typeof e == "number" ? e : Number(e);
|
|
318
321
|
if (!(!Number.isFinite(t) || t < 1))
|
|
319
322
|
return Math.floor(t);
|
|
320
323
|
}
|
|
321
|
-
function
|
|
322
|
-
var
|
|
323
|
-
const { id: n, label: r, path: o, withData:
|
|
324
|
-
return
|
|
324
|
+
function bn(e, t) {
|
|
325
|
+
var a, l, c, u, m, p;
|
|
326
|
+
const { id: n, label: r, path: o, withData: i } = t;
|
|
327
|
+
return i({
|
|
325
328
|
id: n,
|
|
326
329
|
component: "SkoponCaseSelect",
|
|
327
330
|
label: r,
|
|
@@ -329,11 +332,11 @@ function $n(e, t) {
|
|
|
329
332
|
help: e.help ?? "",
|
|
330
333
|
enableRefresh: e.caseEnableRefresh !== !1,
|
|
331
334
|
caseFilter: {
|
|
332
|
-
agentKind: (
|
|
335
|
+
agentKind: (a = e.caseFilter) == null ? void 0 : a.agentKind,
|
|
333
336
|
agentUniqueId: (l = e.caseFilter) == null ? void 0 : l.agentUniqueId,
|
|
334
337
|
flowType: (c = e.caseFilter) == null ? void 0 : c.flowType,
|
|
335
338
|
category: (u = e.caseFilter) == null ? void 0 : u.category,
|
|
336
|
-
flowUniqueIds: ((
|
|
339
|
+
flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
|
|
337
340
|
pageSize: ((p = e.caseFilter) == null ? void 0 : p.pageSize) ?? 20
|
|
338
341
|
},
|
|
339
342
|
...e.caseMinCount !== void 0 ? { minCount: e.caseMinCount } : {},
|
|
@@ -341,51 +344,51 @@ function $n(e, t) {
|
|
|
341
344
|
value: { path: o }
|
|
342
345
|
});
|
|
343
346
|
}
|
|
344
|
-
function
|
|
347
|
+
function Sn(e, t, n) {
|
|
345
348
|
const r = n.nameFromValue(e.value), o = {
|
|
346
349
|
...t("case_multiselect"),
|
|
347
350
|
name: r,
|
|
348
351
|
caseEnableRefresh: e.enableRefresh !== !1
|
|
349
|
-
},
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
const l =
|
|
352
|
+
}, i = n.asLiteral(e.placeholder);
|
|
353
|
+
i && (o.placeholder = i);
|
|
354
|
+
const a = n.asLiteral(e.help);
|
|
355
|
+
a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = vn(e.caseFilter));
|
|
356
|
+
const l = De(e.minCount);
|
|
354
357
|
l !== void 0 && (o.caseMinCount = l);
|
|
355
|
-
const c =
|
|
358
|
+
const c = De(e.maxCount);
|
|
356
359
|
return c !== void 0 && (o.caseMaxCount = c), o;
|
|
357
360
|
}
|
|
358
|
-
const
|
|
359
|
-
function
|
|
361
|
+
const rt = ze({ interactive: !0 });
|
|
362
|
+
function ot({
|
|
360
363
|
interactive: e,
|
|
361
364
|
children: t
|
|
362
365
|
}) {
|
|
363
|
-
return /* @__PURE__ */ s(
|
|
366
|
+
return /* @__PURE__ */ s(rt.Provider, { value: { interactive: e }, children: t });
|
|
364
367
|
}
|
|
365
|
-
function
|
|
366
|
-
return
|
|
368
|
+
function K() {
|
|
369
|
+
return Re(rt);
|
|
367
370
|
}
|
|
368
|
-
function
|
|
371
|
+
function it(e) {
|
|
369
372
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
370
373
|
}
|
|
371
|
-
function
|
|
374
|
+
function Ke(e, t = "value") {
|
|
372
375
|
const r = e.componentModel.properties[t];
|
|
373
|
-
if (!(!
|
|
376
|
+
if (!(!it(r) || r === void 0))
|
|
374
377
|
return e.dataContext.resolveDynamicValue(r);
|
|
375
378
|
}
|
|
376
|
-
function
|
|
377
|
-
const r = e.componentModel.properties[t], o =
|
|
379
|
+
function J(e, t = "value") {
|
|
380
|
+
const r = e.componentModel.properties[t], o = it(r), i = Q(
|
|
378
381
|
(u) => {
|
|
379
382
|
if (!o || r === void 0) return () => {
|
|
380
383
|
};
|
|
381
|
-
const
|
|
382
|
-
return () =>
|
|
384
|
+
const m = e.dataContext.subscribeDynamicValue(r, () => u());
|
|
385
|
+
return () => m.unsubscribe();
|
|
383
386
|
},
|
|
384
387
|
[e, r, o]
|
|
385
|
-
),
|
|
388
|
+
), a = Q(() => {
|
|
386
389
|
if (!(!o || r === void 0))
|
|
387
390
|
return e.dataContext.resolveDynamicValue(r);
|
|
388
|
-
}, [e, r, o]), l =
|
|
391
|
+
}, [e, r, o]), l = Nt(i, a, a), c = Q(
|
|
389
392
|
(u) => {
|
|
390
393
|
!o || !r || typeof r != "object" || !("path" in r) || e.dataContext.set(String(r.path), u);
|
|
391
394
|
},
|
|
@@ -393,81 +396,81 @@ function G(e, t = "value") {
|
|
|
393
396
|
);
|
|
394
397
|
return { value: l, setValue: c, hasBinding: !!o };
|
|
395
398
|
}
|
|
396
|
-
function
|
|
399
|
+
function ne(e) {
|
|
397
400
|
if (typeof e == "string") return e || void 0;
|
|
398
401
|
if (typeof e == "number") return String(e);
|
|
399
402
|
}
|
|
400
|
-
function
|
|
403
|
+
function L(e) {
|
|
401
404
|
return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
|
|
402
405
|
}
|
|
403
|
-
function
|
|
406
|
+
function me(e) {
|
|
404
407
|
if (e == null) return;
|
|
405
408
|
const t = typeof e == "number" ? e : Number(e);
|
|
406
409
|
if (!(!Number.isFinite(t) || t < 1))
|
|
407
410
|
return Math.floor(t);
|
|
408
411
|
}
|
|
409
|
-
function
|
|
412
|
+
function at(e, t, n, r) {
|
|
410
413
|
if (e.includes(t)) {
|
|
411
|
-
const
|
|
412
|
-
return n !== void 0 &&
|
|
414
|
+
const i = e.filter((a) => a !== t);
|
|
415
|
+
return n !== void 0 && i.length < n ? null : i;
|
|
413
416
|
}
|
|
414
417
|
return r !== void 0 && e.length >= r ? null : [...e, t];
|
|
415
418
|
}
|
|
416
|
-
function
|
|
419
|
+
function lt(e, t, n, r, o) {
|
|
417
420
|
if (!n) return !0;
|
|
418
|
-
const
|
|
419
|
-
return !!(!
|
|
421
|
+
const i = e.includes(t);
|
|
422
|
+
return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
|
|
420
423
|
}
|
|
421
|
-
function
|
|
424
|
+
function st(e, t) {
|
|
422
425
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
423
426
|
}
|
|
424
|
-
const
|
|
425
|
-
function
|
|
427
|
+
const ct = ze(null);
|
|
428
|
+
function ut({
|
|
426
429
|
caseSearch: e,
|
|
427
430
|
children: t
|
|
428
431
|
}) {
|
|
429
|
-
return /* @__PURE__ */ s(
|
|
432
|
+
return /* @__PURE__ */ s(ct.Provider, { value: e ?? null, children: t });
|
|
430
433
|
}
|
|
431
|
-
function
|
|
432
|
-
return
|
|
434
|
+
function xn() {
|
|
435
|
+
return Re(ct);
|
|
433
436
|
}
|
|
434
|
-
function
|
|
437
|
+
function Ce(e) {
|
|
435
438
|
return typeof e == "string" ? e : "";
|
|
436
439
|
}
|
|
437
|
-
function
|
|
440
|
+
function ke(e) {
|
|
438
441
|
if (!e || typeof e != "object")
|
|
439
442
|
return { flowUniqueIds: [], pageSize: 20 };
|
|
440
|
-
const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0,
|
|
441
|
-
return { agentKind: o, agentUniqueId:
|
|
443
|
+
const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, a = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, l = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
444
|
+
return { agentKind: o, agentUniqueId: i, flowType: a, category: l, flowUniqueIds: c, pageSize: r };
|
|
442
445
|
}
|
|
443
|
-
function
|
|
446
|
+
function Ae(e) {
|
|
444
447
|
var r;
|
|
445
448
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
|
|
446
449
|
return t || n;
|
|
447
450
|
}
|
|
448
|
-
function
|
|
451
|
+
function Cn(e) {
|
|
449
452
|
return JSON.stringify(e);
|
|
450
453
|
}
|
|
451
|
-
const
|
|
454
|
+
const kn = {
|
|
452
455
|
name: "SkoponCaseSelect",
|
|
453
|
-
schema:
|
|
454
|
-
label:
|
|
455
|
-
placeholder:
|
|
456
|
-
help:
|
|
457
|
-
enableRefresh:
|
|
458
|
-
caseFilter:
|
|
459
|
-
minCount:
|
|
460
|
-
maxCount:
|
|
461
|
-
value:
|
|
456
|
+
schema: d.object({
|
|
457
|
+
label: d.any().optional(),
|
|
458
|
+
placeholder: d.any().optional(),
|
|
459
|
+
help: d.any().optional(),
|
|
460
|
+
enableRefresh: d.any().optional(),
|
|
461
|
+
caseFilter: d.any().optional(),
|
|
462
|
+
minCount: d.any().optional(),
|
|
463
|
+
maxCount: d.any().optional(),
|
|
464
|
+
value: d.any().optional()
|
|
462
465
|
}).passthrough()
|
|
463
466
|
};
|
|
464
|
-
function
|
|
467
|
+
function An({
|
|
465
468
|
item: e,
|
|
466
469
|
selected: t,
|
|
467
470
|
disabled: n,
|
|
468
471
|
onToggle: r
|
|
469
472
|
}) {
|
|
470
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ C(
|
|
471
474
|
"button",
|
|
472
475
|
{
|
|
473
476
|
type: "button",
|
|
@@ -475,11 +478,11 @@ function Fn({
|
|
|
475
478
|
disabled: n,
|
|
476
479
|
onClick: r,
|
|
477
480
|
children: [
|
|
478
|
-
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(
|
|
479
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(Ge, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
|
|
482
|
+
/* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
|
|
480
483
|
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name }),
|
|
481
484
|
e.description ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
|
|
482
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ C("div", { className: "skopon-resume-select-card-meta", children: [
|
|
483
486
|
e.caseUniqueId,
|
|
484
487
|
e.platform ? ` · ${e.platform}` : "",
|
|
485
488
|
e.link ? ` · ${e.link}` : ""
|
|
@@ -489,107 +492,107 @@ function Fn({
|
|
|
489
492
|
}
|
|
490
493
|
);
|
|
491
494
|
}
|
|
492
|
-
function
|
|
493
|
-
const { interactive: t } =
|
|
494
|
-
|
|
495
|
-
const b =
|
|
495
|
+
function Tn({ context: e }) {
|
|
496
|
+
const { interactive: t } = K(), n = xn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Ce(i.label), l = Ce(i.placeholder), c = Ce(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => ke(i.caseFilter), [i.caseFilter]), v = Cn(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
|
|
497
|
+
j(() => {
|
|
498
|
+
const b = st(O, p);
|
|
496
499
|
b !== null && o(b);
|
|
497
|
-
}, [p,
|
|
498
|
-
const
|
|
500
|
+
}, [p, O, o]);
|
|
501
|
+
const H = B(() => n ? Ae(g) ? h || l || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, h, l]), Y = Q(
|
|
499
502
|
async (b) => {
|
|
500
|
-
const
|
|
501
|
-
if (!n || !
|
|
502
|
-
|
|
503
|
+
const F = ke(JSON.parse(v)), R = ++w.current;
|
|
504
|
+
if (!n || !Ae(F)) {
|
|
505
|
+
S([]), z(0), x("");
|
|
503
506
|
return;
|
|
504
507
|
}
|
|
505
|
-
f(!0),
|
|
508
|
+
f(!0), x("");
|
|
506
509
|
try {
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
509
|
-
|
|
510
|
-
} catch (
|
|
511
|
-
if (
|
|
512
|
-
|
|
510
|
+
const N = await n({ filter: F, page: b });
|
|
511
|
+
if (R !== w.current) return;
|
|
512
|
+
S(N.list), z(N.total), T(N.page), G(N.pageSize);
|
|
513
|
+
} catch (N) {
|
|
514
|
+
if (R !== w.current) return;
|
|
515
|
+
S([]), z(0), x(N instanceof Error ? N.message : "加载案例列表失败");
|
|
513
516
|
} finally {
|
|
514
|
-
|
|
517
|
+
R === w.current && f(!1);
|
|
515
518
|
}
|
|
516
519
|
},
|
|
517
520
|
[n, v]
|
|
518
521
|
);
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}, [v,
|
|
522
|
-
const
|
|
522
|
+
j(() => {
|
|
523
|
+
T(1), Y(1);
|
|
524
|
+
}, [v, Y]);
|
|
525
|
+
const P = (b) => {
|
|
523
526
|
if (!t) return;
|
|
524
|
-
const
|
|
525
|
-
|
|
527
|
+
const F = at(
|
|
528
|
+
O,
|
|
526
529
|
b,
|
|
527
|
-
|
|
530
|
+
m,
|
|
528
531
|
p
|
|
529
532
|
);
|
|
530
|
-
|
|
533
|
+
F !== null && o(F);
|
|
531
534
|
}, _ = () => {
|
|
532
|
-
const b =
|
|
533
|
-
|
|
535
|
+
const b = ke(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
|
|
536
|
+
Y(N);
|
|
534
537
|
};
|
|
535
|
-
return /* @__PURE__ */
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
/* @__PURE__ */ s(
|
|
538
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
|
|
539
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
540
|
+
k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
|
|
541
|
+
/* @__PURE__ */ s(Oe, { size: "small" }),
|
|
539
542
|
" 加载案例…"
|
|
540
543
|
] }) : null,
|
|
541
|
-
!
|
|
544
|
+
!k && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: H }) : null,
|
|
542
545
|
y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
|
|
543
|
-
|
|
546
|
+
An,
|
|
544
547
|
{
|
|
545
548
|
item: b,
|
|
546
|
-
selected:
|
|
547
|
-
disabled:
|
|
548
|
-
|
|
549
|
+
selected: O.includes(b.caseUniqueId),
|
|
550
|
+
disabled: lt(
|
|
551
|
+
O,
|
|
549
552
|
b.caseUniqueId,
|
|
550
553
|
t,
|
|
551
|
-
|
|
554
|
+
m,
|
|
552
555
|
p
|
|
553
556
|
),
|
|
554
|
-
onToggle: () =>
|
|
557
|
+
onToggle: () => P(b.caseUniqueId)
|
|
555
558
|
},
|
|
556
559
|
b.caseUniqueId
|
|
557
560
|
)) }) : null,
|
|
558
|
-
u && n &&
|
|
559
|
-
|
|
561
|
+
u && n && Ae(g) ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
|
|
562
|
+
fe,
|
|
560
563
|
{
|
|
561
564
|
type: "default",
|
|
562
565
|
size: "small",
|
|
563
|
-
icon: /* @__PURE__ */ s(
|
|
564
|
-
loading:
|
|
566
|
+
icon: /* @__PURE__ */ s(Xe, {}),
|
|
567
|
+
loading: k,
|
|
565
568
|
disabled: !t,
|
|
566
569
|
onClick: _,
|
|
567
570
|
children: "换一批"
|
|
568
571
|
}
|
|
569
572
|
) }) : null,
|
|
570
|
-
c ? /* @__PURE__ */ s(
|
|
573
|
+
c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
|
|
571
574
|
] });
|
|
572
575
|
}
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
),
|
|
576
|
+
const Nn = V(
|
|
577
|
+
kn,
|
|
578
|
+
Tn
|
|
579
|
+
), In = {
|
|
577
580
|
type: "case_multiselect",
|
|
578
581
|
componentName: "SkoponCaseSelect",
|
|
579
|
-
toComponent:
|
|
580
|
-
fromComponent:
|
|
581
|
-
catalogComponents: [
|
|
582
|
+
toComponent: bn,
|
|
583
|
+
fromComponent: Sn,
|
|
584
|
+
catalogComponents: [Nn]
|
|
582
585
|
};
|
|
583
|
-
function
|
|
586
|
+
function Je(e) {
|
|
584
587
|
if (e == null) return;
|
|
585
588
|
const t = typeof e == "number" ? e : Number(e);
|
|
586
589
|
if (!(!Number.isFinite(t) || t < 1))
|
|
587
590
|
return Math.floor(t);
|
|
588
591
|
}
|
|
589
|
-
function
|
|
590
|
-
var
|
|
591
|
-
const { id: n, label: r, path: o, withData:
|
|
592
|
-
return
|
|
592
|
+
function Mn(e, t) {
|
|
593
|
+
var a, l, c, u;
|
|
594
|
+
const { id: n, label: r, path: o, withData: i } = t;
|
|
595
|
+
return i({
|
|
593
596
|
id: n,
|
|
594
597
|
component: "SkoponResumeSelect",
|
|
595
598
|
label: r,
|
|
@@ -597,7 +600,7 @@ function Un(e, t) {
|
|
|
597
600
|
help: e.help ?? "",
|
|
598
601
|
enableRefresh: e.resumeEnableRefresh !== !1,
|
|
599
602
|
resumeFilter: {
|
|
600
|
-
names: ((
|
|
603
|
+
names: ((a = e.resumeFilter) == null ? void 0 : a.names) ?? [],
|
|
601
604
|
agentUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.agentUniqueIds) ?? [],
|
|
602
605
|
resumeUniqueIds: ((c = e.resumeFilter) == null ? void 0 : c.resumeUniqueIds) ?? [],
|
|
603
606
|
pageSize: ((u = e.resumeFilter) == null ? void 0 : u.pageSize) ?? 20
|
|
@@ -607,15 +610,15 @@ function Un(e, t) {
|
|
|
607
610
|
value: { path: o }
|
|
608
611
|
});
|
|
609
612
|
}
|
|
610
|
-
function
|
|
613
|
+
function Fn(e, t, n) {
|
|
611
614
|
const r = n.nameFromValue(e.value), o = {
|
|
612
615
|
...t("resume_multiselect"),
|
|
613
616
|
name: r,
|
|
614
617
|
resumeEnableRefresh: e.enableRefresh !== !1
|
|
615
|
-
},
|
|
616
|
-
|
|
617
|
-
const
|
|
618
|
-
if (
|
|
618
|
+
}, i = n.asLiteral(e.placeholder);
|
|
619
|
+
i && (o.placeholder = i);
|
|
620
|
+
const a = n.asLiteral(e.help);
|
|
621
|
+
if (a && (o.help = a), e.resumeFilter && typeof e.resumeFilter == "object") {
|
|
619
622
|
const u = e.resumeFilter;
|
|
620
623
|
o.resumeFilter = {
|
|
621
624
|
names: Array.isArray(u.names) ? u.names.map(String) : [],
|
|
@@ -624,79 +627,79 @@ function jn(e, t, n) {
|
|
|
624
627
|
pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
|
|
625
628
|
};
|
|
626
629
|
}
|
|
627
|
-
const l =
|
|
630
|
+
const l = Je(e.minCount);
|
|
628
631
|
l !== void 0 && (o.resumeMinCount = l);
|
|
629
|
-
const c =
|
|
632
|
+
const c = Je(e.maxCount);
|
|
630
633
|
return c !== void 0 && (o.resumeMaxCount = c), o;
|
|
631
634
|
}
|
|
632
|
-
const
|
|
633
|
-
function
|
|
635
|
+
const pt = ze(null);
|
|
636
|
+
function mt({
|
|
634
637
|
resumeSearch: e,
|
|
635
638
|
children: t
|
|
636
639
|
}) {
|
|
637
|
-
return /* @__PURE__ */ s(
|
|
640
|
+
return /* @__PURE__ */ s(pt.Provider, { value: e ?? null, children: t });
|
|
638
641
|
}
|
|
639
|
-
function
|
|
640
|
-
return
|
|
642
|
+
function Pn() {
|
|
643
|
+
return Re(pt);
|
|
641
644
|
}
|
|
642
|
-
function
|
|
645
|
+
function Te(e) {
|
|
643
646
|
return typeof e == "string" ? e : "";
|
|
644
647
|
}
|
|
645
|
-
function
|
|
648
|
+
function Ne(e) {
|
|
646
649
|
if (!e || typeof e != "object")
|
|
647
650
|
return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
|
|
648
|
-
const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [],
|
|
649
|
-
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize:
|
|
651
|
+
const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), a = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
|
|
652
|
+
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: a };
|
|
650
653
|
}
|
|
651
|
-
function
|
|
654
|
+
function Un(e) {
|
|
652
655
|
return JSON.stringify(e);
|
|
653
656
|
}
|
|
654
|
-
const
|
|
657
|
+
const _n = {
|
|
655
658
|
name: "SkoponResumeSelect",
|
|
656
|
-
schema:
|
|
657
|
-
label:
|
|
658
|
-
placeholder:
|
|
659
|
-
help:
|
|
660
|
-
enableRefresh:
|
|
661
|
-
resumeFilter:
|
|
662
|
-
minCount:
|
|
663
|
-
maxCount:
|
|
664
|
-
value:
|
|
659
|
+
schema: d.object({
|
|
660
|
+
label: d.any().optional(),
|
|
661
|
+
placeholder: d.any().optional(),
|
|
662
|
+
help: d.any().optional(),
|
|
663
|
+
enableRefresh: d.any().optional(),
|
|
664
|
+
resumeFilter: d.any().optional(),
|
|
665
|
+
minCount: d.any().optional(),
|
|
666
|
+
maxCount: d.any().optional(),
|
|
667
|
+
value: d.any().optional()
|
|
665
668
|
}).passthrough()
|
|
666
|
-
},
|
|
667
|
-
function
|
|
668
|
-
const n = (t ?? []).filter(Boolean), r = n.slice(0,
|
|
669
|
-
return /* @__PURE__ */
|
|
669
|
+
}, En = 3, zn = 2;
|
|
670
|
+
function Ie(e, t) {
|
|
671
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, En), o = n.length - r.length;
|
|
672
|
+
return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags", children: [
|
|
670
673
|
/* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
671
|
-
n.length > 0 ? /* @__PURE__ */
|
|
672
|
-
r.map((
|
|
673
|
-
o > 0 ? /* @__PURE__ */
|
|
674
|
+
n.length > 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
675
|
+
r.map((i) => /* @__PURE__ */ s(te, { className: "skopon-resume-select-card-tag", children: i }, i)),
|
|
676
|
+
o > 0 ? /* @__PURE__ */ C(te, { className: "skopon-resume-select-card-tag", children: [
|
|
674
677
|
"+",
|
|
675
678
|
o
|
|
676
679
|
] }) : null
|
|
677
680
|
] }) : /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
678
681
|
] });
|
|
679
682
|
}
|
|
680
|
-
function
|
|
681
|
-
return /* @__PURE__ */
|
|
683
|
+
function Rn(e) {
|
|
684
|
+
return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-field", children: [
|
|
682
685
|
/* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
683
686
|
/* @__PURE__ */ s("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
684
687
|
] });
|
|
685
688
|
}
|
|
686
|
-
function
|
|
687
|
-
return /* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ s("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ s(
|
|
689
|
+
function On({ work: e }) {
|
|
690
|
+
return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-work", children: [
|
|
691
|
+
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ s("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ s(Bt, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
689
692
|
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
690
693
|
] });
|
|
691
694
|
}
|
|
692
|
-
function
|
|
695
|
+
function Bn({
|
|
693
696
|
item: e,
|
|
694
697
|
selected: t,
|
|
695
698
|
disabled: n,
|
|
696
699
|
onToggle: r
|
|
697
700
|
}) {
|
|
698
|
-
const o = (e.works ?? []).slice(0,
|
|
699
|
-
return /* @__PURE__ */
|
|
701
|
+
const o = (e.works ?? []).slice(0, zn);
|
|
702
|
+
return /* @__PURE__ */ C(
|
|
700
703
|
"button",
|
|
701
704
|
{
|
|
702
705
|
type: "button",
|
|
@@ -705,182 +708,182 @@ function Kn({
|
|
|
705
708
|
onClick: r,
|
|
706
709
|
children: [
|
|
707
710
|
/* @__PURE__ */ s(
|
|
708
|
-
|
|
711
|
+
Ft,
|
|
709
712
|
{
|
|
710
713
|
size: 48,
|
|
711
714
|
src: e.avatarUrl || void 0,
|
|
712
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(
|
|
715
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(Ot, {}),
|
|
713
716
|
className: "skopon-resume-select-card-avatar"
|
|
714
717
|
}
|
|
715
718
|
),
|
|
716
719
|
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
717
|
-
/* @__PURE__ */
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
|
|
721
|
+
Rn(e.satisfaction),
|
|
722
|
+
Ie("性格", e.personality),
|
|
723
|
+
Ie("专长", e.specialties),
|
|
724
|
+
Ie("擅长领域", e.traits),
|
|
725
|
+
/* @__PURE__ */ C("div", { className: "skopon-resume-select-card-works", children: [
|
|
723
726
|
/* @__PURE__ */ s("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
|
|
724
|
-
o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((
|
|
727
|
+
o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ s(On, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
|
|
725
728
|
] })
|
|
726
729
|
] })
|
|
727
730
|
]
|
|
728
731
|
}
|
|
729
732
|
);
|
|
730
733
|
}
|
|
731
|
-
function
|
|
732
|
-
const { interactive: t } =
|
|
733
|
-
|
|
734
|
-
const b =
|
|
734
|
+
function Vn({ context: e }) {
|
|
735
|
+
const { interactive: t } = K(), n = Pn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Te(i.label), l = Te(i.placeholder), c = Te(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => Ne(i.resumeFilter), [i.resumeFilter]), v = Un(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
|
|
736
|
+
j(() => {
|
|
737
|
+
const b = st(O, p);
|
|
735
738
|
b !== null && o(b);
|
|
736
|
-
}, [p,
|
|
737
|
-
const
|
|
739
|
+
}, [p, O, o]);
|
|
740
|
+
const H = Q(
|
|
738
741
|
async (b) => {
|
|
739
|
-
const
|
|
742
|
+
const F = Ne(JSON.parse(v)), R = ++w.current;
|
|
740
743
|
if (!n) {
|
|
741
|
-
|
|
744
|
+
S([]), z(0), x("未配置简历搜索服务");
|
|
742
745
|
return;
|
|
743
746
|
}
|
|
744
|
-
f(!0),
|
|
747
|
+
f(!0), x("");
|
|
745
748
|
try {
|
|
746
|
-
const
|
|
747
|
-
if (
|
|
748
|
-
|
|
749
|
-
} catch (
|
|
750
|
-
if (
|
|
751
|
-
|
|
749
|
+
const N = await n({ filter: F, page: b });
|
|
750
|
+
if (R !== w.current) return;
|
|
751
|
+
S(N.list), z(N.total), T(N.page), G(N.pageSize);
|
|
752
|
+
} catch (N) {
|
|
753
|
+
if (R !== w.current) return;
|
|
754
|
+
S([]), z(0), x(N instanceof Error ? N.message : "加载简历列表失败");
|
|
752
755
|
} finally {
|
|
753
|
-
|
|
756
|
+
R === w.current && f(!1);
|
|
754
757
|
}
|
|
755
758
|
},
|
|
756
759
|
[n, v]
|
|
757
760
|
);
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
}, [v,
|
|
761
|
-
const
|
|
761
|
+
j(() => {
|
|
762
|
+
T(1), H(1);
|
|
763
|
+
}, [v, H]);
|
|
764
|
+
const Y = (b) => {
|
|
762
765
|
if (!t) return;
|
|
763
|
-
const
|
|
764
|
-
|
|
766
|
+
const F = at(
|
|
767
|
+
O,
|
|
765
768
|
b,
|
|
766
|
-
|
|
769
|
+
m,
|
|
767
770
|
p
|
|
768
771
|
);
|
|
769
|
-
|
|
770
|
-
},
|
|
771
|
-
const b =
|
|
772
|
-
|
|
772
|
+
F !== null && o(F);
|
|
773
|
+
}, P = () => {
|
|
774
|
+
const b = Ne(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
|
|
775
|
+
H(N);
|
|
773
776
|
}, _ = l || "暂无匹配的简历";
|
|
774
|
-
return /* @__PURE__ */
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
/* @__PURE__ */ s(
|
|
777
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
|
|
778
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
779
|
+
k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
|
|
780
|
+
/* @__PURE__ */ s(Oe, { size: "small" }),
|
|
778
781
|
" 加载简历…"
|
|
779
782
|
] }) : null,
|
|
780
|
-
!
|
|
781
|
-
!
|
|
783
|
+
!k && h ? /* @__PURE__ */ s(D.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
|
|
784
|
+
!k && !h && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: _ }) : null,
|
|
782
785
|
y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
|
|
783
|
-
|
|
786
|
+
Bn,
|
|
784
787
|
{
|
|
785
788
|
item: b,
|
|
786
|
-
selected:
|
|
787
|
-
disabled:
|
|
788
|
-
|
|
789
|
+
selected: O.includes(b.resumeUniqueId),
|
|
790
|
+
disabled: lt(
|
|
791
|
+
O,
|
|
789
792
|
b.resumeUniqueId,
|
|
790
793
|
t,
|
|
791
|
-
|
|
794
|
+
m,
|
|
792
795
|
p
|
|
793
796
|
),
|
|
794
|
-
onToggle: () =>
|
|
797
|
+
onToggle: () => Y(b.resumeUniqueId)
|
|
795
798
|
},
|
|
796
799
|
b.resumeUniqueId
|
|
797
800
|
)) }) : null,
|
|
798
801
|
u && n ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
|
|
799
|
-
|
|
802
|
+
fe,
|
|
800
803
|
{
|
|
801
804
|
type: "default",
|
|
802
805
|
size: "small",
|
|
803
|
-
icon: /* @__PURE__ */ s(
|
|
804
|
-
loading:
|
|
806
|
+
icon: /* @__PURE__ */ s(Xe, {}),
|
|
807
|
+
loading: k,
|
|
805
808
|
disabled: !t,
|
|
806
|
-
onClick:
|
|
809
|
+
onClick: P,
|
|
807
810
|
children: "换一批"
|
|
808
811
|
}
|
|
809
812
|
) }) : null,
|
|
810
|
-
c ? /* @__PURE__ */ s(
|
|
813
|
+
c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
|
|
811
814
|
] });
|
|
812
815
|
}
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
),
|
|
816
|
+
const wn = V(
|
|
817
|
+
_n,
|
|
818
|
+
Vn
|
|
819
|
+
), qn = {
|
|
817
820
|
type: "resume_multiselect",
|
|
818
821
|
componentName: "SkoponResumeSelect",
|
|
819
|
-
toComponent:
|
|
820
|
-
fromComponent:
|
|
821
|
-
catalogComponents: [
|
|
822
|
-
},
|
|
823
|
-
|
|
824
|
-
),
|
|
825
|
-
|
|
822
|
+
toComponent: Mn,
|
|
823
|
+
fromComponent: Fn,
|
|
824
|
+
catalogComponents: [wn]
|
|
825
|
+
}, he = [qn, In], jn = new Map(
|
|
826
|
+
he.map((e) => [e.type, e])
|
|
827
|
+
), $n = new Map(
|
|
828
|
+
he.map((e) => [e.componentName, e])
|
|
826
829
|
);
|
|
827
|
-
function
|
|
828
|
-
return
|
|
830
|
+
function Ln(e) {
|
|
831
|
+
return jn.get(e);
|
|
829
832
|
}
|
|
830
|
-
function
|
|
831
|
-
return
|
|
833
|
+
function Dn(e) {
|
|
834
|
+
return $n.get(e);
|
|
832
835
|
}
|
|
833
|
-
function
|
|
834
|
-
return
|
|
836
|
+
function Kn() {
|
|
837
|
+
return he.flatMap((e) => e.catalogComponents);
|
|
835
838
|
}
|
|
836
|
-
function
|
|
837
|
-
return
|
|
839
|
+
function Jn() {
|
|
840
|
+
return he.map((e) => e.componentName);
|
|
838
841
|
}
|
|
839
|
-
const
|
|
840
|
-
function
|
|
842
|
+
const de = "root", Ue = "__title__", _e = "__desc__", dt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
843
|
+
function Hn(e) {
|
|
841
844
|
return `/${e}`;
|
|
842
845
|
}
|
|
843
|
-
function
|
|
846
|
+
function He(e) {
|
|
844
847
|
return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
|
|
845
848
|
}
|
|
846
|
-
function
|
|
849
|
+
function E(e) {
|
|
847
850
|
if (typeof e == "string") return e;
|
|
848
851
|
}
|
|
849
|
-
function
|
|
850
|
-
const t = e.id ||
|
|
852
|
+
function Yn(e) {
|
|
853
|
+
const t = e.id || re("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
851
854
|
return {
|
|
852
855
|
id: t,
|
|
853
856
|
component: "SkoponMedia",
|
|
854
857
|
mediaType: n,
|
|
855
|
-
urls:
|
|
856
|
-
mediaSize:
|
|
858
|
+
urls: cn(e),
|
|
859
|
+
mediaSize: ie(e.mediaSize),
|
|
857
860
|
label: e.label ?? "",
|
|
858
861
|
help: e.help ?? "",
|
|
859
862
|
placeholder: e.placeholder ?? ""
|
|
860
863
|
};
|
|
861
864
|
}
|
|
862
|
-
function
|
|
865
|
+
function Xn(e) {
|
|
863
866
|
if (Array.isArray(e.urls))
|
|
864
867
|
return e.urls.map((n) => String(n).trim()).filter(Boolean);
|
|
865
|
-
const t =
|
|
868
|
+
const t = E(e.url);
|
|
866
869
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
867
870
|
}
|
|
868
|
-
function
|
|
869
|
-
const r = typeof e.id == "string" ? e.id :
|
|
871
|
+
function se(e, t, n) {
|
|
872
|
+
const r = typeof e.id == "string" ? e.id : re("block-"), o = Xn(e), i = E(e.label) ?? E(e.description) ?? n, a = E(e.help), l = E(e.placeholder), c = ie(e.mediaSize);
|
|
870
873
|
return {
|
|
871
874
|
id: r,
|
|
872
875
|
type: t,
|
|
873
|
-
label:
|
|
874
|
-
...
|
|
876
|
+
label: i,
|
|
877
|
+
...a ? { help: a } : {},
|
|
875
878
|
...l ? { placeholder: l } : {},
|
|
876
879
|
mediaSize: c,
|
|
877
880
|
mediaUrls: o.length > 0 ? o : [""]
|
|
878
881
|
};
|
|
879
882
|
}
|
|
880
|
-
function
|
|
883
|
+
function Gn(e) {
|
|
881
884
|
switch (e.type) {
|
|
882
885
|
case "toggle":
|
|
883
|
-
return
|
|
886
|
+
return qe(e.defaultValue);
|
|
884
887
|
case "multiselect":
|
|
885
888
|
case "checkbox":
|
|
886
889
|
case "resume_multiselect":
|
|
@@ -894,9 +897,9 @@ function or(e) {
|
|
|
894
897
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
895
898
|
}
|
|
896
899
|
}
|
|
897
|
-
function
|
|
900
|
+
function Wn(e) {
|
|
898
901
|
var u;
|
|
899
|
-
const t = e.id ||
|
|
902
|
+
const t = e.id || re("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Hn(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), a = (m) => r ? { node: m, dataKey: r, dataValue: Gn(e) } : { node: m }, l = { id: t, label: n, name: r, path: o, withData: a }, c = Ln(e.type);
|
|
900
903
|
if (c)
|
|
901
904
|
return c.toComponent(e, l);
|
|
902
905
|
switch (e.type) {
|
|
@@ -907,7 +910,7 @@ function ar(e) {
|
|
|
907
910
|
case "text":
|
|
908
911
|
case "tel":
|
|
909
912
|
case "url":
|
|
910
|
-
return
|
|
913
|
+
return a({
|
|
911
914
|
id: t,
|
|
912
915
|
component: "TextField",
|
|
913
916
|
label: n,
|
|
@@ -916,17 +919,17 @@ function ar(e) {
|
|
|
916
919
|
value: { path: o }
|
|
917
920
|
});
|
|
918
921
|
case "email":
|
|
919
|
-
return
|
|
922
|
+
return a({
|
|
920
923
|
id: t,
|
|
921
924
|
component: "TextField",
|
|
922
925
|
label: n,
|
|
923
926
|
variant: "shortText",
|
|
924
|
-
validationRegexp:
|
|
927
|
+
validationRegexp: dt,
|
|
925
928
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
926
929
|
value: { path: o }
|
|
927
930
|
});
|
|
928
931
|
case "textarea":
|
|
929
|
-
return
|
|
932
|
+
return a({
|
|
930
933
|
id: t,
|
|
931
934
|
component: "TextField",
|
|
932
935
|
label: n,
|
|
@@ -935,7 +938,7 @@ function ar(e) {
|
|
|
935
938
|
value: { path: o }
|
|
936
939
|
});
|
|
937
940
|
case "number":
|
|
938
|
-
return
|
|
941
|
+
return a({
|
|
939
942
|
id: t,
|
|
940
943
|
component: "TextField",
|
|
941
944
|
label: n,
|
|
@@ -944,49 +947,49 @@ function ar(e) {
|
|
|
944
947
|
value: { path: o }
|
|
945
948
|
});
|
|
946
949
|
case "select":
|
|
947
|
-
return
|
|
950
|
+
return a({
|
|
948
951
|
id: t,
|
|
949
952
|
component: "SkoponSelect",
|
|
950
953
|
label: n,
|
|
951
954
|
mode: "single",
|
|
952
955
|
placeholder: e.placeholder ?? "",
|
|
953
|
-
options:
|
|
956
|
+
options: i,
|
|
954
957
|
value: { path: o }
|
|
955
958
|
});
|
|
956
959
|
case "radio":
|
|
957
|
-
return
|
|
960
|
+
return a({
|
|
958
961
|
id: t,
|
|
959
962
|
component: "ChoicePicker",
|
|
960
963
|
label: n,
|
|
961
964
|
variant: "mutuallyExclusive",
|
|
962
965
|
skoponPickerType: "radio",
|
|
963
|
-
options:
|
|
966
|
+
options: i,
|
|
964
967
|
value: { path: o }
|
|
965
968
|
});
|
|
966
969
|
case "multiselect":
|
|
967
|
-
return
|
|
970
|
+
return a({
|
|
968
971
|
id: t,
|
|
969
972
|
component: "SkoponSelect",
|
|
970
973
|
label: n,
|
|
971
974
|
mode: "multiple",
|
|
972
975
|
placeholder: e.placeholder ?? "",
|
|
973
|
-
options:
|
|
976
|
+
options: i,
|
|
974
977
|
value: { path: o }
|
|
975
978
|
});
|
|
976
979
|
case "checkbox":
|
|
977
|
-
return
|
|
980
|
+
return a({
|
|
978
981
|
id: t,
|
|
979
982
|
component: "ChoicePicker",
|
|
980
983
|
label: n,
|
|
981
984
|
variant: "multipleSelection",
|
|
982
985
|
skoponPickerType: "checkbox",
|
|
983
|
-
options:
|
|
986
|
+
options: i,
|
|
984
987
|
value: { path: o }
|
|
985
988
|
});
|
|
986
989
|
case "toggle":
|
|
987
|
-
return
|
|
990
|
+
return a({ id: t, component: "CheckBox", label: n, value: { path: o } });
|
|
988
991
|
case "datetime":
|
|
989
|
-
return
|
|
992
|
+
return a({
|
|
990
993
|
id: t,
|
|
991
994
|
component: "DateTimeInput",
|
|
992
995
|
label: n,
|
|
@@ -996,7 +999,7 @@ function ar(e) {
|
|
|
996
999
|
value: { path: o }
|
|
997
1000
|
});
|
|
998
1001
|
case "time":
|
|
999
|
-
return
|
|
1002
|
+
return a({
|
|
1000
1003
|
id: t,
|
|
1001
1004
|
component: "DateTimeInput",
|
|
1002
1005
|
label: n,
|
|
@@ -1007,9 +1010,9 @@ function ar(e) {
|
|
|
1007
1010
|
case "image":
|
|
1008
1011
|
case "video":
|
|
1009
1012
|
case "audio":
|
|
1010
|
-
return { node:
|
|
1013
|
+
return { node: Yn(e) };
|
|
1011
1014
|
case "file":
|
|
1012
|
-
return
|
|
1015
|
+
return a({
|
|
1013
1016
|
id: t,
|
|
1014
1017
|
component: "FileUpload",
|
|
1015
1018
|
label: n,
|
|
@@ -1024,31 +1027,31 @@ function ar(e) {
|
|
|
1024
1027
|
return { node: null };
|
|
1025
1028
|
}
|
|
1026
1029
|
}
|
|
1027
|
-
function
|
|
1030
|
+
function Ee(e) {
|
|
1028
1031
|
if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
|
|
1029
|
-
const t = e.components.find((r) => r.id ===
|
|
1032
|
+
const t = e.components.find((r) => r.id === de);
|
|
1030
1033
|
if (!t) return e.components.length === 0;
|
|
1031
1034
|
const n = t.children;
|
|
1032
1035
|
return !Array.isArray(n) || n.length === 0;
|
|
1033
1036
|
}
|
|
1034
|
-
function
|
|
1035
|
-
const n = [], r = [], o = {},
|
|
1036
|
-
|
|
1037
|
-
for (const
|
|
1038
|
-
const { node: p, dataKey: g, dataValue: v } =
|
|
1037
|
+
function ft(e, t) {
|
|
1038
|
+
const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), l = (e.description ?? "").trim();
|
|
1039
|
+
i && a && (n.push({ id: Ue, component: "Text", text: a, variant: "h2" }), r.push(Ue)), i && l && (n.push({ id: _e, component: "Text", text: l, variant: "body" }), r.push(_e));
|
|
1040
|
+
for (const m of e.blocks ?? []) {
|
|
1041
|
+
const { node: p, dataKey: g, dataValue: v } = Wn(m);
|
|
1039
1042
|
p && (n.push(p), r.push(p.id), g && (o[g] = v));
|
|
1040
1043
|
}
|
|
1041
|
-
n.unshift({ id:
|
|
1042
|
-
const c = { root:
|
|
1044
|
+
n.unshift({ id: de, component: "Column", children: r });
|
|
1045
|
+
const c = { root: de, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
|
|
1043
1046
|
return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
|
|
1044
1047
|
}
|
|
1045
|
-
function
|
|
1048
|
+
function Zn(e) {
|
|
1046
1049
|
const t = /* @__PURE__ */ new Map();
|
|
1047
1050
|
for (const n of e.components ?? [])
|
|
1048
1051
|
n && typeof n.id == "string" && t.set(n.id, n);
|
|
1049
1052
|
return t;
|
|
1050
1053
|
}
|
|
1051
|
-
function
|
|
1054
|
+
function Me(e) {
|
|
1052
1055
|
const t = e.options;
|
|
1053
1056
|
return Array.isArray(t) ? t.map((n) => {
|
|
1054
1057
|
if (!n || typeof n != "object") return null;
|
|
@@ -1059,10 +1062,10 @@ function Pe(e) {
|
|
|
1059
1062
|
};
|
|
1060
1063
|
}).filter((n) => !!n) : [];
|
|
1061
1064
|
}
|
|
1062
|
-
function
|
|
1063
|
-
const t = typeof e.id == "string" ? e.id :
|
|
1064
|
-
if (
|
|
1065
|
-
return
|
|
1065
|
+
function Qn(e) {
|
|
1066
|
+
const t = typeof e.id == "string" ? e.id : re("block-"), n = String(e.component ?? ""), r = E(e.label) ?? E(e.text) ?? "", o = He(e.value), i = (l) => ({ id: t, type: l, label: r }), a = Dn(n);
|
|
1067
|
+
if (a)
|
|
1068
|
+
return a.fromComponent(e, i, { asLiteral: E, nameFromValue: He });
|
|
1066
1069
|
switch (n) {
|
|
1067
1070
|
case "Text": {
|
|
1068
1071
|
const l = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(l) || l === "title" || l === "subtitle";
|
|
@@ -1071,104 +1074,104 @@ function lr(e) {
|
|
|
1071
1074
|
case "TextField": {
|
|
1072
1075
|
const l = String(e.variant ?? "shortText");
|
|
1073
1076
|
let c = "text";
|
|
1074
|
-
l === "longText" ? c = "textarea" : l === "number" ? c = "number" :
|
|
1075
|
-
const u = { ...
|
|
1076
|
-
return
|
|
1077
|
+
l === "longText" ? c = "textarea" : l === "number" ? c = "number" : E(e.validationRegexp) === dt && (c = "email");
|
|
1078
|
+
const u = { ...i(c), name: o }, m = E(e.placeholder);
|
|
1079
|
+
return m && (u.placeholder = m), u;
|
|
1077
1080
|
}
|
|
1078
1081
|
case "CheckBox":
|
|
1079
|
-
return { ...
|
|
1082
|
+
return { ...i("toggle"), name: o };
|
|
1080
1083
|
case "SkoponSelect": {
|
|
1081
1084
|
const c = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
|
|
1082
|
-
...
|
|
1085
|
+
...i(c),
|
|
1083
1086
|
name: o,
|
|
1084
|
-
options:
|
|
1085
|
-
},
|
|
1086
|
-
return
|
|
1087
|
+
options: Me(e)
|
|
1088
|
+
}, m = E(e.placeholder);
|
|
1089
|
+
return m && (u.placeholder = m), u;
|
|
1087
1090
|
}
|
|
1088
1091
|
case "ChoicePicker": {
|
|
1089
|
-
const l =
|
|
1092
|
+
const l = E(e.skoponPickerType);
|
|
1090
1093
|
if (l === "select" || l === "multiselect" || l === "radio" || l === "checkbox") {
|
|
1091
|
-
const
|
|
1092
|
-
...
|
|
1094
|
+
const m = {
|
|
1095
|
+
...i(l),
|
|
1093
1096
|
name: o,
|
|
1094
|
-
options:
|
|
1095
|
-
}, p =
|
|
1096
|
-
return p && (
|
|
1097
|
+
options: Me(e)
|
|
1098
|
+
}, p = E(e.placeholder);
|
|
1099
|
+
return p && (m.placeholder = p), m;
|
|
1097
1100
|
}
|
|
1098
1101
|
const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1099
|
-
return { ...
|
|
1102
|
+
return { ...i(u), name: o, options: Me(e) };
|
|
1100
1103
|
}
|
|
1101
1104
|
case "DateTimeInput": {
|
|
1102
|
-
const l = e.enableDate === !0, c = e.enableTime === !0,
|
|
1103
|
-
return p && (
|
|
1105
|
+
const l = e.enableDate === !0, c = e.enableTime === !0, m = { ...i(!l && c ? "time" : "datetime"), name: o }, p = E(e.placeholder);
|
|
1106
|
+
return p && (m.placeholder = p), m;
|
|
1104
1107
|
}
|
|
1105
1108
|
case "SkoponMedia": {
|
|
1106
1109
|
const l = String(e.mediaType ?? "image");
|
|
1107
|
-
return
|
|
1110
|
+
return se(e, l === "video" ? "video" : l === "audio" ? "audio" : "image", r);
|
|
1108
1111
|
}
|
|
1109
1112
|
case "Image":
|
|
1110
|
-
return
|
|
1113
|
+
return se(e, "image", r);
|
|
1111
1114
|
case "Video":
|
|
1112
|
-
return
|
|
1115
|
+
return se(e, "video", r);
|
|
1113
1116
|
case "AudioPlayer":
|
|
1114
|
-
return
|
|
1117
|
+
return se(e, "audio", r);
|
|
1115
1118
|
case "FileUpload": {
|
|
1116
|
-
const l =
|
|
1119
|
+
const l = E(e.accept) ?? "", c = { ...i("file"), name: o };
|
|
1117
1120
|
return l && (c.fileAcceptExtensions = l.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (c.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (c.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (c.fileMinCount = e.minCount), typeof e.maxCount == "number" && (c.fileMaxCount = e.maxCount), c;
|
|
1118
1121
|
}
|
|
1119
1122
|
default:
|
|
1120
1123
|
return null;
|
|
1121
1124
|
}
|
|
1122
1125
|
}
|
|
1123
|
-
function
|
|
1126
|
+
function ht(e, t, n, r) {
|
|
1124
1127
|
if (n.has(e)) return;
|
|
1125
1128
|
n.add(e);
|
|
1126
1129
|
const o = t.get(e);
|
|
1127
1130
|
if (!o) return;
|
|
1128
|
-
const
|
|
1129
|
-
if ((
|
|
1130
|
-
for (const
|
|
1131
|
-
typeof
|
|
1131
|
+
const i = String(o.component ?? "");
|
|
1132
|
+
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
1133
|
+
for (const a of o.children)
|
|
1134
|
+
typeof a == "string" && ht(a, t, n, r);
|
|
1132
1135
|
return;
|
|
1133
1136
|
}
|
|
1134
1137
|
r.push(o);
|
|
1135
1138
|
}
|
|
1136
|
-
function
|
|
1139
|
+
function er(e, t) {
|
|
1137
1140
|
return t ? e.map((n) => {
|
|
1138
|
-
var
|
|
1139
|
-
const r = (
|
|
1141
|
+
var i;
|
|
1142
|
+
const r = (i = n.name) == null ? void 0 : i.trim();
|
|
1140
1143
|
if (!r || !(r in t)) return n;
|
|
1141
1144
|
const o = t[r];
|
|
1142
1145
|
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: o === !0 || o === "true" } : { ...n, defaultValue: o };
|
|
1143
1146
|
}) : e;
|
|
1144
1147
|
}
|
|
1145
|
-
function
|
|
1148
|
+
function tr(e) {
|
|
1146
1149
|
if (!e || !Array.isArray(e.components))
|
|
1147
|
-
return
|
|
1148
|
-
const t =
|
|
1149
|
-
|
|
1150
|
+
return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
1151
|
+
const t = Zn(e), n = [];
|
|
1152
|
+
ht(e.root ?? de, t, /* @__PURE__ */ new Set(), n);
|
|
1150
1153
|
let r = "", o = "";
|
|
1151
|
-
const
|
|
1152
|
-
for (const
|
|
1153
|
-
if (
|
|
1154
|
-
r =
|
|
1154
|
+
const i = [];
|
|
1155
|
+
for (const a of n) {
|
|
1156
|
+
if (a.id === Ue) {
|
|
1157
|
+
r = E(a.text) ?? r;
|
|
1155
1158
|
continue;
|
|
1156
1159
|
}
|
|
1157
|
-
if (
|
|
1158
|
-
o =
|
|
1160
|
+
if (a.id === _e) {
|
|
1161
|
+
o = E(a.text) ?? o;
|
|
1159
1162
|
continue;
|
|
1160
1163
|
}
|
|
1161
|
-
const l =
|
|
1162
|
-
l &&
|
|
1164
|
+
const l = Qn(a);
|
|
1165
|
+
l && i.push(l);
|
|
1163
1166
|
}
|
|
1164
|
-
return
|
|
1167
|
+
return pe({
|
|
1165
1168
|
title: r,
|
|
1166
1169
|
description: o,
|
|
1167
|
-
blocks:
|
|
1170
|
+
blocks: er(i, e.dataModel),
|
|
1168
1171
|
jsonSchema: {}
|
|
1169
1172
|
});
|
|
1170
1173
|
}
|
|
1171
|
-
function
|
|
1174
|
+
function nr(e, t) {
|
|
1172
1175
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1173
1176
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1174
1177
|
{
|
|
@@ -1181,24 +1184,24 @@ function ur(e, t) {
|
|
|
1181
1184
|
updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
|
|
1182
1185
|
}), o;
|
|
1183
1186
|
}
|
|
1184
|
-
function
|
|
1187
|
+
function gt(e) {
|
|
1185
1188
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1186
1189
|
}
|
|
1187
|
-
function
|
|
1190
|
+
function rr(e, t) {
|
|
1188
1191
|
if (!e || typeof e != "object") return null;
|
|
1189
|
-
const n = e, r =
|
|
1190
|
-
if (r && !
|
|
1192
|
+
const n = e, r = gt(n.a2ui) ? n.a2ui : void 0;
|
|
1193
|
+
if (r && !Ee(r)) return r;
|
|
1191
1194
|
const o = Array.isArray(n.blocks) ? n.blocks : [];
|
|
1192
1195
|
if (o.length === 0) return null;
|
|
1193
|
-
const
|
|
1196
|
+
const i = W({
|
|
1194
1197
|
title: typeof n.title == "string" ? n.title : "",
|
|
1195
1198
|
description: typeof n.description == "string" ? n.description : "",
|
|
1196
1199
|
blocks: o
|
|
1197
|
-
}),
|
|
1198
|
-
return
|
|
1200
|
+
}), a = ft(i, t);
|
|
1201
|
+
return Ee(a) ? null : a;
|
|
1199
1202
|
}
|
|
1200
|
-
function
|
|
1201
|
-
return
|
|
1203
|
+
function or(e, t, n) {
|
|
1204
|
+
return ft(
|
|
1202
1205
|
{
|
|
1203
1206
|
title: e.title,
|
|
1204
1207
|
description: e.description,
|
|
@@ -1207,88 +1210,88 @@ function dr(e, t, n) {
|
|
|
1207
1210
|
n
|
|
1208
1211
|
);
|
|
1209
1212
|
}
|
|
1210
|
-
function
|
|
1213
|
+
function ir(e) {
|
|
1211
1214
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1212
1215
|
return;
|
|
1213
1216
|
const t = e;
|
|
1214
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) &&
|
|
1217
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && gt(t.a2ui) ? tr(t.a2ui) : W({
|
|
1215
1218
|
title: typeof t.title == "string" ? t.title : "",
|
|
1216
1219
|
description: typeof t.description == "string" ? t.description : "",
|
|
1217
1220
|
blocks: Array.isArray(t.blocks) ? t.blocks : []
|
|
1218
1221
|
});
|
|
1219
1222
|
}
|
|
1220
|
-
function
|
|
1223
|
+
function ar(e, t, n) {
|
|
1221
1224
|
const r = e.model.surfacesMap.get(t);
|
|
1222
1225
|
if (!r) return {};
|
|
1223
1226
|
const o = {};
|
|
1224
|
-
for (const
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
+
for (const i of n) {
|
|
1228
|
+
const a = i.trim();
|
|
1229
|
+
a && (o[a] = r.dataModel.get(`/${a}`));
|
|
1227
1230
|
}
|
|
1228
1231
|
return o;
|
|
1229
1232
|
}
|
|
1230
|
-
function
|
|
1231
|
-
return
|
|
1233
|
+
function lr(e) {
|
|
1234
|
+
return W({
|
|
1232
1235
|
title: "",
|
|
1233
1236
|
description: "",
|
|
1234
1237
|
blocks: [e]
|
|
1235
1238
|
}).blocks[0];
|
|
1236
1239
|
}
|
|
1237
|
-
function
|
|
1238
|
-
var o,
|
|
1240
|
+
function sr(e, t) {
|
|
1241
|
+
var o, i;
|
|
1239
1242
|
const n = /* @__PURE__ */ new Map();
|
|
1240
|
-
for (const
|
|
1241
|
-
const l = (o =
|
|
1242
|
-
l && n.set(l,
|
|
1243
|
+
for (const a of t) {
|
|
1244
|
+
const l = (o = a.name) == null ? void 0 : o.trim();
|
|
1245
|
+
l && n.set(l, a);
|
|
1243
1246
|
}
|
|
1244
1247
|
const r = [];
|
|
1245
|
-
for (const
|
|
1246
|
-
if (
|
|
1247
|
-
r.push(
|
|
1248
|
+
for (const a of e.blocks) {
|
|
1249
|
+
if (Be(a.type)) {
|
|
1250
|
+
r.push(lr(a));
|
|
1248
1251
|
continue;
|
|
1249
1252
|
}
|
|
1250
|
-
if (!X(
|
|
1251
|
-
const l = (
|
|
1253
|
+
if (!X(a.type)) continue;
|
|
1254
|
+
const l = (i = a.name) == null ? void 0 : i.trim();
|
|
1252
1255
|
if (!l) continue;
|
|
1253
1256
|
const c = n.get(l);
|
|
1254
1257
|
c && r.push(c);
|
|
1255
1258
|
}
|
|
1256
1259
|
return r;
|
|
1257
1260
|
}
|
|
1258
|
-
function
|
|
1261
|
+
function cr(e, t) {
|
|
1259
1262
|
var r;
|
|
1260
1263
|
const n = {
|
|
1261
1264
|
...e,
|
|
1262
1265
|
name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
|
|
1263
1266
|
};
|
|
1264
|
-
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue),
|
|
1267
|
+
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), W({
|
|
1265
1268
|
title: "",
|
|
1266
1269
|
description: "",
|
|
1267
1270
|
blocks: [n]
|
|
1268
1271
|
}).blocks[0];
|
|
1269
1272
|
}
|
|
1270
|
-
function
|
|
1273
|
+
function yt(e) {
|
|
1271
1274
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1272
1275
|
const t = e;
|
|
1273
|
-
return Array.isArray(t.blocks) ?
|
|
1276
|
+
return Array.isArray(t.blocks) ? W({
|
|
1274
1277
|
title: typeof t.title == "string" ? t.title : "",
|
|
1275
1278
|
description: typeof t.description == "string" ? t.description : "",
|
|
1276
1279
|
blocks: t.blocks
|
|
1277
1280
|
}) : null;
|
|
1278
1281
|
}
|
|
1279
|
-
function
|
|
1280
|
-
var
|
|
1282
|
+
function ur(e, t) {
|
|
1283
|
+
var i, a, l, c, u, m;
|
|
1281
1284
|
const n = /* @__PURE__ */ new Map();
|
|
1282
1285
|
for (const p of (t == null ? void 0 : t.blocks) ?? [])
|
|
1283
|
-
X(p.type) && ((
|
|
1286
|
+
X(p.type) && ((i = p.name) != null && i.trim()) && n.set(p.name.trim(), p);
|
|
1284
1287
|
const r = [], o = [];
|
|
1285
1288
|
for (const p of e.blocks) {
|
|
1286
1289
|
if (!X(p.type)) continue;
|
|
1287
|
-
const g = (
|
|
1290
|
+
const g = (a = p.name) == null ? void 0 : a.trim();
|
|
1288
1291
|
if (!g) continue;
|
|
1289
1292
|
const v = n.get(g);
|
|
1290
|
-
v ? r.push(
|
|
1291
|
-
|
|
1293
|
+
v ? r.push(cr(v, p)) : o.push(
|
|
1294
|
+
W({
|
|
1292
1295
|
title: "",
|
|
1293
1296
|
description: "",
|
|
1294
1297
|
blocks: [p]
|
|
@@ -1298,26 +1301,26 @@ function vr(e, t) {
|
|
|
1298
1301
|
return {
|
|
1299
1302
|
matchedBlocks: r,
|
|
1300
1303
|
extraBlocks: o,
|
|
1301
|
-
renderBlocks:
|
|
1304
|
+
renderBlocks: sr(e, r),
|
|
1302
1305
|
title: ((l = e.title) == null ? void 0 : l.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
|
|
1303
|
-
description: ((u = e.description) == null ? void 0 : u.trim()) || ((
|
|
1306
|
+
description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1304
1307
|
};
|
|
1305
1308
|
}
|
|
1306
|
-
function
|
|
1309
|
+
function pr(e) {
|
|
1307
1310
|
const { type: t, defaultValue: n } = e;
|
|
1308
1311
|
return n !== void 0 ? t === "toggle" ? n === !0 || n === "true" : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? Array.isArray(n) ? n.map(String) : typeof n == "string" && n ? [n] : [] : n : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? [] : t === "number" ? null : "";
|
|
1309
1312
|
}
|
|
1310
|
-
function
|
|
1313
|
+
function vt(e) {
|
|
1311
1314
|
var n;
|
|
1312
1315
|
const t = {};
|
|
1313
1316
|
for (const r of e) {
|
|
1314
1317
|
if (!X(r.type)) continue;
|
|
1315
1318
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1316
|
-
o && (t[o] =
|
|
1319
|
+
o && (t[o] = pr(r));
|
|
1317
1320
|
}
|
|
1318
1321
|
return t;
|
|
1319
1322
|
}
|
|
1320
|
-
function
|
|
1323
|
+
function mr(e) {
|
|
1321
1324
|
return e.blocks.some(
|
|
1322
1325
|
(t) => {
|
|
1323
1326
|
var n;
|
|
@@ -1325,57 +1328,57 @@ function xr(e) {
|
|
|
1325
1328
|
}
|
|
1326
1329
|
);
|
|
1327
1330
|
}
|
|
1328
|
-
function
|
|
1331
|
+
function dr(e) {
|
|
1329
1332
|
return e.blocks.filter((t) => {
|
|
1330
1333
|
var n;
|
|
1331
|
-
return
|
|
1334
|
+
return Be(t.type) ? !0 : X(t.type) && !!((n = t.name) != null && n.trim());
|
|
1332
1335
|
});
|
|
1333
1336
|
}
|
|
1334
|
-
function
|
|
1337
|
+
function fr(e) {
|
|
1335
1338
|
return e.blocks.filter((t) => {
|
|
1336
1339
|
var n;
|
|
1337
1340
|
return X(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1338
1341
|
}).map((t) => t.name.trim());
|
|
1339
1342
|
}
|
|
1340
|
-
function
|
|
1343
|
+
function bt(e) {
|
|
1341
1344
|
return e.replace(/'/g, "'\\''");
|
|
1342
1345
|
}
|
|
1343
|
-
function
|
|
1346
|
+
function St(e, t) {
|
|
1344
1347
|
const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
|
|
1345
1348
|
return [
|
|
1346
1349
|
`curl -X POST '${n}' \\`,
|
|
1347
1350
|
" -H 'Content-Type: application/json' \\",
|
|
1348
|
-
` -d '${
|
|
1351
|
+
` -d '${bt(r)}'`
|
|
1349
1352
|
].join(`
|
|
1350
1353
|
`);
|
|
1351
1354
|
}
|
|
1352
|
-
function
|
|
1355
|
+
function hr(e, t) {
|
|
1353
1356
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1354
1357
|
}
|
|
1355
|
-
function
|
|
1358
|
+
function xt({
|
|
1356
1359
|
cardValues: e,
|
|
1357
1360
|
extraValues: t = {},
|
|
1358
1361
|
callbackUrl: n
|
|
1359
1362
|
}) {
|
|
1360
|
-
const r = (n ?? "").trim() || "<callback_url>", o =
|
|
1363
|
+
const r = (n ?? "").trim() || "<callback_url>", o = hr(e, t);
|
|
1361
1364
|
return [
|
|
1362
1365
|
`curl -X POST '${r}' \\`,
|
|
1363
1366
|
" -H 'Content-Type: application/json' \\",
|
|
1364
|
-
` -d '${
|
|
1367
|
+
` -d '${bt(o)}'`
|
|
1365
1368
|
].join(`
|
|
1366
1369
|
`);
|
|
1367
1370
|
}
|
|
1368
|
-
function
|
|
1369
|
-
const n =
|
|
1370
|
-
if (!n) return
|
|
1371
|
-
const r =
|
|
1372
|
-
return
|
|
1371
|
+
function gr(e, t) {
|
|
1372
|
+
const n = yt(e);
|
|
1373
|
+
if (!n) return St(e, t);
|
|
1374
|
+
const r = vt(n.blocks);
|
|
1375
|
+
return xt({ cardValues: r, callbackUrl: t });
|
|
1373
1376
|
}
|
|
1374
|
-
async function
|
|
1377
|
+
async function yr(e, t, n) {
|
|
1375
1378
|
const r = e.trim();
|
|
1376
1379
|
if (!r)
|
|
1377
1380
|
throw new Error("callback_url 为空");
|
|
1378
|
-
const
|
|
1381
|
+
const i = await ((n == null ? void 0 : n.fetch) ?? fetch)(r, {
|
|
1379
1382
|
method: "POST",
|
|
1380
1383
|
headers: {
|
|
1381
1384
|
"Content-Type": "application/json",
|
|
@@ -1383,22 +1386,22 @@ async function Ar(e, t, n) {
|
|
|
1383
1386
|
},
|
|
1384
1387
|
body: JSON.stringify(t ?? {})
|
|
1385
1388
|
});
|
|
1386
|
-
let
|
|
1387
|
-
if ((
|
|
1389
|
+
let a;
|
|
1390
|
+
if ((i.headers.get("content-type") ?? "").includes("application/json"))
|
|
1388
1391
|
try {
|
|
1389
|
-
|
|
1392
|
+
a = await i.json();
|
|
1390
1393
|
} catch {
|
|
1391
|
-
|
|
1394
|
+
a = void 0;
|
|
1392
1395
|
}
|
|
1393
1396
|
else
|
|
1394
1397
|
try {
|
|
1395
|
-
|
|
1398
|
+
a = await i.text();
|
|
1396
1399
|
} catch {
|
|
1397
|
-
|
|
1400
|
+
a = void 0;
|
|
1398
1401
|
}
|
|
1399
|
-
return { ok:
|
|
1402
|
+
return { ok: i.ok, status: i.status, body: a };
|
|
1400
1403
|
}
|
|
1401
|
-
async function
|
|
1404
|
+
async function Ct(e) {
|
|
1402
1405
|
var n;
|
|
1403
1406
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1404
1407
|
await navigator.clipboard.writeText(e);
|
|
@@ -1414,7 +1417,7 @@ async function $t(e) {
|
|
|
1414
1417
|
document.body.removeChild(t);
|
|
1415
1418
|
}
|
|
1416
1419
|
}
|
|
1417
|
-
async function
|
|
1420
|
+
async function vr(e) {
|
|
1418
1421
|
let t;
|
|
1419
1422
|
try {
|
|
1420
1423
|
t = await e.json();
|
|
@@ -1427,901 +1430,45 @@ async function Tr(e) {
|
|
|
1427
1430
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1428
1431
|
return t.data;
|
|
1429
1432
|
}
|
|
1430
|
-
function
|
|
1433
|
+
function io(e = {}) {
|
|
1431
1434
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1432
|
-
async function o(
|
|
1435
|
+
async function o(i) {
|
|
1433
1436
|
var p;
|
|
1434
|
-
const
|
|
1435
|
-
if (
|
|
1436
|
-
|
|
1437
|
-
else if (
|
|
1438
|
-
|
|
1437
|
+
const a = new URLSearchParams();
|
|
1438
|
+
if (i.formId !== void 0)
|
|
1439
|
+
a.set("form_id", String(i.formId));
|
|
1440
|
+
else if (i.formUniqueId)
|
|
1441
|
+
a.set("form_unique_id", i.formUniqueId);
|
|
1439
1442
|
else
|
|
1440
1443
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
1441
|
-
const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${
|
|
1444
|
+
const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${a.toString()}`, {
|
|
1442
1445
|
method: "GET",
|
|
1443
1446
|
headers: l
|
|
1444
|
-
}), u = await
|
|
1447
|
+
}), u = await vr(c), m = ir(u.form_definition);
|
|
1445
1448
|
return {
|
|
1446
1449
|
formUniqueId: u.form_unique_id,
|
|
1447
1450
|
formId: u.form_id,
|
|
1448
1451
|
disabled: u.disabled === 1,
|
|
1449
|
-
formDefinition:
|
|
1450
|
-
a2ui:
|
|
1452
|
+
formDefinition: m,
|
|
1453
|
+
a2ui: rr(u.form_definition) ?? void 0
|
|
1451
1454
|
};
|
|
1452
1455
|
}
|
|
1453
1456
|
return { fetchDetail: o };
|
|
1454
1457
|
}
|
|
1455
|
-
const
|
|
1456
|
-
:
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
:
|
|
1461
|
-
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
|
-
:where(.a2ui-light) {
|
|
1465
|
-
color-scheme: light;
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
:where(:root), :where(.a2ui-dark), :where(.a2ui-light) {
|
|
1469
|
-
--a2ui-color-background: light-dark(#eee, #111);
|
|
1470
|
-
--a2ui-color-on-background: light-dark(#333, #eee);
|
|
1471
|
-
|
|
1472
|
-
--a2ui-color-surface: light-dark(
|
|
1473
|
-
color-mix(in oklab, var(--a2ui-color-background) 85%, white),
|
|
1474
|
-
color-mix(in oklab, var(--a2ui-color-background) 95%, white)
|
|
1475
|
-
);
|
|
1476
|
-
--a2ui-color-on-surface: light-dark(#333, #eee);
|
|
1477
|
-
|
|
1478
|
-
--a2ui-color-primary: #17e;
|
|
1479
|
-
--a2ui-color-primary-light: ${Q("light", { colorVar: "--a2ui-color-primary" })};
|
|
1480
|
-
--a2ui-color-primary-dark: ${Q("dark", { colorVar: "--a2ui-color-primary" })};
|
|
1481
|
-
--a2ui-color-primary-hover: ${Q("hover", { darkVar: "--a2ui-color-primary-dark", lightVar: "--a2ui-color-primary-light" })};
|
|
1482
|
-
--a2ui-color-on-primary: #fff;
|
|
1483
|
-
|
|
1484
|
-
--a2ui-color-secondary: light-dark(#ddd, #333);
|
|
1485
|
-
--a2ui-color-secondary-light: ${Q("light", { colorVar: "--a2ui-color-secondary" })};
|
|
1486
|
-
--a2ui-color-secondary-dark: ${Q("dark", { colorVar: "--a2ui-color-secondary", percentage: 95 })};
|
|
1487
|
-
--a2ui-color-secondary-hover: ${Q("hover", { darkVar: "--a2ui-color-secondary-dark", lightVar: "--a2ui-color-secondary-light" })};
|
|
1488
|
-
--a2ui-color-on-secondary: light-dark(#333, #eee);
|
|
1489
|
-
|
|
1490
|
-
--a2ui-border-radius: 0.25rem;
|
|
1491
|
-
--a2ui-color-border: light-dark(#ccc, #444);
|
|
1492
|
-
--a2ui-border-width: 1px;
|
|
1493
|
-
--a2ui-border: 1px solid var(--a2ui-color-border, #ccc);
|
|
1494
|
-
|
|
1495
|
-
--a2ui-font-family-title: inherit;
|
|
1496
|
-
--a2ui-font-family-monospace: monospace;
|
|
1497
|
-
--a2ui-color-input: light-dark(#fff, #2a2a2a);
|
|
1498
|
-
--a2ui-color-on-input: light-dark(#333, #eee);
|
|
1499
|
-
|
|
1500
|
-
--a2ui-grid-base: 0.5rem;
|
|
1501
|
-
--a2ui-spacing-xs: calc(var(--a2ui-spacing-s) / 2);
|
|
1502
|
-
--a2ui-spacing-s: calc(var(--a2ui-spacing-m) / 2);
|
|
1503
|
-
--a2ui-spacing-m: var(--a2ui-grid-base);
|
|
1504
|
-
--a2ui-spacing-l: calc(var(--a2ui-spacing-m) * 2);
|
|
1505
|
-
--a2ui-spacing-xl: calc(var(--a2ui-spacing-l) * 2);
|
|
1506
|
-
|
|
1507
|
-
--a2ui-font-size: 1rem;
|
|
1508
|
-
--a2ui-font-scale: 1.2;
|
|
1509
|
-
--a2ui-font-size-xs: calc(var(--a2ui-font-size-s) / var(--a2ui-font-scale));
|
|
1510
|
-
--a2ui-font-size-s: calc(var(--a2ui-font-size-m) / var(--a2ui-font-scale));
|
|
1511
|
-
--a2ui-font-size-m: var(--a2ui-font-size);
|
|
1512
|
-
--a2ui-font-size-l: calc(var(--a2ui-font-size-m) * var(--a2ui-font-scale));
|
|
1513
|
-
--a2ui-font-size-xl: calc(var(--a2ui-font-size-l) * var(--a2ui-font-scale));
|
|
1514
|
-
--a2ui-font-size-2xl: calc(var(--a2ui-font-size-xl) * var(--a2ui-font-scale));
|
|
1515
|
-
|
|
1516
|
-
--a2ui-line-height-headings: 1.2;
|
|
1517
|
-
--a2ui-line-height-body: 1.5;
|
|
1518
|
-
}
|
|
1519
|
-
`;
|
|
1520
|
-
let fe;
|
|
1521
|
-
function Nr() {
|
|
1522
|
-
return fe || (fe = new CSSStyleSheet(), fe.replaceSync($r)), fe;
|
|
1523
|
-
}
|
|
1524
|
-
function Nt() {
|
|
1525
|
-
if (typeof document > "u")
|
|
1526
|
-
return;
|
|
1527
|
-
const e = Nr();
|
|
1528
|
-
document.adoptedStyleSheets.includes(e) || (document.adoptedStyleSheets = [...document.adoptedStyleSheets, e]);
|
|
1529
|
-
}
|
|
1530
|
-
function Q(e, t) {
|
|
1531
|
-
switch (e) {
|
|
1532
|
-
case "light": {
|
|
1533
|
-
const n = t;
|
|
1534
|
-
return `color-mix(in oklab, var(${n.colorVar}) ${n.percentage ?? 85}%, ${n.mixColor ?? "white"})`;
|
|
1535
|
-
}
|
|
1536
|
-
case "dark": {
|
|
1537
|
-
const n = t;
|
|
1538
|
-
return `color-mix(in oklab, var(${n.colorVar}) ${n.percentage ?? 85}%, ${n.mixColor ?? "black"})`;
|
|
1539
|
-
}
|
|
1540
|
-
case "hover": {
|
|
1541
|
-
const n = t;
|
|
1542
|
-
return `light-dark(var(${n.darkVar}), var(${n.lightVar}))`;
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
const Ir = `
|
|
1547
|
-
&:not([disabled]) {
|
|
1548
|
-
cursor: pointer;
|
|
1549
|
-
opacity: var(--opacity, 0);
|
|
1550
|
-
transition: opacity var(--speed, 0.2s) cubic-bezier(0, 0, 0.3, 1);
|
|
1551
|
-
|
|
1552
|
-
&:hover,
|
|
1553
|
-
&:focus {
|
|
1554
|
-
opacity: 1;
|
|
1555
|
-
}
|
|
1556
|
-
}`, zr = `
|
|
1557
|
-
${new Array(21).fill(0).map((e, t) => `.behavior-ho-${t * 5} {
|
|
1558
|
-
--opacity: ${t / 20};
|
|
1559
|
-
${Ir}
|
|
1560
|
-
}`).join(`
|
|
1561
|
-
`)}
|
|
1562
|
-
|
|
1563
|
-
.behavior-o-s {
|
|
1564
|
-
overflow: scroll;
|
|
1565
|
-
}
|
|
1566
|
-
|
|
1567
|
-
.behavior-o-a {
|
|
1568
|
-
overflow: auto;
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
.behavior-o-h {
|
|
1572
|
-
overflow: hidden;
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
|
-
.behavior-sw-n {
|
|
1576
|
-
scrollbar-width: none;
|
|
1577
|
-
}
|
|
1578
|
-
`, z = 4, Mr = `
|
|
1579
|
-
${new Array(25).fill(0).map((e, t) => `
|
|
1580
|
-
.border-bw-${t} { border-width: ${t}px; }
|
|
1581
|
-
.border-btw-${t} { border-top-width: ${t}px; }
|
|
1582
|
-
.border-bbw-${t} { border-bottom-width: ${t}px; }
|
|
1583
|
-
.border-blw-${t} { border-left-width: ${t}px; }
|
|
1584
|
-
.border-brw-${t} { border-right-width: ${t}px; }
|
|
1585
|
-
|
|
1586
|
-
.border-ow-${t} { outline-width: ${t}px; }
|
|
1587
|
-
.border-br-${t} { border-radius: ${t * z}px; overflow: hidden;}`).join(`
|
|
1588
|
-
`)}
|
|
1589
|
-
|
|
1590
|
-
.border-br-50pc {
|
|
1591
|
-
border-radius: 50%;
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
.border-bs-s {
|
|
1595
|
-
border-style: solid;
|
|
1596
|
-
}
|
|
1597
|
-
`, It = [
|
|
1598
|
-
0,
|
|
1599
|
-
5,
|
|
1600
|
-
10,
|
|
1601
|
-
15,
|
|
1602
|
-
20,
|
|
1603
|
-
25,
|
|
1604
|
-
30,
|
|
1605
|
-
35,
|
|
1606
|
-
40,
|
|
1607
|
-
50,
|
|
1608
|
-
60,
|
|
1609
|
-
70,
|
|
1610
|
-
80,
|
|
1611
|
-
90,
|
|
1612
|
-
95,
|
|
1613
|
-
98,
|
|
1614
|
-
99,
|
|
1615
|
-
100
|
|
1616
|
-
];
|
|
1617
|
-
function D(e) {
|
|
1618
|
-
return e.startsWith("nv") ? `--nv-${e.slice(2)}` : `--${e[0]}-${e.slice(1)}`;
|
|
1619
|
-
}
|
|
1620
|
-
const ee = (e) => `
|
|
1621
|
-
${e.map((t) => {
|
|
1622
|
-
const n = Ee(t);
|
|
1623
|
-
return `.color-bc-${t} { border-color: light-dark(var(${D(t)}), var(${D(n)})); }`;
|
|
1624
|
-
}).join(`
|
|
1625
|
-
`)}
|
|
1626
|
-
|
|
1627
|
-
${e.map((t) => {
|
|
1628
|
-
const n = Ee(t), r = [
|
|
1629
|
-
`.color-bgc-${t} { background-color: light-dark(var(${D(t)}), var(${D(n)})); }`,
|
|
1630
|
-
`.color-bbgc-${t}::backdrop { background-color: light-dark(var(${D(t)}), var(${D(n)})); }`
|
|
1631
|
-
];
|
|
1632
|
-
for (let o = 0.1; o < 1; o += 0.1)
|
|
1633
|
-
r.push(`.color-bbgc-${t}_${(o * 100).toFixed(0)}::backdrop {
|
|
1634
|
-
background-color: light-dark(oklch(from var(${D(t)}) l c h / calc(alpha * ${o.toFixed(1)})), oklch(from var(${D(n)}) l c h / calc(alpha * ${o.toFixed(1)})) );
|
|
1635
|
-
}
|
|
1636
|
-
`);
|
|
1637
|
-
return r.join(`
|
|
1638
|
-
`);
|
|
1639
|
-
}).join(`
|
|
1640
|
-
`)}
|
|
1641
|
-
|
|
1642
|
-
${e.map((t) => {
|
|
1643
|
-
const n = Ee(t);
|
|
1644
|
-
return `.color-c-${t} { color: light-dark(var(${D(t)}), var(${D(n)})); }`;
|
|
1645
|
-
}).join(`
|
|
1646
|
-
`)}
|
|
1647
|
-
`, Ee = (e) => {
|
|
1648
|
-
const t = e.match(/^([a-z]+)(\d+)$/);
|
|
1649
|
-
if (!t)
|
|
1650
|
-
return e;
|
|
1651
|
-
const [, n, r] = t, a = 100 - parseInt(r, 10), i = It.reduce((l, c) => Math.abs(c - a) < Math.abs(l - a) ? c : l);
|
|
1652
|
-
return `${n}${i}`;
|
|
1653
|
-
}, te = (e) => It.map((t) => `${e}${t}`), Fr = [
|
|
1654
|
-
ee(te("p")),
|
|
1655
|
-
ee(te("s")),
|
|
1656
|
-
ee(te("t")),
|
|
1657
|
-
ee(te("n")),
|
|
1658
|
-
ee(te("nv")),
|
|
1659
|
-
ee(te("e")),
|
|
1660
|
-
`
|
|
1661
|
-
.color-bgc-transparent {
|
|
1662
|
-
background-color: transparent;
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
:host {
|
|
1666
|
-
color-scheme: var(--color-scheme);
|
|
1667
|
-
}
|
|
1668
|
-
`
|
|
1669
|
-
], _r = `
|
|
1670
|
-
.g-icon {
|
|
1671
|
-
font-family: "Material Symbols Outlined", "Google Symbols";
|
|
1672
|
-
font-weight: normal;
|
|
1673
|
-
font-style: normal;
|
|
1674
|
-
font-display: optional;
|
|
1675
|
-
font-size: 24px;
|
|
1676
|
-
width: 1em;
|
|
1677
|
-
height: 1em;
|
|
1678
|
-
user-select: none;
|
|
1679
|
-
line-height: 1;
|
|
1680
|
-
letter-spacing: normal;
|
|
1681
|
-
text-transform: none;
|
|
1682
|
-
display: inline-block;
|
|
1683
|
-
white-space: nowrap;
|
|
1684
|
-
word-wrap: normal;
|
|
1685
|
-
direction: ltr;
|
|
1686
|
-
font-feature-settings: "liga";
|
|
1687
|
-
-webkit-font-feature-settings: "liga";
|
|
1688
|
-
-webkit-font-smoothing: antialiased;
|
|
1689
|
-
text-rendering: optimizeLegibility;
|
|
1690
|
-
-moz-osx-font-smoothing: grayscale;
|
|
1691
|
-
overflow: hidden;
|
|
1692
|
-
|
|
1693
|
-
font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 48,
|
|
1694
|
-
"ROND" 100;
|
|
1695
|
-
|
|
1696
|
-
&.filled {
|
|
1697
|
-
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 48,
|
|
1698
|
-
"ROND" 100;
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
&.filled-heavy {
|
|
1702
|
-
font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 48,
|
|
1703
|
-
"ROND" 100;
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
`, Pr = `
|
|
1707
|
-
:host {
|
|
1708
|
-
${new Array(16).fill(0).map((e, t) => `--g-${t + 1}: ${(t + 1) * z}px;`).join(`
|
|
1709
|
-
`)}
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
${new Array(49).fill(0).map((e, t) => {
|
|
1713
|
-
const n = t - 24, r = n < 0 ? `n${Math.abs(n)}` : n.toString();
|
|
1714
|
-
return `
|
|
1715
|
-
.layout-p-${r} { --padding: ${n * z}px; padding: var(--padding); }
|
|
1716
|
-
.layout-pt-${r} { padding-top: ${n * z}px; }
|
|
1717
|
-
.layout-pr-${r} { padding-right: ${n * z}px; }
|
|
1718
|
-
.layout-pb-${r} { padding-bottom: ${n * z}px; }
|
|
1719
|
-
.layout-pl-${r} { padding-left: ${n * z}px; }
|
|
1720
|
-
|
|
1721
|
-
.layout-m-${r} { --margin: ${n * z}px; margin: var(--margin); }
|
|
1722
|
-
.layout-mt-${r} { margin-top: ${n * z}px; }
|
|
1723
|
-
.layout-mr-${r} { margin-right: ${n * z}px; }
|
|
1724
|
-
.layout-mb-${r} { margin-bottom: ${n * z}px; }
|
|
1725
|
-
.layout-ml-${r} { margin-left: ${n * z}px; }
|
|
1726
|
-
|
|
1727
|
-
.layout-t-${r} { top: ${n * z}px; }
|
|
1728
|
-
.layout-r-${r} { right: ${n * z}px; }
|
|
1729
|
-
.layout-b-${r} { bottom: ${n * z}px; }
|
|
1730
|
-
.layout-l-${r} { left: ${n * z}px; }`;
|
|
1731
|
-
}).join(`
|
|
1732
|
-
`)}
|
|
1733
|
-
|
|
1734
|
-
${new Array(25).fill(0).map((e, t) => `
|
|
1735
|
-
.layout-g-${t} { gap: ${t * z}px; }`).join(`
|
|
1736
|
-
`)}
|
|
1737
|
-
|
|
1738
|
-
${new Array(8).fill(0).map((e, t) => `
|
|
1739
|
-
.layout-grd-col${t + 1} { grid-template-columns: ${"1fr ".repeat(t + 1).trim()}; }`).join(`
|
|
1740
|
-
`)}
|
|
1741
|
-
|
|
1742
|
-
.layout-pos-a {
|
|
1743
|
-
position: absolute;
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
.layout-pos-rel {
|
|
1747
|
-
position: relative;
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
.layout-dsp-none {
|
|
1751
|
-
display: none;
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
.layout-dsp-block {
|
|
1755
|
-
display: block;
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
.layout-dsp-grid {
|
|
1759
|
-
display: grid;
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
|
-
.layout-dsp-iflex {
|
|
1763
|
-
display: inline-flex;
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
.layout-dsp-flexvert {
|
|
1767
|
-
display: flex;
|
|
1768
|
-
flex-direction: column;
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
.layout-dsp-flexhor {
|
|
1772
|
-
display: flex;
|
|
1773
|
-
flex-direction: row;
|
|
1774
|
-
}
|
|
1775
|
-
|
|
1776
|
-
.layout-fw-w {
|
|
1777
|
-
flex-wrap: wrap;
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
.layout-al-fs {
|
|
1781
|
-
align-items: start;
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
.layout-al-fe {
|
|
1785
|
-
align-items: end;
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
.layout-al-c {
|
|
1789
|
-
align-items: center;
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
.layout-as-n {
|
|
1793
|
-
align-self: normal;
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
.layout-js-c {
|
|
1797
|
-
justify-self: center;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
.layout-sp-c {
|
|
1801
|
-
justify-content: center;
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
.layout-sp-ev {
|
|
1805
|
-
justify-content: space-evenly;
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
.layout-sp-bt {
|
|
1809
|
-
justify-content: space-between;
|
|
1810
|
-
}
|
|
1811
|
-
|
|
1812
|
-
.layout-sp-s {
|
|
1813
|
-
justify-content: start;
|
|
1814
|
-
}
|
|
1815
|
-
|
|
1816
|
-
.layout-sp-e {
|
|
1817
|
-
justify-content: end;
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
.layout-ji-e {
|
|
1821
|
-
justify-items: end;
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
.layout-r-none {
|
|
1825
|
-
resize: none;
|
|
1826
|
-
}
|
|
1827
|
-
|
|
1828
|
-
.layout-fs-c {
|
|
1829
|
-
field-sizing: content;
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1832
|
-
.layout-fs-n {
|
|
1833
|
-
field-sizing: none;
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
.layout-flx-0 {
|
|
1837
|
-
flex: 0 0 auto;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
.layout-flx-1 {
|
|
1841
|
-
flex: 1 0 auto;
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
.layout-c-s {
|
|
1845
|
-
contain: strict;
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
/** Widths **/
|
|
1849
|
-
|
|
1850
|
-
${new Array(10).fill(0).map((e, t) => {
|
|
1851
|
-
const n = (t + 1) * 10;
|
|
1852
|
-
return `.layout-w-${n} { width: ${n}%; max-width: ${n}%; }`;
|
|
1853
|
-
}).join(`
|
|
1854
|
-
`)}
|
|
1855
|
-
|
|
1856
|
-
${new Array(16).fill(0).map((e, t) => {
|
|
1857
|
-
const n = t * z;
|
|
1858
|
-
return `.layout-wp-${t} { width: ${n}px; }`;
|
|
1859
|
-
}).join(`
|
|
1860
|
-
`)}
|
|
1861
|
-
|
|
1862
|
-
/** Heights **/
|
|
1863
|
-
|
|
1864
|
-
${new Array(10).fill(0).map((e, t) => {
|
|
1865
|
-
const n = (t + 1) * 10;
|
|
1866
|
-
return `.layout-h-${n} { height: ${n}%; }`;
|
|
1867
|
-
}).join(`
|
|
1868
|
-
`)}
|
|
1869
|
-
|
|
1870
|
-
${new Array(16).fill(0).map((e, t) => {
|
|
1871
|
-
const n = t * z;
|
|
1872
|
-
return `.layout-hp-${t} { height: ${n}px; }`;
|
|
1873
|
-
}).join(`
|
|
1874
|
-
`)}
|
|
1875
|
-
|
|
1876
|
-
.layout-el-cv {
|
|
1877
|
-
& img,
|
|
1878
|
-
& video {
|
|
1879
|
-
width: 100%;
|
|
1880
|
-
height: 100%;
|
|
1881
|
-
object-fit: cover;
|
|
1882
|
-
margin: 0;
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
|
|
1886
|
-
.layout-ar-sq {
|
|
1887
|
-
aspect-ratio: 1 / 1;
|
|
1888
|
-
}
|
|
1889
|
-
|
|
1890
|
-
.layout-ex-fb {
|
|
1891
|
-
margin: calc(var(--padding) * -1) 0 0 calc(var(--padding) * -1);
|
|
1892
|
-
width: calc(100% + var(--padding) * 2);
|
|
1893
|
-
height: calc(100% + var(--padding) * 2);
|
|
1894
|
-
}
|
|
1895
|
-
`, Er = `
|
|
1896
|
-
${new Array(21).fill(0).map((e, t) => `.opacity-el-${t * 5} { opacity: ${t / 20}; }`).join(`
|
|
1897
|
-
`)}
|
|
1898
|
-
`, Ur = `
|
|
1899
|
-
:host {
|
|
1900
|
-
--default-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
1901
|
-
--default-font-family-mono: "Courier New", Courier, monospace;
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
.typography-f-s {
|
|
1905
|
-
font-family: var(--font-family, var(--default-font-family));
|
|
1906
|
-
font-optical-sizing: auto;
|
|
1907
|
-
font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0;
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
.typography-f-sf {
|
|
1911
|
-
font-family: var(--font-family-flex, var(--default-font-family));
|
|
1912
|
-
font-optical-sizing: auto;
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
.typography-f-c {
|
|
1916
|
-
font-family: var(--font-family-mono, var(--default-font-family));
|
|
1917
|
-
font-optical-sizing: auto;
|
|
1918
|
-
font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0;
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
.typography-v-r {
|
|
1922
|
-
font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 100;
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
.typography-ta-s {
|
|
1926
|
-
text-align: start;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
.typography-ta-c {
|
|
1930
|
-
text-align: center;
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
.typography-fs-n {
|
|
1934
|
-
font-style: normal;
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
.typography-fs-i {
|
|
1938
|
-
font-style: italic;
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
.typography-sz-ls {
|
|
1942
|
-
font-size: 11px;
|
|
1943
|
-
line-height: 16px;
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
.typography-sz-lm {
|
|
1947
|
-
font-size: 12px;
|
|
1948
|
-
line-height: 16px;
|
|
1949
|
-
}
|
|
1950
|
-
|
|
1951
|
-
.typography-sz-ll {
|
|
1952
|
-
font-size: 14px;
|
|
1953
|
-
line-height: 20px;
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
.typography-sz-bs {
|
|
1957
|
-
font-size: 12px;
|
|
1958
|
-
line-height: 16px;
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
.typography-sz-bm {
|
|
1962
|
-
font-size: 14px;
|
|
1963
|
-
line-height: 20px;
|
|
1964
|
-
}
|
|
1965
|
-
|
|
1966
|
-
.typography-sz-bl {
|
|
1967
|
-
font-size: 16px;
|
|
1968
|
-
line-height: 24px;
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
.typography-sz-ts {
|
|
1972
|
-
font-size: 14px;
|
|
1973
|
-
line-height: 20px;
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
.typography-sz-tm {
|
|
1977
|
-
font-size: 16px;
|
|
1978
|
-
line-height: 24px;
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
.typography-sz-tl {
|
|
1982
|
-
font-size: 22px;
|
|
1983
|
-
line-height: 28px;
|
|
1984
|
-
}
|
|
1985
|
-
|
|
1986
|
-
.typography-sz-hs {
|
|
1987
|
-
font-size: 24px;
|
|
1988
|
-
line-height: 32px;
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
.typography-sz-hm {
|
|
1992
|
-
font-size: 28px;
|
|
1993
|
-
line-height: 36px;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
.typography-sz-hl {
|
|
1997
|
-
font-size: 32px;
|
|
1998
|
-
line-height: 40px;
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
.typography-sz-ds {
|
|
2002
|
-
font-size: 36px;
|
|
2003
|
-
line-height: 44px;
|
|
2004
|
-
}
|
|
2005
|
-
|
|
2006
|
-
.typography-sz-dm {
|
|
2007
|
-
font-size: 45px;
|
|
2008
|
-
line-height: 52px;
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
.typography-sz-dl {
|
|
2012
|
-
font-size: 57px;
|
|
2013
|
-
line-height: 64px;
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
.typography-ws-p {
|
|
2017
|
-
white-space: pre-line;
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
.typography-ws-nw {
|
|
2021
|
-
white-space: nowrap;
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
|
-
.typography-td-none {
|
|
2025
|
-
text-decoration: none;
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
|
-
/** Weights **/
|
|
2029
|
-
|
|
2030
|
-
${new Array(9).fill(0).map((e, t) => {
|
|
2031
|
-
const n = (t + 1) * 100;
|
|
2032
|
-
return `.typography-w-${n} { font-weight: ${n}; }`;
|
|
2033
|
-
}).join(`
|
|
2034
|
-
`)}
|
|
2035
|
-
`, jr = [zr, Mr, Fr, _r, Pr, Er, Ur].flat(1 / 0).join(`
|
|
2036
|
-
`);
|
|
2037
|
-
var Rr = `
|
|
2038
|
-
@layer a2ui-reset {
|
|
2039
|
-
:where(.a2ui-surface) :where(*:not(svg, svg *:not(foreignObject *))) {
|
|
2040
|
-
all: revert;
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
`, Or = jr.replace(
|
|
2044
|
-
/:host\s*\{/g,
|
|
2045
|
-
".a2ui-surface {"
|
|
2046
|
-
), Vr = `
|
|
2047
|
-
.a2ui-surface .a2ui-card {
|
|
2048
|
-
display: block;
|
|
2049
|
-
flex: var(--weight);
|
|
2050
|
-
min-height: 0;
|
|
2051
|
-
overflow: auto;
|
|
2052
|
-
}
|
|
2053
|
-
.a2ui-surface .a2ui-card > section {
|
|
2054
|
-
height: 100%;
|
|
2055
|
-
width: 100%;
|
|
2056
|
-
min-height: 0;
|
|
2057
|
-
overflow: auto;
|
|
2058
|
-
}
|
|
2059
|
-
.a2ui-surface .a2ui-card > section > * {
|
|
2060
|
-
height: 100%;
|
|
2061
|
-
width: 100%;
|
|
2062
|
-
}
|
|
2063
|
-
|
|
2064
|
-
.a2ui-surface .a2ui-divider {
|
|
2065
|
-
display: block;
|
|
2066
|
-
min-height: 0;
|
|
2067
|
-
overflow: auto;
|
|
2068
|
-
}
|
|
2069
|
-
:where(.a2ui-surface .a2ui-divider) hr {
|
|
2070
|
-
height: 1px;
|
|
2071
|
-
background: #ccc;
|
|
2072
|
-
border: none;
|
|
2073
|
-
}
|
|
2074
|
-
|
|
2075
|
-
.a2ui-surface .a2ui-text {
|
|
2076
|
-
display: block;
|
|
2077
|
-
flex: var(--weight);
|
|
2078
|
-
}
|
|
2079
|
-
:where(.a2ui-surface .a2ui-text) h1,
|
|
2080
|
-
:where(.a2ui-surface .a2ui-text) h2,
|
|
2081
|
-
:where(.a2ui-surface .a2ui-text) h3,
|
|
2082
|
-
:where(.a2ui-surface .a2ui-text) h4,
|
|
2083
|
-
:where(.a2ui-surface .a2ui-text) h5 {
|
|
2084
|
-
line-height: inherit;
|
|
2085
|
-
font: inherit;
|
|
2086
|
-
}
|
|
2087
|
-
.a2ui-surface .a2ui-text p {
|
|
2088
|
-
margin: 0;
|
|
2089
|
-
}
|
|
2090
|
-
|
|
2091
|
-
.a2ui-surface .a2ui-textfield {
|
|
2092
|
-
display: flex;
|
|
2093
|
-
flex: var(--weight);
|
|
2094
|
-
}
|
|
2095
|
-
:where(.a2ui-surface .a2ui-textfield) input {
|
|
2096
|
-
display: block;
|
|
2097
|
-
width: 100%;
|
|
2098
|
-
}
|
|
2099
|
-
:where(.a2ui-surface .a2ui-textfield) label {
|
|
2100
|
-
display: block;
|
|
2101
|
-
margin-bottom: 4px;
|
|
2102
|
-
}
|
|
2103
|
-
:where(.a2ui-surface .a2ui-textfield) textarea {
|
|
2104
|
-
display: block;
|
|
2105
|
-
width: 100%;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
.a2ui-surface .a2ui-checkbox {
|
|
2109
|
-
display: block;
|
|
2110
|
-
flex: var(--weight);
|
|
2111
|
-
min-height: 0;
|
|
2112
|
-
overflow: auto;
|
|
2113
|
-
}
|
|
2114
|
-
:where(.a2ui-surface .a2ui-checkbox) input {
|
|
2115
|
-
display: block;
|
|
2116
|
-
width: 100%;
|
|
2117
|
-
}
|
|
2118
|
-
|
|
2119
|
-
.a2ui-surface .a2ui-slider {
|
|
2120
|
-
display: block;
|
|
2121
|
-
flex: var(--weight);
|
|
2122
|
-
}
|
|
2123
|
-
:where(.a2ui-surface .a2ui-slider) input {
|
|
2124
|
-
display: block;
|
|
2125
|
-
width: 100%;
|
|
2126
|
-
}
|
|
2127
|
-
|
|
2128
|
-
.a2ui-surface .a2ui-button {
|
|
2129
|
-
display: block;
|
|
2130
|
-
flex: var(--weight);
|
|
2131
|
-
min-height: 0;
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
.a2ui-surface .a2ui-icon {
|
|
2135
|
-
display: block;
|
|
2136
|
-
flex: var(--weight);
|
|
2137
|
-
min-height: 0;
|
|
2138
|
-
overflow: auto;
|
|
2139
|
-
}
|
|
2140
|
-
:where(.a2ui-surface .a2ui-icon) .g-icon {
|
|
2141
|
-
font-size: 24px;
|
|
2142
|
-
}
|
|
2143
|
-
|
|
2144
|
-
.a2ui-surface .a2ui-tabs {
|
|
2145
|
-
display: block;
|
|
2146
|
-
flex: var(--weight);
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
|
-
.a2ui-surface .a2ui-modal {
|
|
2150
|
-
display: block;
|
|
2151
|
-
flex: var(--weight);
|
|
2152
|
-
}
|
|
2153
|
-
:where(.a2ui-surface .a2ui-modal) dialog {
|
|
2154
|
-
padding: 0;
|
|
2155
|
-
border: none;
|
|
2156
|
-
background: none;
|
|
2157
|
-
}
|
|
2158
|
-
.a2ui-surface .a2ui-modal dialog section #controls {
|
|
2159
|
-
display: flex;
|
|
2160
|
-
justify-content: end;
|
|
2161
|
-
margin-bottom: 4px;
|
|
2162
|
-
}
|
|
2163
|
-
.a2ui-surface .a2ui-modal dialog section #controls button {
|
|
2164
|
-
padding: 0;
|
|
2165
|
-
background: none;
|
|
2166
|
-
width: 20px;
|
|
2167
|
-
height: 20px;
|
|
2168
|
-
cursor: pointer;
|
|
2169
|
-
border: none;
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
.a2ui-surface .a2ui-image {
|
|
2173
|
-
display: block;
|
|
2174
|
-
flex: var(--weight);
|
|
2175
|
-
min-height: 0;
|
|
2176
|
-
overflow: auto;
|
|
2177
|
-
}
|
|
2178
|
-
:where(.a2ui-surface .a2ui-image) img {
|
|
2179
|
-
display: block;
|
|
2180
|
-
width: 100%;
|
|
2181
|
-
height: 100%;
|
|
2182
|
-
object-fit: var(--object-fit, fill);
|
|
2183
|
-
}
|
|
2184
|
-
|
|
2185
|
-
.a2ui-surface .a2ui-video {
|
|
2186
|
-
display: block;
|
|
2187
|
-
flex: var(--weight);
|
|
2188
|
-
min-height: 0;
|
|
2189
|
-
overflow: auto;
|
|
2190
|
-
}
|
|
2191
|
-
:where(.a2ui-surface .a2ui-video) video {
|
|
2192
|
-
display: block;
|
|
2193
|
-
width: 100%;
|
|
2194
|
-
}
|
|
2195
|
-
|
|
2196
|
-
.a2ui-surface .a2ui-audio {
|
|
2197
|
-
display: block;
|
|
2198
|
-
flex: var(--weight);
|
|
2199
|
-
min-height: 0;
|
|
2200
|
-
overflow: auto;
|
|
2201
|
-
}
|
|
2202
|
-
:where(.a2ui-surface .a2ui-audio) audio {
|
|
2203
|
-
display: block;
|
|
2204
|
-
width: 100%;
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
|
-
.a2ui-surface .a2ui-multiplechoice {
|
|
2208
|
-
display: block;
|
|
2209
|
-
flex: var(--weight);
|
|
2210
|
-
min-height: 0;
|
|
2211
|
-
overflow: auto;
|
|
2212
|
-
}
|
|
2213
|
-
:where(.a2ui-surface .a2ui-multiplechoice) select {
|
|
2214
|
-
width: 100%;
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
.a2ui-surface .a2ui-column {
|
|
2218
|
-
display: flex;
|
|
2219
|
-
flex: var(--weight);
|
|
2220
|
-
}
|
|
2221
|
-
.a2ui-surface .a2ui-column > section {
|
|
2222
|
-
display: flex;
|
|
2223
|
-
flex-direction: column;
|
|
2224
|
-
min-width: 100%;
|
|
2225
|
-
height: 100%;
|
|
2226
|
-
}
|
|
2227
|
-
.a2ui-surface .a2ui-column[data-alignment="start"] > section { align-items: start; }
|
|
2228
|
-
.a2ui-surface .a2ui-column[data-alignment="center"] > section { align-items: center; }
|
|
2229
|
-
.a2ui-surface .a2ui-column[data-alignment="end"] > section { align-items: end; }
|
|
2230
|
-
.a2ui-surface .a2ui-column[data-alignment="stretch"] > section { align-items: stretch; }
|
|
2231
|
-
.a2ui-surface .a2ui-column[data-distribution="start"] > section { justify-content: start; }
|
|
2232
|
-
.a2ui-surface .a2ui-column[data-distribution="center"] > section { justify-content: center; }
|
|
2233
|
-
.a2ui-surface .a2ui-column[data-distribution="end"] > section { justify-content: end; }
|
|
2234
|
-
.a2ui-surface .a2ui-column[data-distribution="spaceBetween"] > section { justify-content: space-between; }
|
|
2235
|
-
.a2ui-surface .a2ui-column[data-distribution="spaceAround"] > section { justify-content: space-around; }
|
|
2236
|
-
.a2ui-surface .a2ui-column[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
|
|
2237
|
-
|
|
2238
|
-
.a2ui-surface .a2ui-row {
|
|
2239
|
-
display: flex;
|
|
2240
|
-
flex: var(--weight);
|
|
2241
|
-
}
|
|
2242
|
-
.a2ui-surface .a2ui-row > section {
|
|
2243
|
-
display: flex;
|
|
2244
|
-
flex-direction: row;
|
|
2245
|
-
width: 100%;
|
|
2246
|
-
min-height: 100%;
|
|
2247
|
-
}
|
|
2248
|
-
.a2ui-surface .a2ui-row[data-alignment="start"] > section { align-items: start; }
|
|
2249
|
-
.a2ui-surface .a2ui-row[data-alignment="center"] > section { align-items: center; }
|
|
2250
|
-
.a2ui-surface .a2ui-row[data-alignment="end"] > section { align-items: end; }
|
|
2251
|
-
.a2ui-surface .a2ui-row[data-alignment="stretch"] > section { align-items: stretch; }
|
|
2252
|
-
.a2ui-surface .a2ui-row[data-distribution="start"] > section { justify-content: start; }
|
|
2253
|
-
.a2ui-surface .a2ui-row[data-distribution="center"] > section { justify-content: center; }
|
|
2254
|
-
.a2ui-surface .a2ui-row[data-distribution="end"] > section { justify-content: end; }
|
|
2255
|
-
.a2ui-surface .a2ui-row[data-distribution="spaceBetween"] > section { justify-content: space-between; }
|
|
2256
|
-
.a2ui-surface .a2ui-row[data-distribution="spaceAround"] > section { justify-content: space-around; }
|
|
2257
|
-
.a2ui-surface .a2ui-row[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
|
|
2258
|
-
|
|
2259
|
-
.a2ui-surface .a2ui-list {
|
|
2260
|
-
display: block;
|
|
2261
|
-
flex: var(--weight);
|
|
2262
|
-
min-height: 0;
|
|
2263
|
-
overflow: auto;
|
|
2264
|
-
}
|
|
2265
|
-
.a2ui-surface .a2ui-list[data-direction="vertical"] > section {
|
|
2266
|
-
display: grid;
|
|
2267
|
-
}
|
|
2268
|
-
.a2ui-surface .a2ui-list[data-direction="horizontal"] > section {
|
|
2269
|
-
display: flex;
|
|
2270
|
-
max-width: 100%;
|
|
2271
|
-
overflow-x: scroll;
|
|
2272
|
-
overflow-y: hidden;
|
|
2273
|
-
scrollbar-width: none;
|
|
2274
|
-
}
|
|
2275
|
-
.a2ui-surface .a2ui-list[data-direction="horizontal"] > section > * {
|
|
2276
|
-
flex: 1 0 fit-content;
|
|
2277
|
-
max-width: min(80%, 400px);
|
|
2278
|
-
}
|
|
2279
|
-
|
|
2280
|
-
.a2ui-surface .a2ui-datetime-input {
|
|
2281
|
-
display: block;
|
|
2282
|
-
flex: var(--weight);
|
|
2283
|
-
min-height: 0;
|
|
2284
|
-
overflow: auto;
|
|
2285
|
-
}
|
|
2286
|
-
:where(.a2ui-surface .a2ui-datetime-input) input {
|
|
2287
|
-
display: block;
|
|
2288
|
-
border-radius: 8px;
|
|
2289
|
-
padding: 8px;
|
|
2290
|
-
border: 1px solid #ccc;
|
|
2291
|
-
width: 100%;
|
|
2292
|
-
}
|
|
2293
|
-
|
|
2294
|
-
.a2ui-surface *,
|
|
2295
|
-
.a2ui-surface *::before,
|
|
2296
|
-
.a2ui-surface *::after {
|
|
2297
|
-
box-sizing: border-box;
|
|
2298
|
-
}
|
|
2299
|
-
`;
|
|
2300
|
-
function zt() {
|
|
2301
|
-
if (typeof document > "u")
|
|
2302
|
-
return;
|
|
2303
|
-
const e = "a2ui-structural-styles";
|
|
2304
|
-
if (document.getElementById(e))
|
|
2305
|
-
return;
|
|
2306
|
-
const t = document.createElement("style");
|
|
2307
|
-
t.id = e, t.textContent = Rr + `
|
|
2308
|
-
` + Or + `
|
|
2309
|
-
` + Vr, document.head.appendChild(t);
|
|
2310
|
-
}
|
|
2311
|
-
const Br = {
|
|
2312
|
-
video: Yt,
|
|
2313
|
-
audio: Gt,
|
|
2314
|
-
image: Jt,
|
|
2315
|
-
file: ot,
|
|
2316
|
-
spreadsheet: Ht,
|
|
2317
|
-
document: rt
|
|
1458
|
+
const br = {
|
|
1459
|
+
video: jt,
|
|
1460
|
+
audio: qt,
|
|
1461
|
+
image: wt,
|
|
1462
|
+
file: We,
|
|
1463
|
+
spreadsheet: Vt,
|
|
1464
|
+
document: Ge
|
|
2318
1465
|
};
|
|
2319
|
-
function
|
|
1466
|
+
function Sr({
|
|
2320
1467
|
type: e,
|
|
2321
1468
|
size: t = 40,
|
|
2322
1469
|
className: n
|
|
2323
1470
|
}) {
|
|
2324
|
-
const r =
|
|
1471
|
+
const r = br[e] ?? We;
|
|
2325
1472
|
return /* @__PURE__ */ s(
|
|
2326
1473
|
r,
|
|
2327
1474
|
{
|
|
@@ -2331,7 +1478,7 @@ function qr({
|
|
|
2331
1478
|
}
|
|
2332
1479
|
);
|
|
2333
1480
|
}
|
|
2334
|
-
const
|
|
1481
|
+
const kt = "skopon-form-v0_9", xr = /* @__PURE__ */ new Set([
|
|
2335
1482
|
"SkoponMedia",
|
|
2336
1483
|
"SkoponSelect",
|
|
2337
1484
|
"Image",
|
|
@@ -2343,46 +1490,46 @@ const Mt = "skopon-form-v0_9", Lr = /* @__PURE__ */ new Set([
|
|
|
2343
1490
|
"FileUpload",
|
|
2344
1491
|
"TextField",
|
|
2345
1492
|
"Text",
|
|
2346
|
-
...
|
|
2347
|
-
]),
|
|
2348
|
-
function
|
|
2349
|
-
const t = [...
|
|
1493
|
+
...Jn()
|
|
1494
|
+
]), Cr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
1495
|
+
function ae(e) {
|
|
1496
|
+
const t = [...ue.components.values()].find((n) => n.name === e);
|
|
2350
1497
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
2351
1498
|
return t.schema;
|
|
2352
1499
|
}
|
|
2353
|
-
function
|
|
1500
|
+
function A(e) {
|
|
2354
1501
|
return typeof e == "string" ? e : "";
|
|
2355
1502
|
}
|
|
2356
|
-
function
|
|
1503
|
+
function At(e) {
|
|
2357
1504
|
return Array.isArray(e) ? e.map((t) => {
|
|
2358
1505
|
if (!t || typeof t != "object") return null;
|
|
2359
1506
|
const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
|
|
2360
1507
|
return { value: r, label: o };
|
|
2361
1508
|
}).filter((t) => !!t) : [];
|
|
2362
1509
|
}
|
|
2363
|
-
function
|
|
1510
|
+
function ge({
|
|
2364
1511
|
mediaType: e,
|
|
2365
1512
|
urls: t,
|
|
2366
1513
|
mediaSize: n,
|
|
2367
1514
|
label: r,
|
|
2368
1515
|
help: o,
|
|
2369
|
-
placeholder:
|
|
1516
|
+
placeholder: i
|
|
2370
1517
|
}) {
|
|
2371
|
-
const
|
|
2372
|
-
return /* @__PURE__ */
|
|
2373
|
-
|
|
2374
|
-
t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((
|
|
1518
|
+
const a = r == null ? void 0 : r.trim(), l = o == null ? void 0 : o.trim(), c = pn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
1519
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1520
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
1521
|
+
t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((m, p) => e === "image" ? /* @__PURE__ */ s(
|
|
2375
1522
|
"img",
|
|
2376
1523
|
{
|
|
2377
|
-
src:
|
|
2378
|
-
alt:
|
|
1524
|
+
src: m,
|
|
1525
|
+
alt: a || "图片",
|
|
2379
1526
|
className: "form-media-item"
|
|
2380
1527
|
},
|
|
2381
1528
|
`media-${p}`
|
|
2382
1529
|
) : e === "video" ? /* @__PURE__ */ s(
|
|
2383
1530
|
"video",
|
|
2384
1531
|
{
|
|
2385
|
-
src:
|
|
1532
|
+
src: m,
|
|
2386
1533
|
controls: !0,
|
|
2387
1534
|
className: "form-media-item"
|
|
2388
1535
|
},
|
|
@@ -2390,88 +1537,88 @@ function ke({
|
|
|
2390
1537
|
) : /* @__PURE__ */ s(
|
|
2391
1538
|
"audio",
|
|
2392
1539
|
{
|
|
2393
|
-
src:
|
|
1540
|
+
src: m,
|
|
2394
1541
|
controls: !0,
|
|
2395
1542
|
className: "form-media-item form-media-item--audio"
|
|
2396
1543
|
},
|
|
2397
1544
|
`media-${p}`
|
|
2398
1545
|
)) }),
|
|
2399
|
-
l ? /* @__PURE__ */ s(
|
|
1546
|
+
l ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
|
|
2400
1547
|
] });
|
|
2401
1548
|
}
|
|
2402
|
-
function
|
|
2403
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
1549
|
+
function ye(e, t) {
|
|
1550
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : A(e.url).trim() ? [A(e.url).trim()] : [];
|
|
2404
1551
|
return {
|
|
2405
1552
|
mediaType: t,
|
|
2406
1553
|
urls: n,
|
|
2407
|
-
mediaSize:
|
|
2408
|
-
label:
|
|
2409
|
-
help:
|
|
2410
|
-
placeholder:
|
|
1554
|
+
mediaSize: ie(e.mediaSize),
|
|
1555
|
+
label: A(e.label) || A(e.description),
|
|
1556
|
+
help: A(e.help),
|
|
1557
|
+
placeholder: A(e.placeholder)
|
|
2411
1558
|
};
|
|
2412
1559
|
}
|
|
2413
|
-
const
|
|
1560
|
+
const kr = {
|
|
2414
1561
|
name: "SkoponMedia",
|
|
2415
|
-
schema:
|
|
2416
|
-
mediaType:
|
|
2417
|
-
urls:
|
|
2418
|
-
mediaSize:
|
|
2419
|
-
label:
|
|
2420
|
-
help:
|
|
2421
|
-
placeholder:
|
|
1562
|
+
schema: d.object({
|
|
1563
|
+
mediaType: d.any().optional(),
|
|
1564
|
+
urls: d.any().optional(),
|
|
1565
|
+
mediaSize: d.any().optional(),
|
|
1566
|
+
label: d.any().optional(),
|
|
1567
|
+
help: d.any().optional(),
|
|
1568
|
+
placeholder: d.any().optional()
|
|
2422
1569
|
}).passthrough()
|
|
2423
|
-
},
|
|
2424
|
-
const t = e.componentModel.properties, n =
|
|
2425
|
-
return /* @__PURE__ */ s(
|
|
2426
|
-
}),
|
|
2427
|
-
{ name: "Image", schema:
|
|
2428
|
-
({ context: e }) => /* @__PURE__ */ s(
|
|
2429
|
-
),
|
|
2430
|
-
{ name: "Video", schema:
|
|
2431
|
-
({ context: e }) => /* @__PURE__ */ s(
|
|
2432
|
-
),
|
|
2433
|
-
{ name: "AudioPlayer", schema:
|
|
2434
|
-
({ context: e }) => /* @__PURE__ */ s(
|
|
2435
|
-
),
|
|
1570
|
+
}, Ar = V(kr, ({ context: e }) => {
|
|
1571
|
+
const t = e.componentModel.properties, n = A(t.mediaType);
|
|
1572
|
+
return /* @__PURE__ */ s(ge, { ...ye(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
1573
|
+
}), Tr = V(
|
|
1574
|
+
{ name: "Image", schema: ae("Image") },
|
|
1575
|
+
({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "image") })
|
|
1576
|
+
), Nr = V(
|
|
1577
|
+
{ name: "Video", schema: ae("Video") },
|
|
1578
|
+
({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "video") })
|
|
1579
|
+
), Ir = V(
|
|
1580
|
+
{ name: "AudioPlayer", schema: ae("AudioPlayer") },
|
|
1581
|
+
({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "audio") })
|
|
1582
|
+
), Mr = {
|
|
2436
1583
|
name: "SkoponSelect",
|
|
2437
|
-
schema:
|
|
2438
|
-
label:
|
|
2439
|
-
mode:
|
|
2440
|
-
placeholder:
|
|
2441
|
-
options:
|
|
2442
|
-
value:
|
|
1584
|
+
schema: d.object({
|
|
1585
|
+
label: d.any().optional(),
|
|
1586
|
+
mode: d.any().optional(),
|
|
1587
|
+
placeholder: d.any().optional(),
|
|
1588
|
+
options: d.any().optional(),
|
|
1589
|
+
value: d.any().optional()
|
|
2443
1590
|
}).passthrough()
|
|
2444
1591
|
};
|
|
2445
|
-
function
|
|
2446
|
-
const { interactive: t } =
|
|
2447
|
-
return /* @__PURE__ */
|
|
2448
|
-
|
|
1592
|
+
function Fr({ context: e }) {
|
|
1593
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = At(o.options), c = A(o.mode) === "multiple";
|
|
1594
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1595
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
2449
1596
|
/* @__PURE__ */ s(
|
|
2450
|
-
|
|
1597
|
+
Fe,
|
|
2451
1598
|
{
|
|
2452
1599
|
mode: c ? "multiple" : void 0,
|
|
2453
1600
|
disabled: !t,
|
|
2454
1601
|
allowClear: !0,
|
|
2455
1602
|
className: "form-block-preview-control",
|
|
2456
1603
|
style: { width: "100%" },
|
|
2457
|
-
placeholder:
|
|
1604
|
+
placeholder: a || (c ? "请选择多项" : "请选择"),
|
|
2458
1605
|
options: l,
|
|
2459
|
-
value: c ?
|
|
1606
|
+
value: c ? L(n) : ne(n),
|
|
2460
1607
|
onChange: (u) => r(c ? u ?? [] : u ?? "")
|
|
2461
1608
|
}
|
|
2462
1609
|
)
|
|
2463
1610
|
] });
|
|
2464
1611
|
}
|
|
2465
|
-
const
|
|
2466
|
-
|
|
2467
|
-
|
|
1612
|
+
const Pr = V(
|
|
1613
|
+
Mr,
|
|
1614
|
+
Fr
|
|
2468
1615
|
);
|
|
2469
|
-
function
|
|
2470
|
-
const { interactive: t } =
|
|
2471
|
-
return /* @__PURE__ */
|
|
2472
|
-
|
|
1616
|
+
function Ur({ context: e }) {
|
|
1617
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.variant) || "mutuallyExclusive", l = A(o.skoponPickerType), c = A(o.placeholder), u = At(o.options), p = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : a === "multipleSelection" ? "checkbox" : "radio";
|
|
1618
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1619
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
2473
1620
|
p === "select" ? /* @__PURE__ */ s(
|
|
2474
|
-
|
|
1621
|
+
Fe,
|
|
2475
1622
|
{
|
|
2476
1623
|
disabled: !t,
|
|
2477
1624
|
allowClear: !0,
|
|
@@ -2479,11 +1626,11 @@ function Qr({ context: e }) {
|
|
|
2479
1626
|
style: { width: "100%" },
|
|
2480
1627
|
placeholder: c || "请选择",
|
|
2481
1628
|
options: u,
|
|
2482
|
-
value:
|
|
1629
|
+
value: ne(n),
|
|
2483
1630
|
onChange: (g) => r(g ?? "")
|
|
2484
1631
|
}
|
|
2485
1632
|
) : p === "multiselect" ? /* @__PURE__ */ s(
|
|
2486
|
-
|
|
1633
|
+
Fe,
|
|
2487
1634
|
{
|
|
2488
1635
|
mode: "multiple",
|
|
2489
1636
|
disabled: !t,
|
|
@@ -2492,75 +1639,75 @@ function Qr({ context: e }) {
|
|
|
2492
1639
|
style: { width: "100%" },
|
|
2493
1640
|
placeholder: c || "请选择多项",
|
|
2494
1641
|
options: u,
|
|
2495
|
-
value:
|
|
1642
|
+
value: L(n),
|
|
2496
1643
|
onChange: (g) => r(g ?? [])
|
|
2497
1644
|
}
|
|
2498
1645
|
) : p === "checkbox" ? /* @__PURE__ */ s(
|
|
2499
|
-
|
|
1646
|
+
Pt.Group,
|
|
2500
1647
|
{
|
|
2501
1648
|
disabled: !t,
|
|
2502
1649
|
className: "form-block-preview-control",
|
|
2503
1650
|
options: u,
|
|
2504
|
-
value:
|
|
1651
|
+
value: L(n),
|
|
2505
1652
|
onChange: (g) => r(g)
|
|
2506
1653
|
}
|
|
2507
1654
|
) : /* @__PURE__ */ s(
|
|
2508
|
-
|
|
1655
|
+
Ut.Group,
|
|
2509
1656
|
{
|
|
2510
1657
|
disabled: !t,
|
|
2511
1658
|
className: "form-block-preview-control",
|
|
2512
1659
|
options: u,
|
|
2513
|
-
value:
|
|
1660
|
+
value: ne(n),
|
|
2514
1661
|
onChange: (g) => r(g.target.value)
|
|
2515
1662
|
}
|
|
2516
1663
|
)
|
|
2517
1664
|
] });
|
|
2518
1665
|
}
|
|
2519
|
-
const
|
|
1666
|
+
const _r = V(
|
|
2520
1667
|
{
|
|
2521
1668
|
name: "ChoicePicker",
|
|
2522
|
-
schema:
|
|
2523
|
-
label:
|
|
2524
|
-
variant:
|
|
2525
|
-
options:
|
|
2526
|
-
value:
|
|
2527
|
-
skoponPickerType:
|
|
2528
|
-
placeholder:
|
|
1669
|
+
schema: d.object({
|
|
1670
|
+
label: d.any().optional(),
|
|
1671
|
+
variant: d.any().optional(),
|
|
1672
|
+
options: d.any().optional(),
|
|
1673
|
+
value: d.any().optional(),
|
|
1674
|
+
skoponPickerType: d.any().optional(),
|
|
1675
|
+
placeholder: d.any().optional()
|
|
2529
1676
|
}).passthrough()
|
|
2530
1677
|
},
|
|
2531
|
-
|
|
1678
|
+
Ur
|
|
2532
1679
|
);
|
|
2533
|
-
function
|
|
2534
|
-
const { interactive: t } =
|
|
2535
|
-
return /* @__PURE__ */
|
|
2536
|
-
|
|
1680
|
+
function Er({ context: e }) {
|
|
1681
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label);
|
|
1682
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1683
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
2537
1684
|
/* @__PURE__ */ s(
|
|
2538
|
-
|
|
1685
|
+
_t,
|
|
2539
1686
|
{
|
|
2540
1687
|
disabled: !t,
|
|
2541
1688
|
className: "form-block-preview-control",
|
|
2542
|
-
checked:
|
|
2543
|
-
onChange: (
|
|
1689
|
+
checked: qe(n),
|
|
1690
|
+
onChange: (a) => r(a)
|
|
2544
1691
|
}
|
|
2545
1692
|
)
|
|
2546
1693
|
] });
|
|
2547
1694
|
}
|
|
2548
|
-
const
|
|
2549
|
-
{ name: "CheckBox", schema:
|
|
2550
|
-
|
|
1695
|
+
const zr = V(
|
|
1696
|
+
{ name: "CheckBox", schema: ae("CheckBox") },
|
|
1697
|
+
Er
|
|
2551
1698
|
);
|
|
2552
|
-
function
|
|
2553
|
-
const r =
|
|
1699
|
+
function Rr(e, t, n) {
|
|
1700
|
+
const r = ne(e);
|
|
2554
1701
|
if (!r) return;
|
|
2555
1702
|
if (!t && n) {
|
|
2556
|
-
const
|
|
2557
|
-
return
|
|
1703
|
+
const i = $e(r, "HH:mm", !0);
|
|
1704
|
+
return i.isValid() ? i : void 0;
|
|
2558
1705
|
}
|
|
2559
|
-
const o =
|
|
1706
|
+
const o = $e(r);
|
|
2560
1707
|
return o.isValid() ? o : void 0;
|
|
2561
1708
|
}
|
|
2562
|
-
function
|
|
2563
|
-
const { interactive: t } =
|
|
1709
|
+
function Or({ context: e }) {
|
|
1710
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = Rr(n, l, c), m = (p) => {
|
|
2564
1711
|
if (!p) {
|
|
2565
1712
|
r("");
|
|
2566
1713
|
return;
|
|
@@ -2575,117 +1722,117 @@ function oo({ context: e }) {
|
|
|
2575
1722
|
}
|
|
2576
1723
|
r(p.format("YYYY-MM-DD"));
|
|
2577
1724
|
};
|
|
2578
|
-
return /* @__PURE__ */
|
|
2579
|
-
|
|
1725
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1726
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
2580
1727
|
!l && c ? /* @__PURE__ */ s(
|
|
2581
|
-
|
|
1728
|
+
Et,
|
|
2582
1729
|
{
|
|
2583
1730
|
disabled: !t,
|
|
2584
1731
|
className: "form-block-preview-control",
|
|
2585
1732
|
style: { width: "100%" },
|
|
2586
|
-
placeholder:
|
|
1733
|
+
placeholder: a || "选择时间",
|
|
2587
1734
|
value: u,
|
|
2588
|
-
onChange:
|
|
1735
|
+
onChange: m
|
|
2589
1736
|
}
|
|
2590
1737
|
) : /* @__PURE__ */ s(
|
|
2591
|
-
|
|
1738
|
+
zt,
|
|
2592
1739
|
{
|
|
2593
1740
|
showTime: l && c,
|
|
2594
1741
|
disabled: !t,
|
|
2595
1742
|
className: "form-block-preview-control",
|
|
2596
1743
|
style: { width: "100%" },
|
|
2597
|
-
placeholder:
|
|
1744
|
+
placeholder: a || (l && c ? "选择日期时间" : "选择日期"),
|
|
2598
1745
|
value: u,
|
|
2599
|
-
onChange:
|
|
1746
|
+
onChange: m
|
|
2600
1747
|
}
|
|
2601
1748
|
)
|
|
2602
1749
|
] });
|
|
2603
1750
|
}
|
|
2604
|
-
const
|
|
1751
|
+
const Br = V(
|
|
2605
1752
|
{
|
|
2606
1753
|
name: "DateTimeInput",
|
|
2607
|
-
schema:
|
|
2608
|
-
label:
|
|
2609
|
-
enableDate:
|
|
2610
|
-
enableTime:
|
|
2611
|
-
placeholder:
|
|
2612
|
-
value:
|
|
2613
|
-
min:
|
|
2614
|
-
max:
|
|
1754
|
+
schema: d.object({
|
|
1755
|
+
label: d.any().optional(),
|
|
1756
|
+
enableDate: d.any().optional(),
|
|
1757
|
+
enableTime: d.any().optional(),
|
|
1758
|
+
placeholder: d.any().optional(),
|
|
1759
|
+
value: d.any().optional(),
|
|
1760
|
+
min: d.any().optional(),
|
|
1761
|
+
max: d.any().optional()
|
|
2615
1762
|
}).passthrough()
|
|
2616
1763
|
},
|
|
2617
|
-
|
|
2618
|
-
),
|
|
1764
|
+
Or
|
|
1765
|
+
), Vr = {
|
|
2619
1766
|
name: "FileUpload",
|
|
2620
|
-
schema:
|
|
2621
|
-
label:
|
|
2622
|
-
accept:
|
|
2623
|
-
fileAcceptTypes:
|
|
2624
|
-
filePlaceholderIcon:
|
|
2625
|
-
minCount:
|
|
2626
|
-
maxCount:
|
|
2627
|
-
value:
|
|
1767
|
+
schema: d.object({
|
|
1768
|
+
label: d.any().optional(),
|
|
1769
|
+
accept: d.any().optional(),
|
|
1770
|
+
fileAcceptTypes: d.any().optional(),
|
|
1771
|
+
filePlaceholderIcon: d.any().optional(),
|
|
1772
|
+
minCount: d.any().optional(),
|
|
1773
|
+
maxCount: d.any().optional(),
|
|
1774
|
+
value: d.any().optional()
|
|
2628
1775
|
}).passthrough()
|
|
2629
1776
|
};
|
|
2630
|
-
function
|
|
2631
|
-
const { interactive: t } =
|
|
1777
|
+
function wr({ context: e }) {
|
|
1778
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.accept), l = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = rn(l, c), m = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2632
1779
|
o.filePlaceholderIcon
|
|
2633
|
-
) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, g = typeof o.maxCount == "number" ? o.maxCount : 1, v = g > 0,
|
|
2634
|
-
return /* @__PURE__ */
|
|
2635
|
-
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
|
|
1780
|
+
) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, g = typeof o.maxCount == "number" ? o.maxCount : 1, v = g > 0, I = L(n), T = v && I.length >= g, k = I.length < p;
|
|
1781
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1782
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1783
|
+
/* @__PURE__ */ C(
|
|
1784
|
+
Se.Dragger,
|
|
2638
1785
|
{
|
|
2639
|
-
disabled: !t ||
|
|
2640
|
-
accept:
|
|
1786
|
+
disabled: !t || T,
|
|
1787
|
+
accept: nn(l, c),
|
|
2641
1788
|
className: "form-file-upload-preview",
|
|
2642
|
-
showUploadList: t &&
|
|
2643
|
-
fileList: t ?
|
|
1789
|
+
showUploadList: t && I.length > 0,
|
|
1790
|
+
fileList: t ? I.map((f, h) => ({
|
|
2644
1791
|
uid: `${h}-${f}`,
|
|
2645
1792
|
name: f,
|
|
2646
1793
|
status: "done"
|
|
2647
1794
|
})) : [],
|
|
2648
1795
|
beforeUpload: (f) => {
|
|
2649
|
-
if (!t) return
|
|
2650
|
-
const h =
|
|
2651
|
-
if (v && h.length >= g) return
|
|
2652
|
-
const
|
|
2653
|
-
return r(
|
|
1796
|
+
if (!t) return Se.LIST_IGNORE;
|
|
1797
|
+
const h = L(Ke(e));
|
|
1798
|
+
if (v && h.length >= g) return Se.LIST_IGNORE;
|
|
1799
|
+
const x = v ? [...h, f.name].slice(0, g) : [...h, f.name];
|
|
1800
|
+
return r(x), !1;
|
|
2654
1801
|
},
|
|
2655
1802
|
onRemove: (f) => {
|
|
2656
|
-
const h =
|
|
2657
|
-
if (
|
|
2658
|
-
r(
|
|
1803
|
+
const h = L(Ke(e)), x = /^(\d+)-/.exec(f.uid ?? ""), y = x ? Number(x[1]) : -1, S = y >= 0 && y < h.length ? h.filter((M, z) => z !== y) : h.filter((M) => M !== f.name);
|
|
1804
|
+
if (S.length < p) return !1;
|
|
1805
|
+
r(S);
|
|
2659
1806
|
},
|
|
2660
1807
|
children: [
|
|
2661
|
-
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(
|
|
1808
|
+
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(Sr, { type: m, size: 40 }) }),
|
|
2662
1809
|
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2663
1810
|
]
|
|
2664
1811
|
}
|
|
2665
1812
|
),
|
|
2666
|
-
/* @__PURE__ */
|
|
1813
|
+
/* @__PURE__ */ C(D.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
2667
1814
|
"允许:",
|
|
2668
1815
|
u ?? "全部类型",
|
|
2669
1816
|
p > 0 ? `;至少 ${p} 个文件` : "",
|
|
2670
1817
|
v ? `;最多 ${g} 个文件` : "",
|
|
2671
|
-
|
|
1818
|
+
k && t ? `(当前 ${I.length} 个,未达下限)` : ""
|
|
2672
1819
|
] })
|
|
2673
1820
|
] });
|
|
2674
1821
|
}
|
|
2675
|
-
const
|
|
2676
|
-
|
|
2677
|
-
|
|
1822
|
+
const qr = V(
|
|
1823
|
+
Vr,
|
|
1824
|
+
wr
|
|
2678
1825
|
);
|
|
2679
|
-
function
|
|
2680
|
-
const { interactive: t } =
|
|
1826
|
+
function jr({ context: e }) {
|
|
1827
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = A(o.variant) || "shortText", c = ne(n) ?? "", u = !t, m = "form-block-preview-control";
|
|
2681
1828
|
let p;
|
|
2682
1829
|
if (l === "longText")
|
|
2683
1830
|
p = /* @__PURE__ */ s(
|
|
2684
|
-
|
|
1831
|
+
xe.TextArea,
|
|
2685
1832
|
{
|
|
2686
1833
|
disabled: u,
|
|
2687
|
-
className:
|
|
2688
|
-
placeholder:
|
|
1834
|
+
className: m,
|
|
1835
|
+
placeholder: a || "长文本回答...",
|
|
2689
1836
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
2690
1837
|
value: c,
|
|
2691
1838
|
onChange: (g) => r(g.target.value)
|
|
@@ -2694,249 +1841,249 @@ function co({ context: e }) {
|
|
|
2694
1841
|
else if (l === "number") {
|
|
2695
1842
|
const g = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
|
|
2696
1843
|
p = /* @__PURE__ */ s(
|
|
2697
|
-
|
|
1844
|
+
Rt,
|
|
2698
1845
|
{
|
|
2699
1846
|
disabled: u,
|
|
2700
|
-
className:
|
|
1847
|
+
className: m,
|
|
2701
1848
|
style: { width: "100%" },
|
|
2702
|
-
placeholder:
|
|
1849
|
+
placeholder: a || "数字",
|
|
2703
1850
|
value: g,
|
|
2704
1851
|
onChange: (v) => r(v == null ? "" : String(v))
|
|
2705
1852
|
}
|
|
2706
1853
|
);
|
|
2707
1854
|
} else l === "obscured" ? p = /* @__PURE__ */ s(
|
|
2708
|
-
|
|
1855
|
+
xe.Password,
|
|
2709
1856
|
{
|
|
2710
1857
|
disabled: u,
|
|
2711
|
-
className:
|
|
2712
|
-
placeholder:
|
|
1858
|
+
className: m,
|
|
1859
|
+
placeholder: a,
|
|
2713
1860
|
value: c,
|
|
2714
1861
|
onChange: (g) => r(g.target.value)
|
|
2715
1862
|
}
|
|
2716
1863
|
) : p = /* @__PURE__ */ s(
|
|
2717
|
-
|
|
1864
|
+
xe,
|
|
2718
1865
|
{
|
|
2719
1866
|
disabled: u,
|
|
2720
|
-
className:
|
|
2721
|
-
placeholder:
|
|
1867
|
+
className: m,
|
|
1868
|
+
placeholder: a,
|
|
2722
1869
|
value: c,
|
|
2723
1870
|
onChange: (g) => r(g.target.value)
|
|
2724
1871
|
}
|
|
2725
1872
|
);
|
|
2726
|
-
return /* @__PURE__ */
|
|
2727
|
-
|
|
1873
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1874
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
2728
1875
|
p
|
|
2729
1876
|
] });
|
|
2730
1877
|
}
|
|
2731
|
-
const
|
|
1878
|
+
const $r = V(
|
|
2732
1879
|
{
|
|
2733
1880
|
name: "TextField",
|
|
2734
|
-
schema:
|
|
2735
|
-
label:
|
|
2736
|
-
variant:
|
|
2737
|
-
placeholder:
|
|
2738
|
-
validationRegexp:
|
|
2739
|
-
value:
|
|
1881
|
+
schema: d.object({
|
|
1882
|
+
label: d.any().optional(),
|
|
1883
|
+
variant: d.any().optional(),
|
|
1884
|
+
placeholder: d.any().optional(),
|
|
1885
|
+
validationRegexp: d.any().optional(),
|
|
1886
|
+
value: d.any().optional()
|
|
2740
1887
|
}).passthrough()
|
|
2741
1888
|
},
|
|
2742
|
-
|
|
1889
|
+
jr
|
|
2743
1890
|
);
|
|
2744
|
-
function
|
|
2745
|
-
const t = e.componentModel.properties, n =
|
|
2746
|
-
return
|
|
1891
|
+
function Lr({ context: e }) {
|
|
1892
|
+
const t = e.componentModel.properties, n = A(t.text), r = A(t.variant) || "body";
|
|
1893
|
+
return Cr.has(r) ? r === "caption" ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ s("em", { children: n }) }) : /* @__PURE__ */ s(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ s(D.Paragraph, { className: "form-block-preview-paragraph", children: n });
|
|
2747
1894
|
}
|
|
2748
|
-
const
|
|
2749
|
-
{ name: "Text", schema:
|
|
2750
|
-
|
|
1895
|
+
const Dr = V(
|
|
1896
|
+
{ name: "Text", schema: ae("Text") },
|
|
1897
|
+
Lr
|
|
2751
1898
|
);
|
|
2752
|
-
function
|
|
1899
|
+
function Tt() {
|
|
2753
1900
|
const t = [
|
|
2754
|
-
...[...
|
|
2755
|
-
(r) => !
|
|
1901
|
+
...[...ue.components.values()].filter(
|
|
1902
|
+
(r) => !xr.has(r.name)
|
|
2756
1903
|
),
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
...
|
|
2769
|
-
], n = [...
|
|
2770
|
-
return new
|
|
2771
|
-
}
|
|
2772
|
-
const
|
|
1904
|
+
Ar,
|
|
1905
|
+
Pr,
|
|
1906
|
+
Tr,
|
|
1907
|
+
Nr,
|
|
1908
|
+
Ir,
|
|
1909
|
+
_r,
|
|
1910
|
+
zr,
|
|
1911
|
+
Br,
|
|
1912
|
+
qr,
|
|
1913
|
+
$r,
|
|
1914
|
+
Dr,
|
|
1915
|
+
...Kn()
|
|
1916
|
+
], n = [...ue.functions.values()];
|
|
1917
|
+
return new $t(kt, t, n, ue.themeSchema);
|
|
1918
|
+
}
|
|
1919
|
+
const Kr = It(
|
|
2773
1920
|
function({
|
|
2774
1921
|
doc: t,
|
|
2775
1922
|
surfaceId: n = "skopon-form",
|
|
2776
1923
|
emptyHint: r = null,
|
|
2777
1924
|
interactive: o = !0,
|
|
2778
|
-
fieldNames:
|
|
2779
|
-
resumeSearch:
|
|
1925
|
+
fieldNames: i = [],
|
|
1926
|
+
resumeSearch: a = null,
|
|
2780
1927
|
caseSearch: l = null
|
|
2781
1928
|
}, c) {
|
|
2782
|
-
|
|
2783
|
-
|
|
1929
|
+
j(() => {
|
|
1930
|
+
tt(), et();
|
|
2784
1931
|
}, []);
|
|
2785
|
-
const u =
|
|
2786
|
-
|
|
2787
|
-
const p =
|
|
2788
|
-
if (
|
|
1932
|
+
const u = q(null), m = q(i);
|
|
1933
|
+
m.current = i;
|
|
1934
|
+
const p = B(() => {
|
|
1935
|
+
if (Ee(t)) return "";
|
|
2789
1936
|
try {
|
|
2790
1937
|
return JSON.stringify(t);
|
|
2791
1938
|
} catch {
|
|
2792
1939
|
return String(t);
|
|
2793
1940
|
}
|
|
2794
|
-
}, [t]), g =
|
|
1941
|
+
}, [t]), g = B(() => {
|
|
2795
1942
|
if (!p)
|
|
2796
1943
|
return { surfaces: [], processor: null };
|
|
2797
1944
|
try {
|
|
2798
|
-
const
|
|
1945
|
+
const T = JSON.parse(p), k = new Qe([Tt()]), f = nr(T, {
|
|
2799
1946
|
surfaceId: n,
|
|
2800
|
-
catalogId:
|
|
1947
|
+
catalogId: kt
|
|
2801
1948
|
});
|
|
2802
|
-
return
|
|
2803
|
-
surfaces: Array.from(
|
|
2804
|
-
processor:
|
|
1949
|
+
return k.processMessages(f), {
|
|
1950
|
+
surfaces: Array.from(k.model.surfacesMap.values()),
|
|
1951
|
+
processor: k
|
|
2805
1952
|
};
|
|
2806
|
-
} catch (
|
|
2807
|
-
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败",
|
|
1953
|
+
} catch (T) {
|
|
1954
|
+
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", T), { surfaces: [], processor: null };
|
|
2808
1955
|
}
|
|
2809
|
-
}, [p, n]), { surfaces: v, processor:
|
|
2810
|
-
return u.current =
|
|
1956
|
+
}, [p, n]), { surfaces: v, processor: I } = g;
|
|
1957
|
+
return u.current = I, Mt(
|
|
2811
1958
|
c,
|
|
2812
1959
|
() => ({
|
|
2813
|
-
getValues(
|
|
2814
|
-
const
|
|
2815
|
-
if (!
|
|
2816
|
-
const f = (
|
|
2817
|
-
return
|
|
1960
|
+
getValues(T) {
|
|
1961
|
+
const k = u.current;
|
|
1962
|
+
if (!k) return {};
|
|
1963
|
+
const f = (T ?? m.current).map((h) => h.trim()).filter(Boolean);
|
|
1964
|
+
return ar(k, n, f);
|
|
2818
1965
|
}
|
|
2819
1966
|
}),
|
|
2820
1967
|
[n]
|
|
2821
|
-
), v.length === 0 ? /* @__PURE__ */ s(
|
|
1968
|
+
), v.length === 0 ? /* @__PURE__ */ s(Ye, { children: r }) : /* @__PURE__ */ s(mt, { resumeSearch: a, children: /* @__PURE__ */ s(ut, { caseSearch: l, children: /* @__PURE__ */ s(ot, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: v.map((T) => /* @__PURE__ */ s(Ze, { surface: T }, T.id)) }) }) }) });
|
|
2822
1969
|
}
|
|
2823
1970
|
);
|
|
2824
|
-
function
|
|
2825
|
-
return new
|
|
1971
|
+
function ce() {
|
|
1972
|
+
return new Qe([Tt()]);
|
|
2826
1973
|
}
|
|
2827
|
-
function
|
|
1974
|
+
function ao({
|
|
2828
1975
|
messages: e,
|
|
2829
1976
|
surfaceId: t = "skopon-form-stream",
|
|
2830
1977
|
emptyHint: n = null,
|
|
2831
1978
|
interactive: r = !0,
|
|
2832
1979
|
resumeSearch: o = null,
|
|
2833
|
-
caseSearch:
|
|
1980
|
+
caseSearch: i = null
|
|
2834
1981
|
}) {
|
|
2835
|
-
|
|
2836
|
-
|
|
1982
|
+
j(() => {
|
|
1983
|
+
tt(), et();
|
|
2837
1984
|
}, []);
|
|
2838
|
-
const
|
|
2839
|
-
|
|
2840
|
-
const l =
|
|
1985
|
+
const a = q(null);
|
|
1986
|
+
a.current === null && (a.current = ce());
|
|
1987
|
+
const l = q(0), c = q(""), u = q(!0), m = q(t);
|
|
2841
1988
|
function p(f, h) {
|
|
2842
|
-
|
|
1989
|
+
a.current = f, l.current = h.length, c.current = JSON.stringify(h), u.current && (I(f), k(Array.from(f.model.surfacesMap.values())));
|
|
2843
1990
|
}
|
|
2844
1991
|
function g(f, h) {
|
|
2845
1992
|
if (h <= 0) return !1;
|
|
2846
|
-
const
|
|
1993
|
+
const x = JSON.stringify(f.slice(0, h)), y = c.current;
|
|
2847
1994
|
if (!y) return !0;
|
|
2848
1995
|
try {
|
|
2849
|
-
const
|
|
2850
|
-
return JSON.stringify(
|
|
1996
|
+
const S = JSON.parse(y);
|
|
1997
|
+
return JSON.stringify(S.slice(0, h)) !== x;
|
|
2851
1998
|
} catch {
|
|
2852
1999
|
return !0;
|
|
2853
2000
|
}
|
|
2854
2001
|
}
|
|
2855
|
-
const [v,
|
|
2856
|
-
() =>
|
|
2857
|
-
), [
|
|
2002
|
+
const [v, I] = U(
|
|
2003
|
+
() => a.current
|
|
2004
|
+
), [T, k] = U(
|
|
2858
2005
|
() => Array.from(
|
|
2859
|
-
|
|
2006
|
+
a.current.model.surfacesMap.values()
|
|
2860
2007
|
)
|
|
2861
2008
|
);
|
|
2862
|
-
return
|
|
2009
|
+
return j(() => (u.current = !0, () => {
|
|
2863
2010
|
u.current = !1;
|
|
2864
|
-
}), []),
|
|
2865
|
-
|
|
2866
|
-
}, [v]),
|
|
2011
|
+
}), []), j(() => {
|
|
2012
|
+
a.current = v;
|
|
2013
|
+
}, [v]), j(() => {
|
|
2867
2014
|
const f = () => {
|
|
2868
|
-
u.current &&
|
|
2869
|
-
}, h = v.onSurfaceCreated(f),
|
|
2015
|
+
u.current && k(Array.from(v.model.surfacesMap.values()));
|
|
2016
|
+
}, h = v.onSurfaceCreated(f), x = v.onSurfaceDeleted(f);
|
|
2870
2017
|
return () => {
|
|
2871
|
-
h.unsubscribe(),
|
|
2018
|
+
h.unsubscribe(), x.unsubscribe();
|
|
2872
2019
|
};
|
|
2873
|
-
}, [v]),
|
|
2020
|
+
}, [v]), j(() => {
|
|
2874
2021
|
let f = !1;
|
|
2875
|
-
const h =
|
|
2876
|
-
if (
|
|
2877
|
-
const
|
|
2878
|
-
return Array.isArray(e) && e.length > 0 ? (
|
|
2022
|
+
const h = m.current !== t;
|
|
2023
|
+
if (m.current = t, h) {
|
|
2024
|
+
const M = ce();
|
|
2025
|
+
return Array.isArray(e) && e.length > 0 ? (M.processMessages(e), f || p(M, e)) : (a.current = M, l.current = 0, c.current = "", f || (I(M), k([]))), () => {
|
|
2879
2026
|
f = !0;
|
|
2880
2027
|
};
|
|
2881
2028
|
}
|
|
2882
2029
|
if (!Array.isArray(e) || e.length === 0) {
|
|
2883
2030
|
if (l.current > 0) {
|
|
2884
|
-
const
|
|
2885
|
-
|
|
2031
|
+
const M = ce();
|
|
2032
|
+
a.current = M, l.current = 0, c.current = "", f || (I(M), k([]));
|
|
2886
2033
|
}
|
|
2887
2034
|
return () => {
|
|
2888
2035
|
f = !0;
|
|
2889
2036
|
};
|
|
2890
2037
|
}
|
|
2891
|
-
const
|
|
2038
|
+
const x = a.current, y = l.current;
|
|
2892
2039
|
if (e.length < y || g(e, y)) {
|
|
2893
|
-
const
|
|
2894
|
-
return
|
|
2040
|
+
const M = ce();
|
|
2041
|
+
return M.processMessages(e), f || p(M, e), () => {
|
|
2895
2042
|
f = !0;
|
|
2896
2043
|
};
|
|
2897
2044
|
}
|
|
2898
|
-
const
|
|
2899
|
-
return
|
|
2045
|
+
const S = e.slice(y);
|
|
2046
|
+
return S.length === 0 ? () => {
|
|
2900
2047
|
f = !0;
|
|
2901
|
-
} : (
|
|
2048
|
+
} : (x.processMessages(S), l.current = e.length, c.current = JSON.stringify(e), f || k(Array.from(x.model.surfacesMap.values())), () => {
|
|
2902
2049
|
f = !0;
|
|
2903
2050
|
});
|
|
2904
|
-
}, [e, t]),
|
|
2051
|
+
}, [e, t]), T.length === 0 ? /* @__PURE__ */ s(Ye, { children: n }) : /* @__PURE__ */ s(mt, { resumeSearch: o, children: /* @__PURE__ */ s(ut, { caseSearch: i, children: /* @__PURE__ */ s(ot, { interactive: r, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: T.map((f) => /* @__PURE__ */ s(Ze, { surface: f }, f.id)) }) }) }) });
|
|
2905
2052
|
}
|
|
2906
|
-
function
|
|
2053
|
+
function Jr({
|
|
2907
2054
|
payload: e,
|
|
2908
2055
|
callbackUrl: t,
|
|
2909
2056
|
title: n,
|
|
2910
2057
|
unpublishedFormId: r,
|
|
2911
2058
|
incompleteFormId: o,
|
|
2912
|
-
copyMode:
|
|
2913
|
-
onNotify:
|
|
2059
|
+
copyMode: i = "display",
|
|
2060
|
+
onNotify: a
|
|
2914
2061
|
}) {
|
|
2915
|
-
const l =
|
|
2916
|
-
() =>
|
|
2062
|
+
const l = B(
|
|
2063
|
+
() => St(e, t),
|
|
2917
2064
|
[e, t]
|
|
2918
|
-
), c =
|
|
2065
|
+
), c = B(() => i === "submitFields" ? gr(e, t) : l, [i, e, t, l]);
|
|
2919
2066
|
async function u() {
|
|
2920
2067
|
try {
|
|
2921
|
-
await
|
|
2068
|
+
await Ct(c), a == null || a("success", "已复制到剪贴板");
|
|
2922
2069
|
} catch {
|
|
2923
|
-
|
|
2070
|
+
a == null || a("error", "复制失败");
|
|
2924
2071
|
}
|
|
2925
2072
|
}
|
|
2926
|
-
const
|
|
2927
|
-
return /* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
2929
|
-
/* @__PURE__ */
|
|
2930
|
-
/* @__PURE__ */ s(
|
|
2931
|
-
r ? /* @__PURE__ */ s(
|
|
2932
|
-
o ? /* @__PURE__ */ s(
|
|
2073
|
+
const m = i === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
|
|
2074
|
+
return /* @__PURE__ */ C("div", { className: "ask-user-curl-card", children: [
|
|
2075
|
+
/* @__PURE__ */ C("div", { className: "ask-user-curl-card-header", children: [
|
|
2076
|
+
/* @__PURE__ */ C("div", { className: "ask-user-curl-card-header-title", children: [
|
|
2077
|
+
/* @__PURE__ */ s(D.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
2078
|
+
r ? /* @__PURE__ */ s(ee, { title: r, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
2079
|
+
o ? /* @__PURE__ */ s(ee, { title: o, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
2933
2080
|
] }),
|
|
2934
|
-
/* @__PURE__ */ s(
|
|
2081
|
+
/* @__PURE__ */ s(ee, { title: m, children: /* @__PURE__ */ s(fe, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
|
|
2935
2082
|
] }),
|
|
2936
2083
|
/* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: l })
|
|
2937
2084
|
] });
|
|
2938
2085
|
}
|
|
2939
|
-
function
|
|
2086
|
+
function Hr(e, t) {
|
|
2940
2087
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
2941
2088
|
const n = t.message;
|
|
2942
2089
|
if (typeof n == "string" && n.trim())
|
|
@@ -2944,156 +2091,156 @@ function go(e, t) {
|
|
|
2944
2091
|
}
|
|
2945
2092
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2946
2093
|
}
|
|
2947
|
-
function
|
|
2094
|
+
function lo({
|
|
2948
2095
|
payload: e,
|
|
2949
2096
|
formUniqueId: t,
|
|
2950
2097
|
callbackUrl: n,
|
|
2951
2098
|
submitMode: r = "curl",
|
|
2952
2099
|
fetchFormDetail: o,
|
|
2953
|
-
onNotify:
|
|
2954
|
-
resumeSearch:
|
|
2100
|
+
onNotify: i,
|
|
2101
|
+
resumeSearch: a = null,
|
|
2955
2102
|
caseSearch: l = null
|
|
2956
2103
|
}) {
|
|
2957
|
-
const [c, u] =
|
|
2958
|
-
h.current =
|
|
2959
|
-
const
|
|
2960
|
-
|
|
2104
|
+
const [c, u] = U(null), [m, p] = U(!1), [g, v] = U(!0), [I, T] = U(!1), k = q(null), f = q(!0), h = q(i);
|
|
2105
|
+
h.current = i;
|
|
2106
|
+
const x = (t == null ? void 0 : t.trim()) ?? "";
|
|
2107
|
+
j(() => (f.current = !0, () => {
|
|
2961
2108
|
f.current = !1;
|
|
2962
|
-
}), []),
|
|
2963
|
-
let
|
|
2964
|
-
return
|
|
2965
|
-
|
|
2109
|
+
}), []), j(() => {
|
|
2110
|
+
let P = !1;
|
|
2111
|
+
return x ? (v(!0), p(!1), o({ formUniqueId: x }).then((_) => {
|
|
2112
|
+
P || (p(!!_.disabled), u(_.formDefinition ?? null));
|
|
2966
2113
|
}).catch((_) => {
|
|
2967
2114
|
var b;
|
|
2968
|
-
if (!
|
|
2115
|
+
if (!P) {
|
|
2969
2116
|
p(!1), u(null);
|
|
2970
|
-
const
|
|
2971
|
-
(b = h.current) == null || b.call(h, "error",
|
|
2117
|
+
const F = _ instanceof Error ? _.message : "获取表单定义失败";
|
|
2118
|
+
(b = h.current) == null || b.call(h, "error", F);
|
|
2972
2119
|
}
|
|
2973
2120
|
}).finally(() => {
|
|
2974
|
-
|
|
2121
|
+
P || v(!1);
|
|
2975
2122
|
}), () => {
|
|
2976
|
-
|
|
2123
|
+
P = !0;
|
|
2977
2124
|
}) : (v(!1), p(!1), u(null), () => {
|
|
2978
|
-
|
|
2125
|
+
P = !0;
|
|
2979
2126
|
});
|
|
2980
|
-
}, [
|
|
2981
|
-
const y =
|
|
2982
|
-
() =>
|
|
2983
|
-
[
|
|
2984
|
-
),
|
|
2127
|
+
}, [x, o]);
|
|
2128
|
+
const y = B(() => yt(e), [e]), S = B(() => y ? ur(y, c ?? void 0) : null, [y, c]), M = (S == null ? void 0 : S.matchedBlocks) ?? [], z = !!(y && mr(y) && M.length === 0), $ = B(() => z && y ? dr(y) : S && S.renderBlocks.length > 0 ? S.renderBlocks : [], [S, z, y]), G = B(
|
|
2129
|
+
() => z ? {} : vt((S == null ? void 0 : S.extraBlocks) ?? []),
|
|
2130
|
+
[z, S]
|
|
2131
|
+
), w = B(() => z && y ? fr(y) : $.filter((P) => {
|
|
2985
2132
|
var _;
|
|
2986
|
-
return (_ =
|
|
2987
|
-
}).map((
|
|
2988
|
-
if (
|
|
2989
|
-
const
|
|
2990
|
-
return
|
|
2991
|
-
}, [
|
|
2133
|
+
return (_ = P.name) == null ? void 0 : _.trim();
|
|
2134
|
+
}).map((P) => P.name.trim()), [z, y, $]), O = B(() => {
|
|
2135
|
+
if ($.length === 0) return null;
|
|
2136
|
+
const P = (S == null ? void 0 : S.title) ?? (y == null ? void 0 : y.title) ?? "", _ = (S == null ? void 0 : S.description) ?? (y == null ? void 0 : y.description) ?? "";
|
|
2137
|
+
return or({ title: P, description: _ }, $);
|
|
2138
|
+
}, [S, y, $]), H = x ? `ask-user-${x}` : "ask-user-payload";
|
|
2992
2139
|
if (g)
|
|
2993
|
-
return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(
|
|
2994
|
-
if (!y ||
|
|
2140
|
+
return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(Oe, { size: "small" }) });
|
|
2141
|
+
if (!y || $.length === 0)
|
|
2995
2142
|
return /* @__PURE__ */ s(
|
|
2996
|
-
|
|
2143
|
+
Jr,
|
|
2997
2144
|
{
|
|
2998
2145
|
payload: e,
|
|
2999
2146
|
callbackUrl: n,
|
|
3000
2147
|
copyMode: "submitFields",
|
|
3001
|
-
unpublishedFormId:
|
|
3002
|
-
onNotify:
|
|
2148
|
+
unpublishedFormId: m && x ? x : void 0,
|
|
2149
|
+
onNotify: i
|
|
3003
2150
|
}
|
|
3004
2151
|
);
|
|
3005
|
-
async function
|
|
3006
|
-
var
|
|
3007
|
-
if (
|
|
3008
|
-
|
|
2152
|
+
async function Y() {
|
|
2153
|
+
var P, _, b, F, R, N;
|
|
2154
|
+
if (!I) {
|
|
2155
|
+
T(!0);
|
|
3009
2156
|
try {
|
|
3010
|
-
const
|
|
2157
|
+
const Z = ((P = k.current) == null ? void 0 : P.getValues(w)) ?? {}, ve = { ...Z, ...G };
|
|
3011
2158
|
if (r === "post") {
|
|
3012
|
-
const
|
|
3013
|
-
if (!
|
|
2159
|
+
const je = (n ?? "").trim();
|
|
2160
|
+
if (!je) {
|
|
3014
2161
|
(_ = h.current) == null || _.call(h, "error", "callback_url 为空,无法提交");
|
|
3015
2162
|
return;
|
|
3016
2163
|
}
|
|
3017
|
-
const
|
|
2164
|
+
const be = await yr(je, ve);
|
|
3018
2165
|
if (!f.current) return;
|
|
3019
|
-
|
|
2166
|
+
be.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (F = h.current) == null || F.call(h, "error", Hr(be.status, be.body));
|
|
3020
2167
|
return;
|
|
3021
2168
|
}
|
|
3022
|
-
if (await
|
|
3023
|
-
|
|
2169
|
+
if (await Ct(
|
|
2170
|
+
xt({ cardValues: Z, extraValues: G, callbackUrl: n })
|
|
3024
2171
|
), !f.current) return;
|
|
3025
|
-
(
|
|
3026
|
-
} catch (
|
|
2172
|
+
(R = h.current) == null || R.call(h, "success", "已复制 curl 到剪贴板");
|
|
2173
|
+
} catch (Z) {
|
|
3027
2174
|
if (!f.current) return;
|
|
3028
|
-
const
|
|
3029
|
-
(
|
|
2175
|
+
const ve = Z instanceof Error ? Z.message : "复制失败";
|
|
2176
|
+
(N = h.current) == null || N.call(h, "error", ve);
|
|
3030
2177
|
} finally {
|
|
3031
|
-
f.current &&
|
|
2178
|
+
f.current && T(!1);
|
|
3032
2179
|
}
|
|
3033
2180
|
}
|
|
3034
2181
|
}
|
|
3035
|
-
return /* @__PURE__ */
|
|
3036
|
-
|
|
2182
|
+
return /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
|
|
2183
|
+
m && x ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(ee, { title: x, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
3037
2184
|
/* @__PURE__ */ s(
|
|
3038
|
-
|
|
2185
|
+
Kr,
|
|
3039
2186
|
{
|
|
3040
|
-
ref:
|
|
3041
|
-
doc:
|
|
3042
|
-
surfaceId:
|
|
3043
|
-
fieldNames:
|
|
2187
|
+
ref: k,
|
|
2188
|
+
doc: O,
|
|
2189
|
+
surfaceId: H,
|
|
2190
|
+
fieldNames: w,
|
|
3044
2191
|
interactive: !0,
|
|
3045
|
-
resumeSearch:
|
|
2192
|
+
resumeSearch: a,
|
|
3046
2193
|
caseSearch: l
|
|
3047
2194
|
}
|
|
3048
2195
|
),
|
|
3049
|
-
/* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(
|
|
3050
|
-
|
|
2196
|
+
/* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(ee, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
|
|
2197
|
+
fe,
|
|
3051
2198
|
{
|
|
3052
2199
|
type: "primary",
|
|
3053
2200
|
size: "small",
|
|
3054
|
-
loading:
|
|
3055
|
-
disabled:
|
|
3056
|
-
onClick: () => void
|
|
2201
|
+
loading: I,
|
|
2202
|
+
disabled: I,
|
|
2203
|
+
onClick: () => void Y(),
|
|
3057
2204
|
children: "提交"
|
|
3058
2205
|
}
|
|
3059
2206
|
) }) })
|
|
3060
2207
|
] });
|
|
3061
2208
|
}
|
|
3062
2209
|
export {
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
2210
|
+
oo as A2UI_PROTOCOL_VERSION,
|
|
2211
|
+
lo as AskUserFormCard,
|
|
2212
|
+
ut as CaseSearchProvider,
|
|
2213
|
+
Jr as CurlSubmitBlock,
|
|
2214
|
+
Lt as FORM_MEDIA_SIZES,
|
|
2215
|
+
mt as ResumeSearchProvider,
|
|
2216
|
+
ao as SkoponA2uiStreamRenderer,
|
|
2217
|
+
Kr as SkoponFormRenderer,
|
|
2218
|
+
tr as a2uiToBlocks,
|
|
2219
|
+
ft as blocksToA2ui,
|
|
2220
|
+
hr as buildAskUserCurlBodyJson,
|
|
2221
|
+
xt as buildAskUserCurlStatement,
|
|
2222
|
+
gr as buildAskUserSubmitCurlFromPayload,
|
|
2223
|
+
or as buildAskUserSurface,
|
|
2224
|
+
St as buildCurlStatement,
|
|
2225
|
+
Ct as copyTextToClipboard,
|
|
2226
|
+
io as createFormClient,
|
|
2227
|
+
vt as extractExtraBlockValues,
|
|
2228
|
+
ar as extractSurfaceValues,
|
|
2229
|
+
fr as getPayloadInputFieldNames,
|
|
2230
|
+
dr as getPayloadRenderableBlocks,
|
|
2231
|
+
ur as intersectPayloadBlocksWithForm,
|
|
2232
|
+
Ee as isA2uiSurfaceEmpty,
|
|
3086
2233
|
X as isInputBlockType,
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
2234
|
+
Be as isLayoutBlockType,
|
|
2235
|
+
Pe as isMediaBlockType,
|
|
2236
|
+
ir as mapFormDefinitionFromDto,
|
|
2237
|
+
W as normalizeFormDefinition,
|
|
2238
|
+
yt as parsePayloadBlocksJson,
|
|
2239
|
+
mr as payloadHasInputBlocks,
|
|
2240
|
+
rr as resolveSurfaceFromFormDefinition,
|
|
2241
|
+
yr as submitFormJson,
|
|
2242
|
+
nr as surfaceDocToMessages,
|
|
2243
|
+
pe as syncFormDefinition,
|
|
2244
|
+
xn as useCaseSearch,
|
|
2245
|
+
Pn as useResumeSearch
|
|
3099
2246
|
};
|