inquirer-form 0.2.0 → 0.2.1

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.
@@ -1,17 +1,17 @@
1
- import { defineComponent as h, computed as V, createBlock as x, openBlock as u, unref as o, withCtx as w, createElementVNode as c, createElementBlock as d, createCommentVNode as y, toDisplayString as f, Fragment as S, renderList as I, toRefs as B, createVNode as b, createSlots as re, createTextVNode as Y, renderSlot as ne, ref as L, Transition as Ie, mergeProps as D, onBeforeUnmount as ue, watch as ee, resolveComponent as Ne, resolveDynamicComponent as ae, normalizeProps as Be, guardReactiveProps as Ae, onMounted as Re, withDirectives as W, normalizeClass as Te, vShow as X } from "vue";
2
- import { FormItemWrapper as de, TextSetting as N, SwitchSetting as le, OptionsEditor as ce, registry as Q, SchemaEngine as pe, FormDesigner as me, serialize as De } from "agilebuilder-form";
3
- import { ElInput as H, ElTooltip as ze, ElIcon as Fe, ElInputNumber as fe, ElSwitch as Le, ElSelect as ve, ElOption as be, ElCheckboxGroup as Me, ElCheckbox as Oe, ElForm as Je } from "element-plus";
4
- import { useI18n as Pe } from "vue-i18n";
5
- const Qe = { class: "inquirer-designer-card" }, je = { class: "card-header" }, Ge = { class: "type-badge" }, Ye = { class: "message" }, He = {
1
+ import { defineComponent as f, computed as y, createBlock as b, openBlock as i, unref as o, withCtx as V, createElementVNode as c, createElementBlock as d, createCommentVNode as x, toDisplayString as m, Fragment as I, renderList as z, toRefs as B, createVNode as h, createSlots as xe, createTextVNode as X, renderSlot as ie, ref as H, Transition as Oe, mergeProps as L, onBeforeUnmount as ye, watch as Z, resolveComponent as He, resolveDynamicComponent as he, normalizeProps as Je, guardReactiveProps as Ge, onMounted as Qe, withDirectives as oe, normalizeClass as je, vShow as ne } from "vue";
2
+ import { FormItemWrapper as _e, TextSetting as A, SwitchSetting as se, OptionsEditor as we, registry as j, SchemaEngine as Ve, FormDesigner as qe, serialize as We } from "agilebuilder-form";
3
+ import { ElInput as ee, ElTooltip as Ye, ElIcon as Ce, ElInputNumber as Ee, ElSwitch as Ke, ElSelect as Se, ElOption as ke, ElCheckboxGroup as Xe, ElCheckbox as Ze, ElForm as et } from "element-plus";
4
+ import { useI18n as re } from "vue-i18n";
5
+ const tt = { class: "inquirer-designer-card" }, lt = { class: "card-header" }, st = { class: "type-badge" }, at = { class: "message" }, ot = {
6
6
  key: 0,
7
7
  class: "description"
8
- }, Ke = {
8
+ }, nt = {
9
9
  key: 1,
10
10
  class: "options-preview"
11
- }, We = {
11
+ }, it = {
12
12
  key: 0,
13
13
  class: "more"
14
- }, Xe = /* @__PURE__ */ h({
14
+ }, rt = /* @__PURE__ */ f({
15
15
  inheritAttrs: !1,
16
16
  __name: "BaseQuestionDesigner",
17
17
  props: {
@@ -24,38 +24,38 @@ const Qe = { class: "inquirer-designer-card" }, je = { class: "card-header" }, G
24
24
  previewCount: {}
25
25
  },
26
26
  emits: ["select"],
27
- setup(e, { emit: t }) {
28
- const l = e, s = t, a = V(() => l.previewCount ?? 3), i = V(() => l.options?.slice(0, a.value) ?? []), n = V(() => (l.options?.length ?? 0) > a.value), r = V(() => l.label || l.message || l.typeLabel), g = V(() => l.message || "未设置 message");
29
- return (m, p) => (u(), x(o(de), {
27
+ setup(e, { emit: l }) {
28
+ const t = e, a = l, r = y(() => t.previewCount ?? 3), n = y(() => t.options?.slice(0, r.value) ?? []), s = y(() => (t.options?.length ?? 0) > r.value), u = y(() => t.label || t.message || t.typeLabel), _ = y(() => t.message || "未设置 message");
29
+ return (p, v) => (i(), b(o(_e), {
30
30
  selectable: "",
31
- label: r.value,
31
+ label: u.value,
32
32
  "is-active": e.isActive,
33
- onSelect: p[0] || (p[0] = (v) => s("select"))
33
+ onSelect: v[0] || (v[0] = (g) => a("select"))
34
34
  }, {
35
- default: w(() => [
36
- c("div", Qe, [
37
- c("header", je, [
38
- c("span", Ge, f(e.typeLabel), 1)
35
+ default: V(() => [
36
+ c("div", tt, [
37
+ c("header", lt, [
38
+ c("span", st, m(e.typeLabel), 1)
39
39
  ]),
40
- c("div", Ye, f(g.value), 1),
41
- e.description ? (u(), d("p", He, f(e.description), 1)) : y("", !0),
42
- i.value.length ? (u(), d("ul", Ke, [
43
- (u(!0), d(S, null, I(i.value, (v) => (u(), d("li", {
44
- key: v.value
45
- }, f(v.label || v.value), 1))), 128)),
46
- n.value ? (u(), d("li", We, "…")) : y("", !0)
47
- ])) : y("", !0)
40
+ c("div", at, m(_.value), 1),
41
+ e.description ? (i(), d("p", ot, m(e.description), 1)) : x("", !0),
42
+ n.value.length ? (i(), d("ul", nt, [
43
+ (i(!0), d(I, null, z(n.value, (g) => (i(), d("li", {
44
+ key: g.value
45
+ }, m(g.label || g.value), 1))), 128)),
46
+ s.value ? (i(), d("li", it, "…")) : x("", !0)
47
+ ])) : x("", !0)
48
48
  ])
49
49
  ]),
50
50
  _: 1
51
51
  }, 8, ["label", "is-active"]));
52
52
  }
53
- }), _ = (e, t) => {
54
- const l = e.__vccOpts || e;
55
- for (const [s, a] of t)
56
- l[s] = a;
57
- return l;
58
- }, A = /* @__PURE__ */ _(Xe, [["__scopeId", "data-v-5aa173c3"]]), Ze = /* @__PURE__ */ h({
53
+ }), q = (e, l) => {
54
+ const t = e.__vccOpts || e;
55
+ for (const [a, r] of l)
56
+ t[a] = r;
57
+ return t;
58
+ }, M = /* @__PURE__ */ q(rt, [["__scopeId", "data-v-b29b6f1e"]]), ut = /* @__PURE__ */ f({
59
59
  __name: "designer",
60
60
  props: {
61
61
  label: {},
@@ -64,21 +64,21 @@ const Qe = { class: "inquirer-designer-card" }, je = { class: "card-header" }, G
64
64
  isActive: { type: Boolean }
65
65
  },
66
66
  emits: ["select"],
67
- setup(e, { emit: t }) {
68
- const l = e, s = t, { label: a, message: i, description: n, isActive: r } = B(l);
69
- return (g, m) => (u(), x(A, {
70
- label: o(a),
71
- message: o(i),
72
- description: o(n),
67
+ setup(e, { emit: l }) {
68
+ const t = e, a = l, { label: r, message: n, description: s, isActive: u } = B(t);
69
+ return (_, p) => (i(), b(M, {
70
+ label: o(r),
71
+ message: o(n),
72
+ description: o(s),
73
73
  "type-label": "Inquirer Input",
74
- "is-active": o(r),
75
- onSelect: m[0] || (m[0] = (p) => s("select"))
74
+ "is-active": o(u),
75
+ onSelect: p[0] || (p[0] = (v) => a("select"))
76
76
  }, null, 8, ["label", "message", "description", "is-active"]));
77
77
  }
78
- }), el = { class: "inquirer-input" }, ll = {
78
+ }), ct = { class: "inquirer-input" }, dt = {
79
79
  key: 0,
80
80
  class: "transformer-preview"
81
- }, tl = /* @__PURE__ */ h({
81
+ }, pt = /* @__PURE__ */ f({
82
82
  __name: "runtime",
83
83
  props: {
84
84
  modelValue: {},
@@ -89,67 +89,62 @@ const Qe = { class: "inquirer-designer-card" }, je = { class: "card-header" }, G
89
89
  displayValue: {}
90
90
  },
91
91
  emits: ["update:modelValue"],
92
- setup(e, { emit: t }) {
93
- const l = e, s = t, a = V(() => l.displayValue === void 0 ? !1 : l.displayValue !== l.modelValue);
94
- return (i, n) => (u(), d("div", el, [
95
- b(o(H), {
92
+ setup(e, { emit: l }) {
93
+ const t = e, a = l, r = y(() => t.displayValue === void 0 ? !1 : t.displayValue !== t.modelValue);
94
+ return (n, s) => (i(), d("div", ct, [
95
+ h(o(ee), {
96
96
  "model-value": e.modelValue ?? "",
97
97
  placeholder: e.placeholder,
98
98
  disabled: e.disabled,
99
99
  clearable: "",
100
- "onUpdate:modelValue": n[0] || (n[0] = (r) => s("update:modelValue", r ?? ""))
101
- }, re({ _: 2 }, [
100
+ "onUpdate:modelValue": s[0] || (s[0] = (u) => a("update:modelValue", u ?? ""))
101
+ }, xe({ _: 2 }, [
102
102
  e.prefix ? {
103
103
  name: "prepend",
104
- fn: w(() => [
105
- Y(f(e.prefix), 1)
104
+ fn: V(() => [
105
+ X(m(e.prefix), 1)
106
106
  ]),
107
107
  key: "0"
108
108
  } : void 0,
109
109
  e.suffix ? {
110
110
  name: "append",
111
- fn: w(() => [
112
- Y(f(e.suffix), 1)
111
+ fn: V(() => [
112
+ X(m(e.suffix), 1)
113
113
  ]),
114
114
  key: "1"
115
115
  } : void 0
116
116
  ]), 1032, ["model-value", "placeholder", "disabled"]),
117
- a.value ? (u(), d("p", ll, f(e.displayValue), 1)) : y("", !0)
117
+ r.value ? (i(), d("p", dt, m(e.displayValue), 1)) : x("", !0)
118
118
  ]));
119
119
  }
120
- }), nl = /* @__PURE__ */ _(tl, [["__scopeId", "data-v-b9ac497e"]]), sl = { class: "base-input-config" }, ol = /* @__PURE__ */ h({
120
+ }), mt = /* @__PURE__ */ q(pt, [["__scopeId", "data-v-c4eebc18"]]), ft = { class: "base-input-config" }, ht = /* @__PURE__ */ f({
121
121
  __name: "BaseInputConfig",
122
122
  props: {
123
123
  label: {},
124
124
  field: {}
125
125
  },
126
126
  emits: ["update"],
127
- setup(e, { emit: t }) {
128
- const l = t;
129
- function s(i) {
130
- l("update", { field: i });
127
+ setup(e, { emit: l }) {
128
+ const t = l;
129
+ function a(n) {
130
+ t("update", { field: n });
131
131
  }
132
- function a(i, n) {
133
- l("update", { props: { [i]: n } });
132
+ function r(n, s) {
133
+ t("update", { props: { [n]: s } });
134
134
  }
135
- return (i, n) => (u(), d("div", sl, [
136
- b(o(N), {
137
- label: i.$t("designer.node.field_label"),
135
+ return (n, s) => (i(), d("div", ft, [
136
+ h(o(A), {
137
+ label: n.$t("designer.node.field_label"),
138
138
  modelValue: e.field,
139
- "onUpdate:modelValue": s
139
+ "onUpdate:modelValue": a
140
140
  }, null, 8, ["label", "modelValue"]),
141
- b(o(N), {
142
- label: i.$t("designer.form.fields.label_label"),
143
- modelValue: e.label,
144
- "onUpdate:modelValue": n[0] || (n[0] = (r) => a("label", r))
145
- }, null, 8, ["label", "modelValue"]),
146
- ne(i.$slots, "default", { updateProp: a }, void 0, !0)
141
+ ie(n.$slots, "default", { updateProp: r }, void 0, !0)
147
142
  ]));
148
143
  }
149
- }), al = /* @__PURE__ */ _(ol, [["__scopeId", "data-v-bd4a89f6"]]), il = { class: "textarea-setting" }, rl = {
144
+ }), vt = /* @__PURE__ */ q(ht, [["__scopeId", "data-v-be4e1176"]]), gt = { class: "textarea-setting" }, bt = {
150
145
  key: 0,
151
146
  class: "hint"
152
- }, ul = /* @__PURE__ */ h({
147
+ }, xt = /* @__PURE__ */ f({
153
148
  __name: "TextareaSetting",
154
149
  props: {
155
150
  label: {},
@@ -159,25 +154,117 @@ const Qe = { class: "inquirer-designer-card" }, je = { class: "card-header" }, G
159
154
  maxRows: { default: 4 }
160
155
  },
161
156
  emits: ["update:modelValue"],
162
- setup(e, { emit: t }) {
163
- const l = t;
164
- return (s, a) => (u(), d("div", il, [
165
- c("label", null, f(e.label), 1),
166
- b(o(H), {
157
+ setup(e, { emit: l }) {
158
+ const t = l;
159
+ return (a, r) => (i(), d("div", gt, [
160
+ c("label", null, m(e.label), 1),
161
+ h(o(ee), {
167
162
  type: "textarea",
168
163
  "model-value": e.modelValue,
169
164
  autosize: { minRows: e.minRows, maxRows: e.maxRows },
170
- "onUpdate:modelValue": a[0] || (a[0] = (i) => l("update:modelValue", i ?? ""))
165
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => t("update:modelValue", n ?? ""))
171
166
  }, null, 8, ["model-value", "autosize"]),
172
- e.hint ? (u(), d("p", rl, f(e.hint), 1)) : y("", !0)
167
+ e.hint ? (i(), d("p", bt, m(e.hint), 1)) : x("", !0)
168
+ ]));
169
+ }
170
+ }), yt = /* @__PURE__ */ q(xt, [["__scopeId", "data-v-9093816f"]]);
171
+ var _t = /* @__PURE__ */ f({
172
+ name: "CircleCheck",
173
+ __name: "circle-check",
174
+ setup(e) {
175
+ return (l, t) => (i(), d("svg", {
176
+ xmlns: "http://www.w3.org/2000/svg",
177
+ viewBox: "0 0 1024 1024"
178
+ }, [
179
+ c("path", {
180
+ fill: "currentColor",
181
+ d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
182
+ }),
183
+ c("path", {
184
+ fill: "currentColor",
185
+ d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"
186
+ })
187
+ ]));
188
+ }
189
+ }), wt = _t, Vt = /* @__PURE__ */ f({
190
+ name: "Compass",
191
+ __name: "compass",
192
+ setup(e) {
193
+ return (l, t) => (i(), d("svg", {
194
+ xmlns: "http://www.w3.org/2000/svg",
195
+ viewBox: "0 0 1024 1024"
196
+ }, [
197
+ c("path", {
198
+ fill: "currentColor",
199
+ d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
200
+ }),
201
+ c("path", {
202
+ fill: "currentColor",
203
+ d: "M725.888 315.008C676.48 428.672 624 513.28 568.576 568.64c-55.424 55.424-139.968 107.904-253.568 157.312a12.8 12.8 0 0 1-16.896-16.832c49.536-113.728 102.016-198.272 157.312-253.632 55.36-55.296 139.904-107.776 253.632-157.312a12.8 12.8 0 0 1 16.832 16.832"
204
+ })
205
+ ]));
206
+ }
207
+ }), qt = Vt, Ct = /* @__PURE__ */ f({
208
+ name: "DataLine",
209
+ __name: "data-line",
210
+ setup(e) {
211
+ return (l, t) => (i(), d("svg", {
212
+ xmlns: "http://www.w3.org/2000/svg",
213
+ viewBox: "0 0 1024 1024"
214
+ }, [
215
+ c("path", {
216
+ fill: "currentColor",
217
+ d: "M359.168 768H160a32 32 0 0 1-32-32V192H64a32 32 0 0 1 0-64h896a32 32 0 1 1 0 64h-64v544a32 32 0 0 1-32 32H665.216l110.848 192h-73.856L591.36 768H433.024L322.176 960H248.32zM832 192H192v512h640zM342.656 534.656a32 32 0 1 1-45.312-45.312L444.992 341.76l125.44 94.08L679.04 300.032a32 32 0 1 1 49.92 39.936L581.632 524.224 451.008 426.24 342.656 534.592z"
218
+ })
173
219
  ]));
174
220
  }
175
- }), dl = /* @__PURE__ */ _(ul, [["__scopeId", "data-v-2c386165"]]);
176
- var cl = /* @__PURE__ */ h({
221
+ }), Et = Ct, St = /* @__PURE__ */ f({
222
+ name: "EditPen",
223
+ __name: "edit-pen",
224
+ setup(e) {
225
+ return (l, t) => (i(), d("svg", {
226
+ xmlns: "http://www.w3.org/2000/svg",
227
+ viewBox: "0 0 1024 1024"
228
+ }, [
229
+ c("path", {
230
+ fill: "currentColor",
231
+ d: "m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"
232
+ })
233
+ ]));
234
+ }
235
+ }), kt = St, $t = /* @__PURE__ */ f({
236
+ name: "Expand",
237
+ __name: "expand",
238
+ setup(e) {
239
+ return (l, t) => (i(), d("svg", {
240
+ xmlns: "http://www.w3.org/2000/svg",
241
+ viewBox: "0 0 1024 1024"
242
+ }, [
243
+ c("path", {
244
+ fill: "currentColor",
245
+ d: "M128 192h768v128H128zm0 256h512v128H128zm0 256h768v128H128zm576-352 192 160-192 128z"
246
+ })
247
+ ]));
248
+ }
249
+ }), Ut = $t, It = /* @__PURE__ */ f({
250
+ name: "Finished",
251
+ __name: "finished",
252
+ setup(e) {
253
+ return (l, t) => (i(), d("svg", {
254
+ xmlns: "http://www.w3.org/2000/svg",
255
+ viewBox: "0 0 1024 1024"
256
+ }, [
257
+ c("path", {
258
+ fill: "currentColor",
259
+ d: "M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z"
260
+ })
261
+ ]));
262
+ }
263
+ }), Nt = It, zt = /* @__PURE__ */ f({
177
264
  name: "InfoFilled",
178
265
  __name: "info-filled",
179
266
  setup(e) {
180
- return (t, l) => (u(), d("svg", {
267
+ return (l, t) => (i(), d("svg", {
181
268
  xmlns: "http://www.w3.org/2000/svg",
182
269
  viewBox: "0 0 1024 1024"
183
270
  }, [
@@ -187,8 +274,77 @@ var cl = /* @__PURE__ */ h({
187
274
  })
188
275
  ]));
189
276
  }
190
- }), pl = cl;
191
- const ml = {
277
+ }), Bt = zt, Mt = /* @__PURE__ */ f({
278
+ name: "List",
279
+ __name: "list",
280
+ setup(e) {
281
+ return (l, t) => (i(), d("svg", {
282
+ xmlns: "http://www.w3.org/2000/svg",
283
+ viewBox: "0 0 1024 1024"
284
+ }, [
285
+ c("path", {
286
+ fill: "currentColor",
287
+ d: "M704 192h160v736H160V192h160v64h384zM288 512h448v-64H288zm0 256h448v-64H288zm96-576V96h256v96z"
288
+ })
289
+ ]));
290
+ }
291
+ }), Tt = Mt, Dt = /* @__PURE__ */ f({
292
+ name: "Lock",
293
+ __name: "lock",
294
+ setup(e) {
295
+ return (l, t) => (i(), d("svg", {
296
+ xmlns: "http://www.w3.org/2000/svg",
297
+ viewBox: "0 0 1024 1024"
298
+ }, [
299
+ c("path", {
300
+ fill: "currentColor",
301
+ d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
302
+ }),
303
+ c("path", {
304
+ fill: "currentColor",
305
+ d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"
306
+ })
307
+ ]));
308
+ }
309
+ }), At = Dt, Lt = /* @__PURE__ */ f({
310
+ name: "Memo",
311
+ __name: "memo",
312
+ setup(e) {
313
+ return (l, t) => (i(), d("svg", {
314
+ xmlns: "http://www.w3.org/2000/svg",
315
+ "xml:space": "preserve",
316
+ viewBox: "0 0 1024 1024"
317
+ }, [
318
+ c("path", {
319
+ fill: "currentColor",
320
+ d: "M480 320h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32"
321
+ }),
322
+ c("path", {
323
+ fill: "currentColor",
324
+ d: "M887.01 72.99C881.01 67 873.34 64 864 64H160c-9.35 0-17.02 3-23.01 8.99C131 78.99 128 86.66 128 96v832c0 9.35 2.99 17.02 8.99 23.01S150.66 960 160 960h704c9.35 0 17.02-2.99 23.01-8.99S896 937.34 896 928V96c0-9.35-3-17.02-8.99-23.01M192 896V128h96v768zm640 0H352V128h480z"
325
+ }),
326
+ c("path", {
327
+ fill: "currentColor",
328
+ d: "M480 512h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32m0 192h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32"
329
+ })
330
+ ]));
331
+ }
332
+ }), Rt = Lt, Ft = /* @__PURE__ */ f({
333
+ name: "Tickets",
334
+ __name: "tickets",
335
+ setup(e) {
336
+ return (l, t) => (i(), d("svg", {
337
+ xmlns: "http://www.w3.org/2000/svg",
338
+ viewBox: "0 0 1024 1024"
339
+ }, [
340
+ c("path", {
341
+ fill: "currentColor",
342
+ d: "M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h192v64H320zm0 384h384v64H320z"
343
+ })
344
+ ]));
345
+ }
346
+ }), Pt = Ft;
347
+ const Ot = {
192
348
  "zh-CN": {
193
349
  config: {
194
350
  message: "提问文案 (message)",
@@ -244,17 +400,17 @@ const ml = {
244
400
  }
245
401
  }
246
402
  };
247
- function xe() {
248
- return Pe({
403
+ function $e() {
404
+ return re({
249
405
  inheritLocale: !0,
250
406
  useScope: "local",
251
- messages: ml
407
+ messages: Ot
252
408
  });
253
409
  }
254
- const fl = { class: "expression-editor" }, vl = { class: "expression-editor__label" }, bl = {
410
+ const Ht = { class: "expression-editor" }, Jt = { class: "expression-editor__label" }, Gt = {
255
411
  key: 0,
256
412
  class: "expression-editor__examples"
257
- }, xl = { class: "examples-title" }, hl = { class: "examples-list" }, gl = { class: "expression-editor__footer" }, yl = /* @__PURE__ */ h({
413
+ }, Qt = { class: "examples-title" }, jt = { class: "examples-list" }, Wt = { class: "expression-editor__footer" }, Yt = /* @__PURE__ */ f({
258
414
  __name: "ExpressionEditor",
259
415
  props: {
260
416
  label: {},
@@ -267,67 +423,67 @@ const fl = { class: "expression-editor" }, vl = { class: "expression-editor__lab
267
423
  suggestions: { default: () => [] }
268
424
  },
269
425
  emits: ["update:modelValue"],
270
- setup(e, { emit: t }) {
271
- const l = e, s = t, { t: a } = xe(), i = [
426
+ setup(e, { emit: l }) {
427
+ const t = e, a = l, { t: r } = $e(), n = [
272
428
  "return input;",
273
429
  'return input?.trim() ?? "";',
274
430
  "return input ? input.toUpperCase() : input;",
275
431
  "return answers.otherField;"
276
- ], n = V(() => l.placeholder || a("editor.placeholder")), r = V(() => a("editor.show_examples")), g = V(() => a("editor.hide_examples")), m = V(() => a("editor.examples_title")), p = V(() => l.suggestions && l.suggestions.length > 0 ? l.suggestions : i), v = L(!1);
277
- function O() {
278
- v.value = !v.value;
432
+ ], s = y(() => t.placeholder || r("editor.placeholder")), u = y(() => r("editor.show_examples")), _ = y(() => r("editor.hide_examples")), p = y(() => r("editor.examples_title")), v = y(() => t.suggestions && t.suggestions.length > 0 ? t.suggestions : n), g = H(!1);
433
+ function w() {
434
+ g.value = !g.value;
279
435
  }
280
- return (j, J) => (u(), d("div", fl, [
281
- c("label", vl, [
282
- c("span", null, f(e.label), 1),
283
- e.info ? (u(), x(o(ze), {
436
+ return (te, G) => (i(), d("div", Ht, [
437
+ c("label", Jt, [
438
+ c("span", null, m(e.label), 1),
439
+ e.info ? (i(), b(o(Ye), {
284
440
  key: 0,
285
441
  placement: "top",
286
442
  effect: "dark",
287
443
  content: e.info
288
444
  }, {
289
- default: w(() => [
290
- b(o(Fe), { class: "info-icon" }, {
291
- default: w(() => [
292
- b(o(pl))
445
+ default: V(() => [
446
+ h(o(Ce), { class: "info-icon" }, {
447
+ default: V(() => [
448
+ h(o(Bt))
293
449
  ]),
294
450
  _: 1
295
451
  })
296
452
  ]),
297
453
  _: 1
298
- }, 8, ["content"])) : y("", !0)
454
+ }, 8, ["content"])) : x("", !0)
299
455
  ]),
300
- b(o(H), {
456
+ h(o(ee), {
301
457
  class: "code-input",
302
458
  type: "textarea",
303
459
  "model-value": e.modelValue,
304
460
  autosize: { minRows: e.minRows, maxRows: e.maxRows },
305
- placeholder: n.value,
306
- "onUpdate:modelValue": J[0] || (J[0] = (C) => s("update:modelValue", C ?? ""))
461
+ placeholder: s.value,
462
+ "onUpdate:modelValue": G[0] || (G[0] = (U) => a("update:modelValue", U ?? ""))
307
463
  }, null, 8, ["model-value", "autosize", "placeholder"]),
308
- b(Ie, { name: "fade" }, {
309
- default: w(() => [
310
- v.value ? (u(), d("div", bl, [
311
- c("p", xl, f(m.value), 1),
312
- c("ul", hl, [
313
- (u(!0), d(S, null, I(p.value, (C) => (u(), d("li", { key: C }, [
314
- c("code", null, f(C), 1)
464
+ h(Oe, { name: "fade" }, {
465
+ default: V(() => [
466
+ g.value ? (i(), d("div", Gt, [
467
+ c("p", Qt, m(p.value), 1),
468
+ c("ul", jt, [
469
+ (i(!0), d(I, null, z(v.value, (U) => (i(), d("li", { key: U }, [
470
+ c("code", null, m(U), 1)
315
471
  ]))), 128))
316
472
  ])
317
- ])) : y("", !0)
473
+ ])) : x("", !0)
318
474
  ]),
319
475
  _: 1
320
476
  }),
321
- c("div", gl, [
477
+ c("div", Wt, [
322
478
  c("button", {
323
479
  class: "example-toggle",
324
480
  type: "button",
325
- onClick: O
326
- }, f(v.value ? g.value : r.value), 1)
481
+ onClick: w
482
+ }, m(g.value ? _.value : u.value), 1)
327
483
  ])
328
484
  ]));
329
485
  }
330
- }), Z = /* @__PURE__ */ _(yl, [["__scopeId", "data-v-91ba45bb"]]), Vl = { class: "inline-settings" }, wl = /* @__PURE__ */ h({
486
+ }), le = /* @__PURE__ */ q(Yt, [["__scopeId", "data-v-7b2a61b5"]]), Kt = { class: "inline-settings" }, Xt = /* @__PURE__ */ f({
331
487
  __name: "BaseQuestionConfig",
332
488
  props: {
333
489
  label: {},
@@ -347,121 +503,130 @@ const fl = { class: "expression-editor" }, vl = { class: "expression-editor__lab
347
503
  showDefaultInput: { type: Boolean, default: !0 }
348
504
  },
349
505
  emits: ["update"],
350
- setup(e, { emit: t }) {
351
- const l = [
506
+ setup(e, { emit: l }) {
507
+ const t = [
352
508
  "return answers.age >= 18;",
353
509
  "return answers.role === 'admin';",
354
510
  "return Boolean(input);"
355
- ], s = [
511
+ ], a = [
356
512
  `if (!input) return '必填';
357
513
  return true;`,
358
514
  `if ((input || "").length < 3) return "至少 3 个字符";
359
515
  return true;`,
360
516
  'return Array.isArray(input) && input.length > 0 ? true : "请选择至少一项";'
361
- ], a = [
517
+ ], r = [
362
518
  'return input?.trim() ?? "";',
363
519
  "return Number(input) || 0;",
364
520
  "return input?.toLowerCase();"
365
- ], i = [
521
+ ], n = [
366
522
  "return input ? `⭐ ${input}` : input;",
367
523
  'return input ? `${input} (${answers.unit || ""})` : input;',
368
524
  "return input ? input.toUpperCase() : input;"
369
- ], { t: n } = xe(), r = t;
370
- return (g, m) => (u(), x(al, {
525
+ ], { t: s } = $e(), u = l;
526
+ function _(p) {
527
+ u("update", {
528
+ props: {
529
+ message: p,
530
+ label: p
531
+ // 同步 message 到 label
532
+ }
533
+ });
534
+ }
535
+ return (p, v) => (i(), b(vt, {
371
536
  label: e.label,
372
537
  field: e.field,
373
- onUpdate: m[0] || (m[0] = (p) => r("update", p))
538
+ onUpdate: v[0] || (v[0] = (g) => u("update", g))
374
539
  }, {
375
- default: w(({ updateProp: p }) => [
376
- b(o(N), {
377
- label: o(n)("config.message"),
540
+ default: V(({ updateProp: g }) => [
541
+ h(o(A), {
542
+ label: o(s)("config.message"),
378
543
  "model-value": e.message,
379
- "onUpdate:modelValue": (v) => p("message", v)
380
- }, null, 8, ["label", "model-value", "onUpdate:modelValue"]),
381
- b(dl, {
382
- label: o(n)("config.description"),
544
+ "onUpdate:modelValue": _
545
+ }, null, 8, ["label", "model-value"]),
546
+ h(yt, {
547
+ label: o(s)("config.description"),
383
548
  "model-value": e.description,
384
549
  "min-rows": 2,
385
550
  "max-rows": 3,
386
- "onUpdate:modelValue": (v) => p("description", v)
551
+ "onUpdate:modelValue": (w) => g("description", w)
387
552
  }, null, 8, ["label", "model-value", "onUpdate:modelValue"]),
388
- e.showPlaceholder ? (u(), x(o(N), {
553
+ e.showPlaceholder ? (i(), b(o(A), {
389
554
  key: 0,
390
- label: o(n)("config.placeholder"),
555
+ label: o(s)("config.placeholder"),
391
556
  "model-value": e.placeholder,
392
- "onUpdate:modelValue": (v) => p("placeholder", v)
393
- }, null, 8, ["label", "model-value", "onUpdate:modelValue"])) : y("", !0),
394
- ne(g.$slots, "defaultValue", { updateProp: p }, () => [
395
- e.showDefaultInput ? (u(), x(o(N), {
557
+ "onUpdate:modelValue": (w) => g("placeholder", w)
558
+ }, null, 8, ["label", "model-value", "onUpdate:modelValue"])) : x("", !0),
559
+ ie(p.$slots, "defaultValue", { updateProp: g }, () => [
560
+ e.showDefaultInput ? (i(), b(o(A), {
396
561
  key: 0,
397
- label: o(n)("config.default_value"),
562
+ label: o(s)("config.default_value"),
398
563
  "model-value": e.defaultValue,
399
- "onUpdate:modelValue": (v) => p("defaultValue", v)
400
- }, null, 8, ["label", "model-value", "onUpdate:modelValue"])) : y("", !0)
564
+ "onUpdate:modelValue": (w) => g("defaultValue", w)
565
+ }, null, 8, ["label", "model-value", "onUpdate:modelValue"])) : x("", !0)
401
566
  ], !0),
402
- c("div", Vl, [
403
- b(o(N), {
404
- label: o(n)("config.prefix"),
567
+ c("div", Kt, [
568
+ h(o(A), {
569
+ label: o(s)("config.prefix"),
405
570
  "model-value": e.prefix,
406
- "onUpdate:modelValue": (v) => p("prefix", v)
571
+ "onUpdate:modelValue": (w) => g("prefix", w)
407
572
  }, null, 8, ["label", "model-value", "onUpdate:modelValue"]),
408
- b(o(N), {
409
- label: o(n)("config.suffix"),
573
+ h(o(A), {
574
+ label: o(s)("config.suffix"),
410
575
  "model-value": e.suffix,
411
- "onUpdate:modelValue": (v) => p("suffix", v)
576
+ "onUpdate:modelValue": (w) => g("suffix", w)
412
577
  }, null, 8, ["label", "model-value", "onUpdate:modelValue"])
413
578
  ]),
414
- b(o(le), {
415
- label: o(n)("config.required"),
579
+ h(o(se), {
580
+ label: o(s)("config.required"),
416
581
  "model-value": e.required,
417
- "onUpdate:modelValue": (v) => p("required", v)
582
+ "onUpdate:modelValue": (w) => g("required", w)
418
583
  }, null, 8, ["label", "model-value", "onUpdate:modelValue"]),
419
- ne(g.$slots, "extra", { updateProp: p }, void 0, !0),
420
- b(Z, {
421
- label: o(n)("config.expressions.when_label"),
422
- info: o(n)("config.expressions.when_info"),
584
+ ie(p.$slots, "extra", { updateProp: g }, void 0, !0),
585
+ h(le, {
586
+ label: o(s)("config.expressions.when_label"),
587
+ info: o(s)("config.expressions.when_info"),
423
588
  "model-value": e.whenExpression,
424
589
  "min-rows": 2,
425
590
  "max-rows": 3,
426
- placeholder: o(n)("editor.placeholder"),
427
- suggestions: l,
428
- "onUpdate:modelValue": (v) => p("whenExpression", v)
591
+ placeholder: o(s)("editor.placeholder"),
592
+ suggestions: t,
593
+ "onUpdate:modelValue": (w) => g("whenExpression", w)
429
594
  }, null, 8, ["label", "info", "model-value", "placeholder", "onUpdate:modelValue"]),
430
- b(Z, {
431
- label: o(n)("config.expressions.validate_label"),
432
- info: o(n)("config.expressions.validate_info"),
595
+ h(le, {
596
+ label: o(s)("config.expressions.validate_label"),
597
+ info: o(s)("config.expressions.validate_info"),
433
598
  "model-value": e.validateExpression,
434
599
  "min-rows": 3,
435
600
  "max-rows": 5,
436
- placeholder: o(n)("editor.placeholder"),
437
- suggestions: s,
438
- "onUpdate:modelValue": (v) => p("validateExpression", v)
601
+ placeholder: o(s)("editor.placeholder"),
602
+ suggestions: a,
603
+ "onUpdate:modelValue": (w) => g("validateExpression", w)
439
604
  }, null, 8, ["label", "info", "model-value", "placeholder", "onUpdate:modelValue"]),
440
- b(Z, {
441
- label: o(n)("config.expressions.filter_label"),
442
- info: o(n)("config.expressions.filter_info"),
605
+ h(le, {
606
+ label: o(s)("config.expressions.filter_label"),
607
+ info: o(s)("config.expressions.filter_info"),
443
608
  "model-value": e.filterExpression,
444
609
  "min-rows": 2,
445
610
  "max-rows": 4,
446
- placeholder: o(n)("editor.placeholder"),
447
- suggestions: a,
448
- "onUpdate:modelValue": (v) => p("filterExpression", v)
611
+ placeholder: o(s)("editor.placeholder"),
612
+ suggestions: r,
613
+ "onUpdate:modelValue": (w) => g("filterExpression", w)
449
614
  }, null, 8, ["label", "info", "model-value", "placeholder", "onUpdate:modelValue"]),
450
- b(Z, {
451
- label: o(n)("config.expressions.transformer_label"),
452
- info: o(n)("config.expressions.transformer_info"),
615
+ h(le, {
616
+ label: o(s)("config.expressions.transformer_label"),
617
+ info: o(s)("config.expressions.transformer_info"),
453
618
  "model-value": e.transformerExpression,
454
619
  "min-rows": 2,
455
620
  "max-rows": 4,
456
- placeholder: o(n)("editor.placeholder"),
457
- suggestions: i,
458
- "onUpdate:modelValue": (v) => p("transformerExpression", v)
621
+ placeholder: o(s)("editor.placeholder"),
622
+ suggestions: n,
623
+ "onUpdate:modelValue": (w) => g("transformerExpression", w)
459
624
  }, null, 8, ["label", "info", "model-value", "placeholder", "onUpdate:modelValue"])
460
625
  ]),
461
626
  _: 3
462
627
  }, 8, ["label", "field"]));
463
628
  }
464
- }), M = /* @__PURE__ */ _(wl, [["__scopeId", "data-v-c4882c52"]]), _l = /* @__PURE__ */ h({
629
+ }), J = /* @__PURE__ */ q(Xt, [["__scopeId", "data-v-43dc3bfd"]]), Zt = /* @__PURE__ */ f({
465
630
  __name: "config",
466
631
  props: {
467
632
  label: {},
@@ -478,55 +643,205 @@ return true;`,
478
643
  transformerExpression: {}
479
644
  },
480
645
  emits: ["update"],
481
- setup(e, { emit: t }) {
482
- const l = e, s = t;
483
- return (a, i) => (u(), x(M, D(l, {
484
- onUpdate: i[0] || (i[0] = (n) => s("update", n))
646
+ setup(e, { emit: l }) {
647
+ const t = e, a = l;
648
+ return (r, n) => (i(), b(J, L(t, {
649
+ onUpdate: n[0] || (n[0] = (s) => a("update", s))
485
650
  }), null, 16));
486
651
  }
487
652
  });
488
- function R(e) {
653
+ function T(e) {
489
654
  return `${e}_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
490
655
  }
491
- function k(e, t) {
656
+ function $(e, l) {
492
657
  return {
493
658
  label: e,
494
- value: t ?? e
659
+ value: l ?? e
495
660
  };
496
661
  }
497
- const he = {
662
+ const D = {
663
+ input: kt,
664
+ password: At,
665
+ number: Et,
666
+ confirm: wt,
667
+ list: Tt,
668
+ rawList: Pt,
669
+ expand: Ut,
670
+ checkbox: Nt,
671
+ editor: Rt
672
+ }, Ue = {
673
+ "zh-CN": {
674
+ controls: {
675
+ input: {
676
+ label: "文本输入",
677
+ message: "请输入文本",
678
+ placeholder: "请输入内容"
679
+ },
680
+ password: {
681
+ label: "密码",
682
+ message: "请输入密码",
683
+ placeholder: "请输入密码"
684
+ },
685
+ number: {
686
+ label: "数字",
687
+ message: "请输入数字",
688
+ placeholder: "请输入数字"
689
+ },
690
+ confirm: {
691
+ label: "确认",
692
+ message: "是否确认?"
693
+ },
694
+ list: {
695
+ label: "单选列表",
696
+ message: "请选择一个选项",
697
+ placeholder: "请选择",
698
+ option: "选项"
699
+ },
700
+ rawlist: {
701
+ label: "序号列表",
702
+ message: "请选择一个选项",
703
+ placeholder: "请选择",
704
+ option: "选项"
705
+ },
706
+ expand: {
707
+ label: "扩展列表",
708
+ message: "请选择一个选项",
709
+ option: "选项"
710
+ },
711
+ checkbox: {
712
+ label: "多选框",
713
+ message: "请选择选项(可多选)",
714
+ option: "选项"
715
+ },
716
+ editor: {
717
+ label: "长文本",
718
+ message: "请输入长文本内容",
719
+ placeholder: "请输入详细内容"
720
+ }
721
+ },
722
+ runtime: {
723
+ emptyForm: "暂无表单内容",
724
+ required: "此项为必填项",
725
+ invalidNumber: "请输入有效的数字",
726
+ minValue: "值不能小于 {min}",
727
+ maxValue: "值不能大于 {max}"
728
+ }
729
+ },
730
+ "en-US": {
731
+ controls: {
732
+ input: {
733
+ label: "Text Input",
734
+ message: "Please enter text",
735
+ placeholder: "Enter content"
736
+ },
737
+ password: {
738
+ label: "Password",
739
+ message: "Please enter password",
740
+ placeholder: "Enter password"
741
+ },
742
+ number: {
743
+ label: "Number",
744
+ message: "Please enter a number",
745
+ placeholder: "Enter number"
746
+ },
747
+ confirm: {
748
+ label: "Confirm",
749
+ message: "Confirm?"
750
+ },
751
+ list: {
752
+ label: "List",
753
+ message: "Please select an option",
754
+ placeholder: "Select",
755
+ option: "Option"
756
+ },
757
+ rawlist: {
758
+ label: "Raw List",
759
+ message: "Please select an option",
760
+ placeholder: "Select",
761
+ option: "Option"
762
+ },
763
+ expand: {
764
+ label: "Expand List",
765
+ message: "Please select an option",
766
+ option: "Option"
767
+ },
768
+ checkbox: {
769
+ label: "Checkbox",
770
+ message: "Please select options (multiple)",
771
+ option: "Option"
772
+ },
773
+ editor: {
774
+ label: "Editor",
775
+ message: "Please enter long text",
776
+ placeholder: "Enter detailed content"
777
+ }
778
+ },
779
+ runtime: {
780
+ emptyForm: "No form content",
781
+ required: "This field is required",
782
+ invalidNumber: "Please enter a valid number",
783
+ minValue: "Value cannot be less than {min}",
784
+ maxValue: "Value cannot be greater than {max}"
785
+ }
786
+ }
787
+ };
788
+ function el() {
789
+ if (typeof window < "u") {
790
+ const e = document.documentElement, l = e.getAttribute("lang") || e.lang;
791
+ if (l === "en-US" || l === "en") return "en-US";
792
+ }
793
+ return "zh-CN";
794
+ }
795
+ function tl(e) {
796
+ const l = el(), t = e.split(".");
797
+ let a = Ue[l];
798
+ for (const r of t)
799
+ if (a && typeof a == "object")
800
+ a = a[r];
801
+ else
802
+ return e;
803
+ return typeof a == "string" ? a : e;
804
+ }
805
+ function C(e, l) {
806
+ return tl(e);
807
+ }
808
+ const Ie = {
498
809
  type: "inq-input",
499
810
  category: "inputControl",
500
811
  label: "输入",
501
- icon: "⌨️",
812
+ icon: D.input,
502
813
  isContainer: !1,
503
- initialSchema: () => ({
504
- id: R("inq_input"),
505
- type: "inq-input",
506
- field: "question_" + Math.random().toString(36).slice(2, 6),
507
- props: {
508
- label: "普通输入",
509
- message: "请输入内容",
510
- promptType: "input",
511
- placeholder: "例如:姓名",
512
- defaultValue: "",
513
- prefix: "",
514
- suffix: "",
515
- required: !1,
516
- whenExpression: "",
517
- validateExpression: "",
518
- filterExpression: "",
519
- transformerExpression: ""
520
- }
521
- }),
522
- designer: Ze,
523
- runtime: nl,
524
- config: _l,
814
+ initialSchema: () => {
815
+ const e = C("controls.input.message");
816
+ return {
817
+ id: T("inq_input"),
818
+ type: "inq-input",
819
+ field: "question_" + Math.random().toString(36).slice(2, 6),
820
+ props: {
821
+ label: e,
822
+ // label 和 message 保持一致
823
+ message: e,
824
+ promptType: "input",
825
+ placeholder: C("controls.input.placeholder"),
826
+ defaultValue: "",
827
+ prefix: "",
828
+ suffix: "",
829
+ required: !0,
830
+ whenExpression: "",
831
+ validateExpression: "",
832
+ filterExpression: "",
833
+ transformerExpression: ""
834
+ }
835
+ };
836
+ },
837
+ designer: ut,
838
+ runtime: mt,
839
+ config: Zt,
525
840
  locales: {
526
841
  "zh-CN": { control: { "inq-input": { label: "输入" } } },
527
842
  "en-US": { control: { "inq-input": { label: "Input" } } }
528
843
  }
529
- }, ql = /* @__PURE__ */ h({
844
+ }, ll = /* @__PURE__ */ f({
530
845
  __name: "designer",
531
846
  props: {
532
847
  label: {},
@@ -535,21 +850,21 @@ const he = {
535
850
  isActive: { type: Boolean }
536
851
  },
537
852
  emits: ["select"],
538
- setup(e, { emit: t }) {
539
- const l = e, s = t, { label: a, message: i, description: n, isActive: r } = B(l);
540
- return (g, m) => (u(), x(A, {
541
- label: o(a),
542
- message: o(i),
543
- description: o(n),
853
+ setup(e, { emit: l }) {
854
+ const t = e, a = l, { label: r, message: n, description: s, isActive: u } = B(t);
855
+ return (_, p) => (i(), b(M, {
856
+ label: o(r),
857
+ message: o(n),
858
+ description: o(s),
544
859
  "type-label": "Inquirer Password",
545
- "is-active": o(r),
546
- onSelect: m[0] || (m[0] = (p) => s("select"))
860
+ "is-active": o(u),
861
+ onSelect: p[0] || (p[0] = (v) => a("select"))
547
862
  }, null, 8, ["label", "message", "description", "is-active"]));
548
863
  }
549
- }), El = { class: "inquirer-password" }, Sl = {
864
+ }), sl = { class: "inquirer-password" }, al = {
550
865
  key: 0,
551
866
  class: "mask-hint"
552
- }, kl = /* @__PURE__ */ h({
867
+ }, ol = /* @__PURE__ */ f({
553
868
  __name: "runtime",
554
869
  props: {
555
870
  modelValue: {},
@@ -561,36 +876,36 @@ const he = {
561
876
  maskSymbol: {}
562
877
  },
563
878
  emits: ["update:modelValue"],
564
- setup(e, { emit: t }) {
565
- const l = t;
566
- return (s, a) => (u(), d("div", El, [
567
- b(o(H), {
879
+ setup(e, { emit: l }) {
880
+ const t = l;
881
+ return (a, r) => (i(), d("div", sl, [
882
+ h(o(ee), {
568
883
  "model-value": e.modelValue ?? "",
569
884
  placeholder: e.placeholder,
570
885
  disabled: e.disabled,
571
886
  type: "password",
572
887
  "show-password": "",
573
- "onUpdate:modelValue": a[0] || (a[0] = (i) => l("update:modelValue", i ?? ""))
574
- }, re({ _: 2 }, [
888
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => t("update:modelValue", n ?? ""))
889
+ }, xe({ _: 2 }, [
575
890
  e.prefix ? {
576
891
  name: "prepend",
577
- fn: w(() => [
578
- Y(f(e.prefix), 1)
892
+ fn: V(() => [
893
+ X(m(e.prefix), 1)
579
894
  ]),
580
895
  key: "0"
581
896
  } : void 0,
582
897
  e.suffix ? {
583
898
  name: "append",
584
- fn: w(() => [
585
- Y(f(e.suffix), 1)
899
+ fn: V(() => [
900
+ X(m(e.suffix), 1)
586
901
  ]),
587
902
  key: "1"
588
903
  } : void 0
589
904
  ]), 1032, ["model-value", "placeholder", "disabled"]),
590
- e.maskEnabled ? (u(), d("p", Sl, " 输出将使用 " + f(e.maskSymbol || "掩码") + " 掩码 ", 1)) : y("", !0)
905
+ e.maskEnabled ? (i(), d("p", al, " 输出将使用 " + m(e.maskSymbol || "掩码") + " 掩码 ", 1)) : x("", !0)
591
906
  ]));
592
907
  }
593
- }), Cl = /* @__PURE__ */ _(kl, [["__scopeId", "data-v-0cb418f2"]]), $l = /* @__PURE__ */ h({
908
+ }), nl = /* @__PURE__ */ q(ol, [["__scopeId", "data-v-027f448e"]]), il = /* @__PURE__ */ f({
594
909
  __name: "config",
595
910
  props: {
596
911
  label: {},
@@ -609,62 +924,65 @@ const he = {
609
924
  maskSymbol: {}
610
925
  },
611
926
  emits: ["update"],
612
- setup(e, { emit: t }) {
613
- const l = e, s = t;
614
- return (a, i) => (u(), x(M, D(l, {
615
- onUpdate: i[0] || (i[0] = (n) => s("update", n))
927
+ setup(e, { emit: l }) {
928
+ const t = e, a = l;
929
+ return (r, n) => (i(), b(J, L(t, {
930
+ onUpdate: n[0] || (n[0] = (s) => a("update", s))
616
931
  }), {
617
- extra: w(({ updateProp: n }) => [
618
- b(o(le), {
932
+ extra: V(({ updateProp: s }) => [
933
+ h(o(se), {
619
934
  label: "掩码输出",
620
935
  "model-value": e.maskEnabled,
621
- "onUpdate:modelValue": (r) => n("maskEnabled", r)
936
+ "onUpdate:modelValue": (u) => s("maskEnabled", u)
622
937
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
623
- e.maskEnabled ? (u(), x(o(N), {
938
+ e.maskEnabled ? (i(), b(o(A), {
624
939
  key: 0,
625
940
  label: "掩码符号",
626
941
  "model-value": e.maskSymbol,
627
- "onUpdate:modelValue": (r) => n("maskSymbol", r)
628
- }, null, 8, ["model-value", "onUpdate:modelValue"])) : y("", !0)
942
+ "onUpdate:modelValue": (u) => s("maskSymbol", u)
943
+ }, null, 8, ["model-value", "onUpdate:modelValue"])) : x("", !0)
629
944
  ]),
630
945
  _: 1
631
946
  }, 16));
632
947
  }
633
- }), ge = {
948
+ }), Ne = {
634
949
  type: "inq-password",
635
950
  category: "inputControl",
636
951
  label: "密码",
637
- icon: "🔒",
952
+ icon: D.password,
638
953
  isContainer: !1,
639
- initialSchema: () => ({
640
- id: R("inq_password"),
641
- type: "inq-password",
642
- field: "secret_" + Math.random().toString(36).slice(2, 6),
643
- props: {
644
- label: "密码",
645
- message: "请输入密码",
646
- promptType: "password",
647
- placeholder: "******",
648
- defaultValue: "",
649
- prefix: "",
650
- suffix: "",
651
- maskEnabled: !0,
652
- maskSymbol: "*",
653
- required: !0,
654
- whenExpression: "",
655
- validateExpression: "",
656
- filterExpression: "",
657
- transformerExpression: ""
658
- }
659
- }),
660
- designer: ql,
661
- runtime: Cl,
662
- config: $l,
954
+ initialSchema: () => {
955
+ const e = C("controls.password.message");
956
+ return {
957
+ id: T("inq_password"),
958
+ type: "inq-password",
959
+ field: "secret_" + Math.random().toString(36).slice(2, 6),
960
+ props: {
961
+ label: e,
962
+ message: e,
963
+ promptType: "password",
964
+ placeholder: C("controls.password.placeholder"),
965
+ defaultValue: "",
966
+ prefix: "",
967
+ suffix: "",
968
+ maskEnabled: !0,
969
+ maskSymbol: "*",
970
+ required: !0,
971
+ whenExpression: "",
972
+ validateExpression: "",
973
+ filterExpression: "",
974
+ transformerExpression: ""
975
+ }
976
+ };
977
+ },
978
+ designer: ll,
979
+ runtime: nl,
980
+ config: il,
663
981
  locales: {
664
982
  "zh-CN": { control: { "inq-password": { label: "密码" } } },
665
983
  "en-US": { control: { "inq-password": { label: "Password" } } }
666
984
  }
667
- }, Ul = /* @__PURE__ */ h({
985
+ }, rl = /* @__PURE__ */ f({
668
986
  __name: "designer",
669
987
  props: {
670
988
  label: {},
@@ -673,24 +991,24 @@ const he = {
673
991
  isActive: { type: Boolean }
674
992
  },
675
993
  emits: ["select"],
676
- setup(e, { emit: t }) {
677
- const l = e, s = t, { label: a, message: i, description: n, isActive: r } = B(l);
678
- return (g, m) => (u(), x(A, {
679
- label: o(a),
680
- message: o(i),
681
- description: o(n),
994
+ setup(e, { emit: l }) {
995
+ const t = e, a = l, { label: r, message: n, description: s, isActive: u } = B(t);
996
+ return (_, p) => (i(), b(M, {
997
+ label: o(r),
998
+ message: o(n),
999
+ description: o(s),
682
1000
  "type-label": "Inquirer Number",
683
- "is-active": o(r),
684
- onSelect: m[0] || (m[0] = (p) => s("select"))
1001
+ "is-active": o(u),
1002
+ onSelect: p[0] || (p[0] = (v) => a("select"))
685
1003
  }, null, 8, ["label", "message", "description", "is-active"]));
686
1004
  }
687
- }), Il = { class: "number-runtime" }, Nl = {
1005
+ }), ul = { class: "number-runtime" }, cl = {
688
1006
  key: 0,
689
1007
  class: "affix"
690
- }, Bl = {
1008
+ }, dl = {
691
1009
  key: 1,
692
1010
  class: "affix"
693
- }, Al = /* @__PURE__ */ h({
1011
+ }, pl = /* @__PURE__ */ f({
694
1012
  __name: "runtime",
695
1013
  props: {
696
1014
  modelValue: {},
@@ -703,11 +1021,11 @@ const he = {
703
1021
  suffix: {}
704
1022
  },
705
1023
  emits: ["update:modelValue"],
706
- setup(e, { emit: t }) {
707
- const l = t;
708
- return (s, a) => (u(), d("div", Il, [
709
- e.prefix ? (u(), d("span", Nl, f(e.prefix), 1)) : y("", !0),
710
- b(o(fe), {
1024
+ setup(e, { emit: l }) {
1025
+ const t = l;
1026
+ return (a, r) => (i(), d("div", ul, [
1027
+ e.prefix ? (i(), d("span", cl, m(e.prefix), 1)) : x("", !0),
1028
+ h(o(Ee), {
711
1029
  class: "number-runtime__input",
712
1030
  "model-value": e.modelValue,
713
1031
  placeholder: e.placeholder,
@@ -716,12 +1034,12 @@ const he = {
716
1034
  max: e.max,
717
1035
  step: e.step || 1,
718
1036
  "controls-position": "right",
719
- "onUpdate:modelValue": a[0] || (a[0] = (i) => l("update:modelValue", i ?? void 0))
1037
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => t("update:modelValue", n ?? void 0))
720
1038
  }, null, 8, ["model-value", "placeholder", "disabled", "min", "max", "step"]),
721
- e.suffix ? (u(), d("span", Bl, f(e.suffix), 1)) : y("", !0)
1039
+ e.suffix ? (i(), d("span", dl, m(e.suffix), 1)) : x("", !0)
722
1040
  ]));
723
1041
  }
724
- }), Rl = /* @__PURE__ */ _(Al, [["__scopeId", "data-v-ade0684b"]]), Tl = { class: "number-setting" }, Dl = /* @__PURE__ */ h({
1042
+ }), ml = /* @__PURE__ */ q(pl, [["__scopeId", "data-v-41430bc7"]]), fl = { class: "number-setting" }, hl = /* @__PURE__ */ f({
725
1043
  __name: "NumberSetting",
726
1044
  props: {
727
1045
  label: {},
@@ -731,21 +1049,21 @@ const he = {
731
1049
  step: { default: 1 }
732
1050
  },
733
1051
  emits: ["update:modelValue"],
734
- setup(e, { emit: t }) {
735
- const l = t;
736
- return (s, a) => (u(), d("div", Tl, [
737
- c("label", null, f(e.label), 1),
738
- b(o(fe), {
1052
+ setup(e, { emit: l }) {
1053
+ const t = l;
1054
+ return (a, r) => (i(), d("div", fl, [
1055
+ c("label", null, m(e.label), 1),
1056
+ h(o(Ee), {
739
1057
  "model-value": e.modelValue,
740
1058
  min: e.min,
741
1059
  max: e.max,
742
1060
  step: e.step,
743
1061
  "controls-position": "right",
744
- "onUpdate:modelValue": a[0] || (a[0] = (i) => l("update:modelValue", i ?? void 0))
1062
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => t("update:modelValue", n ?? void 0))
745
1063
  }, null, 8, ["model-value", "min", "max", "step"])
746
1064
  ]));
747
1065
  }
748
- }), P = /* @__PURE__ */ _(Dl, [["__scopeId", "data-v-4fb22ad3"]]), zl = /* @__PURE__ */ h({
1066
+ }), Q = /* @__PURE__ */ q(hl, [["__scopeId", "data-v-9db53040"]]), vl = /* @__PURE__ */ f({
749
1067
  __name: "config",
750
1068
  props: {
751
1069
  label: {},
@@ -764,76 +1082,79 @@ const he = {
764
1082
  step: {}
765
1083
  },
766
1084
  emits: ["update"],
767
- setup(e, { emit: t }) {
768
- const l = e, s = t;
769
- return (a, i) => (u(), x(M, D(l, {
1085
+ setup(e, { emit: l }) {
1086
+ const t = e, a = l;
1087
+ return (r, n) => (i(), b(J, L(t, {
770
1088
  "show-placeholder": !1,
771
- onUpdate: i[0] || (i[0] = (n) => s("update", n))
1089
+ onUpdate: n[0] || (n[0] = (s) => a("update", s))
772
1090
  }), {
773
- defaultValue: w(({ updateProp: n }) => [
774
- b(P, {
1091
+ defaultValue: V(({ updateProp: s }) => [
1092
+ h(Q, {
775
1093
  label: "默认值",
776
1094
  "model-value": e.defaultValue,
777
- "onUpdate:modelValue": (r) => n("defaultValue", r)
1095
+ "onUpdate:modelValue": (u) => s("defaultValue", u)
778
1096
  }, null, 8, ["model-value", "onUpdate:modelValue"])
779
1097
  ]),
780
- extra: w(({ updateProp: n }) => [
781
- b(P, {
1098
+ extra: V(({ updateProp: s }) => [
1099
+ h(Q, {
782
1100
  label: "最小值",
783
1101
  "model-value": e.min,
784
- "onUpdate:modelValue": (r) => n("min", r)
1102
+ "onUpdate:modelValue": (u) => s("min", u)
785
1103
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
786
- b(P, {
1104
+ h(Q, {
787
1105
  label: "最大值",
788
1106
  "model-value": e.max,
789
- "onUpdate:modelValue": (r) => n("max", r)
1107
+ "onUpdate:modelValue": (u) => s("max", u)
790
1108
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
791
- b(P, {
1109
+ h(Q, {
792
1110
  label: "步长",
793
1111
  "model-value": e.step,
794
1112
  min: 0,
795
1113
  step: 0.1,
796
- "onUpdate:modelValue": (r) => n("step", r)
1114
+ "onUpdate:modelValue": (u) => s("step", u)
797
1115
  }, null, 8, ["model-value", "onUpdate:modelValue"])
798
1116
  ]),
799
1117
  _: 1
800
1118
  }, 16));
801
1119
  }
802
- }), ye = {
1120
+ }), ze = {
803
1121
  type: "inq-number",
804
1122
  category: "inputControl",
805
1123
  label: "数字",
806
- icon: "🔢",
1124
+ icon: D.number,
807
1125
  isContainer: !1,
808
- initialSchema: () => ({
809
- id: R("inq_number"),
810
- type: "inq-number",
811
- field: "amount_" + Math.random().toString(36).slice(2, 6),
812
- props: {
813
- label: "数字输入",
814
- message: "请输入数字",
815
- promptType: "number",
816
- defaultValue: 0,
817
- min: 0,
818
- max: 100,
819
- step: 1,
820
- prefix: "",
821
- suffix: "",
822
- required: !1,
823
- whenExpression: "",
824
- validateExpression: "",
825
- filterExpression: "",
826
- transformerExpression: ""
827
- }
828
- }),
829
- designer: Ul,
830
- runtime: Rl,
831
- config: zl,
1126
+ initialSchema: () => {
1127
+ const e = C("controls.number.message");
1128
+ return {
1129
+ id: T("inq_number"),
1130
+ type: "inq-number",
1131
+ field: "amount_" + Math.random().toString(36).slice(2, 6),
1132
+ props: {
1133
+ label: e,
1134
+ message: e,
1135
+ promptType: "number",
1136
+ defaultValue: 0,
1137
+ min: 0,
1138
+ max: 100,
1139
+ step: 1,
1140
+ prefix: "",
1141
+ suffix: "",
1142
+ required: !1,
1143
+ whenExpression: "",
1144
+ validateExpression: "",
1145
+ filterExpression: "",
1146
+ transformerExpression: ""
1147
+ }
1148
+ };
1149
+ },
1150
+ designer: rl,
1151
+ runtime: ml,
1152
+ config: vl,
832
1153
  locales: {
833
1154
  "zh-CN": { control: { "inq-number": { label: "数字" } } },
834
1155
  "en-US": { control: { "inq-number": { label: "Number" } } }
835
1156
  }
836
- }, Fl = /* @__PURE__ */ h({
1157
+ }, gl = /* @__PURE__ */ f({
837
1158
  __name: "designer",
838
1159
  props: {
839
1160
  label: {},
@@ -842,24 +1163,24 @@ const he = {
842
1163
  isActive: { type: Boolean }
843
1164
  },
844
1165
  emits: ["select"],
845
- setup(e, { emit: t }) {
846
- const l = e, s = t, { label: a, message: i, description: n, isActive: r } = B(l);
847
- return (g, m) => (u(), x(A, {
848
- label: o(a),
849
- message: o(i),
850
- description: o(n),
1166
+ setup(e, { emit: l }) {
1167
+ const t = e, a = l, { label: r, message: n, description: s, isActive: u } = B(t);
1168
+ return (_, p) => (i(), b(M, {
1169
+ label: o(r),
1170
+ message: o(n),
1171
+ description: o(s),
851
1172
  "type-label": "Inquirer Confirm",
852
- "is-active": o(r),
853
- onSelect: m[0] || (m[0] = (p) => s("select"))
1173
+ "is-active": o(u),
1174
+ onSelect: p[0] || (p[0] = (v) => a("select"))
854
1175
  }, null, 8, ["label", "message", "description", "is-active"]));
855
1176
  }
856
- }), Ll = { class: "confirm-runtime" }, Ml = {
1177
+ }), bl = { class: "confirm-runtime" }, xl = {
857
1178
  key: 0,
858
1179
  class: "affix"
859
- }, Ol = { class: "state" }, Jl = {
1180
+ }, yl = { class: "state" }, _l = {
860
1181
  key: 1,
861
1182
  class: "affix"
862
- }, Pl = /* @__PURE__ */ h({
1183
+ }, wl = /* @__PURE__ */ f({
863
1184
  __name: "runtime",
864
1185
  props: {
865
1186
  modelValue: { type: Boolean },
@@ -868,23 +1189,23 @@ const he = {
868
1189
  suffix: {}
869
1190
  },
870
1191
  emits: ["update:modelValue"],
871
- setup(e, { emit: t }) {
872
- const l = t;
873
- function s(a) {
874
- l("update:modelValue", !!a);
1192
+ setup(e, { emit: l }) {
1193
+ const t = l;
1194
+ function a(r) {
1195
+ t("update:modelValue", !!r);
875
1196
  }
876
- return (a, i) => (u(), d("div", Ll, [
877
- e.prefix ? (u(), d("span", Ml, f(e.prefix), 1)) : y("", !0),
878
- b(o(Le), {
1197
+ return (r, n) => (i(), d("div", bl, [
1198
+ e.prefix ? (i(), d("span", xl, m(e.prefix), 1)) : x("", !0),
1199
+ h(o(Ke), {
879
1200
  "model-value": e.modelValue ?? !1,
880
1201
  disabled: e.disabled,
881
- "onUpdate:modelValue": s
1202
+ "onUpdate:modelValue": a
882
1203
  }, null, 8, ["model-value", "disabled"]),
883
- c("span", Ol, f(e.modelValue ?? !1 ? "Yes" : "No"), 1),
884
- e.suffix ? (u(), d("span", Jl, f(e.suffix), 1)) : y("", !0)
1204
+ c("span", yl, m(e.modelValue ?? !1 ? "Yes" : "No"), 1),
1205
+ e.suffix ? (i(), d("span", _l, m(e.suffix), 1)) : x("", !0)
885
1206
  ]));
886
1207
  }
887
- }), Ql = /* @__PURE__ */ _(Pl, [["__scopeId", "data-v-f41e6b08"]]), jl = /* @__PURE__ */ h({
1208
+ }), Vl = /* @__PURE__ */ q(wl, [["__scopeId", "data-v-220e5de9"]]), ql = /* @__PURE__ */ f({
888
1209
  __name: "config",
889
1210
  props: {
890
1211
  label: {},
@@ -900,54 +1221,57 @@ const he = {
900
1221
  transformerExpression: {}
901
1222
  },
902
1223
  emits: ["update"],
903
- setup(e, { emit: t }) {
904
- const l = e, s = t;
905
- return (a, i) => (u(), x(M, D(l, {
1224
+ setup(e, { emit: l }) {
1225
+ const t = e, a = l;
1226
+ return (r, n) => (i(), b(J, L(t, {
906
1227
  "show-placeholder": !1,
907
- onUpdate: i[0] || (i[0] = (n) => s("update", n))
1228
+ onUpdate: n[0] || (n[0] = (s) => a("update", s))
908
1229
  }), {
909
- defaultValue: w(({ updateProp: n }) => [
910
- b(o(le), {
1230
+ defaultValue: V(({ updateProp: s }) => [
1231
+ h(o(se), {
911
1232
  label: "默认值 (Yes/No)",
912
1233
  "model-value": e.defaultValue ?? !1,
913
- "onUpdate:modelValue": (r) => n("defaultValue", r)
1234
+ "onUpdate:modelValue": (u) => s("defaultValue", u)
914
1235
  }, null, 8, ["model-value", "onUpdate:modelValue"])
915
1236
  ]),
916
1237
  _: 1
917
1238
  }, 16));
918
1239
  }
919
- }), Ve = {
1240
+ }), Be = {
920
1241
  type: "inq-confirm",
921
1242
  category: "inputControl",
922
1243
  label: "确认",
923
- icon: "❓",
1244
+ icon: D.confirm,
924
1245
  isContainer: !1,
925
- initialSchema: () => ({
926
- id: R("inq_confirm"),
927
- type: "inq-confirm",
928
- field: "confirm_" + Math.random().toString(36).slice(2, 6),
929
- props: {
930
- label: "是否继续",
931
- message: "请确认是否执行",
932
- promptType: "confirm",
933
- defaultValue: !1,
934
- prefix: "",
935
- suffix: "",
936
- required: !1,
937
- whenExpression: "",
938
- validateExpression: "",
939
- filterExpression: "",
940
- transformerExpression: ""
941
- }
942
- }),
943
- designer: Fl,
944
- runtime: Ql,
945
- config: jl,
1246
+ initialSchema: () => {
1247
+ const e = C("controls.confirm.message");
1248
+ return {
1249
+ id: T("inq_confirm"),
1250
+ type: "inq-confirm",
1251
+ field: "confirm_" + Math.random().toString(36).slice(2, 6),
1252
+ props: {
1253
+ label: e,
1254
+ message: e,
1255
+ promptType: "confirm",
1256
+ defaultValue: !1,
1257
+ prefix: "",
1258
+ suffix: "",
1259
+ required: !1,
1260
+ whenExpression: "",
1261
+ validateExpression: "",
1262
+ filterExpression: "",
1263
+ transformerExpression: ""
1264
+ }
1265
+ };
1266
+ },
1267
+ designer: gl,
1268
+ runtime: Vl,
1269
+ config: ql,
946
1270
  locales: {
947
1271
  "zh-CN": { control: { "inq-confirm": { label: "确认" } } },
948
1272
  "en-US": { control: { "inq-confirm": { label: "Confirm" } } }
949
1273
  }
950
- }, Gl = /* @__PURE__ */ h({
1274
+ }, Cl = /* @__PURE__ */ f({
951
1275
  __name: "designer",
952
1276
  props: {
953
1277
  label: {},
@@ -957,28 +1281,28 @@ const he = {
957
1281
  choices: {}
958
1282
  },
959
1283
  emits: ["select"],
960
- setup(e, { emit: t }) {
961
- const l = e, s = t, { label: a, message: i, description: n, isActive: r, choices: g } = B(l);
962
- return (m, p) => (u(), x(A, {
963
- label: o(a),
964
- message: o(i),
965
- description: o(n),
966
- options: o(g),
1284
+ setup(e, { emit: l }) {
1285
+ const t = e, a = l, { label: r, message: n, description: s, isActive: u, choices: _ } = B(t);
1286
+ return (p, v) => (i(), b(M, {
1287
+ label: o(r),
1288
+ message: o(n),
1289
+ description: o(s),
1290
+ options: o(_),
967
1291
  "type-label": "Inquirer List",
968
- "is-active": o(r),
969
- onSelect: p[0] || (p[0] = (v) => s("select"))
1292
+ "is-active": o(u),
1293
+ onSelect: v[0] || (v[0] = (g) => a("select"))
970
1294
  }, null, 8, ["label", "message", "description", "options", "is-active"]));
971
1295
  }
972
- }), Yl = { class: "inquirer-list" }, Hl = {
1296
+ }), El = { class: "inquirer-list" }, Sl = {
973
1297
  key: 0,
974
1298
  class: "affix"
975
- }, Kl = {
1299
+ }, kl = {
976
1300
  key: 1,
977
1301
  class: "affix"
978
- }, Wl = {
1302
+ }, $l = {
979
1303
  key: 2,
980
1304
  class: "list-hint"
981
- }, Xl = { key: 0 }, Zl = { key: 1 }, et = /* @__PURE__ */ h({
1305
+ }, Ul = { key: 0 }, Il = { key: 1 }, Nl = /* @__PURE__ */ f({
982
1306
  __name: "runtime",
983
1307
  props: {
984
1308
  modelValue: {},
@@ -991,41 +1315,41 @@ const he = {
991
1315
  loop: { type: Boolean }
992
1316
  },
993
1317
  emits: ["update:modelValue"],
994
- setup(e, { emit: t }) {
995
- const l = e, s = t, a = V(
996
- () => (l.choices ?? []).map((i) => ({
997
- label: i.label || i.value,
998
- value: i.value
1318
+ setup(e, { emit: l }) {
1319
+ const t = e, a = l, r = y(
1320
+ () => (t.choices ?? []).map((n) => ({
1321
+ label: n.label || n.value,
1322
+ value: n.value
999
1323
  }))
1000
1324
  );
1001
- return (i, n) => (u(), d("div", Yl, [
1002
- e.prefix ? (u(), d("span", Hl, f(e.prefix), 1)) : y("", !0),
1003
- b(o(ve), {
1325
+ return (n, s) => (i(), d("div", El, [
1326
+ e.prefix ? (i(), d("span", Sl, m(e.prefix), 1)) : x("", !0),
1327
+ h(o(Se), {
1004
1328
  class: "select-runtime",
1005
1329
  "model-value": e.modelValue,
1006
1330
  placeholder: e.placeholder,
1007
1331
  disabled: e.disabled,
1008
1332
  filterable: "",
1009
1333
  clearable: "",
1010
- "onUpdate:modelValue": n[0] || (n[0] = (r) => s("update:modelValue", r))
1334
+ "onUpdate:modelValue": s[0] || (s[0] = (u) => a("update:modelValue", u))
1011
1335
  }, {
1012
- default: w(() => [
1013
- (u(!0), d(S, null, I(a.value, (r) => (u(), x(o(be), {
1014
- key: r.value,
1015
- label: r.label,
1016
- value: r.value
1336
+ default: V(() => [
1337
+ (i(!0), d(I, null, z(r.value, (u) => (i(), b(o(ke), {
1338
+ key: u.value,
1339
+ label: u.label,
1340
+ value: u.value
1017
1341
  }, null, 8, ["label", "value"]))), 128))
1018
1342
  ]),
1019
1343
  _: 1
1020
1344
  }, 8, ["model-value", "placeholder", "disabled"]),
1021
- e.suffix ? (u(), d("span", Kl, f(e.suffix), 1)) : y("", !0),
1022
- e.loop || e.pageSize ? (u(), d("p", Wl, [
1023
- e.pageSize ? (u(), d("span", Xl, "每页 " + f(e.pageSize) + " 项", 1)) : y("", !0),
1024
- e.loop ? (u(), d("span", Zl, " · 循环导航开启")) : y("", !0)
1025
- ])) : y("", !0)
1345
+ e.suffix ? (i(), d("span", kl, m(e.suffix), 1)) : x("", !0),
1346
+ e.loop || e.pageSize ? (i(), d("p", $l, [
1347
+ e.pageSize ? (i(), d("span", Ul, "每页 " + m(e.pageSize) + " 项", 1)) : x("", !0),
1348
+ e.loop ? (i(), d("span", Il, " · 循环导航开启")) : x("", !0)
1349
+ ])) : x("", !0)
1026
1350
  ]));
1027
1351
  }
1028
- }), se = /* @__PURE__ */ _(et, [["__scopeId", "data-v-ad8b9ebc"]]), oe = /* @__PURE__ */ h({
1352
+ }), ue = /* @__PURE__ */ q(Nl, [["__scopeId", "data-v-ed3b4861"]]), ce = /* @__PURE__ */ f({
1029
1353
  __name: "config",
1030
1354
  props: {
1031
1355
  label: {},
@@ -1046,73 +1370,79 @@ const he = {
1046
1370
  loop: { type: Boolean }
1047
1371
  },
1048
1372
  emits: ["update"],
1049
- setup(e, { emit: t }) {
1050
- const l = e, s = t;
1051
- return (a, i) => (u(), x(M, D(l, {
1052
- onUpdate: i[0] || (i[0] = (n) => s("update", n))
1373
+ setup(e, { emit: l }) {
1374
+ const t = e, a = l;
1375
+ return (r, n) => (i(), b(J, L(t, {
1376
+ onUpdate: n[0] || (n[0] = (s) => a("update", s))
1053
1377
  }), {
1054
- extra: w(({ updateProp: n }) => [
1055
- b(o(ce), {
1378
+ extra: V(({ updateProp: s }) => [
1379
+ h(o(we), {
1056
1380
  label: "选项",
1057
1381
  "model-value": e.choices,
1058
- "onUpdate:modelValue": (r) => n("choices", r)
1382
+ "onUpdate:modelValue": (u) => s("choices", u)
1059
1383
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
1060
- b(o(N), {
1384
+ h(o(A), {
1061
1385
  label: "默认选项值",
1062
1386
  "model-value": e.defaultChoice,
1063
- "onUpdate:modelValue": (r) => n("defaultChoice", r)
1387
+ "onUpdate:modelValue": (u) => s("defaultChoice", u)
1064
1388
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
1065
- b(P, {
1389
+ h(Q, {
1066
1390
  label: "pageSize",
1067
1391
  "model-value": e.pageSize,
1068
1392
  min: 1,
1069
- "onUpdate:modelValue": (r) => n("pageSize", r)
1393
+ "onUpdate:modelValue": (u) => s("pageSize", u)
1070
1394
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
1071
- b(o(le), {
1395
+ h(o(se), {
1072
1396
  label: "循环 (loop)",
1073
1397
  "model-value": e.loop,
1074
- "onUpdate:modelValue": (r) => n("loop", r)
1398
+ "onUpdate:modelValue": (u) => s("loop", u)
1075
1399
  }, null, 8, ["model-value", "onUpdate:modelValue"])
1076
1400
  ]),
1077
1401
  _: 1
1078
1402
  }, 16));
1079
1403
  }
1080
- }), we = {
1404
+ }), Me = {
1081
1405
  type: "inq-list",
1082
1406
  category: "inputControl",
1083
1407
  label: "列表",
1084
- icon: "📋",
1408
+ icon: D.list,
1085
1409
  isContainer: !1,
1086
- initialSchema: () => ({
1087
- id: R("inq_list"),
1088
- type: "inq-list",
1089
- field: "list_" + Math.random().toString(36).slice(2, 6),
1090
- props: {
1091
- label: "单选列表",
1092
- message: "请选择一个选项",
1093
- promptType: "list",
1094
- placeholder: "请选择",
1095
- defaultChoice: "opt_1",
1096
- choices: [k("选项 1", "opt_1"), k("选项 2", "opt_2")],
1097
- pageSize: 7,
1098
- loop: !0,
1099
- prefix: "",
1100
- suffix: "",
1101
- required: !0,
1102
- whenExpression: "",
1103
- validateExpression: "",
1104
- filterExpression: "",
1105
- transformerExpression: ""
1106
- }
1107
- }),
1108
- designer: Gl,
1109
- runtime: se,
1110
- config: oe,
1410
+ initialSchema: () => {
1411
+ const e = C("controls.list.message");
1412
+ return {
1413
+ id: T("inq_list"),
1414
+ type: "inq-list",
1415
+ field: "list_" + Math.random().toString(36).slice(2, 6),
1416
+ props: {
1417
+ label: e,
1418
+ message: e,
1419
+ promptType: "list",
1420
+ placeholder: C("controls.list.placeholder"),
1421
+ defaultChoice: "opt_1",
1422
+ choices: [
1423
+ $(C("controls.list.option") + " 1", "opt_1"),
1424
+ $(C("controls.list.option") + " 2", "opt_2")
1425
+ ],
1426
+ pageSize: 7,
1427
+ loop: !0,
1428
+ prefix: "",
1429
+ suffix: "",
1430
+ required: !0,
1431
+ whenExpression: "",
1432
+ validateExpression: "",
1433
+ filterExpression: "",
1434
+ transformerExpression: ""
1435
+ }
1436
+ };
1437
+ },
1438
+ designer: Cl,
1439
+ runtime: ue,
1440
+ config: ce,
1111
1441
  locales: {
1112
1442
  "zh-CN": { control: { "inq-list": { label: "列表" } } },
1113
1443
  "en-US": { control: { "inq-list": { label: "List" } } }
1114
1444
  }
1115
- }, lt = /* @__PURE__ */ h({
1445
+ }, zl = /* @__PURE__ */ f({
1116
1446
  __name: "designer",
1117
1447
  props: {
1118
1448
  label: {},
@@ -1122,26 +1452,26 @@ const he = {
1122
1452
  choices: {}
1123
1453
  },
1124
1454
  emits: ["select"],
1125
- setup(e, { emit: t }) {
1126
- const l = e, s = t, { label: a, message: i, description: n, isActive: r, choices: g } = B(l);
1127
- return (m, p) => (u(), x(A, {
1128
- label: o(a),
1129
- message: o(i),
1130
- description: o(n),
1131
- options: o(g),
1455
+ setup(e, { emit: l }) {
1456
+ const t = e, a = l, { label: r, message: n, description: s, isActive: u, choices: _ } = B(t);
1457
+ return (p, v) => (i(), b(M, {
1458
+ label: o(r),
1459
+ message: o(n),
1460
+ description: o(s),
1461
+ options: o(_),
1132
1462
  "type-label": "Inquirer Raw List",
1133
- "is-active": o(r),
1134
- onSelect: p[0] || (p[0] = (v) => s("select"))
1463
+ "is-active": o(u),
1464
+ onSelect: v[0] || (v[0] = (g) => a("select"))
1135
1465
  }, null, 8, ["label", "message", "description", "options", "is-active"]));
1136
1466
  }
1137
- }), tt = {
1467
+ }), Bl = {
1138
1468
  type: "inq-rawlist",
1139
1469
  category: "inputControl",
1140
1470
  label: "序号列表",
1141
- icon: "🔢",
1471
+ icon: D.rawList,
1142
1472
  isContainer: !1,
1143
1473
  initialSchema: () => ({
1144
- id: R("inq_rawlist"),
1474
+ id: T("inq_rawlist"),
1145
1475
  type: "inq-rawlist",
1146
1476
  field: "rawlist_" + Math.random().toString(36).slice(2, 6),
1147
1477
  props: {
@@ -1150,7 +1480,7 @@ const he = {
1150
1480
  promptType: "rawlist",
1151
1481
  placeholder: "输入编号",
1152
1482
  defaultChoice: "opt_a",
1153
- choices: [k("Alpha", "opt_a"), k("Beta", "opt_b"), k("Gamma", "opt_c")],
1483
+ choices: [$("Alpha", "opt_a"), $("Beta", "opt_b"), $("Gamma", "opt_c")],
1154
1484
  pageSize: 5,
1155
1485
  loop: !1,
1156
1486
  prefix: "#",
@@ -1162,14 +1492,14 @@ const he = {
1162
1492
  transformerExpression: ""
1163
1493
  }
1164
1494
  }),
1165
- designer: lt,
1166
- runtime: se,
1167
- config: oe,
1495
+ designer: zl,
1496
+ runtime: ue,
1497
+ config: ce,
1168
1498
  locales: {
1169
1499
  "zh-CN": { control: { "inq-rawlist": { label: "序号列表" } } },
1170
1500
  "en-US": { control: { "inq-rawlist": { label: "Raw List" } } }
1171
1501
  }
1172
- }, nt = /* @__PURE__ */ h({
1502
+ }, Ml = /* @__PURE__ */ f({
1173
1503
  __name: "designer",
1174
1504
  props: {
1175
1505
  label: {},
@@ -1179,26 +1509,26 @@ const he = {
1179
1509
  choices: {}
1180
1510
  },
1181
1511
  emits: ["select"],
1182
- setup(e, { emit: t }) {
1183
- const l = e, s = t, { label: a, message: i, description: n, isActive: r, choices: g } = B(l);
1184
- return (m, p) => (u(), x(A, {
1185
- label: o(a),
1186
- message: o(i),
1187
- description: o(n),
1188
- options: o(g),
1512
+ setup(e, { emit: l }) {
1513
+ const t = e, a = l, { label: r, message: n, description: s, isActive: u, choices: _ } = B(t);
1514
+ return (p, v) => (i(), b(M, {
1515
+ label: o(r),
1516
+ message: o(n),
1517
+ description: o(s),
1518
+ options: o(_),
1189
1519
  "type-label": "Inquirer Expand",
1190
- "is-active": o(r),
1191
- onSelect: p[0] || (p[0] = (v) => s("select"))
1520
+ "is-active": o(u),
1521
+ onSelect: v[0] || (v[0] = (g) => a("select"))
1192
1522
  }, null, 8, ["label", "message", "description", "options", "is-active"]));
1193
1523
  }
1194
- }), st = {
1524
+ }), Tl = {
1195
1525
  type: "inq-expand",
1196
1526
  category: "inputControl",
1197
1527
  label: "扩展列表",
1198
- icon: "🧩",
1528
+ icon: D.expand,
1199
1529
  isContainer: !1,
1200
1530
  initialSchema: () => ({
1201
- id: R("inq_expand"),
1531
+ id: T("inq_expand"),
1202
1532
  type: "inq-expand",
1203
1533
  field: "expand_" + Math.random().toString(36).slice(2, 6),
1204
1534
  props: {
@@ -1208,9 +1538,9 @@ const he = {
1208
1538
  placeholder: "按键选择",
1209
1539
  defaultChoice: "opt_1",
1210
1540
  choices: [
1211
- k("继续", "opt_1"),
1212
- k("跳过", "opt_2"),
1213
- k("退出", "opt_3")
1541
+ $("继续", "opt_1"),
1542
+ $("跳过", "opt_2"),
1543
+ $("退出", "opt_3")
1214
1544
  ],
1215
1545
  pageSize: 5,
1216
1546
  loop: !1,
@@ -1223,14 +1553,14 @@ const he = {
1223
1553
  transformerExpression: ""
1224
1554
  }
1225
1555
  }),
1226
- designer: nt,
1227
- runtime: se,
1228
- config: oe,
1556
+ designer: Ml,
1557
+ runtime: ue,
1558
+ config: ce,
1229
1559
  locales: {
1230
1560
  "zh-CN": { control: { "inq-expand": { label: "扩展列表" } } },
1231
1561
  "en-US": { control: { "inq-expand": { label: "Expand" } } }
1232
1562
  }
1233
- }, ot = /* @__PURE__ */ h({
1563
+ }, Dl = /* @__PURE__ */ f({
1234
1564
  __name: "designer",
1235
1565
  props: {
1236
1566
  label: {},
@@ -1240,25 +1570,25 @@ const he = {
1240
1570
  choices: {}
1241
1571
  },
1242
1572
  emits: ["select"],
1243
- setup(e, { emit: t }) {
1244
- const l = e, s = t, { label: a, message: i, description: n, isActive: r, choices: g } = B(l);
1245
- return (m, p) => (u(), x(A, {
1246
- label: o(a),
1247
- message: o(i),
1248
- description: o(n),
1249
- options: o(g),
1573
+ setup(e, { emit: l }) {
1574
+ const t = e, a = l, { label: r, message: n, description: s, isActive: u, choices: _ } = B(t);
1575
+ return (p, v) => (i(), b(M, {
1576
+ label: o(r),
1577
+ message: o(n),
1578
+ description: o(s),
1579
+ options: o(_),
1250
1580
  "type-label": "Inquirer Checkbox",
1251
- "is-active": o(r),
1252
- onSelect: p[0] || (p[0] = (v) => s("select"))
1581
+ "is-active": o(u),
1582
+ onSelect: v[0] || (v[0] = (g) => a("select"))
1253
1583
  }, null, 8, ["label", "message", "description", "options", "is-active"]));
1254
1584
  }
1255
- }), at = { class: "checkbox-wrapper" }, it = {
1585
+ }), Al = { class: "checkbox-wrapper" }, Ll = {
1256
1586
  key: 0,
1257
1587
  class: "affix"
1258
- }, rt = {
1588
+ }, Rl = {
1259
1589
  key: 1,
1260
1590
  class: "affix"
1261
- }, ut = /* @__PURE__ */ h({
1591
+ }, Fl = /* @__PURE__ */ f({
1262
1592
  __name: "runtime",
1263
1593
  props: {
1264
1594
  modelValue: {},
@@ -1268,38 +1598,38 @@ const he = {
1268
1598
  suffix: {}
1269
1599
  },
1270
1600
  emits: ["update:modelValue"],
1271
- setup(e, { emit: t }) {
1272
- const l = e, s = t, a = V(
1273
- () => (l.choices ?? []).map((i) => ({
1274
- label: i.label || i.value,
1275
- value: i.value
1601
+ setup(e, { emit: l }) {
1602
+ const t = e, a = l, r = y(
1603
+ () => (t.choices ?? []).map((n) => ({
1604
+ label: n.label || n.value,
1605
+ value: n.value
1276
1606
  }))
1277
1607
  );
1278
- return (i, n) => (u(), d("div", at, [
1279
- e.prefix ? (u(), d("span", it, f(e.prefix), 1)) : y("", !0),
1280
- b(o(Me), {
1608
+ return (n, s) => (i(), d("div", Al, [
1609
+ e.prefix ? (i(), d("span", Ll, m(e.prefix), 1)) : x("", !0),
1610
+ h(o(Xe), {
1281
1611
  class: "checkbox-runtime",
1282
1612
  "model-value": e.modelValue || [],
1283
1613
  disabled: e.disabled,
1284
- "onUpdate:modelValue": n[0] || (n[0] = (r) => s("update:modelValue", r))
1614
+ "onUpdate:modelValue": s[0] || (s[0] = (u) => a("update:modelValue", u))
1285
1615
  }, {
1286
- default: w(() => [
1287
- (u(!0), d(S, null, I(a.value, (r) => (u(), x(o(Oe), {
1288
- key: r.value,
1289
- label: r.value
1616
+ default: V(() => [
1617
+ (i(!0), d(I, null, z(r.value, (u) => (i(), b(o(Ze), {
1618
+ key: u.value,
1619
+ label: u.value
1290
1620
  }, {
1291
- default: w(() => [
1292
- Y(f(r.label), 1)
1621
+ default: V(() => [
1622
+ X(m(u.label), 1)
1293
1623
  ]),
1294
1624
  _: 2
1295
1625
  }, 1032, ["label"]))), 128))
1296
1626
  ]),
1297
1627
  _: 1
1298
1628
  }, 8, ["model-value", "disabled"]),
1299
- e.suffix ? (u(), d("span", rt, f(e.suffix), 1)) : y("", !0)
1629
+ e.suffix ? (i(), d("span", Rl, m(e.suffix), 1)) : x("", !0)
1300
1630
  ]));
1301
1631
  }
1302
- }), dt = /* @__PURE__ */ _(ut, [["__scopeId", "data-v-86b287ae"]]), ct = { class: "multi-default" }, pt = /* @__PURE__ */ h({
1632
+ }), Pl = /* @__PURE__ */ q(Fl, [["__scopeId", "data-v-5def473d"]]), Ol = { class: "multi-default" }, Hl = /* @__PURE__ */ f({
1303
1633
  __name: "config",
1304
1634
  props: {
1305
1635
  label: {},
@@ -1318,79 +1648,82 @@ const he = {
1318
1648
  defaultChoices: {}
1319
1649
  },
1320
1650
  emits: ["update"],
1321
- setup(e, { emit: t }) {
1322
- const l = e, s = t;
1323
- return (a, i) => (u(), x(M, D(l, {
1324
- onUpdate: i[0] || (i[0] = (n) => s("update", n))
1651
+ setup(e, { emit: l }) {
1652
+ const t = e, a = l;
1653
+ return (r, n) => (i(), b(J, L(t, {
1654
+ onUpdate: n[0] || (n[0] = (s) => a("update", s))
1325
1655
  }), {
1326
- defaultValue: w(({ updateProp: n }) => [
1327
- c("div", ct, [
1328
- i[1] || (i[1] = c("label", null, "默认选中值", -1)),
1329
- b(o(ve), {
1656
+ defaultValue: V(({ updateProp: s }) => [
1657
+ c("div", Ol, [
1658
+ n[1] || (n[1] = c("label", null, "默认选中值", -1)),
1659
+ h(o(Se), {
1330
1660
  multiple: "",
1331
1661
  "collapse-tags": "",
1332
1662
  "collapse-tags-tooltip": "",
1333
1663
  "model-value": e.defaultChoices || [],
1334
- "onUpdate:modelValue": (r) => n("defaultChoices", r)
1664
+ "onUpdate:modelValue": (u) => s("defaultChoices", u)
1335
1665
  }, {
1336
- default: w(() => [
1337
- (u(!0), d(S, null, I(e.choices || [], (r) => (u(), x(o(be), {
1338
- key: r.value,
1339
- label: r.label,
1340
- value: r.value
1666
+ default: V(() => [
1667
+ (i(!0), d(I, null, z(e.choices || [], (u) => (i(), b(o(ke), {
1668
+ key: u.value,
1669
+ label: u.label,
1670
+ value: u.value
1341
1671
  }, null, 8, ["label", "value"]))), 128))
1342
1672
  ]),
1343
1673
  _: 1
1344
1674
  }, 8, ["model-value", "onUpdate:modelValue"])
1345
1675
  ])
1346
1676
  ]),
1347
- extra: w(({ updateProp: n }) => [
1348
- b(o(ce), {
1677
+ extra: V(({ updateProp: s }) => [
1678
+ h(o(we), {
1349
1679
  label: "选项",
1350
1680
  "model-value": e.choices,
1351
- "onUpdate:modelValue": (r) => n("choices", r)
1681
+ "onUpdate:modelValue": (u) => s("choices", u)
1352
1682
  }, null, 8, ["model-value", "onUpdate:modelValue"])
1353
1683
  ]),
1354
1684
  _: 1
1355
1685
  }, 16));
1356
1686
  }
1357
- }), mt = /* @__PURE__ */ _(pt, [["__scopeId", "data-v-c571b549"]]), _e = {
1687
+ }), Jl = /* @__PURE__ */ q(Hl, [["__scopeId", "data-v-fa680fd2"]]), Te = {
1358
1688
  type: "inq-checkbox",
1359
1689
  category: "inputControl",
1360
1690
  label: "多选",
1361
- icon: "☑️",
1691
+ icon: D.checkbox,
1362
1692
  isContainer: !1,
1363
- initialSchema: () => ({
1364
- id: R("inq_checkbox"),
1365
- type: "inq-checkbox",
1366
- field: "checkbox_" + Math.random().toString(36).slice(2, 6),
1367
- props: {
1368
- label: "多选题",
1369
- message: "选择一个或多个选项",
1370
- promptType: "checkbox",
1371
- choices: [
1372
- k("JavaScript", "js"),
1373
- k("TypeScript", "ts"),
1374
- k("Rust", "rust")
1375
- ],
1376
- defaultChoices: ["js"],
1377
- prefix: "",
1378
- suffix: "",
1379
- required: !1,
1380
- whenExpression: "",
1381
- validateExpression: "",
1382
- filterExpression: "",
1383
- transformerExpression: ""
1384
- }
1385
- }),
1386
- designer: ot,
1387
- runtime: dt,
1388
- config: mt,
1693
+ initialSchema: () => {
1694
+ const e = C("controls.checkbox.message");
1695
+ return {
1696
+ id: T("inq_checkbox"),
1697
+ type: "inq-checkbox",
1698
+ field: "checkbox_" + Math.random().toString(36).slice(2, 6),
1699
+ props: {
1700
+ label: e,
1701
+ message: e,
1702
+ promptType: "checkbox",
1703
+ choices: [
1704
+ $(C("controls.checkbox.option") + " 1", "opt_1"),
1705
+ $(C("controls.checkbox.option") + " 2", "opt_2"),
1706
+ $(C("controls.checkbox.option") + " 3", "opt_3")
1707
+ ],
1708
+ defaultChoices: ["opt_1"],
1709
+ prefix: "",
1710
+ suffix: "",
1711
+ required: !1,
1712
+ whenExpression: "",
1713
+ validateExpression: "",
1714
+ filterExpression: "",
1715
+ transformerExpression: ""
1716
+ }
1717
+ };
1718
+ },
1719
+ designer: Dl,
1720
+ runtime: Pl,
1721
+ config: Jl,
1389
1722
  locales: {
1390
1723
  "zh-CN": { control: { "inq-checkbox": { label: "多选" } } },
1391
1724
  "en-US": { control: { "inq-checkbox": { label: "Checkbox" } } }
1392
1725
  }
1393
- }, ft = /* @__PURE__ */ h({
1726
+ }, Gl = /* @__PURE__ */ f({
1394
1727
  __name: "designer",
1395
1728
  props: {
1396
1729
  label: {},
@@ -1399,27 +1732,27 @@ const he = {
1399
1732
  isActive: { type: Boolean }
1400
1733
  },
1401
1734
  emits: ["select"],
1402
- setup(e, { emit: t }) {
1403
- const l = e, s = t, { label: a, message: i, description: n, isActive: r } = B(l);
1404
- return (g, m) => (u(), x(A, {
1405
- label: o(a),
1406
- message: o(i),
1407
- description: o(n),
1735
+ setup(e, { emit: l }) {
1736
+ const t = e, a = l, { label: r, message: n, description: s, isActive: u } = B(t);
1737
+ return (_, p) => (i(), b(M, {
1738
+ label: o(r),
1739
+ message: o(n),
1740
+ description: o(s),
1408
1741
  "type-label": "Inquirer Editor",
1409
- "is-active": o(r),
1410
- onSelect: m[0] || (m[0] = (p) => s("select"))
1742
+ "is-active": o(u),
1743
+ onSelect: p[0] || (p[0] = (v) => a("select"))
1411
1744
  }, null, 8, ["label", "message", "description", "is-active"]));
1412
1745
  }
1413
- }), vt = { class: "editor-runtime" }, bt = {
1746
+ }), Ql = { class: "editor-runtime" }, jl = {
1414
1747
  key: 0,
1415
1748
  class: "affix"
1416
- }, xt = {
1749
+ }, Wl = {
1417
1750
  key: 1,
1418
1751
  class: "affix"
1419
- }, ht = {
1752
+ }, Yl = {
1420
1753
  key: 2,
1421
1754
  class: "transformer-preview"
1422
- }, gt = /* @__PURE__ */ h({
1755
+ }, Kl = /* @__PURE__ */ f({
1423
1756
  __name: "runtime",
1424
1757
  props: {
1425
1758
  modelValue: {},
@@ -1431,23 +1764,23 @@ const he = {
1431
1764
  displayValue: {}
1432
1765
  },
1433
1766
  emits: ["update:modelValue"],
1434
- setup(e, { emit: t }) {
1435
- const l = e, s = t, a = V(() => l.displayValue === void 0 ? !1 : l.displayValue !== l.modelValue);
1436
- return (i, n) => (u(), d("div", vt, [
1437
- e.prefix ? (u(), d("span", bt, f(e.prefix), 1)) : y("", !0),
1438
- b(o(H), {
1767
+ setup(e, { emit: l }) {
1768
+ const t = e, a = l, r = y(() => t.displayValue === void 0 ? !1 : t.displayValue !== t.modelValue);
1769
+ return (n, s) => (i(), d("div", Ql, [
1770
+ e.prefix ? (i(), d("span", jl, m(e.prefix), 1)) : x("", !0),
1771
+ h(o(ee), {
1439
1772
  type: "textarea",
1440
1773
  rows: e.rows || 6,
1441
1774
  "model-value": e.modelValue ?? "",
1442
1775
  placeholder: e.placeholder,
1443
1776
  disabled: e.disabled,
1444
- "onUpdate:modelValue": n[0] || (n[0] = (r) => s("update:modelValue", r ?? ""))
1777
+ "onUpdate:modelValue": s[0] || (s[0] = (u) => a("update:modelValue", u ?? ""))
1445
1778
  }, null, 8, ["rows", "model-value", "placeholder", "disabled"]),
1446
- e.suffix ? (u(), d("span", xt, f(e.suffix), 1)) : y("", !0),
1447
- a.value ? (u(), d("p", ht, f(e.displayValue), 1)) : y("", !0)
1779
+ e.suffix ? (i(), d("span", Wl, m(e.suffix), 1)) : x("", !0),
1780
+ r.value ? (i(), d("p", Yl, m(e.displayValue), 1)) : x("", !0)
1448
1781
  ]));
1449
1782
  }
1450
- }), yt = /* @__PURE__ */ _(gt, [["__scopeId", "data-v-bd13db5a"]]), Vt = /* @__PURE__ */ h({
1783
+ }), Xl = /* @__PURE__ */ q(Kl, [["__scopeId", "data-v-768e57da"]]), Zl = /* @__PURE__ */ f({
1451
1784
  __name: "config",
1452
1785
  props: {
1453
1786
  label: {},
@@ -1465,156 +1798,166 @@ const he = {
1465
1798
  rows: {}
1466
1799
  },
1467
1800
  emits: ["update"],
1468
- setup(e, { emit: t }) {
1469
- const l = e, s = t;
1470
- return (a, i) => (u(), x(M, D(l, {
1471
- onUpdate: i[0] || (i[0] = (n) => s("update", n))
1801
+ setup(e, { emit: l }) {
1802
+ const t = e, a = l;
1803
+ return (r, n) => (i(), b(J, L(t, {
1804
+ onUpdate: n[0] || (n[0] = (s) => a("update", s))
1472
1805
  }), {
1473
- extra: w(({ updateProp: n }) => [
1474
- b(P, {
1806
+ extra: V(({ updateProp: s }) => [
1807
+ h(Q, {
1475
1808
  label: "行数",
1476
1809
  "model-value": e.rows,
1477
1810
  min: 2,
1478
1811
  max: 20,
1479
- "onUpdate:modelValue": (r) => n("rows", r)
1812
+ "onUpdate:modelValue": (u) => s("rows", u)
1480
1813
  }, null, 8, ["model-value", "onUpdate:modelValue"])
1481
1814
  ]),
1482
1815
  _: 1
1483
1816
  }, 16));
1484
1817
  }
1485
- }), qe = {
1818
+ }), De = {
1486
1819
  type: "inq-editor",
1487
1820
  category: "inputControl",
1488
1821
  label: "长文本",
1489
- icon: "📝",
1822
+ icon: D.editor,
1490
1823
  isContainer: !1,
1491
- initialSchema: () => ({
1492
- id: R("inq_editor"),
1493
- type: "inq-editor",
1494
- field: "editor_" + Math.random().toString(36).slice(2, 6),
1495
- props: {
1496
- label: "长文本",
1497
- message: "请输入长文本",
1498
- promptType: "editor",
1499
- placeholder: "多行输入",
1500
- rows: 6,
1501
- defaultValue: "",
1502
- prefix: "",
1503
- suffix: "",
1504
- required: !1,
1505
- whenExpression: "",
1506
- validateExpression: "",
1507
- filterExpression: "",
1508
- transformerExpression: ""
1509
- }
1510
- }),
1511
- designer: ft,
1512
- runtime: yt,
1513
- config: Vt,
1824
+ initialSchema: () => {
1825
+ const e = C("controls.editor.message");
1826
+ return {
1827
+ id: T("inq_editor"),
1828
+ type: "inq-editor",
1829
+ field: "editor_" + Math.random().toString(36).slice(2, 6),
1830
+ props: {
1831
+ label: e,
1832
+ message: e,
1833
+ promptType: "editor",
1834
+ placeholder: C("controls.editor.placeholder"),
1835
+ rows: 6,
1836
+ defaultValue: "",
1837
+ prefix: "",
1838
+ suffix: "",
1839
+ required: !1,
1840
+ whenExpression: "",
1841
+ validateExpression: "",
1842
+ filterExpression: "",
1843
+ transformerExpression: ""
1844
+ }
1845
+ };
1846
+ },
1847
+ designer: Gl,
1848
+ runtime: Xl,
1849
+ config: Zl,
1514
1850
  locales: {
1515
1851
  "zh-CN": { control: { "inq-editor": { label: "长文本" } } },
1516
1852
  "en-US": { control: { "inq-editor": { label: "Editor" } } }
1517
1853
  }
1518
- }, Ee = [
1519
- he,
1520
- ge,
1521
- ye,
1522
- Ve,
1523
- we,
1524
- tt,
1525
- st,
1526
- _e,
1527
- qe
1854
+ }, es = [
1855
+ Ie,
1856
+ Ne,
1857
+ ze,
1858
+ Be,
1859
+ Me,
1860
+ Bl,
1861
+ Tl,
1862
+ Te,
1863
+ De
1528
1864
  ];
1529
- function Se() {
1530
- Q.replaceAll(Ee);
1865
+ function Ae() {
1866
+ j.replaceAll(es);
1531
1867
  }
1532
- function z(e, t) {
1533
- const l = e.initialSchema();
1868
+ function P(e, l) {
1869
+ const t = e.initialSchema();
1534
1870
  return {
1535
- ...l,
1536
1871
  ...t,
1872
+ ...l,
1537
1873
  props: {
1538
- ...l.props,
1539
- ...t.props
1874
+ ...t.props,
1875
+ ...l.props
1540
1876
  }
1541
1877
  };
1542
1878
  }
1543
- function ke() {
1879
+ function Le(e) {
1544
1880
  return [
1545
- z(he, {
1881
+ P(Ie, {
1546
1882
  field: "fullName",
1547
1883
  props: {
1548
- label: "姓名",
1549
- message: "请输入您的姓名",
1550
- placeholder: "张三",
1551
- description: "该信息将用于生成问候语"
1884
+ label: e("sample.fullName.message"),
1885
+ // label 和 message 保持一致
1886
+ message: e("sample.fullName.message"),
1887
+ placeholder: e("sample.fullName.placeholder"),
1888
+ description: e("sample.fullName.description")
1552
1889
  }
1553
1890
  }),
1554
- z(ge, {
1891
+ P(Ne, {
1555
1892
  field: "accountPassword",
1556
1893
  props: {
1557
- label: "账户密码",
1558
- message: "请输入账户密码",
1559
- description: "密码不会被保存在示例应用中"
1894
+ label: e("sample.password.message"),
1895
+ // label 和 message 保持一致
1896
+ message: e("sample.password.message"),
1897
+ description: e("sample.password.description")
1560
1898
  }
1561
1899
  }),
1562
- z(ye, {
1900
+ P(ze, {
1563
1901
  field: "age",
1564
1902
  props: {
1565
- label: "年龄",
1566
- message: "请输入年龄",
1903
+ label: e("sample.age.message"),
1904
+ // label 和 message 保持一致
1905
+ message: e("sample.age.message"),
1567
1906
  min: 0,
1568
1907
  max: 120,
1569
1908
  required: !0,
1570
- description: "用于计算问卷分层,必填"
1909
+ description: e("sample.age.description")
1571
1910
  }
1572
1911
  }),
1573
- z(Ve, {
1912
+ P(Be, {
1574
1913
  field: "allowContact",
1575
1914
  props: {
1576
- label: "是否允许联系",
1577
- message: "我们可以通过邮件联系您吗?",
1915
+ label: e("sample.allowContact.message"),
1916
+ // label 和 message 保持一致
1917
+ message: e("sample.allowContact.message"),
1578
1918
  defaultValue: !0,
1579
- description: "若选择是,将会收到提效工具邮件"
1919
+ description: e("sample.allowContact.description")
1580
1920
  }
1581
1921
  }),
1582
- z(we, {
1922
+ P(Me, {
1583
1923
  field: "favoriteStack",
1584
1924
  props: {
1585
- label: "技术栈",
1586
- message: "请选择主要技术栈",
1925
+ label: e("sample.favoriteStack.message"),
1926
+ // label 和 message 保持一致
1927
+ message: e("sample.favoriteStack.message"),
1587
1928
  defaultChoice: "ts",
1588
- description: "用于统计语言偏好"
1929
+ description: e("sample.favoriteStack.description")
1589
1930
  }
1590
1931
  }),
1591
- z(_e, {
1932
+ P(Te, {
1592
1933
  field: "tools",
1593
1934
  props: {
1594
- label: "常用工具",
1595
- message: "请选择常用工具",
1935
+ label: e("sample.tools.message"),
1936
+ // label 和 message 保持一致
1937
+ message: e("sample.tools.message"),
1596
1938
  defaultChoices: ["git", "eslint"],
1597
1939
  choices: [
1598
- { label: "Git", value: "git" },
1599
- { label: "ESLint", value: "eslint" },
1600
- { label: "Vite", value: "vite" },
1601
- { label: "Vitest", value: "vitest" }
1940
+ { label: e("sample.tools.choices.git"), value: "git" },
1941
+ { label: e("sample.tools.choices.eslint"), value: "eslint" },
1942
+ { label: e("sample.tools.choices.vite"), value: "vite" },
1943
+ { label: e("sample.tools.choices.vitest"), value: "vitest" }
1602
1944
  ],
1603
- description: "可多选"
1945
+ description: e("sample.tools.description")
1604
1946
  }
1605
1947
  }),
1606
- z(qe, {
1948
+ P(De, {
1607
1949
  field: "bio",
1608
1950
  props: {
1609
- label: "自我介绍",
1610
- message: "请输入自我介绍",
1951
+ label: e("sample.bio.message"),
1952
+ // label 和 message 保持一致
1953
+ message: e("sample.bio.message"),
1611
1954
  rows: 5,
1612
- description: "可用于在 inquirer 中展示更丰富的信息"
1955
+ description: e("sample.bio.description")
1613
1956
  }
1614
1957
  })
1615
1958
  ];
1616
1959
  }
1617
- const wt = /* @__PURE__ */ h({
1960
+ const ts = /* @__PURE__ */ f({
1618
1961
  name: "InquirerFormDesigner",
1619
1962
  __name: "InquirerFormDesigner",
1620
1963
  props: {
@@ -1623,14 +1966,14 @@ const wt = /* @__PURE__ */ h({
1623
1966
  autoRegisterControls: { type: Boolean, default: !0 }
1624
1967
  },
1625
1968
  setup(e) {
1626
- const t = e, l = new pe(), s = V(() => t.engine ?? l);
1627
- let a = null;
1628
- const i = t.autoRegisterControls;
1629
- return i && (a = [...Q.getAll()], Se()), t.seedSample && s.value.getSchema().controls.length === 0 && (s.value.getSchema().controls = ke()), ue(() => {
1630
- i && a && Q.replaceAll(a);
1631
- }), (n, r) => (u(), x(o(me), { engine: s.value }, null, 8, ["engine"]));
1969
+ const l = e, t = new Ve(), a = y(() => l.engine ?? t);
1970
+ let r = null;
1971
+ const n = l.autoRegisterControls;
1972
+ return n && (r = [...j.getAll()], Ae()), l.seedSample && a.value.getSchema().controls.length === 0 && (a.value.getSchema().controls = Le()), ye(() => {
1973
+ n && r && j.replaceAll(r);
1974
+ }), (s, u) => (i(), b(o(qe), { engine: a.value }, null, 8, ["engine"]));
1632
1975
  }
1633
- }), _t = {
1976
+ }), ls = {
1634
1977
  "inq-input": "input",
1635
1978
  "inq-password": "password",
1636
1979
  "inq-number": "number",
@@ -1640,99 +1983,99 @@ const wt = /* @__PURE__ */ h({
1640
1983
  "inq-expand": "expand",
1641
1984
  "inq-checkbox": "checkbox",
1642
1985
  "inq-editor": "editor"
1643
- }, qt = ["list", "rawlist", "expand", "checkbox"];
1644
- function Ce(e) {
1645
- const t = e.props?.promptType;
1646
- return t || (_t[e.type] ?? null);
1986
+ }, ss = ["list", "rawlist", "expand", "checkbox"];
1987
+ function Re(e) {
1988
+ const l = e.props?.promptType;
1989
+ return l || (ls[e.type] ?? null);
1647
1990
  }
1648
- function Et(e) {
1649
- return qt.includes(e);
1991
+ function as(e) {
1992
+ return ss.includes(e);
1650
1993
  }
1651
- function $e(e) {
1652
- const t = Ce(e);
1653
- if (!t) return;
1654
- const l = e.props || {};
1655
- if (t === "confirm")
1656
- return typeof l.defaultValue == "boolean" ? l.defaultValue : !1;
1657
- if (t === "checkbox")
1658
- return Array.isArray(l.defaultChoices) ? l.defaultChoices : Array.isArray(l.defaultValue) ? l.defaultValue : [];
1659
- if (t === "number") {
1660
- const s = Number(l.defaultValue);
1661
- return Number.isNaN(s) ? void 0 : s;
1994
+ function de(e) {
1995
+ const l = Re(e);
1996
+ if (!l) return;
1997
+ const t = e.props || {};
1998
+ if (l === "confirm")
1999
+ return typeof t.defaultValue == "boolean" ? t.defaultValue : !1;
2000
+ if (l === "checkbox")
2001
+ return Array.isArray(t.defaultChoices) ? t.defaultChoices : Array.isArray(t.defaultValue) ? t.defaultValue : [];
2002
+ if (l === "number") {
2003
+ const a = Number(t.defaultValue);
2004
+ return Number.isNaN(a) ? void 0 : a;
1662
2005
  }
1663
- if ((t === "list" || t === "rawlist" || t === "expand") && typeof l.defaultChoice == "string")
1664
- return l.defaultChoice;
1665
- if (l.defaultValue !== void 0 && l.defaultValue !== null)
1666
- return l.defaultValue;
1667
- if (t === "input" || t === "password" || t === "editor")
2006
+ if ((l === "list" || l === "rawlist" || l === "expand") && typeof t.defaultChoice == "string")
2007
+ return t.defaultChoice;
2008
+ if (t.defaultValue !== void 0 && t.defaultValue !== null)
2009
+ return t.defaultValue;
2010
+ if (l === "input" || l === "password" || l === "editor")
1668
2011
  return "";
1669
2012
  }
1670
- function te(e, t) {
2013
+ function ae(e, l) {
1671
2014
  if (!(!e || typeof e != "string"))
1672
2015
  try {
1673
- return new Function("input", "answers", e)(t.input, t.answers);
1674
- } catch (l) {
1675
- console.warn("[inquirer-demo] 表达式执行失败:", l);
2016
+ return new Function("input", "answers", e)(l.input, l.answers);
2017
+ } catch (t) {
2018
+ console.warn("[inquirer-demo] 表达式执行失败:", t);
1676
2019
  return;
1677
2020
  }
1678
2021
  }
1679
- function St(e, t) {
1680
- const l = e.props?.whenExpression;
1681
- if (!l) return !0;
1682
- const s = te(l, { input: t[e.field || ""], answers: t });
1683
- return typeof s == "boolean" ? s : !0;
2022
+ function os(e, l) {
2023
+ const t = e.props?.whenExpression;
2024
+ if (!t) return !0;
2025
+ const a = ae(t, { input: l[e.field || ""], answers: l });
2026
+ return typeof a == "boolean" ? a : !0;
1684
2027
  }
1685
- function kt(e, t, l) {
1686
- const s = e.props?.filterExpression;
1687
- if (!s) return t;
1688
- const a = te(s, { input: t, answers: l });
1689
- return a === void 0 ? t : a;
2028
+ function ns(e, l, t) {
2029
+ const a = e.props?.filterExpression;
2030
+ if (!a) return l;
2031
+ const r = ae(a, { input: l, answers: t });
2032
+ return r === void 0 ? l : r;
1690
2033
  }
1691
- function Ct(e, t, l) {
1692
- const s = e.props?.transformerExpression;
1693
- if (!s) return t;
1694
- const a = te(s, { input: t, answers: l });
1695
- return a === void 0 ? t : a;
2034
+ function is(e, l, t) {
2035
+ const a = e.props?.transformerExpression;
2036
+ if (!a) return l;
2037
+ const r = ae(a, { input: l, answers: t });
2038
+ return r === void 0 ? l : r;
1696
2039
  }
1697
- function ie(e, t, l) {
1698
- const s = e.props?.validateExpression;
1699
- if (!s && !e.props?.required)
2040
+ function ve(e, l, t) {
2041
+ const a = e.props?.validateExpression;
2042
+ if (!a && !e.props?.required)
1700
2043
  return null;
1701
- if (s) {
1702
- const a = te(s, { input: t, answers: l });
1703
- if (a === !0 || a === void 0)
2044
+ if (a) {
2045
+ const r = ae(a, { input: l, answers: t });
2046
+ if (r === !0 || r === void 0)
1704
2047
  return null;
1705
- if (typeof a == "string")
1706
- return a;
2048
+ if (typeof r == "string")
2049
+ return r;
1707
2050
  } else if (e.props?.required) {
1708
- if (t == null || t === "")
1709
- return "该问题为必填项";
1710
- if (Array.isArray(t) && t.length === 0)
1711
- return "至少选择一项";
2051
+ if (l == null || l === "")
2052
+ return "Please input";
2053
+ if (Array.isArray(l) && l.length === 0)
2054
+ return "Please select";
1712
2055
  }
1713
2056
  return null;
1714
2057
  }
1715
- function $t(e, t) {
1716
- if (!t.field || e[t.field] !== void 0) return;
1717
- const l = $e(t);
1718
- l !== void 0 && (e[t.field] = l);
2058
+ function rs(e, l) {
2059
+ if (!l.field || e[l.field] !== void 0) return;
2060
+ const t = de(l);
2061
+ t !== void 0 && (e[l.field] = t);
1719
2062
  }
1720
- function Ut(e) {
2063
+ function us(e) {
1721
2064
  if (typeof e.props?.description == "string" && e.props.description.trim().length > 0)
1722
2065
  return e.props.description.trim();
1723
2066
  if (typeof e.props?.message == "string" && e.props.message.trim().length > 0)
1724
2067
  return e.props.message.trim();
1725
2068
  }
1726
- const It = {
2069
+ const cs = {
1727
2070
  key: 0,
1728
2071
  class: "inquirer-container"
1729
- }, Nt = {
2072
+ }, ds = {
1730
2073
  key: 0,
1731
2074
  class: "node-description"
1732
- }, Bt = {
2075
+ }, ps = {
1733
2076
  key: 1,
1734
2077
  class: "node-error"
1735
- }, At = /* @__PURE__ */ h({
2078
+ }, ms = /* @__PURE__ */ f({
1736
2079
  name: "InquirerRuntimeNode",
1737
2080
  __name: "InquirerRuntimeNode",
1738
2081
  props: {
@@ -1740,80 +2083,80 @@ const It = {
1740
2083
  formData: {}
1741
2084
  },
1742
2085
  emits: ["update"],
1743
- setup(e, { emit: t }) {
1744
- const l = e, s = t, a = V(() => Q.get(l.node.type)), i = V(() => a.value?.runtime || null), n = V(() => l.formData || {}), r = V(() => {
1745
- if (l.node.field)
1746
- return n.value[l.node.field];
1747
- }), g = V(() => Ut(l.node)), m = L(null), p = V(() => St(l.node, n.value));
1748
- ee(
1749
- p,
1750
- ($) => {
1751
- !$ && l.node.field && n.value[l.node.field] !== void 0 && (s("update", l.node.field, void 0), m.value = null);
2086
+ setup(e, { emit: l }) {
2087
+ const t = e, a = l, r = y(() => j.get(t.node.type)), n = y(() => r.value?.runtime || null), s = y(() => t.formData || {}), u = y(() => {
2088
+ if (t.node.field)
2089
+ return s.value[t.node.field];
2090
+ }), _ = y(() => us(t.node)), p = H(null), v = y(() => os(t.node, s.value));
2091
+ Z(
2092
+ v,
2093
+ (k) => {
2094
+ !k && t.node.field && s.value[t.node.field] !== void 0 && (a("update", t.node.field, void 0), p.value = null);
1752
2095
  },
1753
2096
  { immediate: !0 }
1754
- ), ee(
1755
- () => r.value,
1756
- ($) => {
1757
- m.value = ie(l.node, $, n.value);
2097
+ ), Z(
2098
+ () => u.value,
2099
+ (k) => {
2100
+ p.value = ve(t.node, k, s.value);
1758
2101
  },
1759
2102
  { immediate: !0 }
1760
2103
  );
1761
- function v($) {
1762
- if (!l.node.field) return;
1763
- const T = kt(l.node, $, n.value);
1764
- s("update", l.node.field, T), m.value = ie(l.node, T, n.value);
2104
+ function g(k) {
2105
+ if (!t.node.field) return;
2106
+ const R = ns(t.node, k, s.value);
2107
+ a("update", t.node.field, R), p.value = ve(t.node, R, s.value);
1765
2108
  }
1766
- const O = V(() => typeof l.node.props?.message == "string" && l.node.props.message.trim() ? l.node.props.message : typeof l.node.props?.label == "string" && l.node.props.label.trim() ? l.node.props.label : l.node.field || "未命名控件"), j = V(() => Ct(l.node, r.value, n.value)), J = V(() => a.value?.isContainer ?? !1);
1767
- function C($, T) {
1768
- s("update", $, T);
2109
+ const w = y(() => typeof t.node.props?.message == "string" && t.node.props.message.trim() ? t.node.props.message : typeof t.node.props?.label == "string" && t.node.props.label.trim() ? t.node.props.label : t.node.field || "未命名控件"), te = y(() => is(t.node, u.value, s.value)), G = y(() => r.value?.isContainer ?? !1);
2110
+ function U(k, R) {
2111
+ a("update", k, R);
1769
2112
  }
1770
- return ($, T) => {
1771
- const K = Ne("InquirerRuntimeNode", !0);
1772
- return p.value ? (u(), d(S, { key: 0 }, [
1773
- J.value ? (u(), d("div", It, [
1774
- (u(), x(ae(i.value), Be(Ae(e.node.props)), {
1775
- default: w(() => [
1776
- e.node.children && e.node.children.length ? (u(!0), d(S, { key: 0 }, I(e.node.children, (U) => (u(), x(K, {
1777
- key: U.id,
1778
- node: U,
2113
+ return (k, R) => {
2114
+ const W = He("InquirerRuntimeNode", !0);
2115
+ return v.value ? (i(), d(I, { key: 0 }, [
2116
+ G.value ? (i(), d("div", cs, [
2117
+ (i(), b(he(n.value), Je(Ge(e.node.props)), {
2118
+ default: V(() => [
2119
+ e.node.children && e.node.children.length ? (i(!0), d(I, { key: 0 }, z(e.node.children, (F) => (i(), b(W, {
2120
+ key: F.id,
2121
+ node: F,
1779
2122
  formData: e.formData,
1780
- onUpdate: C
1781
- }, null, 8, ["node", "formData"]))), 128)) : y("", !0)
2123
+ onUpdate: U
2124
+ }, null, 8, ["node", "formData"]))), 128)) : x("", !0)
1782
2125
  ]),
1783
2126
  _: 1
1784
2127
  }, 16))
1785
- ])) : (u(), x(o(de), {
2128
+ ])) : (i(), b(o(_e), {
1786
2129
  key: 1,
1787
- label: O.value
2130
+ label: w.value
1788
2131
  }, {
1789
- default: w(() => [
1790
- (u(), x(ae(i.value), D(e.node.props, {
1791
- modelValue: r.value,
1792
- displayValue: j.value,
1793
- "onUpdate:modelValue": v
2132
+ default: V(() => [
2133
+ (i(), b(he(n.value), L(e.node.props, {
2134
+ modelValue: u.value,
2135
+ displayValue: te.value,
2136
+ "onUpdate:modelValue": g
1794
2137
  }), {
1795
- default: w(() => [
1796
- e.node.children && e.node.children.length ? (u(!0), d(S, { key: 0 }, I(e.node.children, (U) => (u(), x(K, {
1797
- key: U.id,
1798
- node: U,
2138
+ default: V(() => [
2139
+ e.node.children && e.node.children.length ? (i(!0), d(I, { key: 0 }, z(e.node.children, (F) => (i(), b(W, {
2140
+ key: F.id,
2141
+ node: F,
1799
2142
  formData: e.formData,
1800
- onUpdate: C
1801
- }, null, 8, ["node", "formData"]))), 128)) : y("", !0)
2143
+ onUpdate: U
2144
+ }, null, 8, ["node", "formData"]))), 128)) : x("", !0)
1802
2145
  ]),
1803
2146
  _: 1
1804
2147
  }, 16, ["modelValue", "displayValue"])),
1805
- g.value ? (u(), d("p", Nt, f(g.value), 1)) : y("", !0),
1806
- m.value ? (u(), d("p", Bt, f(m.value), 1)) : y("", !0)
2148
+ _.value ? (i(), d("p", ds, m(_.value), 1)) : x("", !0),
2149
+ p.value ? (i(), d("p", ps, m(p.value), 1)) : x("", !0)
1807
2150
  ]),
1808
2151
  _: 1
1809
2152
  }, 8, ["label"]))
1810
- ], 64)) : y("", !0);
2153
+ ], 64)) : x("", !0);
1811
2154
  };
1812
2155
  }
1813
- }), Rt = /* @__PURE__ */ _(At, [["__scopeId", "data-v-762f3565"]]), Tt = { class: "inquirer-web-runtime" }, Dt = {
2156
+ }), fs = /* @__PURE__ */ q(ms, [["__scopeId", "data-v-5d5107df"]]), hs = { class: "inquirer-web-runtime" }, vs = {
1814
2157
  key: 0,
1815
2158
  class: "runtime-empty"
1816
- }, zt = /* @__PURE__ */ h({
2159
+ }, gs = /* @__PURE__ */ f({
1817
2160
  name: "InquirerFormRuntime",
1818
2161
  __name: "InquirerFormRuntime",
1819
2162
  props: {
@@ -1821,279 +2164,496 @@ const It = {
1821
2164
  modelValue: {}
1822
2165
  },
1823
2166
  emits: ["update:modelValue"],
1824
- setup(e, { emit: t }) {
1825
- const l = e, s = t, a = L({ ...l.modelValue || {} });
1826
- ee(
1827
- () => l.modelValue,
1828
- (g) => {
1829
- a.value = { ...g || {} };
2167
+ setup(e, { emit: l }) {
2168
+ const { t } = re({
2169
+ messages: Ue,
2170
+ inheritLocale: !0
2171
+ }), a = e, r = l, n = H({ ...a.modelValue || {} });
2172
+ Z(
2173
+ () => a.modelValue,
2174
+ (p) => {
2175
+ n.value = { ...p || {} };
1830
2176
  },
1831
2177
  { deep: !0 }
1832
- ), ee(
1833
- () => l.schema.controls,
2178
+ ), Z(
2179
+ () => a.schema.controls,
1834
2180
  () => {
1835
- i();
2181
+ s();
1836
2182
  },
1837
2183
  { deep: !0, immediate: !0 }
1838
2184
  );
1839
- function i() {
1840
- n(l.schema.controls), s("update:modelValue", { ...a.value });
2185
+ function s() {
2186
+ u(a.schema.controls), r("update:modelValue", { ...n.value });
1841
2187
  }
1842
- function n(g) {
1843
- g && g.forEach((m) => {
1844
- $t(a.value, m), m.children?.length && n(m.children);
2188
+ function u(p) {
2189
+ p && p.forEach((v) => {
2190
+ rs(n.value, v), v.children?.length && u(v.children);
1845
2191
  });
1846
2192
  }
1847
- function r(g, m) {
1848
- m === void 0 ? delete a.value[g] : a.value[g] = m, s("update:modelValue", { ...a.value });
2193
+ function _(p, v) {
2194
+ v === void 0 ? delete n.value[p] : n.value[p] = v, r("update:modelValue", { ...n.value });
1849
2195
  }
1850
- return (g, m) => (u(), d("div", Tt, [
1851
- b(o(Je), {
2196
+ return (p, v) => (i(), d("div", hs, [
2197
+ h(o(et), {
1852
2198
  class: "form-content",
1853
2199
  "label-position": "top",
1854
- model: a.value
2200
+ model: n.value
1855
2201
  }, {
1856
- default: w(() => [
1857
- !e.schema.controls || e.schema.controls.length === 0 ? (u(), d("div", Dt, " 暂无表单内容 ")) : (u(!0), d(S, { key: 1 }, I(e.schema.controls, (p) => (u(), x(Rt, {
1858
- key: p.id,
1859
- node: p,
1860
- formData: a.value,
1861
- onUpdate: r
2202
+ default: V(() => [
2203
+ !e.schema.controls || e.schema.controls.length === 0 ? (i(), d("div", vs, m(o(t)("runtime.emptyForm")), 1)) : (i(!0), d(I, { key: 1 }, z(e.schema.controls, (g) => (i(), b(fs, {
2204
+ key: g.id,
2205
+ node: g,
2206
+ formData: n.value,
2207
+ onUpdate: _
1862
2208
  }, null, 8, ["node", "formData"]))), 128))
1863
2209
  ]),
1864
2210
  _: 1
1865
2211
  }, 8, ["model"])
1866
2212
  ]));
1867
2213
  }
1868
- }), Ue = /* @__PURE__ */ _(zt, [["__scopeId", "data-v-2ef727bc"]]);
1869
- function Ft(e, t = {}) {
1870
- const l = [];
1871
- function s(a) {
1872
- a && a.forEach((i) => {
1873
- const n = Lt(i, t);
1874
- n && l.push(n), i.children?.length && s(i.children);
2214
+ }), Fe = /* @__PURE__ */ q(gs, [["__scopeId", "data-v-6fa4aa68"]]);
2215
+ function bs(e, l = {}) {
2216
+ const t = [];
2217
+ function a(r) {
2218
+ r && r.forEach((n) => {
2219
+ const s = xs(n, l);
2220
+ s && t.push(s), n.children?.length && a(n.children);
1875
2221
  });
1876
2222
  }
1877
- return s(e.controls), l;
2223
+ return a(e.controls), t;
1878
2224
  }
1879
- function Lt(e, t) {
1880
- const l = Ce(e);
1881
- if (!l || e.props?.disabled && !t.includeDisabled)
2225
+ function xs(e, l) {
2226
+ const t = Re(e);
2227
+ if (!t || e.props?.disabled && !l.includeDisabled)
1882
2228
  return null;
1883
- const s = e.field?.trim() || e.props?.alias || e.id, a = e.props?.message?.trim() || e.props?.label || s, i = $e(e), n = {
1884
- type: l,
1885
- name: s,
1886
- message: a,
1887
- default: i,
1888
- prefix: F(e.props?.prefix),
1889
- suffix: F(e.props?.suffix),
1890
- pageSize: G(e.props?.pageSize),
2229
+ const a = e.field?.trim() || e.props?.alias || e.id, r = e.props?.message?.trim() || e.props?.label || a, n = de(e), s = {
2230
+ type: t,
2231
+ name: a,
2232
+ message: r,
2233
+ default: n,
2234
+ prefix: O(e.props?.prefix),
2235
+ suffix: O(e.props?.suffix),
2236
+ pageSize: K(e.props?.pageSize),
1891
2237
  loop: typeof e.props?.loop == "boolean" ? e.props.loop : void 0,
1892
- whenExpression: F(e.props?.whenExpression),
1893
- validateExpression: Ot(e),
1894
- filterExpression: F(e.props?.filterExpression),
1895
- transformerExpression: F(e.props?.transformerExpression),
1896
- mask: Mt(e.props),
1897
- choices: Jt(l, e.props),
2238
+ whenExpression: O(e.props?.whenExpression),
2239
+ validateExpression: _s(e),
2240
+ filterExpression: O(e.props?.filterExpression),
2241
+ transformerExpression: O(e.props?.transformerExpression),
2242
+ mask: ys(e.props),
2243
+ choices: ws(t, e.props),
1898
2244
  metadata: {
1899
2245
  schemaNodeId: e.id,
1900
2246
  label: e.props?.label,
1901
2247
  placeholder: e.props?.placeholder,
1902
2248
  required: !!e.props?.required,
1903
- inquirerType: l,
2249
+ inquirerType: t,
1904
2250
  group: e.props?.groupLabel,
1905
2251
  description: e.props?.description
1906
2252
  }
1907
2253
  };
1908
- return l === "checkbox" && (n.metadata = {
1909
- ...n.metadata,
2254
+ return t === "checkbox" && (s.metadata = {
2255
+ ...s.metadata,
1910
2256
  defaultChoices: Array.isArray(e.props?.defaultChoices) ? e.props.defaultChoices : void 0
1911
- }), l === "number" && (n.metadata = {
1912
- ...n.metadata,
1913
- min: G(e.props?.min),
1914
- max: G(e.props?.max),
1915
- step: G(e.props?.step)
1916
- }), l === "editor" && (n.metadata = {
1917
- ...n.metadata,
1918
- rows: G(e.props?.rows)
1919
- }), n;
2257
+ }), t === "number" && (s.metadata = {
2258
+ ...s.metadata,
2259
+ min: K(e.props?.min),
2260
+ max: K(e.props?.max),
2261
+ step: K(e.props?.step)
2262
+ }), t === "editor" && (s.metadata = {
2263
+ ...s.metadata,
2264
+ rows: K(e.props?.rows)
2265
+ }), s;
1920
2266
  }
1921
- function Mt(e = {}) {
2267
+ function ys(e = {}) {
1922
2268
  if (e.maskEnabled)
1923
2269
  return typeof e.maskSymbol == "string" && e.maskSymbol.trim().length > 0 ? e.maskSymbol : !0;
1924
2270
  }
1925
- function Ot(e) {
1926
- const t = F(e.props?.validateExpression);
1927
- if (t) return t;
2271
+ function _s(e) {
2272
+ const l = O(e.props?.validateExpression);
2273
+ if (l) return l;
1928
2274
  if (e.props?.required)
1929
- return "return input ? true : '该问题为必填项'";
2275
+ return "return input ? true : 'Please input'";
1930
2276
  }
1931
- function Jt(e, t = {}) {
1932
- if (!Et(e))
2277
+ function ws(e, l = {}) {
2278
+ if (!as(e))
1933
2279
  return;
1934
- const l = t.choices;
1935
- return !Array.isArray(l) || l.length === 0 ? [] : l.filter((s) => typeof s?.label == "string" && typeof s?.value == "string").map((s) => ({
1936
- name: s.label,
1937
- value: s.value,
1938
- short: F(s.short)
2280
+ const t = l.choices;
2281
+ return !Array.isArray(t) || t.length === 0 ? [] : t.filter((a) => typeof a?.label == "string" && typeof a?.value == "string").map((a) => ({
2282
+ name: a.label,
2283
+ value: a.value,
2284
+ short: O(a.short)
1939
2285
  }));
1940
2286
  }
1941
- function F(e) {
2287
+ function O(e) {
1942
2288
  if (typeof e != "string") return;
1943
- const t = e.trim();
1944
- return t.length ? t : void 0;
2289
+ const l = e.trim();
2290
+ return l.length ? l : void 0;
1945
2291
  }
1946
- function G(e) {
2292
+ function K(e) {
1947
2293
  if (e == null) return;
1948
- const t = Number(e);
1949
- return Number.isNaN(t) ? void 0 : t;
2294
+ const l = Number(e);
2295
+ return Number.isNaN(l) ? void 0 : l;
1950
2296
  }
1951
- const Pt = { class: "inquirer-demo" }, Qt = { class: "demo-workspace" }, jt = { class: "workspace-tabs" }, Gt = ["onClick"], Yt = { class: "workspace-panel designer-panel" }, Ht = { class: "workspace-panel runtime-panel" }, Kt = { class: "runtime-json" }, Wt = { class: "workspace-panel export-panel" }, Xt = { class: "json-viewer" }, Zt = { class: "code-snippet" }, en = { class: "workspace-panel docs-panel" }, ln = { class: "callout-controls" }, tn = { class: "type" }, nn = { class: "meta" }, sn = /* @__PURE__ */ h({
2297
+ const ge = {
2298
+ "zh-CN": {
2299
+ playground: {
2300
+ title: "Inquirer 表单设计器",
2301
+ subtitle: "Element Plus 风格的 CLI 表单工作台",
2302
+ actions: {
2303
+ generateSample: "生成示例表单",
2304
+ clearForm: "清空表单",
2305
+ copySchema: "复制 Schema JSON",
2306
+ copyInquirer: "复制 Inquirer JSON"
2307
+ },
2308
+ tabs: {
2309
+ designer: {
2310
+ label: "可视化设计器",
2311
+ desc: "拖拽控件,构建 Schema"
2312
+ },
2313
+ runtime: {
2314
+ label: "Web端预览",
2315
+ desc: "运行态在线预览"
2316
+ },
2317
+ export: {
2318
+ label: "Inquirer示例",
2319
+ desc: "生成 Inquirer prompt 以及调用示例"
2320
+ }
2321
+ },
2322
+ runtime: {
2323
+ formDataTitle: "FormData(实时)"
2324
+ },
2325
+ export: {
2326
+ copyButton: "复制 JSON",
2327
+ exampleTitle: "调用示例"
2328
+ },
2329
+ messages: {
2330
+ copied: "已复制到剪贴板"
2331
+ }
2332
+ }
2333
+ },
2334
+ "en-US": {
2335
+ playground: {
2336
+ title: "Inquirer Form Designer",
2337
+ subtitle: "Element Plus styled CLI form workbench",
2338
+ actions: {
2339
+ generateSample: "Generate Sample",
2340
+ clearForm: "Clear Form",
2341
+ copySchema: "Copy Schema JSON",
2342
+ copyInquirer: "Copy Inquirer JSON"
2343
+ },
2344
+ tabs: {
2345
+ designer: {
2346
+ label: "Visual Designer",
2347
+ desc: "Drag controls, build Schema"
2348
+ },
2349
+ runtime: {
2350
+ label: "Web Preview",
2351
+ desc: "Runtime online preview"
2352
+ },
2353
+ export: {
2354
+ label: "Inquirer Example",
2355
+ desc: "Generate Inquirer prompt and usage example"
2356
+ }
2357
+ },
2358
+ runtime: {
2359
+ formDataTitle: "FormData (Live)"
2360
+ },
2361
+ export: {
2362
+ copyButton: "Copy JSON",
2363
+ exampleTitle: "Usage Example"
2364
+ },
2365
+ messages: {
2366
+ copied: "Copied to clipboard"
2367
+ }
2368
+ }
2369
+ }
2370
+ }, be = {
2371
+ "zh-CN": {
2372
+ sample: {
2373
+ fullName: {
2374
+ label: "姓名",
2375
+ message: "请输入您的姓名",
2376
+ placeholder: "张三",
2377
+ description: "该信息将用于生成问候语"
2378
+ },
2379
+ password: {
2380
+ label: "账户密码",
2381
+ message: "请输入账户密码",
2382
+ description: "密码不会被保存在示例应用中"
2383
+ },
2384
+ age: {
2385
+ label: "年龄",
2386
+ message: "请输入年龄",
2387
+ description: "用于计算问卷分层,必填"
2388
+ },
2389
+ allowContact: {
2390
+ label: "是否允许联系",
2391
+ message: "我们可以通过邮件联系您吗?",
2392
+ description: "若选择是,将会收到提效工具邮件"
2393
+ },
2394
+ favoriteStack: {
2395
+ label: "技术栈",
2396
+ message: "请选择主要技术栈",
2397
+ description: "用于统计语言偏好"
2398
+ },
2399
+ tools: {
2400
+ label: "常用工具",
2401
+ message: "请选择常用工具",
2402
+ description: "可多选",
2403
+ choices: {
2404
+ git: "Git",
2405
+ eslint: "ESLint",
2406
+ vite: "Vite",
2407
+ vitest: "Vitest"
2408
+ }
2409
+ },
2410
+ bio: {
2411
+ label: "自我介绍",
2412
+ message: "请输入自我介绍",
2413
+ description: "可用于在 inquirer 中展示更丰富的信息"
2414
+ }
2415
+ }
2416
+ },
2417
+ "en-US": {
2418
+ sample: {
2419
+ fullName: {
2420
+ label: "Full Name",
2421
+ message: "Please enter your full name",
2422
+ placeholder: "John Doe",
2423
+ description: "This information will be used to generate greetings"
2424
+ },
2425
+ password: {
2426
+ label: "Account Password",
2427
+ message: "Please enter your account password",
2428
+ description: "Password will not be saved in the sample application"
2429
+ },
2430
+ age: {
2431
+ label: "Age",
2432
+ message: "Please enter your age",
2433
+ description: "Used for survey stratification, required"
2434
+ },
2435
+ allowContact: {
2436
+ label: "Allow Contact",
2437
+ message: "May we contact you via email?",
2438
+ description: "If yes, you will receive productivity tool emails"
2439
+ },
2440
+ favoriteStack: {
2441
+ label: "Tech Stack",
2442
+ message: "Please select your primary tech stack",
2443
+ description: "Used for language preference statistics"
2444
+ },
2445
+ tools: {
2446
+ label: "Common Tools",
2447
+ message: "Please select your common tools",
2448
+ description: "Multiple selections allowed",
2449
+ choices: {
2450
+ git: "Git",
2451
+ eslint: "ESLint",
2452
+ vite: "Vite",
2453
+ vitest: "Vitest"
2454
+ }
2455
+ },
2456
+ bio: {
2457
+ label: "Bio",
2458
+ message: "Please enter your bio",
2459
+ description: "Can be used to display richer information in inquirer"
2460
+ }
2461
+ }
2462
+ }
2463
+ }, Vs = { class: "inquirer-demo" }, qs = { class: "callout-panel" }, Cs = { class: "callout-header" }, Es = { class: "callout-title" }, Ss = { class: "callout-actions" }, ks = { class: "demo-workspace" }, $s = { class: "workspace-tabs" }, Us = ["onClick"], Is = { class: "workspace-panel designer-panel" }, Ns = { class: "workspace-panel runtime-panel" }, zs = { class: "runtime-json" }, Bs = { class: "workspace-panel export-panel" }, Ms = { class: "panel-header" }, Ts = { class: "json-viewer" }, Ds = { class: "code-snippet" }, As = /* @__PURE__ */ f({
1952
2464
  __name: "InquirerFormPlayground",
1953
2465
  setup(e) {
1954
- const t = new pe();
1955
- t.updateInfo({
1956
- title: "Inquirer 表单定义",
1957
- description: "通过拖拽生成 Inquirer QuestionCollection"
2466
+ const l = {
2467
+ "zh-CN": {
2468
+ ...ge["zh-CN"],
2469
+ ...be["zh-CN"]
2470
+ },
2471
+ "en-US": {
2472
+ ...ge["en-US"],
2473
+ ...be["en-US"]
2474
+ }
2475
+ }, { t } = re({
2476
+ messages: l,
2477
+ inheritLocale: !0
2478
+ }), a = new Ve();
2479
+ a.updateInfo({
2480
+ title: "Inquirer Form Definition",
2481
+ description: ""
1958
2482
  });
1959
- const l = [...Q.getAll()];
1960
- Se(), Re(() => {
1961
- t.getSchema().controls.length || j();
1962
- }), ue(() => {
1963
- Q.replaceAll(l);
2483
+ const r = [...j.getAll()];
2484
+ Ae(), Qe(() => {
2485
+ a.getSchema().controls.length || k();
2486
+ }), ye(() => {
2487
+ j.replaceAll(r);
2488
+ });
2489
+ const n = H({}), s = H(0), u = H(0), _ = y(() => [
2490
+ {
2491
+ key: "designer",
2492
+ label: t("playground.tabs.designer.label"),
2493
+ desc: t("playground.tabs.designer.desc")
2494
+ },
2495
+ {
2496
+ key: "runtime",
2497
+ label: t("playground.tabs.runtime.label"),
2498
+ desc: t("playground.tabs.runtime.desc")
2499
+ },
2500
+ {
2501
+ key: "export",
2502
+ label: t("playground.tabs.export.label"),
2503
+ desc: t("playground.tabs.export.desc")
2504
+ }
2505
+ ]), p = H(_.value[0]?.key ?? "designer");
2506
+ Z(p, (N, E) => {
2507
+ N === "runtime" && E !== "runtime" && v();
1964
2508
  });
1965
- const s = L({}), a = L(0), i = L(0), n = [
1966
- { key: "designer", label: "可视化设计器", desc: "拖拽字段,构建 Schema" },
1967
- { key: "runtime", label: "运行态预览", desc: "实时数据与交互" },
1968
- { key: "export", label: "Inquirer 输出", desc: "生成 QuestionCollection + 调用" },
1969
- { key: "docs", label: "说明", desc: "当前已注册控件" }
1970
- ], r = L(n[0]?.key ?? "designer"), g = V(() => Ft(t.getSchema())), m = V(() => JSON.stringify(g.value, null, 2)), p = V(() => JSON.stringify(s.value, null, 2));
1971
2509
  function v() {
1972
- a.value++, i.value++;
2510
+ const N = {}, E = a.getSchema().controls;
2511
+ function S(me) {
2512
+ me.forEach((Y) => {
2513
+ if (Y.field) {
2514
+ const fe = de(Y);
2515
+ fe !== void 0 && (N[Y.field] = fe);
2516
+ }
2517
+ Y.children?.length && S(Y.children);
2518
+ });
2519
+ }
2520
+ E?.length && S(E), n.value = N;
2521
+ }
2522
+ const g = y(() => bs(a.getSchema())), w = y(() => JSON.stringify(g.value, null, 2)), te = y(() => JSON.stringify(n.value, null, 2));
2523
+ function G() {
2524
+ s.value++, u.value++;
1973
2525
  }
1974
- function O(U) {
1975
- const q = t.getSchema().controls;
1976
- q.splice(0, q.length, ...U), t.selectNode(void 0), t.snapshot("update"), v();
2526
+ function U(N) {
2527
+ const E = a.getSchema().controls;
2528
+ E.splice(0, E.length, ...N), a.selectNode(void 0), a.snapshot("update"), G();
1977
2529
  }
1978
- function j() {
1979
- O(ke());
2530
+ function k() {
2531
+ U(Le(t));
1980
2532
  }
1981
- function J() {
1982
- O([]), s.value = {};
2533
+ function R() {
2534
+ U([]), n.value = {};
1983
2535
  }
1984
- async function C(U, q) {
2536
+ async function W(N, E) {
1985
2537
  try {
1986
- await navigator.clipboard.writeText(U), alert(`${q} 已复制到剪贴板`);
1987
- } catch (E) {
1988
- console.warn("clipboard failed", E);
2538
+ await navigator.clipboard.writeText(N), alert(`${E} ${t("playground.messages.copied")}`);
2539
+ } catch (S) {
2540
+ console.warn("clipboard failed", S);
1989
2541
  }
1990
2542
  }
1991
- function $() {
1992
- C(De(t.getSchema()), "Schema JSON");
2543
+ function F() {
2544
+ W(We(a.getSchema()), "Schema JSON");
1993
2545
  }
1994
- function T() {
1995
- C(m.value, "Inquirer JSON");
2546
+ function pe() {
2547
+ W(w.value, "Inquirer JSON");
1996
2548
  }
1997
- const K = V(() => `import inquirer from 'inquirer'
2549
+ const Pe = y(() => `import inquirer from 'inquirer'
1998
2550
  import { schemaToInquirer } from 'inquirer-form'
1999
2551
 
2000
2552
  const questions = schemaToInquirer(schema)
2001
2553
  const answers = await inquirer.prompt(questions)
2002
2554
  console.log(answers)`);
2003
- return (U, q) => (u(), d("div", Pt, [
2004
- c("section", { class: "callout-panel" }, [
2005
- c("div", { class: "callout-header" }, [
2006
- q[1] || (q[1] = c("div", null, [
2007
- c("h1", null, "🧭 Inquirer 表单调用示例")
2008
- ], -1)),
2009
- c("div", { class: "callout-actions" }, [
2010
- c("button", { onClick: j }, "生成示例表单"),
2011
- c("button", { onClick: J }, "清空表单"),
2012
- c("button", { onClick: $ }, "复制 Schema JSON"),
2013
- c("button", { onClick: T }, "复制 Inquirer JSON")
2555
+ return (N, E) => (i(), d("div", Vs, [
2556
+ c("section", qs, [
2557
+ c("div", Cs, [
2558
+ c("div", Es, [
2559
+ h(o(Ce), { class: "title-icon" }, {
2560
+ default: V(() => [
2561
+ h(o(qt))
2562
+ ]),
2563
+ _: 1
2564
+ }),
2565
+ c("div", null, [
2566
+ c("h1", null, m(o(t)("playground.title")), 1),
2567
+ c("p", null, m(o(t)("playground.subtitle")), 1)
2568
+ ])
2569
+ ]),
2570
+ c("div", Ss, [
2571
+ c("button", {
2572
+ type: "button",
2573
+ onClick: k
2574
+ }, m(o(t)("playground.actions.generateSample")), 1),
2575
+ c("button", {
2576
+ type: "button",
2577
+ onClick: R
2578
+ }, m(o(t)("playground.actions.clearForm")), 1),
2579
+ c("button", {
2580
+ type: "button",
2581
+ onClick: F
2582
+ }, m(o(t)("playground.actions.copySchema")), 1),
2583
+ c("button", {
2584
+ type: "button",
2585
+ onClick: pe
2586
+ }, m(o(t)("playground.actions.copyInquirer")), 1)
2014
2587
  ])
2015
2588
  ])
2016
2589
  ]),
2017
- c("main", Qt, [
2018
- c("div", jt, [
2019
- (u(), d(S, null, I(n, (E) => c("button", {
2020
- key: E.key,
2021
- class: Te(["tab-item", { active: E.key === r.value }]),
2022
- onClick: (on) => r.value = E.key
2590
+ c("main", ks, [
2591
+ c("div", $s, [
2592
+ (i(!0), d(I, null, z(_.value, (S) => (i(), d("button", {
2593
+ key: S.key,
2594
+ class: je(["tab-item", { active: S.key === p.value }]),
2595
+ onClick: (me) => p.value = S.key
2023
2596
  }, [
2024
- c("span", null, f(E.label), 1),
2025
- c("small", null, f(E.desc), 1)
2026
- ], 10, Gt)), 64))
2597
+ c("span", null, m(S.label), 1),
2598
+ c("small", null, m(S.desc), 1)
2599
+ ], 10, Us))), 128))
2027
2600
  ]),
2028
- W(c("section", Yt, [
2029
- (u(), x(o(me), {
2030
- key: a.value,
2031
- engine: o(t)
2601
+ oe(c("section", Is, [
2602
+ (i(), b(o(qe), {
2603
+ showControlTabs: !1,
2604
+ key: s.value,
2605
+ engine: o(a)
2032
2606
  }, null, 8, ["engine"]))
2033
2607
  ], 512), [
2034
- [X, r.value === "designer"]
2608
+ [ne, p.value === "designer"]
2035
2609
  ]),
2036
- W(c("section", Ht, [
2037
- (u(), x(Ue, {
2038
- key: i.value,
2039
- schema: o(t).getSchema(),
2040
- modelValue: s.value,
2041
- "onUpdate:modelValue": q[0] || (q[0] = (E) => s.value = E)
2610
+ oe(c("section", Ns, [
2611
+ (i(), b(Fe, {
2612
+ key: u.value,
2613
+ schema: o(a).getSchema(),
2614
+ modelValue: n.value,
2615
+ "onUpdate:modelValue": E[0] || (E[0] = (S) => n.value = S)
2042
2616
  }, null, 8, ["schema", "modelValue"])),
2043
- c("div", Kt, [
2044
- q[2] || (q[2] = c("header", null, "FormData(实时)", -1)),
2045
- c("pre", null, f(p.value), 1)
2617
+ c("div", zs, [
2618
+ c("header", null, m(o(t)("playground.runtime.formDataTitle")), 1),
2619
+ c("pre", null, m(te.value), 1)
2046
2620
  ])
2047
2621
  ], 512), [
2048
- [X, r.value === "runtime"]
2622
+ [ne, p.value === "runtime"]
2049
2623
  ]),
2050
- W(c("section", Wt, [
2051
- c("div", { class: "panel-header" }, [
2052
- q[3] || (q[3] = c("div", null, null, -1)),
2624
+ oe(c("section", Bs, [
2625
+ c("div", Ms, [
2626
+ E[1] || (E[1] = c("div", null, null, -1)),
2053
2627
  c("button", {
2054
2628
  class: "btn-copy",
2055
- onClick: T
2056
- }, "复制 JSON")
2629
+ onClick: pe
2630
+ }, m(o(t)("playground.export.copyButton")), 1)
2057
2631
  ]),
2058
- c("pre", Xt, f(m.value), 1),
2059
- c("div", Zt, [
2060
- q[4] || (q[4] = c("header", null, "调用示例", -1)),
2632
+ c("pre", Ts, m(w.value), 1),
2633
+ c("div", Ds, [
2634
+ c("header", null, m(o(t)("playground.export.exampleTitle")), 1),
2061
2635
  c("pre", null, [
2062
- c("code", null, f(K.value), 1)
2063
- ])
2064
- ])
2065
- ], 512), [
2066
- [X, r.value === "export"]
2067
- ]),
2068
- W(c("section", en, [
2069
- c("div", ln, [
2070
- c("ul", null, [
2071
- (u(!0), d(S, null, I(o(Ee), (E) => (u(), d("li", {
2072
- key: E.type
2073
- }, [
2074
- c("span", tn, f(E.label), 1),
2075
- c("span", nn, f(E.type), 1)
2076
- ]))), 128))
2636
+ c("code", null, m(Pe.value), 1)
2077
2637
  ])
2078
2638
  ])
2079
2639
  ], 512), [
2080
- [X, r.value === "docs"]
2640
+ [ne, p.value === "export"]
2081
2641
  ])
2082
2642
  ])
2083
2643
  ]));
2084
2644
  }
2085
- }), cn = /* @__PURE__ */ _(sn, [["__scopeId", "data-v-cdc491b8"]]), pn = {
2645
+ }), Os = /* @__PURE__ */ q(As, [["__scopeId", "data-v-5dae1a4e"]]), Hs = {
2086
2646
  install(e) {
2087
- e.component("InquirerFormDesigner", wt), e.component("InquirerFormRuntime", Ue);
2647
+ e.component("InquirerFormDesigner", ts), e.component("InquirerFormRuntime", Fe);
2088
2648
  }
2089
2649
  };
2090
2650
  export {
2091
- wt as InquirerFormDesigner,
2092
- cn as InquirerFormPlayground,
2093
- Ue as InquirerFormRuntime,
2094
- ke as createInquirerSampleControls,
2095
- pn as default,
2096
- Ee as inquirerControls,
2097
- Se as registerInquirerControls,
2098
- Ft as schemaToInquirer
2651
+ ts as InquirerFormDesigner,
2652
+ Os as InquirerFormPlayground,
2653
+ Fe as InquirerFormRuntime,
2654
+ Le as createInquirerSampleControls,
2655
+ Hs as default,
2656
+ es as inquirerControls,
2657
+ Ae as registerInquirerControls,
2658
+ bs as schemaToInquirer
2099
2659
  };