@skopon-cool/form-sdk 0.4.9 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -1
- package/dist/adapter/a2uiAdapter.d.ts.map +1 -1
- package/dist/adapter/formOptions.d.ts +6 -0
- package/dist/adapter/formOptions.d.ts.map +1 -0
- package/dist/adapter/formSchema.d.ts.map +1 -1
- package/dist/adapter/formWeb.d.ts +14 -0
- package/dist/adapter/formWeb.d.ts.map +1 -0
- package/dist/blocks/registry.d.ts.map +1 -1
- package/dist/blocks/web/adapter.d.ts +8 -0
- package/dist/blocks/web/adapter.d.ts.map +1 -0
- package/dist/blocks/web/catalog.d.ts +9 -0
- package/dist/blocks/web/catalog.d.ts.map +1 -0
- package/dist/blocks/web/index.d.ts +3 -0
- package/dist/blocks/web/index.d.ts.map +1 -0
- package/dist/catalog/a2uiCustomCatalog.d.ts.map +1 -1
- package/dist/client/authStorage.d.ts +1 -1
- package/dist/client/authStorage.d.ts.map +1 -1
- package/dist/form-sdk.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1408 -1220
- package/dist/submit/intersectPayloadBlocksWithForm.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapter/a2uiAdapter.test.ts +96 -0
- package/src/adapter/a2uiAdapter.ts +3 -12
- package/src/adapter/formOptions.test.ts +60 -0
- package/src/adapter/formOptions.ts +36 -0
- package/src/adapter/formSchema.test.ts +68 -0
- package/src/adapter/formSchema.ts +19 -6
- package/src/adapter/formWeb.test.ts +38 -0
- package/src/adapter/formWeb.ts +41 -0
- package/src/blocks/registry.ts +6 -1
- package/src/blocks/web/adapter.ts +36 -0
- package/src/blocks/web/catalog.test.tsx +95 -0
- package/src/blocks/web/catalog.tsx +158 -0
- package/src/blocks/web/index.ts +11 -0
- package/src/catalog/a2uiCustomCatalog.tsx +6 -10
- package/src/catalog/invalidStaticOptions.test.tsx +62 -0
- package/src/client/authStorage.ts +1 -1
- package/src/index.ts +9 -0
- package/src/styles/index.css +87 -0
- package/src/submit/intersectPayloadBlocksWithForm.ts +14 -4
- package/src/submit/submit.test.ts +54 -2
- package/src/submit/validateFormSubmit.ts +2 -2
- package/src/types/index.ts +12 -2
package/dist/index.js
CHANGED
|
@@ -1,43 +1,70 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var G = (e, t, n) =>
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useRef as A, useState as
|
|
7
|
-
import { Spin as
|
|
8
|
-
import { ReloadOutlined as
|
|
9
|
-
import { createBinderlessComponentImplementation as
|
|
10
|
-
import { z as
|
|
11
|
-
import { Catalog as
|
|
12
|
-
import { injectBasicCatalogStyles as
|
|
13
|
-
import { injectStyles as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
2
|
+
var Kn = Object.defineProperty;
|
|
3
|
+
var Wn = (e, t, n) => t in e ? Kn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var G = (e, t, n) => Wn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { jsx as c, jsxs as x } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as A, useState as E, useCallback as j, useMemo as V, createContext as _e, useContext as Te, useEffect as B, useSyncExternalStore as Gn, forwardRef as Jn, useImperativeHandle as Yn } from "react";
|
|
7
|
+
import { Spin as yt, Button as xe, Typography as ee, Avatar as Xn, Tag as ve, Tooltip as he, Modal as Qn, Select as ct, Checkbox as Zn, Radio as er, Switch as tr, TimePicker as nr, DatePicker as rr, Upload as Ze, Input as et, InputNumber as or, ConfigProvider as ir } from "antd";
|
|
8
|
+
import { ReloadOutlined as nn, FileTextOutlined as rn, UserOutlined as sr, FileImageOutlined as ar, FullscreenOutlined as lr, FileExcelOutlined as cr, FileOutlined as on, PictureOutlined as ur, SoundOutlined as mr, VideoCameraOutlined as dr } from "@ant-design/icons";
|
|
9
|
+
import { createBinderlessComponentImplementation as J, basicCatalog as Pe, A2uiSurface as sn } from "@a2ui/react/v0_9";
|
|
10
|
+
import { z as f } from "zod";
|
|
11
|
+
import { Catalog as pr, MessageProcessor as an } from "@a2ui/web_core/v0_9";
|
|
12
|
+
import { injectBasicCatalogStyles as ln } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
13
|
+
import { injectStyles as cn } from "@a2ui/react/styles";
|
|
14
|
+
import Kt from "dayjs";
|
|
15
|
+
const Rs = "v0.9", fr = [
|
|
16
16
|
"huge",
|
|
17
17
|
"large",
|
|
18
18
|
"medium",
|
|
19
19
|
"small",
|
|
20
20
|
"icon"
|
|
21
21
|
];
|
|
22
|
-
function
|
|
22
|
+
function be(e) {
|
|
23
23
|
return e === "image" || e === "video" || e === "audio";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Se(e) {
|
|
26
|
+
return e === "web";
|
|
27
|
+
}
|
|
28
|
+
function un(e) {
|
|
26
29
|
return e === "heading" || e === "paragraph";
|
|
27
30
|
}
|
|
28
31
|
function Z(e) {
|
|
29
|
-
return !
|
|
32
|
+
return !un(e) && !be(e) && !Se(e);
|
|
30
33
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
34
|
+
function mn(e) {
|
|
35
|
+
return un(e) || be(e) || Se(e);
|
|
33
36
|
}
|
|
34
|
-
function
|
|
37
|
+
function dn(e) {
|
|
35
38
|
return e === "select" || e === "multiselect" || e === "radio" || e === "checkbox";
|
|
36
39
|
}
|
|
37
|
-
function
|
|
40
|
+
function ws(e) {
|
|
38
41
|
return Z(e) && e !== "file" && e !== "resume_multiselect" && e !== "case_multiselect";
|
|
39
42
|
}
|
|
40
|
-
|
|
43
|
+
const ut = 360, hr = 200, gr = 1200;
|
|
44
|
+
function Me(e) {
|
|
45
|
+
if (e == null || e === "")
|
|
46
|
+
return ut;
|
|
47
|
+
const t = typeof e == "number" ? e : Number(e);
|
|
48
|
+
return Number.isFinite(t) ? Math.min(
|
|
49
|
+
gr,
|
|
50
|
+
Math.max(hr, Math.floor(t))
|
|
51
|
+
) : ut;
|
|
52
|
+
}
|
|
53
|
+
function yr(e) {
|
|
54
|
+
if (typeof e != "string") return !1;
|
|
55
|
+
const t = e.trim();
|
|
56
|
+
if (!t) return !1;
|
|
57
|
+
if (/^\/(?!\/)/.test(t) || /^\.\.?\//.test(t))
|
|
58
|
+
return !0;
|
|
59
|
+
if (!/^https?:\/\//i.test(t)) return !1;
|
|
60
|
+
try {
|
|
61
|
+
const n = new URL(t);
|
|
62
|
+
return (n.protocol === "http:" || n.protocol === "https:") && !!n.hostname;
|
|
63
|
+
} catch {
|
|
64
|
+
return !1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function vr() {
|
|
41
68
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
42
69
|
return crypto.randomUUID();
|
|
43
70
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
@@ -52,10 +79,10 @@ function sr() {
|
|
|
52
79
|
});
|
|
53
80
|
}
|
|
54
81
|
function le(e) {
|
|
55
|
-
const t =
|
|
82
|
+
const t = vr().replace(/-/g, "").slice(0, 8);
|
|
56
83
|
return `${e}${t}`;
|
|
57
84
|
}
|
|
58
|
-
const
|
|
85
|
+
const pn = [
|
|
59
86
|
{ value: "image/*", label: "图片" },
|
|
60
87
|
{ value: "video/*", label: "视频" },
|
|
61
88
|
{ value: "audio/*", label: "音频" },
|
|
@@ -66,7 +93,7 @@ const on = [
|
|
|
66
93
|
{ value: "text/plain", label: "纯文本" },
|
|
67
94
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
68
95
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
69
|
-
],
|
|
96
|
+
], br = {
|
|
70
97
|
"image/*": ["image/*"],
|
|
71
98
|
"video/*": ["video/*"],
|
|
72
99
|
"audio/*": ["audio/*"],
|
|
@@ -86,7 +113,7 @@ const on = [
|
|
|
86
113
|
"text/plain": ["text/plain"],
|
|
87
114
|
"application/zip": ["application/zip"],
|
|
88
115
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
89
|
-
},
|
|
116
|
+
}, Sr = {
|
|
90
117
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
91
118
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
92
119
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -97,14 +124,14 @@ const on = [
|
|
|
97
124
|
"text/plain": [".txt"],
|
|
98
125
|
"application/zip": [".zip", ".7z"],
|
|
99
126
|
"application/x-rar-compressed": [".rar"]
|
|
100
|
-
},
|
|
127
|
+
}, kr = {
|
|
101
128
|
"application/msword": "office/word",
|
|
102
129
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
103
130
|
"application/vnd.ms-excel": "office/excel",
|
|
104
131
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
|
|
105
132
|
"application/vnd.ms-powerpoint": "office/ppt",
|
|
106
133
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
|
|
107
|
-
},
|
|
134
|
+
}, vt = [
|
|
108
135
|
{ value: ".jpg", label: ".jpg" },
|
|
109
136
|
{ value: ".jpeg", label: ".jpeg" },
|
|
110
137
|
{ value: ".png", label: ".png" },
|
|
@@ -130,119 +157,140 @@ const on = [
|
|
|
130
157
|
{ value: ".zip", label: ".zip" },
|
|
131
158
|
{ value: ".rar", label: ".rar" },
|
|
132
159
|
{ value: ".7z", label: ".7z" }
|
|
133
|
-
],
|
|
134
|
-
|
|
135
|
-
),
|
|
136
|
-
|
|
137
|
-
),
|
|
138
|
-
|
|
160
|
+
], Cr = Object.fromEntries(
|
|
161
|
+
pn.map((e) => [e.value, e.label])
|
|
162
|
+
), Ar = Object.fromEntries(
|
|
163
|
+
vt.map((e) => [e.value, e.label])
|
|
164
|
+
), _r = new Set(pn.map((e) => e.value)), Tr = new Set(
|
|
165
|
+
vt.map((e) => e.value)
|
|
139
166
|
);
|
|
140
|
-
function
|
|
167
|
+
function xr(e) {
|
|
141
168
|
const t = e.trim();
|
|
142
|
-
return t ?
|
|
169
|
+
return t ? _r.has(t) ? t : kr[t] ?? null : null;
|
|
143
170
|
}
|
|
144
|
-
function
|
|
171
|
+
function Mr(e) {
|
|
145
172
|
return Array.isArray(e) ? e.map((t) => {
|
|
146
173
|
const n = t.trim().toLowerCase();
|
|
147
174
|
return n ? n.startsWith(".") ? n : `.${n}` : "";
|
|
148
175
|
}).filter(Boolean) : [];
|
|
149
176
|
}
|
|
150
|
-
function
|
|
177
|
+
function Ne(e) {
|
|
151
178
|
if (!Array.isArray(e)) return [];
|
|
152
179
|
const t = [], n = /* @__PURE__ */ new Set();
|
|
153
180
|
for (const r of e) {
|
|
154
|
-
const o =
|
|
181
|
+
const o = xr(r);
|
|
155
182
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
156
183
|
}
|
|
157
184
|
return t;
|
|
158
185
|
}
|
|
159
|
-
function
|
|
160
|
-
const t =
|
|
186
|
+
function Nr(e) {
|
|
187
|
+
const t = Ne(e), n = [];
|
|
161
188
|
for (const r of t)
|
|
162
|
-
n.push(...
|
|
189
|
+
n.push(...br[r] ?? [r]);
|
|
163
190
|
return n;
|
|
164
191
|
}
|
|
165
|
-
function
|
|
166
|
-
const t =
|
|
192
|
+
function Fr(e) {
|
|
193
|
+
const t = Ne(e);
|
|
167
194
|
if (t.length === 0) return [];
|
|
168
195
|
const n = /* @__PURE__ */ new Set();
|
|
169
196
|
for (const r of t)
|
|
170
|
-
for (const o of
|
|
197
|
+
for (const o of Sr[r] ?? [])
|
|
171
198
|
n.add(o);
|
|
172
|
-
return
|
|
199
|
+
return vt.filter((r) => n.has(r.value));
|
|
173
200
|
}
|
|
174
|
-
function
|
|
175
|
-
const n =
|
|
201
|
+
function bt(e, t) {
|
|
202
|
+
const n = Mr(t), r = Ne(e);
|
|
176
203
|
if (r.length === 0)
|
|
177
|
-
return n.filter((i) =>
|
|
204
|
+
return n.filter((i) => Tr.has(i));
|
|
178
205
|
const o = new Set(
|
|
179
|
-
|
|
206
|
+
Fr(r).map((i) => i.value)
|
|
180
207
|
);
|
|
181
208
|
return n.filter((i) => o.has(i));
|
|
182
209
|
}
|
|
183
|
-
function
|
|
184
|
-
const n =
|
|
210
|
+
function Ir(e, t) {
|
|
211
|
+
const n = Nr(e), r = bt(e, t), o = [...n, ...r];
|
|
185
212
|
return o.length > 0 ? o.join(",") : void 0;
|
|
186
213
|
}
|
|
187
|
-
function
|
|
188
|
-
const n =
|
|
214
|
+
function Er(e, t) {
|
|
215
|
+
const n = Ne(e), r = bt(
|
|
189
216
|
n,
|
|
190
217
|
t
|
|
191
218
|
), o = [
|
|
192
|
-
...n.map((i) =>
|
|
193
|
-
...r.map((i) =>
|
|
219
|
+
...n.map((i) => Cr[i] ?? i),
|
|
220
|
+
...r.map((i) => Ar[i] ?? i)
|
|
194
221
|
];
|
|
195
222
|
return o.length === 0 ? null : o.join("、");
|
|
196
223
|
}
|
|
197
|
-
const
|
|
224
|
+
const Ur = [
|
|
198
225
|
"video",
|
|
199
226
|
"audio",
|
|
200
227
|
"image",
|
|
201
228
|
"file",
|
|
202
229
|
"spreadsheet",
|
|
203
230
|
"document"
|
|
204
|
-
],
|
|
205
|
-
function
|
|
206
|
-
return e &&
|
|
231
|
+
], Rr = new Set(Ur);
|
|
232
|
+
function wr(e) {
|
|
233
|
+
return e && Rr.has(e) ? e : "file";
|
|
207
234
|
}
|
|
208
|
-
function
|
|
209
|
-
return typeof e == "string" &&
|
|
235
|
+
function Fe(e) {
|
|
236
|
+
return typeof e == "string" && fr.includes(e) ? e : "medium";
|
|
210
237
|
}
|
|
211
|
-
function
|
|
238
|
+
function Pr(e, t) {
|
|
212
239
|
var o;
|
|
213
240
|
const n = Math.max(1, t);
|
|
214
241
|
let r = [];
|
|
215
242
|
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);
|
|
216
243
|
}
|
|
217
|
-
function
|
|
244
|
+
function zr(e) {
|
|
218
245
|
var t;
|
|
219
246
|
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
220
247
|
}
|
|
221
|
-
function
|
|
222
|
-
return `form-media-size-${
|
|
248
|
+
function Or(e) {
|
|
249
|
+
return `form-media-size-${Fe(e)}`;
|
|
223
250
|
}
|
|
224
|
-
function
|
|
225
|
-
return `form-media-preview form-media-list ${
|
|
251
|
+
function Br(e) {
|
|
252
|
+
return `form-media-preview form-media-list ${Or(e)}`;
|
|
226
253
|
}
|
|
227
|
-
|
|
228
|
-
|
|
254
|
+
function Wt(e) {
|
|
255
|
+
if (typeof e == "number")
|
|
256
|
+
return Number.isFinite(e) ? String(e) : void 0;
|
|
257
|
+
if (typeof e != "string") return;
|
|
258
|
+
const t = e.trim();
|
|
259
|
+
if (!(!t || t.toLowerCase() === "null"))
|
|
260
|
+
return t;
|
|
261
|
+
}
|
|
262
|
+
function Le(e) {
|
|
263
|
+
if (!Array.isArray(e)) return [];
|
|
264
|
+
const t = [];
|
|
265
|
+
for (const n of e) {
|
|
266
|
+
if (!n || typeof n != "object" || Array.isArray(n)) continue;
|
|
267
|
+
const r = n, o = Wt(r.value), i = Wt(r.label);
|
|
268
|
+
o === void 0 || i === void 0 || t.push({ value: o, label: i });
|
|
269
|
+
}
|
|
270
|
+
return t;
|
|
271
|
+
}
|
|
272
|
+
function ce(e) {
|
|
273
|
+
return !dn(e.type) || Le(e.options).length > 0;
|
|
274
|
+
}
|
|
275
|
+
const qr = 10;
|
|
276
|
+
function fn(e) {
|
|
229
277
|
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
230
278
|
}
|
|
231
|
-
function
|
|
279
|
+
function Ie(e) {
|
|
232
280
|
return e === !0 || e === "true" || e === 1 || e === "1";
|
|
233
281
|
}
|
|
234
|
-
function
|
|
282
|
+
function ze(e, t = 1) {
|
|
235
283
|
const n = typeof e == "number" ? e : Number(e);
|
|
236
284
|
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
|
|
237
285
|
}
|
|
238
|
-
function
|
|
286
|
+
function pe(e, t = 1) {
|
|
239
287
|
const n = typeof e == "number" ? e : Number(e);
|
|
240
288
|
return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
|
|
241
289
|
}
|
|
242
|
-
function
|
|
243
|
-
return t == null ? void 0 : e === "toggle" ?
|
|
290
|
+
function hn(e, t) {
|
|
291
|
+
return t == null ? void 0 : e === "toggle" ? Ie(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String).map((o) => o.trim()).filter(Boolean) : typeof t == "string" && t.trim() ? [t.trim()] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t).trim() || void 0;
|
|
244
292
|
}
|
|
245
|
-
function
|
|
293
|
+
function Lr(e) {
|
|
246
294
|
if (Array.isArray(e)) return e.map(String).filter(Boolean);
|
|
247
295
|
if (typeof e == "string" && e.trim())
|
|
248
296
|
try {
|
|
@@ -252,11 +300,11 @@ function Nr(e) {
|
|
|
252
300
|
}
|
|
253
301
|
return [];
|
|
254
302
|
}
|
|
255
|
-
function
|
|
256
|
-
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, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a =
|
|
303
|
+
function Vr(e) {
|
|
304
|
+
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, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a = Lr(e == null ? void 0 : e.flowUniqueIds);
|
|
257
305
|
return { agentKind: r, agentUniqueId: o, flowType: i, category: s, flowUniqueIds: a, pageSize: n };
|
|
258
306
|
}
|
|
259
|
-
function
|
|
307
|
+
function jr(e) {
|
|
260
308
|
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;
|
|
261
309
|
return {
|
|
262
310
|
names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
|
|
@@ -266,14 +314,14 @@ function Fr(e) {
|
|
|
266
314
|
pageSize: n
|
|
267
315
|
};
|
|
268
316
|
}
|
|
269
|
-
function
|
|
317
|
+
function $r(e) {
|
|
270
318
|
if (e.type !== "case_singleselect") return e;
|
|
271
319
|
const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
|
|
272
320
|
return { ...e, type: "case_multiselect", defaultValue: t };
|
|
273
321
|
}
|
|
274
|
-
function
|
|
275
|
-
var o, i, s, a;
|
|
276
|
-
const t =
|
|
322
|
+
function Dr(e) {
|
|
323
|
+
var o, i, s, a, l;
|
|
324
|
+
const t = $r(e), n = Ne(t.fileAcceptTypes), r = t.type;
|
|
277
325
|
return {
|
|
278
326
|
id: ((o = t.id) == null ? void 0 : o.trim()) || le("block-"),
|
|
279
327
|
type: r,
|
|
@@ -282,56 +330,52 @@ function Ur(e) {
|
|
|
282
330
|
placeholder: t.placeholder ?? "",
|
|
283
331
|
help: t.help ?? "",
|
|
284
332
|
required: t.required === !0,
|
|
285
|
-
mediaUrls:
|
|
286
|
-
mediaSize:
|
|
333
|
+
mediaUrls: be(r) ? Pr(t, qr) : void 0,
|
|
334
|
+
mediaSize: be(r) ? Fe(t.mediaSize) : void 0,
|
|
335
|
+
webUrl: Se(r) ? ((s = t.webUrl) == null ? void 0 : s.trim()) ?? "" : void 0,
|
|
336
|
+
webHeight: Se(r) ? Me(t.webHeight) : void 0,
|
|
287
337
|
fileAcceptTypes: n,
|
|
288
|
-
fileAcceptExtensions:
|
|
338
|
+
fileAcceptExtensions: bt(
|
|
289
339
|
n,
|
|
290
340
|
t.fileAcceptExtensions
|
|
291
341
|
),
|
|
292
|
-
filePlaceholderIcon:
|
|
293
|
-
fileMinCount: r === "file" ?
|
|
294
|
-
fileMaxCount: r === "file" ?
|
|
295
|
-
defaultValue:
|
|
296
|
-
jsonSchemaDescription: ((
|
|
342
|
+
filePlaceholderIcon: wr(t.filePlaceholderIcon),
|
|
343
|
+
fileMinCount: r === "file" ? ze(t.fileMinCount, 1) : void 0,
|
|
344
|
+
fileMaxCount: r === "file" ? ze(t.fileMaxCount, 1) : void 0,
|
|
345
|
+
defaultValue: hn(r, t.defaultValue),
|
|
346
|
+
jsonSchemaDescription: ((a = t.jsonSchemaDescription) == null ? void 0 : a.trim()) ?? "",
|
|
297
347
|
hidden: r === "text" ? t.hidden === !0 : void 0,
|
|
298
348
|
needLLM: t.needLLM === !0 ? !0 : void 0,
|
|
299
|
-
options: Array.isArray(t.options) ? t.options
|
|
300
|
-
|
|
301
|
-
return {
|
|
302
|
-
value: ((m = l.value) == null ? void 0 : m.trim()) || `option_${c + 1}`,
|
|
303
|
-
label: ((d = l.label) == null ? void 0 : d.trim()) || `选项 ${c + 1}`
|
|
304
|
-
};
|
|
305
|
-
}) : void 0,
|
|
306
|
-
condition: (a = t.condition) != null && a.fieldName ? {
|
|
349
|
+
options: Array.isArray(t.options) ? Le(t.options) : void 0,
|
|
350
|
+
condition: (l = t.condition) != null && l.fieldName ? {
|
|
307
351
|
fieldName: t.condition.fieldName.trim(),
|
|
308
352
|
operator: t.condition.operator ?? "eq",
|
|
309
353
|
value: t.condition.value
|
|
310
354
|
} : void 0,
|
|
311
355
|
resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
|
|
312
|
-
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ?
|
|
313
|
-
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ?
|
|
314
|
-
resumeFilter: r === "resume_multiselect" ?
|
|
356
|
+
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? pe(t.resumeMinCount, 1) : void 0,
|
|
357
|
+
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? pe(t.resumeMaxCount, 1) : void 0,
|
|
358
|
+
resumeFilter: r === "resume_multiselect" ? jr(t.resumeFilter) : void 0,
|
|
315
359
|
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
316
|
-
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ?
|
|
317
|
-
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ?
|
|
318
|
-
caseFilter: r === "case_multiselect" ?
|
|
360
|
+
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? pe(t.caseMinCount, 1) : void 0,
|
|
361
|
+
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? pe(t.caseMaxCount, 1) : void 0,
|
|
362
|
+
caseFilter: r === "case_multiselect" ? Vr(t.caseFilter) : void 0
|
|
319
363
|
};
|
|
320
364
|
}
|
|
321
|
-
function
|
|
365
|
+
function Hr(e) {
|
|
322
366
|
return new Set((e.options ?? []).map((t) => t.value));
|
|
323
367
|
}
|
|
324
|
-
function
|
|
368
|
+
function Gt(e, t) {
|
|
325
369
|
const n = {
|
|
326
370
|
type: "array",
|
|
327
371
|
items: { type: "string" }
|
|
328
372
|
};
|
|
329
|
-
return e !== void 0 && (n.minItems =
|
|
373
|
+
return e !== void 0 && (n.minItems = pe(e, 1)), t !== void 0 && (n.maxItems = pe(t, 1)), n;
|
|
330
374
|
}
|
|
331
|
-
function
|
|
332
|
-
const t =
|
|
375
|
+
function Kr(e) {
|
|
376
|
+
const t = hn(e.type, e.defaultValue);
|
|
333
377
|
if (t === void 0) return;
|
|
334
|
-
const n =
|
|
378
|
+
const n = Hr(e);
|
|
335
379
|
switch (e.type) {
|
|
336
380
|
case "toggle":
|
|
337
381
|
return t;
|
|
@@ -358,7 +402,7 @@ function Pr(e) {
|
|
|
358
402
|
return t;
|
|
359
403
|
}
|
|
360
404
|
}
|
|
361
|
-
function
|
|
405
|
+
function Wr(e) {
|
|
362
406
|
var i, s;
|
|
363
407
|
if (!((i = e.name) == null ? void 0 : i.trim()) || !Z(e.type)) return null;
|
|
364
408
|
let n;
|
|
@@ -386,7 +430,7 @@ function wr(e) {
|
|
|
386
430
|
break;
|
|
387
431
|
}
|
|
388
432
|
case "file": {
|
|
389
|
-
const a =
|
|
433
|
+
const a = ze(e.fileMinCount, 1), l = ze(e.fileMaxCount, 1);
|
|
390
434
|
l <= 1 ? n = { type: "string" } : n = {
|
|
391
435
|
type: "array",
|
|
392
436
|
items: { type: "string" },
|
|
@@ -396,10 +440,10 @@ function wr(e) {
|
|
|
396
440
|
break;
|
|
397
441
|
}
|
|
398
442
|
case "resume_multiselect":
|
|
399
|
-
n =
|
|
443
|
+
n = Gt(e.resumeMinCount, e.resumeMaxCount);
|
|
400
444
|
break;
|
|
401
445
|
case "case_multiselect":
|
|
402
|
-
n =
|
|
446
|
+
n = Gt(e.caseMinCount, e.caseMaxCount);
|
|
403
447
|
break;
|
|
404
448
|
case "text":
|
|
405
449
|
n = { type: "string" }, e.hidden && (n["x-hidden"] = !0);
|
|
@@ -410,17 +454,17 @@ function wr(e) {
|
|
|
410
454
|
}
|
|
411
455
|
const r = (s = e.jsonSchemaDescription) == null ? void 0 : s.trim();
|
|
412
456
|
r && (n.$comment = r);
|
|
413
|
-
const o =
|
|
457
|
+
const o = Kr(e);
|
|
414
458
|
return o !== void 0 && (n.default = o), n;
|
|
415
459
|
}
|
|
416
|
-
function
|
|
460
|
+
function Gr(e, t, n) {
|
|
417
461
|
var l;
|
|
418
462
|
const r = {}, o = [];
|
|
419
|
-
for (const
|
|
420
|
-
const m = (l =
|
|
421
|
-
if (!m || !Z(
|
|
422
|
-
const d =
|
|
423
|
-
d && (r[m] = d,
|
|
463
|
+
for (const u of e) {
|
|
464
|
+
const m = (l = u.name) == null ? void 0 : l.trim();
|
|
465
|
+
if (!m || !Z(u.type) || !ce(u)) continue;
|
|
466
|
+
const d = Wr(u);
|
|
467
|
+
d && (r[m] = d, u.required && o.push(m));
|
|
424
468
|
}
|
|
425
469
|
const i = {
|
|
426
470
|
type: "object",
|
|
@@ -430,35 +474,35 @@ function zr(e, t, n) {
|
|
|
430
474
|
}, s = t == null ? void 0 : t.trim(), a = n == null ? void 0 : n.trim();
|
|
431
475
|
return s && (i.title = s), a && (i.description = a), i;
|
|
432
476
|
}
|
|
433
|
-
function
|
|
477
|
+
function ke(e) {
|
|
434
478
|
const t = e.title ?? "", n = e.description ?? "";
|
|
435
479
|
return {
|
|
436
480
|
title: t,
|
|
437
481
|
description: n,
|
|
438
482
|
blocks: e.blocks,
|
|
439
|
-
jsonSchema:
|
|
483
|
+
jsonSchema: Gr(e.blocks, t, n)
|
|
440
484
|
};
|
|
441
485
|
}
|
|
442
|
-
function
|
|
486
|
+
function Ve(e) {
|
|
443
487
|
if (!e || !Array.isArray(e.blocks))
|
|
444
|
-
return
|
|
445
|
-
const t = e.blocks.map(
|
|
446
|
-
return
|
|
488
|
+
return ke({ title: "", description: "", blocks: [] });
|
|
489
|
+
const t = e.blocks.map(Dr);
|
|
490
|
+
return ke({
|
|
447
491
|
title: typeof e.title == "string" ? e.title : "",
|
|
448
492
|
description: typeof e.description == "string" ? e.description : "",
|
|
449
493
|
blocks: t
|
|
450
494
|
});
|
|
451
495
|
}
|
|
452
|
-
function
|
|
453
|
-
return
|
|
496
|
+
function Ps() {
|
|
497
|
+
return ke({ title: "", description: "", blocks: [] });
|
|
454
498
|
}
|
|
455
|
-
function
|
|
499
|
+
function zs(e) {
|
|
456
500
|
const t = {
|
|
457
501
|
id: le("block-"),
|
|
458
502
|
type: e,
|
|
459
503
|
label: e
|
|
460
504
|
};
|
|
461
|
-
return Z(e) && (t.label = "", t.name = le("field_"), t.placeholder = "", t.required = !1),
|
|
505
|
+
return Z(e) && (t.label = "", t.name = le("field_"), t.placeholder = "", t.required = !1), be(e) && (t.label = "", t.placeholder = "", t.help = "", t.mediaUrls = [""], t.mediaSize = "medium"), Se(e) && (t.label = "", t.help = "", t.webUrl = "", t.webHeight = ut), dn(e) && (t.options = [
|
|
462
506
|
{ value: "option_1", label: "选项 1" },
|
|
463
507
|
{ value: "option_2", label: "选项 2" }
|
|
464
508
|
]), e === "file" && (t.fileAcceptTypes = [], t.fileAcceptExtensions = [], t.filePlaceholderIcon = "file", t.fileMinCount = 1, t.fileMaxCount = 1), e === "resume_multiselect" && (t.resumeEnableRefresh = !0, t.resumeMinCount = 1, t.resumeMaxCount = 1, t.resumeFilter = {
|
|
@@ -468,7 +512,7 @@ function vs(e) {
|
|
|
468
512
|
pageSize: 20
|
|
469
513
|
}, t.defaultValue = []), e === "case_multiselect" && (t.caseEnableRefresh = !0, t.caseMinCount = 1, t.caseMaxCount = 1, t.caseFilter = { flowUniqueIds: [], pageSize: 20 }, t.defaultValue = []), t;
|
|
470
514
|
}
|
|
471
|
-
function
|
|
515
|
+
function Jr(e) {
|
|
472
516
|
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, s = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
473
517
|
return {
|
|
474
518
|
agentKind: n,
|
|
@@ -479,14 +523,14 @@ function Or(e) {
|
|
|
479
523
|
pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
|
|
480
524
|
};
|
|
481
525
|
}
|
|
482
|
-
function
|
|
526
|
+
function Jt(e) {
|
|
483
527
|
if (e == null) return;
|
|
484
528
|
const t = typeof e == "number" ? e : Number(e);
|
|
485
529
|
if (!(!Number.isFinite(t) || t < 1))
|
|
486
530
|
return Math.floor(t);
|
|
487
531
|
}
|
|
488
|
-
function
|
|
489
|
-
var s, a, l,
|
|
532
|
+
function Yr(e, t) {
|
|
533
|
+
var s, a, l, u, m, d;
|
|
490
534
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
491
535
|
return i({
|
|
492
536
|
id: n,
|
|
@@ -499,7 +543,7 @@ function qr(e, t) {
|
|
|
499
543
|
agentKind: (s = e.caseFilter) == null ? void 0 : s.agentKind,
|
|
500
544
|
agentUniqueId: (a = e.caseFilter) == null ? void 0 : a.agentUniqueId,
|
|
501
545
|
flowType: (l = e.caseFilter) == null ? void 0 : l.flowType,
|
|
502
|
-
category: (
|
|
546
|
+
category: (u = e.caseFilter) == null ? void 0 : u.category,
|
|
503
547
|
flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
|
|
504
548
|
pageSize: ((d = e.caseFilter) == null ? void 0 : d.pageSize) ?? 20
|
|
505
549
|
},
|
|
@@ -508,7 +552,7 @@ function qr(e, t) {
|
|
|
508
552
|
value: { path: o }
|
|
509
553
|
});
|
|
510
554
|
}
|
|
511
|
-
function
|
|
555
|
+
function Xr(e, t, n) {
|
|
512
556
|
const r = n.nameFromValue(e.value), o = {
|
|
513
557
|
...t("case_multiselect"),
|
|
514
558
|
name: r,
|
|
@@ -516,23 +560,23 @@ function Br(e, t, n) {
|
|
|
516
560
|
}, i = n.asLiteral(e.placeholder);
|
|
517
561
|
i && (o.placeholder = i);
|
|
518
562
|
const s = n.asLiteral(e.help);
|
|
519
|
-
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter =
|
|
520
|
-
const a =
|
|
563
|
+
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Jr(e.caseFilter));
|
|
564
|
+
const a = Jt(e.minCount);
|
|
521
565
|
a !== void 0 && (o.caseMinCount = a);
|
|
522
|
-
const l =
|
|
566
|
+
const l = Jt(e.maxCount);
|
|
523
567
|
return l !== void 0 && (o.caseMaxCount = l), o;
|
|
524
568
|
}
|
|
525
|
-
const
|
|
569
|
+
const gn = _e(
|
|
526
570
|
null
|
|
527
571
|
);
|
|
528
|
-
function
|
|
572
|
+
function Qr(e) {
|
|
529
573
|
try {
|
|
530
574
|
return JSON.stringify(e);
|
|
531
575
|
} catch {
|
|
532
576
|
return String(e.length);
|
|
533
577
|
}
|
|
534
578
|
}
|
|
535
|
-
const
|
|
579
|
+
const Zr = {
|
|
536
580
|
publishLiveOptions: () => {
|
|
537
581
|
},
|
|
538
582
|
liveOptions: /* @__PURE__ */ new Map(),
|
|
@@ -541,23 +585,23 @@ const Lr = {
|
|
|
541
585
|
clearPendingChangeFields: () => {
|
|
542
586
|
}
|
|
543
587
|
};
|
|
544
|
-
function
|
|
545
|
-
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] =
|
|
588
|
+
function eo({ children: e }) {
|
|
589
|
+
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = E(0), [s, a] = E(() => /* @__PURE__ */ new Map()), [l, u] = E(
|
|
546
590
|
[]
|
|
547
591
|
), m = j(
|
|
548
592
|
(y, S) => {
|
|
549
593
|
const g = y.trim();
|
|
550
594
|
if (!g) return;
|
|
551
|
-
const k = S.map((
|
|
552
|
-
value: String(
|
|
553
|
-
label: String(
|
|
554
|
-
})),
|
|
555
|
-
n.current.get(g) !==
|
|
595
|
+
const k = S.map((p) => ({
|
|
596
|
+
value: String(p.value ?? ""),
|
|
597
|
+
label: String(p.label ?? p.value ?? "")
|
|
598
|
+
})), h = Qr(k);
|
|
599
|
+
n.current.get(g) !== h && (n.current.set(g, h), t.current.set(g, k), r.current.includes(g) || (r.current = [...r.current, g]), a(new Map(t.current)), u(r.current), i((p) => p + 1));
|
|
556
600
|
},
|
|
557
601
|
[]
|
|
558
602
|
), d = j(() => {
|
|
559
|
-
r.current = [],
|
|
560
|
-
}, []), b =
|
|
603
|
+
r.current = [], u([]);
|
|
604
|
+
}, []), b = V(
|
|
561
605
|
() => ({
|
|
562
606
|
publishLiveOptions: m,
|
|
563
607
|
liveOptions: s,
|
|
@@ -573,26 +617,26 @@ function jr({ children: e }) {
|
|
|
573
617
|
d
|
|
574
618
|
]
|
|
575
619
|
);
|
|
576
|
-
return /* @__PURE__ */
|
|
620
|
+
return /* @__PURE__ */ c(gn.Provider, { value: b, children: e });
|
|
577
621
|
}
|
|
578
|
-
function
|
|
579
|
-
return
|
|
622
|
+
function St() {
|
|
623
|
+
return Te(gn) ?? Zr;
|
|
580
624
|
}
|
|
581
|
-
const
|
|
582
|
-
function
|
|
625
|
+
const yn = _e({ interactive: !0 });
|
|
626
|
+
function mt({
|
|
583
627
|
interactive: e,
|
|
584
628
|
children: t
|
|
585
629
|
}) {
|
|
586
|
-
return /* @__PURE__ */
|
|
630
|
+
return /* @__PURE__ */ c(yn.Provider, { value: { interactive: e }, children: t });
|
|
587
631
|
}
|
|
588
632
|
function se() {
|
|
589
|
-
return
|
|
633
|
+
return Te(yn);
|
|
590
634
|
}
|
|
591
|
-
const
|
|
592
|
-
function
|
|
635
|
+
const vn = _e(null);
|
|
636
|
+
function to(e) {
|
|
593
637
|
return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
594
638
|
}
|
|
595
|
-
const
|
|
639
|
+
const no = {
|
|
596
640
|
reportEvent: () => {
|
|
597
641
|
},
|
|
598
642
|
reportData: () => {
|
|
@@ -600,7 +644,7 @@ const Dr = {
|
|
|
600
644
|
runAutoControl: (e) => e(),
|
|
601
645
|
isAutoControl: () => !1
|
|
602
646
|
};
|
|
603
|
-
function
|
|
647
|
+
function ro(e) {
|
|
604
648
|
const t = {};
|
|
605
649
|
for (const [n, r] of Object.entries(e.form_values ?? {}))
|
|
606
650
|
r !== void 0 && (t[n] = r);
|
|
@@ -610,40 +654,40 @@ function Hr(e) {
|
|
|
610
654
|
form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
|
|
611
655
|
};
|
|
612
656
|
}
|
|
613
|
-
function
|
|
657
|
+
function oo({
|
|
614
658
|
client: e,
|
|
615
659
|
children: t
|
|
616
660
|
}) {
|
|
617
661
|
const n = A(0), r = A(e);
|
|
618
662
|
r.current = e;
|
|
619
|
-
const o = j((
|
|
663
|
+
const o = j((u) => {
|
|
620
664
|
const m = r.current;
|
|
621
665
|
if (!m) return;
|
|
622
666
|
const d = {
|
|
623
|
-
action:
|
|
624
|
-
component:
|
|
667
|
+
action: u.action,
|
|
668
|
+
component: u.component
|
|
625
669
|
};
|
|
626
|
-
|
|
670
|
+
u.field !== void 0 && (d.field = u.field), u.value !== void 0 && (d.value = u.value);
|
|
627
671
|
const b = n.current > 0 ? "form_auto_control_bac_event" : "form_runtime_event";
|
|
628
672
|
m.send(b, d);
|
|
629
|
-
}, []), i = j((
|
|
673
|
+
}, []), i = j((u) => {
|
|
630
674
|
const m = r.current;
|
|
631
|
-
m && m.send("form_runtime_data",
|
|
632
|
-
}, []), s = j((
|
|
675
|
+
m && m.send("form_runtime_data", ro(u));
|
|
676
|
+
}, []), s = j((u) => {
|
|
633
677
|
n.current += 1;
|
|
634
678
|
let m;
|
|
635
679
|
try {
|
|
636
|
-
m =
|
|
680
|
+
m = u();
|
|
637
681
|
} catch (d) {
|
|
638
682
|
throw n.current = Math.max(0, n.current - 1), d;
|
|
639
683
|
}
|
|
640
|
-
return
|
|
684
|
+
return to(m) ? Promise.resolve(m).finally(() => {
|
|
641
685
|
n.current = Math.max(0, n.current - 1);
|
|
642
686
|
}) : (n.current = Math.max(0, n.current - 1), m);
|
|
643
687
|
}, []), a = j(
|
|
644
688
|
() => n.current > 0,
|
|
645
689
|
[]
|
|
646
|
-
), l =
|
|
690
|
+
), l = V(
|
|
647
691
|
() => ({
|
|
648
692
|
reportEvent: o,
|
|
649
693
|
reportData: i,
|
|
@@ -652,85 +696,85 @@ function Kr({
|
|
|
652
696
|
}),
|
|
653
697
|
[o, i, s, a]
|
|
654
698
|
);
|
|
655
|
-
return /* @__PURE__ */
|
|
699
|
+
return /* @__PURE__ */ c(vn.Provider, { value: l, children: t });
|
|
656
700
|
}
|
|
657
|
-
function
|
|
658
|
-
return
|
|
701
|
+
function bn() {
|
|
702
|
+
return Te(vn) ?? no;
|
|
659
703
|
}
|
|
660
|
-
const
|
|
661
|
-
function
|
|
704
|
+
const io = 300;
|
|
705
|
+
function Sn(e) {
|
|
662
706
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
663
707
|
}
|
|
664
|
-
function
|
|
708
|
+
function so(e) {
|
|
665
709
|
if (!e) return;
|
|
666
710
|
const t = e.trim();
|
|
667
711
|
if (t)
|
|
668
712
|
return t.startsWith("/") ? t.slice(1) : t;
|
|
669
713
|
}
|
|
670
|
-
function
|
|
714
|
+
function Yt(e, t = "value") {
|
|
671
715
|
const r = e.componentModel.properties[t];
|
|
672
|
-
if (!(!
|
|
716
|
+
if (!(!Sn(r) || r === void 0))
|
|
673
717
|
return e.dataContext.resolveDynamicValue(r);
|
|
674
718
|
}
|
|
675
719
|
function ae(e, t = "value", n = {}) {
|
|
676
|
-
const o = e.componentModel.properties[t], i =
|
|
720
|
+
const o = e.componentModel.properties[t], i = Sn(o), s = so(i), a = bn(), {
|
|
677
721
|
component: l = "Unknown",
|
|
678
|
-
changeAction:
|
|
722
|
+
changeAction: u = "change",
|
|
679
723
|
debounceChange: m = !1
|
|
680
724
|
} = n, d = A(null), b = A(void 0), y = A(!1), S = A(a);
|
|
681
725
|
S.current = a;
|
|
682
|
-
const g = A(
|
|
683
|
-
g.current =
|
|
726
|
+
const g = A(u);
|
|
727
|
+
g.current = u;
|
|
684
728
|
const k = A(l);
|
|
685
729
|
k.current = l;
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
d.current != null && (clearTimeout(d.current), d.current = null), y.current &&
|
|
730
|
+
const h = A(s);
|
|
731
|
+
h.current = s, B(() => () => {
|
|
732
|
+
d.current != null && (clearTimeout(d.current), d.current = null), y.current && h.current && (y.current = !1, S.current.reportEvent({
|
|
689
733
|
action: g.current,
|
|
690
734
|
component: k.current,
|
|
691
|
-
field:
|
|
735
|
+
field: h.current,
|
|
692
736
|
value: b.current
|
|
693
737
|
}));
|
|
694
738
|
}, []);
|
|
695
|
-
const
|
|
696
|
-
(
|
|
739
|
+
const p = j(
|
|
740
|
+
(q) => {
|
|
697
741
|
if (!i || o === void 0) return () => {
|
|
698
742
|
};
|
|
699
|
-
const
|
|
700
|
-
return () =>
|
|
743
|
+
const L = e.dataContext.subscribeDynamicValue(o, () => q());
|
|
744
|
+
return () => L.unsubscribe();
|
|
701
745
|
},
|
|
702
746
|
[e, o, i]
|
|
703
747
|
), v = j(() => {
|
|
704
748
|
if (!(!i || o === void 0))
|
|
705
749
|
return e.dataContext.resolveDynamicValue(o);
|
|
706
|
-
}, [e, o, i]),
|
|
707
|
-
(
|
|
750
|
+
}, [e, o, i]), M = Gn(p, v, v), N = j(
|
|
751
|
+
(q) => {
|
|
708
752
|
if (!s) return;
|
|
709
|
-
const
|
|
753
|
+
const L = () => {
|
|
710
754
|
y.current = !1, S.current.reportEvent({
|
|
711
|
-
action:
|
|
755
|
+
action: u,
|
|
712
756
|
component: l,
|
|
713
757
|
field: s,
|
|
714
|
-
value:
|
|
758
|
+
value: q
|
|
715
759
|
});
|
|
716
760
|
};
|
|
717
761
|
if (!m) {
|
|
718
|
-
|
|
762
|
+
L();
|
|
719
763
|
return;
|
|
720
764
|
}
|
|
721
|
-
b.current =
|
|
722
|
-
d.current = null,
|
|
723
|
-
},
|
|
765
|
+
b.current = q, y.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
766
|
+
d.current = null, L();
|
|
767
|
+
}, io);
|
|
724
768
|
},
|
|
725
|
-
[s,
|
|
769
|
+
[s, u, l, m]
|
|
726
770
|
), _ = j(
|
|
727
|
-
(
|
|
728
|
-
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path),
|
|
771
|
+
(q) => {
|
|
772
|
+
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path), q);
|
|
729
773
|
},
|
|
730
774
|
[e, o, i]
|
|
731
775
|
), z = j(
|
|
732
|
-
(
|
|
733
|
-
_(
|
|
776
|
+
(q) => {
|
|
777
|
+
_(q), N(q);
|
|
734
778
|
},
|
|
735
779
|
[_, N]
|
|
736
780
|
), C = j(() => {
|
|
@@ -741,7 +785,7 @@ function ae(e, t = "value", n = {}) {
|
|
|
741
785
|
});
|
|
742
786
|
}, [s, l]);
|
|
743
787
|
return {
|
|
744
|
-
value:
|
|
788
|
+
value: M,
|
|
745
789
|
setValue: z,
|
|
746
790
|
/** 写入 dataModel 但不上报(用于模式切换规范化等内部同步) */
|
|
747
791
|
setValueSilent: _,
|
|
@@ -750,45 +794,45 @@ function ae(e, t = "value", n = {}) {
|
|
|
750
794
|
reportFocus: C
|
|
751
795
|
};
|
|
752
796
|
}
|
|
753
|
-
function
|
|
797
|
+
function Ce(e) {
|
|
754
798
|
if (typeof e == "string") return e || void 0;
|
|
755
799
|
if (typeof e == "number") return String(e);
|
|
756
800
|
}
|
|
757
801
|
function Q(e) {
|
|
758
802
|
return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
|
|
759
803
|
}
|
|
760
|
-
function
|
|
804
|
+
function kn(e, t) {
|
|
761
805
|
return t ? Array.isArray(e) ? null : Q(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
|
|
762
806
|
}
|
|
763
|
-
function
|
|
807
|
+
function Oe(e) {
|
|
764
808
|
if (e == null) return;
|
|
765
809
|
const t = typeof e == "number" ? e : Number(e);
|
|
766
810
|
if (!(!Number.isFinite(t) || t < 1))
|
|
767
811
|
return Math.floor(t);
|
|
768
812
|
}
|
|
769
|
-
function
|
|
813
|
+
function Cn(e, t, n, r) {
|
|
770
814
|
return e.includes(t) ? e.filter((i) => i !== t) : r === 1 ? [t] : r !== void 0 && e.length >= r ? null : [...e, t];
|
|
771
815
|
}
|
|
772
|
-
function
|
|
816
|
+
function An(e, t, n, r, o) {
|
|
773
817
|
return n ? e.includes(t) || o === 1 ? !1 : o !== void 0 && e.length >= o : !0;
|
|
774
818
|
}
|
|
775
|
-
function
|
|
819
|
+
function _n(e, t) {
|
|
776
820
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
777
821
|
}
|
|
778
|
-
const
|
|
779
|
-
function
|
|
822
|
+
const Tn = _e(null);
|
|
823
|
+
function dt({
|
|
780
824
|
caseSearch: e,
|
|
781
825
|
children: t
|
|
782
826
|
}) {
|
|
783
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ c(Tn.Provider, { value: e ?? null, children: t });
|
|
784
828
|
}
|
|
785
|
-
function
|
|
786
|
-
return
|
|
829
|
+
function ao() {
|
|
830
|
+
return Te(Tn);
|
|
787
831
|
}
|
|
788
|
-
function
|
|
832
|
+
function tt(e) {
|
|
789
833
|
return typeof e == "string" ? e : "";
|
|
790
834
|
}
|
|
791
|
-
function
|
|
835
|
+
function lo(e) {
|
|
792
836
|
if (Array.isArray(e)) return e.map(String).filter(Boolean);
|
|
793
837
|
if (typeof e == "string" && e.trim())
|
|
794
838
|
try {
|
|
@@ -798,40 +842,40 @@ function Yr(e) {
|
|
|
798
842
|
}
|
|
799
843
|
return [];
|
|
800
844
|
}
|
|
801
|
-
function
|
|
845
|
+
function nt(e) {
|
|
802
846
|
if (!e || typeof e != "object")
|
|
803
847
|
return { flowUniqueIds: [], pageSize: 20 };
|
|
804
|
-
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, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l =
|
|
848
|
+
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, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l = lo(t.flowUniqueIds);
|
|
805
849
|
return { agentKind: o, agentUniqueId: i, flowType: s, category: a, flowUniqueIds: l, pageSize: r };
|
|
806
850
|
}
|
|
807
|
-
function
|
|
851
|
+
function rt(e) {
|
|
808
852
|
var r;
|
|
809
853
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
|
|
810
854
|
return t || n;
|
|
811
855
|
}
|
|
812
|
-
function
|
|
856
|
+
function co(e) {
|
|
813
857
|
return JSON.stringify(e);
|
|
814
858
|
}
|
|
815
|
-
const
|
|
859
|
+
const uo = {
|
|
816
860
|
name: "SkoponCaseSelect",
|
|
817
|
-
schema:
|
|
818
|
-
label:
|
|
819
|
-
placeholder:
|
|
820
|
-
help:
|
|
821
|
-
enableRefresh:
|
|
822
|
-
caseFilter:
|
|
823
|
-
minCount:
|
|
824
|
-
maxCount:
|
|
825
|
-
value:
|
|
861
|
+
schema: f.object({
|
|
862
|
+
label: f.any().optional(),
|
|
863
|
+
placeholder: f.any().optional(),
|
|
864
|
+
help: f.any().optional(),
|
|
865
|
+
enableRefresh: f.any().optional(),
|
|
866
|
+
caseFilter: f.any().optional(),
|
|
867
|
+
minCount: f.any().optional(),
|
|
868
|
+
maxCount: f.any().optional(),
|
|
869
|
+
value: f.any().optional()
|
|
826
870
|
}).passthrough()
|
|
827
871
|
};
|
|
828
|
-
function
|
|
872
|
+
function mo({
|
|
829
873
|
item: e,
|
|
830
874
|
selected: t,
|
|
831
875
|
disabled: n,
|
|
832
876
|
onToggle: r
|
|
833
877
|
}) {
|
|
834
|
-
return /* @__PURE__ */
|
|
878
|
+
return /* @__PURE__ */ x(
|
|
835
879
|
"button",
|
|
836
880
|
{
|
|
837
881
|
type: "button",
|
|
@@ -839,11 +883,11 @@ function Zr({
|
|
|
839
883
|
disabled: n,
|
|
840
884
|
onClick: r,
|
|
841
885
|
children: [
|
|
842
|
-
/* @__PURE__ */
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
e.description ? /* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ c(rn, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
|
|
887
|
+
/* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
|
|
888
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-name", children: e.name }),
|
|
889
|
+
e.description ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
|
|
890
|
+
/* @__PURE__ */ x("div", { className: "skopon-resume-select-card-meta", children: [
|
|
847
891
|
e.caseUniqueId,
|
|
848
892
|
e.platform ? ` · ${e.platform}` : "",
|
|
849
893
|
e.link ? ` · ${e.link}` : ""
|
|
@@ -853,121 +897,121 @@ function Zr({
|
|
|
853
897
|
}
|
|
854
898
|
);
|
|
855
899
|
}
|
|
856
|
-
function
|
|
857
|
-
const { interactive: t } = se(), n =
|
|
900
|
+
function po({ context: e }) {
|
|
901
|
+
const { interactive: t } = se(), n = ao(), { publishLiveOptions: r } = St(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
858
902
|
component: "SkoponCaseSelect",
|
|
859
903
|
changeAction: "click"
|
|
860
|
-
}), l = e.componentModel.properties,
|
|
861
|
-
|
|
862
|
-
const T =
|
|
904
|
+
}), l = e.componentModel.properties, u = tt(l.label), m = tt(l.placeholder), d = tt(l.help), b = l.enableRefresh !== !1, y = Oe(l.minCount), S = Oe(l.maxCount), g = V(() => nt(l.caseFilter), [l.caseFilter]), k = co(g), [h, p] = E(1), [v, M] = E(!1), [N, _] = E(""), [z, C] = E([]), [q, L] = E(0), [re, K] = E(g.pageSize ?? 20), $ = A(0), Y = Q(o);
|
|
905
|
+
B(() => {
|
|
906
|
+
const T = _n(Y, S);
|
|
863
907
|
T !== null && s(T);
|
|
864
|
-
}, [S,
|
|
865
|
-
const
|
|
908
|
+
}, [S, Y, s]);
|
|
909
|
+
const te = V(() => n ? rt(g) ? N || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, N, m]), ne = j(
|
|
866
910
|
async (T) => {
|
|
867
|
-
const D =
|
|
868
|
-
if (!n || !
|
|
869
|
-
C([]),
|
|
911
|
+
const D = nt(JSON.parse(k)), R = ++$.current;
|
|
912
|
+
if (!n || !rt(D)) {
|
|
913
|
+
C([]), L(0), _(""), M(!1);
|
|
870
914
|
return;
|
|
871
915
|
}
|
|
872
|
-
|
|
916
|
+
M(!0), _("");
|
|
873
917
|
try {
|
|
874
|
-
const
|
|
875
|
-
if (
|
|
876
|
-
C(
|
|
918
|
+
const I = await n({ filter: D, page: T });
|
|
919
|
+
if (R !== $.current) return;
|
|
920
|
+
C(I.list), L(I.total), p(I.page), K(I.pageSize), a && r(
|
|
877
921
|
a,
|
|
878
|
-
|
|
879
|
-
value:
|
|
880
|
-
label:
|
|
922
|
+
I.list.map((X) => ({
|
|
923
|
+
value: X.caseUniqueId,
|
|
924
|
+
label: X.name || X.caseUniqueId
|
|
881
925
|
}))
|
|
882
926
|
);
|
|
883
|
-
} catch (
|
|
884
|
-
if (
|
|
885
|
-
C([]),
|
|
927
|
+
} catch (I) {
|
|
928
|
+
if (R !== $.current) return;
|
|
929
|
+
C([]), L(0), _(I instanceof Error ? I.message : "加载案例列表失败");
|
|
886
930
|
} finally {
|
|
887
|
-
|
|
931
|
+
R === $.current && M(!1);
|
|
888
932
|
}
|
|
889
933
|
},
|
|
890
934
|
[n, k, a, r]
|
|
891
935
|
);
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
}, [k,
|
|
895
|
-
const
|
|
936
|
+
B(() => {
|
|
937
|
+
p(1), ne(1);
|
|
938
|
+
}, [k, ne]);
|
|
939
|
+
const U = (T) => {
|
|
896
940
|
if (!t) return;
|
|
897
|
-
const D =
|
|
898
|
-
|
|
941
|
+
const D = Cn(
|
|
942
|
+
Y,
|
|
899
943
|
T,
|
|
900
944
|
y,
|
|
901
945
|
S
|
|
902
946
|
);
|
|
903
947
|
D !== null && i(D);
|
|
904
948
|
}, P = () => {
|
|
905
|
-
const T =
|
|
906
|
-
|
|
949
|
+
const T = nt(JSON.parse(k)), D = re || T.pageSize || 20, R = Math.max(1, Math.ceil(q / D)), I = h >= R ? 1 : h + 1;
|
|
950
|
+
ne(I);
|
|
907
951
|
};
|
|
908
|
-
return /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ x(
|
|
909
953
|
"div",
|
|
910
954
|
{
|
|
911
955
|
className: "form-block-preview skopon-resume-select",
|
|
912
956
|
"data-skopon-field": a || void 0,
|
|
913
957
|
children: [
|
|
914
|
-
|
|
915
|
-
v && z.length === 0 ? /* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
958
|
+
u ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: u }) : null,
|
|
959
|
+
v && z.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
|
|
960
|
+
/* @__PURE__ */ c(yt, { size: "small" }),
|
|
917
961
|
" 加载案例…"
|
|
918
962
|
] }) : null,
|
|
919
|
-
!v && z.length === 0 ? /* @__PURE__ */
|
|
920
|
-
z.length > 0 ? /* @__PURE__ */
|
|
921
|
-
|
|
963
|
+
!v && z.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: te }) : null,
|
|
964
|
+
z.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ c(
|
|
965
|
+
mo,
|
|
922
966
|
{
|
|
923
967
|
item: T,
|
|
924
|
-
selected:
|
|
925
|
-
disabled:
|
|
926
|
-
|
|
968
|
+
selected: Y.includes(T.caseUniqueId),
|
|
969
|
+
disabled: An(
|
|
970
|
+
Y,
|
|
927
971
|
T.caseUniqueId,
|
|
928
972
|
t,
|
|
929
973
|
y,
|
|
930
974
|
S
|
|
931
975
|
),
|
|
932
|
-
onToggle: () =>
|
|
976
|
+
onToggle: () => U(T.caseUniqueId)
|
|
933
977
|
},
|
|
934
978
|
T.caseUniqueId
|
|
935
979
|
)) }) : null,
|
|
936
|
-
b && n &&
|
|
937
|
-
|
|
980
|
+
b && n && rt(g) ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
|
|
981
|
+
xe,
|
|
938
982
|
{
|
|
939
983
|
type: "default",
|
|
940
984
|
size: "small",
|
|
941
|
-
icon: /* @__PURE__ */
|
|
985
|
+
icon: /* @__PURE__ */ c(nn, {}),
|
|
942
986
|
loading: v,
|
|
943
987
|
disabled: !t,
|
|
944
988
|
onClick: P,
|
|
945
989
|
children: "换一批"
|
|
946
990
|
}
|
|
947
991
|
) }) : null,
|
|
948
|
-
d ? /* @__PURE__ */
|
|
992
|
+
d ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
|
|
949
993
|
]
|
|
950
994
|
}
|
|
951
995
|
);
|
|
952
996
|
}
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
),
|
|
997
|
+
const fo = J(
|
|
998
|
+
uo,
|
|
999
|
+
po
|
|
1000
|
+
), ho = {
|
|
957
1001
|
type: "case_multiselect",
|
|
958
1002
|
componentName: "SkoponCaseSelect",
|
|
959
|
-
toComponent:
|
|
960
|
-
fromComponent:
|
|
961
|
-
catalogComponents: [
|
|
1003
|
+
toComponent: Yr,
|
|
1004
|
+
fromComponent: Xr,
|
|
1005
|
+
catalogComponents: [fo]
|
|
962
1006
|
};
|
|
963
|
-
function
|
|
1007
|
+
function Xt(e) {
|
|
964
1008
|
if (e == null) return;
|
|
965
1009
|
const t = typeof e == "number" ? e : Number(e);
|
|
966
1010
|
if (!(!Number.isFinite(t) || t < 1))
|
|
967
1011
|
return Math.floor(t);
|
|
968
1012
|
}
|
|
969
|
-
function
|
|
970
|
-
var s, a, l,
|
|
1013
|
+
function go(e, t) {
|
|
1014
|
+
var s, a, l, u;
|
|
971
1015
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
972
1016
|
return i({
|
|
973
1017
|
id: n,
|
|
@@ -980,14 +1024,14 @@ function ro(e, t) {
|
|
|
980
1024
|
names: ((s = e.resumeFilter) == null ? void 0 : s.names) ?? [],
|
|
981
1025
|
agentUniqueIds: ((a = e.resumeFilter) == null ? void 0 : a.agentUniqueIds) ?? [],
|
|
982
1026
|
resumeUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.resumeUniqueIds) ?? [],
|
|
983
|
-
pageSize: ((
|
|
1027
|
+
pageSize: ((u = e.resumeFilter) == null ? void 0 : u.pageSize) ?? 20
|
|
984
1028
|
},
|
|
985
1029
|
...e.resumeMinCount !== void 0 ? { minCount: e.resumeMinCount } : {},
|
|
986
1030
|
...e.resumeMaxCount !== void 0 ? { maxCount: e.resumeMaxCount } : {},
|
|
987
1031
|
value: { path: o }
|
|
988
1032
|
});
|
|
989
1033
|
}
|
|
990
|
-
function
|
|
1034
|
+
function yo(e, t, n) {
|
|
991
1035
|
const r = n.nameFromValue(e.value), o = {
|
|
992
1036
|
...t("resume_multiselect"),
|
|
993
1037
|
name: r,
|
|
@@ -996,87 +1040,87 @@ function oo(e, t, n) {
|
|
|
996
1040
|
i && (o.placeholder = i);
|
|
997
1041
|
const s = n.asLiteral(e.help);
|
|
998
1042
|
if (s && (o.help = s), e.resumeFilter && typeof e.resumeFilter == "object") {
|
|
999
|
-
const
|
|
1043
|
+
const u = e.resumeFilter;
|
|
1000
1044
|
o.resumeFilter = {
|
|
1001
|
-
names: Array.isArray(
|
|
1002
|
-
agentUniqueIds: Array.isArray(
|
|
1003
|
-
resumeUniqueIds: Array.isArray(
|
|
1004
|
-
pageSize: typeof
|
|
1045
|
+
names: Array.isArray(u.names) ? u.names.map(String) : [],
|
|
1046
|
+
agentUniqueIds: Array.isArray(u.agentUniqueIds) ? u.agentUniqueIds.map(String) : [],
|
|
1047
|
+
resumeUniqueIds: Array.isArray(u.resumeUniqueIds) ? u.resumeUniqueIds.map(String) : [],
|
|
1048
|
+
pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
|
|
1005
1049
|
};
|
|
1006
1050
|
}
|
|
1007
|
-
const a =
|
|
1051
|
+
const a = Xt(e.minCount);
|
|
1008
1052
|
a !== void 0 && (o.resumeMinCount = a);
|
|
1009
|
-
const l =
|
|
1053
|
+
const l = Xt(e.maxCount);
|
|
1010
1054
|
return l !== void 0 && (o.resumeMaxCount = l), o;
|
|
1011
1055
|
}
|
|
1012
|
-
const
|
|
1013
|
-
function
|
|
1056
|
+
const xn = _e(null);
|
|
1057
|
+
function pt({
|
|
1014
1058
|
resumeSearch: e,
|
|
1015
1059
|
children: t
|
|
1016
1060
|
}) {
|
|
1017
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ c(xn.Provider, { value: e ?? null, children: t });
|
|
1018
1062
|
}
|
|
1019
|
-
function
|
|
1020
|
-
return
|
|
1063
|
+
function vo() {
|
|
1064
|
+
return Te(xn);
|
|
1021
1065
|
}
|
|
1022
|
-
function
|
|
1066
|
+
function ot(e) {
|
|
1023
1067
|
return typeof e == "string" ? e : "";
|
|
1024
1068
|
}
|
|
1025
|
-
function
|
|
1069
|
+
function it(e) {
|
|
1026
1070
|
if (!e || typeof e != "object")
|
|
1027
1071
|
return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
|
|
1028
1072
|
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), s = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
|
|
1029
1073
|
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: s };
|
|
1030
1074
|
}
|
|
1031
|
-
function
|
|
1075
|
+
function bo(e) {
|
|
1032
1076
|
return JSON.stringify(e);
|
|
1033
1077
|
}
|
|
1034
|
-
const
|
|
1078
|
+
const So = {
|
|
1035
1079
|
name: "SkoponResumeSelect",
|
|
1036
|
-
schema:
|
|
1037
|
-
label:
|
|
1038
|
-
placeholder:
|
|
1039
|
-
help:
|
|
1040
|
-
enableRefresh:
|
|
1041
|
-
resumeFilter:
|
|
1042
|
-
minCount:
|
|
1043
|
-
maxCount:
|
|
1044
|
-
value:
|
|
1080
|
+
schema: f.object({
|
|
1081
|
+
label: f.any().optional(),
|
|
1082
|
+
placeholder: f.any().optional(),
|
|
1083
|
+
help: f.any().optional(),
|
|
1084
|
+
enableRefresh: f.any().optional(),
|
|
1085
|
+
resumeFilter: f.any().optional(),
|
|
1086
|
+
minCount: f.any().optional(),
|
|
1087
|
+
maxCount: f.any().optional(),
|
|
1088
|
+
value: f.any().optional()
|
|
1045
1089
|
}).passthrough()
|
|
1046
|
-
},
|
|
1047
|
-
function
|
|
1048
|
-
const n = (t ?? []).filter(Boolean), r = n.slice(0,
|
|
1049
|
-
return /* @__PURE__ */
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
n.length > 0 ? /* @__PURE__ */
|
|
1052
|
-
r.map((i) => /* @__PURE__ */
|
|
1053
|
-
o > 0 ? /* @__PURE__ */
|
|
1090
|
+
}, ko = 3, Co = 2;
|
|
1091
|
+
function st(e, t) {
|
|
1092
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, ko), o = n.length - r.length;
|
|
1093
|
+
return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags", children: [
|
|
1094
|
+
/* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
1095
|
+
n.length > 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
1096
|
+
r.map((i) => /* @__PURE__ */ c(ve, { className: "skopon-resume-select-card-tag", children: i }, i)),
|
|
1097
|
+
o > 0 ? /* @__PURE__ */ x(ve, { className: "skopon-resume-select-card-tag", children: [
|
|
1054
1098
|
"+",
|
|
1055
1099
|
o
|
|
1056
1100
|
] }) : null
|
|
1057
|
-
] }) : /* @__PURE__ */
|
|
1101
|
+
] }) : /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
1058
1102
|
] });
|
|
1059
1103
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return /* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
-
/* @__PURE__ */
|
|
1104
|
+
function Ao(e) {
|
|
1105
|
+
return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-field", children: [
|
|
1106
|
+
/* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
1107
|
+
/* @__PURE__ */ c("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
1064
1108
|
] });
|
|
1065
1109
|
}
|
|
1066
|
-
function
|
|
1067
|
-
return /* @__PURE__ */
|
|
1068
|
-
/* @__PURE__ */
|
|
1069
|
-
/* @__PURE__ */
|
|
1110
|
+
function _o({ work: e }) {
|
|
1111
|
+
return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-work", children: [
|
|
1112
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ c("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ c(ar, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
1113
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
1070
1114
|
] });
|
|
1071
1115
|
}
|
|
1072
|
-
function
|
|
1116
|
+
function To({
|
|
1073
1117
|
item: e,
|
|
1074
1118
|
selected: t,
|
|
1075
1119
|
disabled: n,
|
|
1076
1120
|
onToggle: r
|
|
1077
1121
|
}) {
|
|
1078
|
-
const o = (e.works ?? []).slice(0,
|
|
1079
|
-
return /* @__PURE__ */
|
|
1122
|
+
const o = (e.works ?? []).slice(0, Co);
|
|
1123
|
+
return /* @__PURE__ */ x(
|
|
1080
1124
|
"button",
|
|
1081
1125
|
{
|
|
1082
1126
|
type: "button",
|
|
@@ -1084,185 +1128,331 @@ function fo({
|
|
|
1084
1128
|
disabled: n,
|
|
1085
1129
|
onClick: r,
|
|
1086
1130
|
children: [
|
|
1087
|
-
/* @__PURE__ */
|
|
1088
|
-
|
|
1131
|
+
/* @__PURE__ */ c(
|
|
1132
|
+
Xn,
|
|
1089
1133
|
{
|
|
1090
1134
|
size: 48,
|
|
1091
1135
|
src: e.avatarUrl || void 0,
|
|
1092
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */
|
|
1136
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ c(sr, {}),
|
|
1093
1137
|
className: "skopon-resume-select-card-avatar"
|
|
1094
1138
|
}
|
|
1095
1139
|
),
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
o.length > 0 ? /* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
1141
|
+
/* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
|
|
1142
|
+
Ao(e.satisfaction),
|
|
1143
|
+
st("性格", e.personality),
|
|
1144
|
+
st("专长", e.specialties),
|
|
1145
|
+
st("擅长领域", e.traits),
|
|
1146
|
+
/* @__PURE__ */ x("div", { className: "skopon-resume-select-card-works", children: [
|
|
1147
|
+
/* @__PURE__ */ c("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
|
|
1148
|
+
o.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ c(_o, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
|
|
1105
1149
|
] })
|
|
1106
1150
|
] })
|
|
1107
1151
|
]
|
|
1108
1152
|
}
|
|
1109
1153
|
);
|
|
1110
1154
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const { interactive: t } = se(), n =
|
|
1155
|
+
function xo({ context: e }) {
|
|
1156
|
+
const { interactive: t } = se(), n = vo(), { publishLiveOptions: r } = St(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
1113
1157
|
component: "SkoponResumeSelect",
|
|
1114
1158
|
changeAction: "click"
|
|
1115
|
-
}), l = e.componentModel.properties,
|
|
1116
|
-
|
|
1117
|
-
const T =
|
|
1159
|
+
}), l = e.componentModel.properties, u = ot(l.label), m = ot(l.placeholder), d = ot(l.help), b = l.enableRefresh !== !1, y = Oe(l.minCount), S = Oe(l.maxCount), g = V(() => it(l.resumeFilter), [l.resumeFilter]), k = bo(g), [h, p] = E(1), [v, M] = E(!1), [N, _] = E(""), [z, C] = E([]), [q, L] = E(0), [re, K] = E(g.pageSize ?? 20), $ = A(0), Y = Q(o);
|
|
1160
|
+
B(() => {
|
|
1161
|
+
const T = _n(Y, S);
|
|
1118
1162
|
T !== null && s(T);
|
|
1119
|
-
}, [S,
|
|
1120
|
-
const
|
|
1163
|
+
}, [S, Y, s]);
|
|
1164
|
+
const te = j(
|
|
1121
1165
|
async (T) => {
|
|
1122
|
-
const D =
|
|
1166
|
+
const D = it(JSON.parse(k)), R = ++$.current;
|
|
1123
1167
|
if (!n) {
|
|
1124
|
-
C([]),
|
|
1168
|
+
C([]), L(0), _("未配置简历搜索服务"), M(!1);
|
|
1125
1169
|
return;
|
|
1126
1170
|
}
|
|
1127
|
-
|
|
1171
|
+
M(!0), _("");
|
|
1128
1172
|
try {
|
|
1129
|
-
const
|
|
1130
|
-
if (
|
|
1131
|
-
C(
|
|
1173
|
+
const I = await n({ filter: D, page: T });
|
|
1174
|
+
if (R !== $.current) return;
|
|
1175
|
+
C(I.list), L(I.total), p(I.page), K(I.pageSize), a && r(
|
|
1132
1176
|
a,
|
|
1133
|
-
|
|
1134
|
-
value:
|
|
1135
|
-
label:
|
|
1177
|
+
I.list.map((X) => ({
|
|
1178
|
+
value: X.resumeUniqueId,
|
|
1179
|
+
label: X.name || X.resumeUniqueId
|
|
1136
1180
|
}))
|
|
1137
1181
|
);
|
|
1138
|
-
} catch (
|
|
1139
|
-
if (
|
|
1140
|
-
C([]),
|
|
1182
|
+
} catch (I) {
|
|
1183
|
+
if (R !== $.current) return;
|
|
1184
|
+
C([]), L(0), _(I instanceof Error ? I.message : "加载简历列表失败");
|
|
1141
1185
|
} finally {
|
|
1142
|
-
|
|
1186
|
+
R === $.current && M(!1);
|
|
1143
1187
|
}
|
|
1144
1188
|
},
|
|
1145
1189
|
[n, k, a, r]
|
|
1146
1190
|
);
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
}, [k,
|
|
1150
|
-
const
|
|
1191
|
+
B(() => {
|
|
1192
|
+
p(1), te(1);
|
|
1193
|
+
}, [k, te]);
|
|
1194
|
+
const ne = (T) => {
|
|
1151
1195
|
if (!t) return;
|
|
1152
|
-
const D =
|
|
1153
|
-
|
|
1196
|
+
const D = Cn(
|
|
1197
|
+
Y,
|
|
1154
1198
|
T,
|
|
1155
1199
|
y,
|
|
1156
1200
|
S
|
|
1157
1201
|
);
|
|
1158
1202
|
D !== null && i(D);
|
|
1159
|
-
},
|
|
1160
|
-
const T =
|
|
1161
|
-
|
|
1203
|
+
}, U = () => {
|
|
1204
|
+
const T = it(JSON.parse(k)), D = re || T.pageSize || 20, R = Math.max(1, Math.ceil(q / D)), I = h >= R ? 1 : h + 1;
|
|
1205
|
+
te(I);
|
|
1162
1206
|
}, P = m || "暂无匹配的简历";
|
|
1163
|
-
return /* @__PURE__ */
|
|
1207
|
+
return /* @__PURE__ */ x(
|
|
1164
1208
|
"div",
|
|
1165
1209
|
{
|
|
1166
1210
|
className: "form-block-preview skopon-resume-select",
|
|
1167
1211
|
"data-skopon-field": a || void 0,
|
|
1168
1212
|
children: [
|
|
1169
|
-
|
|
1170
|
-
v && z.length === 0 ? /* @__PURE__ */
|
|
1171
|
-
/* @__PURE__ */
|
|
1213
|
+
u ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: u }) : null,
|
|
1214
|
+
v && z.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
|
|
1215
|
+
/* @__PURE__ */ c(yt, { size: "small" }),
|
|
1172
1216
|
" 加载简历…"
|
|
1173
1217
|
] }) : null,
|
|
1174
|
-
!v && N ? /* @__PURE__ */
|
|
1175
|
-
!v && !N && z.length === 0 ? /* @__PURE__ */
|
|
1176
|
-
z.length > 0 ? /* @__PURE__ */
|
|
1177
|
-
|
|
1218
|
+
!v && N ? /* @__PURE__ */ c(ee.Text, { type: "danger", className: "skopon-resume-select-status", children: N }) : null,
|
|
1219
|
+
!v && !N && z.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: P }) : null,
|
|
1220
|
+
z.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ c(
|
|
1221
|
+
To,
|
|
1178
1222
|
{
|
|
1179
1223
|
item: T,
|
|
1180
|
-
selected:
|
|
1181
|
-
disabled:
|
|
1182
|
-
|
|
1224
|
+
selected: Y.includes(T.resumeUniqueId),
|
|
1225
|
+
disabled: An(
|
|
1226
|
+
Y,
|
|
1183
1227
|
T.resumeUniqueId,
|
|
1184
1228
|
t,
|
|
1185
1229
|
y,
|
|
1186
1230
|
S
|
|
1187
1231
|
),
|
|
1188
|
-
onToggle: () =>
|
|
1232
|
+
onToggle: () => ne(T.resumeUniqueId)
|
|
1189
1233
|
},
|
|
1190
1234
|
T.resumeUniqueId
|
|
1191
1235
|
)) }) : null,
|
|
1192
|
-
b && n ? /* @__PURE__ */
|
|
1193
|
-
|
|
1236
|
+
b && n ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
|
|
1237
|
+
xe,
|
|
1194
1238
|
{
|
|
1195
1239
|
type: "default",
|
|
1196
1240
|
size: "small",
|
|
1197
|
-
icon: /* @__PURE__ */
|
|
1241
|
+
icon: /* @__PURE__ */ c(nn, {}),
|
|
1198
1242
|
loading: v,
|
|
1199
1243
|
disabled: !t,
|
|
1200
|
-
onClick:
|
|
1244
|
+
onClick: U,
|
|
1201
1245
|
children: "换一批"
|
|
1202
1246
|
}
|
|
1203
1247
|
) }) : null,
|
|
1204
|
-
d ? /* @__PURE__ */
|
|
1248
|
+
d ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
|
|
1205
1249
|
]
|
|
1206
1250
|
}
|
|
1207
1251
|
);
|
|
1208
1252
|
}
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
),
|
|
1253
|
+
const Mo = J(
|
|
1254
|
+
So,
|
|
1255
|
+
xo
|
|
1256
|
+
), No = {
|
|
1213
1257
|
type: "resume_multiselect",
|
|
1214
1258
|
componentName: "SkoponResumeSelect",
|
|
1215
|
-
toComponent:
|
|
1216
|
-
fromComponent:
|
|
1217
|
-
catalogComponents: [
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1259
|
+
toComponent: go,
|
|
1260
|
+
fromComponent: yo,
|
|
1261
|
+
catalogComponents: [Mo]
|
|
1262
|
+
};
|
|
1263
|
+
function Fo(e, t) {
|
|
1264
|
+
var n;
|
|
1265
|
+
return {
|
|
1266
|
+
node: {
|
|
1267
|
+
id: t.id,
|
|
1268
|
+
component: "SkoponWeb",
|
|
1269
|
+
url: ((n = e.webUrl) == null ? void 0 : n.trim()) ?? "",
|
|
1270
|
+
height: Me(e.webHeight),
|
|
1271
|
+
label: t.label,
|
|
1272
|
+
help: e.help ?? ""
|
|
1273
|
+
}
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
function Io(e, t, n) {
|
|
1277
|
+
var o, i;
|
|
1278
|
+
const r = (o = n.asLiteral(e.help)) == null ? void 0 : o.trim();
|
|
1279
|
+
return {
|
|
1280
|
+
...t("web"),
|
|
1281
|
+
webUrl: ((i = n.asLiteral(e.url)) == null ? void 0 : i.trim()) ?? "",
|
|
1282
|
+
webHeight: Me(e.height),
|
|
1283
|
+
...r ? { help: r } : {}
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
function Qt({
|
|
1287
|
+
url: e,
|
|
1288
|
+
title: t,
|
|
1289
|
+
className: n,
|
|
1290
|
+
height: r,
|
|
1291
|
+
frameRef: o
|
|
1292
|
+
}) {
|
|
1293
|
+
return /* @__PURE__ */ c(
|
|
1294
|
+
"iframe",
|
|
1295
|
+
{
|
|
1296
|
+
ref: o,
|
|
1297
|
+
src: e,
|
|
1298
|
+
title: t,
|
|
1299
|
+
className: n,
|
|
1300
|
+
style: r === void 0 ? void 0 : { height: r },
|
|
1301
|
+
loading: "lazy",
|
|
1302
|
+
referrerPolicy: "strict-origin-when-cross-origin",
|
|
1303
|
+
allowFullScreen: !0
|
|
1304
|
+
}
|
|
1305
|
+
);
|
|
1306
|
+
}
|
|
1307
|
+
function Eo({
|
|
1308
|
+
url: e = "",
|
|
1309
|
+
height: t,
|
|
1310
|
+
label: n,
|
|
1311
|
+
help: r
|
|
1312
|
+
}) {
|
|
1313
|
+
const [o, i] = E(!1), [s, a] = E(!0), l = A(null), u = e.trim(), m = yr(u) ? u : null, d = Me(t), b = (n == null ? void 0 : n.trim()) || "网页展示", y = r == null ? void 0 : r.trim(), S = u ? "网页 URL 无效" : "未设置网页 URL";
|
|
1314
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview skopon-web-preview", children: [
|
|
1315
|
+
n != null && n.trim() ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: n.trim() }) : null,
|
|
1316
|
+
/* @__PURE__ */ x(
|
|
1317
|
+
"div",
|
|
1318
|
+
{
|
|
1319
|
+
className: `skopon-web-frame-shell${m ? "" : " skopon-web-frame-shell--empty"}`,
|
|
1320
|
+
style: { height: d },
|
|
1321
|
+
children: [
|
|
1322
|
+
m && s ? /* @__PURE__ */ c(
|
|
1323
|
+
Qt,
|
|
1324
|
+
{
|
|
1325
|
+
url: m,
|
|
1326
|
+
title: b,
|
|
1327
|
+
className: "skopon-web-frame skopon-web-frame--inline",
|
|
1328
|
+
height: d
|
|
1329
|
+
}
|
|
1330
|
+
) : null,
|
|
1331
|
+
m ? null : /* @__PURE__ */ c("div", { className: "skopon-web-empty", role: "status", children: S }),
|
|
1332
|
+
m ? /* @__PURE__ */ c(he, { title: "扩展显示", children: /* @__PURE__ */ c(
|
|
1333
|
+
xe,
|
|
1334
|
+
{
|
|
1335
|
+
type: "default",
|
|
1336
|
+
shape: "circle",
|
|
1337
|
+
className: "skopon-web-expand-button",
|
|
1338
|
+
icon: /* @__PURE__ */ c(lr, {}),
|
|
1339
|
+
"aria-label": "扩展显示",
|
|
1340
|
+
onClick: () => {
|
|
1341
|
+
a(!1), i(!0);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
) }) : null
|
|
1345
|
+
]
|
|
1346
|
+
}
|
|
1347
|
+
),
|
|
1348
|
+
y ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: y }) : null,
|
|
1349
|
+
/* @__PURE__ */ c(
|
|
1350
|
+
Qn,
|
|
1351
|
+
{
|
|
1352
|
+
open: o,
|
|
1353
|
+
title: b,
|
|
1354
|
+
footer: null,
|
|
1355
|
+
width: "min(1200px, calc(100vw - 32px))",
|
|
1356
|
+
className: "skopon-web-modal",
|
|
1357
|
+
destroyOnHidden: !0,
|
|
1358
|
+
mask: { closable: !0 },
|
|
1359
|
+
onCancel: () => {
|
|
1360
|
+
var g;
|
|
1361
|
+
(g = l.current) == null || g.removeAttribute("src"), i(!1), a(!0);
|
|
1362
|
+
},
|
|
1363
|
+
children: m && !s ? /* @__PURE__ */ c(
|
|
1364
|
+
Qt,
|
|
1365
|
+
{
|
|
1366
|
+
url: m,
|
|
1367
|
+
title: `${b}(扩展显示)`,
|
|
1368
|
+
className: "skopon-web-frame skopon-web-frame--modal",
|
|
1369
|
+
frameRef: l
|
|
1370
|
+
}
|
|
1371
|
+
) : null
|
|
1372
|
+
}
|
|
1373
|
+
)
|
|
1374
|
+
] });
|
|
1375
|
+
}
|
|
1376
|
+
const Uo = {
|
|
1377
|
+
name: "SkoponWeb",
|
|
1378
|
+
schema: f.object({
|
|
1379
|
+
url: f.any().optional(),
|
|
1380
|
+
height: f.any().optional(),
|
|
1381
|
+
label: f.any().optional(),
|
|
1382
|
+
help: f.any().optional()
|
|
1383
|
+
}).passthrough()
|
|
1384
|
+
}, Ro = J(
|
|
1385
|
+
Uo,
|
|
1386
|
+
({ context: e }) => {
|
|
1387
|
+
const t = e.componentModel.properties;
|
|
1388
|
+
return /* @__PURE__ */ c(
|
|
1389
|
+
Eo,
|
|
1390
|
+
{
|
|
1391
|
+
url: typeof t.url == "string" ? t.url : "",
|
|
1392
|
+
height: Me(t.height),
|
|
1393
|
+
label: typeof t.label == "string" ? t.label : "",
|
|
1394
|
+
help: typeof t.help == "string" ? t.help : ""
|
|
1395
|
+
}
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
), wo = {
|
|
1399
|
+
type: "web",
|
|
1400
|
+
componentName: "SkoponWeb",
|
|
1401
|
+
toComponent: Fo,
|
|
1402
|
+
fromComponent: Io,
|
|
1403
|
+
catalogComponents: [Ro]
|
|
1404
|
+
}, je = [
|
|
1405
|
+
No,
|
|
1406
|
+
ho,
|
|
1407
|
+
wo
|
|
1408
|
+
], Po = new Map(
|
|
1409
|
+
je.map((e) => [e.type, e])
|
|
1410
|
+
), zo = new Map(
|
|
1411
|
+
je.map((e) => [e.componentName, e])
|
|
1222
1412
|
);
|
|
1223
|
-
function
|
|
1224
|
-
return
|
|
1413
|
+
function Oo(e) {
|
|
1414
|
+
return Po.get(e);
|
|
1225
1415
|
}
|
|
1226
|
-
function
|
|
1227
|
-
return
|
|
1416
|
+
function Bo(e) {
|
|
1417
|
+
return zo.get(e);
|
|
1228
1418
|
}
|
|
1229
|
-
function
|
|
1230
|
-
return
|
|
1419
|
+
function qo() {
|
|
1420
|
+
return je.flatMap((e) => e.catalogComponents);
|
|
1231
1421
|
}
|
|
1232
|
-
function
|
|
1233
|
-
return
|
|
1422
|
+
function Lo() {
|
|
1423
|
+
return je.map((e) => e.componentName);
|
|
1234
1424
|
}
|
|
1235
|
-
const
|
|
1236
|
-
function
|
|
1425
|
+
const Be = "root", ft = "__title__", ht = "__desc__", kt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
1426
|
+
function Vo(e) {
|
|
1237
1427
|
return `/${e}`;
|
|
1238
1428
|
}
|
|
1239
|
-
function
|
|
1429
|
+
function Zt(e) {
|
|
1240
1430
|
return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
|
|
1241
1431
|
}
|
|
1242
1432
|
function H(e) {
|
|
1243
1433
|
if (typeof e == "string") return e;
|
|
1244
1434
|
}
|
|
1245
|
-
function
|
|
1435
|
+
function jo(e) {
|
|
1246
1436
|
const t = e.id || le("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
1247
1437
|
return {
|
|
1248
1438
|
id: t,
|
|
1249
1439
|
component: "SkoponMedia",
|
|
1250
1440
|
mediaType: n,
|
|
1251
|
-
urls:
|
|
1252
|
-
mediaSize:
|
|
1441
|
+
urls: zr(e),
|
|
1442
|
+
mediaSize: Fe(e.mediaSize),
|
|
1253
1443
|
label: e.label ?? "",
|
|
1254
1444
|
help: e.help ?? "",
|
|
1255
1445
|
placeholder: e.placeholder ?? ""
|
|
1256
1446
|
};
|
|
1257
1447
|
}
|
|
1258
|
-
function
|
|
1448
|
+
function $o(e) {
|
|
1259
1449
|
if (Array.isArray(e.urls))
|
|
1260
1450
|
return e.urls.map((n) => String(n).trim()).filter(Boolean);
|
|
1261
1451
|
const t = H(e.url);
|
|
1262
1452
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
1263
1453
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const r = typeof e.id == "string" ? e.id : le("block-"), o =
|
|
1454
|
+
function Re(e, t, n) {
|
|
1455
|
+
const r = typeof e.id == "string" ? e.id : le("block-"), o = $o(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = Fe(e.mediaSize);
|
|
1266
1456
|
return {
|
|
1267
1457
|
id: r,
|
|
1268
1458
|
type: t,
|
|
@@ -1273,10 +1463,10 @@ function Ie(e, t, n) {
|
|
|
1273
1463
|
mediaUrls: o.length > 0 ? o : [""]
|
|
1274
1464
|
};
|
|
1275
1465
|
}
|
|
1276
|
-
function
|
|
1466
|
+
function en(e) {
|
|
1277
1467
|
switch (e.type) {
|
|
1278
1468
|
case "toggle":
|
|
1279
|
-
return
|
|
1469
|
+
return Ie(e.defaultValue);
|
|
1280
1470
|
case "multiselect":
|
|
1281
1471
|
case "checkbox":
|
|
1282
1472
|
case "resume_multiselect":
|
|
@@ -1290,9 +1480,9 @@ function Gt(e) {
|
|
|
1290
1480
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
1291
1481
|
}
|
|
1292
1482
|
}
|
|
1293
|
-
function
|
|
1294
|
-
var
|
|
1295
|
-
const t = e.id || le("a2-"), n = e.label ?? "", r = ((
|
|
1483
|
+
function Do(e) {
|
|
1484
|
+
var u;
|
|
1485
|
+
const t = e.id || le("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Vo(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), s = (m) => r ? { node: m, dataKey: r, dataValue: en(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = Oo(e.type);
|
|
1296
1486
|
if (l)
|
|
1297
1487
|
return l.toComponent(e, a);
|
|
1298
1488
|
switch (e.type) {
|
|
@@ -1301,7 +1491,7 @@ function xo(e) {
|
|
|
1301
1491
|
case "paragraph":
|
|
1302
1492
|
return { node: { id: t, component: "Text", text: n, variant: "body" } };
|
|
1303
1493
|
case "text":
|
|
1304
|
-
return e.hidden ? r ? { node: null, dataKey: r, dataValue:
|
|
1494
|
+
return e.hidden ? r ? { node: null, dataKey: r, dataValue: en(e) } : { node: null } : s({
|
|
1305
1495
|
id: t,
|
|
1306
1496
|
component: "TextField",
|
|
1307
1497
|
label: n,
|
|
@@ -1325,7 +1515,7 @@ function xo(e) {
|
|
|
1325
1515
|
component: "TextField",
|
|
1326
1516
|
label: n,
|
|
1327
1517
|
variant: "shortText",
|
|
1328
|
-
validationRegexp:
|
|
1518
|
+
validationRegexp: kt,
|
|
1329
1519
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
1330
1520
|
value: { path: o }
|
|
1331
1521
|
});
|
|
@@ -1411,7 +1601,7 @@ function xo(e) {
|
|
|
1411
1601
|
case "image":
|
|
1412
1602
|
case "video":
|
|
1413
1603
|
case "audio":
|
|
1414
|
-
return { node:
|
|
1604
|
+
return { node: jo(e) };
|
|
1415
1605
|
case "file":
|
|
1416
1606
|
return s({
|
|
1417
1607
|
id: t,
|
|
@@ -1428,45 +1618,38 @@ function xo(e) {
|
|
|
1428
1618
|
return { node: null };
|
|
1429
1619
|
}
|
|
1430
1620
|
}
|
|
1431
|
-
function
|
|
1621
|
+
function gt(e) {
|
|
1432
1622
|
if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
|
|
1433
|
-
const t = e.components.find((r) => r.id ===
|
|
1623
|
+
const t = e.components.find((r) => r.id === Be);
|
|
1434
1624
|
if (!t) return e.components.length === 0;
|
|
1435
1625
|
const n = t.children;
|
|
1436
1626
|
return !Array.isArray(n) || n.length === 0;
|
|
1437
1627
|
}
|
|
1438
|
-
function
|
|
1628
|
+
function Mn(e, t) {
|
|
1439
1629
|
const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, s = (e.title ?? "").trim(), a = (e.description ?? "").trim();
|
|
1440
|
-
i && s && (n.push({ id:
|
|
1630
|
+
i && s && (n.push({ id: ft, component: "Text", text: s, variant: "h2" }), r.push(ft)), i && a && (n.push({ id: ht, component: "Text", text: a, variant: "body" }), r.push(ht));
|
|
1441
1631
|
for (const m of e.blocks ?? []) {
|
|
1442
|
-
|
|
1632
|
+
if (!ce(m)) continue;
|
|
1633
|
+
const { node: d, dataKey: b, dataValue: y } = Do(m);
|
|
1443
1634
|
b && (o[b] = y), d && (n.push(d), r.push(d.id));
|
|
1444
1635
|
}
|
|
1445
|
-
n.unshift({ id:
|
|
1446
|
-
const l = { root:
|
|
1447
|
-
return
|
|
1636
|
+
n.unshift({ id: Be, component: "Column", children: r });
|
|
1637
|
+
const l = { root: Be, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
|
|
1638
|
+
return u !== void 0 && (l.surfaceProperties = { styleId: u ?? null }), l;
|
|
1448
1639
|
}
|
|
1449
|
-
function
|
|
1640
|
+
function Ho(e) {
|
|
1450
1641
|
const t = /* @__PURE__ */ new Map();
|
|
1451
1642
|
for (const n of e.components ?? [])
|
|
1452
1643
|
n && typeof n.id == "string" && t.set(n.id, n);
|
|
1453
1644
|
return t;
|
|
1454
1645
|
}
|
|
1455
|
-
function
|
|
1456
|
-
|
|
1457
|
-
return Array.isArray(t) ? t.map((n) => {
|
|
1458
|
-
if (!n || typeof n != "object") return null;
|
|
1459
|
-
const r = n;
|
|
1460
|
-
return {
|
|
1461
|
-
value: String(r.value ?? r.label ?? ""),
|
|
1462
|
-
label: String(r.label ?? r.value ?? "")
|
|
1463
|
-
};
|
|
1464
|
-
}).filter((n) => !!n) : [];
|
|
1646
|
+
function at(e) {
|
|
1647
|
+
return Le(e.options);
|
|
1465
1648
|
}
|
|
1466
|
-
function
|
|
1467
|
-
const t = typeof e.id == "string" ? e.id : le("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o =
|
|
1649
|
+
function Ko(e) {
|
|
1650
|
+
const t = typeof e.id == "string" ? e.id : le("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o = Zt(e.value), i = (a) => ({ id: t, type: a, label: r }), s = Bo(n);
|
|
1468
1651
|
if (s)
|
|
1469
|
-
return s.fromComponent(e, i, { asLiteral: H, nameFromValue:
|
|
1652
|
+
return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Zt });
|
|
1470
1653
|
switch (n) {
|
|
1471
1654
|
case "Text": {
|
|
1472
1655
|
const a = String(e.variant ?? "body"), l = /^h[1-6]$/i.test(a) || a === "title" || a === "subtitle";
|
|
@@ -1475,19 +1658,19 @@ function No(e) {
|
|
|
1475
1658
|
case "TextField": {
|
|
1476
1659
|
const a = String(e.variant ?? "shortText");
|
|
1477
1660
|
let l = "text";
|
|
1478
|
-
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) ===
|
|
1479
|
-
const
|
|
1480
|
-
return m && (
|
|
1661
|
+
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) === kt && (l = "email");
|
|
1662
|
+
const u = { ...i(l), name: o }, m = H(e.placeholder);
|
|
1663
|
+
return m && (u.placeholder = m), u;
|
|
1481
1664
|
}
|
|
1482
1665
|
case "CheckBox":
|
|
1483
1666
|
return { ...i("toggle"), name: o };
|
|
1484
1667
|
case "SkoponSelect": {
|
|
1485
|
-
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select",
|
|
1668
|
+
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
|
|
1486
1669
|
...i(l),
|
|
1487
1670
|
name: o,
|
|
1488
|
-
options:
|
|
1671
|
+
options: at(e)
|
|
1489
1672
|
}, m = H(e.placeholder);
|
|
1490
|
-
return m && (
|
|
1673
|
+
return m && (u.placeholder = m), u;
|
|
1491
1674
|
}
|
|
1492
1675
|
case "ChoicePicker": {
|
|
1493
1676
|
const a = H(e.skoponPickerType);
|
|
@@ -1495,12 +1678,12 @@ function No(e) {
|
|
|
1495
1678
|
const m = {
|
|
1496
1679
|
...i(a),
|
|
1497
1680
|
name: o,
|
|
1498
|
-
options:
|
|
1681
|
+
options: at(e)
|
|
1499
1682
|
}, d = H(e.placeholder);
|
|
1500
1683
|
return d && (m.placeholder = d), m;
|
|
1501
1684
|
}
|
|
1502
|
-
const
|
|
1503
|
-
return { ...i(
|
|
1685
|
+
const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1686
|
+
return { ...i(u), name: o, options: at(e) };
|
|
1504
1687
|
}
|
|
1505
1688
|
case "DateTimeInput": {
|
|
1506
1689
|
const a = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!a && l ? "time" : "datetime"), name: o }, d = H(e.placeholder);
|
|
@@ -1508,23 +1691,23 @@ function No(e) {
|
|
|
1508
1691
|
}
|
|
1509
1692
|
case "SkoponMedia": {
|
|
1510
1693
|
const a = String(e.mediaType ?? "image");
|
|
1511
|
-
return
|
|
1694
|
+
return Re(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
|
|
1512
1695
|
}
|
|
1513
1696
|
case "Image":
|
|
1514
|
-
return
|
|
1697
|
+
return Re(e, "image", r);
|
|
1515
1698
|
case "Video":
|
|
1516
|
-
return
|
|
1699
|
+
return Re(e, "video", r);
|
|
1517
1700
|
case "AudioPlayer":
|
|
1518
|
-
return
|
|
1701
|
+
return Re(e, "audio", r);
|
|
1519
1702
|
case "FileUpload": {
|
|
1520
1703
|
const a = H(e.accept) ?? "", l = { ...i("file"), name: o };
|
|
1521
|
-
return a && (l.fileAcceptExtensions = a.split(",").map((
|
|
1704
|
+
return a && (l.fileAcceptExtensions = a.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (l.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (l.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (l.fileMinCount = e.minCount), typeof e.maxCount == "number" && (l.fileMaxCount = e.maxCount), l;
|
|
1522
1705
|
}
|
|
1523
1706
|
default:
|
|
1524
1707
|
return null;
|
|
1525
1708
|
}
|
|
1526
1709
|
}
|
|
1527
|
-
function
|
|
1710
|
+
function Nn(e, t, n, r) {
|
|
1528
1711
|
if (n.has(e)) return;
|
|
1529
1712
|
n.add(e);
|
|
1530
1713
|
const o = t.get(e);
|
|
@@ -1532,46 +1715,46 @@ function Sn(e, t, n, r) {
|
|
|
1532
1715
|
const i = String(o.component ?? "");
|
|
1533
1716
|
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
1534
1717
|
for (const s of o.children)
|
|
1535
|
-
typeof s == "string" &&
|
|
1718
|
+
typeof s == "string" && Nn(s, t, n, r);
|
|
1536
1719
|
return;
|
|
1537
1720
|
}
|
|
1538
1721
|
r.push(o);
|
|
1539
1722
|
}
|
|
1540
|
-
function
|
|
1723
|
+
function Wo(e, t) {
|
|
1541
1724
|
return t ? e.map((n) => {
|
|
1542
1725
|
var i;
|
|
1543
1726
|
const r = (i = n.name) == null ? void 0 : i.trim();
|
|
1544
1727
|
if (!r || !(r in t)) return n;
|
|
1545
1728
|
const o = t[r];
|
|
1546
|
-
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue:
|
|
1729
|
+
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: Ie(o) } : { ...n, defaultValue: o };
|
|
1547
1730
|
}) : e;
|
|
1548
1731
|
}
|
|
1549
|
-
function
|
|
1732
|
+
function Go(e) {
|
|
1550
1733
|
if (!e || !Array.isArray(e.components))
|
|
1551
|
-
return
|
|
1552
|
-
const t =
|
|
1553
|
-
|
|
1734
|
+
return ke({ title: "", description: "", blocks: [] });
|
|
1735
|
+
const t = Ho(e), n = [];
|
|
1736
|
+
Nn(e.root ?? Be, t, /* @__PURE__ */ new Set(), n);
|
|
1554
1737
|
let r = "", o = "";
|
|
1555
1738
|
const i = [];
|
|
1556
1739
|
for (const s of n) {
|
|
1557
|
-
if (s.id ===
|
|
1740
|
+
if (s.id === ft) {
|
|
1558
1741
|
r = H(s.text) ?? r;
|
|
1559
1742
|
continue;
|
|
1560
1743
|
}
|
|
1561
|
-
if (s.id ===
|
|
1744
|
+
if (s.id === ht) {
|
|
1562
1745
|
o = H(s.text) ?? o;
|
|
1563
1746
|
continue;
|
|
1564
1747
|
}
|
|
1565
|
-
const a =
|
|
1748
|
+
const a = Ko(s);
|
|
1566
1749
|
a && i.push(a);
|
|
1567
1750
|
}
|
|
1568
|
-
return
|
|
1751
|
+
return ke({
|
|
1569
1752
|
title: r,
|
|
1570
1753
|
description: o,
|
|
1571
|
-
blocks:
|
|
1754
|
+
blocks: Wo(i, e.dataModel)
|
|
1572
1755
|
});
|
|
1573
1756
|
}
|
|
1574
|
-
function
|
|
1757
|
+
function Jo(e, t) {
|
|
1575
1758
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1576
1759
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1577
1760
|
{
|
|
@@ -1584,25 +1767,25 @@ function Eo(e, t) {
|
|
|
1584
1767
|
updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
|
|
1585
1768
|
}), o;
|
|
1586
1769
|
}
|
|
1587
|
-
function
|
|
1770
|
+
function Fn(e) {
|
|
1588
1771
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1589
1772
|
}
|
|
1590
|
-
function
|
|
1773
|
+
function Yo(e, t) {
|
|
1591
1774
|
if (!e || typeof e != "object") return null;
|
|
1592
|
-
const n = e, r =
|
|
1593
|
-
if (r && !
|
|
1775
|
+
const n = e, r = Fn(n.a2ui) ? n.a2ui : void 0;
|
|
1776
|
+
if (r && !gt(r)) return r;
|
|
1594
1777
|
const o = Array.isArray(n.blocks) ? n.blocks : [];
|
|
1595
1778
|
if (o.length === 0) return null;
|
|
1596
|
-
const i =
|
|
1779
|
+
const i = Ve({
|
|
1597
1780
|
title: typeof n.title == "string" ? n.title : "",
|
|
1598
1781
|
description: typeof n.description == "string" ? n.description : "",
|
|
1599
1782
|
blocks: o,
|
|
1600
|
-
jsonSchema:
|
|
1601
|
-
}), s =
|
|
1602
|
-
return
|
|
1783
|
+
jsonSchema: fn(n.jsonSchema ?? n.json_schema)
|
|
1784
|
+
}), s = Mn(i, t);
|
|
1785
|
+
return gt(s) ? null : s;
|
|
1603
1786
|
}
|
|
1604
|
-
function
|
|
1605
|
-
return
|
|
1787
|
+
function Xo(e, t, n) {
|
|
1788
|
+
return Mn(
|
|
1606
1789
|
{
|
|
1607
1790
|
title: e.title,
|
|
1608
1791
|
description: e.description,
|
|
@@ -1611,18 +1794,18 @@ function Ro(e, t, n) {
|
|
|
1611
1794
|
n
|
|
1612
1795
|
);
|
|
1613
1796
|
}
|
|
1614
|
-
function
|
|
1797
|
+
function Qo(e) {
|
|
1615
1798
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1616
1799
|
return;
|
|
1617
1800
|
const t = e;
|
|
1618
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) &&
|
|
1801
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && Fn(t.a2ui) ? Go(t.a2ui) : Ve({
|
|
1619
1802
|
title: typeof t.title == "string" ? t.title : "",
|
|
1620
1803
|
description: typeof t.description == "string" ? t.description : "",
|
|
1621
1804
|
blocks: Array.isArray(t.blocks) ? t.blocks : [],
|
|
1622
|
-
jsonSchema:
|
|
1805
|
+
jsonSchema: fn(t.jsonSchema ?? t.json_schema)
|
|
1623
1806
|
});
|
|
1624
1807
|
}
|
|
1625
|
-
function
|
|
1808
|
+
function Zo(e, t, n) {
|
|
1626
1809
|
const r = e.model.surfacesMap.get(t);
|
|
1627
1810
|
if (!r) return {};
|
|
1628
1811
|
const o = {};
|
|
@@ -1632,18 +1815,18 @@ function wo(e, t, n) {
|
|
|
1632
1815
|
}
|
|
1633
1816
|
return o;
|
|
1634
1817
|
}
|
|
1635
|
-
const
|
|
1636
|
-
function
|
|
1818
|
+
const ei = /* @__PURE__ */ new Set(["type", "name", "id"]);
|
|
1819
|
+
function Ct(e) {
|
|
1637
1820
|
return e.type === "text" && e.hidden === !0;
|
|
1638
1821
|
}
|
|
1639
|
-
function
|
|
1640
|
-
return
|
|
1822
|
+
function At(e) {
|
|
1823
|
+
return Ve({
|
|
1641
1824
|
title: "",
|
|
1642
1825
|
description: "",
|
|
1643
1826
|
blocks: [e]
|
|
1644
1827
|
}).blocks[0];
|
|
1645
1828
|
}
|
|
1646
|
-
function
|
|
1829
|
+
function ti(e, t) {
|
|
1647
1830
|
var o, i;
|
|
1648
1831
|
const n = /* @__PURE__ */ new Map();
|
|
1649
1832
|
for (const s of t) {
|
|
@@ -1652,19 +1835,19 @@ function Oo(e, t) {
|
|
|
1652
1835
|
}
|
|
1653
1836
|
const r = [];
|
|
1654
1837
|
for (const s of e.blocks) {
|
|
1655
|
-
if (
|
|
1656
|
-
r.push(
|
|
1838
|
+
if (mn(s.type)) {
|
|
1839
|
+
r.push(At(s));
|
|
1657
1840
|
continue;
|
|
1658
1841
|
}
|
|
1659
1842
|
if (!Z(s.type)) continue;
|
|
1660
1843
|
const a = (i = s.name) == null ? void 0 : i.trim();
|
|
1661
1844
|
if (!a) continue;
|
|
1662
1845
|
const l = n.get(a);
|
|
1663
|
-
l && (
|
|
1846
|
+
l && (Ct(l) || ce(l) && r.push(l));
|
|
1664
1847
|
}
|
|
1665
1848
|
return r;
|
|
1666
1849
|
}
|
|
1667
|
-
function
|
|
1850
|
+
function ni(e, t, n) {
|
|
1668
1851
|
const r = e.rawBlocks;
|
|
1669
1852
|
if (!(r != null && r.length)) return n;
|
|
1670
1853
|
for (const o of r) {
|
|
@@ -1673,23 +1856,23 @@ function qo(e, t, n) {
|
|
|
1673
1856
|
}
|
|
1674
1857
|
return n;
|
|
1675
1858
|
}
|
|
1676
|
-
function
|
|
1859
|
+
function ri(e, t) {
|
|
1677
1860
|
var r;
|
|
1678
1861
|
const n = { ...e };
|
|
1679
1862
|
for (const o of Object.keys(t)) {
|
|
1680
|
-
if (
|
|
1863
|
+
if (ei.has(o) || !Object.prototype.hasOwnProperty.call(t, o)) continue;
|
|
1681
1864
|
const i = t[o];
|
|
1682
1865
|
i !== void 0 && Object.assign(n, { [o]: i });
|
|
1683
1866
|
}
|
|
1684
|
-
return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id,
|
|
1867
|
+
return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id, At(n);
|
|
1685
1868
|
}
|
|
1686
|
-
function
|
|
1869
|
+
function $e(e) {
|
|
1687
1870
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1688
1871
|
const t = e;
|
|
1689
1872
|
if (!Array.isArray(t.blocks)) return null;
|
|
1690
1873
|
const n = t.blocks.filter(
|
|
1691
1874
|
(o) => !!o && typeof o == "object" && !Array.isArray(o)
|
|
1692
|
-
), r =
|
|
1875
|
+
), r = Ve({
|
|
1693
1876
|
title: typeof t.title == "string" ? t.title : "",
|
|
1694
1877
|
description: typeof t.description == "string" ? t.description : "",
|
|
1695
1878
|
blocks: n
|
|
@@ -1701,8 +1884,8 @@ function Be(e) {
|
|
|
1701
1884
|
rawBlocks: n
|
|
1702
1885
|
};
|
|
1703
1886
|
}
|
|
1704
|
-
function
|
|
1705
|
-
var i, s, a, l,
|
|
1887
|
+
function oi(e, t) {
|
|
1888
|
+
var i, s, a, l, u, m;
|
|
1706
1889
|
const n = /* @__PURE__ */ new Map();
|
|
1707
1890
|
for (const d of (t == null ? void 0 : t.blocks) ?? [])
|
|
1708
1891
|
Z(d.type) && ((i = d.name) != null && i.trim()) && n.set(d.name.trim(), d);
|
|
@@ -1713,106 +1896,108 @@ function Vo(e, t) {
|
|
|
1713
1896
|
if (!b) continue;
|
|
1714
1897
|
const y = n.get(b);
|
|
1715
1898
|
if (y) {
|
|
1716
|
-
const S =
|
|
1717
|
-
r.push(
|
|
1899
|
+
const S = ni(e, b, d);
|
|
1900
|
+
r.push(ri(y, S));
|
|
1718
1901
|
} else
|
|
1719
|
-
o.push(
|
|
1902
|
+
o.push(At(d));
|
|
1720
1903
|
}
|
|
1721
1904
|
return {
|
|
1722
1905
|
matchedBlocks: r,
|
|
1723
1906
|
extraBlocks: o,
|
|
1724
|
-
renderBlocks:
|
|
1907
|
+
renderBlocks: ti(e, r),
|
|
1725
1908
|
title: ((a = e.title) == null ? void 0 : a.trim()) || ((l = t == null ? void 0 : t.title) == null ? void 0 : l.trim()) || "",
|
|
1726
|
-
description: ((
|
|
1909
|
+
description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1727
1910
|
};
|
|
1728
1911
|
}
|
|
1729
|
-
function
|
|
1912
|
+
function In(e) {
|
|
1730
1913
|
const { type: t, defaultValue: n } = e;
|
|
1731
1914
|
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 : "";
|
|
1732
1915
|
}
|
|
1733
|
-
function
|
|
1916
|
+
function qe(e) {
|
|
1734
1917
|
var n;
|
|
1735
1918
|
const t = {};
|
|
1736
1919
|
for (const r of e) {
|
|
1737
|
-
if (!Z(r.type)) continue;
|
|
1920
|
+
if (!Z(r.type) || !ce(r)) continue;
|
|
1738
1921
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1739
|
-
o && (t[o] =
|
|
1922
|
+
o && (t[o] = In(r));
|
|
1740
1923
|
}
|
|
1741
1924
|
return t;
|
|
1742
1925
|
}
|
|
1743
|
-
function
|
|
1926
|
+
function ii(e) {
|
|
1744
1927
|
return e.blocks.some(
|
|
1745
1928
|
(t) => {
|
|
1746
1929
|
var n;
|
|
1747
|
-
return Z(t.type) && !!((n = t.name) != null && n.trim());
|
|
1930
|
+
return Z(t.type) && !!((n = t.name) != null && n.trim()) && ce(t);
|
|
1748
1931
|
}
|
|
1749
1932
|
);
|
|
1750
1933
|
}
|
|
1751
|
-
function
|
|
1934
|
+
function si(e) {
|
|
1752
1935
|
return e.blocks.filter((t) => {
|
|
1753
1936
|
var n;
|
|
1754
|
-
return
|
|
1937
|
+
return mn(t.type) ? !0 : !Z(t.type) || !((n = t.name) != null && n.trim()) || !ce(t) ? !1 : !Ct(t);
|
|
1755
1938
|
});
|
|
1756
1939
|
}
|
|
1757
|
-
function
|
|
1758
|
-
return e.blocks.filter(
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1940
|
+
function Os(e) {
|
|
1941
|
+
return e.blocks.filter(
|
|
1942
|
+
(t) => {
|
|
1943
|
+
var n;
|
|
1944
|
+
return Z(t.type) && ((n = t.name) == null ? void 0 : n.trim()) && ce(t);
|
|
1945
|
+
}
|
|
1946
|
+
).map((t) => t.name.trim());
|
|
1762
1947
|
}
|
|
1763
|
-
function
|
|
1948
|
+
function ai(e) {
|
|
1764
1949
|
var n;
|
|
1765
1950
|
const t = {};
|
|
1766
1951
|
for (const r of e.blocks) {
|
|
1767
|
-
if (!
|
|
1952
|
+
if (!Ct(r)) continue;
|
|
1768
1953
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1769
|
-
o && (t[o] =
|
|
1954
|
+
o && (t[o] = In(r));
|
|
1770
1955
|
}
|
|
1771
1956
|
return t;
|
|
1772
1957
|
}
|
|
1773
|
-
function
|
|
1958
|
+
function _t(e) {
|
|
1774
1959
|
return e.replace(/'/g, "'\\''");
|
|
1775
1960
|
}
|
|
1776
|
-
function
|
|
1961
|
+
function En(e) {
|
|
1777
1962
|
var n;
|
|
1778
1963
|
const t = (n = e == null ? void 0 : e.Authorization) == null ? void 0 : n.trim();
|
|
1779
|
-
return t ? ` -H 'Authorization: ${
|
|
1964
|
+
return t ? ` -H 'Authorization: ${_t(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
|
|
1780
1965
|
}
|
|
1781
|
-
function
|
|
1966
|
+
function Un(e, t, n) {
|
|
1782
1967
|
const r = (t ?? "").trim() || "<callback_url>", o = JSON.stringify(e ?? {}, null, 2);
|
|
1783
1968
|
return [
|
|
1784
1969
|
`curl -X POST '${r}' \\`,
|
|
1785
1970
|
" -H 'Content-Type: application/json' \\",
|
|
1786
|
-
|
|
1787
|
-
` -d '${
|
|
1971
|
+
En(n),
|
|
1972
|
+
` -d '${_t(o)}'`
|
|
1788
1973
|
].join(`
|
|
1789
1974
|
`);
|
|
1790
1975
|
}
|
|
1791
|
-
function
|
|
1976
|
+
function li(e, t) {
|
|
1792
1977
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1793
1978
|
}
|
|
1794
|
-
function
|
|
1979
|
+
function ci({
|
|
1795
1980
|
cardValues: e,
|
|
1796
1981
|
extraValues: t = {},
|
|
1797
1982
|
callbackUrl: n,
|
|
1798
1983
|
headers: r
|
|
1799
1984
|
}) {
|
|
1800
|
-
const o = (n ?? "").trim() || "<callback_url>", i =
|
|
1985
|
+
const o = (n ?? "").trim() || "<callback_url>", i = li(e, t);
|
|
1801
1986
|
return [
|
|
1802
1987
|
`curl -X POST '${o}' \\`,
|
|
1803
1988
|
" -H 'Content-Type: application/json' \\",
|
|
1804
|
-
|
|
1805
|
-
` -d '${
|
|
1989
|
+
En(r),
|
|
1990
|
+
` -d '${_t(i)}'`
|
|
1806
1991
|
].join(`
|
|
1807
1992
|
`);
|
|
1808
1993
|
}
|
|
1809
|
-
function
|
|
1810
|
-
const r =
|
|
1811
|
-
if (!r) return
|
|
1812
|
-
const o =
|
|
1813
|
-
return
|
|
1994
|
+
function Bs(e, t, n) {
|
|
1995
|
+
const r = $e(e);
|
|
1996
|
+
if (!r) return Un(e, t, n);
|
|
1997
|
+
const o = qe(r.blocks);
|
|
1998
|
+
return ci({ cardValues: o, callbackUrl: t, headers: n });
|
|
1814
1999
|
}
|
|
1815
|
-
async function
|
|
2000
|
+
async function Rn(e, t, n) {
|
|
1816
2001
|
const r = e.trim();
|
|
1817
2002
|
if (!r)
|
|
1818
2003
|
throw new Error("callback_url 为空");
|
|
@@ -1839,7 +2024,7 @@ async function Tn(e, t, n) {
|
|
|
1839
2024
|
}
|
|
1840
2025
|
return { ok: i.ok, status: i.status, body: s };
|
|
1841
2026
|
}
|
|
1842
|
-
async function
|
|
2027
|
+
async function qs(e) {
|
|
1843
2028
|
var n;
|
|
1844
2029
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1845
2030
|
await navigator.clipboard.writeText(e);
|
|
@@ -1855,7 +2040,7 @@ async function ks(e) {
|
|
|
1855
2040
|
document.body.removeChild(t);
|
|
1856
2041
|
}
|
|
1857
2042
|
}
|
|
1858
|
-
async function
|
|
2043
|
+
async function Tt(e) {
|
|
1859
2044
|
let t;
|
|
1860
2045
|
try {
|
|
1861
2046
|
t = await e.json();
|
|
@@ -1868,8 +2053,8 @@ async function kt(e) {
|
|
|
1868
2053
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1869
2054
|
return t.data;
|
|
1870
2055
|
}
|
|
1871
|
-
const
|
|
1872
|
-
function
|
|
2056
|
+
const xt = "auth_user", ui = "token", mi = "answer_agent_callback_url", di = "realtime_ws_url", pi = "/api/v1/mock/ask_user_answer_mock";
|
|
2057
|
+
function Mt(e) {
|
|
1873
2058
|
if (typeof window > "u") return null;
|
|
1874
2059
|
try {
|
|
1875
2060
|
return e === "localStorage" ? window.localStorage : window.sessionStorage;
|
|
@@ -1877,7 +2062,7 @@ function At(e) {
|
|
|
1877
2062
|
return null;
|
|
1878
2063
|
}
|
|
1879
2064
|
}
|
|
1880
|
-
function
|
|
2065
|
+
function Nt(e) {
|
|
1881
2066
|
try {
|
|
1882
2067
|
const t = JSON.parse(e);
|
|
1883
2068
|
return !t || typeof t != "object" || Array.isArray(t) ? null : t;
|
|
@@ -1885,50 +2070,50 @@ function _t(e) {
|
|
|
1885
2070
|
return null;
|
|
1886
2071
|
}
|
|
1887
2072
|
}
|
|
1888
|
-
function
|
|
1889
|
-
const n =
|
|
2073
|
+
function fi(e, t) {
|
|
2074
|
+
const n = Nt(e);
|
|
1890
2075
|
if (!n) return "";
|
|
1891
2076
|
const r = n[t];
|
|
1892
2077
|
return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
|
|
1893
2078
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
2079
|
+
function hi(e = {}) {
|
|
2080
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? xt, r = e.answerAgentCallbackUrlField ?? mi, o = Mt(t);
|
|
1896
2081
|
if (!o) return "";
|
|
1897
2082
|
const i = o.getItem(n);
|
|
1898
2083
|
if (!i) return "";
|
|
1899
|
-
const s =
|
|
2084
|
+
const s = Nt(i);
|
|
1900
2085
|
if (!s) return "";
|
|
1901
2086
|
const a = s[r];
|
|
1902
|
-
return (typeof a == "string" ? a.trim() : "") ||
|
|
2087
|
+
return (typeof a == "string" ? a.trim() : "") || pi;
|
|
1903
2088
|
}
|
|
1904
|
-
function
|
|
1905
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
2089
|
+
function gi(e = {}) {
|
|
2090
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? xt, r = e.realtimeWsUrlField ?? di, o = Mt(t);
|
|
1906
2091
|
if (!o) return "";
|
|
1907
2092
|
const i = o.getItem(n);
|
|
1908
2093
|
if (!i) return "";
|
|
1909
|
-
const s =
|
|
2094
|
+
const s = Nt(i);
|
|
1910
2095
|
if (!s) return "";
|
|
1911
2096
|
const a = s[r];
|
|
1912
2097
|
return typeof a == "string" ? a.trim() : "";
|
|
1913
2098
|
}
|
|
1914
|
-
function
|
|
2099
|
+
function Ft(e, t) {
|
|
1915
2100
|
return {
|
|
1916
|
-
...
|
|
2101
|
+
...wn(t),
|
|
1917
2102
|
...e ?? {}
|
|
1918
2103
|
};
|
|
1919
2104
|
}
|
|
1920
|
-
function
|
|
1921
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
2105
|
+
function wn(e = {}) {
|
|
2106
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? xt, r = e.tokenField ?? ui, o = Mt(t);
|
|
1922
2107
|
if (!o) return {};
|
|
1923
2108
|
const i = o.getItem(n);
|
|
1924
2109
|
if (!i) return {};
|
|
1925
|
-
const s =
|
|
2110
|
+
const s = fi(i, r);
|
|
1926
2111
|
return s ? { Authorization: `Bearer ${s}` } : {};
|
|
1927
2112
|
}
|
|
1928
|
-
async function
|
|
1929
|
-
return e.getHeaders ? await e.getHeaders() ?? {} :
|
|
2113
|
+
async function It(e = {}) {
|
|
2114
|
+
return e.getHeaders ? await e.getHeaders() ?? {} : wn(e.authStorage);
|
|
1930
2115
|
}
|
|
1931
|
-
function
|
|
2116
|
+
function yi(e = {}) {
|
|
1932
2117
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1933
2118
|
async function o(i) {
|
|
1934
2119
|
const s = new URLSearchParams();
|
|
@@ -1938,21 +2123,21 @@ function Zo(e = {}) {
|
|
|
1938
2123
|
s.set("form_unique_id", i.formUniqueId);
|
|
1939
2124
|
else
|
|
1940
2125
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
1941
|
-
const a = await
|
|
2126
|
+
const a = await It(e), l = await r(`${t}${n}?${s.toString()}`, {
|
|
1942
2127
|
method: "GET",
|
|
1943
2128
|
headers: a
|
|
1944
|
-
}),
|
|
2129
|
+
}), u = await Tt(l), m = Qo(u.form_definition);
|
|
1945
2130
|
return {
|
|
1946
|
-
formUniqueId:
|
|
1947
|
-
formId:
|
|
1948
|
-
disabled:
|
|
2131
|
+
formUniqueId: u.form_unique_id,
|
|
2132
|
+
formId: u.form_id,
|
|
2133
|
+
disabled: u.disabled === 1,
|
|
1949
2134
|
formDefinition: m,
|
|
1950
|
-
a2ui:
|
|
2135
|
+
a2ui: Yo(u.form_definition) ?? void 0
|
|
1951
2136
|
};
|
|
1952
2137
|
}
|
|
1953
2138
|
return { fetchDetail: o };
|
|
1954
2139
|
}
|
|
1955
|
-
function
|
|
2140
|
+
function vi(e) {
|
|
1956
2141
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1957
2142
|
return e ?? null;
|
|
1958
2143
|
const t = e;
|
|
@@ -1962,13 +2147,13 @@ function ei(e) {
|
|
|
1962
2147
|
blocks: t.blocks
|
|
1963
2148
|
} : e;
|
|
1964
2149
|
}
|
|
1965
|
-
function
|
|
2150
|
+
function Et({
|
|
1966
2151
|
context: e,
|
|
1967
2152
|
payload: t,
|
|
1968
2153
|
form: n,
|
|
1969
2154
|
answer: r
|
|
1970
2155
|
}) {
|
|
1971
|
-
const o =
|
|
2156
|
+
const o = $e(t) ?? t, i = n ? vi(n) : o;
|
|
1972
2157
|
return {
|
|
1973
2158
|
mission_id: e.missionId ?? null,
|
|
1974
2159
|
tenant_id: e.tenantId ?? null,
|
|
@@ -1981,7 +2166,7 @@ function Mt({
|
|
|
1981
2166
|
answer: r
|
|
1982
2167
|
};
|
|
1983
2168
|
}
|
|
1984
|
-
function
|
|
2169
|
+
function Ut(e) {
|
|
1985
2170
|
const t = e.callback_url;
|
|
1986
2171
|
if (typeof t != "string" || !t.trim())
|
|
1987
2172
|
return "callback_url 为空,无法提交";
|
|
@@ -1996,34 +2181,34 @@ function Nt(e) {
|
|
|
1996
2181
|
const o = e.mission_id;
|
|
1997
2182
|
return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
|
|
1998
2183
|
}
|
|
1999
|
-
function
|
|
2000
|
-
return
|
|
2001
|
-
|
|
2184
|
+
function Ls(e) {
|
|
2185
|
+
return Ut(
|
|
2186
|
+
Et({
|
|
2002
2187
|
context: e,
|
|
2003
2188
|
payload: {},
|
|
2004
2189
|
answer: {}
|
|
2005
2190
|
})
|
|
2006
2191
|
);
|
|
2007
2192
|
}
|
|
2008
|
-
const
|
|
2009
|
-
function
|
|
2193
|
+
const tn = "answer_agent_callback_url 未配置,无法提交";
|
|
2194
|
+
function bi(e) {
|
|
2010
2195
|
if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
|
|
2011
2196
|
const n = e.answerAgentCallbackUrl.trim();
|
|
2012
2197
|
if (!n)
|
|
2013
|
-
throw new Error(
|
|
2198
|
+
throw new Error(tn);
|
|
2014
2199
|
return n;
|
|
2015
2200
|
}
|
|
2016
|
-
const t =
|
|
2201
|
+
const t = hi(e == null ? void 0 : e.authStorage).trim();
|
|
2017
2202
|
if (!t)
|
|
2018
|
-
throw new Error(
|
|
2203
|
+
throw new Error(tn);
|
|
2019
2204
|
return t;
|
|
2020
2205
|
}
|
|
2021
|
-
function
|
|
2206
|
+
function Pn(e) {
|
|
2022
2207
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
2023
2208
|
const n = e.data;
|
|
2024
2209
|
return !n || typeof n != "object" || Array.isArray(n) ? null : n;
|
|
2025
2210
|
}
|
|
2026
|
-
function
|
|
2211
|
+
function Si(e, t) {
|
|
2027
2212
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
2028
2213
|
const n = t.message;
|
|
2029
2214
|
if (typeof n == "string" && n.trim())
|
|
@@ -2031,27 +2216,27 @@ function ni(e, t) {
|
|
|
2031
2216
|
}
|
|
2032
2217
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2033
2218
|
}
|
|
2034
|
-
function
|
|
2219
|
+
function ki(e) {
|
|
2035
2220
|
return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
|
|
2036
2221
|
}
|
|
2037
|
-
function
|
|
2038
|
-
const t =
|
|
2039
|
-
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message:
|
|
2222
|
+
function zn(e) {
|
|
2223
|
+
const t = Pn(e.body);
|
|
2224
|
+
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: ki(t) } : e.ok ? { type: "success", message: "提交成功" } : {
|
|
2040
2225
|
type: "error",
|
|
2041
|
-
message:
|
|
2226
|
+
message: Si(e.status, e.body)
|
|
2042
2227
|
};
|
|
2043
2228
|
}
|
|
2044
|
-
async function
|
|
2045
|
-
const n =
|
|
2229
|
+
async function On(e, t) {
|
|
2230
|
+
const n = Ut(e);
|
|
2046
2231
|
if (n)
|
|
2047
2232
|
throw new Error(n);
|
|
2048
|
-
const r =
|
|
2233
|
+
const r = bi(t), o = await Rn(r, e, {
|
|
2049
2234
|
...t,
|
|
2050
|
-
headers:
|
|
2051
|
-
}), i =
|
|
2235
|
+
headers: Ft(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
|
|
2236
|
+
}), i = Pn(o.body);
|
|
2052
2237
|
return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
|
|
2053
2238
|
}
|
|
2054
|
-
function
|
|
2239
|
+
function Ci(e) {
|
|
2055
2240
|
return {
|
|
2056
2241
|
resumeUniqueId: e.resume_unique_id,
|
|
2057
2242
|
resumeId: e.resume_id,
|
|
@@ -2072,7 +2257,7 @@ function oi(e) {
|
|
|
2072
2257
|
}))
|
|
2073
2258
|
};
|
|
2074
2259
|
}
|
|
2075
|
-
function
|
|
2260
|
+
function Ai(e, t, n) {
|
|
2076
2261
|
const r = new URLSearchParams();
|
|
2077
2262
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20));
|
|
2078
2263
|
for (const o of e.names ?? [])
|
|
@@ -2085,27 +2270,27 @@ function ii(e, t, n) {
|
|
|
2085
2270
|
r.append("published", String(o));
|
|
2086
2271
|
return r;
|
|
2087
2272
|
}
|
|
2088
|
-
function
|
|
2273
|
+
function _i(e = {}) {
|
|
2089
2274
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch, o = e.published ?? [1];
|
|
2090
2275
|
return async ({ filter: i, page: s }) => {
|
|
2091
|
-
const a = await
|
|
2276
|
+
const a = await It(e), l = Ai(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
|
|
2092
2277
|
method: "GET",
|
|
2093
2278
|
headers: a
|
|
2094
|
-
}), m = await
|
|
2279
|
+
}), m = await Tt(u);
|
|
2095
2280
|
return {
|
|
2096
|
-
list: (m.list ?? []).map(
|
|
2281
|
+
list: (m.list ?? []).map(Ci),
|
|
2097
2282
|
total: m.total ?? 0,
|
|
2098
2283
|
page: m.page ?? s,
|
|
2099
2284
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2100
2285
|
};
|
|
2101
2286
|
};
|
|
2102
2287
|
}
|
|
2103
|
-
function
|
|
2288
|
+
function Ti(e) {
|
|
2104
2289
|
var r, o, i, s;
|
|
2105
2290
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!((o = e.agentUniqueId) != null && o.trim() && ((i = e.flowType) != null && i.trim()) && ((s = e.category) != null && s.trim()));
|
|
2106
2291
|
return t || n;
|
|
2107
2292
|
}
|
|
2108
|
-
function
|
|
2293
|
+
function xi(e) {
|
|
2109
2294
|
return {
|
|
2110
2295
|
caseUniqueId: e.case_unique_id,
|
|
2111
2296
|
caseId: e.case_id,
|
|
@@ -2116,7 +2301,7 @@ function li(e) {
|
|
|
2116
2301
|
description: e.description ?? void 0
|
|
2117
2302
|
};
|
|
2118
2303
|
}
|
|
2119
|
-
function
|
|
2304
|
+
function Mi(e, t, n) {
|
|
2120
2305
|
var o, i, s;
|
|
2121
2306
|
const r = new URLSearchParams();
|
|
2122
2307
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20)), r.set("published", String(n)), (o = e.agentUniqueId) != null && o.trim() && r.set("agent_unique_id", e.agentUniqueId.trim()), (i = e.flowType) != null && i.trim() && r.set("flow_type", e.flowType.trim()), (s = e.category) != null && s.trim() && r.set("category_unique_id", e.category.trim());
|
|
@@ -2124,24 +2309,24 @@ function ci(e, t, n) {
|
|
|
2124
2309
|
a && r.append("flow_unique_ids", a);
|
|
2125
2310
|
return r;
|
|
2126
2311
|
}
|
|
2127
|
-
function
|
|
2312
|
+
function Ni(e = {}) {
|
|
2128
2313
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
|
|
2129
2314
|
return async ({ filter: i, page: s }) => {
|
|
2130
|
-
if (!
|
|
2315
|
+
if (!Ti(i))
|
|
2131
2316
|
return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
|
|
2132
|
-
const a = await
|
|
2317
|
+
const a = await It(e), l = Mi(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
|
|
2133
2318
|
method: "GET",
|
|
2134
2319
|
headers: a
|
|
2135
|
-
}), m = await
|
|
2320
|
+
}), m = await Tt(u);
|
|
2136
2321
|
return {
|
|
2137
|
-
list: (m.list ?? []).map(
|
|
2322
|
+
list: (m.list ?? []).map(xi),
|
|
2138
2323
|
total: m.total ?? 0,
|
|
2139
2324
|
page: m.page ?? s,
|
|
2140
2325
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2141
2326
|
};
|
|
2142
2327
|
};
|
|
2143
2328
|
}
|
|
2144
|
-
function
|
|
2329
|
+
function Vs(e = {}) {
|
|
2145
2330
|
var r, o, i, s, a;
|
|
2146
2331
|
const t = {
|
|
2147
2332
|
baseUrl: e.baseUrl,
|
|
@@ -2150,23 +2335,23 @@ function As(e = {}) {
|
|
|
2150
2335
|
authStorage: e.authStorage
|
|
2151
2336
|
};
|
|
2152
2337
|
return {
|
|
2153
|
-
fetchDetail:
|
|
2338
|
+
fetchDetail: yi({
|
|
2154
2339
|
...t,
|
|
2155
2340
|
detailPath: (r = e.form) == null ? void 0 : r.detailPath
|
|
2156
2341
|
}).fetchDetail,
|
|
2157
|
-
resumeSearch:
|
|
2342
|
+
resumeSearch: _i({
|
|
2158
2343
|
...t,
|
|
2159
2344
|
searchPath: (o = e.resume) == null ? void 0 : o.searchPath,
|
|
2160
2345
|
published: (i = e.resume) == null ? void 0 : i.published
|
|
2161
2346
|
}),
|
|
2162
|
-
caseSearch:
|
|
2347
|
+
caseSearch: Ni({
|
|
2163
2348
|
...t,
|
|
2164
2349
|
listPath: (s = e.case) == null ? void 0 : s.listPath,
|
|
2165
2350
|
published: (a = e.case) == null ? void 0 : a.published
|
|
2166
2351
|
})
|
|
2167
2352
|
};
|
|
2168
2353
|
}
|
|
2169
|
-
function
|
|
2354
|
+
function Bn(e, t) {
|
|
2170
2355
|
if (!t.trim()) return !0;
|
|
2171
2356
|
try {
|
|
2172
2357
|
return new RegExp(t).test(e);
|
|
@@ -2174,10 +2359,10 @@ function Fn(e, t) {
|
|
|
2174
2359
|
return !0;
|
|
2175
2360
|
}
|
|
2176
2361
|
}
|
|
2177
|
-
function
|
|
2362
|
+
function qn(e) {
|
|
2178
2363
|
return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
|
|
2179
2364
|
}
|
|
2180
|
-
function
|
|
2365
|
+
function Fi(e, t) {
|
|
2181
2366
|
switch (e.type) {
|
|
2182
2367
|
case "multiselect":
|
|
2183
2368
|
case "checkbox":
|
|
@@ -2186,32 +2371,33 @@ function mi(e, t) {
|
|
|
2186
2371
|
case "case_multiselect":
|
|
2187
2372
|
return Q(t).length === 0;
|
|
2188
2373
|
case "toggle":
|
|
2189
|
-
return !
|
|
2374
|
+
return !Ie(t);
|
|
2190
2375
|
case "number":
|
|
2191
2376
|
return t == null || t === "";
|
|
2192
2377
|
default:
|
|
2193
|
-
return
|
|
2378
|
+
return qn(t);
|
|
2194
2379
|
}
|
|
2195
2380
|
}
|
|
2196
|
-
function
|
|
2381
|
+
function lt(e, t) {
|
|
2197
2382
|
return e.required === !0 || t > 0;
|
|
2198
2383
|
}
|
|
2199
|
-
function
|
|
2384
|
+
function Ii(e, t) {
|
|
2200
2385
|
var n, r;
|
|
2201
2386
|
for (const o of e) {
|
|
2387
|
+
if (!Z(o.type)) continue;
|
|
2202
2388
|
const i = (n = o.name) == null ? void 0 : n.trim();
|
|
2203
|
-
if (!i
|
|
2389
|
+
if (!i) continue;
|
|
2204
2390
|
const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
|
|
2205
|
-
if (o.required &&
|
|
2391
|
+
if (o.required && Fi(o, s))
|
|
2206
2392
|
return { fieldName: i, label: a, message: `请填写「${a}」` };
|
|
2207
|
-
if (o.type === "email" && !
|
|
2393
|
+
if (o.type === "email" && !qn(s)) {
|
|
2208
2394
|
const l = String(s).trim();
|
|
2209
|
-
if (!
|
|
2395
|
+
if (!Bn(l, kt))
|
|
2210
2396
|
return { fieldName: i, label: a, message: `「${a}」格式不正确` };
|
|
2211
2397
|
}
|
|
2212
2398
|
if (o.type === "file") {
|
|
2213
|
-
const l = o.fileMinCount ?? 0,
|
|
2214
|
-
if (l > 0 &&
|
|
2399
|
+
const l = o.fileMinCount ?? 0, u = Q(s).length;
|
|
2400
|
+
if (l > 0 && u < l && lt(o, u))
|
|
2215
2401
|
return {
|
|
2216
2402
|
fieldName: i,
|
|
2217
2403
|
label: a,
|
|
@@ -2219,8 +2405,8 @@ function di(e, t) {
|
|
|
2219
2405
|
};
|
|
2220
2406
|
}
|
|
2221
2407
|
if (o.type === "resume_multiselect") {
|
|
2222
|
-
const l = o.resumeMinCount,
|
|
2223
|
-
if (l !== void 0 &&
|
|
2408
|
+
const l = o.resumeMinCount, u = Q(s).length;
|
|
2409
|
+
if (l !== void 0 && u < l && lt(o, u))
|
|
2224
2410
|
return {
|
|
2225
2411
|
fieldName: i,
|
|
2226
2412
|
label: a,
|
|
@@ -2228,8 +2414,8 @@ function di(e, t) {
|
|
|
2228
2414
|
};
|
|
2229
2415
|
}
|
|
2230
2416
|
if (o.type === "case_multiselect") {
|
|
2231
|
-
const l = o.caseMinCount,
|
|
2232
|
-
if (l !== void 0 &&
|
|
2417
|
+
const l = o.caseMinCount, u = Q(s).length;
|
|
2418
|
+
if (l !== void 0 && u < l && lt(o, u))
|
|
2233
2419
|
return {
|
|
2234
2420
|
fieldName: i,
|
|
2235
2421
|
label: a,
|
|
@@ -2239,21 +2425,21 @@ function di(e, t) {
|
|
|
2239
2425
|
}
|
|
2240
2426
|
return null;
|
|
2241
2427
|
}
|
|
2242
|
-
const
|
|
2243
|
-
video:
|
|
2244
|
-
audio:
|
|
2245
|
-
image:
|
|
2246
|
-
file:
|
|
2247
|
-
spreadsheet:
|
|
2248
|
-
document:
|
|
2428
|
+
const Ei = {
|
|
2429
|
+
video: dr,
|
|
2430
|
+
audio: mr,
|
|
2431
|
+
image: ur,
|
|
2432
|
+
file: on,
|
|
2433
|
+
spreadsheet: cr,
|
|
2434
|
+
document: rn
|
|
2249
2435
|
};
|
|
2250
|
-
function
|
|
2436
|
+
function Ui({
|
|
2251
2437
|
type: e,
|
|
2252
2438
|
size: t = 40,
|
|
2253
2439
|
className: n
|
|
2254
2440
|
}) {
|
|
2255
|
-
const r =
|
|
2256
|
-
return /* @__PURE__ */
|
|
2441
|
+
const r = Ei[e] ?? on;
|
|
2442
|
+
return /* @__PURE__ */ c(
|
|
2257
2443
|
r,
|
|
2258
2444
|
{
|
|
2259
2445
|
className: n ?? "skopon-form-file-placeholder-icon",
|
|
@@ -2262,7 +2448,7 @@ function pi({
|
|
|
2262
2448
|
}
|
|
2263
2449
|
);
|
|
2264
2450
|
}
|
|
2265
|
-
const
|
|
2451
|
+
const Ln = "skopon-form-v0_9", Ri = /* @__PURE__ */ new Set([
|
|
2266
2452
|
"SkoponMedia",
|
|
2267
2453
|
"SkoponSelect",
|
|
2268
2454
|
"Image",
|
|
@@ -2274,24 +2460,20 @@ const Un = "skopon-form-v0_9", hi = /* @__PURE__ */ new Set([
|
|
|
2274
2460
|
"FileUpload",
|
|
2275
2461
|
"TextField",
|
|
2276
2462
|
"Text",
|
|
2277
|
-
...
|
|
2278
|
-
]),
|
|
2279
|
-
function
|
|
2280
|
-
const t = [...
|
|
2463
|
+
...Lo()
|
|
2464
|
+
]), wi = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
2465
|
+
function Ee(e) {
|
|
2466
|
+
const t = [...Pe.components.values()].find((n) => n.name === e);
|
|
2281
2467
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
2282
2468
|
return t.schema;
|
|
2283
2469
|
}
|
|
2284
|
-
function
|
|
2470
|
+
function w(e) {
|
|
2285
2471
|
return typeof e == "string" ? e : "";
|
|
2286
2472
|
}
|
|
2287
|
-
function
|
|
2288
|
-
return
|
|
2289
|
-
if (!t || typeof t != "object") return null;
|
|
2290
|
-
const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
|
|
2291
|
-
return { value: r, label: o };
|
|
2292
|
-
}).filter((t) => !!t) : [];
|
|
2473
|
+
function Vn(e) {
|
|
2474
|
+
return Le(e);
|
|
2293
2475
|
}
|
|
2294
|
-
function
|
|
2476
|
+
function De({
|
|
2295
2477
|
mediaType: e,
|
|
2296
2478
|
urls: t,
|
|
2297
2479
|
mediaSize: n,
|
|
@@ -2299,10 +2481,10 @@ function Ve({
|
|
|
2299
2481
|
help: o,
|
|
2300
2482
|
placeholder: i
|
|
2301
2483
|
}) {
|
|
2302
|
-
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l =
|
|
2303
|
-
return /* @__PURE__ */
|
|
2304
|
-
s ? /* @__PURE__ */
|
|
2305
|
-
t.length === 0 ? /* @__PURE__ */
|
|
2484
|
+
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = Br(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
2485
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
|
|
2486
|
+
s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2487
|
+
t.length === 0 ? /* @__PURE__ */ c("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ c("div", { className: l, children: t.map((m, d) => e === "image" ? /* @__PURE__ */ c(
|
|
2306
2488
|
"img",
|
|
2307
2489
|
{
|
|
2308
2490
|
src: m,
|
|
@@ -2310,7 +2492,7 @@ function Ve({
|
|
|
2310
2492
|
className: "form-media-item"
|
|
2311
2493
|
},
|
|
2312
2494
|
`media-${d}`
|
|
2313
|
-
) : e === "video" ? /* @__PURE__ */
|
|
2495
|
+
) : e === "video" ? /* @__PURE__ */ c(
|
|
2314
2496
|
"video",
|
|
2315
2497
|
{
|
|
2316
2498
|
src: m,
|
|
@@ -2318,7 +2500,7 @@ function Ve({
|
|
|
2318
2500
|
className: "form-media-item"
|
|
2319
2501
|
},
|
|
2320
2502
|
`media-${d}`
|
|
2321
|
-
) : /* @__PURE__ */
|
|
2503
|
+
) : /* @__PURE__ */ c(
|
|
2322
2504
|
"audio",
|
|
2323
2505
|
{
|
|
2324
2506
|
src: m,
|
|
@@ -2327,64 +2509,64 @@ function Ve({
|
|
|
2327
2509
|
},
|
|
2328
2510
|
`media-${d}`
|
|
2329
2511
|
)) }),
|
|
2330
|
-
a ? /* @__PURE__ */
|
|
2512
|
+
a ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: a }) : null
|
|
2331
2513
|
] });
|
|
2332
2514
|
}
|
|
2333
|
-
function
|
|
2334
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
2515
|
+
function He(e, t) {
|
|
2516
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : w(e.url).trim() ? [w(e.url).trim()] : [];
|
|
2335
2517
|
return {
|
|
2336
2518
|
mediaType: t,
|
|
2337
2519
|
urls: n,
|
|
2338
|
-
mediaSize:
|
|
2339
|
-
label:
|
|
2340
|
-
help:
|
|
2341
|
-
placeholder:
|
|
2520
|
+
mediaSize: Fe(e.mediaSize),
|
|
2521
|
+
label: w(e.label) || w(e.description),
|
|
2522
|
+
help: w(e.help),
|
|
2523
|
+
placeholder: w(e.placeholder)
|
|
2342
2524
|
};
|
|
2343
2525
|
}
|
|
2344
|
-
const
|
|
2526
|
+
const Pi = {
|
|
2345
2527
|
name: "SkoponMedia",
|
|
2346
|
-
schema:
|
|
2347
|
-
mediaType:
|
|
2348
|
-
urls:
|
|
2349
|
-
mediaSize:
|
|
2350
|
-
label:
|
|
2351
|
-
help:
|
|
2352
|
-
placeholder:
|
|
2528
|
+
schema: f.object({
|
|
2529
|
+
mediaType: f.any().optional(),
|
|
2530
|
+
urls: f.any().optional(),
|
|
2531
|
+
mediaSize: f.any().optional(),
|
|
2532
|
+
label: f.any().optional(),
|
|
2533
|
+
help: f.any().optional(),
|
|
2534
|
+
placeholder: f.any().optional()
|
|
2353
2535
|
}).passthrough()
|
|
2354
|
-
},
|
|
2355
|
-
const t = e.componentModel.properties, n =
|
|
2356
|
-
return /* @__PURE__ */
|
|
2357
|
-
}),
|
|
2358
|
-
{ name: "Image", schema:
|
|
2359
|
-
({ context: e }) => /* @__PURE__ */
|
|
2360
|
-
),
|
|
2361
|
-
{ name: "Video", schema:
|
|
2362
|
-
({ context: e }) => /* @__PURE__ */
|
|
2363
|
-
),
|
|
2364
|
-
{ name: "AudioPlayer", schema:
|
|
2365
|
-
({ context: e }) => /* @__PURE__ */
|
|
2366
|
-
),
|
|
2536
|
+
}, zi = J(Pi, ({ context: e }) => {
|
|
2537
|
+
const t = e.componentModel.properties, n = w(t.mediaType);
|
|
2538
|
+
return /* @__PURE__ */ c(De, { ...He(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
2539
|
+
}), Oi = J(
|
|
2540
|
+
{ name: "Image", schema: Ee("Image") },
|
|
2541
|
+
({ context: e }) => /* @__PURE__ */ c(De, { ...He(e.componentModel.properties, "image") })
|
|
2542
|
+
), Bi = J(
|
|
2543
|
+
{ name: "Video", schema: Ee("Video") },
|
|
2544
|
+
({ context: e }) => /* @__PURE__ */ c(De, { ...He(e.componentModel.properties, "video") })
|
|
2545
|
+
), qi = J(
|
|
2546
|
+
{ name: "AudioPlayer", schema: Ee("AudioPlayer") },
|
|
2547
|
+
({ context: e }) => /* @__PURE__ */ c(De, { ...He(e.componentModel.properties, "audio") })
|
|
2548
|
+
), Li = {
|
|
2367
2549
|
name: "SkoponSelect",
|
|
2368
|
-
schema:
|
|
2369
|
-
label:
|
|
2370
|
-
mode:
|
|
2371
|
-
placeholder:
|
|
2372
|
-
options:
|
|
2373
|
-
value:
|
|
2550
|
+
schema: f.object({
|
|
2551
|
+
label: f.any().optional(),
|
|
2552
|
+
mode: f.any().optional(),
|
|
2553
|
+
placeholder: f.any().optional(),
|
|
2554
|
+
options: f.any().optional(),
|
|
2555
|
+
value: f.any().optional()
|
|
2374
2556
|
}).passthrough()
|
|
2375
2557
|
};
|
|
2376
|
-
function
|
|
2558
|
+
function Vi({ context: e }) {
|
|
2377
2559
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2378
2560
|
component: "SkoponSelect",
|
|
2379
2561
|
changeAction: "select"
|
|
2380
|
-
}), s = e.componentModel.properties, a =
|
|
2381
|
-
return
|
|
2382
|
-
const d =
|
|
2562
|
+
}), s = e.componentModel.properties, a = w(s.label), l = w(s.placeholder), u = Vn(s.options), m = w(s.mode) === "multiple";
|
|
2563
|
+
return B(() => {
|
|
2564
|
+
const d = kn(n, m);
|
|
2383
2565
|
d !== null && o(d);
|
|
2384
|
-
}, [m, n, o]), /* @__PURE__ */
|
|
2385
|
-
a ? /* @__PURE__ */
|
|
2386
|
-
/* @__PURE__ */
|
|
2387
|
-
|
|
2566
|
+
}, [m, n, o]), u.length === 0 ? null : /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2567
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2568
|
+
/* @__PURE__ */ c(
|
|
2569
|
+
ct,
|
|
2388
2570
|
{
|
|
2389
2571
|
mode: m ? "multiple" : void 0,
|
|
2390
2572
|
disabled: !t,
|
|
@@ -2392,29 +2574,29 @@ function Ai({ context: e }) {
|
|
|
2392
2574
|
className: "form-block-preview-control",
|
|
2393
2575
|
style: { width: "100%" },
|
|
2394
2576
|
placeholder: l || (m ? "请选择多项" : "请选择"),
|
|
2395
|
-
options:
|
|
2396
|
-
value: m ? Q(n) :
|
|
2577
|
+
options: u,
|
|
2578
|
+
value: m ? Q(n) : Ce(n),
|
|
2397
2579
|
onChange: (d) => r(m ? d ?? [] : d ?? "")
|
|
2398
2580
|
}
|
|
2399
2581
|
)
|
|
2400
2582
|
] });
|
|
2401
2583
|
}
|
|
2402
|
-
const
|
|
2403
|
-
|
|
2404
|
-
|
|
2584
|
+
const ji = J(
|
|
2585
|
+
Li,
|
|
2586
|
+
Vi
|
|
2405
2587
|
);
|
|
2406
|
-
function
|
|
2588
|
+
function $i({ context: e }) {
|
|
2407
2589
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2408
2590
|
component: "ChoicePicker",
|
|
2409
2591
|
changeAction: "select"
|
|
2410
|
-
}), s = e.componentModel.properties, a =
|
|
2411
|
-
return
|
|
2412
|
-
const g =
|
|
2592
|
+
}), s = e.componentModel.properties, a = w(s.label), l = w(s.variant) || "mutuallyExclusive", u = w(s.skoponPickerType), m = w(s.placeholder), d = Vn(s.options), y = u === "select" || u === "multiselect" || u === "radio" || u === "checkbox" ? u : l === "multipleSelection" ? "checkbox" : "radio", S = y === "multiselect" || y === "checkbox";
|
|
2593
|
+
return B(() => {
|
|
2594
|
+
const g = kn(n, S);
|
|
2413
2595
|
g !== null && o(g);
|
|
2414
|
-
}, [S, n, o]), /* @__PURE__ */
|
|
2415
|
-
a ? /* @__PURE__ */
|
|
2416
|
-
y === "select" ? /* @__PURE__ */
|
|
2417
|
-
|
|
2596
|
+
}, [S, n, o]), d.length === 0 ? null : /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2597
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2598
|
+
y === "select" ? /* @__PURE__ */ c(
|
|
2599
|
+
ct,
|
|
2418
2600
|
{
|
|
2419
2601
|
disabled: !t,
|
|
2420
2602
|
allowClear: !0,
|
|
@@ -2422,11 +2604,11 @@ function Ti({ context: e }) {
|
|
|
2422
2604
|
style: { width: "100%" },
|
|
2423
2605
|
placeholder: m || "请选择",
|
|
2424
2606
|
options: d,
|
|
2425
|
-
value:
|
|
2607
|
+
value: Ce(n),
|
|
2426
2608
|
onChange: (g) => r(g ?? "")
|
|
2427
2609
|
}
|
|
2428
|
-
) : y === "multiselect" ? /* @__PURE__ */
|
|
2429
|
-
|
|
2610
|
+
) : y === "multiselect" ? /* @__PURE__ */ c(
|
|
2611
|
+
ct,
|
|
2430
2612
|
{
|
|
2431
2613
|
mode: "multiple",
|
|
2432
2614
|
disabled: !t,
|
|
@@ -2438,8 +2620,8 @@ function Ti({ context: e }) {
|
|
|
2438
2620
|
value: Q(n),
|
|
2439
2621
|
onChange: (g) => r(g ?? [])
|
|
2440
2622
|
}
|
|
2441
|
-
) : y === "checkbox" ? /* @__PURE__ */
|
|
2442
|
-
|
|
2623
|
+
) : y === "checkbox" ? /* @__PURE__ */ c(
|
|
2624
|
+
Zn.Group,
|
|
2443
2625
|
{
|
|
2444
2626
|
disabled: !t,
|
|
2445
2627
|
className: "form-block-preview-control",
|
|
@@ -2447,87 +2629,87 @@ function Ti({ context: e }) {
|
|
|
2447
2629
|
value: Q(n),
|
|
2448
2630
|
onChange: (g) => r(g)
|
|
2449
2631
|
}
|
|
2450
|
-
) : /* @__PURE__ */
|
|
2451
|
-
|
|
2632
|
+
) : /* @__PURE__ */ c(
|
|
2633
|
+
er.Group,
|
|
2452
2634
|
{
|
|
2453
2635
|
disabled: !t,
|
|
2454
2636
|
className: "form-block-preview-control",
|
|
2455
2637
|
options: d,
|
|
2456
|
-
value:
|
|
2638
|
+
value: Ce(n),
|
|
2457
2639
|
onChange: (g) => r(g.target.value)
|
|
2458
2640
|
}
|
|
2459
2641
|
)
|
|
2460
2642
|
] });
|
|
2461
2643
|
}
|
|
2462
|
-
const
|
|
2644
|
+
const Di = J(
|
|
2463
2645
|
{
|
|
2464
2646
|
name: "ChoicePicker",
|
|
2465
|
-
schema:
|
|
2466
|
-
label:
|
|
2467
|
-
variant:
|
|
2468
|
-
options:
|
|
2469
|
-
value:
|
|
2470
|
-
skoponPickerType:
|
|
2471
|
-
placeholder:
|
|
2647
|
+
schema: f.object({
|
|
2648
|
+
label: f.any().optional(),
|
|
2649
|
+
variant: f.any().optional(),
|
|
2650
|
+
options: f.any().optional(),
|
|
2651
|
+
value: f.any().optional(),
|
|
2652
|
+
skoponPickerType: f.any().optional(),
|
|
2653
|
+
placeholder: f.any().optional()
|
|
2472
2654
|
}).passthrough()
|
|
2473
2655
|
},
|
|
2474
|
-
|
|
2656
|
+
$i
|
|
2475
2657
|
);
|
|
2476
|
-
function
|
|
2658
|
+
function Hi({ context: e }) {
|
|
2477
2659
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2478
2660
|
component: "CheckBox",
|
|
2479
2661
|
changeAction: "change"
|
|
2480
|
-
}), i = e.componentModel.properties, s =
|
|
2481
|
-
return /* @__PURE__ */
|
|
2482
|
-
s ? /* @__PURE__ */
|
|
2483
|
-
/* @__PURE__ */
|
|
2484
|
-
|
|
2662
|
+
}), i = e.componentModel.properties, s = w(i.label);
|
|
2663
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2664
|
+
s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2665
|
+
/* @__PURE__ */ c(
|
|
2666
|
+
tr,
|
|
2485
2667
|
{
|
|
2486
2668
|
disabled: !t,
|
|
2487
2669
|
className: "form-block-preview-control",
|
|
2488
|
-
checked:
|
|
2670
|
+
checked: Ie(n),
|
|
2489
2671
|
onChange: (a) => r(a)
|
|
2490
2672
|
}
|
|
2491
2673
|
)
|
|
2492
2674
|
] });
|
|
2493
2675
|
}
|
|
2494
|
-
const
|
|
2495
|
-
{ name: "CheckBox", schema:
|
|
2496
|
-
|
|
2676
|
+
const Ki = J(
|
|
2677
|
+
{ name: "CheckBox", schema: Ee("CheckBox") },
|
|
2678
|
+
Hi
|
|
2497
2679
|
);
|
|
2498
|
-
function
|
|
2499
|
-
const r =
|
|
2680
|
+
function Wi(e, t, n) {
|
|
2681
|
+
const r = Ce(e);
|
|
2500
2682
|
if (!r) return;
|
|
2501
2683
|
if (!t && n) {
|
|
2502
|
-
const i =
|
|
2684
|
+
const i = Kt(r, "HH:mm", !0);
|
|
2503
2685
|
return i.isValid() ? i : void 0;
|
|
2504
2686
|
}
|
|
2505
|
-
const o =
|
|
2687
|
+
const o = Kt(r);
|
|
2506
2688
|
return o.isValid() ? o : void 0;
|
|
2507
2689
|
}
|
|
2508
|
-
function
|
|
2690
|
+
function Gi({ context: e }) {
|
|
2509
2691
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2510
2692
|
component: "DateTimeInput",
|
|
2511
2693
|
changeAction: "change"
|
|
2512
|
-
}), s = e.componentModel.properties, a =
|
|
2694
|
+
}), s = e.componentModel.properties, a = w(s.label), l = w(s.placeholder), u = s.enableDate === !0, m = s.enableTime === !0, d = Wi(n, u, m), b = (y) => {
|
|
2513
2695
|
if (!y) {
|
|
2514
2696
|
r("");
|
|
2515
2697
|
return;
|
|
2516
2698
|
}
|
|
2517
|
-
if (!
|
|
2699
|
+
if (!u && m) {
|
|
2518
2700
|
r(y.format("HH:mm"));
|
|
2519
2701
|
return;
|
|
2520
2702
|
}
|
|
2521
|
-
if (
|
|
2703
|
+
if (u && m) {
|
|
2522
2704
|
r(y.format("YYYY-MM-DDTHH:mm"));
|
|
2523
2705
|
return;
|
|
2524
2706
|
}
|
|
2525
2707
|
r(y.format("YYYY-MM-DD"));
|
|
2526
2708
|
};
|
|
2527
|
-
return /* @__PURE__ */
|
|
2528
|
-
a ? /* @__PURE__ */
|
|
2529
|
-
!
|
|
2530
|
-
|
|
2709
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2710
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2711
|
+
!u && m ? /* @__PURE__ */ c(
|
|
2712
|
+
nr,
|
|
2531
2713
|
{
|
|
2532
2714
|
disabled: !t,
|
|
2533
2715
|
className: "form-block-preview-control",
|
|
@@ -2537,14 +2719,14 @@ function Fi({ context: e }) {
|
|
|
2537
2719
|
onChange: b,
|
|
2538
2720
|
onFocus: i
|
|
2539
2721
|
}
|
|
2540
|
-
) : /* @__PURE__ */
|
|
2541
|
-
|
|
2722
|
+
) : /* @__PURE__ */ c(
|
|
2723
|
+
rr,
|
|
2542
2724
|
{
|
|
2543
|
-
showTime:
|
|
2725
|
+
showTime: u && m,
|
|
2544
2726
|
disabled: !t,
|
|
2545
2727
|
className: "form-block-preview-control",
|
|
2546
2728
|
style: { width: "100%" },
|
|
2547
|
-
placeholder: l || (
|
|
2729
|
+
placeholder: l || (u && m ? "选择日期时间" : "选择日期"),
|
|
2548
2730
|
value: d,
|
|
2549
2731
|
onChange: b,
|
|
2550
2732
|
onFocus: i
|
|
@@ -2552,105 +2734,105 @@ function Fi({ context: e }) {
|
|
|
2552
2734
|
)
|
|
2553
2735
|
] });
|
|
2554
2736
|
}
|
|
2555
|
-
const
|
|
2737
|
+
const Ji = J(
|
|
2556
2738
|
{
|
|
2557
2739
|
name: "DateTimeInput",
|
|
2558
|
-
schema:
|
|
2559
|
-
label:
|
|
2560
|
-
enableDate:
|
|
2561
|
-
enableTime:
|
|
2562
|
-
placeholder:
|
|
2563
|
-
value:
|
|
2564
|
-
min:
|
|
2565
|
-
max:
|
|
2740
|
+
schema: f.object({
|
|
2741
|
+
label: f.any().optional(),
|
|
2742
|
+
enableDate: f.any().optional(),
|
|
2743
|
+
enableTime: f.any().optional(),
|
|
2744
|
+
placeholder: f.any().optional(),
|
|
2745
|
+
value: f.any().optional(),
|
|
2746
|
+
min: f.any().optional(),
|
|
2747
|
+
max: f.any().optional()
|
|
2566
2748
|
}).passthrough()
|
|
2567
2749
|
},
|
|
2568
|
-
|
|
2569
|
-
),
|
|
2750
|
+
Gi
|
|
2751
|
+
), Yi = {
|
|
2570
2752
|
name: "FileUpload",
|
|
2571
|
-
schema:
|
|
2572
|
-
label:
|
|
2573
|
-
accept:
|
|
2574
|
-
fileAcceptTypes:
|
|
2575
|
-
filePlaceholderIcon:
|
|
2576
|
-
minCount:
|
|
2577
|
-
maxCount:
|
|
2578
|
-
value:
|
|
2753
|
+
schema: f.object({
|
|
2754
|
+
label: f.any().optional(),
|
|
2755
|
+
accept: f.any().optional(),
|
|
2756
|
+
fileAcceptTypes: f.any().optional(),
|
|
2757
|
+
filePlaceholderIcon: f.any().optional(),
|
|
2758
|
+
minCount: f.any().optional(),
|
|
2759
|
+
maxCount: f.any().optional(),
|
|
2760
|
+
value: f.any().optional()
|
|
2579
2761
|
}).passthrough()
|
|
2580
2762
|
};
|
|
2581
|
-
function
|
|
2763
|
+
function Xi({ context: e }) {
|
|
2582
2764
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2583
2765
|
component: "FileUpload",
|
|
2584
2766
|
changeAction: "change"
|
|
2585
|
-
}), i = e.componentModel.properties, s =
|
|
2767
|
+
}), i = e.componentModel.properties, s = w(i.label), a = w(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0, u = a ? a.split(",").map((p) => p.trim()).filter(Boolean) : void 0, m = Er(l, u), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2586
2768
|
i.filePlaceholderIcon
|
|
2587
|
-
) ? i.filePlaceholderIcon : "document", b = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, y = typeof i.maxCount == "number" ? i.maxCount : 1, S = y > 0, g = Q(n), k = S && g.length >= y,
|
|
2588
|
-
return /* @__PURE__ */
|
|
2589
|
-
s ? /* @__PURE__ */
|
|
2590
|
-
/* @__PURE__ */
|
|
2591
|
-
|
|
2769
|
+
) ? i.filePlaceholderIcon : "document", b = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, y = typeof i.maxCount == "number" ? i.maxCount : 1, S = y > 0, g = Q(n), k = S && g.length >= y, h = g.length < b;
|
|
2770
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2771
|
+
s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2772
|
+
/* @__PURE__ */ x(
|
|
2773
|
+
Ze.Dragger,
|
|
2592
2774
|
{
|
|
2593
2775
|
disabled: !t || k,
|
|
2594
|
-
accept:
|
|
2776
|
+
accept: Ir(l, u),
|
|
2595
2777
|
className: "form-file-upload-preview",
|
|
2596
2778
|
showUploadList: t && g.length > 0,
|
|
2597
|
-
fileList: t ? g.map((
|
|
2598
|
-
uid: `${v}-${
|
|
2599
|
-
name:
|
|
2779
|
+
fileList: t ? g.map((p, v) => ({
|
|
2780
|
+
uid: `${v}-${p}`,
|
|
2781
|
+
name: p,
|
|
2600
2782
|
status: "done"
|
|
2601
2783
|
})) : [],
|
|
2602
|
-
beforeUpload: (
|
|
2603
|
-
if (!t) return
|
|
2604
|
-
const v = Q(
|
|
2605
|
-
if (S && v.length >= y) return
|
|
2606
|
-
const
|
|
2607
|
-
return r(
|
|
2784
|
+
beforeUpload: (p) => {
|
|
2785
|
+
if (!t) return Ze.LIST_IGNORE;
|
|
2786
|
+
const v = Q(Yt(e));
|
|
2787
|
+
if (S && v.length >= y) return Ze.LIST_IGNORE;
|
|
2788
|
+
const M = S ? [...v, p.name].slice(0, y) : [...v, p.name];
|
|
2789
|
+
return r(M), !1;
|
|
2608
2790
|
},
|
|
2609
|
-
onRemove: (
|
|
2610
|
-
const v = Q(
|
|
2791
|
+
onRemove: (p) => {
|
|
2792
|
+
const v = Q(Yt(e)), M = /^(\d+)-/.exec(p.uid ?? ""), N = M ? Number(M[1]) : -1, _ = N >= 0 && N < v.length ? v.filter((z, C) => C !== N) : v.filter((z) => z !== p.name);
|
|
2611
2793
|
if (_.length < b) return !1;
|
|
2612
2794
|
r(_);
|
|
2613
2795
|
},
|
|
2614
2796
|
children: [
|
|
2615
|
-
/* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2797
|
+
/* @__PURE__ */ c("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ c(Ui, { type: d, size: 40 }) }),
|
|
2798
|
+
/* @__PURE__ */ c("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2617
2799
|
]
|
|
2618
2800
|
}
|
|
2619
2801
|
),
|
|
2620
|
-
/* @__PURE__ */
|
|
2802
|
+
/* @__PURE__ */ x(ee.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
2621
2803
|
"允许:",
|
|
2622
2804
|
m ?? "全部类型",
|
|
2623
2805
|
b > 0 ? `;至少 ${b} 个文件` : "",
|
|
2624
2806
|
S ? `;最多 ${y} 个文件` : "",
|
|
2625
2807
|
";当前仅收集文件名(不含文件内容,需宿主另行上传)",
|
|
2626
|
-
|
|
2808
|
+
h && t ? `(当前 ${g.length} 个,未达下限)` : ""
|
|
2627
2809
|
] })
|
|
2628
2810
|
] });
|
|
2629
2811
|
}
|
|
2630
|
-
const
|
|
2631
|
-
|
|
2632
|
-
|
|
2812
|
+
const Qi = J(
|
|
2813
|
+
Yi,
|
|
2814
|
+
Xi
|
|
2633
2815
|
);
|
|
2634
|
-
function
|
|
2816
|
+
function Zi({ context: e }) {
|
|
2635
2817
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2636
2818
|
component: "TextField",
|
|
2637
2819
|
changeAction: "change",
|
|
2638
2820
|
debounceChange: !0
|
|
2639
|
-
}), s = e.componentModel.properties, a =
|
|
2640
|
-
if (!m || !
|
|
2821
|
+
}), s = e.componentModel.properties, a = w(s.label), l = w(s.placeholder), u = w(s.variant) || "shortText", m = w(s.validationRegexp), d = Ce(n) ?? "", b = !t, [y, S] = E(""), g = (p) => {
|
|
2822
|
+
if (!m || !p.trim()) {
|
|
2641
2823
|
S("");
|
|
2642
2824
|
return;
|
|
2643
2825
|
}
|
|
2644
|
-
S(
|
|
2826
|
+
S(Bn(p, m) ? "" : "格式不正确");
|
|
2645
2827
|
};
|
|
2646
|
-
|
|
2828
|
+
B(() => {
|
|
2647
2829
|
g(d);
|
|
2648
2830
|
}, [m, d]);
|
|
2649
2831
|
const k = "form-block-preview-control";
|
|
2650
|
-
let
|
|
2651
|
-
if (
|
|
2652
|
-
|
|
2653
|
-
|
|
2832
|
+
let h;
|
|
2833
|
+
if (u === "longText")
|
|
2834
|
+
h = /* @__PURE__ */ c(
|
|
2835
|
+
et.TextArea,
|
|
2654
2836
|
{
|
|
2655
2837
|
disabled: b,
|
|
2656
2838
|
className: k,
|
|
@@ -2658,100 +2840,100 @@ function wi({ context: e }) {
|
|
|
2658
2840
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
2659
2841
|
value: d,
|
|
2660
2842
|
status: y ? "error" : void 0,
|
|
2661
|
-
onChange: (
|
|
2662
|
-
const v =
|
|
2843
|
+
onChange: (p) => {
|
|
2844
|
+
const v = p.target.value;
|
|
2663
2845
|
r(v), g(v);
|
|
2664
2846
|
},
|
|
2665
2847
|
onFocus: i,
|
|
2666
|
-
onBlur: (
|
|
2848
|
+
onBlur: (p) => g(p.target.value)
|
|
2667
2849
|
}
|
|
2668
2850
|
);
|
|
2669
|
-
else if (
|
|
2670
|
-
const
|
|
2671
|
-
|
|
2672
|
-
|
|
2851
|
+
else if (u === "number") {
|
|
2852
|
+
const p = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
|
|
2853
|
+
h = /* @__PURE__ */ c(
|
|
2854
|
+
or,
|
|
2673
2855
|
{
|
|
2674
2856
|
disabled: b,
|
|
2675
2857
|
className: k,
|
|
2676
2858
|
style: { width: "100%" },
|
|
2677
2859
|
placeholder: l || "数字",
|
|
2678
|
-
value:
|
|
2860
|
+
value: p,
|
|
2679
2861
|
onChange: (v) => r(v == null ? "" : String(v)),
|
|
2680
2862
|
onFocus: i
|
|
2681
2863
|
}
|
|
2682
2864
|
);
|
|
2683
|
-
} else
|
|
2684
|
-
|
|
2865
|
+
} else u === "obscured" ? h = /* @__PURE__ */ c(
|
|
2866
|
+
et.Password,
|
|
2685
2867
|
{
|
|
2686
2868
|
disabled: b,
|
|
2687
2869
|
className: k,
|
|
2688
2870
|
placeholder: l,
|
|
2689
2871
|
value: d,
|
|
2690
|
-
onChange: (
|
|
2872
|
+
onChange: (p) => r(p.target.value),
|
|
2691
2873
|
onFocus: i
|
|
2692
2874
|
}
|
|
2693
|
-
) :
|
|
2694
|
-
|
|
2875
|
+
) : h = /* @__PURE__ */ c(
|
|
2876
|
+
et,
|
|
2695
2877
|
{
|
|
2696
2878
|
disabled: b,
|
|
2697
2879
|
className: k,
|
|
2698
2880
|
placeholder: l,
|
|
2699
2881
|
value: d,
|
|
2700
2882
|
status: y ? "error" : void 0,
|
|
2701
|
-
onChange: (
|
|
2702
|
-
const v =
|
|
2883
|
+
onChange: (p) => {
|
|
2884
|
+
const v = p.target.value;
|
|
2703
2885
|
r(v), g(v);
|
|
2704
2886
|
},
|
|
2705
2887
|
onFocus: i,
|
|
2706
|
-
onBlur: (
|
|
2888
|
+
onBlur: (p) => g(p.target.value)
|
|
2707
2889
|
}
|
|
2708
2890
|
);
|
|
2709
|
-
return /* @__PURE__ */
|
|
2710
|
-
a ? /* @__PURE__ */
|
|
2711
|
-
|
|
2712
|
-
y ? /* @__PURE__ */
|
|
2891
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2892
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2893
|
+
h,
|
|
2894
|
+
y ? /* @__PURE__ */ c(ee.Text, { type: "danger", className: "form-block-preview-help", children: y }) : null
|
|
2713
2895
|
] });
|
|
2714
2896
|
}
|
|
2715
|
-
const
|
|
2897
|
+
const es = J(
|
|
2716
2898
|
{
|
|
2717
2899
|
name: "TextField",
|
|
2718
|
-
schema:
|
|
2719
|
-
label:
|
|
2720
|
-
variant:
|
|
2721
|
-
placeholder:
|
|
2722
|
-
validationRegexp:
|
|
2723
|
-
value:
|
|
2900
|
+
schema: f.object({
|
|
2901
|
+
label: f.any().optional(),
|
|
2902
|
+
variant: f.any().optional(),
|
|
2903
|
+
placeholder: f.any().optional(),
|
|
2904
|
+
validationRegexp: f.any().optional(),
|
|
2905
|
+
value: f.any().optional()
|
|
2724
2906
|
}).passthrough()
|
|
2725
2907
|
},
|
|
2726
|
-
|
|
2908
|
+
Zi
|
|
2727
2909
|
);
|
|
2728
|
-
function
|
|
2729
|
-
const t = e.componentModel.properties, n =
|
|
2730
|
-
return
|
|
2910
|
+
function ts({ context: e }) {
|
|
2911
|
+
const t = e.componentModel.properties, n = w(t.text), r = w(t.variant) || "body";
|
|
2912
|
+
return wi.has(r) ? r === "caption" ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ c("em", { children: n }) }) : /* @__PURE__ */ c(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ c(ee.Paragraph, { className: "form-block-preview-paragraph", children: n });
|
|
2731
2913
|
}
|
|
2732
|
-
const
|
|
2733
|
-
{ name: "Text", schema:
|
|
2734
|
-
|
|
2914
|
+
const ns = J(
|
|
2915
|
+
{ name: "Text", schema: Ee("Text") },
|
|
2916
|
+
ts
|
|
2735
2917
|
);
|
|
2736
|
-
function
|
|
2918
|
+
function jn() {
|
|
2737
2919
|
const t = [
|
|
2738
|
-
...[...
|
|
2739
|
-
(r) => !
|
|
2920
|
+
...[...Pe.components.values()].filter(
|
|
2921
|
+
(r) => !Ri.has(r.name)
|
|
2740
2922
|
),
|
|
2741
|
-
vi,
|
|
2742
|
-
_i,
|
|
2743
|
-
bi,
|
|
2744
|
-
Si,
|
|
2745
|
-
ki,
|
|
2746
|
-
xi,
|
|
2747
|
-
Ni,
|
|
2748
|
-
Ei,
|
|
2749
|
-
Pi,
|
|
2750
2923
|
zi,
|
|
2924
|
+
ji,
|
|
2925
|
+
Oi,
|
|
2926
|
+
Bi,
|
|
2751
2927
|
qi,
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2928
|
+
Di,
|
|
2929
|
+
Ki,
|
|
2930
|
+
Ji,
|
|
2931
|
+
Qi,
|
|
2932
|
+
es,
|
|
2933
|
+
ns,
|
|
2934
|
+
...qo()
|
|
2935
|
+
], n = [...Pe.functions.values()];
|
|
2936
|
+
return new pr(Ln, t, n, Pe.themeSchema);
|
|
2755
2937
|
}
|
|
2756
2938
|
const ie = {
|
|
2757
2939
|
jade9: "#29a383",
|
|
@@ -2765,7 +2947,7 @@ const ie = {
|
|
|
2765
2947
|
primaryHover: "#26997b",
|
|
2766
2948
|
primaryActive: "#1d3b31",
|
|
2767
2949
|
onPrimary: "#ffffff"
|
|
2768
|
-
},
|
|
2950
|
+
}, rs = {
|
|
2769
2951
|
cssVar: { key: "vidtempl" },
|
|
2770
2952
|
token: {
|
|
2771
2953
|
colorPrimary: ie.primarySolid,
|
|
@@ -2850,14 +3032,14 @@ const ie = {
|
|
|
2850
3032
|
}
|
|
2851
3033
|
}
|
|
2852
3034
|
};
|
|
2853
|
-
function
|
|
3035
|
+
function Ae({
|
|
2854
3036
|
children: e,
|
|
2855
3037
|
locale: t,
|
|
2856
3038
|
theme: n
|
|
2857
3039
|
}) {
|
|
2858
|
-
return /* @__PURE__ */
|
|
3040
|
+
return /* @__PURE__ */ c(ir, { theme: n ?? rs, locale: t, children: e });
|
|
2859
3041
|
}
|
|
2860
|
-
const
|
|
3042
|
+
const os = Jn(
|
|
2861
3043
|
function({
|
|
2862
3044
|
doc: t,
|
|
2863
3045
|
surfaceId: n = "skopon-form",
|
|
@@ -2867,68 +3049,68 @@ const Vi = Ln(
|
|
|
2867
3049
|
resumeSearch: s = null,
|
|
2868
3050
|
caseSearch: a = null,
|
|
2869
3051
|
wrapProvider: l = !0
|
|
2870
|
-
},
|
|
2871
|
-
|
|
2872
|
-
|
|
3052
|
+
}, u) {
|
|
3053
|
+
B(() => {
|
|
3054
|
+
cn(), ln();
|
|
2873
3055
|
}, []);
|
|
2874
3056
|
const m = A(null), d = A(i);
|
|
2875
3057
|
d.current = i;
|
|
2876
|
-
const b =
|
|
2877
|
-
if (
|
|
3058
|
+
const b = V(() => {
|
|
3059
|
+
if (gt(t)) return "";
|
|
2878
3060
|
try {
|
|
2879
3061
|
return JSON.stringify(t);
|
|
2880
3062
|
} catch {
|
|
2881
3063
|
return String(t);
|
|
2882
3064
|
}
|
|
2883
|
-
}, [t]), y =
|
|
3065
|
+
}, [t]), y = V(() => {
|
|
2884
3066
|
if (!b)
|
|
2885
3067
|
return { surfaces: [], processor: null };
|
|
2886
3068
|
try {
|
|
2887
|
-
const
|
|
3069
|
+
const h = JSON.parse(b), p = new an([jn()]), v = Jo(h, {
|
|
2888
3070
|
surfaceId: n,
|
|
2889
|
-
catalogId:
|
|
3071
|
+
catalogId: Ln
|
|
2890
3072
|
});
|
|
2891
|
-
return
|
|
2892
|
-
surfaces: Array.from(
|
|
2893
|
-
processor:
|
|
3073
|
+
return p.processMessages(v), {
|
|
3074
|
+
surfaces: Array.from(p.model.surfacesMap.values()),
|
|
3075
|
+
processor: p
|
|
2894
3076
|
};
|
|
2895
|
-
} catch (
|
|
2896
|
-
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败",
|
|
3077
|
+
} catch (h) {
|
|
3078
|
+
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", h), { surfaces: [], processor: null };
|
|
2897
3079
|
}
|
|
2898
3080
|
}, [b, n]), { surfaces: S, processor: g } = y;
|
|
2899
|
-
if (m.current = g,
|
|
2900
|
-
|
|
3081
|
+
if (m.current = g, Yn(
|
|
3082
|
+
u,
|
|
2901
3083
|
() => ({
|
|
2902
|
-
getValues(
|
|
2903
|
-
const
|
|
2904
|
-
if (!
|
|
2905
|
-
const v = (
|
|
2906
|
-
return
|
|
3084
|
+
getValues(h) {
|
|
3085
|
+
const p = m.current;
|
|
3086
|
+
if (!p) return {};
|
|
3087
|
+
const v = (h ?? d.current).map((M) => M.trim()).filter(Boolean);
|
|
3088
|
+
return Zo(p, n, v);
|
|
2907
3089
|
},
|
|
2908
|
-
setValues(
|
|
2909
|
-
const
|
|
2910
|
-
if (!
|
|
2911
|
-
const v =
|
|
3090
|
+
setValues(h) {
|
|
3091
|
+
const p = m.current;
|
|
3092
|
+
if (!p) return;
|
|
3093
|
+
const v = p.model.surfacesMap.get(n);
|
|
2912
3094
|
if (v)
|
|
2913
|
-
for (const [
|
|
2914
|
-
const _ =
|
|
3095
|
+
for (const [M, N] of Object.entries(h)) {
|
|
3096
|
+
const _ = M.trim();
|
|
2915
3097
|
_ && v.dataModel.set(`/${_}`, N);
|
|
2916
3098
|
}
|
|
2917
3099
|
}
|
|
2918
3100
|
}),
|
|
2919
3101
|
[n]
|
|
2920
3102
|
), S.length === 0) {
|
|
2921
|
-
const
|
|
2922
|
-
return l ? /* @__PURE__ */
|
|
3103
|
+
const h = /* @__PURE__ */ c(pt, { resumeSearch: s, children: /* @__PURE__ */ c(dt, { caseSearch: a, children: /* @__PURE__ */ c(mt, { interactive: o, children: r }) }) });
|
|
3104
|
+
return l ? /* @__PURE__ */ c(Ae, { children: h }) : h;
|
|
2923
3105
|
}
|
|
2924
|
-
const k = /* @__PURE__ */
|
|
2925
|
-
return l ? /* @__PURE__ */
|
|
3106
|
+
const k = /* @__PURE__ */ c(pt, { resumeSearch: s, children: /* @__PURE__ */ c(dt, { caseSearch: a, children: /* @__PURE__ */ c(mt, { interactive: o, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: S.map((h) => /* @__PURE__ */ c(sn, { surface: h }, h.id)) }) }) }) });
|
|
3107
|
+
return l ? /* @__PURE__ */ c(Ae, { children: k }) : k;
|
|
2926
3108
|
}
|
|
2927
3109
|
);
|
|
2928
|
-
function
|
|
2929
|
-
return new
|
|
3110
|
+
function we() {
|
|
3111
|
+
return new an([jn()]);
|
|
2930
3112
|
}
|
|
2931
|
-
function
|
|
3113
|
+
function js({
|
|
2932
3114
|
messages: e,
|
|
2933
3115
|
surfaceId: t = "skopon-form-stream",
|
|
2934
3116
|
emptyHint: n = null,
|
|
@@ -2936,84 +3118,84 @@ function _s({
|
|
|
2936
3118
|
resumeSearch: o = null,
|
|
2937
3119
|
caseSearch: i = null
|
|
2938
3120
|
}) {
|
|
2939
|
-
|
|
2940
|
-
|
|
3121
|
+
B(() => {
|
|
3122
|
+
cn(), ln();
|
|
2941
3123
|
}, []);
|
|
2942
3124
|
const s = A(null);
|
|
2943
|
-
s.current === null && (s.current =
|
|
2944
|
-
const a = A(0), l = A(""),
|
|
2945
|
-
function d(
|
|
2946
|
-
s.current =
|
|
2947
|
-
}
|
|
2948
|
-
function b(
|
|
2949
|
-
if (
|
|
2950
|
-
const v = JSON.stringify(
|
|
2951
|
-
if (!
|
|
3125
|
+
s.current === null && (s.current = we());
|
|
3126
|
+
const a = A(0), l = A(""), u = A(!0), m = A(t);
|
|
3127
|
+
function d(h, p) {
|
|
3128
|
+
s.current = h, a.current = p.length, l.current = JSON.stringify(p), u.current && (S(h), k(Array.from(h.model.surfacesMap.values())));
|
|
3129
|
+
}
|
|
3130
|
+
function b(h, p) {
|
|
3131
|
+
if (p <= 0) return !1;
|
|
3132
|
+
const v = JSON.stringify(h.slice(0, p)), M = l.current;
|
|
3133
|
+
if (!M) return !0;
|
|
2952
3134
|
try {
|
|
2953
|
-
const N = JSON.parse(
|
|
2954
|
-
return JSON.stringify(N.slice(0,
|
|
3135
|
+
const N = JSON.parse(M);
|
|
3136
|
+
return JSON.stringify(N.slice(0, p)) !== v;
|
|
2955
3137
|
} catch {
|
|
2956
3138
|
return !0;
|
|
2957
3139
|
}
|
|
2958
3140
|
}
|
|
2959
|
-
const [y, S] =
|
|
3141
|
+
const [y, S] = E(
|
|
2960
3142
|
() => s.current
|
|
2961
|
-
), [g, k] =
|
|
3143
|
+
), [g, k] = E(
|
|
2962
3144
|
() => Array.from(
|
|
2963
3145
|
s.current.model.surfacesMap.values()
|
|
2964
3146
|
)
|
|
2965
3147
|
);
|
|
2966
|
-
return
|
|
2967
|
-
|
|
2968
|
-
}), []),
|
|
3148
|
+
return B(() => (u.current = !0, () => {
|
|
3149
|
+
u.current = !1;
|
|
3150
|
+
}), []), B(() => {
|
|
2969
3151
|
s.current = y;
|
|
2970
|
-
}, [y]),
|
|
2971
|
-
const
|
|
2972
|
-
|
|
2973
|
-
},
|
|
3152
|
+
}, [y]), B(() => {
|
|
3153
|
+
const h = () => {
|
|
3154
|
+
u.current && k(Array.from(y.model.surfacesMap.values()));
|
|
3155
|
+
}, p = y.onSurfaceCreated(h), v = y.onSurfaceDeleted(h);
|
|
2974
3156
|
return () => {
|
|
2975
|
-
|
|
3157
|
+
p.unsubscribe(), v.unsubscribe();
|
|
2976
3158
|
};
|
|
2977
|
-
}, [y]),
|
|
2978
|
-
let
|
|
2979
|
-
const
|
|
2980
|
-
if (m.current = t,
|
|
2981
|
-
const _ =
|
|
2982
|
-
return Array.isArray(e) && e.length > 0 ? (_.processMessages(e),
|
|
2983
|
-
|
|
3159
|
+
}, [y]), B(() => {
|
|
3160
|
+
let h = !1;
|
|
3161
|
+
const p = m.current !== t;
|
|
3162
|
+
if (m.current = t, p) {
|
|
3163
|
+
const _ = we();
|
|
3164
|
+
return Array.isArray(e) && e.length > 0 ? (_.processMessages(e), h || d(_, e)) : (s.current = _, a.current = 0, l.current = "", h || (S(_), k([]))), () => {
|
|
3165
|
+
h = !0;
|
|
2984
3166
|
};
|
|
2985
3167
|
}
|
|
2986
3168
|
if (!Array.isArray(e) || e.length === 0) {
|
|
2987
3169
|
if (a.current > 0) {
|
|
2988
|
-
const _ =
|
|
2989
|
-
s.current = _, a.current = 0, l.current = "",
|
|
3170
|
+
const _ = we();
|
|
3171
|
+
s.current = _, a.current = 0, l.current = "", h || (S(_), k([]));
|
|
2990
3172
|
}
|
|
2991
3173
|
return () => {
|
|
2992
|
-
|
|
3174
|
+
h = !0;
|
|
2993
3175
|
};
|
|
2994
3176
|
}
|
|
2995
|
-
const v = s.current,
|
|
2996
|
-
if (e.length <
|
|
2997
|
-
const _ =
|
|
2998
|
-
return _.processMessages(e),
|
|
2999
|
-
|
|
3177
|
+
const v = s.current, M = a.current;
|
|
3178
|
+
if (e.length < M || b(e, M)) {
|
|
3179
|
+
const _ = we();
|
|
3180
|
+
return _.processMessages(e), h || d(_, e), () => {
|
|
3181
|
+
h = !0;
|
|
3000
3182
|
};
|
|
3001
3183
|
}
|
|
3002
|
-
const N = e.slice(
|
|
3184
|
+
const N = e.slice(M);
|
|
3003
3185
|
return N.length === 0 ? () => {
|
|
3004
|
-
|
|
3005
|
-
} : (v.processMessages(N), a.current = e.length, l.current = JSON.stringify(e),
|
|
3006
|
-
|
|
3186
|
+
h = !0;
|
|
3187
|
+
} : (v.processMessages(N), a.current = e.length, l.current = JSON.stringify(e), h || k(Array.from(v.model.surfacesMap.values())), () => {
|
|
3188
|
+
h = !0;
|
|
3007
3189
|
});
|
|
3008
|
-
}, [e, t]), g.length === 0 ? /* @__PURE__ */
|
|
3190
|
+
}, [e, t]), g.length === 0 ? /* @__PURE__ */ c(Ae, { children: n }) : /* @__PURE__ */ c(Ae, { children: /* @__PURE__ */ c(pt, { resumeSearch: o, children: /* @__PURE__ */ c(dt, { caseSearch: i, children: /* @__PURE__ */ c(mt, { interactive: r, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: g.map((h) => /* @__PURE__ */ c(sn, { surface: h }, h.id)) }) }) }) }) });
|
|
3009
3191
|
}
|
|
3010
|
-
const
|
|
3011
|
-
function
|
|
3192
|
+
const is = 100, ss = 3e4, as = 1500, fe = /* @__PURE__ */ new Map();
|
|
3193
|
+
function ls(e) {
|
|
3012
3194
|
const t = e.trim();
|
|
3013
3195
|
let n = fe.get(t);
|
|
3014
|
-
return n || (n = new
|
|
3196
|
+
return n || (n = new cs(t), fe.set(t, n)), n.acquire(), n;
|
|
3015
3197
|
}
|
|
3016
|
-
class
|
|
3198
|
+
class cs {
|
|
3017
3199
|
constructor(t) {
|
|
3018
3200
|
G(this, "url");
|
|
3019
3201
|
G(this, "ws", null);
|
|
@@ -3032,7 +3214,7 @@ class Hi {
|
|
|
3032
3214
|
release() {
|
|
3033
3215
|
this.refCount = Math.max(0, this.refCount - 1), !(this.refCount > 0) && (this.clearReleaseTimer(), this.releaseTimer = setTimeout(() => {
|
|
3034
3216
|
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), fe.get(this.url) === this && fe.delete(this.url));
|
|
3035
|
-
},
|
|
3217
|
+
}, as));
|
|
3036
3218
|
}
|
|
3037
3219
|
/** 强制关闭(测试用),跳过宽限期。 */
|
|
3038
3220
|
forceClose() {
|
|
@@ -3105,7 +3287,7 @@ class Hi {
|
|
|
3105
3287
|
}
|
|
3106
3288
|
}
|
|
3107
3289
|
enqueue(t) {
|
|
3108
|
-
for (this.sendQueue.push(t); this.sendQueue.length >
|
|
3290
|
+
for (this.sendQueue.push(t); this.sendQueue.length > is; )
|
|
3109
3291
|
this.sendQueue.shift();
|
|
3110
3292
|
}
|
|
3111
3293
|
flushQueue() {
|
|
@@ -3119,7 +3301,7 @@ class Hi {
|
|
|
3119
3301
|
if (!this.connectRequested || this.refCount <= 0) return;
|
|
3120
3302
|
this.clearReconnectTimer();
|
|
3121
3303
|
const t = Math.min(
|
|
3122
|
-
|
|
3304
|
+
ss,
|
|
3123
3305
|
1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
|
|
3124
3306
|
);
|
|
3125
3307
|
this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
|
|
@@ -3157,13 +3339,13 @@ class Hi {
|
|
|
3157
3339
|
}
|
|
3158
3340
|
}
|
|
3159
3341
|
}
|
|
3160
|
-
class
|
|
3342
|
+
class us {
|
|
3161
3343
|
constructor(t) {
|
|
3162
3344
|
G(this, "askUserMessageId");
|
|
3163
3345
|
G(this, "connection");
|
|
3164
3346
|
G(this, "unsubscribe");
|
|
3165
3347
|
G(this, "closed", !1);
|
|
3166
|
-
this.askUserMessageId = t.askUserMessageId.trim(), this.connection =
|
|
3348
|
+
this.askUserMessageId = t.askUserMessageId.trim(), this.connection = ls(t.url);
|
|
3167
3349
|
const n = t.onAutoControl;
|
|
3168
3350
|
this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
|
|
3169
3351
|
};
|
|
@@ -3178,24 +3360,24 @@ class Ki {
|
|
|
3178
3360
|
this.closed || (this.closed = !0, this.unsubscribe(), this.connection.release());
|
|
3179
3361
|
}
|
|
3180
3362
|
}
|
|
3181
|
-
function
|
|
3363
|
+
function $n(e) {
|
|
3182
3364
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3183
3365
|
}
|
|
3184
|
-
function
|
|
3366
|
+
function ms(e, t) {
|
|
3185
3367
|
if (!e) return !1;
|
|
3186
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3368
|
+
const n = e.querySelector(`[data-skopon-field="${$n(t)}"]`);
|
|
3187
3369
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3188
3370
|
'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
|
|
3189
3371
|
) ?? n).focus(), !0) : !1;
|
|
3190
3372
|
}
|
|
3191
|
-
function
|
|
3373
|
+
function ds(e, t) {
|
|
3192
3374
|
if (!e) return !1;
|
|
3193
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3375
|
+
const n = e.querySelector(`[data-skopon-field="${$n(t)}"]`);
|
|
3194
3376
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3195
3377
|
'button, [role="button"], .skopon-resume-select-card, input, label'
|
|
3196
3378
|
) ?? n).click(), !0) : !1;
|
|
3197
3379
|
}
|
|
3198
|
-
function
|
|
3380
|
+
function ps(e, t, n) {
|
|
3199
3381
|
const r = e.action;
|
|
3200
3382
|
if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
|
|
3201
3383
|
console.warn("[FormAutoControl] unknown action", r);
|
|
@@ -3225,47 +3407,47 @@ function Wi(e, t, n) {
|
|
|
3225
3407
|
return;
|
|
3226
3408
|
}
|
|
3227
3409
|
if (r === "focus") {
|
|
3228
|
-
|
|
3410
|
+
ms(t.rootElement, o), n.reportEvent({
|
|
3229
3411
|
action: "focus",
|
|
3230
3412
|
component: i,
|
|
3231
3413
|
field: o
|
|
3232
3414
|
});
|
|
3233
3415
|
return;
|
|
3234
3416
|
}
|
|
3235
|
-
|
|
3417
|
+
ds(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
|
|
3236
3418
|
});
|
|
3237
3419
|
}
|
|
3238
|
-
function
|
|
3420
|
+
function fs(e) {
|
|
3239
3421
|
const t = {};
|
|
3240
3422
|
for (const [n, r] of Object.entries(e))
|
|
3241
3423
|
r !== void 0 && (t[n] = r);
|
|
3242
3424
|
return t;
|
|
3243
3425
|
}
|
|
3244
|
-
function
|
|
3426
|
+
function hs(e, t) {
|
|
3245
3427
|
var o;
|
|
3246
3428
|
const n = (o = e.name) == null ? void 0 : o.trim();
|
|
3247
3429
|
if (!n || !t) return { ...e };
|
|
3248
3430
|
const r = t.get(n);
|
|
3249
3431
|
return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
|
|
3250
3432
|
}
|
|
3251
|
-
function
|
|
3433
|
+
function gs(e) {
|
|
3252
3434
|
var i, s;
|
|
3253
3435
|
const n = {
|
|
3254
3436
|
blocks: (e.blocks ?? []).map(
|
|
3255
|
-
(a) =>
|
|
3437
|
+
(a) => hs(a, e.liveOptions)
|
|
3256
3438
|
)
|
|
3257
3439
|
}, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
|
|
3258
3440
|
return r && (n.title = r), o && (n.description = o), {
|
|
3259
3441
|
form_schema: n,
|
|
3260
|
-
form_values:
|
|
3442
|
+
form_values: fs(e.values ?? {}),
|
|
3261
3443
|
form_change: [...e.formChange ?? []]
|
|
3262
3444
|
};
|
|
3263
3445
|
}
|
|
3264
|
-
function
|
|
3265
|
-
const t =
|
|
3266
|
-
return t ?
|
|
3446
|
+
function ys(e) {
|
|
3447
|
+
const t = $e(e);
|
|
3448
|
+
return t ? qe(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
3267
3449
|
}
|
|
3268
|
-
function
|
|
3450
|
+
function vs({
|
|
3269
3451
|
payload: e,
|
|
3270
3452
|
callbackUrl: t,
|
|
3271
3453
|
title: n,
|
|
@@ -3275,17 +3457,17 @@ function es({
|
|
|
3275
3457
|
submitHeaders: s,
|
|
3276
3458
|
onNotify: a
|
|
3277
3459
|
}) {
|
|
3278
|
-
const [l,
|
|
3279
|
-
|
|
3460
|
+
const [l, u] = E(!1), m = A(!0);
|
|
3461
|
+
B(() => (m.current = !0, () => {
|
|
3280
3462
|
m.current = !1;
|
|
3281
3463
|
}), []);
|
|
3282
|
-
const d =
|
|
3283
|
-
() =>
|
|
3464
|
+
const d = V(
|
|
3465
|
+
() => Ft(s),
|
|
3284
3466
|
[s]
|
|
3285
|
-
), b =
|
|
3286
|
-
() =>
|
|
3467
|
+
), b = V(
|
|
3468
|
+
() => Un(e, t, d),
|
|
3287
3469
|
[e, t, d]
|
|
3288
|
-
), y =
|
|
3470
|
+
), y = V(
|
|
3289
3471
|
() => ({
|
|
3290
3472
|
...i,
|
|
3291
3473
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? t ?? null
|
|
@@ -3294,36 +3476,36 @@ function es({
|
|
|
3294
3476
|
);
|
|
3295
3477
|
async function S() {
|
|
3296
3478
|
if (!l) {
|
|
3297
|
-
|
|
3479
|
+
u(!0);
|
|
3298
3480
|
try {
|
|
3299
|
-
const g =
|
|
3481
|
+
const g = ys(e), k = Et({
|
|
3300
3482
|
context: y,
|
|
3301
3483
|
payload: e,
|
|
3302
3484
|
answer: g
|
|
3303
|
-
}),
|
|
3485
|
+
}), h = await On(k, {
|
|
3304
3486
|
headers: d
|
|
3305
3487
|
});
|
|
3306
3488
|
if (!m.current) return;
|
|
3307
|
-
const
|
|
3308
|
-
a == null || a(
|
|
3489
|
+
const p = zn(h);
|
|
3490
|
+
a == null || a(p.type, p.message);
|
|
3309
3491
|
} catch (g) {
|
|
3310
3492
|
if (!m.current) return;
|
|
3311
3493
|
const k = g instanceof Error ? g.message : "提交失败";
|
|
3312
3494
|
a == null || a("error", k);
|
|
3313
3495
|
} finally {
|
|
3314
|
-
m.current &&
|
|
3496
|
+
m.current && u(!1);
|
|
3315
3497
|
}
|
|
3316
3498
|
}
|
|
3317
3499
|
}
|
|
3318
|
-
return /* @__PURE__ */
|
|
3319
|
-
/* @__PURE__ */
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
3322
|
-
r ? /* @__PURE__ */
|
|
3323
|
-
o ? /* @__PURE__ */
|
|
3500
|
+
return /* @__PURE__ */ x("div", { className: "ask-user-curl-card", children: [
|
|
3501
|
+
/* @__PURE__ */ x("div", { className: "ask-user-curl-card-header", children: [
|
|
3502
|
+
/* @__PURE__ */ x("div", { className: "ask-user-curl-card-header-title", children: [
|
|
3503
|
+
/* @__PURE__ */ c(ee.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
3504
|
+
r ? /* @__PURE__ */ c(he, { title: r, children: /* @__PURE__ */ c(ve, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
3505
|
+
o ? /* @__PURE__ */ c(he, { title: o, children: /* @__PURE__ */ c(ve, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
3324
3506
|
] }),
|
|
3325
|
-
/* @__PURE__ */
|
|
3326
|
-
|
|
3507
|
+
/* @__PURE__ */ c(he, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ c(
|
|
3508
|
+
xe,
|
|
3327
3509
|
{
|
|
3328
3510
|
size: "small",
|
|
3329
3511
|
type: "text",
|
|
@@ -3334,11 +3516,11 @@ function es({
|
|
|
3334
3516
|
}
|
|
3335
3517
|
) })
|
|
3336
3518
|
] }),
|
|
3337
|
-
/* @__PURE__ */
|
|
3519
|
+
/* @__PURE__ */ c("pre", { className: "skopon-form-curl-json", children: b })
|
|
3338
3520
|
] });
|
|
3339
3521
|
}
|
|
3340
|
-
const
|
|
3341
|
-
function
|
|
3522
|
+
const bs = 80;
|
|
3523
|
+
function Ss(e, t) {
|
|
3342
3524
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
3343
3525
|
const n = t.message;
|
|
3344
3526
|
if (typeof n == "string" && n.trim())
|
|
@@ -3346,7 +3528,7 @@ function ns(e, t) {
|
|
|
3346
3528
|
}
|
|
3347
3529
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
3348
3530
|
}
|
|
3349
|
-
function
|
|
3531
|
+
function ks({
|
|
3350
3532
|
payload: e,
|
|
3351
3533
|
formUniqueId: t,
|
|
3352
3534
|
askUserMessageId: n,
|
|
@@ -3356,263 +3538,263 @@ function rs({
|
|
|
3356
3538
|
submitHeaders: s,
|
|
3357
3539
|
fetchFormDetail: a,
|
|
3358
3540
|
onNotify: l,
|
|
3359
|
-
resumeSearch:
|
|
3541
|
+
resumeSearch: u = null,
|
|
3360
3542
|
caseSearch: m = null,
|
|
3361
3543
|
onSurfaceReadyChange: d,
|
|
3362
3544
|
onAutoControlReady: b
|
|
3363
3545
|
}) {
|
|
3364
|
-
const [y, S] =
|
|
3546
|
+
const [y, S] = E(null), [g, k] = E(!1), [h, p] = E(!0), [v, M] = E(!1), N = A(null), _ = A(null), z = A(!0), C = A(l);
|
|
3365
3547
|
C.current = l;
|
|
3366
|
-
const
|
|
3367
|
-
() =>
|
|
3548
|
+
const q = bn(), L = St(), re = A(""), K = A(null), $ = (t == null ? void 0 : t.trim()) ?? "", Y = (n == null ? void 0 : n.trim()) ?? "", te = V(
|
|
3549
|
+
() => Ft(s),
|
|
3368
3550
|
[s]
|
|
3369
|
-
),
|
|
3551
|
+
), ne = V(
|
|
3370
3552
|
() => ({
|
|
3371
3553
|
...i,
|
|
3372
3554
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? r ?? null
|
|
3373
3555
|
}),
|
|
3374
3556
|
[i, r]
|
|
3375
3557
|
);
|
|
3376
|
-
|
|
3558
|
+
B(() => (z.current = !0, () => {
|
|
3377
3559
|
z.current = !1, K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3378
|
-
}), []),
|
|
3379
|
-
let
|
|
3380
|
-
return $ ? (
|
|
3381
|
-
|
|
3560
|
+
}), []), B(() => {
|
|
3561
|
+
let F = !1;
|
|
3562
|
+
return $ ? (p(!0), k(!1), a({ formUniqueId: $ }).then((O) => {
|
|
3563
|
+
F || (k(!!O.disabled), S(O.formDefinition ?? null));
|
|
3382
3564
|
}).catch((O) => {
|
|
3383
|
-
var
|
|
3384
|
-
if (!
|
|
3565
|
+
var W;
|
|
3566
|
+
if (!F) {
|
|
3385
3567
|
k(!1), S(null);
|
|
3386
|
-
const
|
|
3387
|
-
(
|
|
3568
|
+
const Ue = O instanceof Error ? O.message : "获取表单定义失败";
|
|
3569
|
+
(W = C.current) == null || W.call(C, "error", Ue);
|
|
3388
3570
|
}
|
|
3389
3571
|
}).finally(() => {
|
|
3390
|
-
|
|
3572
|
+
F || p(!1);
|
|
3391
3573
|
}), () => {
|
|
3392
|
-
|
|
3393
|
-
}) : (
|
|
3394
|
-
|
|
3574
|
+
F = !0;
|
|
3575
|
+
}) : (p(!1), k(!1), S(null), () => {
|
|
3576
|
+
F = !0;
|
|
3395
3577
|
});
|
|
3396
3578
|
}, [$, a]);
|
|
3397
|
-
const
|
|
3398
|
-
if (D &&
|
|
3399
|
-
return
|
|
3400
|
-
const
|
|
3401
|
-
return { ...
|
|
3579
|
+
const U = V(() => $e(e), [e]), P = V(() => U ? oi(U, y ?? void 0) : null, [U, y]), T = (P == null ? void 0 : P.matchedBlocks) ?? [], D = !!(U && ii(U) && T.length === 0), R = V(() => D && U ? si(U) : P && P.renderBlocks.length > 0 ? P.renderBlocks : [], [P, D, U]), I = V(() => {
|
|
3580
|
+
if (D && U)
|
|
3581
|
+
return ai(U);
|
|
3582
|
+
const F = qe((P == null ? void 0 : P.extraBlocks) ?? []);
|
|
3583
|
+
return { ...qe(
|
|
3402
3584
|
((P == null ? void 0 : P.matchedBlocks) ?? []).filter(
|
|
3403
|
-
(
|
|
3585
|
+
(W) => W.type === "text" && W.hidden === !0
|
|
3404
3586
|
)
|
|
3405
|
-
), ...
|
|
3406
|
-
}, [D,
|
|
3407
|
-
() =>
|
|
3587
|
+
), ...F };
|
|
3588
|
+
}, [D, U, P]), X = V(
|
|
3589
|
+
() => R.filter((F) => {
|
|
3408
3590
|
var O;
|
|
3409
|
-
return Z(
|
|
3410
|
-
}).map((
|
|
3411
|
-
[
|
|
3412
|
-
),
|
|
3413
|
-
{ title:
|
|
3414
|
-
|
|
3415
|
-
), [
|
|
3416
|
-
if (!
|
|
3591
|
+
return Z(F.type) && ((O = F.name) == null ? void 0 : O.trim());
|
|
3592
|
+
}).map((F) => F.name.trim()),
|
|
3593
|
+
[R]
|
|
3594
|
+
), ue = (P == null ? void 0 : P.title) ?? (U == null ? void 0 : U.title) ?? "", me = (P == null ? void 0 : P.description) ?? (U == null ? void 0 : U.description) ?? "", de = V(() => R.length === 0 ? null : Xo(
|
|
3595
|
+
{ title: ue, description: me },
|
|
3596
|
+
R
|
|
3597
|
+
), [ue, me, R]), Ke = V(() => {
|
|
3598
|
+
if (!de) return "";
|
|
3417
3599
|
try {
|
|
3418
|
-
return JSON.stringify(
|
|
3600
|
+
return JSON.stringify(de);
|
|
3419
3601
|
} catch {
|
|
3420
|
-
return String(
|
|
3602
|
+
return String(de);
|
|
3421
3603
|
}
|
|
3422
|
-
}, [
|
|
3423
|
-
|
|
3424
|
-
const
|
|
3604
|
+
}, [de]), We = $ ? `ask-user-${$}` : "ask-user-payload", oe = !!(!h && U && R.length > 0 && de);
|
|
3605
|
+
B(() => (d(oe), () => d(!1)), [oe, d]);
|
|
3606
|
+
const Rt = j(() => {
|
|
3425
3607
|
var O;
|
|
3426
|
-
return { ...((O = N.current) == null ? void 0 : O.getValues(
|
|
3427
|
-
}, [
|
|
3428
|
-
|
|
3429
|
-
const
|
|
3430
|
-
|
|
3431
|
-
const
|
|
3432
|
-
(
|
|
3433
|
-
const O =
|
|
3434
|
-
title:
|
|
3435
|
-
description:
|
|
3436
|
-
blocks:
|
|
3437
|
-
values:
|
|
3438
|
-
liveOptions:
|
|
3439
|
-
formChange:
|
|
3608
|
+
return { ...((O = N.current) == null ? void 0 : O.getValues(X)) ?? {}, ...I };
|
|
3609
|
+
}, [X, I]), wt = A(L.liveOptions);
|
|
3610
|
+
wt.current = L.liveOptions;
|
|
3611
|
+
const Ge = A(L.pendingChangeFields);
|
|
3612
|
+
Ge.current = L.pendingChangeFields;
|
|
3613
|
+
const ge = j(
|
|
3614
|
+
(F) => {
|
|
3615
|
+
const O = gs({
|
|
3616
|
+
title: ue,
|
|
3617
|
+
description: me,
|
|
3618
|
+
blocks: R,
|
|
3619
|
+
values: Rt(),
|
|
3620
|
+
liveOptions: wt.current,
|
|
3621
|
+
formChange: F
|
|
3440
3622
|
});
|
|
3441
|
-
|
|
3623
|
+
q.reportData(O);
|
|
3442
3624
|
},
|
|
3443
|
-
[
|
|
3444
|
-
),
|
|
3445
|
-
|
|
3625
|
+
[ue, me, R, Rt, q]
|
|
3626
|
+
), Je = A(ge);
|
|
3627
|
+
Je.current = ge, B(() => {
|
|
3446
3628
|
if (!oe) {
|
|
3447
3629
|
re.current = "";
|
|
3448
3630
|
return;
|
|
3449
3631
|
}
|
|
3450
|
-
if (!
|
|
3451
|
-
const
|
|
3452
|
-
if (re.current ===
|
|
3632
|
+
if (!Ke) return;
|
|
3633
|
+
const F = `${We}::${Ke}`;
|
|
3634
|
+
if (re.current === F) return;
|
|
3453
3635
|
const O = setTimeout(() => {
|
|
3454
|
-
z.current && re.current !==
|
|
3636
|
+
z.current && re.current !== F && (re.current = F, Je.current([]));
|
|
3455
3637
|
}, 0);
|
|
3456
3638
|
return () => clearTimeout(O);
|
|
3457
|
-
}, [oe,
|
|
3458
|
-
if (!(!oe ||
|
|
3639
|
+
}, [oe, We, Ke]), B(() => {
|
|
3640
|
+
if (!(!oe || L.version === 0) && Ge.current.length !== 0)
|
|
3459
3641
|
return K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
|
|
3460
3642
|
if (K.current = null, !z.current) return;
|
|
3461
|
-
const
|
|
3462
|
-
|
|
3463
|
-
},
|
|
3643
|
+
const F = [...Ge.current];
|
|
3644
|
+
L.clearPendingChangeFields(), F.length !== 0 && Je.current(F);
|
|
3645
|
+
}, bs), () => {
|
|
3464
3646
|
K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3465
3647
|
};
|
|
3466
|
-
}, [oe,
|
|
3467
|
-
const
|
|
3468
|
-
var
|
|
3648
|
+
}, [oe, L.version, L.clearPendingChangeFields]);
|
|
3649
|
+
const Ye = j(async () => {
|
|
3650
|
+
var F, O, W, Ue, Ot, Bt, qt, Lt;
|
|
3469
3651
|
if (!v) {
|
|
3470
|
-
|
|
3652
|
+
M(!0);
|
|
3471
3653
|
try {
|
|
3472
|
-
const
|
|
3473
|
-
if (
|
|
3474
|
-
(O = C.current) == null || O.call(C, "error",
|
|
3654
|
+
const ye = { ...((F = N.current) == null ? void 0 : F.getValues(X)) ?? {}, ...I }, Vt = Ii(R, ye);
|
|
3655
|
+
if (Vt) {
|
|
3656
|
+
(O = C.current) == null || O.call(C, "error", Vt.message);
|
|
3475
3657
|
return;
|
|
3476
3658
|
}
|
|
3477
3659
|
if (o === "post") {
|
|
3478
|
-
const
|
|
3479
|
-
if (!
|
|
3480
|
-
(
|
|
3660
|
+
const Ht = (r ?? "").trim();
|
|
3661
|
+
if (!Ht) {
|
|
3662
|
+
(W = C.current) == null || W.call(C, "error", "callback_url 为空,无法提交");
|
|
3481
3663
|
return;
|
|
3482
3664
|
}
|
|
3483
|
-
|
|
3665
|
+
ge([]), q.reportEvent({
|
|
3484
3666
|
action: "submit",
|
|
3485
3667
|
component: "SubmitButton"
|
|
3486
3668
|
});
|
|
3487
|
-
const
|
|
3488
|
-
headers:
|
|
3669
|
+
const Qe = await Rn(Ht, ye, {
|
|
3670
|
+
headers: te
|
|
3489
3671
|
});
|
|
3490
3672
|
if (!z.current) return;
|
|
3491
|
-
|
|
3673
|
+
Qe.ok ? (Ue = C.current) == null || Ue.call(C, "success", "提交成功") : (Ot = C.current) == null || Ot.call(C, "error", Ss(Qe.status, Qe.body));
|
|
3492
3674
|
return;
|
|
3493
3675
|
}
|
|
3494
|
-
const
|
|
3495
|
-
title:
|
|
3496
|
-
description:
|
|
3497
|
-
blocks:
|
|
3498
|
-
} :
|
|
3499
|
-
context:
|
|
3676
|
+
const Dn = R.length > 0 ? {
|
|
3677
|
+
title: ue,
|
|
3678
|
+
description: me,
|
|
3679
|
+
blocks: R
|
|
3680
|
+
} : U ?? void 0, jt = Et({
|
|
3681
|
+
context: ne,
|
|
3500
3682
|
payload: e,
|
|
3501
|
-
form:
|
|
3502
|
-
answer:
|
|
3503
|
-
}),
|
|
3504
|
-
if (
|
|
3505
|
-
(
|
|
3683
|
+
form: Dn,
|
|
3684
|
+
answer: ye
|
|
3685
|
+
}), $t = Ut(jt);
|
|
3686
|
+
if ($t) {
|
|
3687
|
+
(Bt = C.current) == null || Bt.call(C, "error", $t);
|
|
3506
3688
|
return;
|
|
3507
3689
|
}
|
|
3508
|
-
|
|
3690
|
+
ge([]), q.reportEvent({
|
|
3509
3691
|
action: "submit",
|
|
3510
3692
|
component: "SubmitButton"
|
|
3511
3693
|
});
|
|
3512
|
-
const
|
|
3513
|
-
headers:
|
|
3694
|
+
const Hn = await On(jt, {
|
|
3695
|
+
headers: te
|
|
3514
3696
|
});
|
|
3515
3697
|
if (!z.current) return;
|
|
3516
|
-
const
|
|
3517
|
-
(
|
|
3518
|
-
} catch (
|
|
3698
|
+
const Dt = zn(Hn);
|
|
3699
|
+
(qt = C.current) == null || qt.call(C, Dt.type, Dt.message);
|
|
3700
|
+
} catch (Xe) {
|
|
3519
3701
|
if (!z.current) return;
|
|
3520
|
-
const
|
|
3521
|
-
(
|
|
3702
|
+
const ye = Xe instanceof Error ? Xe.message : "提交失败";
|
|
3703
|
+
(Lt = C.current) == null || Lt.call(C, "error", ye);
|
|
3522
3704
|
} finally {
|
|
3523
|
-
z.current &&
|
|
3705
|
+
z.current && M(!1);
|
|
3524
3706
|
}
|
|
3525
3707
|
}
|
|
3526
3708
|
}, [
|
|
3527
3709
|
v,
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
ce,
|
|
3710
|
+
X,
|
|
3711
|
+
R,
|
|
3531
3712
|
ue,
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3713
|
+
me,
|
|
3714
|
+
I,
|
|
3715
|
+
ge,
|
|
3716
|
+
q,
|
|
3535
3717
|
o,
|
|
3536
3718
|
r,
|
|
3537
|
-
ee,
|
|
3538
3719
|
te,
|
|
3720
|
+
ne,
|
|
3539
3721
|
e,
|
|
3540
|
-
|
|
3541
|
-
]),
|
|
3542
|
-
|
|
3543
|
-
const
|
|
3544
|
-
(
|
|
3545
|
-
|
|
3546
|
-
|
|
3722
|
+
U
|
|
3723
|
+
]), Pt = A(Ye);
|
|
3724
|
+
Pt.current = Ye;
|
|
3725
|
+
const zt = j(
|
|
3726
|
+
(F) => {
|
|
3727
|
+
ps(
|
|
3728
|
+
F,
|
|
3547
3729
|
{
|
|
3548
3730
|
setValues: (O) => {
|
|
3549
|
-
var
|
|
3550
|
-
return (
|
|
3731
|
+
var W;
|
|
3732
|
+
return (W = N.current) == null ? void 0 : W.setValues(O);
|
|
3551
3733
|
},
|
|
3552
3734
|
getValues: (O) => {
|
|
3553
|
-
var
|
|
3554
|
-
return ((
|
|
3735
|
+
var W;
|
|
3736
|
+
return ((W = N.current) == null ? void 0 : W.getValues(O)) ?? {};
|
|
3555
3737
|
},
|
|
3556
|
-
submit: () =>
|
|
3738
|
+
submit: () => Pt.current(),
|
|
3557
3739
|
rootElement: _.current
|
|
3558
3740
|
},
|
|
3559
3741
|
{
|
|
3560
|
-
reportEvent:
|
|
3561
|
-
runAutoControl:
|
|
3742
|
+
reportEvent: q.reportEvent,
|
|
3743
|
+
runAutoControl: q.runAutoControl
|
|
3562
3744
|
}
|
|
3563
3745
|
);
|
|
3564
3746
|
},
|
|
3565
|
-
[
|
|
3747
|
+
[q]
|
|
3566
3748
|
);
|
|
3567
|
-
return
|
|
3749
|
+
return B(() => {
|
|
3568
3750
|
if (!oe) {
|
|
3569
3751
|
b(null);
|
|
3570
3752
|
return;
|
|
3571
3753
|
}
|
|
3572
|
-
return b(
|
|
3573
|
-
}, [oe,
|
|
3574
|
-
|
|
3754
|
+
return b(zt), () => b(null);
|
|
3755
|
+
}, [oe, zt, b]), h ? /* @__PURE__ */ c("div", { className: "ask-user-form-card", children: /* @__PURE__ */ c(yt, { size: "small" }) }) : !U || R.length === 0 ? /* @__PURE__ */ c(
|
|
3756
|
+
vs,
|
|
3575
3757
|
{
|
|
3576
3758
|
payload: e,
|
|
3577
3759
|
callbackUrl: r,
|
|
3578
|
-
answerAgentContext:
|
|
3760
|
+
answerAgentContext: ne,
|
|
3579
3761
|
submitHeaders: s,
|
|
3580
3762
|
unpublishedFormId: g && $ ? $ : void 0,
|
|
3581
3763
|
onNotify: l
|
|
3582
3764
|
}
|
|
3583
|
-
) : /* @__PURE__ */
|
|
3765
|
+
) : /* @__PURE__ */ x(
|
|
3584
3766
|
"div",
|
|
3585
3767
|
{
|
|
3586
3768
|
className: "ask-user-form-card",
|
|
3587
3769
|
ref: _,
|
|
3588
|
-
"data-ask-user-message-id":
|
|
3770
|
+
"data-ask-user-message-id": Y || void 0,
|
|
3589
3771
|
children: [
|
|
3590
|
-
g && $ ? /* @__PURE__ */
|
|
3591
|
-
/* @__PURE__ */
|
|
3592
|
-
|
|
3772
|
+
g && $ ? /* @__PURE__ */ c("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ c(he, { title: $, children: /* @__PURE__ */ c(ve, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
3773
|
+
/* @__PURE__ */ c(
|
|
3774
|
+
os,
|
|
3593
3775
|
{
|
|
3594
3776
|
ref: N,
|
|
3595
|
-
doc:
|
|
3596
|
-
surfaceId:
|
|
3597
|
-
fieldNames:
|
|
3777
|
+
doc: de,
|
|
3778
|
+
surfaceId: We,
|
|
3779
|
+
fieldNames: X,
|
|
3598
3780
|
interactive: !0,
|
|
3599
3781
|
wrapProvider: !1,
|
|
3600
|
-
resumeSearch:
|
|
3782
|
+
resumeSearch: u,
|
|
3601
3783
|
caseSearch: m
|
|
3602
3784
|
}
|
|
3603
3785
|
),
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
|
|
3786
|
+
/* @__PURE__ */ c("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ c(
|
|
3787
|
+
he,
|
|
3606
3788
|
{
|
|
3607
3789
|
title: o === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
|
|
3608
|
-
children: /* @__PURE__ */
|
|
3609
|
-
|
|
3790
|
+
children: /* @__PURE__ */ c(
|
|
3791
|
+
xe,
|
|
3610
3792
|
{
|
|
3611
3793
|
type: "primary",
|
|
3612
3794
|
size: "small",
|
|
3613
3795
|
loading: v,
|
|
3614
3796
|
disabled: v,
|
|
3615
|
-
onClick: () => void
|
|
3797
|
+
onClick: () => void Ye(),
|
|
3616
3798
|
children: "提交"
|
|
3617
3799
|
}
|
|
3618
3800
|
)
|
|
@@ -3622,16 +3804,16 @@ function rs({
|
|
|
3622
3804
|
}
|
|
3623
3805
|
);
|
|
3624
3806
|
}
|
|
3625
|
-
function
|
|
3626
|
-
var
|
|
3627
|
-
const t = ((
|
|
3807
|
+
function $s(e) {
|
|
3808
|
+
var u;
|
|
3809
|
+
const t = ((u = e.askUserMessageId) == null ? void 0 : u.trim()) ?? "", n = V(() => gi(), []), [r, o] = E(!1), i = A(null), s = j((m) => {
|
|
3628
3810
|
o(m);
|
|
3629
3811
|
}, []), a = j(
|
|
3630
3812
|
(m) => {
|
|
3631
3813
|
i.current = m;
|
|
3632
3814
|
},
|
|
3633
3815
|
[]
|
|
3634
|
-
), l =
|
|
3816
|
+
), l = V(() => !n || !t ? null : new us({
|
|
3635
3817
|
url: n,
|
|
3636
3818
|
askUserMessageId: t,
|
|
3637
3819
|
onAutoControl: (m) => {
|
|
@@ -3639,15 +3821,15 @@ function Ts(e) {
|
|
|
3639
3821
|
(d = i.current) == null || d.call(i, m);
|
|
3640
3822
|
}
|
|
3641
3823
|
}), [n, t]);
|
|
3642
|
-
return
|
|
3824
|
+
return B(() => {
|
|
3643
3825
|
if (l)
|
|
3644
3826
|
return () => {
|
|
3645
3827
|
l.close();
|
|
3646
3828
|
};
|
|
3647
|
-
}, [l]),
|
|
3829
|
+
}, [l]), B(() => {
|
|
3648
3830
|
!l || !r || l.connect();
|
|
3649
|
-
}, [l, r]), /* @__PURE__ */
|
|
3650
|
-
|
|
3831
|
+
}, [l, r]), /* @__PURE__ */ c(Ae, { children: /* @__PURE__ */ c(oo, { client: l, children: /* @__PURE__ */ c(eo, { children: /* @__PURE__ */ c(
|
|
3832
|
+
ks,
|
|
3651
3833
|
{
|
|
3652
3834
|
...e,
|
|
3653
3835
|
onSurfaceReadyChange: s,
|
|
@@ -3656,71 +3838,77 @@ function Ts(e) {
|
|
|
3656
3838
|
) }) }) });
|
|
3657
3839
|
}
|
|
3658
3840
|
export {
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3841
|
+
Rs as A2UI_PROTOCOL_VERSION,
|
|
3842
|
+
$s as AskUserFormCard,
|
|
3843
|
+
dt as CaseSearchProvider,
|
|
3844
|
+
vs as CurlSubmitBlock,
|
|
3845
|
+
pi as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
|
|
3846
|
+
mi as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
|
|
3847
|
+
di as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
|
|
3848
|
+
xt as DEFAULT_AUTH_STORAGE_KEY,
|
|
3849
|
+
ui as DEFAULT_AUTH_TOKEN_FIELD,
|
|
3850
|
+
fr as FORM_MEDIA_SIZES,
|
|
3851
|
+
ut as FORM_WEB_DEFAULT_HEIGHT,
|
|
3852
|
+
gr as FORM_WEB_MAX_HEIGHT,
|
|
3853
|
+
hr as FORM_WEB_MIN_HEIGHT,
|
|
3854
|
+
pt as ResumeSearchProvider,
|
|
3855
|
+
js as SkoponA2uiStreamRenderer,
|
|
3856
|
+
Ae as SkoponFormProvider,
|
|
3857
|
+
os as SkoponFormRenderer,
|
|
3858
|
+
Go as a2uiToBlocks,
|
|
3859
|
+
Mn as blocksToA2ui,
|
|
3860
|
+
Gr as blocksToJsonSchema,
|
|
3861
|
+
Et as buildAnswerAgentBody,
|
|
3862
|
+
li as buildAskUserCurlBodyJson,
|
|
3863
|
+
ci as buildAskUserCurlStatement,
|
|
3864
|
+
Bs as buildAskUserSubmitCurlFromPayload,
|
|
3865
|
+
Xo as buildAskUserSurface,
|
|
3866
|
+
Un as buildCurlStatement,
|
|
3867
|
+
Ie as coerceToggleValue,
|
|
3868
|
+
qs as copyTextToClipboard,
|
|
3869
|
+
Ni as createCaseSearchClient,
|
|
3870
|
+
zs as createEmptyBlock,
|
|
3871
|
+
Ps as createEmptyFormDefinition,
|
|
3872
|
+
yi as createFormClient,
|
|
3873
|
+
_i as createResumeSearchClient,
|
|
3874
|
+
Vs as createSkoponSdkClients,
|
|
3875
|
+
qe as extractExtraBlockValues,
|
|
3876
|
+
Zo as extractSurfaceValues,
|
|
3877
|
+
zn as formatAnswerAgentSubmitMessage,
|
|
3878
|
+
ai as getPayloadHiddenBlockValues,
|
|
3879
|
+
Os as getPayloadInputFieldNames,
|
|
3880
|
+
si as getPayloadRenderableBlocks,
|
|
3881
|
+
oi as intersectPayloadBlocksWithForm,
|
|
3882
|
+
gt as isA2uiSurfaceEmpty,
|
|
3883
|
+
mn as isDisplayBlockType,
|
|
3699
3884
|
Z as isInputBlockType,
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3885
|
+
un as isLayoutBlockType,
|
|
3886
|
+
be as isMediaBlockType,
|
|
3887
|
+
dn as isOptionsBlockType,
|
|
3888
|
+
yr as isSupportedWebUrl,
|
|
3889
|
+
Se as isWebBlockType,
|
|
3890
|
+
Qo as mapFormDefinitionFromDto,
|
|
3891
|
+
Ve as normalizeFormDefinition,
|
|
3892
|
+
pe as normalizeMultiselectCount,
|
|
3893
|
+
Me as normalizeWebHeight,
|
|
3894
|
+
$e as parsePayloadBlocksJson,
|
|
3895
|
+
ii as payloadHasInputBlocks,
|
|
3896
|
+
hi as resolveAnswerAgentCallbackUrl,
|
|
3897
|
+
It as resolveClientHeaders,
|
|
3898
|
+
gi as resolveRealtimeWsUrl,
|
|
3899
|
+
Kr as resolveSchemaDefaultValue,
|
|
3900
|
+
wn as resolveSkoponAuthHeaders,
|
|
3901
|
+
Ft as resolveSubmitAuthHeaders,
|
|
3902
|
+
Yo as resolveSurfaceFromFormDefinition,
|
|
3903
|
+
rs as skoponAntdTheme,
|
|
3716
3904
|
ie as skoponBrandColors,
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3905
|
+
On as submitAnswerAgent,
|
|
3906
|
+
Rn as submitFormJson,
|
|
3907
|
+
ws as supportsDefaultValue,
|
|
3908
|
+
Jo as surfaceDocToMessages,
|
|
3909
|
+
ke as syncFormDefinition,
|
|
3910
|
+
ao as useCaseSearch,
|
|
3911
|
+
vo as useResumeSearch,
|
|
3912
|
+
Ut as validateAnswerAgentBody,
|
|
3913
|
+
Ls as validateAnswerAgentContext
|
|
3726
3914
|
};
|