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