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