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