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