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