@skopon-cool/form-sdk 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/formSchema.d.ts.map +1 -1
- package/dist/blocks/case_multiselect/adapter.d.ts.map +1 -1
- package/dist/blocks/resume_multiselect/adapter.d.ts.map +1 -1
- package/dist/catalog/skoponCaseSelect.d.ts.map +1 -1
- package/dist/catalog/skoponResumeSelect.d.ts.map +1 -1
- package/dist/catalog/useSkoponBoundField.d.ts +5 -0
- package/dist/catalog/useSkoponBoundField.d.ts.map +1 -1
- package/dist/index.js +916 -828
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -2
- 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,31 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
import { jsx as s, jsxs as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { Spin as
|
|
5
|
-
import { ReloadOutlined as
|
|
6
|
-
import { createBinderlessComponentImplementation as
|
|
2
|
+
import { jsx as s, jsxs as C, Fragment as Ye } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as ze, useContext as Re, useCallback as Q, useSyncExternalStore as Nt, useMemo as B, useState as U, useRef as q, useEffect as j, forwardRef as It, useImperativeHandle as Mt } from "react";
|
|
4
|
+
import { Spin as Oe, Button as fe, Typography as D, Avatar as Ft, Tag as te, Select as Fe, Checkbox as Pt, Radio as Ut, Switch as _t, TimePicker as Et, DatePicker as zt, Upload as Se, Input as xe, InputNumber as Rt, Tooltip as ee } from "antd";
|
|
5
|
+
import { ReloadOutlined as Xe, FileTextOutlined as Ge, UserOutlined as Ot, FileImageOutlined as Bt, FileExcelOutlined as Vt, FileOutlined as We, PictureOutlined as wt, SoundOutlined as qt, VideoCameraOutlined as jt } from "@ant-design/icons";
|
|
6
|
+
import { createBinderlessComponentImplementation as V, basicCatalog as ue, A2uiSurface as Ze } from "@a2ui/react/v0_9";
|
|
7
7
|
import { z as d } from "zod";
|
|
8
|
-
import { Catalog as
|
|
9
|
-
import { injectBasicCatalogStyles as
|
|
10
|
-
import { injectStyles as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
8
|
+
import { Catalog as $t, MessageProcessor as Qe } from "@a2ui/web_core/v0_9";
|
|
9
|
+
import { injectBasicCatalogStyles as et } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
10
|
+
import { injectStyles as tt } from "@a2ui/react/styles";
|
|
11
|
+
import $e from "dayjs";
|
|
12
|
+
const oo = "v0.9", Lt = [
|
|
13
13
|
"huge",
|
|
14
14
|
"large",
|
|
15
15
|
"medium",
|
|
16
16
|
"small",
|
|
17
17
|
"icon"
|
|
18
18
|
];
|
|
19
|
-
function
|
|
19
|
+
function Pe(e) {
|
|
20
20
|
return e === "image" || e === "video" || e === "audio";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Be(e) {
|
|
23
23
|
return e === "heading" || e === "paragraph";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return !
|
|
25
|
+
function X(e) {
|
|
26
|
+
return !Be(e) && !Pe(e);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Dt() {
|
|
29
29
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
30
30
|
return crypto.randomUUID();
|
|
31
31
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
@@ -39,11 +39,11 @@ function Ot() {
|
|
|
39
39
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const t =
|
|
42
|
+
function re(e) {
|
|
43
|
+
const t = Dt().replace(/-/g, "").slice(0, 8);
|
|
44
44
|
return `${e}${t}`;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const nt = [
|
|
47
47
|
{ value: "image/*", label: "图片" },
|
|
48
48
|
{ value: "video/*", label: "视频" },
|
|
49
49
|
{ value: "audio/*", label: "音频" },
|
|
@@ -54,7 +54,7 @@ const Ze = [
|
|
|
54
54
|
{ value: "text/plain", label: "纯文本" },
|
|
55
55
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
56
56
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
57
|
-
],
|
|
57
|
+
], Kt = {
|
|
58
58
|
"image/*": ["image/*"],
|
|
59
59
|
"video/*": ["video/*"],
|
|
60
60
|
"audio/*": ["audio/*"],
|
|
@@ -74,7 +74,7 @@ const Ze = [
|
|
|
74
74
|
"text/plain": ["text/plain"],
|
|
75
75
|
"application/zip": ["application/zip"],
|
|
76
76
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
77
|
-
},
|
|
77
|
+
}, Jt = {
|
|
78
78
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
79
79
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
80
80
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -85,14 +85,14 @@ const Ze = [
|
|
|
85
85
|
"text/plain": [".txt"],
|
|
86
86
|
"application/zip": [".zip", ".7z"],
|
|
87
87
|
"application/x-rar-compressed": [".rar"]
|
|
88
|
-
},
|
|
88
|
+
}, Ht = {
|
|
89
89
|
"application/msword": "office/word",
|
|
90
90
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
91
91
|
"application/vnd.ms-excel": "office/excel",
|
|
92
92
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
|
|
93
93
|
"application/vnd.ms-powerpoint": "office/ppt",
|
|
94
94
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
|
|
95
|
-
},
|
|
95
|
+
}, Ve = [
|
|
96
96
|
{ value: ".jpg", label: ".jpg" },
|
|
97
97
|
{ value: ".jpeg", label: ".jpeg" },
|
|
98
98
|
{ value: ".png", label: ".png" },
|
|
@@ -118,117 +118,121 @@ const Ze = [
|
|
|
118
118
|
{ value: ".zip", label: ".zip" },
|
|
119
119
|
{ value: ".rar", label: ".rar" },
|
|
120
120
|
{ value: ".7z", label: ".7z" }
|
|
121
|
-
],
|
|
122
|
-
|
|
123
|
-
),
|
|
124
|
-
|
|
125
|
-
),
|
|
126
|
-
|
|
121
|
+
], Yt = Object.fromEntries(
|
|
122
|
+
nt.map((e) => [e.value, e.label])
|
|
123
|
+
), Xt = Object.fromEntries(
|
|
124
|
+
Ve.map((e) => [e.value, e.label])
|
|
125
|
+
), Gt = new Set(nt.map((e) => e.value)), Wt = new Set(
|
|
126
|
+
Ve.map((e) => e.value)
|
|
127
127
|
);
|
|
128
|
-
function
|
|
128
|
+
function Zt(e) {
|
|
129
129
|
const t = e.trim();
|
|
130
|
-
return t ?
|
|
130
|
+
return t ? Gt.has(t) ? t : Ht[t] ?? null : null;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Qt(e) {
|
|
133
133
|
return Array.isArray(e) ? e.map((t) => {
|
|
134
134
|
const n = t.trim().toLowerCase();
|
|
135
135
|
return n ? n.startsWith(".") ? n : `.${n}` : "";
|
|
136
136
|
}).filter(Boolean) : [];
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function oe(e) {
|
|
139
139
|
if (!Array.isArray(e)) return [];
|
|
140
140
|
const t = [], n = /* @__PURE__ */ new Set();
|
|
141
141
|
for (const r of e) {
|
|
142
|
-
const o =
|
|
142
|
+
const o = Zt(r);
|
|
143
143
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
144
144
|
}
|
|
145
145
|
return t;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
const t =
|
|
147
|
+
function en(e) {
|
|
148
|
+
const t = oe(e), n = [];
|
|
149
149
|
for (const r of t)
|
|
150
|
-
n.push(...
|
|
150
|
+
n.push(...Kt[r] ?? [r]);
|
|
151
151
|
return n;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const t =
|
|
153
|
+
function tn(e) {
|
|
154
|
+
const t = oe(e);
|
|
155
155
|
if (t.length === 0) return [];
|
|
156
156
|
const n = /* @__PURE__ */ new Set();
|
|
157
157
|
for (const r of t)
|
|
158
|
-
for (const o of
|
|
158
|
+
for (const o of Jt[r] ?? [])
|
|
159
159
|
n.add(o);
|
|
160
|
-
return
|
|
160
|
+
return Ve.filter((r) => n.has(r.value));
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const n =
|
|
162
|
+
function we(e, t) {
|
|
163
|
+
const n = Qt(t), r = oe(e);
|
|
164
164
|
if (r.length === 0)
|
|
165
|
-
return n.filter((
|
|
165
|
+
return n.filter((i) => Wt.has(i));
|
|
166
166
|
const o = new Set(
|
|
167
|
-
|
|
167
|
+
tn(r).map((i) => i.value)
|
|
168
168
|
);
|
|
169
|
-
return n.filter((
|
|
169
|
+
return n.filter((i) => o.has(i));
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
const n =
|
|
171
|
+
function nn(e, t) {
|
|
172
|
+
const n = en(e), r = we(e, t), o = [...n, ...r];
|
|
173
173
|
return o.length > 0 ? o.join(",") : void 0;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
const n =
|
|
175
|
+
function rn(e, t) {
|
|
176
|
+
const n = oe(e), r = we(
|
|
177
177
|
n,
|
|
178
178
|
t
|
|
179
179
|
), o = [
|
|
180
|
-
...n.map((
|
|
181
|
-
...r.map((
|
|
180
|
+
...n.map((i) => Yt[i] ?? i),
|
|
181
|
+
...r.map((i) => Xt[i] ?? i)
|
|
182
182
|
];
|
|
183
183
|
return o.length === 0 ? null : o.join("、");
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const on = [
|
|
186
186
|
"video",
|
|
187
187
|
"audio",
|
|
188
188
|
"image",
|
|
189
189
|
"file",
|
|
190
190
|
"spreadsheet",
|
|
191
191
|
"document"
|
|
192
|
-
],
|
|
193
|
-
function
|
|
194
|
-
return e &&
|
|
192
|
+
], an = new Set(on);
|
|
193
|
+
function ln(e) {
|
|
194
|
+
return e && an.has(e) ? e : "file";
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
return typeof e == "string" &&
|
|
196
|
+
function ie(e) {
|
|
197
|
+
return typeof e == "string" && Lt.includes(e) ? e : "medium";
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function sn(e, t) {
|
|
200
200
|
var o;
|
|
201
201
|
const n = Math.max(1, t);
|
|
202
202
|
let r = [];
|
|
203
|
-
return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((
|
|
203
|
+
return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function cn(e) {
|
|
206
206
|
var t;
|
|
207
207
|
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
return `form-media-size-${
|
|
209
|
+
function un(e) {
|
|
210
|
+
return `form-media-size-${ie(e)}`;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
return `form-media-preview form-media-list ${
|
|
212
|
+
function pn(e) {
|
|
213
|
+
return `form-media-preview form-media-list ${un(e)}`;
|
|
214
214
|
}
|
|
215
|
-
const
|
|
216
|
-
function
|
|
215
|
+
const mn = 10;
|
|
216
|
+
function qe(e) {
|
|
217
217
|
return e === !0 || e === "true";
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function Le(e, t = 1) {
|
|
220
220
|
const n = typeof e == "number" ? e : Number(e);
|
|
221
221
|
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function le(e, t = 1) {
|
|
224
|
+
const n = typeof e == "number" ? e : Number(e);
|
|
225
|
+
return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
|
|
226
|
+
}
|
|
227
|
+
function dn(e, t) {
|
|
224
228
|
if (t !== void 0)
|
|
225
|
-
return e === "toggle" ?
|
|
229
|
+
return e === "toggle" ? qe(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
|
|
226
230
|
}
|
|
227
|
-
function
|
|
228
|
-
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,
|
|
229
|
-
return { agentKind: r, agentUniqueId: o, flowType:
|
|
231
|
+
function fn(e) {
|
|
232
|
+
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, a = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, l = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
233
|
+
return { agentKind: r, agentUniqueId: o, flowType: i, category: a, flowUniqueIds: l, pageSize: n };
|
|
230
234
|
}
|
|
231
|
-
function
|
|
235
|
+
function hn(e) {
|
|
232
236
|
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20;
|
|
233
237
|
return {
|
|
234
238
|
names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
|
|
@@ -237,47 +241,51 @@ function sn(e) {
|
|
|
237
241
|
pageSize: n
|
|
238
242
|
};
|
|
239
243
|
}
|
|
240
|
-
function
|
|
244
|
+
function gn(e) {
|
|
241
245
|
if (e.type !== "case_singleselect") return e;
|
|
242
246
|
const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
|
|
243
247
|
return { ...e, type: "case_multiselect", defaultValue: t };
|
|
244
248
|
}
|
|
245
|
-
function
|
|
246
|
-
var o,
|
|
247
|
-
const t =
|
|
249
|
+
function yn(e) {
|
|
250
|
+
var o, i;
|
|
251
|
+
const t = gn(e), n = oe(t.fileAcceptTypes), r = t.type;
|
|
248
252
|
return {
|
|
249
|
-
id: ((o = t.id) == null ? void 0 : o.trim()) ||
|
|
253
|
+
id: ((o = t.id) == null ? void 0 : o.trim()) || re("block-"),
|
|
250
254
|
type: r,
|
|
251
|
-
name: ((
|
|
255
|
+
name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
|
|
252
256
|
label: t.label ?? "",
|
|
253
257
|
placeholder: t.placeholder ?? "",
|
|
254
258
|
help: t.help ?? "",
|
|
255
259
|
required: t.required === !0,
|
|
256
|
-
mediaUrls:
|
|
257
|
-
mediaSize:
|
|
260
|
+
mediaUrls: Pe(r) ? sn(t, mn) : void 0,
|
|
261
|
+
mediaSize: Pe(r) ? ie(t.mediaSize) : void 0,
|
|
258
262
|
fileAcceptTypes: n,
|
|
259
|
-
fileAcceptExtensions:
|
|
263
|
+
fileAcceptExtensions: we(
|
|
260
264
|
n,
|
|
261
265
|
t.fileAcceptExtensions
|
|
262
266
|
),
|
|
263
|
-
filePlaceholderIcon:
|
|
264
|
-
fileMinCount: r === "file" ?
|
|
265
|
-
fileMaxCount: r === "file" ?
|
|
266
|
-
defaultValue:
|
|
267
|
-
options: Array.isArray(t.options) ? t.options.map((
|
|
267
|
+
filePlaceholderIcon: ln(t.filePlaceholderIcon),
|
|
268
|
+
fileMinCount: r === "file" ? Le(t.fileMinCount, 1) : void 0,
|
|
269
|
+
fileMaxCount: r === "file" ? Le(t.fileMaxCount, 1) : void 0,
|
|
270
|
+
defaultValue: dn(r, t.defaultValue),
|
|
271
|
+
options: Array.isArray(t.options) ? t.options.map((a, l) => {
|
|
268
272
|
var c, u;
|
|
269
273
|
return {
|
|
270
|
-
value: ((c =
|
|
271
|
-
label: ((u =
|
|
274
|
+
value: ((c = a.value) == null ? void 0 : c.trim()) || `option_${l + 1}`,
|
|
275
|
+
label: ((u = a.label) == null ? void 0 : u.trim()) || `选项 ${l + 1}`
|
|
272
276
|
};
|
|
273
277
|
}) : void 0,
|
|
274
278
|
resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
|
|
275
|
-
|
|
279
|
+
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? le(t.resumeMinCount, 1) : void 0,
|
|
280
|
+
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? le(t.resumeMaxCount, 1) : void 0,
|
|
281
|
+
resumeFilter: r === "resume_multiselect" ? hn(t.resumeFilter) : void 0,
|
|
276
282
|
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
277
|
-
|
|
283
|
+
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? le(t.caseMinCount, 1) : void 0,
|
|
284
|
+
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? le(t.caseMaxCount, 1) : void 0,
|
|
285
|
+
caseFilter: r === "case_multiselect" ? fn(t.caseFilter) : void 0
|
|
278
286
|
};
|
|
279
287
|
}
|
|
280
|
-
function
|
|
288
|
+
function pe(e) {
|
|
281
289
|
return {
|
|
282
290
|
title: e.title ?? "",
|
|
283
291
|
description: e.description ?? "",
|
|
@@ -285,32 +293,38 @@ function se(e) {
|
|
|
285
293
|
jsonSchema: e.jsonSchema ?? {}
|
|
286
294
|
};
|
|
287
295
|
}
|
|
288
|
-
function
|
|
296
|
+
function W(e) {
|
|
289
297
|
if (!e || !Array.isArray(e.blocks))
|
|
290
|
-
return
|
|
291
|
-
const t = e.blocks.map(
|
|
292
|
-
return
|
|
298
|
+
return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
299
|
+
const t = e.blocks.map(yn);
|
|
300
|
+
return pe({
|
|
293
301
|
title: typeof e.title == "string" ? e.title : "",
|
|
294
302
|
description: typeof e.description == "string" ? e.description : "",
|
|
295
303
|
blocks: t,
|
|
296
304
|
jsonSchema: {}
|
|
297
305
|
});
|
|
298
306
|
}
|
|
299
|
-
function
|
|
300
|
-
const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0,
|
|
307
|
+
function vn(e) {
|
|
308
|
+
const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, a = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
301
309
|
return {
|
|
302
310
|
agentKind: n,
|
|
303
311
|
agentUniqueId: r,
|
|
304
312
|
flowType: o,
|
|
305
|
-
category:
|
|
306
|
-
flowUniqueIds:
|
|
313
|
+
category: i,
|
|
314
|
+
flowUniqueIds: a,
|
|
307
315
|
pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
|
|
308
316
|
};
|
|
309
317
|
}
|
|
310
|
-
function
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
|
|
318
|
+
function De(e) {
|
|
319
|
+
if (e == null) return;
|
|
320
|
+
const t = typeof e == "number" ? e : Number(e);
|
|
321
|
+
if (!(!Number.isFinite(t) || t < 1))
|
|
322
|
+
return Math.floor(t);
|
|
323
|
+
}
|
|
324
|
+
function bn(e, t) {
|
|
325
|
+
var a, l, c, u, m, p;
|
|
326
|
+
const { id: n, label: r, path: o, withData: i } = t;
|
|
327
|
+
return i({
|
|
314
328
|
id: n,
|
|
315
329
|
component: "SkoponCaseSelect",
|
|
316
330
|
label: r,
|
|
@@ -318,46 +332,52 @@ function mn(e, t) {
|
|
|
318
332
|
help: e.help ?? "",
|
|
319
333
|
enableRefresh: e.caseEnableRefresh !== !1,
|
|
320
334
|
caseFilter: {
|
|
321
|
-
agentKind: (
|
|
335
|
+
agentKind: (a = e.caseFilter) == null ? void 0 : a.agentKind,
|
|
322
336
|
agentUniqueId: (l = e.caseFilter) == null ? void 0 : l.agentUniqueId,
|
|
323
337
|
flowType: (c = e.caseFilter) == null ? void 0 : c.flowType,
|
|
324
338
|
category: (u = e.caseFilter) == null ? void 0 : u.category,
|
|
325
339
|
flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
|
|
326
340
|
pageSize: ((p = e.caseFilter) == null ? void 0 : p.pageSize) ?? 20
|
|
327
341
|
},
|
|
342
|
+
...e.caseMinCount !== void 0 ? { minCount: e.caseMinCount } : {},
|
|
343
|
+
...e.caseMaxCount !== void 0 ? { maxCount: e.caseMaxCount } : {},
|
|
328
344
|
value: { path: o }
|
|
329
345
|
});
|
|
330
346
|
}
|
|
331
|
-
function
|
|
347
|
+
function Sn(e, t, n) {
|
|
332
348
|
const r = n.nameFromValue(e.value), o = {
|
|
333
349
|
...t("case_multiselect"),
|
|
334
350
|
name: r,
|
|
335
351
|
caseEnableRefresh: e.enableRefresh !== !1
|
|
336
|
-
},
|
|
337
|
-
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
352
|
+
}, i = n.asLiteral(e.placeholder);
|
|
353
|
+
i && (o.placeholder = i);
|
|
354
|
+
const a = n.asLiteral(e.help);
|
|
355
|
+
a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = vn(e.caseFilter));
|
|
356
|
+
const l = De(e.minCount);
|
|
357
|
+
l !== void 0 && (o.caseMinCount = l);
|
|
358
|
+
const c = De(e.maxCount);
|
|
359
|
+
return c !== void 0 && (o.caseMaxCount = c), o;
|
|
360
|
+
}
|
|
361
|
+
const rt = ze({ interactive: !0 });
|
|
362
|
+
function ot({
|
|
343
363
|
interactive: e,
|
|
344
364
|
children: t
|
|
345
365
|
}) {
|
|
346
|
-
return /* @__PURE__ */ s(
|
|
366
|
+
return /* @__PURE__ */ s(rt.Provider, { value: { interactive: e }, children: t });
|
|
347
367
|
}
|
|
348
|
-
function
|
|
349
|
-
return
|
|
368
|
+
function K() {
|
|
369
|
+
return Re(rt);
|
|
350
370
|
}
|
|
351
|
-
function
|
|
371
|
+
function it(e) {
|
|
352
372
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
353
373
|
}
|
|
354
|
-
function
|
|
374
|
+
function Ke(e, t = "value") {
|
|
355
375
|
const r = e.componentModel.properties[t];
|
|
356
|
-
if (!(!
|
|
376
|
+
if (!(!it(r) || r === void 0))
|
|
357
377
|
return e.dataContext.resolveDynamicValue(r);
|
|
358
378
|
}
|
|
359
|
-
function
|
|
360
|
-
const r = e.componentModel.properties[t], o =
|
|
379
|
+
function J(e, t = "value") {
|
|
380
|
+
const r = e.componentModel.properties[t], o = it(r), i = Q(
|
|
361
381
|
(u) => {
|
|
362
382
|
if (!o || r === void 0) return () => {
|
|
363
383
|
};
|
|
@@ -365,10 +385,10 @@ function D(e, t = "value") {
|
|
|
365
385
|
return () => m.unsubscribe();
|
|
366
386
|
},
|
|
367
387
|
[e, r, o]
|
|
368
|
-
),
|
|
388
|
+
), a = Q(() => {
|
|
369
389
|
if (!(!o || r === void 0))
|
|
370
390
|
return e.dataContext.resolveDynamicValue(r);
|
|
371
|
-
}, [e, r, o]), l =
|
|
391
|
+
}, [e, r, o]), l = Nt(i, a, a), c = Q(
|
|
372
392
|
(u) => {
|
|
373
393
|
!o || !r || typeof r != "object" || !("path" in r) || e.dataContext.set(String(r.path), u);
|
|
374
394
|
},
|
|
@@ -376,41 +396,62 @@ function D(e, t = "value") {
|
|
|
376
396
|
);
|
|
377
397
|
return { value: l, setValue: c, hasBinding: !!o };
|
|
378
398
|
}
|
|
379
|
-
function
|
|
399
|
+
function ne(e) {
|
|
380
400
|
if (typeof e == "string") return e || void 0;
|
|
381
401
|
if (typeof e == "number") return String(e);
|
|
382
402
|
}
|
|
383
|
-
function
|
|
403
|
+
function L(e) {
|
|
384
404
|
return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
|
|
385
405
|
}
|
|
386
|
-
|
|
387
|
-
|
|
406
|
+
function me(e) {
|
|
407
|
+
if (e == null) return;
|
|
408
|
+
const t = typeof e == "number" ? e : Number(e);
|
|
409
|
+
if (!(!Number.isFinite(t) || t < 1))
|
|
410
|
+
return Math.floor(t);
|
|
411
|
+
}
|
|
412
|
+
function at(e, t, n, r) {
|
|
413
|
+
if (e.includes(t)) {
|
|
414
|
+
const i = e.filter((a) => a !== t);
|
|
415
|
+
return n !== void 0 && i.length < n ? null : i;
|
|
416
|
+
}
|
|
417
|
+
return r !== void 0 && e.length >= r ? null : [...e, t];
|
|
418
|
+
}
|
|
419
|
+
function lt(e, t, n, r, o) {
|
|
420
|
+
if (!n) return !0;
|
|
421
|
+
const i = e.includes(t);
|
|
422
|
+
return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
|
|
423
|
+
}
|
|
424
|
+
function st(e, t) {
|
|
425
|
+
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
426
|
+
}
|
|
427
|
+
const ct = ze(null);
|
|
428
|
+
function ut({
|
|
388
429
|
caseSearch: e,
|
|
389
430
|
children: t
|
|
390
431
|
}) {
|
|
391
|
-
return /* @__PURE__ */ s(
|
|
432
|
+
return /* @__PURE__ */ s(ct.Provider, { value: e ?? null, children: t });
|
|
392
433
|
}
|
|
393
|
-
function
|
|
394
|
-
return
|
|
434
|
+
function xn() {
|
|
435
|
+
return Re(ct);
|
|
395
436
|
}
|
|
396
|
-
function
|
|
437
|
+
function Ce(e) {
|
|
397
438
|
return typeof e == "string" ? e : "";
|
|
398
439
|
}
|
|
399
|
-
function
|
|
440
|
+
function ke(e) {
|
|
400
441
|
if (!e || typeof e != "object")
|
|
401
442
|
return { flowUniqueIds: [], pageSize: 20 };
|
|
402
|
-
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,
|
|
403
|
-
return { agentKind: o, agentUniqueId:
|
|
443
|
+
const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, a = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, l = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
444
|
+
return { agentKind: o, agentUniqueId: i, flowType: a, category: l, flowUniqueIds: c, pageSize: r };
|
|
404
445
|
}
|
|
405
|
-
function
|
|
446
|
+
function Ae(e) {
|
|
406
447
|
var r;
|
|
407
448
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
|
|
408
449
|
return t || n;
|
|
409
450
|
}
|
|
410
|
-
function
|
|
451
|
+
function Cn(e) {
|
|
411
452
|
return JSON.stringify(e);
|
|
412
453
|
}
|
|
413
|
-
const
|
|
454
|
+
const kn = {
|
|
414
455
|
name: "SkoponCaseSelect",
|
|
415
456
|
schema: d.object({
|
|
416
457
|
label: d.any().optional(),
|
|
@@ -418,16 +459,18 @@ const gn = {
|
|
|
418
459
|
help: d.any().optional(),
|
|
419
460
|
enableRefresh: d.any().optional(),
|
|
420
461
|
caseFilter: d.any().optional(),
|
|
462
|
+
minCount: d.any().optional(),
|
|
463
|
+
maxCount: d.any().optional(),
|
|
421
464
|
value: d.any().optional()
|
|
422
465
|
}).passthrough()
|
|
423
466
|
};
|
|
424
|
-
function
|
|
467
|
+
function An({
|
|
425
468
|
item: e,
|
|
426
469
|
selected: t,
|
|
427
470
|
disabled: n,
|
|
428
471
|
onToggle: r
|
|
429
472
|
}) {
|
|
430
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ C(
|
|
431
474
|
"button",
|
|
432
475
|
{
|
|
433
476
|
type: "button",
|
|
@@ -435,11 +478,11 @@ function yn({
|
|
|
435
478
|
disabled: n,
|
|
436
479
|
onClick: r,
|
|
437
480
|
children: [
|
|
438
|
-
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(
|
|
439
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(Ge, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
|
|
482
|
+
/* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
|
|
440
483
|
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name }),
|
|
441
484
|
e.description ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
|
|
442
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ C("div", { className: "skopon-resume-select-card-meta", children: [
|
|
443
486
|
e.caseUniqueId,
|
|
444
487
|
e.platform ? ` · ${e.platform}` : "",
|
|
445
488
|
e.link ? ` · ${e.link}` : ""
|
|
@@ -449,85 +492,107 @@ function yn({
|
|
|
449
492
|
}
|
|
450
493
|
);
|
|
451
494
|
}
|
|
452
|
-
function
|
|
453
|
-
const { interactive: t } =
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
495
|
+
function Tn({ context: e }) {
|
|
496
|
+
const { interactive: t } = K(), n = xn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Ce(i.label), l = Ce(i.placeholder), c = Ce(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => ke(i.caseFilter), [i.caseFilter]), v = Cn(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
|
|
497
|
+
j(() => {
|
|
498
|
+
const b = st(O, p);
|
|
499
|
+
b !== null && o(b);
|
|
500
|
+
}, [p, O, o]);
|
|
501
|
+
const H = B(() => n ? Ae(g) ? h || l || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, h, l]), Y = Q(
|
|
502
|
+
async (b) => {
|
|
503
|
+
const F = ke(JSON.parse(v)), R = ++w.current;
|
|
504
|
+
if (!n || !Ae(F)) {
|
|
505
|
+
S([]), z(0), x("");
|
|
458
506
|
return;
|
|
459
507
|
}
|
|
460
|
-
|
|
508
|
+
f(!0), x("");
|
|
461
509
|
try {
|
|
462
|
-
const
|
|
463
|
-
if (
|
|
464
|
-
|
|
465
|
-
} catch (
|
|
466
|
-
if (
|
|
467
|
-
|
|
510
|
+
const N = await n({ filter: F, page: b });
|
|
511
|
+
if (R !== w.current) return;
|
|
512
|
+
S(N.list), z(N.total), T(N.page), G(N.pageSize);
|
|
513
|
+
} catch (N) {
|
|
514
|
+
if (R !== w.current) return;
|
|
515
|
+
S([]), z(0), x(N instanceof Error ? N.message : "加载案例列表失败");
|
|
468
516
|
} finally {
|
|
469
|
-
|
|
517
|
+
R === w.current && f(!1);
|
|
470
518
|
}
|
|
471
519
|
},
|
|
472
|
-
[n,
|
|
520
|
+
[n, v]
|
|
473
521
|
);
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}, [
|
|
477
|
-
const
|
|
522
|
+
j(() => {
|
|
523
|
+
T(1), Y(1);
|
|
524
|
+
}, [v, Y]);
|
|
525
|
+
const P = (b) => {
|
|
478
526
|
if (!t) return;
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
527
|
+
const F = at(
|
|
528
|
+
O,
|
|
529
|
+
b,
|
|
530
|
+
m,
|
|
531
|
+
p
|
|
532
|
+
);
|
|
533
|
+
F !== null && o(F);
|
|
534
|
+
}, _ = () => {
|
|
535
|
+
const b = ke(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
|
|
536
|
+
Y(N);
|
|
484
537
|
};
|
|
485
|
-
return /* @__PURE__ */
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
/* @__PURE__ */ s(
|
|
538
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
|
|
539
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
540
|
+
k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
|
|
541
|
+
/* @__PURE__ */ s(Oe, { size: "small" }),
|
|
489
542
|
" 加载案例…"
|
|
490
543
|
] }) : null,
|
|
491
|
-
!
|
|
492
|
-
|
|
493
|
-
|
|
544
|
+
!k && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: H }) : null,
|
|
545
|
+
y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
|
|
546
|
+
An,
|
|
494
547
|
{
|
|
495
|
-
item:
|
|
496
|
-
selected: O.includes(
|
|
497
|
-
disabled:
|
|
498
|
-
|
|
548
|
+
item: b,
|
|
549
|
+
selected: O.includes(b.caseUniqueId),
|
|
550
|
+
disabled: lt(
|
|
551
|
+
O,
|
|
552
|
+
b.caseUniqueId,
|
|
553
|
+
t,
|
|
554
|
+
m,
|
|
555
|
+
p
|
|
556
|
+
),
|
|
557
|
+
onToggle: () => P(b.caseUniqueId)
|
|
499
558
|
},
|
|
500
|
-
|
|
559
|
+
b.caseUniqueId
|
|
501
560
|
)) }) : null,
|
|
502
|
-
u && n &&
|
|
503
|
-
|
|
561
|
+
u && n && Ae(g) ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
|
|
562
|
+
fe,
|
|
504
563
|
{
|
|
505
564
|
type: "default",
|
|
506
565
|
size: "small",
|
|
507
|
-
icon: /* @__PURE__ */ s(
|
|
508
|
-
loading:
|
|
566
|
+
icon: /* @__PURE__ */ s(Xe, {}),
|
|
567
|
+
loading: k,
|
|
509
568
|
disabled: !t,
|
|
510
|
-
onClick:
|
|
569
|
+
onClick: _,
|
|
511
570
|
children: "换一批"
|
|
512
571
|
}
|
|
513
572
|
) }) : null,
|
|
514
|
-
c ? /* @__PURE__ */ s(
|
|
573
|
+
c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
|
|
515
574
|
] });
|
|
516
575
|
}
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
),
|
|
576
|
+
const Nn = V(
|
|
577
|
+
kn,
|
|
578
|
+
Tn
|
|
579
|
+
), In = {
|
|
521
580
|
type: "case_multiselect",
|
|
522
581
|
componentName: "SkoponCaseSelect",
|
|
523
|
-
toComponent:
|
|
524
|
-
fromComponent:
|
|
525
|
-
catalogComponents: [
|
|
582
|
+
toComponent: bn,
|
|
583
|
+
fromComponent: Sn,
|
|
584
|
+
catalogComponents: [Nn]
|
|
526
585
|
};
|
|
527
|
-
function
|
|
528
|
-
|
|
529
|
-
const
|
|
530
|
-
|
|
586
|
+
function Je(e) {
|
|
587
|
+
if (e == null) return;
|
|
588
|
+
const t = typeof e == "number" ? e : Number(e);
|
|
589
|
+
if (!(!Number.isFinite(t) || t < 1))
|
|
590
|
+
return Math.floor(t);
|
|
591
|
+
}
|
|
592
|
+
function Mn(e, t) {
|
|
593
|
+
var a, l, c, u;
|
|
594
|
+
const { id: n, label: r, path: o, withData: i } = t;
|
|
595
|
+
return i({
|
|
531
596
|
id: n,
|
|
532
597
|
component: "SkoponResumeSelect",
|
|
533
598
|
label: r,
|
|
@@ -535,56 +600,61 @@ function kn(e, t) {
|
|
|
535
600
|
help: e.help ?? "",
|
|
536
601
|
enableRefresh: e.resumeEnableRefresh !== !1,
|
|
537
602
|
resumeFilter: {
|
|
538
|
-
names: ((
|
|
603
|
+
names: ((a = e.resumeFilter) == null ? void 0 : a.names) ?? [],
|
|
539
604
|
agentUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.agentUniqueIds) ?? [],
|
|
540
605
|
resumeUniqueIds: ((c = e.resumeFilter) == null ? void 0 : c.resumeUniqueIds) ?? [],
|
|
541
606
|
pageSize: ((u = e.resumeFilter) == null ? void 0 : u.pageSize) ?? 20
|
|
542
607
|
},
|
|
608
|
+
...e.resumeMinCount !== void 0 ? { minCount: e.resumeMinCount } : {},
|
|
609
|
+
...e.resumeMaxCount !== void 0 ? { maxCount: e.resumeMaxCount } : {},
|
|
543
610
|
value: { path: o }
|
|
544
611
|
});
|
|
545
612
|
}
|
|
546
|
-
function
|
|
613
|
+
function Fn(e, t, n) {
|
|
547
614
|
const r = n.nameFromValue(e.value), o = {
|
|
548
615
|
...t("resume_multiselect"),
|
|
549
616
|
name: r,
|
|
550
617
|
resumeEnableRefresh: e.enableRefresh !== !1
|
|
551
|
-
},
|
|
552
|
-
|
|
553
|
-
const
|
|
554
|
-
if (
|
|
555
|
-
const
|
|
618
|
+
}, i = n.asLiteral(e.placeholder);
|
|
619
|
+
i && (o.placeholder = i);
|
|
620
|
+
const a = n.asLiteral(e.help);
|
|
621
|
+
if (a && (o.help = a), e.resumeFilter && typeof e.resumeFilter == "object") {
|
|
622
|
+
const u = e.resumeFilter;
|
|
556
623
|
o.resumeFilter = {
|
|
557
|
-
names: Array.isArray(
|
|
558
|
-
agentUniqueIds: Array.isArray(
|
|
559
|
-
resumeUniqueIds: Array.isArray(
|
|
560
|
-
pageSize: typeof
|
|
624
|
+
names: Array.isArray(u.names) ? u.names.map(String) : [],
|
|
625
|
+
agentUniqueIds: Array.isArray(u.agentUniqueIds) ? u.agentUniqueIds.map(String) : [],
|
|
626
|
+
resumeUniqueIds: Array.isArray(u.resumeUniqueIds) ? u.resumeUniqueIds.map(String) : [],
|
|
627
|
+
pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
|
|
561
628
|
};
|
|
562
629
|
}
|
|
563
|
-
|
|
630
|
+
const l = Je(e.minCount);
|
|
631
|
+
l !== void 0 && (o.resumeMinCount = l);
|
|
632
|
+
const c = Je(e.maxCount);
|
|
633
|
+
return c !== void 0 && (o.resumeMaxCount = c), o;
|
|
564
634
|
}
|
|
565
|
-
const
|
|
566
|
-
function
|
|
635
|
+
const pt = ze(null);
|
|
636
|
+
function mt({
|
|
567
637
|
resumeSearch: e,
|
|
568
638
|
children: t
|
|
569
639
|
}) {
|
|
570
|
-
return /* @__PURE__ */ s(
|
|
640
|
+
return /* @__PURE__ */ s(pt.Provider, { value: e ?? null, children: t });
|
|
571
641
|
}
|
|
572
|
-
function
|
|
573
|
-
return
|
|
642
|
+
function Pn() {
|
|
643
|
+
return Re(pt);
|
|
574
644
|
}
|
|
575
|
-
function
|
|
645
|
+
function Te(e) {
|
|
576
646
|
return typeof e == "string" ? e : "";
|
|
577
647
|
}
|
|
578
|
-
function
|
|
648
|
+
function Ne(e) {
|
|
579
649
|
if (!e || typeof e != "object")
|
|
580
650
|
return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
|
|
581
|
-
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) : [],
|
|
582
|
-
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize:
|
|
651
|
+
const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), a = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
|
|
652
|
+
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: a };
|
|
583
653
|
}
|
|
584
|
-
function
|
|
654
|
+
function Un(e) {
|
|
585
655
|
return JSON.stringify(e);
|
|
586
656
|
}
|
|
587
|
-
const
|
|
657
|
+
const _n = {
|
|
588
658
|
name: "SkoponResumeSelect",
|
|
589
659
|
schema: d.object({
|
|
590
660
|
label: d.any().optional(),
|
|
@@ -592,42 +662,44 @@ const Cn = {
|
|
|
592
662
|
help: d.any().optional(),
|
|
593
663
|
enableRefresh: d.any().optional(),
|
|
594
664
|
resumeFilter: d.any().optional(),
|
|
665
|
+
minCount: d.any().optional(),
|
|
666
|
+
maxCount: d.any().optional(),
|
|
595
667
|
value: d.any().optional()
|
|
596
668
|
}).passthrough()
|
|
597
|
-
},
|
|
598
|
-
function
|
|
599
|
-
const n = (t ?? []).filter(Boolean), r = n.slice(0,
|
|
600
|
-
return /* @__PURE__ */
|
|
669
|
+
}, En = 3, zn = 2;
|
|
670
|
+
function Ie(e, t) {
|
|
671
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, En), o = n.length - r.length;
|
|
672
|
+
return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags", children: [
|
|
601
673
|
/* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
602
|
-
n.length > 0 ? /* @__PURE__ */
|
|
603
|
-
r.map((
|
|
604
|
-
o > 0 ? /* @__PURE__ */
|
|
674
|
+
n.length > 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
675
|
+
r.map((i) => /* @__PURE__ */ s(te, { className: "skopon-resume-select-card-tag", children: i }, i)),
|
|
676
|
+
o > 0 ? /* @__PURE__ */ C(te, { className: "skopon-resume-select-card-tag", children: [
|
|
605
677
|
"+",
|
|
606
678
|
o
|
|
607
679
|
] }) : null
|
|
608
680
|
] }) : /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
609
681
|
] });
|
|
610
682
|
}
|
|
611
|
-
function
|
|
612
|
-
return /* @__PURE__ */
|
|
683
|
+
function Rn(e) {
|
|
684
|
+
return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-field", children: [
|
|
613
685
|
/* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
614
686
|
/* @__PURE__ */ s("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
615
687
|
] });
|
|
616
688
|
}
|
|
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(
|
|
689
|
+
function On({ work: e }) {
|
|
690
|
+
return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-work", children: [
|
|
691
|
+
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ s("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ s(Bt, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
620
692
|
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
621
693
|
] });
|
|
622
694
|
}
|
|
623
|
-
function
|
|
695
|
+
function Bn({
|
|
624
696
|
item: e,
|
|
625
697
|
selected: t,
|
|
626
698
|
disabled: n,
|
|
627
699
|
onToggle: r
|
|
628
700
|
}) {
|
|
629
|
-
const o = (e.works ?? []).slice(0,
|
|
630
|
-
return /* @__PURE__ */
|
|
701
|
+
const o = (e.works ?? []).slice(0, zn);
|
|
702
|
+
return /* @__PURE__ */ C(
|
|
631
703
|
"button",
|
|
632
704
|
{
|
|
633
705
|
type: "button",
|
|
@@ -636,166 +708,182 @@ function Pn({
|
|
|
636
708
|
onClick: r,
|
|
637
709
|
children: [
|
|
638
710
|
/* @__PURE__ */ s(
|
|
639
|
-
|
|
711
|
+
Ft,
|
|
640
712
|
{
|
|
641
713
|
size: 48,
|
|
642
714
|
src: e.avatarUrl || void 0,
|
|
643
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(
|
|
715
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(Ot, {}),
|
|
644
716
|
className: "skopon-resume-select-card-avatar"
|
|
645
717
|
}
|
|
646
718
|
),
|
|
647
719
|
/* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
648
|
-
/* @__PURE__ */
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
|
|
721
|
+
Rn(e.satisfaction),
|
|
722
|
+
Ie("性格", e.personality),
|
|
723
|
+
Ie("专长", e.specialties),
|
|
724
|
+
Ie("擅长领域", e.traits),
|
|
725
|
+
/* @__PURE__ */ C("div", { className: "skopon-resume-select-card-works", children: [
|
|
654
726
|
/* @__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((
|
|
727
|
+
o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ s(On, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
|
|
656
728
|
] })
|
|
657
729
|
] })
|
|
658
730
|
]
|
|
659
731
|
}
|
|
660
732
|
);
|
|
661
733
|
}
|
|
662
|
-
function
|
|
663
|
-
const { interactive: t } =
|
|
664
|
-
|
|
665
|
-
|
|
734
|
+
function Vn({ context: e }) {
|
|
735
|
+
const { interactive: t } = K(), n = Pn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Te(i.label), l = Te(i.placeholder), c = Te(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => Ne(i.resumeFilter), [i.resumeFilter]), v = Un(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
|
|
736
|
+
j(() => {
|
|
737
|
+
const b = st(O, p);
|
|
738
|
+
b !== null && o(b);
|
|
739
|
+
}, [p, O, o]);
|
|
740
|
+
const H = Q(
|
|
741
|
+
async (b) => {
|
|
742
|
+
const F = Ne(JSON.parse(v)), R = ++w.current;
|
|
666
743
|
if (!n) {
|
|
667
|
-
|
|
744
|
+
S([]), z(0), x("未配置简历搜索服务");
|
|
668
745
|
return;
|
|
669
746
|
}
|
|
670
|
-
|
|
747
|
+
f(!0), x("");
|
|
671
748
|
try {
|
|
672
|
-
const
|
|
673
|
-
if (
|
|
674
|
-
|
|
675
|
-
} catch (
|
|
676
|
-
if (
|
|
677
|
-
|
|
749
|
+
const N = await n({ filter: F, page: b });
|
|
750
|
+
if (R !== w.current) return;
|
|
751
|
+
S(N.list), z(N.total), T(N.page), G(N.pageSize);
|
|
752
|
+
} catch (N) {
|
|
753
|
+
if (R !== w.current) return;
|
|
754
|
+
S([]), z(0), x(N instanceof Error ? N.message : "加载简历列表失败");
|
|
678
755
|
} finally {
|
|
679
|
-
|
|
756
|
+
R === w.current && f(!1);
|
|
680
757
|
}
|
|
681
758
|
},
|
|
682
|
-
[n,
|
|
759
|
+
[n, v]
|
|
683
760
|
);
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}, [
|
|
687
|
-
const
|
|
761
|
+
j(() => {
|
|
762
|
+
T(1), H(1);
|
|
763
|
+
}, [v, H]);
|
|
764
|
+
const Y = (b) => {
|
|
688
765
|
if (!t) return;
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
766
|
+
const F = at(
|
|
767
|
+
O,
|
|
768
|
+
b,
|
|
769
|
+
m,
|
|
770
|
+
p
|
|
771
|
+
);
|
|
772
|
+
F !== null && o(F);
|
|
773
|
+
}, P = () => {
|
|
774
|
+
const b = Ne(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
|
|
775
|
+
H(N);
|
|
776
|
+
}, _ = l || "暂无匹配的简历";
|
|
777
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
|
|
778
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
779
|
+
k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
|
|
780
|
+
/* @__PURE__ */ s(Oe, { size: "small" }),
|
|
699
781
|
" 加载简历…"
|
|
700
782
|
] }) : null,
|
|
701
|
-
!
|
|
702
|
-
!
|
|
703
|
-
|
|
704
|
-
|
|
783
|
+
!k && h ? /* @__PURE__ */ s(D.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
|
|
784
|
+
!k && !h && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: _ }) : null,
|
|
785
|
+
y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
|
|
786
|
+
Bn,
|
|
705
787
|
{
|
|
706
|
-
item:
|
|
707
|
-
selected: O.includes(
|
|
708
|
-
disabled:
|
|
709
|
-
|
|
788
|
+
item: b,
|
|
789
|
+
selected: O.includes(b.resumeUniqueId),
|
|
790
|
+
disabled: lt(
|
|
791
|
+
O,
|
|
792
|
+
b.resumeUniqueId,
|
|
793
|
+
t,
|
|
794
|
+
m,
|
|
795
|
+
p
|
|
796
|
+
),
|
|
797
|
+
onToggle: () => Y(b.resumeUniqueId)
|
|
710
798
|
},
|
|
711
|
-
|
|
799
|
+
b.resumeUniqueId
|
|
712
800
|
)) }) : null,
|
|
713
801
|
u && n ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
|
|
714
|
-
|
|
802
|
+
fe,
|
|
715
803
|
{
|
|
716
804
|
type: "default",
|
|
717
805
|
size: "small",
|
|
718
|
-
icon: /* @__PURE__ */ s(
|
|
719
|
-
loading:
|
|
806
|
+
icon: /* @__PURE__ */ s(Xe, {}),
|
|
807
|
+
loading: k,
|
|
720
808
|
disabled: !t,
|
|
721
|
-
onClick:
|
|
809
|
+
onClick: P,
|
|
722
810
|
children: "换一批"
|
|
723
811
|
}
|
|
724
812
|
) }) : null,
|
|
725
|
-
c ? /* @__PURE__ */ s(
|
|
813
|
+
c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
|
|
726
814
|
] });
|
|
727
815
|
}
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
),
|
|
816
|
+
const wn = V(
|
|
817
|
+
_n,
|
|
818
|
+
Vn
|
|
819
|
+
), qn = {
|
|
732
820
|
type: "resume_multiselect",
|
|
733
821
|
componentName: "SkoponResumeSelect",
|
|
734
|
-
toComponent:
|
|
735
|
-
fromComponent:
|
|
736
|
-
catalogComponents: [
|
|
737
|
-
},
|
|
738
|
-
|
|
739
|
-
),
|
|
740
|
-
|
|
822
|
+
toComponent: Mn,
|
|
823
|
+
fromComponent: Fn,
|
|
824
|
+
catalogComponents: [wn]
|
|
825
|
+
}, he = [qn, In], jn = new Map(
|
|
826
|
+
he.map((e) => [e.type, e])
|
|
827
|
+
), $n = new Map(
|
|
828
|
+
he.map((e) => [e.componentName, e])
|
|
741
829
|
);
|
|
742
|
-
function
|
|
743
|
-
return
|
|
830
|
+
function Ln(e) {
|
|
831
|
+
return jn.get(e);
|
|
744
832
|
}
|
|
745
|
-
function
|
|
746
|
-
return
|
|
833
|
+
function Dn(e) {
|
|
834
|
+
return $n.get(e);
|
|
747
835
|
}
|
|
748
|
-
function
|
|
749
|
-
return
|
|
836
|
+
function Kn() {
|
|
837
|
+
return he.flatMap((e) => e.catalogComponents);
|
|
750
838
|
}
|
|
751
|
-
function
|
|
752
|
-
return
|
|
839
|
+
function Jn() {
|
|
840
|
+
return he.map((e) => e.componentName);
|
|
753
841
|
}
|
|
754
|
-
const
|
|
755
|
-
function
|
|
842
|
+
const de = "root", Ue = "__title__", _e = "__desc__", dt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
843
|
+
function Hn(e) {
|
|
756
844
|
return `/${e}`;
|
|
757
845
|
}
|
|
758
|
-
function
|
|
846
|
+
function He(e) {
|
|
759
847
|
return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
|
|
760
848
|
}
|
|
761
|
-
function
|
|
849
|
+
function E(e) {
|
|
762
850
|
if (typeof e == "string") return e;
|
|
763
851
|
}
|
|
764
|
-
function
|
|
765
|
-
const t = e.id ||
|
|
852
|
+
function Yn(e) {
|
|
853
|
+
const t = e.id || re("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
766
854
|
return {
|
|
767
855
|
id: t,
|
|
768
856
|
component: "SkoponMedia",
|
|
769
857
|
mediaType: n,
|
|
770
|
-
urls:
|
|
771
|
-
mediaSize:
|
|
858
|
+
urls: cn(e),
|
|
859
|
+
mediaSize: ie(e.mediaSize),
|
|
772
860
|
label: e.label ?? "",
|
|
773
861
|
help: e.help ?? "",
|
|
774
862
|
placeholder: e.placeholder ?? ""
|
|
775
863
|
};
|
|
776
864
|
}
|
|
777
|
-
function
|
|
865
|
+
function Xn(e) {
|
|
778
866
|
if (Array.isArray(e.urls))
|
|
779
867
|
return e.urls.map((n) => String(n).trim()).filter(Boolean);
|
|
780
|
-
const t =
|
|
868
|
+
const t = E(e.url);
|
|
781
869
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
782
870
|
}
|
|
783
|
-
function
|
|
784
|
-
const r = typeof e.id == "string" ? e.id :
|
|
871
|
+
function se(e, t, n) {
|
|
872
|
+
const r = typeof e.id == "string" ? e.id : re("block-"), o = Xn(e), i = E(e.label) ?? E(e.description) ?? n, a = E(e.help), l = E(e.placeholder), c = ie(e.mediaSize);
|
|
785
873
|
return {
|
|
786
874
|
id: r,
|
|
787
875
|
type: t,
|
|
788
|
-
label:
|
|
789
|
-
...
|
|
876
|
+
label: i,
|
|
877
|
+
...a ? { help: a } : {},
|
|
790
878
|
...l ? { placeholder: l } : {},
|
|
791
879
|
mediaSize: c,
|
|
792
880
|
mediaUrls: o.length > 0 ? o : [""]
|
|
793
881
|
};
|
|
794
882
|
}
|
|
795
|
-
function
|
|
883
|
+
function Gn(e) {
|
|
796
884
|
switch (e.type) {
|
|
797
885
|
case "toggle":
|
|
798
|
-
return
|
|
886
|
+
return qe(e.defaultValue);
|
|
799
887
|
case "multiselect":
|
|
800
888
|
case "checkbox":
|
|
801
889
|
case "resume_multiselect":
|
|
@@ -809,9 +897,9 @@ function $n(e) {
|
|
|
809
897
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
810
898
|
}
|
|
811
899
|
}
|
|
812
|
-
function
|
|
900
|
+
function Wn(e) {
|
|
813
901
|
var u;
|
|
814
|
-
const t = e.id ||
|
|
902
|
+
const t = e.id || re("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Hn(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), a = (m) => r ? { node: m, dataKey: r, dataValue: Gn(e) } : { node: m }, l = { id: t, label: n, name: r, path: o, withData: a }, c = Ln(e.type);
|
|
815
903
|
if (c)
|
|
816
904
|
return c.toComponent(e, l);
|
|
817
905
|
switch (e.type) {
|
|
@@ -822,7 +910,7 @@ function Dn(e) {
|
|
|
822
910
|
case "text":
|
|
823
911
|
case "tel":
|
|
824
912
|
case "url":
|
|
825
|
-
return
|
|
913
|
+
return a({
|
|
826
914
|
id: t,
|
|
827
915
|
component: "TextField",
|
|
828
916
|
label: n,
|
|
@@ -831,17 +919,17 @@ function Dn(e) {
|
|
|
831
919
|
value: { path: o }
|
|
832
920
|
});
|
|
833
921
|
case "email":
|
|
834
|
-
return
|
|
922
|
+
return a({
|
|
835
923
|
id: t,
|
|
836
924
|
component: "TextField",
|
|
837
925
|
label: n,
|
|
838
926
|
variant: "shortText",
|
|
839
|
-
validationRegexp:
|
|
927
|
+
validationRegexp: dt,
|
|
840
928
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
841
929
|
value: { path: o }
|
|
842
930
|
});
|
|
843
931
|
case "textarea":
|
|
844
|
-
return
|
|
932
|
+
return a({
|
|
845
933
|
id: t,
|
|
846
934
|
component: "TextField",
|
|
847
935
|
label: n,
|
|
@@ -850,7 +938,7 @@ function Dn(e) {
|
|
|
850
938
|
value: { path: o }
|
|
851
939
|
});
|
|
852
940
|
case "number":
|
|
853
|
-
return
|
|
941
|
+
return a({
|
|
854
942
|
id: t,
|
|
855
943
|
component: "TextField",
|
|
856
944
|
label: n,
|
|
@@ -859,49 +947,49 @@ function Dn(e) {
|
|
|
859
947
|
value: { path: o }
|
|
860
948
|
});
|
|
861
949
|
case "select":
|
|
862
|
-
return
|
|
950
|
+
return a({
|
|
863
951
|
id: t,
|
|
864
952
|
component: "SkoponSelect",
|
|
865
953
|
label: n,
|
|
866
954
|
mode: "single",
|
|
867
955
|
placeholder: e.placeholder ?? "",
|
|
868
|
-
options:
|
|
956
|
+
options: i,
|
|
869
957
|
value: { path: o }
|
|
870
958
|
});
|
|
871
959
|
case "radio":
|
|
872
|
-
return
|
|
960
|
+
return a({
|
|
873
961
|
id: t,
|
|
874
962
|
component: "ChoicePicker",
|
|
875
963
|
label: n,
|
|
876
964
|
variant: "mutuallyExclusive",
|
|
877
965
|
skoponPickerType: "radio",
|
|
878
|
-
options:
|
|
966
|
+
options: i,
|
|
879
967
|
value: { path: o }
|
|
880
968
|
});
|
|
881
969
|
case "multiselect":
|
|
882
|
-
return
|
|
970
|
+
return a({
|
|
883
971
|
id: t,
|
|
884
972
|
component: "SkoponSelect",
|
|
885
973
|
label: n,
|
|
886
974
|
mode: "multiple",
|
|
887
975
|
placeholder: e.placeholder ?? "",
|
|
888
|
-
options:
|
|
976
|
+
options: i,
|
|
889
977
|
value: { path: o }
|
|
890
978
|
});
|
|
891
979
|
case "checkbox":
|
|
892
|
-
return
|
|
980
|
+
return a({
|
|
893
981
|
id: t,
|
|
894
982
|
component: "ChoicePicker",
|
|
895
983
|
label: n,
|
|
896
984
|
variant: "multipleSelection",
|
|
897
985
|
skoponPickerType: "checkbox",
|
|
898
|
-
options:
|
|
986
|
+
options: i,
|
|
899
987
|
value: { path: o }
|
|
900
988
|
});
|
|
901
989
|
case "toggle":
|
|
902
|
-
return
|
|
990
|
+
return a({ id: t, component: "CheckBox", label: n, value: { path: o } });
|
|
903
991
|
case "datetime":
|
|
904
|
-
return
|
|
992
|
+
return a({
|
|
905
993
|
id: t,
|
|
906
994
|
component: "DateTimeInput",
|
|
907
995
|
label: n,
|
|
@@ -911,7 +999,7 @@ function Dn(e) {
|
|
|
911
999
|
value: { path: o }
|
|
912
1000
|
});
|
|
913
1001
|
case "time":
|
|
914
|
-
return
|
|
1002
|
+
return a({
|
|
915
1003
|
id: t,
|
|
916
1004
|
component: "DateTimeInput",
|
|
917
1005
|
label: n,
|
|
@@ -922,9 +1010,9 @@ function Dn(e) {
|
|
|
922
1010
|
case "image":
|
|
923
1011
|
case "video":
|
|
924
1012
|
case "audio":
|
|
925
|
-
return { node:
|
|
1013
|
+
return { node: Yn(e) };
|
|
926
1014
|
case "file":
|
|
927
|
-
return
|
|
1015
|
+
return a({
|
|
928
1016
|
id: t,
|
|
929
1017
|
component: "FileUpload",
|
|
930
1018
|
label: n,
|
|
@@ -939,31 +1027,31 @@ function Dn(e) {
|
|
|
939
1027
|
return { node: null };
|
|
940
1028
|
}
|
|
941
1029
|
}
|
|
942
|
-
function
|
|
1030
|
+
function Ee(e) {
|
|
943
1031
|
if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
|
|
944
|
-
const t = e.components.find((r) => r.id ===
|
|
1032
|
+
const t = e.components.find((r) => r.id === de);
|
|
945
1033
|
if (!t) return e.components.length === 0;
|
|
946
1034
|
const n = t.children;
|
|
947
1035
|
return !Array.isArray(n) || n.length === 0;
|
|
948
1036
|
}
|
|
949
|
-
function
|
|
950
|
-
const n = [], r = [], o = {},
|
|
951
|
-
|
|
1037
|
+
function ft(e, t) {
|
|
1038
|
+
const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), l = (e.description ?? "").trim();
|
|
1039
|
+
i && a && (n.push({ id: Ue, component: "Text", text: a, variant: "h2" }), r.push(Ue)), i && l && (n.push({ id: _e, component: "Text", text: l, variant: "body" }), r.push(_e));
|
|
952
1040
|
for (const m of e.blocks ?? []) {
|
|
953
|
-
const { node: p, dataKey:
|
|
954
|
-
p && (n.push(p), r.push(p.id),
|
|
1041
|
+
const { node: p, dataKey: g, dataValue: v } = Wn(m);
|
|
1042
|
+
p && (n.push(p), r.push(p.id), g && (o[g] = v));
|
|
955
1043
|
}
|
|
956
|
-
n.unshift({ id:
|
|
957
|
-
const c = { root:
|
|
1044
|
+
n.unshift({ id: de, component: "Column", children: r });
|
|
1045
|
+
const c = { root: de, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
|
|
958
1046
|
return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
|
|
959
1047
|
}
|
|
960
|
-
function
|
|
1048
|
+
function Zn(e) {
|
|
961
1049
|
const t = /* @__PURE__ */ new Map();
|
|
962
1050
|
for (const n of e.components ?? [])
|
|
963
1051
|
n && typeof n.id == "string" && t.set(n.id, n);
|
|
964
1052
|
return t;
|
|
965
1053
|
}
|
|
966
|
-
function
|
|
1054
|
+
function Me(e) {
|
|
967
1055
|
const t = e.options;
|
|
968
1056
|
return Array.isArray(t) ? t.map((n) => {
|
|
969
1057
|
if (!n || typeof n != "object") return null;
|
|
@@ -974,10 +1062,10 @@ function Te(e) {
|
|
|
974
1062
|
};
|
|
975
1063
|
}).filter((n) => !!n) : [];
|
|
976
1064
|
}
|
|
977
|
-
function
|
|
978
|
-
const t = typeof e.id == "string" ? e.id :
|
|
979
|
-
if (
|
|
980
|
-
return
|
|
1065
|
+
function Qn(e) {
|
|
1066
|
+
const t = typeof e.id == "string" ? e.id : re("block-"), n = String(e.component ?? ""), r = E(e.label) ?? E(e.text) ?? "", o = He(e.value), i = (l) => ({ id: t, type: l, label: r }), a = Dn(n);
|
|
1067
|
+
if (a)
|
|
1068
|
+
return a.fromComponent(e, i, { asLiteral: E, nameFromValue: He });
|
|
981
1069
|
switch (n) {
|
|
982
1070
|
case "Text": {
|
|
983
1071
|
const l = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(l) || l === "title" || l === "subtitle";
|
|
@@ -986,104 +1074,104 @@ function Jn(e) {
|
|
|
986
1074
|
case "TextField": {
|
|
987
1075
|
const l = String(e.variant ?? "shortText");
|
|
988
1076
|
let c = "text";
|
|
989
|
-
l === "longText" ? c = "textarea" : l === "number" ? c = "number" :
|
|
990
|
-
const u = { ...
|
|
1077
|
+
l === "longText" ? c = "textarea" : l === "number" ? c = "number" : E(e.validationRegexp) === dt && (c = "email");
|
|
1078
|
+
const u = { ...i(c), name: o }, m = E(e.placeholder);
|
|
991
1079
|
return m && (u.placeholder = m), u;
|
|
992
1080
|
}
|
|
993
1081
|
case "CheckBox":
|
|
994
|
-
return { ...
|
|
1082
|
+
return { ...i("toggle"), name: o };
|
|
995
1083
|
case "SkoponSelect": {
|
|
996
1084
|
const c = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
|
|
997
|
-
...
|
|
1085
|
+
...i(c),
|
|
998
1086
|
name: o,
|
|
999
|
-
options:
|
|
1000
|
-
}, m =
|
|
1087
|
+
options: Me(e)
|
|
1088
|
+
}, m = E(e.placeholder);
|
|
1001
1089
|
return m && (u.placeholder = m), u;
|
|
1002
1090
|
}
|
|
1003
1091
|
case "ChoicePicker": {
|
|
1004
|
-
const l =
|
|
1092
|
+
const l = E(e.skoponPickerType);
|
|
1005
1093
|
if (l === "select" || l === "multiselect" || l === "radio" || l === "checkbox") {
|
|
1006
1094
|
const m = {
|
|
1007
|
-
...
|
|
1095
|
+
...i(l),
|
|
1008
1096
|
name: o,
|
|
1009
|
-
options:
|
|
1010
|
-
}, p =
|
|
1097
|
+
options: Me(e)
|
|
1098
|
+
}, p = E(e.placeholder);
|
|
1011
1099
|
return p && (m.placeholder = p), m;
|
|
1012
1100
|
}
|
|
1013
1101
|
const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1014
|
-
return { ...
|
|
1102
|
+
return { ...i(u), name: o, options: Me(e) };
|
|
1015
1103
|
}
|
|
1016
1104
|
case "DateTimeInput": {
|
|
1017
|
-
const l = e.enableDate === !0, c = e.enableTime === !0, m = { ...
|
|
1105
|
+
const l = e.enableDate === !0, c = e.enableTime === !0, m = { ...i(!l && c ? "time" : "datetime"), name: o }, p = E(e.placeholder);
|
|
1018
1106
|
return p && (m.placeholder = p), m;
|
|
1019
1107
|
}
|
|
1020
1108
|
case "SkoponMedia": {
|
|
1021
1109
|
const l = String(e.mediaType ?? "image");
|
|
1022
|
-
return
|
|
1110
|
+
return se(e, l === "video" ? "video" : l === "audio" ? "audio" : "image", r);
|
|
1023
1111
|
}
|
|
1024
1112
|
case "Image":
|
|
1025
|
-
return
|
|
1113
|
+
return se(e, "image", r);
|
|
1026
1114
|
case "Video":
|
|
1027
|
-
return
|
|
1115
|
+
return se(e, "video", r);
|
|
1028
1116
|
case "AudioPlayer":
|
|
1029
|
-
return
|
|
1117
|
+
return se(e, "audio", r);
|
|
1030
1118
|
case "FileUpload": {
|
|
1031
|
-
const l =
|
|
1119
|
+
const l = E(e.accept) ?? "", c = { ...i("file"), name: o };
|
|
1032
1120
|
return l && (c.fileAcceptExtensions = l.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (c.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (c.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (c.fileMinCount = e.minCount), typeof e.maxCount == "number" && (c.fileMaxCount = e.maxCount), c;
|
|
1033
1121
|
}
|
|
1034
1122
|
default:
|
|
1035
1123
|
return null;
|
|
1036
1124
|
}
|
|
1037
1125
|
}
|
|
1038
|
-
function
|
|
1126
|
+
function ht(e, t, n, r) {
|
|
1039
1127
|
if (n.has(e)) return;
|
|
1040
1128
|
n.add(e);
|
|
1041
1129
|
const o = t.get(e);
|
|
1042
1130
|
if (!o) return;
|
|
1043
|
-
const
|
|
1044
|
-
if ((
|
|
1045
|
-
for (const
|
|
1046
|
-
typeof
|
|
1131
|
+
const i = String(o.component ?? "");
|
|
1132
|
+
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
1133
|
+
for (const a of o.children)
|
|
1134
|
+
typeof a == "string" && ht(a, t, n, r);
|
|
1047
1135
|
return;
|
|
1048
1136
|
}
|
|
1049
1137
|
r.push(o);
|
|
1050
1138
|
}
|
|
1051
|
-
function
|
|
1139
|
+
function er(e, t) {
|
|
1052
1140
|
return t ? e.map((n) => {
|
|
1053
|
-
var
|
|
1054
|
-
const r = (
|
|
1141
|
+
var i;
|
|
1142
|
+
const r = (i = n.name) == null ? void 0 : i.trim();
|
|
1055
1143
|
if (!r || !(r in t)) return n;
|
|
1056
1144
|
const o = t[r];
|
|
1057
1145
|
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: o === !0 || o === "true" } : { ...n, defaultValue: o };
|
|
1058
1146
|
}) : e;
|
|
1059
1147
|
}
|
|
1060
|
-
function
|
|
1148
|
+
function tr(e) {
|
|
1061
1149
|
if (!e || !Array.isArray(e.components))
|
|
1062
|
-
return
|
|
1063
|
-
const t =
|
|
1064
|
-
|
|
1150
|
+
return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
1151
|
+
const t = Zn(e), n = [];
|
|
1152
|
+
ht(e.root ?? de, t, /* @__PURE__ */ new Set(), n);
|
|
1065
1153
|
let r = "", o = "";
|
|
1066
|
-
const
|
|
1067
|
-
for (const
|
|
1068
|
-
if (
|
|
1069
|
-
r =
|
|
1154
|
+
const i = [];
|
|
1155
|
+
for (const a of n) {
|
|
1156
|
+
if (a.id === Ue) {
|
|
1157
|
+
r = E(a.text) ?? r;
|
|
1070
1158
|
continue;
|
|
1071
1159
|
}
|
|
1072
|
-
if (
|
|
1073
|
-
o =
|
|
1160
|
+
if (a.id === _e) {
|
|
1161
|
+
o = E(a.text) ?? o;
|
|
1074
1162
|
continue;
|
|
1075
1163
|
}
|
|
1076
|
-
const l =
|
|
1077
|
-
l &&
|
|
1164
|
+
const l = Qn(a);
|
|
1165
|
+
l && i.push(l);
|
|
1078
1166
|
}
|
|
1079
|
-
return
|
|
1167
|
+
return pe({
|
|
1080
1168
|
title: r,
|
|
1081
1169
|
description: o,
|
|
1082
|
-
blocks:
|
|
1170
|
+
blocks: er(i, e.dataModel),
|
|
1083
1171
|
jsonSchema: {}
|
|
1084
1172
|
});
|
|
1085
1173
|
}
|
|
1086
|
-
function
|
|
1174
|
+
function nr(e, t) {
|
|
1087
1175
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1088
1176
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1089
1177
|
{
|
|
@@ -1096,24 +1184,24 @@ function Xn(e, t) {
|
|
|
1096
1184
|
updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
|
|
1097
1185
|
}), o;
|
|
1098
1186
|
}
|
|
1099
|
-
function
|
|
1187
|
+
function gt(e) {
|
|
1100
1188
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1101
1189
|
}
|
|
1102
|
-
function
|
|
1190
|
+
function rr(e, t) {
|
|
1103
1191
|
if (!e || typeof e != "object") return null;
|
|
1104
|
-
const n = e, r =
|
|
1105
|
-
if (r && !
|
|
1192
|
+
const n = e, r = gt(n.a2ui) ? n.a2ui : void 0;
|
|
1193
|
+
if (r && !Ee(r)) return r;
|
|
1106
1194
|
const o = Array.isArray(n.blocks) ? n.blocks : [];
|
|
1107
1195
|
if (o.length === 0) return null;
|
|
1108
|
-
const
|
|
1196
|
+
const i = W({
|
|
1109
1197
|
title: typeof n.title == "string" ? n.title : "",
|
|
1110
1198
|
description: typeof n.description == "string" ? n.description : "",
|
|
1111
1199
|
blocks: o
|
|
1112
|
-
}),
|
|
1113
|
-
return
|
|
1200
|
+
}), a = ft(i, t);
|
|
1201
|
+
return Ee(a) ? null : a;
|
|
1114
1202
|
}
|
|
1115
|
-
function
|
|
1116
|
-
return
|
|
1203
|
+
function or(e, t, n) {
|
|
1204
|
+
return ft(
|
|
1117
1205
|
{
|
|
1118
1206
|
title: e.title,
|
|
1119
1207
|
description: e.description,
|
|
@@ -1122,88 +1210,88 @@ function Wn(e, t, n) {
|
|
|
1122
1210
|
n
|
|
1123
1211
|
);
|
|
1124
1212
|
}
|
|
1125
|
-
function
|
|
1213
|
+
function ir(e) {
|
|
1126
1214
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1127
1215
|
return;
|
|
1128
1216
|
const t = e;
|
|
1129
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) &&
|
|
1217
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && gt(t.a2ui) ? tr(t.a2ui) : W({
|
|
1130
1218
|
title: typeof t.title == "string" ? t.title : "",
|
|
1131
1219
|
description: typeof t.description == "string" ? t.description : "",
|
|
1132
1220
|
blocks: Array.isArray(t.blocks) ? t.blocks : []
|
|
1133
1221
|
});
|
|
1134
1222
|
}
|
|
1135
|
-
function
|
|
1223
|
+
function ar(e, t, n) {
|
|
1136
1224
|
const r = e.model.surfacesMap.get(t);
|
|
1137
1225
|
if (!r) return {};
|
|
1138
1226
|
const o = {};
|
|
1139
|
-
for (const
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1227
|
+
for (const i of n) {
|
|
1228
|
+
const a = i.trim();
|
|
1229
|
+
a && (o[a] = r.dataModel.get(`/${a}`));
|
|
1142
1230
|
}
|
|
1143
1231
|
return o;
|
|
1144
1232
|
}
|
|
1145
|
-
function
|
|
1146
|
-
return
|
|
1233
|
+
function lr(e) {
|
|
1234
|
+
return W({
|
|
1147
1235
|
title: "",
|
|
1148
1236
|
description: "",
|
|
1149
1237
|
blocks: [e]
|
|
1150
1238
|
}).blocks[0];
|
|
1151
1239
|
}
|
|
1152
|
-
function
|
|
1153
|
-
var o,
|
|
1240
|
+
function sr(e, t) {
|
|
1241
|
+
var o, i;
|
|
1154
1242
|
const n = /* @__PURE__ */ new Map();
|
|
1155
|
-
for (const
|
|
1156
|
-
const l = (o =
|
|
1157
|
-
l && n.set(l,
|
|
1243
|
+
for (const a of t) {
|
|
1244
|
+
const l = (o = a.name) == null ? void 0 : o.trim();
|
|
1245
|
+
l && n.set(l, a);
|
|
1158
1246
|
}
|
|
1159
1247
|
const r = [];
|
|
1160
|
-
for (const
|
|
1161
|
-
if (
|
|
1162
|
-
r.push(
|
|
1248
|
+
for (const a of e.blocks) {
|
|
1249
|
+
if (Be(a.type)) {
|
|
1250
|
+
r.push(lr(a));
|
|
1163
1251
|
continue;
|
|
1164
1252
|
}
|
|
1165
|
-
if (!
|
|
1166
|
-
const l = (
|
|
1253
|
+
if (!X(a.type)) continue;
|
|
1254
|
+
const l = (i = a.name) == null ? void 0 : i.trim();
|
|
1167
1255
|
if (!l) continue;
|
|
1168
1256
|
const c = n.get(l);
|
|
1169
1257
|
c && r.push(c);
|
|
1170
1258
|
}
|
|
1171
1259
|
return r;
|
|
1172
1260
|
}
|
|
1173
|
-
function
|
|
1261
|
+
function cr(e, t) {
|
|
1174
1262
|
var r;
|
|
1175
1263
|
const n = {
|
|
1176
1264
|
...e,
|
|
1177
1265
|
name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
|
|
1178
1266
|
};
|
|
1179
|
-
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue),
|
|
1267
|
+
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), W({
|
|
1180
1268
|
title: "",
|
|
1181
1269
|
description: "",
|
|
1182
1270
|
blocks: [n]
|
|
1183
1271
|
}).blocks[0];
|
|
1184
1272
|
}
|
|
1185
|
-
function
|
|
1273
|
+
function yt(e) {
|
|
1186
1274
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1187
1275
|
const t = e;
|
|
1188
|
-
return Array.isArray(t.blocks) ?
|
|
1276
|
+
return Array.isArray(t.blocks) ? W({
|
|
1189
1277
|
title: typeof t.title == "string" ? t.title : "",
|
|
1190
1278
|
description: typeof t.description == "string" ? t.description : "",
|
|
1191
1279
|
blocks: t.blocks
|
|
1192
1280
|
}) : null;
|
|
1193
1281
|
}
|
|
1194
|
-
function
|
|
1195
|
-
var
|
|
1282
|
+
function ur(e, t) {
|
|
1283
|
+
var i, a, l, c, u, m;
|
|
1196
1284
|
const n = /* @__PURE__ */ new Map();
|
|
1197
1285
|
for (const p of (t == null ? void 0 : t.blocks) ?? [])
|
|
1198
|
-
|
|
1286
|
+
X(p.type) && ((i = p.name) != null && i.trim()) && n.set(p.name.trim(), p);
|
|
1199
1287
|
const r = [], o = [];
|
|
1200
1288
|
for (const p of e.blocks) {
|
|
1201
|
-
if (!
|
|
1202
|
-
const
|
|
1203
|
-
if (!
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1206
|
-
|
|
1289
|
+
if (!X(p.type)) continue;
|
|
1290
|
+
const g = (a = p.name) == null ? void 0 : a.trim();
|
|
1291
|
+
if (!g) continue;
|
|
1292
|
+
const v = n.get(g);
|
|
1293
|
+
v ? r.push(cr(v, p)) : o.push(
|
|
1294
|
+
W({
|
|
1207
1295
|
title: "",
|
|
1208
1296
|
description: "",
|
|
1209
1297
|
blocks: [p]
|
|
@@ -1213,84 +1301,84 @@ function rr(e, t) {
|
|
|
1213
1301
|
return {
|
|
1214
1302
|
matchedBlocks: r,
|
|
1215
1303
|
extraBlocks: o,
|
|
1216
|
-
renderBlocks:
|
|
1304
|
+
renderBlocks: sr(e, r),
|
|
1217
1305
|
title: ((l = e.title) == null ? void 0 : l.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
|
|
1218
1306
|
description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1219
1307
|
};
|
|
1220
1308
|
}
|
|
1221
|
-
function
|
|
1309
|
+
function pr(e) {
|
|
1222
1310
|
const { type: t, defaultValue: n } = e;
|
|
1223
1311
|
return n !== void 0 ? t === "toggle" ? n === !0 || n === "true" : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? Array.isArray(n) ? n.map(String) : typeof n == "string" && n ? [n] : [] : n : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? [] : t === "number" ? null : "";
|
|
1224
1312
|
}
|
|
1225
|
-
function
|
|
1313
|
+
function vt(e) {
|
|
1226
1314
|
var n;
|
|
1227
1315
|
const t = {};
|
|
1228
1316
|
for (const r of e) {
|
|
1229
|
-
if (!
|
|
1317
|
+
if (!X(r.type)) continue;
|
|
1230
1318
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1231
|
-
o && (t[o] =
|
|
1319
|
+
o && (t[o] = pr(r));
|
|
1232
1320
|
}
|
|
1233
1321
|
return t;
|
|
1234
1322
|
}
|
|
1235
|
-
function
|
|
1323
|
+
function mr(e) {
|
|
1236
1324
|
return e.blocks.some(
|
|
1237
1325
|
(t) => {
|
|
1238
1326
|
var n;
|
|
1239
|
-
return
|
|
1327
|
+
return X(t.type) && !!((n = t.name) != null && n.trim());
|
|
1240
1328
|
}
|
|
1241
1329
|
);
|
|
1242
1330
|
}
|
|
1243
|
-
function
|
|
1331
|
+
function dr(e) {
|
|
1244
1332
|
return e.blocks.filter((t) => {
|
|
1245
1333
|
var n;
|
|
1246
|
-
return
|
|
1334
|
+
return Be(t.type) ? !0 : X(t.type) && !!((n = t.name) != null && n.trim());
|
|
1247
1335
|
});
|
|
1248
1336
|
}
|
|
1249
|
-
function
|
|
1337
|
+
function fr(e) {
|
|
1250
1338
|
return e.blocks.filter((t) => {
|
|
1251
1339
|
var n;
|
|
1252
|
-
return
|
|
1340
|
+
return X(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1253
1341
|
}).map((t) => t.name.trim());
|
|
1254
1342
|
}
|
|
1255
|
-
function
|
|
1343
|
+
function bt(e) {
|
|
1256
1344
|
return e.replace(/'/g, "'\\''");
|
|
1257
1345
|
}
|
|
1258
|
-
function
|
|
1346
|
+
function St(e, t) {
|
|
1259
1347
|
const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
|
|
1260
1348
|
return [
|
|
1261
1349
|
`curl -X POST '${n}' \\`,
|
|
1262
1350
|
" -H 'Content-Type: application/json' \\",
|
|
1263
|
-
` -d '${
|
|
1351
|
+
` -d '${bt(r)}'`
|
|
1264
1352
|
].join(`
|
|
1265
1353
|
`);
|
|
1266
1354
|
}
|
|
1267
|
-
function
|
|
1355
|
+
function hr(e, t) {
|
|
1268
1356
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1269
1357
|
}
|
|
1270
|
-
function
|
|
1358
|
+
function xt({
|
|
1271
1359
|
cardValues: e,
|
|
1272
1360
|
extraValues: t = {},
|
|
1273
1361
|
callbackUrl: n
|
|
1274
1362
|
}) {
|
|
1275
|
-
const r = (n ?? "").trim() || "<callback_url>", o =
|
|
1363
|
+
const r = (n ?? "").trim() || "<callback_url>", o = hr(e, t);
|
|
1276
1364
|
return [
|
|
1277
1365
|
`curl -X POST '${r}' \\`,
|
|
1278
1366
|
" -H 'Content-Type: application/json' \\",
|
|
1279
|
-
` -d '${
|
|
1367
|
+
` -d '${bt(o)}'`
|
|
1280
1368
|
].join(`
|
|
1281
1369
|
`);
|
|
1282
1370
|
}
|
|
1283
|
-
function
|
|
1284
|
-
const n =
|
|
1285
|
-
if (!n) return
|
|
1286
|
-
const r =
|
|
1287
|
-
return
|
|
1371
|
+
function gr(e, t) {
|
|
1372
|
+
const n = yt(e);
|
|
1373
|
+
if (!n) return St(e, t);
|
|
1374
|
+
const r = vt(n.blocks);
|
|
1375
|
+
return xt({ cardValues: r, callbackUrl: t });
|
|
1288
1376
|
}
|
|
1289
|
-
async function
|
|
1377
|
+
async function yr(e, t, n) {
|
|
1290
1378
|
const r = e.trim();
|
|
1291
1379
|
if (!r)
|
|
1292
1380
|
throw new Error("callback_url 为空");
|
|
1293
|
-
const
|
|
1381
|
+
const i = await ((n == null ? void 0 : n.fetch) ?? fetch)(r, {
|
|
1294
1382
|
method: "POST",
|
|
1295
1383
|
headers: {
|
|
1296
1384
|
"Content-Type": "application/json",
|
|
@@ -1298,22 +1386,22 @@ async function ur(e, t, n) {
|
|
|
1298
1386
|
},
|
|
1299
1387
|
body: JSON.stringify(t ?? {})
|
|
1300
1388
|
});
|
|
1301
|
-
let
|
|
1302
|
-
if ((
|
|
1389
|
+
let a;
|
|
1390
|
+
if ((i.headers.get("content-type") ?? "").includes("application/json"))
|
|
1303
1391
|
try {
|
|
1304
|
-
|
|
1392
|
+
a = await i.json();
|
|
1305
1393
|
} catch {
|
|
1306
|
-
|
|
1394
|
+
a = void 0;
|
|
1307
1395
|
}
|
|
1308
1396
|
else
|
|
1309
1397
|
try {
|
|
1310
|
-
|
|
1398
|
+
a = await i.text();
|
|
1311
1399
|
} catch {
|
|
1312
|
-
|
|
1400
|
+
a = void 0;
|
|
1313
1401
|
}
|
|
1314
|
-
return { ok:
|
|
1402
|
+
return { ok: i.ok, status: i.status, body: a };
|
|
1315
1403
|
}
|
|
1316
|
-
async function
|
|
1404
|
+
async function Ct(e) {
|
|
1317
1405
|
var n;
|
|
1318
1406
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1319
1407
|
await navigator.clipboard.writeText(e);
|
|
@@ -1329,7 +1417,7 @@ async function ht(e) {
|
|
|
1329
1417
|
document.body.removeChild(t);
|
|
1330
1418
|
}
|
|
1331
1419
|
}
|
|
1332
|
-
async function
|
|
1420
|
+
async function vr(e) {
|
|
1333
1421
|
let t;
|
|
1334
1422
|
try {
|
|
1335
1423
|
t = await e.json();
|
|
@@ -1342,45 +1430,45 @@ async function pr(e) {
|
|
|
1342
1430
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1343
1431
|
return t.data;
|
|
1344
1432
|
}
|
|
1345
|
-
function
|
|
1433
|
+
function io(e = {}) {
|
|
1346
1434
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1347
|
-
async function o(
|
|
1435
|
+
async function o(i) {
|
|
1348
1436
|
var p;
|
|
1349
|
-
const
|
|
1350
|
-
if (
|
|
1351
|
-
|
|
1352
|
-
else if (
|
|
1353
|
-
|
|
1437
|
+
const a = new URLSearchParams();
|
|
1438
|
+
if (i.formId !== void 0)
|
|
1439
|
+
a.set("form_id", String(i.formId));
|
|
1440
|
+
else if (i.formUniqueId)
|
|
1441
|
+
a.set("form_unique_id", i.formUniqueId);
|
|
1354
1442
|
else
|
|
1355
1443
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
1356
|
-
const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${
|
|
1444
|
+
const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${a.toString()}`, {
|
|
1357
1445
|
method: "GET",
|
|
1358
1446
|
headers: l
|
|
1359
|
-
}), u = await
|
|
1447
|
+
}), u = await vr(c), m = ir(u.form_definition);
|
|
1360
1448
|
return {
|
|
1361
1449
|
formUniqueId: u.form_unique_id,
|
|
1362
1450
|
formId: u.form_id,
|
|
1363
1451
|
disabled: u.disabled === 1,
|
|
1364
1452
|
formDefinition: m,
|
|
1365
|
-
a2ui:
|
|
1453
|
+
a2ui: rr(u.form_definition) ?? void 0
|
|
1366
1454
|
};
|
|
1367
1455
|
}
|
|
1368
1456
|
return { fetchDetail: o };
|
|
1369
1457
|
}
|
|
1370
|
-
const
|
|
1371
|
-
video:
|
|
1372
|
-
audio:
|
|
1373
|
-
image:
|
|
1374
|
-
file:
|
|
1375
|
-
spreadsheet:
|
|
1376
|
-
document:
|
|
1458
|
+
const br = {
|
|
1459
|
+
video: jt,
|
|
1460
|
+
audio: qt,
|
|
1461
|
+
image: wt,
|
|
1462
|
+
file: We,
|
|
1463
|
+
spreadsheet: Vt,
|
|
1464
|
+
document: Ge
|
|
1377
1465
|
};
|
|
1378
|
-
function
|
|
1466
|
+
function Sr({
|
|
1379
1467
|
type: e,
|
|
1380
1468
|
size: t = 40,
|
|
1381
1469
|
className: n
|
|
1382
1470
|
}) {
|
|
1383
|
-
const r =
|
|
1471
|
+
const r = br[e] ?? We;
|
|
1384
1472
|
return /* @__PURE__ */ s(
|
|
1385
1473
|
r,
|
|
1386
1474
|
{
|
|
@@ -1390,7 +1478,7 @@ function dr({
|
|
|
1390
1478
|
}
|
|
1391
1479
|
);
|
|
1392
1480
|
}
|
|
1393
|
-
const
|
|
1481
|
+
const kt = "skopon-form-v0_9", xr = /* @__PURE__ */ new Set([
|
|
1394
1482
|
"SkoponMedia",
|
|
1395
1483
|
"SkoponSelect",
|
|
1396
1484
|
"Image",
|
|
@@ -1402,39 +1490,39 @@ const gt = "skopon-form-v0_9", fr = /* @__PURE__ */ new Set([
|
|
|
1402
1490
|
"FileUpload",
|
|
1403
1491
|
"TextField",
|
|
1404
1492
|
"Text",
|
|
1405
|
-
...
|
|
1406
|
-
]),
|
|
1407
|
-
function
|
|
1408
|
-
const t = [...
|
|
1493
|
+
...Jn()
|
|
1494
|
+
]), Cr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
1495
|
+
function ae(e) {
|
|
1496
|
+
const t = [...ue.components.values()].find((n) => n.name === e);
|
|
1409
1497
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
1410
1498
|
return t.schema;
|
|
1411
1499
|
}
|
|
1412
|
-
function
|
|
1500
|
+
function A(e) {
|
|
1413
1501
|
return typeof e == "string" ? e : "";
|
|
1414
1502
|
}
|
|
1415
|
-
function
|
|
1503
|
+
function At(e) {
|
|
1416
1504
|
return Array.isArray(e) ? e.map((t) => {
|
|
1417
1505
|
if (!t || typeof t != "object") return null;
|
|
1418
1506
|
const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
|
|
1419
1507
|
return { value: r, label: o };
|
|
1420
1508
|
}).filter((t) => !!t) : [];
|
|
1421
1509
|
}
|
|
1422
|
-
function
|
|
1510
|
+
function ge({
|
|
1423
1511
|
mediaType: e,
|
|
1424
1512
|
urls: t,
|
|
1425
1513
|
mediaSize: n,
|
|
1426
1514
|
label: r,
|
|
1427
1515
|
help: o,
|
|
1428
|
-
placeholder:
|
|
1516
|
+
placeholder: i
|
|
1429
1517
|
}) {
|
|
1430
|
-
const
|
|
1431
|
-
return /* @__PURE__ */
|
|
1432
|
-
|
|
1518
|
+
const a = r == null ? void 0 : r.trim(), l = o == null ? void 0 : o.trim(), c = pn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
1519
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1520
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
1433
1521
|
t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((m, p) => e === "image" ? /* @__PURE__ */ s(
|
|
1434
1522
|
"img",
|
|
1435
1523
|
{
|
|
1436
1524
|
src: m,
|
|
1437
|
-
alt:
|
|
1525
|
+
alt: a || "图片",
|
|
1438
1526
|
className: "form-media-item"
|
|
1439
1527
|
},
|
|
1440
1528
|
`media-${p}`
|
|
@@ -1455,21 +1543,21 @@ function me({
|
|
|
1455
1543
|
},
|
|
1456
1544
|
`media-${p}`
|
|
1457
1545
|
)) }),
|
|
1458
|
-
l ? /* @__PURE__ */ s(
|
|
1546
|
+
l ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
|
|
1459
1547
|
] });
|
|
1460
1548
|
}
|
|
1461
|
-
function
|
|
1462
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
1549
|
+
function ye(e, t) {
|
|
1550
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : A(e.url).trim() ? [A(e.url).trim()] : [];
|
|
1463
1551
|
return {
|
|
1464
1552
|
mediaType: t,
|
|
1465
1553
|
urls: n,
|
|
1466
|
-
mediaSize:
|
|
1467
|
-
label:
|
|
1468
|
-
help:
|
|
1469
|
-
placeholder:
|
|
1554
|
+
mediaSize: ie(e.mediaSize),
|
|
1555
|
+
label: A(e.label) || A(e.description),
|
|
1556
|
+
help: A(e.help),
|
|
1557
|
+
placeholder: A(e.placeholder)
|
|
1470
1558
|
};
|
|
1471
1559
|
}
|
|
1472
|
-
const
|
|
1560
|
+
const kr = {
|
|
1473
1561
|
name: "SkoponMedia",
|
|
1474
1562
|
schema: d.object({
|
|
1475
1563
|
mediaType: d.any().optional(),
|
|
@@ -1479,19 +1567,19 @@ const gr = {
|
|
|
1479
1567
|
help: d.any().optional(),
|
|
1480
1568
|
placeholder: d.any().optional()
|
|
1481
1569
|
}).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
|
-
),
|
|
1570
|
+
}, Ar = V(kr, ({ context: e }) => {
|
|
1571
|
+
const t = e.componentModel.properties, n = A(t.mediaType);
|
|
1572
|
+
return /* @__PURE__ */ s(ge, { ...ye(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
1573
|
+
}), Tr = V(
|
|
1574
|
+
{ name: "Image", schema: ae("Image") },
|
|
1575
|
+
({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "image") })
|
|
1576
|
+
), Nr = V(
|
|
1577
|
+
{ name: "Video", schema: ae("Video") },
|
|
1578
|
+
({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "video") })
|
|
1579
|
+
), Ir = V(
|
|
1580
|
+
{ name: "AudioPlayer", schema: ae("AudioPlayer") },
|
|
1581
|
+
({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "audio") })
|
|
1582
|
+
), Mr = {
|
|
1495
1583
|
name: "SkoponSelect",
|
|
1496
1584
|
schema: d.object({
|
|
1497
1585
|
label: d.any().optional(),
|
|
@@ -1501,36 +1589,36 @@ const gr = {
|
|
|
1501
1589
|
value: d.any().optional()
|
|
1502
1590
|
}).passthrough()
|
|
1503
1591
|
};
|
|
1504
|
-
function
|
|
1505
|
-
const { interactive: t } =
|
|
1506
|
-
return /* @__PURE__ */
|
|
1507
|
-
|
|
1592
|
+
function Fr({ context: e }) {
|
|
1593
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = At(o.options), c = A(o.mode) === "multiple";
|
|
1594
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1595
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1508
1596
|
/* @__PURE__ */ s(
|
|
1509
|
-
|
|
1597
|
+
Fe,
|
|
1510
1598
|
{
|
|
1511
1599
|
mode: c ? "multiple" : void 0,
|
|
1512
1600
|
disabled: !t,
|
|
1513
1601
|
allowClear: !0,
|
|
1514
1602
|
className: "form-block-preview-control",
|
|
1515
1603
|
style: { width: "100%" },
|
|
1516
|
-
placeholder:
|
|
1604
|
+
placeholder: a || (c ? "请选择多项" : "请选择"),
|
|
1517
1605
|
options: l,
|
|
1518
|
-
value: c ?
|
|
1606
|
+
value: c ? L(n) : ne(n),
|
|
1519
1607
|
onChange: (u) => r(c ? u ?? [] : u ?? "")
|
|
1520
1608
|
}
|
|
1521
1609
|
)
|
|
1522
1610
|
] });
|
|
1523
1611
|
}
|
|
1524
|
-
const
|
|
1525
|
-
|
|
1526
|
-
|
|
1612
|
+
const Pr = V(
|
|
1613
|
+
Mr,
|
|
1614
|
+
Fr
|
|
1527
1615
|
);
|
|
1528
|
-
function
|
|
1529
|
-
const { interactive: t } =
|
|
1530
|
-
return /* @__PURE__ */
|
|
1531
|
-
|
|
1616
|
+
function Ur({ context: e }) {
|
|
1617
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.variant) || "mutuallyExclusive", l = A(o.skoponPickerType), c = A(o.placeholder), u = At(o.options), p = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : a === "multipleSelection" ? "checkbox" : "radio";
|
|
1618
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1619
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1532
1620
|
p === "select" ? /* @__PURE__ */ s(
|
|
1533
|
-
|
|
1621
|
+
Fe,
|
|
1534
1622
|
{
|
|
1535
1623
|
disabled: !t,
|
|
1536
1624
|
allowClear: !0,
|
|
@@ -1538,11 +1626,11 @@ function Tr({ context: e }) {
|
|
|
1538
1626
|
style: { width: "100%" },
|
|
1539
1627
|
placeholder: c || "请选择",
|
|
1540
1628
|
options: u,
|
|
1541
|
-
value:
|
|
1542
|
-
onChange: (
|
|
1629
|
+
value: ne(n),
|
|
1630
|
+
onChange: (g) => r(g ?? "")
|
|
1543
1631
|
}
|
|
1544
1632
|
) : p === "multiselect" ? /* @__PURE__ */ s(
|
|
1545
|
-
|
|
1633
|
+
Fe,
|
|
1546
1634
|
{
|
|
1547
1635
|
mode: "multiple",
|
|
1548
1636
|
disabled: !t,
|
|
@@ -1551,31 +1639,31 @@ function Tr({ context: e }) {
|
|
|
1551
1639
|
style: { width: "100%" },
|
|
1552
1640
|
placeholder: c || "请选择多项",
|
|
1553
1641
|
options: u,
|
|
1554
|
-
value:
|
|
1555
|
-
onChange: (
|
|
1642
|
+
value: L(n),
|
|
1643
|
+
onChange: (g) => r(g ?? [])
|
|
1556
1644
|
}
|
|
1557
1645
|
) : p === "checkbox" ? /* @__PURE__ */ s(
|
|
1558
|
-
|
|
1646
|
+
Pt.Group,
|
|
1559
1647
|
{
|
|
1560
1648
|
disabled: !t,
|
|
1561
1649
|
className: "form-block-preview-control",
|
|
1562
1650
|
options: u,
|
|
1563
|
-
value:
|
|
1564
|
-
onChange: (
|
|
1651
|
+
value: L(n),
|
|
1652
|
+
onChange: (g) => r(g)
|
|
1565
1653
|
}
|
|
1566
1654
|
) : /* @__PURE__ */ s(
|
|
1567
|
-
|
|
1655
|
+
Ut.Group,
|
|
1568
1656
|
{
|
|
1569
1657
|
disabled: !t,
|
|
1570
1658
|
className: "form-block-preview-control",
|
|
1571
1659
|
options: u,
|
|
1572
|
-
value:
|
|
1573
|
-
onChange: (
|
|
1660
|
+
value: ne(n),
|
|
1661
|
+
onChange: (g) => r(g.target.value)
|
|
1574
1662
|
}
|
|
1575
1663
|
)
|
|
1576
1664
|
] });
|
|
1577
1665
|
}
|
|
1578
|
-
const
|
|
1666
|
+
const _r = V(
|
|
1579
1667
|
{
|
|
1580
1668
|
name: "ChoicePicker",
|
|
1581
1669
|
schema: d.object({
|
|
@@ -1587,39 +1675,39 @@ const Cr = R(
|
|
|
1587
1675
|
placeholder: d.any().optional()
|
|
1588
1676
|
}).passthrough()
|
|
1589
1677
|
},
|
|
1590
|
-
|
|
1678
|
+
Ur
|
|
1591
1679
|
);
|
|
1592
|
-
function
|
|
1593
|
-
const { interactive: t } =
|
|
1594
|
-
return /* @__PURE__ */
|
|
1595
|
-
|
|
1680
|
+
function Er({ context: e }) {
|
|
1681
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label);
|
|
1682
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1683
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1596
1684
|
/* @__PURE__ */ s(
|
|
1597
|
-
|
|
1685
|
+
_t,
|
|
1598
1686
|
{
|
|
1599
1687
|
disabled: !t,
|
|
1600
1688
|
className: "form-block-preview-control",
|
|
1601
|
-
checked:
|
|
1602
|
-
onChange: (
|
|
1689
|
+
checked: qe(n),
|
|
1690
|
+
onChange: (a) => r(a)
|
|
1603
1691
|
}
|
|
1604
1692
|
)
|
|
1605
1693
|
] });
|
|
1606
1694
|
}
|
|
1607
|
-
const
|
|
1608
|
-
{ name: "CheckBox", schema:
|
|
1609
|
-
|
|
1695
|
+
const zr = V(
|
|
1696
|
+
{ name: "CheckBox", schema: ae("CheckBox") },
|
|
1697
|
+
Er
|
|
1610
1698
|
);
|
|
1611
|
-
function
|
|
1612
|
-
const r =
|
|
1699
|
+
function Rr(e, t, n) {
|
|
1700
|
+
const r = ne(e);
|
|
1613
1701
|
if (!r) return;
|
|
1614
1702
|
if (!t && n) {
|
|
1615
|
-
const
|
|
1616
|
-
return
|
|
1703
|
+
const i = $e(r, "HH:mm", !0);
|
|
1704
|
+
return i.isValid() ? i : void 0;
|
|
1617
1705
|
}
|
|
1618
|
-
const o =
|
|
1706
|
+
const o = $e(r);
|
|
1619
1707
|
return o.isValid() ? o : void 0;
|
|
1620
1708
|
}
|
|
1621
|
-
function
|
|
1622
|
-
const { interactive: t } =
|
|
1709
|
+
function Or({ context: e }) {
|
|
1710
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = Rr(n, l, c), m = (p) => {
|
|
1623
1711
|
if (!p) {
|
|
1624
1712
|
r("");
|
|
1625
1713
|
return;
|
|
@@ -1634,33 +1722,33 @@ function Mr({ context: e }) {
|
|
|
1634
1722
|
}
|
|
1635
1723
|
r(p.format("YYYY-MM-DD"));
|
|
1636
1724
|
};
|
|
1637
|
-
return /* @__PURE__ */
|
|
1638
|
-
|
|
1725
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1726
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1639
1727
|
!l && c ? /* @__PURE__ */ s(
|
|
1640
|
-
|
|
1728
|
+
Et,
|
|
1641
1729
|
{
|
|
1642
1730
|
disabled: !t,
|
|
1643
1731
|
className: "form-block-preview-control",
|
|
1644
1732
|
style: { width: "100%" },
|
|
1645
|
-
placeholder:
|
|
1733
|
+
placeholder: a || "选择时间",
|
|
1646
1734
|
value: u,
|
|
1647
1735
|
onChange: m
|
|
1648
1736
|
}
|
|
1649
1737
|
) : /* @__PURE__ */ s(
|
|
1650
|
-
|
|
1738
|
+
zt,
|
|
1651
1739
|
{
|
|
1652
1740
|
showTime: l && c,
|
|
1653
1741
|
disabled: !t,
|
|
1654
1742
|
className: "form-block-preview-control",
|
|
1655
1743
|
style: { width: "100%" },
|
|
1656
|
-
placeholder:
|
|
1744
|
+
placeholder: a || (l && c ? "选择日期时间" : "选择日期"),
|
|
1657
1745
|
value: u,
|
|
1658
1746
|
onChange: m
|
|
1659
1747
|
}
|
|
1660
1748
|
)
|
|
1661
1749
|
] });
|
|
1662
1750
|
}
|
|
1663
|
-
const
|
|
1751
|
+
const Br = V(
|
|
1664
1752
|
{
|
|
1665
1753
|
name: "DateTimeInput",
|
|
1666
1754
|
schema: d.object({
|
|
@@ -1673,8 +1761,8 @@ const Pr = R(
|
|
|
1673
1761
|
max: d.any().optional()
|
|
1674
1762
|
}).passthrough()
|
|
1675
1763
|
},
|
|
1676
|
-
|
|
1677
|
-
),
|
|
1764
|
+
Or
|
|
1765
|
+
), Vr = {
|
|
1678
1766
|
name: "FileUpload",
|
|
1679
1767
|
schema: d.object({
|
|
1680
1768
|
label: d.any().optional(),
|
|
@@ -1686,108 +1774,108 @@ const Pr = R(
|
|
|
1686
1774
|
value: d.any().optional()
|
|
1687
1775
|
}).passthrough()
|
|
1688
1776
|
};
|
|
1689
|
-
function
|
|
1690
|
-
const { interactive: t } =
|
|
1777
|
+
function wr({ context: e }) {
|
|
1778
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.accept), l = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = rn(l, c), m = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
1691
1779
|
o.filePlaceholderIcon
|
|
1692
|
-
) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0,
|
|
1693
|
-
return /* @__PURE__ */
|
|
1694
|
-
|
|
1695
|
-
/* @__PURE__ */
|
|
1696
|
-
|
|
1780
|
+
) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, g = typeof o.maxCount == "number" ? o.maxCount : 1, v = g > 0, I = L(n), T = v && I.length >= g, k = I.length < p;
|
|
1781
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1782
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1783
|
+
/* @__PURE__ */ C(
|
|
1784
|
+
Se.Dragger,
|
|
1697
1785
|
{
|
|
1698
|
-
disabled: !t ||
|
|
1699
|
-
accept:
|
|
1786
|
+
disabled: !t || T,
|
|
1787
|
+
accept: nn(l, c),
|
|
1700
1788
|
className: "form-file-upload-preview",
|
|
1701
|
-
showUploadList: t &&
|
|
1702
|
-
fileList: t ?
|
|
1789
|
+
showUploadList: t && I.length > 0,
|
|
1790
|
+
fileList: t ? I.map((f, h) => ({
|
|
1703
1791
|
uid: `${h}-${f}`,
|
|
1704
1792
|
name: f,
|
|
1705
1793
|
status: "done"
|
|
1706
1794
|
})) : [],
|
|
1707
1795
|
beforeUpload: (f) => {
|
|
1708
|
-
if (!t) return
|
|
1709
|
-
const h =
|
|
1710
|
-
if (
|
|
1711
|
-
const
|
|
1712
|
-
return r(
|
|
1796
|
+
if (!t) return Se.LIST_IGNORE;
|
|
1797
|
+
const h = L(Ke(e));
|
|
1798
|
+
if (v && h.length >= g) return Se.LIST_IGNORE;
|
|
1799
|
+
const x = v ? [...h, f.name].slice(0, g) : [...h, f.name];
|
|
1800
|
+
return r(x), !1;
|
|
1713
1801
|
},
|
|
1714
1802
|
onRemove: (f) => {
|
|
1715
|
-
const h =
|
|
1716
|
-
if (
|
|
1717
|
-
r(
|
|
1803
|
+
const h = L(Ke(e)), x = /^(\d+)-/.exec(f.uid ?? ""), y = x ? Number(x[1]) : -1, S = y >= 0 && y < h.length ? h.filter((M, z) => z !== y) : h.filter((M) => M !== f.name);
|
|
1804
|
+
if (S.length < p) return !1;
|
|
1805
|
+
r(S);
|
|
1718
1806
|
},
|
|
1719
1807
|
children: [
|
|
1720
|
-
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(
|
|
1808
|
+
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(Sr, { type: m, size: 40 }) }),
|
|
1721
1809
|
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
1722
1810
|
]
|
|
1723
1811
|
}
|
|
1724
1812
|
),
|
|
1725
|
-
/* @__PURE__ */
|
|
1813
|
+
/* @__PURE__ */ C(D.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
1726
1814
|
"允许:",
|
|
1727
1815
|
u ?? "全部类型",
|
|
1728
1816
|
p > 0 ? `;至少 ${p} 个文件` : "",
|
|
1729
|
-
|
|
1730
|
-
|
|
1817
|
+
v ? `;最多 ${g} 个文件` : "",
|
|
1818
|
+
k && t ? `(当前 ${I.length} 个,未达下限)` : ""
|
|
1731
1819
|
] })
|
|
1732
1820
|
] });
|
|
1733
1821
|
}
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1736
|
-
|
|
1822
|
+
const qr = V(
|
|
1823
|
+
Vr,
|
|
1824
|
+
wr
|
|
1737
1825
|
);
|
|
1738
|
-
function
|
|
1739
|
-
const { interactive: t } =
|
|
1826
|
+
function jr({ context: e }) {
|
|
1827
|
+
const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = A(o.variant) || "shortText", c = ne(n) ?? "", u = !t, m = "form-block-preview-control";
|
|
1740
1828
|
let p;
|
|
1741
1829
|
if (l === "longText")
|
|
1742
1830
|
p = /* @__PURE__ */ s(
|
|
1743
|
-
|
|
1831
|
+
xe.TextArea,
|
|
1744
1832
|
{
|
|
1745
1833
|
disabled: u,
|
|
1746
1834
|
className: m,
|
|
1747
|
-
placeholder:
|
|
1835
|
+
placeholder: a || "长文本回答...",
|
|
1748
1836
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
1749
1837
|
value: c,
|
|
1750
|
-
onChange: (
|
|
1838
|
+
onChange: (g) => r(g.target.value)
|
|
1751
1839
|
}
|
|
1752
1840
|
);
|
|
1753
1841
|
else if (l === "number") {
|
|
1754
|
-
const
|
|
1842
|
+
const g = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
|
|
1755
1843
|
p = /* @__PURE__ */ s(
|
|
1756
|
-
|
|
1844
|
+
Rt,
|
|
1757
1845
|
{
|
|
1758
1846
|
disabled: u,
|
|
1759
1847
|
className: m,
|
|
1760
1848
|
style: { width: "100%" },
|
|
1761
|
-
placeholder:
|
|
1762
|
-
value:
|
|
1763
|
-
onChange: (
|
|
1849
|
+
placeholder: a || "数字",
|
|
1850
|
+
value: g,
|
|
1851
|
+
onChange: (v) => r(v == null ? "" : String(v))
|
|
1764
1852
|
}
|
|
1765
1853
|
);
|
|
1766
1854
|
} else l === "obscured" ? p = /* @__PURE__ */ s(
|
|
1767
|
-
|
|
1855
|
+
xe.Password,
|
|
1768
1856
|
{
|
|
1769
1857
|
disabled: u,
|
|
1770
1858
|
className: m,
|
|
1771
|
-
placeholder:
|
|
1859
|
+
placeholder: a,
|
|
1772
1860
|
value: c,
|
|
1773
|
-
onChange: (
|
|
1861
|
+
onChange: (g) => r(g.target.value)
|
|
1774
1862
|
}
|
|
1775
1863
|
) : p = /* @__PURE__ */ s(
|
|
1776
|
-
|
|
1864
|
+
xe,
|
|
1777
1865
|
{
|
|
1778
1866
|
disabled: u,
|
|
1779
1867
|
className: m,
|
|
1780
|
-
placeholder:
|
|
1868
|
+
placeholder: a,
|
|
1781
1869
|
value: c,
|
|
1782
|
-
onChange: (
|
|
1870
|
+
onChange: (g) => r(g.target.value)
|
|
1783
1871
|
}
|
|
1784
1872
|
);
|
|
1785
|
-
return /* @__PURE__ */
|
|
1786
|
-
|
|
1873
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1874
|
+
i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1787
1875
|
p
|
|
1788
1876
|
] });
|
|
1789
1877
|
}
|
|
1790
|
-
const
|
|
1878
|
+
const $r = V(
|
|
1791
1879
|
{
|
|
1792
1880
|
name: "TextField",
|
|
1793
1881
|
schema: d.object({
|
|
@@ -1798,204 +1886,204 @@ const Rr = R(
|
|
|
1798
1886
|
value: d.any().optional()
|
|
1799
1887
|
}).passthrough()
|
|
1800
1888
|
},
|
|
1801
|
-
|
|
1889
|
+
jr
|
|
1802
1890
|
);
|
|
1803
|
-
function
|
|
1804
|
-
const t = e.componentModel.properties, n =
|
|
1805
|
-
return
|
|
1891
|
+
function Lr({ context: e }) {
|
|
1892
|
+
const t = e.componentModel.properties, n = A(t.text), r = A(t.variant) || "body";
|
|
1893
|
+
return Cr.has(r) ? r === "caption" ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ s("em", { children: n }) }) : /* @__PURE__ */ s(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ s(D.Paragraph, { className: "form-block-preview-paragraph", children: n });
|
|
1806
1894
|
}
|
|
1807
|
-
const
|
|
1808
|
-
{ name: "Text", schema:
|
|
1809
|
-
|
|
1895
|
+
const Dr = V(
|
|
1896
|
+
{ name: "Text", schema: ae("Text") },
|
|
1897
|
+
Lr
|
|
1810
1898
|
);
|
|
1811
|
-
function
|
|
1899
|
+
function Tt() {
|
|
1812
1900
|
const t = [
|
|
1813
|
-
...[...
|
|
1814
|
-
(r) => !
|
|
1901
|
+
...[...ue.components.values()].filter(
|
|
1902
|
+
(r) => !xr.has(r.name)
|
|
1815
1903
|
),
|
|
1816
|
-
yr,
|
|
1817
1904
|
Ar,
|
|
1818
|
-
vr,
|
|
1819
|
-
br,
|
|
1820
|
-
Sr,
|
|
1821
|
-
Cr,
|
|
1822
|
-
Nr,
|
|
1823
1905
|
Pr,
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1906
|
+
Tr,
|
|
1907
|
+
Nr,
|
|
1908
|
+
Ir,
|
|
1909
|
+
_r,
|
|
1910
|
+
zr,
|
|
1911
|
+
Br,
|
|
1912
|
+
qr,
|
|
1913
|
+
$r,
|
|
1914
|
+
Dr,
|
|
1915
|
+
...Kn()
|
|
1916
|
+
], n = [...ue.functions.values()];
|
|
1917
|
+
return new $t(kt, t, n, ue.themeSchema);
|
|
1918
|
+
}
|
|
1919
|
+
const Kr = It(
|
|
1832
1920
|
function({
|
|
1833
1921
|
doc: t,
|
|
1834
1922
|
surfaceId: n = "skopon-form",
|
|
1835
1923
|
emptyHint: r = null,
|
|
1836
1924
|
interactive: o = !0,
|
|
1837
|
-
fieldNames:
|
|
1838
|
-
resumeSearch:
|
|
1925
|
+
fieldNames: i = [],
|
|
1926
|
+
resumeSearch: a = null,
|
|
1839
1927
|
caseSearch: l = null
|
|
1840
1928
|
}, c) {
|
|
1841
|
-
|
|
1842
|
-
|
|
1929
|
+
j(() => {
|
|
1930
|
+
tt(), et();
|
|
1843
1931
|
}, []);
|
|
1844
|
-
const u =
|
|
1845
|
-
m.current =
|
|
1846
|
-
const p =
|
|
1847
|
-
if (
|
|
1932
|
+
const u = q(null), m = q(i);
|
|
1933
|
+
m.current = i;
|
|
1934
|
+
const p = B(() => {
|
|
1935
|
+
if (Ee(t)) return "";
|
|
1848
1936
|
try {
|
|
1849
1937
|
return JSON.stringify(t);
|
|
1850
1938
|
} catch {
|
|
1851
1939
|
return String(t);
|
|
1852
1940
|
}
|
|
1853
|
-
}, [t]),
|
|
1941
|
+
}, [t]), g = B(() => {
|
|
1854
1942
|
if (!p)
|
|
1855
1943
|
return { surfaces: [], processor: null };
|
|
1856
1944
|
try {
|
|
1857
|
-
const
|
|
1945
|
+
const T = JSON.parse(p), k = new Qe([Tt()]), f = nr(T, {
|
|
1858
1946
|
surfaceId: n,
|
|
1859
|
-
catalogId:
|
|
1947
|
+
catalogId: kt
|
|
1860
1948
|
});
|
|
1861
|
-
return
|
|
1862
|
-
surfaces: Array.from(
|
|
1863
|
-
processor:
|
|
1949
|
+
return k.processMessages(f), {
|
|
1950
|
+
surfaces: Array.from(k.model.surfacesMap.values()),
|
|
1951
|
+
processor: k
|
|
1864
1952
|
};
|
|
1865
|
-
} catch (
|
|
1866
|
-
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败",
|
|
1953
|
+
} catch (T) {
|
|
1954
|
+
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", T), { surfaces: [], processor: null };
|
|
1867
1955
|
}
|
|
1868
|
-
}, [p, n]), { surfaces:
|
|
1869
|
-
return u.current =
|
|
1956
|
+
}, [p, n]), { surfaces: v, processor: I } = g;
|
|
1957
|
+
return u.current = I, Mt(
|
|
1870
1958
|
c,
|
|
1871
1959
|
() => ({
|
|
1872
|
-
getValues(
|
|
1873
|
-
const
|
|
1874
|
-
if (!
|
|
1875
|
-
const f = (
|
|
1876
|
-
return
|
|
1960
|
+
getValues(T) {
|
|
1961
|
+
const k = u.current;
|
|
1962
|
+
if (!k) return {};
|
|
1963
|
+
const f = (T ?? m.current).map((h) => h.trim()).filter(Boolean);
|
|
1964
|
+
return ar(k, n, f);
|
|
1877
1965
|
}
|
|
1878
1966
|
}),
|
|
1879
1967
|
[n]
|
|
1880
|
-
),
|
|
1968
|
+
), v.length === 0 ? /* @__PURE__ */ s(Ye, { children: r }) : /* @__PURE__ */ s(mt, { resumeSearch: a, children: /* @__PURE__ */ s(ut, { caseSearch: l, children: /* @__PURE__ */ s(ot, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: v.map((T) => /* @__PURE__ */ s(Ze, { surface: T }, T.id)) }) }) }) });
|
|
1881
1969
|
}
|
|
1882
1970
|
);
|
|
1883
|
-
function
|
|
1884
|
-
return new
|
|
1971
|
+
function ce() {
|
|
1972
|
+
return new Qe([Tt()]);
|
|
1885
1973
|
}
|
|
1886
|
-
function
|
|
1974
|
+
function ao({
|
|
1887
1975
|
messages: e,
|
|
1888
1976
|
surfaceId: t = "skopon-form-stream",
|
|
1889
1977
|
emptyHint: n = null,
|
|
1890
1978
|
interactive: r = !0,
|
|
1891
1979
|
resumeSearch: o = null,
|
|
1892
|
-
caseSearch:
|
|
1980
|
+
caseSearch: i = null
|
|
1893
1981
|
}) {
|
|
1894
|
-
|
|
1895
|
-
|
|
1982
|
+
j(() => {
|
|
1983
|
+
tt(), et();
|
|
1896
1984
|
}, []);
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1899
|
-
const l =
|
|
1985
|
+
const a = q(null);
|
|
1986
|
+
a.current === null && (a.current = ce());
|
|
1987
|
+
const l = q(0), c = q(""), u = q(!0), m = q(t);
|
|
1900
1988
|
function p(f, h) {
|
|
1901
|
-
|
|
1989
|
+
a.current = f, l.current = h.length, c.current = JSON.stringify(h), u.current && (I(f), k(Array.from(f.model.surfacesMap.values())));
|
|
1902
1990
|
}
|
|
1903
|
-
function
|
|
1991
|
+
function g(f, h) {
|
|
1904
1992
|
if (h <= 0) return !1;
|
|
1905
|
-
const
|
|
1906
|
-
if (!
|
|
1993
|
+
const x = JSON.stringify(f.slice(0, h)), y = c.current;
|
|
1994
|
+
if (!y) return !0;
|
|
1907
1995
|
try {
|
|
1908
|
-
const
|
|
1909
|
-
return JSON.stringify(
|
|
1996
|
+
const S = JSON.parse(y);
|
|
1997
|
+
return JSON.stringify(S.slice(0, h)) !== x;
|
|
1910
1998
|
} catch {
|
|
1911
1999
|
return !0;
|
|
1912
2000
|
}
|
|
1913
2001
|
}
|
|
1914
|
-
const [
|
|
1915
|
-
() =>
|
|
1916
|
-
), [
|
|
2002
|
+
const [v, I] = U(
|
|
2003
|
+
() => a.current
|
|
2004
|
+
), [T, k] = U(
|
|
1917
2005
|
() => Array.from(
|
|
1918
|
-
|
|
2006
|
+
a.current.model.surfacesMap.values()
|
|
1919
2007
|
)
|
|
1920
2008
|
);
|
|
1921
|
-
return
|
|
2009
|
+
return j(() => (u.current = !0, () => {
|
|
1922
2010
|
u.current = !1;
|
|
1923
|
-
}), []),
|
|
1924
|
-
|
|
1925
|
-
}, [
|
|
2011
|
+
}), []), j(() => {
|
|
2012
|
+
a.current = v;
|
|
2013
|
+
}, [v]), j(() => {
|
|
1926
2014
|
const f = () => {
|
|
1927
|
-
u.current &&
|
|
1928
|
-
}, h =
|
|
2015
|
+
u.current && k(Array.from(v.model.surfacesMap.values()));
|
|
2016
|
+
}, h = v.onSurfaceCreated(f), x = v.onSurfaceDeleted(f);
|
|
1929
2017
|
return () => {
|
|
1930
|
-
h.unsubscribe(),
|
|
2018
|
+
h.unsubscribe(), x.unsubscribe();
|
|
1931
2019
|
};
|
|
1932
|
-
}, [
|
|
2020
|
+
}, [v]), j(() => {
|
|
1933
2021
|
let f = !1;
|
|
1934
2022
|
const h = m.current !== t;
|
|
1935
2023
|
if (m.current = t, h) {
|
|
1936
|
-
const
|
|
1937
|
-
return Array.isArray(e) && e.length > 0 ? (
|
|
2024
|
+
const M = ce();
|
|
2025
|
+
return Array.isArray(e) && e.length > 0 ? (M.processMessages(e), f || p(M, e)) : (a.current = M, l.current = 0, c.current = "", f || (I(M), k([]))), () => {
|
|
1938
2026
|
f = !0;
|
|
1939
2027
|
};
|
|
1940
2028
|
}
|
|
1941
2029
|
if (!Array.isArray(e) || e.length === 0) {
|
|
1942
2030
|
if (l.current > 0) {
|
|
1943
|
-
const
|
|
1944
|
-
|
|
2031
|
+
const M = ce();
|
|
2032
|
+
a.current = M, l.current = 0, c.current = "", f || (I(M), k([]));
|
|
1945
2033
|
}
|
|
1946
2034
|
return () => {
|
|
1947
2035
|
f = !0;
|
|
1948
2036
|
};
|
|
1949
2037
|
}
|
|
1950
|
-
const
|
|
1951
|
-
if (e.length <
|
|
1952
|
-
const
|
|
1953
|
-
return
|
|
2038
|
+
const x = a.current, y = l.current;
|
|
2039
|
+
if (e.length < y || g(e, y)) {
|
|
2040
|
+
const M = ce();
|
|
2041
|
+
return M.processMessages(e), f || p(M, e), () => {
|
|
1954
2042
|
f = !0;
|
|
1955
2043
|
};
|
|
1956
2044
|
}
|
|
1957
|
-
const
|
|
1958
|
-
return
|
|
2045
|
+
const S = e.slice(y);
|
|
2046
|
+
return S.length === 0 ? () => {
|
|
1959
2047
|
f = !0;
|
|
1960
|
-
} : (
|
|
2048
|
+
} : (x.processMessages(S), l.current = e.length, c.current = JSON.stringify(e), f || k(Array.from(x.model.surfacesMap.values())), () => {
|
|
1961
2049
|
f = !0;
|
|
1962
2050
|
});
|
|
1963
|
-
}, [e, t]),
|
|
2051
|
+
}, [e, t]), T.length === 0 ? /* @__PURE__ */ s(Ye, { children: n }) : /* @__PURE__ */ s(mt, { resumeSearch: o, children: /* @__PURE__ */ s(ut, { caseSearch: i, children: /* @__PURE__ */ s(ot, { interactive: r, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: T.map((f) => /* @__PURE__ */ s(Ze, { surface: f }, f.id)) }) }) }) });
|
|
1964
2052
|
}
|
|
1965
|
-
function
|
|
2053
|
+
function Jr({
|
|
1966
2054
|
payload: e,
|
|
1967
2055
|
callbackUrl: t,
|
|
1968
2056
|
title: n,
|
|
1969
2057
|
unpublishedFormId: r,
|
|
1970
2058
|
incompleteFormId: o,
|
|
1971
|
-
copyMode:
|
|
1972
|
-
onNotify:
|
|
2059
|
+
copyMode: i = "display",
|
|
2060
|
+
onNotify: a
|
|
1973
2061
|
}) {
|
|
1974
|
-
const l =
|
|
1975
|
-
() =>
|
|
2062
|
+
const l = B(
|
|
2063
|
+
() => St(e, t),
|
|
1976
2064
|
[e, t]
|
|
1977
|
-
), c =
|
|
2065
|
+
), c = B(() => i === "submitFields" ? gr(e, t) : l, [i, e, t, l]);
|
|
1978
2066
|
async function u() {
|
|
1979
2067
|
try {
|
|
1980
|
-
await
|
|
2068
|
+
await Ct(c), a == null || a("success", "已复制到剪贴板");
|
|
1981
2069
|
} catch {
|
|
1982
|
-
|
|
2070
|
+
a == null || a("error", "复制失败");
|
|
1983
2071
|
}
|
|
1984
2072
|
}
|
|
1985
|
-
const m =
|
|
1986
|
-
return /* @__PURE__ */
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */ s(
|
|
1990
|
-
r ? /* @__PURE__ */ s(
|
|
1991
|
-
o ? /* @__PURE__ */ s(
|
|
2073
|
+
const m = i === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
|
|
2074
|
+
return /* @__PURE__ */ C("div", { className: "ask-user-curl-card", children: [
|
|
2075
|
+
/* @__PURE__ */ C("div", { className: "ask-user-curl-card-header", children: [
|
|
2076
|
+
/* @__PURE__ */ C("div", { className: "ask-user-curl-card-header-title", children: [
|
|
2077
|
+
/* @__PURE__ */ s(D.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
2078
|
+
r ? /* @__PURE__ */ s(ee, { title: r, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
2079
|
+
o ? /* @__PURE__ */ s(ee, { title: o, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
1992
2080
|
] }),
|
|
1993
|
-
/* @__PURE__ */ s(
|
|
2081
|
+
/* @__PURE__ */ s(ee, { title: m, children: /* @__PURE__ */ s(fe, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
|
|
1994
2082
|
] }),
|
|
1995
2083
|
/* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: l })
|
|
1996
2084
|
] });
|
|
1997
2085
|
}
|
|
1998
|
-
function
|
|
2086
|
+
function Hr(e, t) {
|
|
1999
2087
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
2000
2088
|
const n = t.message;
|
|
2001
2089
|
if (typeof n == "string" && n.trim())
|
|
@@ -2003,156 +2091,156 @@ function qr(e, t) {
|
|
|
2003
2091
|
}
|
|
2004
2092
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2005
2093
|
}
|
|
2006
|
-
function
|
|
2094
|
+
function lo({
|
|
2007
2095
|
payload: e,
|
|
2008
2096
|
formUniqueId: t,
|
|
2009
2097
|
callbackUrl: n,
|
|
2010
2098
|
submitMode: r = "curl",
|
|
2011
2099
|
fetchFormDetail: o,
|
|
2012
|
-
onNotify:
|
|
2013
|
-
resumeSearch:
|
|
2100
|
+
onNotify: i,
|
|
2101
|
+
resumeSearch: a = null,
|
|
2014
2102
|
caseSearch: l = null
|
|
2015
2103
|
}) {
|
|
2016
|
-
const [c, u] =
|
|
2017
|
-
h.current =
|
|
2018
|
-
const
|
|
2019
|
-
|
|
2104
|
+
const [c, u] = U(null), [m, p] = U(!1), [g, v] = U(!0), [I, T] = U(!1), k = q(null), f = q(!0), h = q(i);
|
|
2105
|
+
h.current = i;
|
|
2106
|
+
const x = (t == null ? void 0 : t.trim()) ?? "";
|
|
2107
|
+
j(() => (f.current = !0, () => {
|
|
2020
2108
|
f.current = !1;
|
|
2021
|
-
}), []),
|
|
2022
|
-
let
|
|
2023
|
-
return
|
|
2024
|
-
|
|
2025
|
-
}).catch((
|
|
2026
|
-
var
|
|
2027
|
-
if (!
|
|
2109
|
+
}), []), j(() => {
|
|
2110
|
+
let P = !1;
|
|
2111
|
+
return x ? (v(!0), p(!1), o({ formUniqueId: x }).then((_) => {
|
|
2112
|
+
P || (p(!!_.disabled), u(_.formDefinition ?? null));
|
|
2113
|
+
}).catch((_) => {
|
|
2114
|
+
var b;
|
|
2115
|
+
if (!P) {
|
|
2028
2116
|
p(!1), u(null);
|
|
2029
|
-
const
|
|
2030
|
-
(
|
|
2117
|
+
const F = _ instanceof Error ? _.message : "获取表单定义失败";
|
|
2118
|
+
(b = h.current) == null || b.call(h, "error", F);
|
|
2031
2119
|
}
|
|
2032
2120
|
}).finally(() => {
|
|
2033
|
-
|
|
2121
|
+
P || v(!1);
|
|
2034
2122
|
}), () => {
|
|
2035
|
-
|
|
2036
|
-
}) : (
|
|
2037
|
-
|
|
2123
|
+
P = !0;
|
|
2124
|
+
}) : (v(!1), p(!1), u(null), () => {
|
|
2125
|
+
P = !0;
|
|
2038
2126
|
});
|
|
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 (!
|
|
2127
|
+
}, [x, o]);
|
|
2128
|
+
const y = B(() => yt(e), [e]), S = B(() => y ? ur(y, c ?? void 0) : null, [y, c]), M = (S == null ? void 0 : S.matchedBlocks) ?? [], z = !!(y && mr(y) && M.length === 0), $ = B(() => z && y ? dr(y) : S && S.renderBlocks.length > 0 ? S.renderBlocks : [], [S, z, y]), G = B(
|
|
2129
|
+
() => z ? {} : vt((S == null ? void 0 : S.extraBlocks) ?? []),
|
|
2130
|
+
[z, S]
|
|
2131
|
+
), w = B(() => z && y ? fr(y) : $.filter((P) => {
|
|
2132
|
+
var _;
|
|
2133
|
+
return (_ = P.name) == null ? void 0 : _.trim();
|
|
2134
|
+
}).map((P) => P.name.trim()), [z, y, $]), O = B(() => {
|
|
2135
|
+
if ($.length === 0) return null;
|
|
2136
|
+
const P = (S == null ? void 0 : S.title) ?? (y == null ? void 0 : y.title) ?? "", _ = (S == null ? void 0 : S.description) ?? (y == null ? void 0 : y.description) ?? "";
|
|
2137
|
+
return or({ title: P, description: _ }, $);
|
|
2138
|
+
}, [S, y, $]), H = x ? `ask-user-${x}` : "ask-user-payload";
|
|
2139
|
+
if (g)
|
|
2140
|
+
return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(Oe, { size: "small" }) });
|
|
2141
|
+
if (!y || $.length === 0)
|
|
2054
2142
|
return /* @__PURE__ */ s(
|
|
2055
|
-
|
|
2143
|
+
Jr,
|
|
2056
2144
|
{
|
|
2057
2145
|
payload: e,
|
|
2058
2146
|
callbackUrl: n,
|
|
2059
2147
|
copyMode: "submitFields",
|
|
2060
|
-
unpublishedFormId: m &&
|
|
2061
|
-
onNotify:
|
|
2148
|
+
unpublishedFormId: m && x ? x : void 0,
|
|
2149
|
+
onNotify: i
|
|
2062
2150
|
}
|
|
2063
2151
|
);
|
|
2064
|
-
async function
|
|
2065
|
-
var
|
|
2066
|
-
if (!
|
|
2067
|
-
|
|
2152
|
+
async function Y() {
|
|
2153
|
+
var P, _, b, F, R, N;
|
|
2154
|
+
if (!I) {
|
|
2155
|
+
T(!0);
|
|
2068
2156
|
try {
|
|
2069
|
-
const
|
|
2157
|
+
const Z = ((P = k.current) == null ? void 0 : P.getValues(w)) ?? {}, ve = { ...Z, ...G };
|
|
2070
2158
|
if (r === "post") {
|
|
2071
|
-
const
|
|
2072
|
-
if (!
|
|
2073
|
-
(
|
|
2159
|
+
const je = (n ?? "").trim();
|
|
2160
|
+
if (!je) {
|
|
2161
|
+
(_ = h.current) == null || _.call(h, "error", "callback_url 为空,无法提交");
|
|
2074
2162
|
return;
|
|
2075
2163
|
}
|
|
2076
|
-
const
|
|
2164
|
+
const be = await yr(je, ve);
|
|
2077
2165
|
if (!f.current) return;
|
|
2078
|
-
|
|
2166
|
+
be.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (F = h.current) == null || F.call(h, "error", Hr(be.status, be.body));
|
|
2079
2167
|
return;
|
|
2080
2168
|
}
|
|
2081
|
-
if (await
|
|
2082
|
-
|
|
2169
|
+
if (await Ct(
|
|
2170
|
+
xt({ cardValues: Z, extraValues: G, callbackUrl: n })
|
|
2083
2171
|
), !f.current) return;
|
|
2084
|
-
(
|
|
2085
|
-
} catch (
|
|
2172
|
+
(R = h.current) == null || R.call(h, "success", "已复制 curl 到剪贴板");
|
|
2173
|
+
} catch (Z) {
|
|
2086
2174
|
if (!f.current) return;
|
|
2087
|
-
const
|
|
2088
|
-
(
|
|
2175
|
+
const ve = Z instanceof Error ? Z.message : "复制失败";
|
|
2176
|
+
(N = h.current) == null || N.call(h, "error", ve);
|
|
2089
2177
|
} finally {
|
|
2090
|
-
f.current &&
|
|
2178
|
+
f.current && T(!1);
|
|
2091
2179
|
}
|
|
2092
2180
|
}
|
|
2093
2181
|
}
|
|
2094
|
-
return /* @__PURE__ */
|
|
2095
|
-
m &&
|
|
2182
|
+
return /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
|
|
2183
|
+
m && x ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(ee, { title: x, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
2096
2184
|
/* @__PURE__ */ s(
|
|
2097
|
-
|
|
2185
|
+
Kr,
|
|
2098
2186
|
{
|
|
2099
|
-
ref:
|
|
2100
|
-
doc:
|
|
2101
|
-
surfaceId:
|
|
2102
|
-
fieldNames:
|
|
2187
|
+
ref: k,
|
|
2188
|
+
doc: O,
|
|
2189
|
+
surfaceId: H,
|
|
2190
|
+
fieldNames: w,
|
|
2103
2191
|
interactive: !0,
|
|
2104
|
-
resumeSearch:
|
|
2192
|
+
resumeSearch: a,
|
|
2105
2193
|
caseSearch: l
|
|
2106
2194
|
}
|
|
2107
2195
|
),
|
|
2108
|
-
/* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(
|
|
2109
|
-
|
|
2196
|
+
/* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(ee, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
|
|
2197
|
+
fe,
|
|
2110
2198
|
{
|
|
2111
2199
|
type: "primary",
|
|
2112
2200
|
size: "small",
|
|
2113
|
-
loading:
|
|
2114
|
-
disabled:
|
|
2115
|
-
onClick: () => void
|
|
2201
|
+
loading: I,
|
|
2202
|
+
disabled: I,
|
|
2203
|
+
onClick: () => void Y(),
|
|
2116
2204
|
children: "提交"
|
|
2117
2205
|
}
|
|
2118
2206
|
) }) })
|
|
2119
2207
|
] });
|
|
2120
2208
|
}
|
|
2121
2209
|
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
|
-
|
|
2210
|
+
oo as A2UI_PROTOCOL_VERSION,
|
|
2211
|
+
lo as AskUserFormCard,
|
|
2212
|
+
ut as CaseSearchProvider,
|
|
2213
|
+
Jr as CurlSubmitBlock,
|
|
2214
|
+
Lt as FORM_MEDIA_SIZES,
|
|
2215
|
+
mt as ResumeSearchProvider,
|
|
2216
|
+
ao as SkoponA2uiStreamRenderer,
|
|
2217
|
+
Kr as SkoponFormRenderer,
|
|
2218
|
+
tr as a2uiToBlocks,
|
|
2219
|
+
ft as blocksToA2ui,
|
|
2220
|
+
hr as buildAskUserCurlBodyJson,
|
|
2221
|
+
xt as buildAskUserCurlStatement,
|
|
2222
|
+
gr as buildAskUserSubmitCurlFromPayload,
|
|
2223
|
+
or as buildAskUserSurface,
|
|
2224
|
+
St as buildCurlStatement,
|
|
2225
|
+
Ct as copyTextToClipboard,
|
|
2226
|
+
io as createFormClient,
|
|
2227
|
+
vt as extractExtraBlockValues,
|
|
2228
|
+
ar as extractSurfaceValues,
|
|
2229
|
+
fr as getPayloadInputFieldNames,
|
|
2230
|
+
dr as getPayloadRenderableBlocks,
|
|
2231
|
+
ur as intersectPayloadBlocksWithForm,
|
|
2232
|
+
Ee as isA2uiSurfaceEmpty,
|
|
2233
|
+
X as isInputBlockType,
|
|
2234
|
+
Be as isLayoutBlockType,
|
|
2235
|
+
Pe as isMediaBlockType,
|
|
2236
|
+
ir as mapFormDefinitionFromDto,
|
|
2237
|
+
W as normalizeFormDefinition,
|
|
2238
|
+
yt as parsePayloadBlocksJson,
|
|
2239
|
+
mr as payloadHasInputBlocks,
|
|
2240
|
+
rr as resolveSurfaceFromFormDefinition,
|
|
2241
|
+
yr as submitFormJson,
|
|
2242
|
+
nr as surfaceDocToMessages,
|
|
2243
|
+
pe as syncFormDefinition,
|
|
2244
|
+
xn as useCaseSearch,
|
|
2245
|
+
Pn as useResumeSearch
|
|
2158
2246
|
};
|