@skopon-cool/form-sdk 0.1.4 → 0.1.5
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/SkoponA2uiStreamRenderer.d.ts.map +1 -1
- package/dist/form-sdk.css +1 -1
- package/dist/index.js +932 -892
- package/dist/submit/buildCurlStatement.d.ts +1 -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/SkoponA2uiStreamRenderer.tsx +11 -4
- package/src/styles/a2ui-preview.css +4 -4
- package/src/styles/index.css +148 -17
- package/src/submit/buildCurlStatement.ts +2 -23
- package/src/submit/intersectPayloadBlocksWithForm.ts +14 -2
- package/src/submit/submit.test.ts +34 -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
|
|
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 Pe, useContext as Ee, useCallback as W, useSyncExternalStore as ht, useMemo as O, useState as E, useRef as B, useEffect as V, forwardRef as gt, useImperativeHandle as yt } from "react";
|
|
4
|
+
import { Spin as Ue, Button as ue, Typography as L, Avatar as vt, Tag as Z, Select as Ce, Checkbox as bt, Radio as St, Switch as kt, TimePicker as xt, DatePicker as At, Upload as ge, Input as ye, InputNumber as Tt, Tooltip as ie } from "antd";
|
|
5
|
+
import { ReloadOutlined as Ke, FileTextOutlined as Je, UserOutlined as Ct, FileImageOutlined as It, FileExcelOutlined as Nt, FileOutlined as He, PictureOutlined as Ft, SoundOutlined as Mt, VideoCameraOutlined as Pt } from "@ant-design/icons";
|
|
6
|
+
import { createBinderlessComponentImplementation as z, basicCatalog as le, A2uiSurface as Ye } from "@a2ui/react/v0_9";
|
|
7
|
+
import { z as d } from "zod";
|
|
8
|
+
import { Catalog as Et, 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 Gr = "v0.9", Ut = [
|
|
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 _e(e) {
|
|
23
23
|
return e === "heading" || e === "paragraph";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return !
|
|
25
|
+
function J(e) {
|
|
26
|
+
return !_e(e) && !Ie(e);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function _t() {
|
|
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 ee(e) {
|
|
43
|
+
const t = _t().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: "音频" },
|
|
@@ -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
|
+
}, Rt = {
|
|
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
|
+
}, wt = {
|
|
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
|
+
], Ot = Object.fromEntries(
|
|
122
|
+
Ze.map((e) => [e.value, e.label])
|
|
123
|
+
), Bt = Object.fromEntries(
|
|
124
124
|
ze.map((e) => [e.value, e.label])
|
|
125
|
-
), Vt = new Set(
|
|
125
|
+
), Vt = new Set(Ze.map((e) => e.value)), qt = new Set(
|
|
126
126
|
ze.map((e) => e.value)
|
|
127
127
|
);
|
|
128
|
-
function
|
|
128
|
+
function jt(e) {
|
|
129
129
|
const t = e.trim();
|
|
130
|
-
return t ? Vt.has(t) ? t :
|
|
130
|
+
return t ? Vt.has(t) ? t : wt[t] ?? null : null;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Lt(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 te(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 = jt(r);
|
|
143
143
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
144
144
|
}
|
|
145
145
|
return t;
|
|
146
146
|
}
|
|
147
147
|
function $t(e) {
|
|
148
|
-
const t =
|
|
148
|
+
const t = te(e), n = [];
|
|
149
149
|
for (const r of t)
|
|
150
150
|
n.push(...zt[r] ?? [r]);
|
|
151
151
|
return n;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const t =
|
|
153
|
+
function Dt(e) {
|
|
154
|
+
const t = te(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 Rt[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 = Lt(t), r = te(e);
|
|
164
164
|
if (r.length === 0)
|
|
165
|
-
return n.filter((a) =>
|
|
165
|
+
return n.filter((a) => qt.has(a));
|
|
166
166
|
const o = new Set(
|
|
167
|
-
|
|
167
|
+
Dt(r).map((a) => a.value)
|
|
168
168
|
);
|
|
169
169
|
return n.filter((a) => o.has(a));
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
const n = $t(e), r =
|
|
171
|
+
function Kt(e, t) {
|
|
172
|
+
const n = $t(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 Jt(e, t) {
|
|
176
|
+
const n = te(e), r = Re(
|
|
177
177
|
n,
|
|
178
178
|
t
|
|
179
179
|
), o = [
|
|
180
|
-
...n.map((a) =>
|
|
181
|
-
...r.map((a) =>
|
|
180
|
+
...n.map((a) => Ot[a] ?? a),
|
|
181
|
+
...r.map((a) => Bt[a] ?? a)
|
|
182
182
|
];
|
|
183
183
|
return o.length === 0 ? null : o.join("、");
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const Ht = [
|
|
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
|
+
], Yt = new Set(Ht);
|
|
193
|
+
function Xt(e) {
|
|
194
|
+
return e && Yt.has(e) ? e : "file";
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
return typeof e == "string" &&
|
|
196
|
+
function ne(e) {
|
|
197
|
+
return typeof e == "string" && Ut.includes(e) ? e : "medium";
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Gt(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 Wt(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 Zt(e) {
|
|
210
|
+
return `form-media-size-${ne(e)}`;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
return `form-media-preview form-media-list ${
|
|
212
|
+
function Qt(e) {
|
|
213
|
+
return `form-media-preview form-media-list ${Zt(e)}`;
|
|
214
214
|
}
|
|
215
|
-
const
|
|
216
|
-
function
|
|
215
|
+
const en = 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 tn(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 nn(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, l = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, i = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
229
|
+
return { agentKind: r, agentUniqueId: o, flowType: a, category: l, flowUniqueIds: i, pageSize: n };
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function rn(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 on(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 an(e) {
|
|
246
|
+
var o, a;
|
|
247
|
+
const t = on(e), n = te(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()) || ee("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) ? Gt(t, en) : void 0,
|
|
257
|
+
mediaSize: Ie(r) ? ne(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: Xt(t.filePlaceholderIcon),
|
|
264
|
+
fileMinCount: r === "file" ? je(t.fileMinCount, 1) : void 0,
|
|
265
|
+
fileMaxCount: r === "file" ? je(t.fileMaxCount, 1) : void 0,
|
|
266
|
+
defaultValue: tn(r, t.defaultValue),
|
|
267
|
+
options: Array.isArray(t.options) ? t.options.map((l, i) => {
|
|
268
|
+
var c, u;
|
|
264
269
|
return {
|
|
265
|
-
value: ((
|
|
266
|
-
label: ((
|
|
270
|
+
value: ((c = l.value) == null ? void 0 : c.trim()) || `option_${i + 1}`,
|
|
271
|
+
label: ((u = l.label) == null ? void 0 : u.trim()) || `选项 ${i + 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" ? rn(t.resumeFilter) : void 0,
|
|
276
|
+
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
277
|
+
caseFilter: r === "case_multiselect" ? nn(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(an);
|
|
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 ln(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, l = 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: l,
|
|
307
|
+
pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
function sn(e, t) {
|
|
311
|
+
var l, i, c, u, m, p;
|
|
296
312
|
const { id: n, label: r, path: o, withData: a } = t;
|
|
297
313
|
return a({
|
|
298
314
|
id: n,
|
|
@@ -302,118 +318,116 @@ function rn(e, t) {
|
|
|
302
318
|
help: e.help ?? "",
|
|
303
319
|
enableRefresh: e.caseEnableRefresh !== !1,
|
|
304
320
|
caseFilter: {
|
|
305
|
-
agentKind: (
|
|
306
|
-
agentUniqueId: (
|
|
307
|
-
|
|
308
|
-
|
|
321
|
+
agentKind: (l = e.caseFilter) == null ? void 0 : l.agentKind,
|
|
322
|
+
agentUniqueId: (i = e.caseFilter) == null ? void 0 : i.agentUniqueId,
|
|
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 cn(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
|
-
const
|
|
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;
|
|
338
|
+
const l = n.asLiteral(e.help);
|
|
339
|
+
return l && (o.help = l), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = ln(e.caseFilter)), o;
|
|
331
340
|
}
|
|
332
|
-
const
|
|
333
|
-
function
|
|
341
|
+
const Qe = Pe({ 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
|
-
),
|
|
368
|
+
), l = W(() => {
|
|
360
369
|
if (!(!o || r === void 0))
|
|
361
370
|
return e.dataContext.resolveDynamicValue(r);
|
|
362
|
-
}, [e, r, o]),
|
|
371
|
+
}, [e, r, o]), i = ht(a, l, l), 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:
|
|
377
|
+
return { value: i, setValue: c, hasBinding: !!o };
|
|
369
378
|
}
|
|
370
|
-
function
|
|
379
|
+
function Q(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 = Pe(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 un() {
|
|
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, l = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, i = 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: l, category: i, 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 pn(e) {
|
|
397
411
|
return JSON.stringify(e);
|
|
398
412
|
}
|
|
399
|
-
const
|
|
413
|
+
const mn = {
|
|
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 dn({
|
|
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 fn({ context: e }) {
|
|
453
|
+
const { interactive: t } = $(), n = un(), { value: r, setValue: o } = D(e), a = e.componentModel.properties, l = ve(a.label), i = ve(a.placeholder), c = ve(a.help), u = a.enableRefresh !== !1, m = O(() => be(a.caseFilter), [a.caseFilter]), p = pn(m), [y, S] = E(1), [C, F] = E(!1), [T, f] = E(""), [h, k] = E([]), [v, b] = E(0), [P, R] = E(m.pageSize ?? 20), _ = B(0), w = j(r), q = O(() => n ? Se(m) ? T || i || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, m, T, i]), K = W(
|
|
454
|
+
async (g) => {
|
|
455
|
+
const A = be(JSON.parse(p)), M = ++_.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 (
|
|
450
|
-
|
|
451
|
-
} catch (
|
|
452
|
-
if (
|
|
453
|
-
|
|
462
|
+
const I = await n({ filter: A, page: g });
|
|
463
|
+
if (M !== _.current) return;
|
|
464
|
+
k(I.list), b(I.total), S(I.page), R(I.pageSize);
|
|
465
|
+
} catch (I) {
|
|
466
|
+
if (M !== _.current) return;
|
|
467
|
+
k([]), b(0), f(I instanceof Error ? I.message : "加载案例列表失败");
|
|
454
468
|
} finally {
|
|
455
|
-
|
|
469
|
+
M === _.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 = w.includes(g) ? w.filter((M) => M !== g) : [...w, g];
|
|
480
|
+
o(A);
|
|
465
481
|
}, X = () => {
|
|
466
|
-
const
|
|
467
|
-
|
|
482
|
+
const g = be(JSON.parse(p)), A = P || g.pageSize || 20, M = Math.max(1, Math.ceil(v / A)), I = y >= M ? 1 : y + 1;
|
|
483
|
+
K(I);
|
|
468
484
|
};
|
|
469
|
-
return /* @__PURE__ */
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
/* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview skopon-resume-select", children: [
|
|
486
|
+
l ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: l }) : null,
|
|
487
|
+
C && h.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
|
|
488
|
+
/* @__PURE__ */ s(Ue, { 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
|
+
dn,
|
|
478
494
|
{
|
|
479
|
-
item:
|
|
480
|
-
selected:
|
|
495
|
+
item: g,
|
|
496
|
+
selected: w.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 hn = z(
|
|
518
|
+
mn,
|
|
519
|
+
fn
|
|
520
|
+
), gn = {
|
|
521
|
+
type: "case_multiselect",
|
|
506
522
|
componentName: "SkoponCaseSelect",
|
|
507
|
-
toComponent:
|
|
508
|
-
fromComponent:
|
|
509
|
-
catalogComponents: [
|
|
523
|
+
toComponent: sn,
|
|
524
|
+
fromComponent: cn,
|
|
525
|
+
catalogComponents: [hn]
|
|
510
526
|
};
|
|
511
|
-
function
|
|
512
|
-
var
|
|
527
|
+
function yn(e, t) {
|
|
528
|
+
var l, i, c, u;
|
|
513
529
|
const { id: n, label: r, path: o, withData: a } = t;
|
|
514
530
|
return a({
|
|
515
531
|
id: n,
|
|
@@ -519,257 +535,285 @@ function mn(e, t) {
|
|
|
519
535
|
help: e.help ?? "",
|
|
520
536
|
enableRefresh: e.resumeEnableRefresh !== !1,
|
|
521
537
|
resumeFilter: {
|
|
522
|
-
names: ((
|
|
523
|
-
agentUniqueIds: ((
|
|
524
|
-
resumeUniqueIds: ((
|
|
538
|
+
names: ((l = e.resumeFilter) == null ? void 0 : l.names) ?? [],
|
|
539
|
+
agentUniqueIds: ((i = e.resumeFilter) == null ? void 0 : i.agentUniqueIds) ?? [],
|
|
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 vn(e, t, n) {
|
|
531
547
|
const r = n.nameFromValue(e.value), o = {
|
|
532
548
|
...t("resume_multiselect"),
|
|
533
549
|
name: r,
|
|
534
550
|
resumeEnableRefresh: e.enableRefresh !== !1
|
|
535
551
|
}, a = n.asLiteral(e.placeholder);
|
|
536
552
|
a && (o.placeholder = a);
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
539
|
-
const
|
|
553
|
+
const l = n.asLiteral(e.help);
|
|
554
|
+
if (l && (o.help = l), e.resumeFilter && typeof e.resumeFilter == "object") {
|
|
555
|
+
const i = e.resumeFilter;
|
|
540
556
|
o.resumeFilter = {
|
|
541
|
-
names: Array.isArray(
|
|
542
|
-
agentUniqueIds: Array.isArray(
|
|
543
|
-
resumeUniqueIds: Array.isArray(
|
|
544
|
-
pageSize: typeof
|
|
557
|
+
names: Array.isArray(i.names) ? i.names.map(String) : [],
|
|
558
|
+
agentUniqueIds: Array.isArray(i.agentUniqueIds) ? i.agentUniqueIds.map(String) : [],
|
|
559
|
+
resumeUniqueIds: Array.isArray(i.resumeUniqueIds) ? i.resumeUniqueIds.map(String) : [],
|
|
560
|
+
pageSize: typeof i.pageSize == "number" ? i.pageSize : 20
|
|
545
561
|
};
|
|
546
562
|
}
|
|
547
563
|
return o;
|
|
548
564
|
}
|
|
549
|
-
const
|
|
550
|
-
function
|
|
565
|
+
const ot = Pe(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 bn() {
|
|
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
|
-
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),
|
|
566
|
-
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize:
|
|
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), l = Number.isFinite(a) && a >= 1 && a <= 100 ? Math.floor(a) : 20;
|
|
582
|
+
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: l };
|
|
567
583
|
}
|
|
568
|
-
function
|
|
584
|
+
function Sn(e) {
|
|
569
585
|
return JSON.stringify(e);
|
|
570
586
|
}
|
|
571
|
-
const
|
|
587
|
+
const kn = {
|
|
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
|
+
}, xn = 3, An = 2;
|
|
598
|
+
function Ae(e, t) {
|
|
599
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, xn), 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(Z, { className: "skopon-resume-select-card-tag", children: a }, a)),
|
|
604
|
+
o > 0 ? /* @__PURE__ */ x(Z, { 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 Tn(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 Cn({ 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(It, { 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 In({
|
|
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, An);
|
|
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
|
+
vt,
|
|
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(Ct, {}),
|
|
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
|
+
Tn(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, l) => /* @__PURE__ */ s(Cn, { work: a }, `${a.title}-${l}`)) }) : /* @__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 Nn({ context: e }) {
|
|
663
|
+
const { interactive: t } = $(), n = bn(), { value: r, setValue: o } = D(e), a = e.componentModel.properties, l = ke(a.label), i = ke(a.placeholder), c = ke(a.help), u = a.enableRefresh !== !1, m = O(() => xe(a.resumeFilter), [a.resumeFilter]), p = Sn(m), [y, S] = E(1), [C, F] = E(!1), [T, f] = E(""), [h, k] = E([]), [v, b] = E(0), [P, R] = E(m.pageSize ?? 20), _ = B(0), w = j(r), q = W(
|
|
664
|
+
async (g) => {
|
|
665
|
+
const A = xe(JSON.parse(p)), M = ++_.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 (
|
|
629
|
-
|
|
630
|
-
} catch (
|
|
631
|
-
if (
|
|
632
|
-
|
|
672
|
+
const I = await n({ filter: A, page: g });
|
|
673
|
+
if (M !== _.current) return;
|
|
674
|
+
k(I.list), b(I.total), S(I.page), R(I.pageSize);
|
|
675
|
+
} catch (I) {
|
|
676
|
+
if (M !== _.current) return;
|
|
677
|
+
k([]), b(0), f(I instanceof Error ? I.message : "加载简历列表失败");
|
|
633
678
|
} finally {
|
|
634
|
-
|
|
679
|
+
M === _.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
|
-
|
|
649
|
-
}, X =
|
|
650
|
-
return /* @__PURE__ */
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
/* @__PURE__ */
|
|
689
|
+
const A = w.includes(g) ? w.filter((M) => M !== g) : [...w, g];
|
|
690
|
+
o(A);
|
|
691
|
+
}, Y = () => {
|
|
692
|
+
const g = xe(JSON.parse(p)), A = P || g.pageSize || 20, M = Math.max(1, Math.ceil(v / A)), I = y >= M ? 1 : y + 1;
|
|
693
|
+
q(I);
|
|
694
|
+
}, X = i || "暂无匹配的简历";
|
|
695
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview skopon-resume-select", children: [
|
|
696
|
+
l ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: l }) : null,
|
|
697
|
+
C && h.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
|
|
698
|
+
/* @__PURE__ */ s(Ue, { 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
|
+
In,
|
|
660
705
|
{
|
|
661
|
-
item:
|
|
662
|
-
selected:
|
|
706
|
+
item: g,
|
|
707
|
+
selected: w.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 Fn = z(
|
|
729
|
+
kn,
|
|
730
|
+
Nn
|
|
731
|
+
), Mn = {
|
|
687
732
|
type: "resume_multiselect",
|
|
688
733
|
componentName: "SkoponResumeSelect",
|
|
689
|
-
toComponent:
|
|
690
|
-
fromComponent:
|
|
691
|
-
catalogComponents: [
|
|
692
|
-
},
|
|
693
|
-
|
|
694
|
-
),
|
|
695
|
-
|
|
734
|
+
toComponent: yn,
|
|
735
|
+
fromComponent: vn,
|
|
736
|
+
catalogComponents: [Fn]
|
|
737
|
+
}, pe = [Mn, gn], Pn = new Map(
|
|
738
|
+
pe.map((e) => [e.type, e])
|
|
739
|
+
), En = new Map(
|
|
740
|
+
pe.map((e) => [e.componentName, e])
|
|
696
741
|
);
|
|
697
|
-
function
|
|
698
|
-
return
|
|
742
|
+
function Un(e) {
|
|
743
|
+
return Pn.get(e);
|
|
699
744
|
}
|
|
700
|
-
function
|
|
701
|
-
return
|
|
745
|
+
function _n(e) {
|
|
746
|
+
return En.get(e);
|
|
702
747
|
}
|
|
703
|
-
function
|
|
704
|
-
return
|
|
748
|
+
function zn() {
|
|
749
|
+
return pe.flatMap((e) => e.catalogComponents);
|
|
705
750
|
}
|
|
706
|
-
function
|
|
707
|
-
return
|
|
751
|
+
function Rn() {
|
|
752
|
+
return pe.map((e) => e.componentName);
|
|
708
753
|
}
|
|
709
|
-
const
|
|
710
|
-
function
|
|
754
|
+
const ce = "root", Ne = "__title__", Fe = "__desc__", lt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
755
|
+
function wn(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 U(e) {
|
|
717
762
|
if (typeof e == "string") return e;
|
|
718
763
|
}
|
|
719
|
-
function
|
|
720
|
-
const t = e.id ||
|
|
764
|
+
function On(e) {
|
|
765
|
+
const t = e.id || ee("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: Wt(e),
|
|
771
|
+
mediaSize: ne(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 Bn(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 = U(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 oe(e, t, n) {
|
|
784
|
+
const r = typeof e.id == "string" ? e.id : ee("block-"), o = Bn(e), a = U(e.label) ?? U(e.description) ?? n, l = U(e.help), i = U(e.placeholder), c = ne(e.mediaSize);
|
|
740
785
|
return {
|
|
741
786
|
id: r,
|
|
742
787
|
type: t,
|
|
743
788
|
label: a,
|
|
744
|
-
...
|
|
745
|
-
...
|
|
746
|
-
mediaSize:
|
|
789
|
+
...l ? { help: l } : {},
|
|
790
|
+
...i ? { placeholder: i } : {},
|
|
791
|
+
mediaSize: c,
|
|
747
792
|
mediaUrls: o.length > 0 ? o : [""]
|
|
748
793
|
};
|
|
749
794
|
}
|
|
750
|
-
function
|
|
795
|
+
function Vn(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 qn(e) {
|
|
769
813
|
var u;
|
|
770
|
-
const t = e.id ||
|
|
771
|
-
if (
|
|
772
|
-
return
|
|
814
|
+
const t = e.id || ee("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? wn(r) : void 0, a = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), l = (m) => r ? { node: m, dataKey: r, dataValue: Vn(e) } : { node: m }, i = { id: t, label: n, name: r, path: o, withData: l }, c = Un(e.type);
|
|
815
|
+
if (c)
|
|
816
|
+
return c.toComponent(e, i);
|
|
773
817
|
switch (e.type) {
|
|
774
818
|
case "heading":
|
|
775
819
|
return { node: { id: t, component: "Text", text: n, variant: "h3" } };
|
|
@@ -778,7 +822,7 @@ function zn(e) {
|
|
|
778
822
|
case "text":
|
|
779
823
|
case "tel":
|
|
780
824
|
case "url":
|
|
781
|
-
return
|
|
825
|
+
return l({
|
|
782
826
|
id: t,
|
|
783
827
|
component: "TextField",
|
|
784
828
|
label: n,
|
|
@@ -787,17 +831,17 @@ function zn(e) {
|
|
|
787
831
|
value: { path: o }
|
|
788
832
|
});
|
|
789
833
|
case "email":
|
|
790
|
-
return
|
|
834
|
+
return l({
|
|
791
835
|
id: t,
|
|
792
836
|
component: "TextField",
|
|
793
837
|
label: n,
|
|
794
838
|
variant: "shortText",
|
|
795
|
-
validationRegexp:
|
|
839
|
+
validationRegexp: lt,
|
|
796
840
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
797
841
|
value: { path: o }
|
|
798
842
|
});
|
|
799
843
|
case "textarea":
|
|
800
|
-
return
|
|
844
|
+
return l({
|
|
801
845
|
id: t,
|
|
802
846
|
component: "TextField",
|
|
803
847
|
label: n,
|
|
@@ -806,7 +850,7 @@ function zn(e) {
|
|
|
806
850
|
value: { path: o }
|
|
807
851
|
});
|
|
808
852
|
case "number":
|
|
809
|
-
return
|
|
853
|
+
return l({
|
|
810
854
|
id: t,
|
|
811
855
|
component: "TextField",
|
|
812
856
|
label: n,
|
|
@@ -815,7 +859,7 @@ function zn(e) {
|
|
|
815
859
|
value: { path: o }
|
|
816
860
|
});
|
|
817
861
|
case "select":
|
|
818
|
-
return
|
|
862
|
+
return l({
|
|
819
863
|
id: t,
|
|
820
864
|
component: "SkoponSelect",
|
|
821
865
|
label: n,
|
|
@@ -825,7 +869,7 @@ function zn(e) {
|
|
|
825
869
|
value: { path: o }
|
|
826
870
|
});
|
|
827
871
|
case "radio":
|
|
828
|
-
return
|
|
872
|
+
return l({
|
|
829
873
|
id: t,
|
|
830
874
|
component: "ChoicePicker",
|
|
831
875
|
label: n,
|
|
@@ -835,7 +879,7 @@ function zn(e) {
|
|
|
835
879
|
value: { path: o }
|
|
836
880
|
});
|
|
837
881
|
case "multiselect":
|
|
838
|
-
return
|
|
882
|
+
return l({
|
|
839
883
|
id: t,
|
|
840
884
|
component: "SkoponSelect",
|
|
841
885
|
label: n,
|
|
@@ -845,7 +889,7 @@ function zn(e) {
|
|
|
845
889
|
value: { path: o }
|
|
846
890
|
});
|
|
847
891
|
case "checkbox":
|
|
848
|
-
return
|
|
892
|
+
return l({
|
|
849
893
|
id: t,
|
|
850
894
|
component: "ChoicePicker",
|
|
851
895
|
label: n,
|
|
@@ -855,9 +899,9 @@ function zn(e) {
|
|
|
855
899
|
value: { path: o }
|
|
856
900
|
});
|
|
857
901
|
case "toggle":
|
|
858
|
-
return
|
|
902
|
+
return l({ id: t, component: "CheckBox", label: n, value: { path: o } });
|
|
859
903
|
case "datetime":
|
|
860
|
-
return
|
|
904
|
+
return l({
|
|
861
905
|
id: t,
|
|
862
906
|
component: "DateTimeInput",
|
|
863
907
|
label: n,
|
|
@@ -867,7 +911,7 @@ function zn(e) {
|
|
|
867
911
|
value: { path: o }
|
|
868
912
|
});
|
|
869
913
|
case "time":
|
|
870
|
-
return
|
|
914
|
+
return l({
|
|
871
915
|
id: t,
|
|
872
916
|
component: "DateTimeInput",
|
|
873
917
|
label: n,
|
|
@@ -878,9 +922,9 @@ function zn(e) {
|
|
|
878
922
|
case "image":
|
|
879
923
|
case "video":
|
|
880
924
|
case "audio":
|
|
881
|
-
return { node:
|
|
925
|
+
return { node: On(e) };
|
|
882
926
|
case "file":
|
|
883
|
-
return
|
|
927
|
+
return l({
|
|
884
928
|
id: t,
|
|
885
929
|
component: "FileUpload",
|
|
886
930
|
label: n,
|
|
@@ -895,31 +939,31 @@ function zn(e) {
|
|
|
895
939
|
return { node: null };
|
|
896
940
|
}
|
|
897
941
|
}
|
|
898
|
-
function
|
|
942
|
+
function Me(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
949
|
function it(e, t) {
|
|
906
|
-
const n = [], r = [], o = {}, a = (t == null ? void 0 : t.includeHeader) !== !1,
|
|
907
|
-
a &&
|
|
908
|
-
for (const
|
|
909
|
-
const { node: p, dataKey:
|
|
910
|
-
p && (n.push(p), r.push(p.id),
|
|
950
|
+
const n = [], r = [], o = {}, a = (t == null ? void 0 : t.includeHeader) !== !1, l = (e.title ?? "").trim(), i = (e.description ?? "").trim();
|
|
951
|
+
a && l && (n.push({ id: Ne, component: "Text", text: l, variant: "h2" }), r.push(Ne)), a && i && (n.push({ id: Fe, component: "Text", text: i, variant: "body" }), r.push(Fe));
|
|
952
|
+
for (const m of e.blocks ?? []) {
|
|
953
|
+
const { node: p, dataKey: y, dataValue: S } = qn(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 jn(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,81 +974,81 @@ function xe(e) {
|
|
|
930
974
|
};
|
|
931
975
|
}).filter((n) => !!n) : [];
|
|
932
976
|
}
|
|
933
|
-
function
|
|
934
|
-
const t = typeof e.id == "string" ? e.id :
|
|
935
|
-
if (
|
|
936
|
-
return
|
|
977
|
+
function Ln(e) {
|
|
978
|
+
const t = typeof e.id == "string" ? e.id : ee("block-"), n = String(e.component ?? ""), r = U(e.label) ?? U(e.text) ?? "", o = $e(e.value), a = (i) => ({ id: t, type: i, label: r }), l = _n(n);
|
|
979
|
+
if (l)
|
|
980
|
+
return l.fromComponent(e, a, { asLiteral: U, nameFromValue: $e });
|
|
937
981
|
switch (n) {
|
|
938
982
|
case "Text": {
|
|
939
|
-
const
|
|
940
|
-
return { id: t, type:
|
|
983
|
+
const i = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(i) || i === "title" || i === "subtitle";
|
|
984
|
+
return { id: t, type: c ? "heading" : "paragraph", label: r };
|
|
941
985
|
}
|
|
942
986
|
case "TextField": {
|
|
943
|
-
const
|
|
944
|
-
let
|
|
945
|
-
|
|
946
|
-
const u = { ...a(
|
|
947
|
-
return
|
|
987
|
+
const i = String(e.variant ?? "shortText");
|
|
988
|
+
let c = "text";
|
|
989
|
+
i === "longText" ? c = "textarea" : i === "number" ? c = "number" : U(e.validationRegexp) === lt && (c = "email");
|
|
990
|
+
const u = { ...a(c), name: o }, m = U(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 = U(e.placeholder);
|
|
1001
|
+
return m && (u.placeholder = m), u;
|
|
958
1002
|
}
|
|
959
1003
|
case "ChoicePicker": {
|
|
960
|
-
const
|
|
961
|
-
if (
|
|
962
|
-
const
|
|
963
|
-
...a(
|
|
1004
|
+
const i = U(e.skoponPickerType);
|
|
1005
|
+
if (i === "select" || i === "multiselect" || i === "radio" || i === "checkbox") {
|
|
1006
|
+
const m = {
|
|
1007
|
+
...a(i),
|
|
964
1008
|
name: o,
|
|
965
|
-
options:
|
|
966
|
-
}, p =
|
|
967
|
-
return p && (
|
|
1009
|
+
options: Te(e)
|
|
1010
|
+
}, p = U(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
|
|
974
|
-
return p && (
|
|
1017
|
+
const i = e.enableDate === !0, c = e.enableTime === !0, m = { ...a(!i && c ? "time" : "datetime"), name: o }, p = U(e.placeholder);
|
|
1018
|
+
return p && (m.placeholder = p), m;
|
|
975
1019
|
}
|
|
976
1020
|
case "SkoponMedia": {
|
|
977
|
-
const
|
|
978
|
-
return
|
|
1021
|
+
const i = String(e.mediaType ?? "image");
|
|
1022
|
+
return oe(e, i === "video" ? "video" : i === "audio" ? "audio" : "image", r);
|
|
979
1023
|
}
|
|
980
1024
|
case "Image":
|
|
981
|
-
return
|
|
1025
|
+
return oe(e, "image", r);
|
|
982
1026
|
case "Video":
|
|
983
|
-
return
|
|
1027
|
+
return oe(e, "video", r);
|
|
984
1028
|
case "AudioPlayer":
|
|
985
|
-
return
|
|
1029
|
+
return oe(e, "audio", r);
|
|
986
1030
|
case "FileUpload": {
|
|
987
|
-
const
|
|
988
|
-
return
|
|
1031
|
+
const i = U(e.accept) ?? "", c = { ...a("file"), name: o };
|
|
1032
|
+
return i && (c.fileAcceptExtensions = i.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);
|
|
998
1042
|
if (!o) return;
|
|
999
1043
|
const a = String(o.component ?? "");
|
|
1000
1044
|
if ((a === "Column" || a === "Row") && Array.isArray(o.children)) {
|
|
1001
|
-
for (const
|
|
1002
|
-
typeof
|
|
1045
|
+
for (const l of o.children)
|
|
1046
|
+
typeof l == "string" && st(l, t, n, r);
|
|
1003
1047
|
return;
|
|
1004
1048
|
}
|
|
1005
1049
|
r.push(o);
|
|
1006
1050
|
}
|
|
1007
|
-
function
|
|
1051
|
+
function $n(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 Dn(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 = jn(e), n = [];
|
|
1064
|
+
st(e.root ?? ce, t, /* @__PURE__ */ new Set(), n);
|
|
1021
1065
|
let r = "", o = "";
|
|
1022
1066
|
const a = [];
|
|
1023
|
-
for (const
|
|
1024
|
-
if (
|
|
1025
|
-
r =
|
|
1067
|
+
for (const l of n) {
|
|
1068
|
+
if (l.id === Ne) {
|
|
1069
|
+
r = U(l.text) ?? r;
|
|
1026
1070
|
continue;
|
|
1027
1071
|
}
|
|
1028
|
-
if (
|
|
1029
|
-
o =
|
|
1072
|
+
if (l.id === Fe) {
|
|
1073
|
+
o = U(l.text) ?? o;
|
|
1030
1074
|
continue;
|
|
1031
1075
|
}
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1076
|
+
const i = Ln(l);
|
|
1077
|
+
i && a.push(i);
|
|
1034
1078
|
}
|
|
1035
|
-
return
|
|
1079
|
+
return se({
|
|
1036
1080
|
title: r,
|
|
1037
1081
|
description: o,
|
|
1038
|
-
blocks:
|
|
1082
|
+
blocks: $n(a, e.dataModel),
|
|
1039
1083
|
jsonSchema: {}
|
|
1040
1084
|
});
|
|
1041
1085
|
}
|
|
1042
|
-
function
|
|
1086
|
+
function Kn(e, t) {
|
|
1043
1087
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1044
1088
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1045
1089
|
{
|
|
@@ -1052,23 +1096,23 @@ 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 Jn(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 && !Me(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
|
-
}),
|
|
1069
|
-
return
|
|
1112
|
+
}), l = it(a, t);
|
|
1113
|
+
return Me(l) ? null : l;
|
|
1070
1114
|
}
|
|
1071
|
-
function
|
|
1115
|
+
function Hn(e, t, n) {
|
|
1072
1116
|
return it(
|
|
1073
1117
|
{
|
|
1074
1118
|
title: e.title,
|
|
@@ -1078,126 +1122,116 @@ function wn(e, t, n) {
|
|
|
1078
1122
|
n
|
|
1079
1123
|
);
|
|
1080
1124
|
}
|
|
1081
|
-
function
|
|
1125
|
+
function Yn(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) ? Dn(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 Xn(e, t, n) {
|
|
1092
1136
|
const r = e.model.surfacesMap.get(t);
|
|
1093
1137
|
if (!r) return {};
|
|
1094
1138
|
const o = {};
|
|
1095
1139
|
for (const a of n) {
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1140
|
+
const l = a.trim();
|
|
1141
|
+
l && (o[l] = r.dataModel.get(`/${l}`));
|
|
1098
1142
|
}
|
|
1099
1143
|
return o;
|
|
1100
1144
|
}
|
|
1101
|
-
function
|
|
1145
|
+
function ut(e) {
|
|
1102
1146
|
return e.replace(/'/g, "'\\''");
|
|
1103
1147
|
}
|
|
1104
|
-
function
|
|
1148
|
+
function Gn(e, t) {
|
|
1105
1149
|
const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
|
|
1106
1150
|
return [
|
|
1107
1151
|
`curl -X POST '${n}' \\`,
|
|
1108
1152
|
" -H 'Content-Type: application/json' \\",
|
|
1109
|
-
` -d '${
|
|
1153
|
+
` -d '${ut(r)}'`
|
|
1110
1154
|
].join(`
|
|
1111
1155
|
`);
|
|
1112
1156
|
}
|
|
1113
|
-
function
|
|
1114
|
-
return
|
|
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
|
-
`);
|
|
1157
|
+
function Wn(e, t) {
|
|
1158
|
+
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1125
1159
|
}
|
|
1126
|
-
function
|
|
1160
|
+
function Zn({
|
|
1127
1161
|
cardValues: e,
|
|
1128
1162
|
extraValues: t = {},
|
|
1129
1163
|
callbackUrl: n
|
|
1130
1164
|
}) {
|
|
1131
|
-
const r = (n ?? "").trim() || "<callback_url>", o =
|
|
1165
|
+
const r = (n ?? "").trim() || "<callback_url>", o = Wn(e, t);
|
|
1132
1166
|
return [
|
|
1133
1167
|
`curl -X POST '${r}' \\`,
|
|
1134
1168
|
" -H 'Content-Type: application/json' \\",
|
|
1135
|
-
` -d '${
|
|
1169
|
+
` -d '${ut(o)}'`
|
|
1136
1170
|
].join(`
|
|
1137
1171
|
`);
|
|
1138
1172
|
}
|
|
1139
|
-
function
|
|
1140
|
-
return
|
|
1173
|
+
function Qn(e) {
|
|
1174
|
+
return H({
|
|
1141
1175
|
title: "",
|
|
1142
1176
|
description: "",
|
|
1143
1177
|
blocks: [e]
|
|
1144
1178
|
}).blocks[0];
|
|
1145
1179
|
}
|
|
1146
|
-
function
|
|
1180
|
+
function er(e, t) {
|
|
1147
1181
|
var o, a;
|
|
1148
1182
|
const n = /* @__PURE__ */ new Map();
|
|
1149
|
-
for (const
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1183
|
+
for (const l of t) {
|
|
1184
|
+
const i = (o = l.name) == null ? void 0 : o.trim();
|
|
1185
|
+
i && n.set(i, l);
|
|
1152
1186
|
}
|
|
1153
1187
|
const r = [];
|
|
1154
|
-
for (const
|
|
1155
|
-
if (
|
|
1156
|
-
r.push(
|
|
1188
|
+
for (const l of e.blocks) {
|
|
1189
|
+
if (_e(l.type)) {
|
|
1190
|
+
r.push(Qn(l));
|
|
1157
1191
|
continue;
|
|
1158
1192
|
}
|
|
1159
|
-
if (!
|
|
1160
|
-
const
|
|
1161
|
-
if (!
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1193
|
+
if (!J(l.type)) continue;
|
|
1194
|
+
const i = (a = l.name) == null ? void 0 : a.trim();
|
|
1195
|
+
if (!i) continue;
|
|
1196
|
+
const c = n.get(i);
|
|
1197
|
+
c && r.push(c);
|
|
1164
1198
|
}
|
|
1165
1199
|
return r;
|
|
1166
1200
|
}
|
|
1167
|
-
function
|
|
1201
|
+
function tr(e, t) {
|
|
1168
1202
|
var r;
|
|
1169
1203
|
const n = {
|
|
1170
1204
|
...e,
|
|
1171
1205
|
name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
|
|
1172
1206
|
};
|
|
1173
|
-
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue),
|
|
1207
|
+
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), H({
|
|
1174
1208
|
title: "",
|
|
1175
1209
|
description: "",
|
|
1176
1210
|
blocks: [n]
|
|
1177
1211
|
}).blocks[0];
|
|
1178
1212
|
}
|
|
1179
|
-
function
|
|
1213
|
+
function nr(e) {
|
|
1180
1214
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1181
1215
|
const t = e;
|
|
1182
|
-
return Array.isArray(t.blocks) ?
|
|
1216
|
+
return Array.isArray(t.blocks) ? H({
|
|
1183
1217
|
title: typeof t.title == "string" ? t.title : "",
|
|
1184
1218
|
description: typeof t.description == "string" ? t.description : "",
|
|
1185
1219
|
blocks: t.blocks
|
|
1186
1220
|
}) : null;
|
|
1187
1221
|
}
|
|
1188
|
-
function
|
|
1189
|
-
var a,
|
|
1222
|
+
function rr(e, t) {
|
|
1223
|
+
var a, l, i, c, u, m;
|
|
1190
1224
|
const n = /* @__PURE__ */ new Map();
|
|
1191
1225
|
for (const p of (t == null ? void 0 : t.blocks) ?? [])
|
|
1192
|
-
|
|
1226
|
+
J(p.type) && ((a = p.name) != null && a.trim()) && n.set(p.name.trim(), p);
|
|
1193
1227
|
const r = [], o = [];
|
|
1194
1228
|
for (const p of e.blocks) {
|
|
1195
|
-
if (!
|
|
1196
|
-
const
|
|
1197
|
-
if (!
|
|
1198
|
-
const S = n.get(
|
|
1199
|
-
S ? r.push(
|
|
1200
|
-
|
|
1229
|
+
if (!J(p.type)) continue;
|
|
1230
|
+
const y = (l = p.name) == null ? void 0 : l.trim();
|
|
1231
|
+
if (!y) continue;
|
|
1232
|
+
const S = n.get(y);
|
|
1233
|
+
S ? r.push(tr(S, p)) : o.push(
|
|
1234
|
+
H({
|
|
1201
1235
|
title: "",
|
|
1202
1236
|
description: "",
|
|
1203
1237
|
blocks: [p]
|
|
@@ -1207,46 +1241,46 @@ function Gn(e, t) {
|
|
|
1207
1241
|
return {
|
|
1208
1242
|
matchedBlocks: r,
|
|
1209
1243
|
extraBlocks: o,
|
|
1210
|
-
renderBlocks:
|
|
1211
|
-
title: ((
|
|
1212
|
-
description: ((u = e.description) == null ? void 0 : u.trim()) || ((
|
|
1244
|
+
renderBlocks: er(e, r),
|
|
1245
|
+
title: ((i = e.title) == null ? void 0 : i.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
|
|
1246
|
+
description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1213
1247
|
};
|
|
1214
1248
|
}
|
|
1215
|
-
function
|
|
1249
|
+
function or(e) {
|
|
1216
1250
|
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 : "";
|
|
1251
|
+
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
1252
|
}
|
|
1219
|
-
function
|
|
1253
|
+
function ar(e) {
|
|
1220
1254
|
var n;
|
|
1221
1255
|
const t = {};
|
|
1222
1256
|
for (const r of e) {
|
|
1223
|
-
if (!
|
|
1257
|
+
if (!J(r.type)) continue;
|
|
1224
1258
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1225
|
-
o && (t[o] =
|
|
1259
|
+
o && (t[o] = or(r));
|
|
1226
1260
|
}
|
|
1227
1261
|
return t;
|
|
1228
1262
|
}
|
|
1229
|
-
function
|
|
1263
|
+
function lr(e) {
|
|
1230
1264
|
return e.blocks.some(
|
|
1231
1265
|
(t) => {
|
|
1232
1266
|
var n;
|
|
1233
|
-
return
|
|
1267
|
+
return J(t.type) && !!((n = t.name) != null && n.trim());
|
|
1234
1268
|
}
|
|
1235
1269
|
);
|
|
1236
1270
|
}
|
|
1237
|
-
function
|
|
1271
|
+
function ir(e) {
|
|
1238
1272
|
return e.blocks.filter((t) => {
|
|
1239
1273
|
var n;
|
|
1240
|
-
return
|
|
1274
|
+
return _e(t.type) ? !0 : J(t.type) && !!((n = t.name) != null && n.trim());
|
|
1241
1275
|
});
|
|
1242
1276
|
}
|
|
1243
|
-
function
|
|
1277
|
+
function sr(e) {
|
|
1244
1278
|
return e.blocks.filter((t) => {
|
|
1245
1279
|
var n;
|
|
1246
|
-
return
|
|
1280
|
+
return J(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1247
1281
|
}).map((t) => t.name.trim());
|
|
1248
1282
|
}
|
|
1249
|
-
async function
|
|
1283
|
+
async function cr(e, t, n) {
|
|
1250
1284
|
const r = e.trim();
|
|
1251
1285
|
if (!r)
|
|
1252
1286
|
throw new Error("callback_url 为空");
|
|
@@ -1258,22 +1292,22 @@ async function tr(e, t, n) {
|
|
|
1258
1292
|
},
|
|
1259
1293
|
body: JSON.stringify(t ?? {})
|
|
1260
1294
|
});
|
|
1261
|
-
let
|
|
1295
|
+
let l;
|
|
1262
1296
|
if ((a.headers.get("content-type") ?? "").includes("application/json"))
|
|
1263
1297
|
try {
|
|
1264
|
-
|
|
1298
|
+
l = await a.json();
|
|
1265
1299
|
} catch {
|
|
1266
|
-
|
|
1300
|
+
l = void 0;
|
|
1267
1301
|
}
|
|
1268
1302
|
else
|
|
1269
1303
|
try {
|
|
1270
|
-
|
|
1304
|
+
l = await a.text();
|
|
1271
1305
|
} catch {
|
|
1272
|
-
|
|
1306
|
+
l = void 0;
|
|
1273
1307
|
}
|
|
1274
|
-
return { ok: a.ok, status: a.status, body:
|
|
1308
|
+
return { ok: a.ok, status: a.status, body: l };
|
|
1275
1309
|
}
|
|
1276
|
-
async function
|
|
1310
|
+
async function pt(e) {
|
|
1277
1311
|
var n;
|
|
1278
1312
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1279
1313
|
await navigator.clipboard.writeText(e);
|
|
@@ -1289,7 +1323,7 @@ async function ut(e) {
|
|
|
1289
1323
|
document.body.removeChild(t);
|
|
1290
1324
|
}
|
|
1291
1325
|
}
|
|
1292
|
-
async function
|
|
1326
|
+
async function ur(e) {
|
|
1293
1327
|
let t;
|
|
1294
1328
|
try {
|
|
1295
1329
|
t = await e.json();
|
|
@@ -1302,46 +1336,46 @@ async function nr(e) {
|
|
|
1302
1336
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1303
1337
|
return t.data;
|
|
1304
1338
|
}
|
|
1305
|
-
function
|
|
1339
|
+
function Wr(e = {}) {
|
|
1306
1340
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1307
1341
|
async function o(a) {
|
|
1308
1342
|
var p;
|
|
1309
|
-
const
|
|
1343
|
+
const l = new URLSearchParams();
|
|
1310
1344
|
if (a.formId !== void 0)
|
|
1311
|
-
|
|
1345
|
+
l.set("form_id", String(a.formId));
|
|
1312
1346
|
else if (a.formUniqueId)
|
|
1313
|
-
|
|
1347
|
+
l.set("form_unique_id", a.formUniqueId);
|
|
1314
1348
|
else
|
|
1315
1349
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
1316
|
-
const
|
|
1350
|
+
const i = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${l.toString()}`, {
|
|
1317
1351
|
method: "GET",
|
|
1318
|
-
headers:
|
|
1319
|
-
}), u = await
|
|
1352
|
+
headers: i
|
|
1353
|
+
}), u = await ur(c), m = Yn(u.form_definition);
|
|
1320
1354
|
return {
|
|
1321
1355
|
formUniqueId: u.form_unique_id,
|
|
1322
1356
|
formId: u.form_id,
|
|
1323
1357
|
disabled: u.disabled === 1,
|
|
1324
|
-
formDefinition:
|
|
1325
|
-
a2ui:
|
|
1358
|
+
formDefinition: m,
|
|
1359
|
+
a2ui: Jn(u.form_definition) ?? void 0
|
|
1326
1360
|
};
|
|
1327
1361
|
}
|
|
1328
1362
|
return { fetchDetail: o };
|
|
1329
1363
|
}
|
|
1330
|
-
const
|
|
1331
|
-
video:
|
|
1332
|
-
audio:
|
|
1333
|
-
image:
|
|
1334
|
-
file:
|
|
1335
|
-
spreadsheet:
|
|
1364
|
+
const pr = {
|
|
1365
|
+
video: Pt,
|
|
1366
|
+
audio: Mt,
|
|
1367
|
+
image: Ft,
|
|
1368
|
+
file: He,
|
|
1369
|
+
spreadsheet: Nt,
|
|
1336
1370
|
document: Je
|
|
1337
1371
|
};
|
|
1338
|
-
function
|
|
1372
|
+
function mr({
|
|
1339
1373
|
type: e,
|
|
1340
1374
|
size: t = 40,
|
|
1341
1375
|
className: n
|
|
1342
1376
|
}) {
|
|
1343
|
-
const r =
|
|
1344
|
-
return /* @__PURE__ */
|
|
1377
|
+
const r = pr[e] ?? He;
|
|
1378
|
+
return /* @__PURE__ */ s(
|
|
1345
1379
|
r,
|
|
1346
1380
|
{
|
|
1347
1381
|
className: n ?? "skopon-form-file-placeholder-icon",
|
|
@@ -1350,7 +1384,7 @@ function or({
|
|
|
1350
1384
|
}
|
|
1351
1385
|
);
|
|
1352
1386
|
}
|
|
1353
|
-
const
|
|
1387
|
+
const mt = "skopon-form-v0_9", dr = /* @__PURE__ */ new Set([
|
|
1354
1388
|
"SkoponMedia",
|
|
1355
1389
|
"SkoponSelect",
|
|
1356
1390
|
"Image",
|
|
@@ -1362,14 +1396,14 @@ const pt = "skopon-form-v0_9", ar = /* @__PURE__ */ new Set([
|
|
|
1362
1396
|
"FileUpload",
|
|
1363
1397
|
"TextField",
|
|
1364
1398
|
"Text",
|
|
1365
|
-
...
|
|
1366
|
-
]),
|
|
1367
|
-
function
|
|
1368
|
-
const t = [...
|
|
1399
|
+
...Rn()
|
|
1400
|
+
]), fr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
1401
|
+
function re(e) {
|
|
1402
|
+
const t = [...le.components.values()].find((n) => n.name === e);
|
|
1369
1403
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
1370
1404
|
return t.schema;
|
|
1371
1405
|
}
|
|
1372
|
-
function
|
|
1406
|
+
function N(e) {
|
|
1373
1407
|
return typeof e == "string" ? e : "";
|
|
1374
1408
|
}
|
|
1375
1409
|
function dt(e) {
|
|
@@ -1379,7 +1413,7 @@ function dt(e) {
|
|
|
1379
1413
|
return { value: r, label: o };
|
|
1380
1414
|
}).filter((t) => !!t) : [];
|
|
1381
1415
|
}
|
|
1382
|
-
function
|
|
1416
|
+
function me({
|
|
1383
1417
|
mediaType: e,
|
|
1384
1418
|
urls: t,
|
|
1385
1419
|
mediaSize: n,
|
|
@@ -1387,463 +1421,463 @@ function pe({
|
|
|
1387
1421
|
help: o,
|
|
1388
1422
|
placeholder: a
|
|
1389
1423
|
}) {
|
|
1390
|
-
const
|
|
1391
|
-
return /* @__PURE__ */
|
|
1392
|
-
|
|
1393
|
-
t.length === 0 ? /* @__PURE__ */
|
|
1424
|
+
const l = r == null ? void 0 : r.trim(), i = o == null ? void 0 : o.trim(), c = Qt(n), u = (a == null ? void 0 : a.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
1425
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
|
|
1426
|
+
l ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: l }) : null,
|
|
1427
|
+
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
1428
|
"img",
|
|
1395
1429
|
{
|
|
1396
|
-
src:
|
|
1397
|
-
alt:
|
|
1430
|
+
src: m,
|
|
1431
|
+
alt: l || "图片",
|
|
1398
1432
|
className: "form-media-item"
|
|
1399
1433
|
},
|
|
1400
1434
|
`media-${p}`
|
|
1401
|
-
) : e === "video" ? /* @__PURE__ */
|
|
1435
|
+
) : e === "video" ? /* @__PURE__ */ s(
|
|
1402
1436
|
"video",
|
|
1403
1437
|
{
|
|
1404
|
-
src:
|
|
1438
|
+
src: m,
|
|
1405
1439
|
controls: !0,
|
|
1406
1440
|
className: "form-media-item"
|
|
1407
1441
|
},
|
|
1408
1442
|
`media-${p}`
|
|
1409
|
-
) : /* @__PURE__ */
|
|
1443
|
+
) : /* @__PURE__ */ s(
|
|
1410
1444
|
"audio",
|
|
1411
1445
|
{
|
|
1412
|
-
src:
|
|
1446
|
+
src: m,
|
|
1413
1447
|
controls: !0,
|
|
1414
1448
|
className: "form-media-item form-media-item--audio"
|
|
1415
1449
|
},
|
|
1416
1450
|
`media-${p}`
|
|
1417
1451
|
)) }),
|
|
1418
|
-
|
|
1452
|
+
i ? /* @__PURE__ */ s(L.Text, { type: "secondary", className: "form-block-preview-help", children: i }) : null
|
|
1419
1453
|
] });
|
|
1420
1454
|
}
|
|
1421
1455
|
function de(e, t) {
|
|
1422
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
1456
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : N(e.url).trim() ? [N(e.url).trim()] : [];
|
|
1423
1457
|
return {
|
|
1424
1458
|
mediaType: t,
|
|
1425
1459
|
urls: n,
|
|
1426
|
-
mediaSize:
|
|
1427
|
-
label:
|
|
1428
|
-
help:
|
|
1429
|
-
placeholder:
|
|
1460
|
+
mediaSize: ne(e.mediaSize),
|
|
1461
|
+
label: N(e.label) || N(e.description),
|
|
1462
|
+
help: N(e.help),
|
|
1463
|
+
placeholder: N(e.placeholder)
|
|
1430
1464
|
};
|
|
1431
1465
|
}
|
|
1432
|
-
const
|
|
1466
|
+
const hr = {
|
|
1433
1467
|
name: "SkoponMedia",
|
|
1434
|
-
schema:
|
|
1435
|
-
mediaType:
|
|
1436
|
-
urls:
|
|
1437
|
-
mediaSize:
|
|
1438
|
-
label:
|
|
1439
|
-
help:
|
|
1440
|
-
placeholder:
|
|
1468
|
+
schema: d.object({
|
|
1469
|
+
mediaType: d.any().optional(),
|
|
1470
|
+
urls: d.any().optional(),
|
|
1471
|
+
mediaSize: d.any().optional(),
|
|
1472
|
+
label: d.any().optional(),
|
|
1473
|
+
help: d.any().optional(),
|
|
1474
|
+
placeholder: d.any().optional()
|
|
1441
1475
|
}).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
|
-
),
|
|
1476
|
+
}, gr = z(hr, ({ context: e }) => {
|
|
1477
|
+
const t = e.componentModel.properties, n = N(t.mediaType);
|
|
1478
|
+
return /* @__PURE__ */ s(me, { ...de(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
1479
|
+
}), yr = z(
|
|
1480
|
+
{ name: "Image", schema: re("Image") },
|
|
1481
|
+
({ context: e }) => /* @__PURE__ */ s(me, { ...de(e.componentModel.properties, "image") })
|
|
1482
|
+
), vr = z(
|
|
1483
|
+
{ name: "Video", schema: re("Video") },
|
|
1484
|
+
({ context: e }) => /* @__PURE__ */ s(me, { ...de(e.componentModel.properties, "video") })
|
|
1485
|
+
), br = z(
|
|
1486
|
+
{ name: "AudioPlayer", schema: re("AudioPlayer") },
|
|
1487
|
+
({ context: e }) => /* @__PURE__ */ s(me, { ...de(e.componentModel.properties, "audio") })
|
|
1488
|
+
), Sr = {
|
|
1455
1489
|
name: "SkoponSelect",
|
|
1456
|
-
schema:
|
|
1457
|
-
label:
|
|
1458
|
-
mode:
|
|
1459
|
-
placeholder:
|
|
1460
|
-
options:
|
|
1461
|
-
value:
|
|
1490
|
+
schema: d.object({
|
|
1491
|
+
label: d.any().optional(),
|
|
1492
|
+
mode: d.any().optional(),
|
|
1493
|
+
placeholder: d.any().optional(),
|
|
1494
|
+
options: d.any().optional(),
|
|
1495
|
+
value: d.any().optional()
|
|
1462
1496
|
}).passthrough()
|
|
1463
1497
|
};
|
|
1464
|
-
function
|
|
1465
|
-
const { interactive: t } =
|
|
1466
|
-
return /* @__PURE__ */
|
|
1467
|
-
a ? /* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1469
|
-
|
|
1498
|
+
function kr({ context: e }) {
|
|
1499
|
+
const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.placeholder), i = dt(o.options), c = N(o.mode) === "multiple";
|
|
1500
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
|
|
1501
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
1502
|
+
/* @__PURE__ */ s(
|
|
1503
|
+
Ce,
|
|
1470
1504
|
{
|
|
1471
|
-
mode:
|
|
1505
|
+
mode: c ? "multiple" : void 0,
|
|
1472
1506
|
disabled: !t,
|
|
1473
1507
|
allowClear: !0,
|
|
1474
1508
|
className: "form-block-preview-control",
|
|
1475
1509
|
style: { width: "100%" },
|
|
1476
|
-
placeholder:
|
|
1477
|
-
options:
|
|
1478
|
-
value:
|
|
1479
|
-
onChange: (u) => r(
|
|
1510
|
+
placeholder: l || (c ? "请选择多项" : "请选择"),
|
|
1511
|
+
options: i,
|
|
1512
|
+
value: c ? j(n) : Q(n),
|
|
1513
|
+
onChange: (u) => r(c ? u ?? [] : u ?? "")
|
|
1480
1514
|
}
|
|
1481
1515
|
)
|
|
1482
1516
|
] });
|
|
1483
1517
|
}
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1486
|
-
|
|
1518
|
+
const xr = z(
|
|
1519
|
+
Sr,
|
|
1520
|
+
kr
|
|
1487
1521
|
);
|
|
1488
|
-
function
|
|
1489
|
-
const { interactive: t } =
|
|
1490
|
-
return /* @__PURE__ */
|
|
1491
|
-
a ? /* @__PURE__ */
|
|
1492
|
-
p === "select" ? /* @__PURE__ */
|
|
1493
|
-
|
|
1522
|
+
function Ar({ context: e }) {
|
|
1523
|
+
const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.variant) || "mutuallyExclusive", i = N(o.skoponPickerType), c = N(o.placeholder), u = dt(o.options), p = i === "select" || i === "multiselect" || i === "radio" || i === "checkbox" ? i : l === "multipleSelection" ? "checkbox" : "radio";
|
|
1524
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
|
|
1525
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
1526
|
+
p === "select" ? /* @__PURE__ */ s(
|
|
1527
|
+
Ce,
|
|
1494
1528
|
{
|
|
1495
1529
|
disabled: !t,
|
|
1496
1530
|
allowClear: !0,
|
|
1497
1531
|
className: "form-block-preview-control",
|
|
1498
1532
|
style: { width: "100%" },
|
|
1499
|
-
placeholder:
|
|
1533
|
+
placeholder: c || "请选择",
|
|
1500
1534
|
options: u,
|
|
1501
|
-
value:
|
|
1502
|
-
onChange: (
|
|
1535
|
+
value: Q(n),
|
|
1536
|
+
onChange: (y) => r(y ?? "")
|
|
1503
1537
|
}
|
|
1504
|
-
) : p === "multiselect" ? /* @__PURE__ */
|
|
1505
|
-
|
|
1538
|
+
) : p === "multiselect" ? /* @__PURE__ */ s(
|
|
1539
|
+
Ce,
|
|
1506
1540
|
{
|
|
1507
1541
|
mode: "multiple",
|
|
1508
1542
|
disabled: !t,
|
|
1509
1543
|
allowClear: !0,
|
|
1510
1544
|
className: "form-block-preview-control",
|
|
1511
1545
|
style: { width: "100%" },
|
|
1512
|
-
placeholder:
|
|
1546
|
+
placeholder: c || "请选择多项",
|
|
1513
1547
|
options: u,
|
|
1514
|
-
value:
|
|
1515
|
-
onChange: (
|
|
1548
|
+
value: j(n),
|
|
1549
|
+
onChange: (y) => r(y ?? [])
|
|
1516
1550
|
}
|
|
1517
|
-
) : p === "checkbox" ? /* @__PURE__ */
|
|
1518
|
-
|
|
1551
|
+
) : p === "checkbox" ? /* @__PURE__ */ s(
|
|
1552
|
+
bt.Group,
|
|
1519
1553
|
{
|
|
1520
1554
|
disabled: !t,
|
|
1521
1555
|
className: "form-block-preview-control",
|
|
1522
1556
|
options: u,
|
|
1523
|
-
value:
|
|
1524
|
-
onChange: (
|
|
1557
|
+
value: j(n),
|
|
1558
|
+
onChange: (y) => r(y)
|
|
1525
1559
|
}
|
|
1526
|
-
) : /* @__PURE__ */
|
|
1527
|
-
|
|
1560
|
+
) : /* @__PURE__ */ s(
|
|
1561
|
+
St.Group,
|
|
1528
1562
|
{
|
|
1529
1563
|
disabled: !t,
|
|
1530
1564
|
className: "form-block-preview-control",
|
|
1531
1565
|
options: u,
|
|
1532
|
-
value:
|
|
1533
|
-
onChange: (
|
|
1566
|
+
value: Q(n),
|
|
1567
|
+
onChange: (y) => r(y.target.value)
|
|
1534
1568
|
}
|
|
1535
1569
|
)
|
|
1536
1570
|
] });
|
|
1537
1571
|
}
|
|
1538
|
-
const
|
|
1572
|
+
const Tr = z(
|
|
1539
1573
|
{
|
|
1540
1574
|
name: "ChoicePicker",
|
|
1541
|
-
schema:
|
|
1542
|
-
label:
|
|
1543
|
-
variant:
|
|
1544
|
-
options:
|
|
1545
|
-
value:
|
|
1546
|
-
skoponPickerType:
|
|
1547
|
-
placeholder:
|
|
1575
|
+
schema: d.object({
|
|
1576
|
+
label: d.any().optional(),
|
|
1577
|
+
variant: d.any().optional(),
|
|
1578
|
+
options: d.any().optional(),
|
|
1579
|
+
value: d.any().optional(),
|
|
1580
|
+
skoponPickerType: d.any().optional(),
|
|
1581
|
+
placeholder: d.any().optional()
|
|
1548
1582
|
}).passthrough()
|
|
1549
1583
|
},
|
|
1550
|
-
|
|
1584
|
+
Ar
|
|
1551
1585
|
);
|
|
1552
|
-
function
|
|
1553
|
-
const { interactive: t } =
|
|
1554
|
-
return /* @__PURE__ */
|
|
1555
|
-
a ? /* @__PURE__ */
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
|
|
1586
|
+
function Cr({ context: e }) {
|
|
1587
|
+
const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label);
|
|
1588
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
|
|
1589
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
1590
|
+
/* @__PURE__ */ s(
|
|
1591
|
+
kt,
|
|
1558
1592
|
{
|
|
1559
1593
|
disabled: !t,
|
|
1560
1594
|
className: "form-block-preview-control",
|
|
1561
|
-
checked:
|
|
1562
|
-
onChange: (
|
|
1595
|
+
checked: we(n),
|
|
1596
|
+
onChange: (l) => r(l)
|
|
1563
1597
|
}
|
|
1564
1598
|
)
|
|
1565
1599
|
] });
|
|
1566
1600
|
}
|
|
1567
|
-
const
|
|
1568
|
-
{ name: "CheckBox", schema:
|
|
1569
|
-
|
|
1601
|
+
const Ir = z(
|
|
1602
|
+
{ name: "CheckBox", schema: re("CheckBox") },
|
|
1603
|
+
Cr
|
|
1570
1604
|
);
|
|
1571
|
-
function
|
|
1572
|
-
const r =
|
|
1605
|
+
function Nr(e, t, n) {
|
|
1606
|
+
const r = Q(e);
|
|
1573
1607
|
if (!r) return;
|
|
1574
1608
|
if (!t && n) {
|
|
1575
|
-
const a =
|
|
1609
|
+
const a = qe(r, "HH:mm", !0);
|
|
1576
1610
|
return a.isValid() ? a : void 0;
|
|
1577
1611
|
}
|
|
1578
|
-
const o =
|
|
1612
|
+
const o = qe(r);
|
|
1579
1613
|
return o.isValid() ? o : void 0;
|
|
1580
1614
|
}
|
|
1581
|
-
function
|
|
1582
|
-
const { interactive: t } =
|
|
1615
|
+
function Fr({ context: e }) {
|
|
1616
|
+
const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.placeholder), i = o.enableDate === !0, c = o.enableTime === !0, u = Nr(n, i, c), m = (p) => {
|
|
1583
1617
|
if (!p) {
|
|
1584
1618
|
r("");
|
|
1585
1619
|
return;
|
|
1586
1620
|
}
|
|
1587
|
-
if (!
|
|
1621
|
+
if (!i && c) {
|
|
1588
1622
|
r(p.format("HH:mm"));
|
|
1589
1623
|
return;
|
|
1590
1624
|
}
|
|
1591
|
-
if (
|
|
1625
|
+
if (i && c) {
|
|
1592
1626
|
r(p.format("YYYY-MM-DDTHH:mm"));
|
|
1593
1627
|
return;
|
|
1594
1628
|
}
|
|
1595
1629
|
r(p.format("YYYY-MM-DD"));
|
|
1596
1630
|
};
|
|
1597
|
-
return /* @__PURE__ */
|
|
1598
|
-
a ? /* @__PURE__ */
|
|
1599
|
-
!
|
|
1631
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
|
|
1632
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
1633
|
+
!i && c ? /* @__PURE__ */ s(
|
|
1600
1634
|
xt,
|
|
1601
1635
|
{
|
|
1602
1636
|
disabled: !t,
|
|
1603
1637
|
className: "form-block-preview-control",
|
|
1604
1638
|
style: { width: "100%" },
|
|
1605
|
-
placeholder:
|
|
1639
|
+
placeholder: l || "选择时间",
|
|
1606
1640
|
value: u,
|
|
1607
|
-
onChange:
|
|
1641
|
+
onChange: m
|
|
1608
1642
|
}
|
|
1609
|
-
) : /* @__PURE__ */
|
|
1610
|
-
|
|
1643
|
+
) : /* @__PURE__ */ s(
|
|
1644
|
+
At,
|
|
1611
1645
|
{
|
|
1612
|
-
showTime:
|
|
1646
|
+
showTime: i && c,
|
|
1613
1647
|
disabled: !t,
|
|
1614
1648
|
className: "form-block-preview-control",
|
|
1615
1649
|
style: { width: "100%" },
|
|
1616
|
-
placeholder:
|
|
1650
|
+
placeholder: l || (i && c ? "选择日期时间" : "选择日期"),
|
|
1617
1651
|
value: u,
|
|
1618
|
-
onChange:
|
|
1652
|
+
onChange: m
|
|
1619
1653
|
}
|
|
1620
1654
|
)
|
|
1621
1655
|
] });
|
|
1622
1656
|
}
|
|
1623
|
-
const
|
|
1657
|
+
const Mr = z(
|
|
1624
1658
|
{
|
|
1625
1659
|
name: "DateTimeInput",
|
|
1626
|
-
schema:
|
|
1627
|
-
label:
|
|
1628
|
-
enableDate:
|
|
1629
|
-
enableTime:
|
|
1630
|
-
placeholder:
|
|
1631
|
-
value:
|
|
1632
|
-
min:
|
|
1633
|
-
max:
|
|
1660
|
+
schema: d.object({
|
|
1661
|
+
label: d.any().optional(),
|
|
1662
|
+
enableDate: d.any().optional(),
|
|
1663
|
+
enableTime: d.any().optional(),
|
|
1664
|
+
placeholder: d.any().optional(),
|
|
1665
|
+
value: d.any().optional(),
|
|
1666
|
+
min: d.any().optional(),
|
|
1667
|
+
max: d.any().optional()
|
|
1634
1668
|
}).passthrough()
|
|
1635
1669
|
},
|
|
1636
|
-
|
|
1637
|
-
),
|
|
1670
|
+
Fr
|
|
1671
|
+
), Pr = {
|
|
1638
1672
|
name: "FileUpload",
|
|
1639
|
-
schema:
|
|
1640
|
-
label:
|
|
1641
|
-
accept:
|
|
1642
|
-
fileAcceptTypes:
|
|
1643
|
-
filePlaceholderIcon:
|
|
1644
|
-
minCount:
|
|
1645
|
-
maxCount:
|
|
1646
|
-
value:
|
|
1673
|
+
schema: d.object({
|
|
1674
|
+
label: d.any().optional(),
|
|
1675
|
+
accept: d.any().optional(),
|
|
1676
|
+
fileAcceptTypes: d.any().optional(),
|
|
1677
|
+
filePlaceholderIcon: d.any().optional(),
|
|
1678
|
+
minCount: d.any().optional(),
|
|
1679
|
+
maxCount: d.any().optional(),
|
|
1680
|
+
value: d.any().optional()
|
|
1647
1681
|
}).passthrough()
|
|
1648
1682
|
};
|
|
1649
|
-
function
|
|
1650
|
-
const { interactive: t } =
|
|
1683
|
+
function Er({ context: e }) {
|
|
1684
|
+
const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.accept), i = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = l ? l.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = Jt(i, c), m = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
1651
1685
|
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
|
-
|
|
1686
|
+
) ? 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;
|
|
1687
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
|
|
1688
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
1689
|
+
/* @__PURE__ */ x(
|
|
1690
|
+
ge.Dragger,
|
|
1657
1691
|
{
|
|
1658
1692
|
disabled: !t || F,
|
|
1659
|
-
accept:
|
|
1693
|
+
accept: Kt(i, c),
|
|
1660
1694
|
className: "form-file-upload-preview",
|
|
1661
|
-
showUploadList: t &&
|
|
1662
|
-
fileList: t ?
|
|
1695
|
+
showUploadList: t && C.length > 0,
|
|
1696
|
+
fileList: t ? C.map((f, h) => ({
|
|
1663
1697
|
uid: `${h}-${f}`,
|
|
1664
1698
|
name: f,
|
|
1665
1699
|
status: "done"
|
|
1666
1700
|
})) : [],
|
|
1667
1701
|
beforeUpload: (f) => {
|
|
1668
|
-
if (!t) return
|
|
1669
|
-
const h =
|
|
1670
|
-
if (S && h.length >=
|
|
1671
|
-
const
|
|
1672
|
-
return r(
|
|
1702
|
+
if (!t) return ge.LIST_IGNORE;
|
|
1703
|
+
const h = j(Le(e));
|
|
1704
|
+
if (S && h.length >= y) return ge.LIST_IGNORE;
|
|
1705
|
+
const k = S ? [...h, f.name].slice(0, y) : [...h, f.name];
|
|
1706
|
+
return r(k), !1;
|
|
1673
1707
|
},
|
|
1674
1708
|
onRemove: (f) => {
|
|
1675
|
-
const h =
|
|
1709
|
+
const h = j(Le(e)), k = /^(\d+)-/.exec(f.uid ?? ""), v = k ? Number(k[1]) : -1, b = v >= 0 && v < h.length ? h.filter((P, R) => R !== v) : h.filter((P) => P !== f.name);
|
|
1676
1710
|
if (b.length < p) return !1;
|
|
1677
1711
|
r(b);
|
|
1678
1712
|
},
|
|
1679
1713
|
children: [
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(mr, { type: m, size: 40 }) }),
|
|
1715
|
+
/* @__PURE__ */ s("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
1682
1716
|
]
|
|
1683
1717
|
}
|
|
1684
1718
|
),
|
|
1685
|
-
/* @__PURE__ */
|
|
1719
|
+
/* @__PURE__ */ x(L.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
1686
1720
|
"允许:",
|
|
1687
1721
|
u ?? "全部类型",
|
|
1688
1722
|
p > 0 ? `;至少 ${p} 个文件` : "",
|
|
1689
|
-
S ? `;最多 ${
|
|
1690
|
-
|
|
1723
|
+
S ? `;最多 ${y} 个文件` : "",
|
|
1724
|
+
T && t ? `(当前 ${C.length} 个,未达下限)` : ""
|
|
1691
1725
|
] })
|
|
1692
1726
|
] });
|
|
1693
1727
|
}
|
|
1694
|
-
const
|
|
1695
|
-
|
|
1696
|
-
|
|
1728
|
+
const Ur = z(
|
|
1729
|
+
Pr,
|
|
1730
|
+
Er
|
|
1697
1731
|
);
|
|
1698
|
-
function
|
|
1699
|
-
const { interactive: t } =
|
|
1732
|
+
function _r({ context: e }) {
|
|
1733
|
+
const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), l = N(o.placeholder), i = N(o.variant) || "shortText", c = Q(n) ?? "", u = !t, m = "form-block-preview-control";
|
|
1700
1734
|
let p;
|
|
1701
|
-
if (
|
|
1702
|
-
p = /* @__PURE__ */
|
|
1703
|
-
|
|
1735
|
+
if (i === "longText")
|
|
1736
|
+
p = /* @__PURE__ */ s(
|
|
1737
|
+
ye.TextArea,
|
|
1704
1738
|
{
|
|
1705
1739
|
disabled: u,
|
|
1706
|
-
className:
|
|
1707
|
-
placeholder:
|
|
1740
|
+
className: m,
|
|
1741
|
+
placeholder: l || "长文本回答...",
|
|
1708
1742
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
1709
|
-
value:
|
|
1710
|
-
onChange: (
|
|
1743
|
+
value: c,
|
|
1744
|
+
onChange: (y) => r(y.target.value)
|
|
1711
1745
|
}
|
|
1712
1746
|
);
|
|
1713
|
-
else if (
|
|
1714
|
-
const
|
|
1715
|
-
p = /* @__PURE__ */
|
|
1716
|
-
|
|
1747
|
+
else if (i === "number") {
|
|
1748
|
+
const y = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
|
|
1749
|
+
p = /* @__PURE__ */ s(
|
|
1750
|
+
Tt,
|
|
1717
1751
|
{
|
|
1718
1752
|
disabled: u,
|
|
1719
|
-
className:
|
|
1753
|
+
className: m,
|
|
1720
1754
|
style: { width: "100%" },
|
|
1721
|
-
placeholder:
|
|
1722
|
-
value:
|
|
1755
|
+
placeholder: l || "数字",
|
|
1756
|
+
value: y,
|
|
1723
1757
|
onChange: (S) => r(S == null ? "" : String(S))
|
|
1724
1758
|
}
|
|
1725
1759
|
);
|
|
1726
|
-
} else
|
|
1727
|
-
|
|
1760
|
+
} else i === "obscured" ? p = /* @__PURE__ */ s(
|
|
1761
|
+
ye.Password,
|
|
1728
1762
|
{
|
|
1729
1763
|
disabled: u,
|
|
1730
|
-
className:
|
|
1731
|
-
placeholder:
|
|
1732
|
-
value:
|
|
1733
|
-
onChange: (
|
|
1764
|
+
className: m,
|
|
1765
|
+
placeholder: l,
|
|
1766
|
+
value: c,
|
|
1767
|
+
onChange: (y) => r(y.target.value)
|
|
1734
1768
|
}
|
|
1735
|
-
) : p = /* @__PURE__ */
|
|
1736
|
-
|
|
1769
|
+
) : p = /* @__PURE__ */ s(
|
|
1770
|
+
ye,
|
|
1737
1771
|
{
|
|
1738
1772
|
disabled: u,
|
|
1739
|
-
className:
|
|
1740
|
-
placeholder:
|
|
1741
|
-
value:
|
|
1742
|
-
onChange: (
|
|
1773
|
+
className: m,
|
|
1774
|
+
placeholder: l,
|
|
1775
|
+
value: c,
|
|
1776
|
+
onChange: (y) => r(y.target.value)
|
|
1743
1777
|
}
|
|
1744
1778
|
);
|
|
1745
|
-
return /* @__PURE__ */
|
|
1746
|
-
a ? /* @__PURE__ */
|
|
1779
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
|
|
1780
|
+
a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
|
|
1747
1781
|
p
|
|
1748
1782
|
] });
|
|
1749
1783
|
}
|
|
1750
|
-
const
|
|
1784
|
+
const zr = z(
|
|
1751
1785
|
{
|
|
1752
1786
|
name: "TextField",
|
|
1753
|
-
schema:
|
|
1754
|
-
label:
|
|
1755
|
-
variant:
|
|
1756
|
-
placeholder:
|
|
1757
|
-
validationRegexp:
|
|
1758
|
-
value:
|
|
1787
|
+
schema: d.object({
|
|
1788
|
+
label: d.any().optional(),
|
|
1789
|
+
variant: d.any().optional(),
|
|
1790
|
+
placeholder: d.any().optional(),
|
|
1791
|
+
validationRegexp: d.any().optional(),
|
|
1792
|
+
value: d.any().optional()
|
|
1759
1793
|
}).passthrough()
|
|
1760
1794
|
},
|
|
1761
|
-
|
|
1795
|
+
_r
|
|
1762
1796
|
);
|
|
1763
|
-
function
|
|
1764
|
-
const t = e.componentModel.properties, n =
|
|
1765
|
-
return
|
|
1797
|
+
function Rr({ context: e }) {
|
|
1798
|
+
const t = e.componentModel.properties, n = N(t.text), r = N(t.variant) || "body";
|
|
1799
|
+
return fr.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
1800
|
}
|
|
1767
|
-
const
|
|
1768
|
-
{ name: "Text", schema:
|
|
1769
|
-
|
|
1801
|
+
const wr = z(
|
|
1802
|
+
{ name: "Text", schema: re("Text") },
|
|
1803
|
+
Rr
|
|
1770
1804
|
);
|
|
1771
|
-
function
|
|
1805
|
+
function ft() {
|
|
1772
1806
|
const t = [
|
|
1773
|
-
...[...
|
|
1774
|
-
(r) => !
|
|
1807
|
+
...[...le.components.values()].filter(
|
|
1808
|
+
(r) => !dr.has(r.name)
|
|
1775
1809
|
),
|
|
1776
|
-
sr,
|
|
1777
|
-
fr,
|
|
1778
|
-
cr,
|
|
1779
|
-
ur,
|
|
1780
|
-
pr,
|
|
1781
1810
|
gr,
|
|
1782
|
-
vr,
|
|
1783
1811
|
xr,
|
|
1784
|
-
|
|
1812
|
+
yr,
|
|
1813
|
+
vr,
|
|
1814
|
+
br,
|
|
1785
1815
|
Tr,
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1816
|
+
Ir,
|
|
1817
|
+
Mr,
|
|
1818
|
+
Ur,
|
|
1819
|
+
zr,
|
|
1820
|
+
wr,
|
|
1821
|
+
...zn()
|
|
1822
|
+
], n = [...le.functions.values()];
|
|
1823
|
+
return new Et(mt, t, n, le.themeSchema);
|
|
1824
|
+
}
|
|
1825
|
+
const Or = gt(
|
|
1792
1826
|
function({
|
|
1793
1827
|
doc: t,
|
|
1794
1828
|
surfaceId: n = "skopon-form",
|
|
1795
1829
|
emptyHint: r = null,
|
|
1796
1830
|
interactive: o = !0,
|
|
1797
1831
|
fieldNames: a = [],
|
|
1798
|
-
resumeSearch:
|
|
1799
|
-
caseSearch:
|
|
1800
|
-
},
|
|
1801
|
-
|
|
1802
|
-
|
|
1832
|
+
resumeSearch: l = null,
|
|
1833
|
+
caseSearch: i = null
|
|
1834
|
+
}, c) {
|
|
1835
|
+
V(() => {
|
|
1836
|
+
We(), Ge();
|
|
1803
1837
|
}, []);
|
|
1804
|
-
const u =
|
|
1805
|
-
|
|
1838
|
+
const u = B(null), m = B(a);
|
|
1839
|
+
m.current = a;
|
|
1806
1840
|
const p = O(() => {
|
|
1807
|
-
if (
|
|
1841
|
+
if (Me(t)) return "";
|
|
1808
1842
|
try {
|
|
1809
1843
|
return JSON.stringify(t);
|
|
1810
1844
|
} catch {
|
|
1811
1845
|
return String(t);
|
|
1812
1846
|
}
|
|
1813
|
-
}, [t]),
|
|
1847
|
+
}, [t]), y = O(() => {
|
|
1814
1848
|
if (!p)
|
|
1815
1849
|
return { surfaces: [], processor: null };
|
|
1816
1850
|
try {
|
|
1817
|
-
const F = JSON.parse(p),
|
|
1851
|
+
const F = JSON.parse(p), T = new Xe([ft()]), f = Kn(F, {
|
|
1818
1852
|
surfaceId: n,
|
|
1819
|
-
catalogId:
|
|
1853
|
+
catalogId: mt
|
|
1820
1854
|
});
|
|
1821
|
-
return
|
|
1822
|
-
surfaces: Array.from(
|
|
1823
|
-
processor:
|
|
1855
|
+
return T.processMessages(f), {
|
|
1856
|
+
surfaces: Array.from(T.model.surfacesMap.values()),
|
|
1857
|
+
processor: T
|
|
1824
1858
|
};
|
|
1825
1859
|
} catch (F) {
|
|
1826
1860
|
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", F), { surfaces: [], processor: null };
|
|
1827
1861
|
}
|
|
1828
|
-
}, [p, n]), { surfaces: S, processor:
|
|
1829
|
-
return u.current =
|
|
1830
|
-
|
|
1862
|
+
}, [p, n]), { surfaces: S, processor: C } = y;
|
|
1863
|
+
return u.current = C, yt(
|
|
1864
|
+
c,
|
|
1831
1865
|
() => ({
|
|
1832
1866
|
getValues(F) {
|
|
1833
|
-
const
|
|
1834
|
-
if (!
|
|
1835
|
-
const f = (F ??
|
|
1836
|
-
return
|
|
1867
|
+
const T = u.current;
|
|
1868
|
+
if (!T) return {};
|
|
1869
|
+
const f = (F ?? m.current).map((h) => h.trim()).filter(Boolean);
|
|
1870
|
+
return Xn(T, n, f);
|
|
1837
1871
|
}
|
|
1838
1872
|
}),
|
|
1839
1873
|
[n]
|
|
1840
|
-
), S.length === 0 ? /* @__PURE__ */
|
|
1874
|
+
), S.length === 0 ? /* @__PURE__ */ s(De, { children: r }) : /* @__PURE__ */ s(at, { resumeSearch: l, children: /* @__PURE__ */ s(rt, { caseSearch: i, 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
1875
|
}
|
|
1842
1876
|
);
|
|
1843
|
-
function
|
|
1844
|
-
return new
|
|
1877
|
+
function ae() {
|
|
1878
|
+
return new Xe([ft()]);
|
|
1845
1879
|
}
|
|
1846
|
-
function
|
|
1880
|
+
function Zr({
|
|
1847
1881
|
messages: e,
|
|
1848
1882
|
surfaceId: t = "skopon-form-stream",
|
|
1849
1883
|
emptyHint: n = null,
|
|
@@ -1851,72 +1885,78 @@ function Dr({
|
|
|
1851
1885
|
resumeSearch: o = null,
|
|
1852
1886
|
caseSearch: a = null
|
|
1853
1887
|
}) {
|
|
1854
|
-
|
|
1855
|
-
|
|
1888
|
+
V(() => {
|
|
1889
|
+
We(), Ge();
|
|
1856
1890
|
}, []);
|
|
1857
|
-
const
|
|
1891
|
+
const l = B(null);
|
|
1892
|
+
l.current === null && (l.current = ae());
|
|
1893
|
+
const i = B(0), c = B(""), u = B(!0), m = B(t);
|
|
1858
1894
|
function p(f, h) {
|
|
1859
|
-
|
|
1895
|
+
l.current = f, i.current = h.length, c.current = JSON.stringify(h), u.current && (C(f), T(Array.from(f.model.surfacesMap.values())));
|
|
1860
1896
|
}
|
|
1861
|
-
function
|
|
1897
|
+
function y(f, h) {
|
|
1862
1898
|
if (h <= 0) return !1;
|
|
1863
|
-
const
|
|
1899
|
+
const k = JSON.stringify(f.slice(0, h)), v = c.current;
|
|
1864
1900
|
if (!v) return !0;
|
|
1865
1901
|
try {
|
|
1866
1902
|
const b = JSON.parse(v);
|
|
1867
|
-
return JSON.stringify(b.slice(0, h)) !==
|
|
1903
|
+
return JSON.stringify(b.slice(0, h)) !== k;
|
|
1868
1904
|
} catch {
|
|
1869
1905
|
return !0;
|
|
1870
1906
|
}
|
|
1871
1907
|
}
|
|
1872
|
-
const [S,
|
|
1873
|
-
() =>
|
|
1908
|
+
const [S, C] = E(
|
|
1909
|
+
() => l.current
|
|
1910
|
+
), [F, T] = E(
|
|
1911
|
+
() => Array.from(
|
|
1912
|
+
l.current.model.surfacesMap.values()
|
|
1913
|
+
)
|
|
1874
1914
|
);
|
|
1875
|
-
return
|
|
1915
|
+
return V(() => (u.current = !0, () => {
|
|
1876
1916
|
u.current = !1;
|
|
1877
|
-
}), []),
|
|
1878
|
-
|
|
1879
|
-
}, [S]),
|
|
1917
|
+
}), []), V(() => {
|
|
1918
|
+
l.current = S;
|
|
1919
|
+
}, [S]), V(() => {
|
|
1880
1920
|
const f = () => {
|
|
1881
|
-
u.current &&
|
|
1882
|
-
}, h = S.onSurfaceCreated(f),
|
|
1921
|
+
u.current && T(Array.from(S.model.surfacesMap.values()));
|
|
1922
|
+
}, h = S.onSurfaceCreated(f), k = S.onSurfaceDeleted(f);
|
|
1883
1923
|
return () => {
|
|
1884
|
-
h.unsubscribe(),
|
|
1924
|
+
h.unsubscribe(), k.unsubscribe();
|
|
1885
1925
|
};
|
|
1886
|
-
}, [S]),
|
|
1926
|
+
}, [S]), V(() => {
|
|
1887
1927
|
let f = !1;
|
|
1888
|
-
const h =
|
|
1889
|
-
if (
|
|
1890
|
-
const
|
|
1891
|
-
return Array.isArray(e) && e.length > 0 ? (
|
|
1928
|
+
const h = m.current !== t;
|
|
1929
|
+
if (m.current = t, h) {
|
|
1930
|
+
const P = ae();
|
|
1931
|
+
return Array.isArray(e) && e.length > 0 ? (P.processMessages(e), f || p(P, e)) : (l.current = P, i.current = 0, c.current = "", f || (C(P), T([]))), () => {
|
|
1892
1932
|
f = !0;
|
|
1893
1933
|
};
|
|
1894
1934
|
}
|
|
1895
1935
|
if (!Array.isArray(e) || e.length === 0) {
|
|
1896
|
-
if (
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1936
|
+
if (i.current > 0) {
|
|
1937
|
+
const P = ae();
|
|
1938
|
+
l.current = P, i.current = 0, c.current = "", f || (C(P), T([]));
|
|
1899
1939
|
}
|
|
1900
1940
|
return () => {
|
|
1901
1941
|
f = !0;
|
|
1902
1942
|
};
|
|
1903
1943
|
}
|
|
1904
|
-
const
|
|
1905
|
-
if (e.length < v ||
|
|
1906
|
-
const
|
|
1907
|
-
return
|
|
1944
|
+
const k = l.current, v = i.current;
|
|
1945
|
+
if (e.length < v || y(e, v)) {
|
|
1946
|
+
const P = ae();
|
|
1947
|
+
return P.processMessages(e), f || p(P, e), () => {
|
|
1908
1948
|
f = !0;
|
|
1909
1949
|
};
|
|
1910
1950
|
}
|
|
1911
1951
|
const b = e.slice(v);
|
|
1912
1952
|
return b.length === 0 ? () => {
|
|
1913
1953
|
f = !0;
|
|
1914
|
-
} : (
|
|
1954
|
+
} : (k.processMessages(b), i.current = e.length, c.current = JSON.stringify(e), f || T(Array.from(k.model.surfacesMap.values())), () => {
|
|
1915
1955
|
f = !0;
|
|
1916
1956
|
});
|
|
1917
|
-
}, [e, t]), F.length === 0 ? /* @__PURE__ */
|
|
1957
|
+
}, [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
1958
|
}
|
|
1919
|
-
function
|
|
1959
|
+
function Br({
|
|
1920
1960
|
payload: e,
|
|
1921
1961
|
callbackUrl: t,
|
|
1922
1962
|
title: n,
|
|
@@ -1924,30 +1964,30 @@ function Pr({
|
|
|
1924
1964
|
incompleteFormId: o,
|
|
1925
1965
|
onNotify: a
|
|
1926
1966
|
}) {
|
|
1927
|
-
const
|
|
1928
|
-
() =>
|
|
1967
|
+
const l = O(
|
|
1968
|
+
() => Gn(e, t),
|
|
1929
1969
|
[e, t]
|
|
1930
1970
|
);
|
|
1931
|
-
async function
|
|
1971
|
+
async function i() {
|
|
1932
1972
|
try {
|
|
1933
|
-
await
|
|
1973
|
+
await pt(l), a == null || a("success", "已复制到剪贴板");
|
|
1934
1974
|
} catch {
|
|
1935
1975
|
a == null || a("error", "复制失败");
|
|
1936
1976
|
}
|
|
1937
1977
|
}
|
|
1938
|
-
return /* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
r ? /* @__PURE__ */
|
|
1943
|
-
o ? /* @__PURE__ */
|
|
1978
|
+
return /* @__PURE__ */ x("div", { className: "ask-user-curl-card", children: [
|
|
1979
|
+
/* @__PURE__ */ x("div", { className: "ask-user-curl-card-header", children: [
|
|
1980
|
+
/* @__PURE__ */ x("div", { className: "ask-user-curl-card-header-title", children: [
|
|
1981
|
+
/* @__PURE__ */ s(L.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
1982
|
+
r ? /* @__PURE__ */ s(ie, { title: r, children: /* @__PURE__ */ s(Z, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
1983
|
+
o ? /* @__PURE__ */ s(ie, { title: o, children: /* @__PURE__ */ s(Z, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
1944
1984
|
] }),
|
|
1945
|
-
/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ s(ue, { size: "small", type: "text", onClick: () => void i(), children: "复制" })
|
|
1946
1986
|
] }),
|
|
1947
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: l })
|
|
1948
1988
|
] });
|
|
1949
1989
|
}
|
|
1950
|
-
function
|
|
1990
|
+
function Vr(e, t) {
|
|
1951
1991
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
1952
1992
|
const n = t.message;
|
|
1953
1993
|
if (typeof n == "string" && n.trim())
|
|
@@ -1955,114 +1995,114 @@ function Er(e, t) {
|
|
|
1955
1995
|
}
|
|
1956
1996
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
1957
1997
|
}
|
|
1958
|
-
function
|
|
1998
|
+
function Qr({
|
|
1959
1999
|
payload: e,
|
|
1960
2000
|
formUniqueId: t,
|
|
1961
2001
|
callbackUrl: n,
|
|
1962
2002
|
submitMode: r = "curl",
|
|
1963
2003
|
fetchFormDetail: o,
|
|
1964
2004
|
onNotify: a,
|
|
1965
|
-
resumeSearch:
|
|
1966
|
-
caseSearch:
|
|
2005
|
+
resumeSearch: l = null,
|
|
2006
|
+
caseSearch: i = null
|
|
1967
2007
|
}) {
|
|
1968
|
-
const [
|
|
2008
|
+
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
2009
|
h.current = a;
|
|
1970
|
-
const
|
|
1971
|
-
|
|
2010
|
+
const k = (t == null ? void 0 : t.trim()) ?? "";
|
|
2011
|
+
V(() => (f.current = !0, () => {
|
|
1972
2012
|
f.current = !1;
|
|
1973
|
-
}), []),
|
|
1974
|
-
let
|
|
1975
|
-
return
|
|
1976
|
-
|
|
1977
|
-
}).catch((
|
|
1978
|
-
var
|
|
1979
|
-
if (!
|
|
2013
|
+
}), []), V(() => {
|
|
2014
|
+
let g = !1;
|
|
2015
|
+
return k ? (S(!0), p(!1), o({ formUniqueId: k }).then((A) => {
|
|
2016
|
+
g || (p(!!A.disabled), u(A.formDefinition ?? null));
|
|
2017
|
+
}).catch((A) => {
|
|
2018
|
+
var M;
|
|
2019
|
+
if (!g) {
|
|
1980
2020
|
p(!1), u(null);
|
|
1981
|
-
const
|
|
1982
|
-
(
|
|
2021
|
+
const I = A instanceof Error ? A.message : "获取表单定义失败";
|
|
2022
|
+
(M = h.current) == null || M.call(h, "error", I);
|
|
1983
2023
|
}
|
|
1984
2024
|
}).finally(() => {
|
|
1985
|
-
|
|
2025
|
+
g || S(!1);
|
|
1986
2026
|
}), () => {
|
|
1987
|
-
|
|
2027
|
+
g = !0;
|
|
1988
2028
|
}) : (S(!1), p(!1), u(null), () => {
|
|
1989
|
-
|
|
2029
|
+
g = !0;
|
|
1990
2030
|
});
|
|
1991
|
-
}, [
|
|
1992
|
-
const v = O(() =>
|
|
1993
|
-
() =>
|
|
1994
|
-
[
|
|
1995
|
-
),
|
|
1996
|
-
var
|
|
1997
|
-
return (
|
|
1998
|
-
}).map((
|
|
2031
|
+
}, [k, o]);
|
|
2032
|
+
const v = O(() => nr(e), [e]), b = O(() => v ? rr(v, c ?? void 0) : null, [v, c]), P = (b == null ? void 0 : b.matchedBlocks) ?? [], R = !!(v && lr(v) && P.length === 0), _ = O(() => R && v ? ir(v) : b && b.renderBlocks.length > 0 ? b.renderBlocks : [], [b, R, v]), w = O(
|
|
2033
|
+
() => R ? {} : ar((b == null ? void 0 : b.extraBlocks) ?? []),
|
|
2034
|
+
[R, b]
|
|
2035
|
+
), q = O(() => R && v ? sr(v) : _.filter((g) => {
|
|
2036
|
+
var A;
|
|
2037
|
+
return (A = g.name) == null ? void 0 : A.trim();
|
|
2038
|
+
}).map((g) => g.name.trim()), [R, v, _]), K = O(() => {
|
|
1999
2039
|
if (_.length === 0) return null;
|
|
2000
|
-
const
|
|
2001
|
-
return
|
|
2002
|
-
}, [b, v, _]),
|
|
2003
|
-
if (
|
|
2004
|
-
return /* @__PURE__ */
|
|
2040
|
+
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) ?? "";
|
|
2041
|
+
return Hn({ title: g, description: A }, _);
|
|
2042
|
+
}, [b, v, _]), Y = k ? `ask-user-${k}` : "ask-user-payload";
|
|
2043
|
+
if (y)
|
|
2044
|
+
return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(Ue, { size: "small" }) });
|
|
2005
2045
|
if (!v || _.length === 0)
|
|
2006
|
-
return /* @__PURE__ */
|
|
2007
|
-
|
|
2046
|
+
return /* @__PURE__ */ s(
|
|
2047
|
+
Br,
|
|
2008
2048
|
{
|
|
2009
2049
|
payload: e,
|
|
2010
2050
|
callbackUrl: n,
|
|
2011
|
-
unpublishedFormId:
|
|
2051
|
+
unpublishedFormId: m && k ? k : void 0,
|
|
2012
2052
|
onNotify: a
|
|
2013
2053
|
}
|
|
2014
2054
|
);
|
|
2015
2055
|
async function X() {
|
|
2016
|
-
var
|
|
2017
|
-
if (!
|
|
2056
|
+
var g, A, M, I, Oe, Be;
|
|
2057
|
+
if (!C) {
|
|
2018
2058
|
F(!0);
|
|
2019
2059
|
try {
|
|
2020
|
-
const
|
|
2060
|
+
const G = ((g = T.current) == null ? void 0 : g.getValues(q)) ?? {}, fe = { ...G, ...w };
|
|
2021
2061
|
if (r === "post") {
|
|
2022
2062
|
const Ve = (n ?? "").trim();
|
|
2023
2063
|
if (!Ve) {
|
|
2024
|
-
(
|
|
2064
|
+
(A = h.current) == null || A.call(h, "error", "callback_url 为空,无法提交");
|
|
2025
2065
|
return;
|
|
2026
2066
|
}
|
|
2027
|
-
const
|
|
2067
|
+
const he = await cr(Ve, fe);
|
|
2028
2068
|
if (!f.current) return;
|
|
2029
|
-
|
|
2069
|
+
he.ok ? (M = h.current) == null || M.call(h, "success", "提交成功") : (I = h.current) == null || I.call(h, "error", Vr(he.status, he.body));
|
|
2030
2070
|
return;
|
|
2031
2071
|
}
|
|
2032
|
-
if (await
|
|
2033
|
-
|
|
2072
|
+
if (await pt(
|
|
2073
|
+
Zn({ cardValues: G, extraValues: w, callbackUrl: n })
|
|
2034
2074
|
), !f.current) return;
|
|
2035
|
-
(
|
|
2036
|
-
} catch (
|
|
2075
|
+
(Oe = h.current) == null || Oe.call(h, "success", "已复制 curl 到剪贴板");
|
|
2076
|
+
} catch (G) {
|
|
2037
2077
|
if (!f.current) return;
|
|
2038
|
-
const
|
|
2039
|
-
(
|
|
2078
|
+
const fe = G instanceof Error ? G.message : "复制失败";
|
|
2079
|
+
(Be = h.current) == null || Be.call(h, "error", fe);
|
|
2040
2080
|
} finally {
|
|
2041
2081
|
f.current && F(!1);
|
|
2042
2082
|
}
|
|
2043
2083
|
}
|
|
2044
2084
|
}
|
|
2045
|
-
return /* @__PURE__ */
|
|
2046
|
-
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
|
|
2085
|
+
return /* @__PURE__ */ x("div", { className: "ask-user-form-card", children: [
|
|
2086
|
+
m && k ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(ie, { title: k, children: /* @__PURE__ */ s(Z, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
2087
|
+
/* @__PURE__ */ s(
|
|
2088
|
+
Or,
|
|
2049
2089
|
{
|
|
2050
|
-
ref:
|
|
2051
|
-
doc:
|
|
2052
|
-
surfaceId:
|
|
2053
|
-
fieldNames:
|
|
2090
|
+
ref: T,
|
|
2091
|
+
doc: K,
|
|
2092
|
+
surfaceId: Y,
|
|
2093
|
+
fieldNames: q,
|
|
2054
2094
|
interactive: !0,
|
|
2055
|
-
resumeSearch:
|
|
2056
|
-
caseSearch:
|
|
2095
|
+
resumeSearch: l,
|
|
2096
|
+
caseSearch: i
|
|
2057
2097
|
}
|
|
2058
2098
|
),
|
|
2059
|
-
/* @__PURE__ */
|
|
2060
|
-
|
|
2099
|
+
/* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(ie, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
|
|
2100
|
+
ue,
|
|
2061
2101
|
{
|
|
2062
2102
|
type: "primary",
|
|
2063
2103
|
size: "small",
|
|
2064
|
-
loading:
|
|
2065
|
-
disabled:
|
|
2104
|
+
loading: C,
|
|
2105
|
+
disabled: C,
|
|
2066
2106
|
onClick: () => void X(),
|
|
2067
2107
|
children: "提交"
|
|
2068
2108
|
}
|
|
@@ -2070,39 +2110,39 @@ function Jr({
|
|
|
2070
2110
|
] });
|
|
2071
2111
|
}
|
|
2072
2112
|
export {
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2113
|
+
Gr as A2UI_PROTOCOL_VERSION,
|
|
2114
|
+
Qr as AskUserFormCard,
|
|
2115
|
+
rt as CaseSearchProvider,
|
|
2116
|
+
Br as CurlSubmitBlock,
|
|
2117
|
+
Ut as FORM_MEDIA_SIZES,
|
|
2118
|
+
at as ResumeSearchProvider,
|
|
2119
|
+
Zr as SkoponA2uiStreamRenderer,
|
|
2120
|
+
Or as SkoponFormRenderer,
|
|
2121
|
+
Dn as a2uiToBlocks,
|
|
2082
2122
|
it as blocksToA2ui,
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2123
|
+
Wn as buildAskUserCurlBodyJson,
|
|
2124
|
+
Zn as buildAskUserCurlStatement,
|
|
2125
|
+
Hn as buildAskUserSurface,
|
|
2126
|
+
Gn as buildCurlStatement,
|
|
2127
|
+
pt as copyTextToClipboard,
|
|
2128
|
+
Wr as createFormClient,
|
|
2129
|
+
ar as extractExtraBlockValues,
|
|
2130
|
+
Xn as extractSurfaceValues,
|
|
2131
|
+
sr as getPayloadInputFieldNames,
|
|
2132
|
+
ir as getPayloadRenderableBlocks,
|
|
2133
|
+
rr as intersectPayloadBlocksWithForm,
|
|
2134
|
+
Me as isA2uiSurfaceEmpty,
|
|
2135
|
+
J as isInputBlockType,
|
|
2136
|
+
_e as isLayoutBlockType,
|
|
2097
2137
|
Ie as isMediaBlockType,
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2138
|
+
Yn as mapFormDefinitionFromDto,
|
|
2139
|
+
H as normalizeFormDefinition,
|
|
2140
|
+
nr as parsePayloadBlocksJson,
|
|
2141
|
+
lr as payloadHasInputBlocks,
|
|
2142
|
+
Jn as resolveSurfaceFromFormDefinition,
|
|
2143
|
+
cr as submitFormJson,
|
|
2144
|
+
Kn as surfaceDocToMessages,
|
|
2145
|
+
se as syncFormDefinition,
|
|
2146
|
+
un as useCaseSearch,
|
|
2147
|
+
bn as useResumeSearch
|
|
2108
2148
|
};
|