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