@sparqjs/schema-designer 0.2.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -676,7 +676,7 @@ function Tt(e, t) {
676
676
  });
677
677
  }
678
678
  function Et(e) {
679
- return e.footer === !1 ? [] : e.footer?.actions?.length ? e.footer.actions.map((e) => ({ ...e })) : [{ action: "submit" }, { action: "reset" }];
679
+ return e.footer ? e.footer?.actions === void 0 ? [{ action: "submit" }, { action: "reset" }] : e.footer.actions.map((e) => ({ ...e })) : [];
680
680
  }
681
681
  //#endregion
682
682
  //#region src/state/visibility.ts
@@ -6246,7 +6246,7 @@ var Ss = [
6246
6246
  value: "none"
6247
6247
  }
6248
6248
  ],
6249
- visible: (e) => e.footer !== !1
6249
+ visible: (e) => !!e.footer
6250
6250
  },
6251
6251
  {
6252
6252
  key: "footer.submitTitle",
@@ -6254,7 +6254,7 @@ var Ss = [
6254
6254
  label: "提交文案",
6255
6255
  commitMode: "blur",
6256
6256
  placeholder: "默认使用提交",
6257
- visible: (e) => e.footer !== !1
6257
+ visible: (e) => !!e.footer
6258
6258
  },
6259
6259
  {
6260
6260
  key: "footer.secondaryTitle",
@@ -6262,7 +6262,7 @@ var Ss = [
6262
6262
  label: "次按钮文案",
6263
6263
  commitMode: "blur",
6264
6264
  placeholder: "默认使用系统文案",
6265
- visible: (e) => e.footer !== !1 && Es(e) !== void 0
6265
+ visible: (e) => !!e.footer && Es(e) !== void 0
6266
6266
  }
6267
6267
  ]
6268
6268
  }
@@ -6278,9 +6278,9 @@ function ws(e) {
6278
6278
  }
6279
6279
  function Ts(e, t) {
6280
6280
  if (t.key === "props.showRequiredAsterisk") return e.props?.hideRequiredAsterisk !== !0;
6281
- if (t.key === "footer.visible") return e.footer !== !1;
6281
+ if (t.key === "footer.visible") return !!e.footer;
6282
6282
  if (!(t.key === "wrapper.type" && e.wrapper?.type === "default") && !(t.key === "props.size" && e.props?.size === "default")) {
6283
- if (t.key === "footer.secondary") return Es(e)?.action ?? "reset";
6283
+ if (t.key === "footer.secondary") return Es(e)?.action ?? "none";
6284
6284
  if (t.key === "footer.submitTitle") return Et(e).find((e) => e.action === "submit")?.title ?? "";
6285
6285
  if (t.key === "footer.secondaryTitle") return Es(e)?.title ?? "";
6286
6286
  if (t.path) return A(e, t.path);
@@ -6334,7 +6334,7 @@ function As(e, t) {
6334
6334
  let n = E(e);
6335
6335
  for (let [r, i] of Object.entries(t)) {
6336
6336
  let t = Cs(e).flatMap((e) => e.fields).find((e) => e.kind !== "divider" && e.key === r);
6337
- t && t.kind !== "divider" && Ns(n, t, Vs(t, i));
6337
+ t && t.kind !== "divider" && Ns(n, t, Bs(t, i));
6338
6338
  }
6339
6339
  return n;
6340
6340
  }
@@ -6342,7 +6342,7 @@ function js(e) {
6342
6342
  return {
6343
6343
  name: e.key,
6344
6344
  label: e.label,
6345
- type: zs(e),
6345
+ type: Rs(e),
6346
6346
  formable: !0,
6347
6347
  multiple: !1,
6348
6348
  options: e.kind === "select" ? {
@@ -6360,7 +6360,7 @@ function Ms(e) {
6360
6360
  type: "field",
6361
6361
  field: e.key,
6362
6362
  tip: e.tip,
6363
- component: Bs(e),
6363
+ component: zs(e),
6364
6364
  props: {
6365
6365
  placeholder: e.kind === "text" || e.kind === "textarea" || e.kind === "number" ? e.placeholder : void 0,
6366
6366
  min: e.kind === "number" ? e.min : void 0,
@@ -6377,7 +6377,7 @@ function Ns(e, t, n) {
6377
6377
  return;
6378
6378
  }
6379
6379
  if (t.key === "footer.visible") {
6380
- n === !1 ? e.footer = !1 : e.footer === !1 && (e.footer = {});
6380
+ n === !1 ? e.footer = !1 : e.footer ||= {};
6381
6381
  return;
6382
6382
  }
6383
6383
  if (t.key === "footer.secondary") {
@@ -6385,50 +6385,47 @@ function Ns(e, t, n) {
6385
6385
  return;
6386
6386
  }
6387
6387
  if (t.key === "footer.submitTitle") {
6388
- Fs(e, "submit", Hs(n));
6388
+ Fs(e, "submit", Vs(n));
6389
6389
  return;
6390
6390
  }
6391
6391
  if (t.key === "footer.secondaryTitle") {
6392
- let t = Is(e).find((e) => e.action === "reset" || e.action === "cancel");
6393
- t?.action && Fs(e, t.action, Hs(n));
6392
+ let t = Et(e).find((e) => e.action === "reset" || e.action === "cancel");
6393
+ t?.action && Fs(e, t.action, Vs(n));
6394
6394
  return;
6395
6395
  }
6396
6396
  t.path && j(e, t.path, n);
6397
6397
  }
6398
6398
  function Ps(e, t) {
6399
- let n = Rs(e), r = Is(e), i = r.find((e) => e.action === "submit"), a = r.find((e) => e.action === "reset" || e.action === "cancel"), o = t === "none" ? void 0 : {
6399
+ let n = Ls(e), r = Et(e), i = r.find((e) => e.action === "submit"), a = r.find((e) => e.action === "reset" || e.action === "cancel"), o = t === "none" ? void 0 : {
6400
6400
  action: t,
6401
6401
  title: a?.action === t ? a.title : void 0
6402
6402
  };
6403
6403
  e.footer = {
6404
6404
  ...n,
6405
6405
  actions: [i ?? { action: "submit" }, ...o ? [o] : []]
6406
- }, Ls(e.footer);
6406
+ }, Is(e.footer);
6407
6407
  }
6408
6408
  function Fs(e, t, n) {
6409
- let r = Rs(e), i = Is(e), a = i.find((e) => e.action === t) ?? { action: t };
6409
+ let r = Ls(e), i = Et(e), a = i.find((e) => e.action === t) ?? { action: t };
6410
6410
  i.includes(a) || i.push(a), a.title = n, e.footer = {
6411
6411
  ...r,
6412
6412
  actions: i
6413
- }, Ls(e.footer);
6413
+ }, Is(e.footer);
6414
6414
  }
6415
6415
  function Is(e) {
6416
- return e.footer === !1 ? [] : e.footer?.actions?.length ? e.footer.actions.map((e) => ({ ...e })) : [{ action: "submit" }, { action: "reset" }];
6417
- }
6418
- function Ls(e) {
6419
6416
  if (e) for (let t of e.actions ?? []) t.title || delete t.title;
6420
6417
  }
6421
- function Rs(e) {
6418
+ function Ls(e) {
6422
6419
  return (e.footer === !1 || !e.footer) && (e.footer = {}), e.footer;
6423
6420
  }
6424
- function zs(e) {
6421
+ function Rs(e) {
6425
6422
  switch (e.kind) {
6426
6423
  case "number": return "number";
6427
6424
  case "switch": return "boolean";
6428
6425
  default: return "string";
6429
6426
  }
6430
6427
  }
6431
- function Bs(e) {
6428
+ function zs(e) {
6432
6429
  switch (e.kind) {
6433
6430
  case "textarea": return "textarea";
6434
6431
  case "number": return "number";
@@ -6437,15 +6434,15 @@ function Bs(e) {
6437
6434
  default: return "text";
6438
6435
  }
6439
6436
  }
6440
- function Vs(e, t) {
6437
+ function Bs(e, t) {
6441
6438
  return e.kind === "number" ? typeof t == "number" && Number.isFinite(t) ? t : void 0 : e.kind === "switch" ? t === !0 : typeof t == "string" && t === "" ? void 0 : t;
6442
6439
  }
6443
- function Hs(e) {
6440
+ function Vs(e) {
6444
6441
  return typeof e == "string" && e !== "" ? e : void 0;
6445
6442
  }
6446
6443
  //#endregion
6447
6444
  //#region src/inspector/commands/form-property.ts
6448
- function Us(e, t) {
6445
+ function Hs(e, t) {
6449
6446
  let n = Se(e.schema, e.viewName), r = new Set(ws(n).map((e) => e.key)), i = Object.keys(t.values).filter((e) => !r.has(e)).map((e) => ({
6450
6447
  key: e,
6451
6448
  code: "unknown-property",
@@ -6458,36 +6455,36 @@ function Us(e, t) {
6458
6455
  };
6459
6456
  if (Object.keys(t.values).length === 0) return { status: "unchanged" };
6460
6457
  let a = As(n, t.values);
6461
- return Ws(n, a) ? { status: "unchanged" } : (Tt(e, a), { status: "applied" });
6458
+ return Us(n, a) ? { status: "unchanged" } : (Tt(e, a), { status: "applied" });
6462
6459
  }
6463
- function Ws(e, t) {
6460
+ function Us(e, t) {
6464
6461
  return JSON.stringify(e) === JSON.stringify(t);
6465
6462
  }
6466
6463
  //#endregion
6467
6464
  //#region src/inspector/property-commit.ts
6468
- function Gs(e, t) {
6469
- return [...new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Xs(e[n], t[n]));
6465
+ function Ws(e, t) {
6466
+ return [...new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Ys(e[n], t[n]));
6470
6467
  }
6471
- function Ks(e) {
6468
+ function Gs(e) {
6472
6469
  return e.commitMode !== "blur";
6473
6470
  }
6474
- function qs(e) {
6471
+ function Ks(e) {
6475
6472
  return e.commitMode === "blur";
6476
6473
  }
6477
- function Js(e, t) {
6474
+ function qs(e, t) {
6478
6475
  return e.commitMode !== "blur" || t.key !== "Enter" || t.isComposing ? !1 : e.kind === "textarea" ? t.ctrlKey === !0 || t.metaKey === !0 : !0;
6479
6476
  }
6480
- function Ys(e, t, n) {
6477
+ function Js(e, t, n) {
6481
6478
  let r = { ...e };
6482
6479
  for (let e of n) Object.prototype.hasOwnProperty.call(t, e) && (r[e] = t[e]);
6483
6480
  return r;
6484
6481
  }
6485
- function Xs(e, t) {
6482
+ function Ys(e, t) {
6486
6483
  return JSON.stringify(e) === JSON.stringify(t);
6487
6484
  }
6488
6485
  //#endregion
6489
6486
  //#region src/inspector/validation-rule-editor.tsx
6490
- var Zs = [
6487
+ var Xs = [
6491
6488
  {
6492
6489
  label: "邮箱",
6493
6490
  value: "email"
@@ -6528,7 +6525,7 @@ var Zs = [
6528
6525
  label: "短标识",
6529
6526
  value: "slug"
6530
6527
  }
6531
- ], Qs = [{
6528
+ ], Zs = [{
6532
6529
  label: "大小写 + 数字",
6533
6530
  value: "upper_lower_num",
6534
6531
  params: {
@@ -6549,14 +6546,14 @@ var Zs = [
6549
6546
  require_symbol: !0
6550
6547
  },
6551
6548
  message: "密码至少 8 位,且包含大小写字母、数字和特殊字符。"
6552
- }], $s = [
6549
+ }], Qs = [
6553
6550
  "min_length",
6554
6551
  "max_length",
6555
6552
  "require_lower",
6556
6553
  "require_upper",
6557
6554
  "require_digit",
6558
6555
  "require_symbol"
6559
- ], Y = J(), ec = r({
6556
+ ], Y = J(), $s = r({
6560
6557
  name: "ValidationRuleEditor",
6561
6558
  props: {
6562
6559
  value: Array,
@@ -6564,21 +6561,21 @@ var Zs = [
6564
6561
  props: Object
6565
6562
  },
6566
6563
  setup(e) {
6567
- let t = f(!1), r = f([]), a = f(""), o = n(() => e.props?.component || "text"), s = n(() => e.props?.fieldLabel || "字段"), c = n(() => e.props?.fields ?? []), l = n(() => e.props?.supported), u = n(() => Fc(e.value ?? [])), d = n(() => (e.value?.length ?? 0) > 0);
6564
+ let t = f(!1), r = f([]), a = f(""), o = n(() => e.props?.component || "text"), s = n(() => e.props?.fieldLabel || "字段"), c = n(() => e.props?.fields ?? []), l = n(() => e.props?.supported), u = n(() => Pc(e.value ?? [])), d = n(() => (e.value?.length ?? 0) > 0);
6568
6565
  m(() => e.value, (e) => {
6569
- t.value || (r.value = Vc(e ?? []));
6566
+ t.value || (r.value = Bc(e ?? []));
6570
6567
  }, {
6571
6568
  immediate: !0,
6572
6569
  deep: !0
6573
6570
  });
6574
6571
  function p() {
6575
- r.value = Vc(e.value ?? []), oc(r.value, o.value), rc(r.value, o.value), a.value = "", t.value = !0;
6572
+ r.value = Bc(e.value ?? []), ac(r.value, o.value), nc(r.value, o.value), a.value = "", t.value = !0;
6576
6573
  }
6577
6574
  function h() {
6578
6575
  t.value = !1;
6579
6576
  }
6580
6577
  function g() {
6581
- let n = Ic(r.value, o.value, l.value), i = Lc(n, o.value, e.props?.field);
6578
+ let n = Fc(r.value, o.value, l.value), i = Ic(n, o.value, e.props?.field);
6582
6579
  if (i) {
6583
6580
  a.value = i;
6584
6581
  return;
@@ -6606,7 +6603,7 @@ var Zs = [
6606
6603
  class: "sparq-validation-dialog__body",
6607
6604
  onInput: () => a.value = "",
6608
6605
  onChange: () => a.value = ""
6609
- }, tc(o.value, r.value, c.value, l.value), a.value ? /* @__PURE__ */ i("p", {
6606
+ }, ec(o.value, r.value, c.value, l.value), a.value ? /* @__PURE__ */ i("p", {
6610
6607
  class: "sparq-validation-dialog__error",
6611
6608
  role: "alert"
6612
6609
  }, a.value) : void 0), /* @__PURE__ */ i("footer", { class: "sparq-validation-dialog__footer" }, /* @__PURE__ */ i("button", {
@@ -6619,21 +6616,21 @@ var Zs = [
6619
6616
  }, "确认")))) : void 0);
6620
6617
  }
6621
6618
  });
6622
- function tc(t, n, r, a) {
6623
- let o = Bc(t, a);
6619
+ function ec(t, n, r, a) {
6620
+ let o = zc(t, a);
6624
6621
  if (o.size === 1 && o.has("required")) return X(n, r);
6625
6622
  switch (t) {
6626
- case "password": return /* @__PURE__ */ i(e, null, X(n, r), Ec(n));
6627
- case "textarea": return /* @__PURE__ */ i(e, null, X(n, r), dc(n), Tc(n));
6623
+ case "password": return /* @__PURE__ */ i(e, null, X(n, r), Tc(n));
6624
+ case "textarea": return /* @__PURE__ */ i(e, null, X(n, r), uc(n), wc(n));
6628
6625
  case "number":
6629
6626
  case "slider":
6630
- case "rate": return /* @__PURE__ */ i(e, null, X(n, r), fc(n, "最小值", "最大值", "例如 0"));
6631
- case "date-picker": return /* @__PURE__ */ i(e, null, X(n, r), fc(n, "最早日期", "最晚日期", "YYYY-MM-DD", t));
6632
- case "datetime-picker": return /* @__PURE__ */ i(e, null, X(n, r), fc(n, "最早时间", "最晚时间", "YYYY-MM-DD HH:mm:ss", t));
6633
- case "time-picker": return /* @__PURE__ */ i(e, null, X(n, r), fc(n, "最早时间", "最晚时间", "HH:mm:ss", t));
6627
+ case "rate": return /* @__PURE__ */ i(e, null, X(n, r), dc(n, "最小值", "最大值", "例如 0"));
6628
+ case "date-picker": return /* @__PURE__ */ i(e, null, X(n, r), dc(n, "最早日期", "最晚日期", "YYYY-MM-DD", t));
6629
+ case "datetime-picker": return /* @__PURE__ */ i(e, null, X(n, r), dc(n, "最早时间", "最晚时间", "YYYY-MM-DD HH:mm:ss", t));
6630
+ case "time-picker": return /* @__PURE__ */ i(e, null, X(n, r), dc(n, "最早时间", "最晚时间", "HH:mm:ss", t));
6634
6631
  case "date-range-picker":
6635
- case "time-range-picker": return /* @__PURE__ */ i(e, null, X(n, r), ic(n, t));
6636
- case "color": return /* @__PURE__ */ i(e, null, X(n, r), nc(n));
6632
+ case "time-range-picker": return /* @__PURE__ */ i(e, null, X(n, r), rc(n, t));
6633
+ case "color": return /* @__PURE__ */ i(e, null, X(n, r), tc(n));
6637
6634
  case "select":
6638
6635
  case "multi-select":
6639
6636
  case "select-tree":
@@ -6642,14 +6639,14 @@ function tc(t, n, r, a) {
6642
6639
  case "checkbox":
6643
6640
  case "image-upload":
6644
6641
  case "file-upload": return X(n, r);
6645
- default: return /* @__PURE__ */ i(e, null, X(n, r), uc(n), dc(n), Tc(n));
6642
+ default: return /* @__PURE__ */ i(e, null, X(n, r), lc(n), uc(n), wc(n));
6646
6643
  }
6647
6644
  }
6648
- function nc(e) {
6649
- let t = rc(e, "color");
6650
- if (t) return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "颜色格式"), /* @__PURE__ */ i("small", null, "固定校验 HEX、RGB 和 RGBA")), Oc(t, "颜色错误提示"));
6645
+ function tc(e) {
6646
+ let t = nc(e, "color");
6647
+ if (t) return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "颜色格式"), /* @__PURE__ */ i("small", null, "固定校验 HEX、RGB 和 RGBA")), Dc(t, "颜色错误提示"));
6651
6648
  }
6652
- function rc(e, t) {
6649
+ function nc(e, t) {
6653
6650
  if (t !== "color") return;
6654
6651
  for (let t = e.length - 1; t >= 0; --t) e[t]?.type === "format" && e[t]?.value !== "color" && e.splice(t, 1);
6655
6652
  let n = e.find((e) => e.type === "format" && e.value === "color");
@@ -6660,8 +6657,8 @@ function rc(e, t) {
6660
6657
  };
6661
6658
  return e.push(r), r;
6662
6659
  }
6663
- function ic(e, t) {
6664
- let n = oc(e, t);
6660
+ function rc(e, t) {
6661
+ let n = ac(e, t);
6665
6662
  if (!n) return;
6666
6663
  let r = n.params ?? {}, a = t === "date-range-picker" ? "day" : "minute", o = a === "day" ? "YYYY-MM-DD" : "HH:mm:ss", s = new Map(fe(r).issues.map((e) => [e.key, e.message]));
6667
6664
  return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "范围限制"), /* @__PURE__ */ i("small", null, "起止顺序固定校验")), /* @__PURE__ */ i("div", { class: "sparq-validation-grid" }, /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "最小边界"), Y.text({
@@ -6669,30 +6666,30 @@ function ic(e, t) {
6669
6666
  class: "sparq-validation-rule__control",
6670
6667
  placeholder: o,
6671
6668
  "aria-label": "最小边界",
6672
- onChange: (e) => sc(n, "min", typeof e == "string" ? e : "")
6673
- }), ac(s.get("min"))), /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "最大边界"), Y.text({
6669
+ onChange: (e) => oc(n, "min", typeof e == "string" ? e : "")
6670
+ }), ic(s.get("min"))), /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "最大边界"), Y.text({
6674
6671
  value: typeof r.max == "string" ? r.max : "",
6675
6672
  class: "sparq-validation-rule__control",
6676
6673
  placeholder: o,
6677
6674
  "aria-label": "最大边界",
6678
- onChange: (e) => sc(n, "max", typeof e == "string" ? e : "")
6679
- }), ac(s.get("max"))), /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "最大跨度(", a === "day" ? "天" : "分钟", ")"), Y.number({
6675
+ onChange: (e) => oc(n, "max", typeof e == "string" ? e : "")
6676
+ }), ic(s.get("max"))), /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "最大跨度(", a === "day" ? "天" : "分钟", ")"), Y.number({
6680
6677
  min: 0,
6681
6678
  step: 1,
6682
6679
  value: typeof r.max_span == "number" ? r.max_span : void 0,
6683
6680
  class: "sparq-validation-rule__control",
6684
6681
  placeholder: "不限制",
6685
6682
  "aria-label": `最大跨度(${a === "day" ? "天" : "分钟"})`,
6686
- onChange: (e) => cc(n, typeof e == "number" ? String(e) : "")
6687
- }), ac(s.get("max_span")))), Oc(n, "范围错误提示"));
6683
+ onChange: (e) => sc(n, typeof e == "number" ? String(e) : "")
6684
+ }), ic(s.get("max_span")))), Dc(n, "范围错误提示"));
6688
6685
  }
6689
- function ac(e) {
6686
+ function ic(e) {
6690
6687
  return e ? /* @__PURE__ */ i("small", {
6691
6688
  class: "sparq-validation-rule__error",
6692
6689
  role: "alert"
6693
6690
  }, e) : void 0;
6694
6691
  }
6695
- function oc(e, t) {
6692
+ function ac(e, t) {
6696
6693
  if (t !== "date-range-picker" && t !== "time-range-picker") return;
6697
6694
  let n = t === "date-range-picker" ? "day" : "minute", r = Z(e, "range");
6698
6695
  if (r) return r.params = {
@@ -6709,14 +6706,14 @@ function oc(e, t) {
6709
6706
  };
6710
6707
  return e.push(i), i;
6711
6708
  }
6712
- function sc(e, t, n) {
6709
+ function oc(e, t, n) {
6713
6710
  if (e.params ??= {}, n === "") {
6714
6711
  delete e.params[t];
6715
6712
  return;
6716
6713
  }
6717
6714
  e.params[t] = n;
6718
6715
  }
6719
- function cc(e, t) {
6716
+ function sc(e, t) {
6720
6717
  if (e.params ??= {}, t === "") {
6721
6718
  delete e.params.max_span;
6722
6719
  return;
@@ -6724,10 +6721,10 @@ function cc(e, t) {
6724
6721
  e.params.max_span = Number(t);
6725
6722
  }
6726
6723
  function X(e, t) {
6727
- let n = Z(e, "required"), r = Uc(n);
6724
+ let n = Z(e, "required"), r = Hc(n);
6728
6725
  return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "必填规则"), n ? /* @__PURE__ */ i("button", {
6729
6726
  type: "button",
6730
- onClick: () => Mc(e, "required")
6727
+ onClick: () => jc(e, "required")
6731
6728
  }, "清除") : void 0), /* @__PURE__ */ i("div", { class: "sparq-validation-options" }, [
6732
6729
  {
6733
6730
  label: "始终",
@@ -6748,12 +6745,12 @@ function X(e, t) {
6748
6745
  ].map((n) => /* @__PURE__ */ i("button", {
6749
6746
  type: "button",
6750
6747
  class: r === n.value ? "is-active" : void 0,
6751
- onClick: () => Wc(e, n.value, t)
6752
- }, n.label))), n && r === "condition" ? lc(n, t) : void 0, n && r === "advanced" ? /* @__PURE__ */ i("p", { class: "sparq-validation-rule__hint" }, "当前为高级条件,请通过 JSON 或后续条件编辑器调整。") : void 0, n ? Oc(n, "必填错误提示") : void 0);
6748
+ onClick: () => Uc(e, n.value, t)
6749
+ }, n.label))), n && r === "condition" ? cc(n, t) : void 0, n && r === "advanced" ? /* @__PURE__ */ i("p", { class: "sparq-validation-rule__hint" }, "当前为高级条件,请通过 JSON 或后续条件编辑器调整。") : void 0, n ? Dc(n, "必填错误提示") : void 0);
6753
6750
  }
6754
- function lc(e, t) {
6755
- let n = Gc(e, t), r = Yc(n.op);
6756
- return /* @__PURE__ */ i("div", { class: "sparq-validation-condition" }, /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "字段"), kc(n.field ?? "", t.length ? t : [{
6751
+ function cc(e, t) {
6752
+ let n = Wc(e, t), r = Jc(n.op);
6753
+ return /* @__PURE__ */ i("div", { class: "sparq-validation-condition" }, /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "字段"), Oc(n.field ?? "", t.length ? t : [{
6757
6754
  label: "暂无可选字段",
6758
6755
  value: "",
6759
6756
  disabled: !0
@@ -6765,9 +6762,9 @@ function lc(e, t) {
6765
6762
  }, {
6766
6763
  placeholder: "选择字段",
6767
6764
  "aria-label": "条件字段"
6768
- })), /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "条件"), kc(r, Hc, (r) => {
6765
+ })), /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "条件"), Oc(r, Vc, (r) => {
6769
6766
  let i = r;
6770
- e.when = Kc(n.field ?? Jc(t), i, n.value);
6767
+ e.when = Gc(n.field ?? qc(t), i, n.value);
6771
6768
  }, { "aria-label": "条件操作符" })), r === "empty" || r === "not_empty" ? void 0 : /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, "值"), Y.text({
6772
6769
  value: n.value === void 0 ? "" : String(n.value),
6773
6770
  class: "sparq-validation-rule__control",
@@ -6776,34 +6773,34 @@ function lc(e, t) {
6776
6773
  onChange: (t) => {
6777
6774
  e.when = {
6778
6775
  ...n,
6779
- value: Xc(typeof t == "string" ? t : "")
6776
+ value: Yc(typeof t == "string" ? t : "")
6780
6777
  };
6781
6778
  }
6782
6779
  })));
6783
6780
  }
6784
- function uc(e) {
6781
+ function lc(e) {
6785
6782
  let t = Z(e, "format");
6786
6783
  return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "格式校验"), t ? /* @__PURE__ */ i("button", {
6787
6784
  type: "button",
6788
- onClick: () => Mc(e, "format")
6789
- }, "清除") : void 0), /* @__PURE__ */ i("div", { class: "sparq-validation-options" }, Zs.map((n) => /* @__PURE__ */ i("button", {
6785
+ onClick: () => jc(e, "format")
6786
+ }, "清除") : void 0), /* @__PURE__ */ i("div", { class: "sparq-validation-options" }, Xs.map((n) => /* @__PURE__ */ i("button", {
6790
6787
  type: "button",
6791
6788
  class: t?.value === n.value ? "is-active" : void 0,
6792
- onClick: () => jc(e, {
6789
+ onClick: () => Ac(e, {
6793
6790
  type: "format",
6794
6791
  value: n.value
6795
6792
  })
6796
- }, n.label))), t ? Oc(t, "格式错误提示") : void 0);
6793
+ }, n.label))), t ? Dc(t, "格式错误提示") : void 0);
6797
6794
  }
6798
- function dc(e) {
6799
- return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "长度限制")), /* @__PURE__ */ i("div", { class: "sparq-validation-grid" }, Dc(e, "min_length", "最小长度", "例如 2"), Dc(e, "max_length", "最大长度", "例如 199")));
6795
+ function uc(e) {
6796
+ return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "长度限制")), /* @__PURE__ */ i("div", { class: "sparq-validation-grid" }, Ec(e, "min_length", "最小长度", "例如 2"), Ec(e, "max_length", "最大长度", "例如 199")));
6800
6797
  }
6801
- function fc(e, t, n, r, a) {
6802
- return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "边界限制")), /* @__PURE__ */ i("div", { class: "sparq-validation-grid" }, a ? pc(e, "min", t, r, a) : Dc(e, "min", t, r), a ? pc(e, "max", n, r, a) : Dc(e, "max", n, r)));
6798
+ function dc(e, t, n, r, a) {
6799
+ return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "边界限制")), /* @__PURE__ */ i("div", { class: "sparq-validation-grid" }, a ? fc(e, "min", t, r, a) : Ec(e, "min", t, r), a ? fc(e, "max", n, r, a) : Ec(e, "max", n, r)));
6803
6800
  }
6804
- function pc(e, t, n, r, a) {
6805
- let o = Z(e, t), s = vc(o), c = _c(a), l = o?.value_expr && o.value_expr.type !== "literal" && !c.some((e) => e.value === o.value_expr?.type) ? o.value_expr.type : void 0;
6806
- return /* @__PURE__ */ i("label", { class: "sparq-validation-boundary" }, /* @__PURE__ */ i("span", null, n), kc(s, [
6801
+ function fc(e, t, n, r, a) {
6802
+ let o = Z(e, t), s = _c(o), c = gc(a), l = o?.value_expr && o.value_expr.type !== "literal" && !c.some((e) => e.value === o.value_expr?.type) ? o.value_expr.type : void 0;
6803
+ return /* @__PURE__ */ i("label", { class: "sparq-validation-boundary" }, /* @__PURE__ */ i("span", null, n), Oc(s, [
6807
6804
  {
6808
6805
  label: "固定值",
6809
6806
  value: "static"
@@ -6813,15 +6810,15 @@ function pc(e, t, n, r, a) {
6813
6810
  label: `现有表达式(${l})`,
6814
6811
  value: l
6815
6812
  }] : []
6816
- ], (n) => bc(e, t, n, o), { "aria-label": `${n}方式` }), s === "static" ? Y.text({
6817
- value: yc(o),
6813
+ ], (n) => yc(e, t, n, o), { "aria-label": `${n}方式` }), s === "static" ? Y.text({
6814
+ value: vc(o),
6818
6815
  class: "sparq-validation-rule__control",
6819
6816
  placeholder: r,
6820
6817
  "aria-label": n,
6821
- onChange: (n) => xc(e, t, typeof n == "string" ? n : "")
6822
- }) : Cc(o) ? /* @__PURE__ */ i("small", null, Cc(o)) : void 0);
6818
+ onChange: (n) => bc(e, t, typeof n == "string" ? n : "")
6819
+ }) : Sc(o) ? /* @__PURE__ */ i("small", null, Sc(o)) : void 0);
6823
6820
  }
6824
- var mc = [
6821
+ var pc = [
6825
6822
  {
6826
6823
  label: "今天",
6827
6824
  value: "today"
@@ -6834,7 +6831,7 @@ var mc = [
6834
6831
  label: "本月结束",
6835
6832
  value: "end_of_month"
6836
6833
  }
6837
- ], hc = [
6834
+ ], mc = [
6838
6835
  {
6839
6836
  label: "当前时间",
6840
6837
  value: "now"
@@ -6859,7 +6856,7 @@ var mc = [
6859
6856
  label: "本月结束",
6860
6857
  value: "end_of_month"
6861
6858
  }
6862
- ], gc = [
6859
+ ], hc = [
6863
6860
  {
6864
6861
  label: "当前时间",
6865
6862
  value: "now"
@@ -6873,48 +6870,48 @@ var mc = [
6873
6870
  value: "end_of_day"
6874
6871
  }
6875
6872
  ];
6876
- function _c(e) {
6877
- return e === "date-picker" ? mc : e === "time-picker" ? gc : hc;
6873
+ function gc(e) {
6874
+ return e === "date-picker" ? pc : e === "time-picker" ? hc : mc;
6878
6875
  }
6879
- function vc(e) {
6876
+ function _c(e) {
6880
6877
  return e?.value_expr && e.value_expr.type !== "literal" ? e.value_expr.type : "static";
6881
6878
  }
6882
- function yc(e) {
6879
+ function vc(e) {
6883
6880
  let t = e?.value_expr?.type === "literal" ? e.value_expr.value : e?.value;
6884
6881
  return t === void 0 ? "" : String(t);
6885
6882
  }
6886
- function bc(e, t, n, r) {
6883
+ function yc(e, t, n, r) {
6887
6884
  if (n === "static") {
6888
- let n = yc(r);
6889
- n ? Sc(e, t, { value: n }) : Mc(e, t);
6885
+ let n = vc(r);
6886
+ n ? xc(e, t, { value: n }) : jc(e, t);
6890
6887
  return;
6891
6888
  }
6892
6889
  let i = r?.value_expr?.type === n ? r.value_expr : void 0;
6893
- Sc(e, t, { value_expr: i ? {
6890
+ xc(e, t, { value_expr: i ? {
6894
6891
  ...i,
6895
6892
  offset: i.offset ? { ...i.offset } : void 0
6896
6893
  } : { type: n } });
6897
6894
  }
6898
- function xc(e, t, n) {
6895
+ function bc(e, t, n) {
6899
6896
  let r = n.trim();
6900
6897
  if (!r) {
6901
- Mc(e, t);
6898
+ jc(e, t);
6902
6899
  return;
6903
6900
  }
6904
- Sc(e, t, { value: r });
6901
+ xc(e, t, { value: r });
6905
6902
  }
6906
- function Sc(e, t, n) {
6903
+ function xc(e, t, n) {
6907
6904
  let r = {
6908
6905
  ...Z(e, t),
6909
6906
  type: t
6910
6907
  };
6911
- delete r.value, delete r.value_expr, Object.assign(r, n), jc(e, r);
6908
+ delete r.value, delete r.value_expr, Object.assign(r, n), Ac(e, r);
6912
6909
  }
6913
- function Cc(e) {
6910
+ function Sc(e) {
6914
6911
  let t = Object.entries(e?.value_expr?.offset ?? {}).filter(([, e]) => e !== 0);
6915
- return t.length ? `保留偏移:${t.map(([e, t]) => `${wc[e] ?? e} ${t}`).join(",")}` : void 0;
6912
+ return t.length ? `保留偏移:${t.map(([e, t]) => `${Cc[e] ?? e} ${t}`).join(",")}` : void 0;
6916
6913
  }
6917
- var wc = {
6914
+ var Cc = {
6918
6915
  years: "年",
6919
6916
  months: "月",
6920
6917
  weeks: "周",
@@ -6924,45 +6921,45 @@ var wc = {
6924
6921
  seconds: "秒",
6925
6922
  milliseconds: "毫秒"
6926
6923
  };
6927
- function Tc(e) {
6924
+ function wc(e) {
6928
6925
  let t = Z(e, "pattern");
6929
6926
  return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "正则校验"), t ? /* @__PURE__ */ i("button", {
6930
6927
  type: "button",
6931
- onClick: () => Mc(e, "pattern")
6928
+ onClick: () => jc(e, "pattern")
6932
6929
  }, "清除") : void 0), Y.text({
6933
6930
  value: typeof t?.value == "string" ? t.value : "",
6934
6931
  class: "sparq-validation-rule__control",
6935
6932
  placeholder: "^1[3-9][0-9]{9}$",
6936
6933
  "aria-label": "正则表达式",
6937
- onChange: (t) => Ac(e, "pattern", typeof t == "string" ? t : "")
6938
- }), t ? Oc(t, "正则错误提示") : void 0);
6934
+ onChange: (t) => kc(e, "pattern", typeof t == "string" ? t : "")
6935
+ }), t ? Dc(t, "正则错误提示") : void 0);
6939
6936
  }
6940
- function Ec(e) {
6941
- let t = Nc(e), n = Z(e, "complexity");
6937
+ function Tc(e) {
6938
+ let t = Mc(e), n = Z(e, "complexity");
6942
6939
  return /* @__PURE__ */ i("section", { class: "sparq-validation-rule" }, /* @__PURE__ */ i("header", null, /* @__PURE__ */ i("strong", null, "密码复杂度"), n ? /* @__PURE__ */ i("button", {
6943
6940
  type: "button",
6944
- onClick: () => Mc(e, "complexity")
6945
- }, "清除") : void 0), /* @__PURE__ */ i("div", { class: "sparq-validation-options" }, Qs.map((n) => /* @__PURE__ */ i("button", {
6941
+ onClick: () => jc(e, "complexity")
6942
+ }, "清除") : void 0), /* @__PURE__ */ i("div", { class: "sparq-validation-options" }, Zs.map((n) => /* @__PURE__ */ i("button", {
6946
6943
  type: "button",
6947
6944
  class: t === n.value ? "is-active" : void 0,
6948
- onClick: () => jc(e, {
6945
+ onClick: () => Ac(e, {
6949
6946
  type: "complexity",
6950
6947
  message: n.message,
6951
6948
  params: { ...n.params }
6952
6949
  })
6953
- }, n.label))), n ? Oc(n, "密码错误提示") : void 0);
6950
+ }, n.label))), n ? Dc(n, "密码错误提示") : void 0);
6954
6951
  }
6955
- function Dc(e, t, n, r) {
6952
+ function Ec(e, t, n, r) {
6956
6953
  let a = Z(e, t);
6957
6954
  return /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, n), Y.text({
6958
6955
  value: a?.value === void 0 ? "" : String(a.value),
6959
6956
  class: "sparq-validation-rule__control",
6960
6957
  placeholder: r,
6961
6958
  "aria-label": n,
6962
- onChange: (n) => Ac(e, t, typeof n == "string" ? n : "")
6959
+ onChange: (n) => kc(e, t, typeof n == "string" ? n : "")
6963
6960
  }));
6964
6961
  }
6965
- function Oc(e, t) {
6962
+ function Dc(e, t) {
6966
6963
  return /* @__PURE__ */ i("label", null, /* @__PURE__ */ i("span", null, t), Y.text({
6967
6964
  value: e.message ?? "",
6968
6965
  class: "sparq-validation-rule__control",
@@ -6974,7 +6971,7 @@ function Oc(e, t) {
6974
6971
  }
6975
6972
  }));
6976
6973
  }
6977
- function kc(e, t, n, r = {}) {
6974
+ function Oc(e, t, n, r = {}) {
6978
6975
  return Y.select({
6979
6976
  ...r,
6980
6977
  class: ["sparq-validation-rule__control", r.class],
@@ -6982,45 +6979,45 @@ function kc(e, t, n, r = {}) {
6982
6979
  onChange: (e) => n(typeof e == "string" ? e : "")
6983
6980
  }, { default: () => t.map((e) => Y.option(e)) });
6984
6981
  }
6985
- function Ac(e, t, n) {
6982
+ function kc(e, t, n) {
6986
6983
  let r = n.trim();
6987
6984
  if (!r) {
6988
- Mc(e, t);
6985
+ jc(e, t);
6989
6986
  return;
6990
6987
  }
6991
- jc(e, {
6988
+ Ac(e, {
6992
6989
  type: t,
6993
6990
  value: r
6994
6991
  });
6995
6992
  }
6996
- function jc(e, t) {
6997
- Mc(e, t.type), e.push(t);
6993
+ function Ac(e, t) {
6994
+ jc(e, t.type), e.push(t);
6998
6995
  }
6999
- function Mc(e, t) {
6996
+ function jc(e, t) {
7000
6997
  let n = e.findIndex((e) => e.type === t);
7001
6998
  n >= 0 && e.splice(n, 1);
7002
6999
  }
7003
7000
  function Z(e, t) {
7004
7001
  return e.find((e) => e.type === t);
7005
7002
  }
7006
- function Nc(e) {
7003
+ function Mc(e) {
7007
7004
  let t = Z(e, "complexity");
7008
7005
  if (t?.params) {
7009
- for (let e of Qs) if (Pc(t.params, e.params)) return e.value;
7006
+ for (let e of Zs) if (Nc(t.params, e.params)) return e.value;
7010
7007
  }
7011
7008
  }
7012
- function Pc(e, t) {
7013
- return $s.every((n) => e[n] === t[n]);
7009
+ function Nc(e, t) {
7010
+ return Qs.every((n) => e[n] === t[n]);
7014
7011
  }
7015
- function Fc(e) {
7016
- let t = e.map((e) => e.type === "required" ? "必填" : e.type === "format" ? e.value === "color" ? "颜色格式" : Zs.find((t) => t.value === e.value)?.label ?? "格式" : e.type === "min_length" || e.type === "max_length" ? "长度" : e.type === "min" || e.type === "max" ? "边界" : e.type === "pattern" ? "正则" : e.type === "complexity" ? "密码复杂度" : e.type === "range" ? "范围" : e.type);
7012
+ function Pc(e) {
7013
+ let t = e.map((e) => e.type === "required" ? "必填" : e.type === "format" ? e.value === "color" ? "颜色格式" : Xs.find((t) => t.value === e.value)?.label ?? "格式" : e.type === "min_length" || e.type === "max_length" ? "长度" : e.type === "min" || e.type === "max" ? "边界" : e.type === "pattern" ? "正则" : e.type === "complexity" ? "密码复杂度" : e.type === "range" ? "范围" : e.type);
7017
7014
  return [...new Set(t)].join("、");
7018
7015
  }
7019
- function Ic(e, t, n) {
7020
- let r = Bc(t, n);
7021
- return Vc(e).filter((e) => r.has(e.type) ? e.type === "required" || e.type === "complexity" ? !0 : e.type === "range" ? !!e.params : e.value !== void 0 && e.value !== "" || e.value_expr !== void 0 : !1);
7016
+ function Fc(e, t, n) {
7017
+ let r = zc(t, n);
7018
+ return Bc(e).filter((e) => r.has(e.type) ? e.type === "required" || e.type === "complexity" ? !0 : e.type === "range" ? !!e.params : e.value !== void 0 && e.value !== "" || e.value_expr !== void 0 : !1);
7022
7019
  }
7023
- function Lc(e, t, n) {
7020
+ function Ic(e, t, n) {
7024
7021
  if (t === "date-range-picker" || t === "time-range-picker") {
7025
7022
  let t = Z(e, "range");
7026
7023
  return t ? fe(t.params).issues[0]?.message : void 0;
@@ -7030,20 +7027,20 @@ function Lc(e, t, n) {
7030
7027
  "datetime-picker",
7031
7028
  "time-picker"
7032
7029
  ].includes(t)) return;
7033
- let r = /* @__PURE__ */ new Date(), i = Rc(Z(e, "min"), n, r), a = Rc(Z(e, "max"), n, r), o = zc(i, t, n, "最早值") ?? zc(a, t, n, "最晚值");
7030
+ let r = /* @__PURE__ */ new Date(), i = Lc(Z(e, "min"), n, r), a = Lc(Z(e, "max"), n, r), o = Rc(i, t, n, "最早值") ?? Rc(a, t, n, "最晚值");
7034
7031
  if (o) return o;
7035
7032
  if (i !== void 0 && a !== void 0 && (ae(i, a) ?? 0) > 0) return "最早值不能晚于最晚值,请调整边界后再确认。";
7036
7033
  }
7037
- function Rc(e, t, n) {
7034
+ function Lc(e, t, n) {
7038
7035
  if (e) return e.value_expr ? le(e.value_expr, {
7039
7036
  field: t,
7040
7037
  now: n
7041
7038
  }) : e.value;
7042
7039
  }
7043
- function zc(e, t, n, r) {
7040
+ function Rc(e, t, n, r) {
7044
7041
  if (!(e === void 0 || n?.type === "string")) return t === "time-picker" ? de(e) === void 0 ? `${r}应使用 HH:mm 或 HH:mm:ss。` : void 0 : ue(e) === void 0 ? `${r}应使用 YYYY-MM-DD${t === "datetime-picker" ? " HH:mm:ss" : ""}。` : void 0;
7045
7042
  }
7046
- function Bc(e, t) {
7043
+ function zc(e, t) {
7047
7044
  if (t) return new Set(t);
7048
7045
  switch (e) {
7049
7046
  case "password": return new Set(["required", "complexity"]);
@@ -7083,14 +7080,14 @@ function Bc(e, t) {
7083
7080
  ]);
7084
7081
  }
7085
7082
  }
7086
- function Vc(e) {
7083
+ function Bc(e) {
7087
7084
  return e.map((e) => ({
7088
7085
  ...e,
7089
- when: e.when ? Zc(e.when) : void 0,
7086
+ when: e.when ? Xc(e.when) : void 0,
7090
7087
  params: e.params ? { ...e.params } : void 0
7091
7088
  }));
7092
7089
  }
7093
- var Hc = [
7090
+ var Vc = [
7094
7091
  {
7095
7092
  label: "等于",
7096
7093
  value: "eq"
@@ -7124,16 +7121,16 @@ var Hc = [
7124
7121
  value: "not_empty"
7125
7122
  }
7126
7123
  ];
7127
- function Uc(e) {
7128
- return e ? e.when ? e.when.field === "action" && e.when.op === "eq" && e.when.value === "create" ? "create" : e.when.field === "action" && e.when.op === "eq" && e.when.value === "update" ? "update" : qc(e.when) ? "condition" : "advanced" : "always" : "none";
7124
+ function Hc(e) {
7125
+ return e ? e.when ? e.when.field === "action" && e.when.op === "eq" && e.when.value === "create" ? "create" : e.when.field === "action" && e.when.op === "eq" && e.when.value === "update" ? "update" : Kc(e.when) ? "condition" : "advanced" : "always" : "none";
7129
7126
  }
7130
- function Wc(e, t, n) {
7127
+ function Uc(e, t, n) {
7131
7128
  if (t === "always") {
7132
- jc(e, { type: "required" });
7129
+ Ac(e, { type: "required" });
7133
7130
  return;
7134
7131
  }
7135
7132
  if (t === "create" || t === "update") {
7136
- jc(e, {
7133
+ Ac(e, {
7137
7134
  type: "required",
7138
7135
  when: {
7139
7136
  field: "action",
@@ -7143,47 +7140,47 @@ function Wc(e, t, n) {
7143
7140
  });
7144
7141
  return;
7145
7142
  }
7146
- jc(e, {
7143
+ Ac(e, {
7147
7144
  type: "required",
7148
- when: Kc(Jc(n), "not_empty")
7145
+ when: Gc(qc(n), "not_empty")
7149
7146
  });
7150
7147
  }
7151
- function Gc(e, t) {
7152
- if (qc(e.when)) return e.when;
7153
- let n = Kc(Jc(t), "not_empty");
7148
+ function Wc(e, t) {
7149
+ if (Kc(e.when)) return e.when;
7150
+ let n = Gc(qc(t), "not_empty");
7154
7151
  return e.when = n, n;
7155
7152
  }
7156
- function Kc(e, t, n) {
7153
+ function Gc(e, t, n) {
7157
7154
  let r = {
7158
7155
  field: e,
7159
7156
  op: t
7160
7157
  };
7161
7158
  return t !== "empty" && t !== "not_empty" && (r.value = n ?? ""), r;
7162
7159
  }
7163
- function qc(e) {
7160
+ function Kc(e) {
7164
7161
  return !e || e.all || e.any || e.not || e.expr || e.selection_empty !== void 0 ? !1 : typeof e.field == "string" && e.field.startsWith("form.");
7165
7162
  }
7166
- function Jc(e) {
7163
+ function qc(e) {
7167
7164
  return e[0]?.value ?? "";
7168
7165
  }
7169
- function Yc(e) {
7170
- return Hc.some((t) => t.value === e) ? e : "eq";
7166
+ function Jc(e) {
7167
+ return Vc.some((t) => t.value === e) ? e : "eq";
7171
7168
  }
7172
- function Xc(e) {
7169
+ function Yc(e) {
7173
7170
  let t = e.trim();
7174
7171
  return t === "true" ? !0 : t === "false" ? !1 : t !== "" && Number.isFinite(Number(t)) ? Number(t) : t;
7175
7172
  }
7176
- function Zc(e) {
7173
+ function Xc(e) {
7177
7174
  return {
7178
7175
  ...e,
7179
- all: e.all?.map(Zc),
7180
- any: e.any?.map(Zc),
7181
- not: e.not ? Zc(e.not) : void 0
7176
+ all: e.all?.map(Xc),
7177
+ any: e.any?.map(Xc),
7178
+ not: e.not ? Xc(e.not) : void 0
7182
7179
  };
7183
7180
  }
7184
7181
  //#endregion
7185
7182
  //#region src/inspector/option-source-editor.tsx
7186
- var Qc = [
7183
+ var Zc = [
7187
7184
  {
7188
7185
  label: "静态",
7189
7186
  value: "static"
@@ -7196,7 +7193,7 @@ var Qc = [
7196
7193
  label: "字典",
7197
7194
  value: "dictionary"
7198
7195
  }
7199
- ], $c = r({
7196
+ ], Qc = r({
7200
7197
  name: "OptionSourceEditor",
7201
7198
  props: {
7202
7199
  value: Object,
@@ -7204,13 +7201,13 @@ var Qc = [
7204
7201
  props: Object
7205
7202
  },
7206
7203
  setup(e) {
7207
- let t = f(!1), r = f({}), a = f([]), o = f([]), s = f([]), c = f(), l = f(), u = f(), d = f(!1), p = f(!1), h = f(!1), g = f(""), _ = f(""), v = f(""), y = se(), b = ja(), S = q(), C = ee({ "designer.static-options-list": { component: el } }), te = n(() => ({
7204
+ let t = f(!1), r = f({}), a = f([]), o = f([]), s = f([]), c = f(), l = f(), u = f(), d = f(!1), p = f(!1), h = f(!1), g = f(""), _ = f(""), v = f(""), y = se(), b = ja(), S = q(), C = ee({ "designer.static-options-list": { component: $c } }), te = n(() => ({
7208
7205
  node: e.props?.node,
7209
7206
  field: e.props?.field,
7210
7207
  fields: e.props?.fields ?? []
7211
- })), ne = n(() => Xn(e.value?.options)), re = n(() => e.props?.optionSources ?? []), w = n(() => re.value.includes("reference")), ie = n(() => re.value.includes("dictionary")), ae = n(() => ["select", "multi-select"].includes(e.props?.node?.component ?? "")), oe = n(() => ol(re.value, Q(r.value))), ce = n(() => tl(Q(r.value), oe.value, w.value, ae.value, r.value["options.value_policy_open"] === !0, bl(a.value, $(r.value, "reference.resource")), cl(r.value, o.value), bl(s.value, $(r.value, "options.dictionary.code"))));
7208
+ })), ne = n(() => Xn(e.value?.options)), re = n(() => e.props?.optionSources ?? []), w = n(() => re.value.includes("reference")), ie = n(() => re.value.includes("dictionary")), ae = n(() => ["select", "multi-select"].includes(e.props?.node?.component ?? "")), oe = n(() => al(re.value, Q(r.value))), ce = n(() => el(Q(r.value), oe.value, w.value, ae.value, r.value["options.value_policy_open"] === !0, yl(a.value, $(r.value, "reference.resource")), sl(r.value, o.value), yl(s.value, $(r.value, "options.dictionary.code"))));
7212
7209
  m(() => e.value, (e) => {
7213
- t.value || (r.value = rl(e));
7210
+ t.value || (r.value = nl(e));
7214
7211
  }, {
7215
7212
  immediate: !0,
7216
7213
  deep: !0
@@ -7218,20 +7215,20 @@ var Qc = [
7218
7215
  t.value && w.value && Q(r.value) === "reference" && pe(e);
7219
7216
  });
7220
7217
  function le() {
7221
- r.value = rl(e.value), t.value = !0, w.value && fe(), ie.value && me(), w.value && Q(r.value) === "reference" && pe($(r.value, "reference.resource"));
7218
+ r.value = nl(e.value), t.value = !0, w.value && fe(), ie.value && me(), w.value && Q(r.value) === "reference" && pe($(r.value, "reference.resource"));
7222
7219
  }
7223
7220
  function T() {
7224
7221
  he(), t.value = !1;
7225
7222
  }
7226
7223
  function ue() {
7227
- e.onChange?.(il(r.value, e.props?.field?.type)), T();
7224
+ e.onChange?.(rl(r.value, e.props?.field?.type)), T();
7228
7225
  }
7229
7226
  function de(e) {
7230
7227
  let t = Q(r.value), n = Q(e), i = {
7231
7228
  ...r.value,
7232
7229
  ...e
7233
7230
  };
7234
- t !== n && al(i, n), !xl(r.value, i) && (r.value = i);
7231
+ t !== n && il(i, n), !bl(r.value, i) && (r.value = i);
7235
7232
  }
7236
7233
  return () => /* @__PURE__ */ i("div", { class: "sparq-capability-editor sparq-option-source-editor" }, /* @__PURE__ */ i("div", { class: "sparq-capability-editor__summary" }, /* @__PURE__ */ i("span", null, ne.value), /* @__PURE__ */ i("div", { class: "sparq-capability-editor__actions" }, /* @__PURE__ */ i("button", {
7237
7234
  type: "button",
@@ -7329,14 +7326,14 @@ var Qc = [
7329
7326
  c.value?.abort(), l.value?.abort(), u.value?.abort();
7330
7327
  }
7331
7328
  }
7332
- }), el = r({
7329
+ }), $c = r({
7333
7330
  name: "StaticOptionsListEditor",
7334
7331
  props: {
7335
7332
  value: Array,
7336
7333
  onChange: Function
7337
7334
  },
7338
7335
  setup(e) {
7339
- let t = n(() => ll(e.value ?? [])), r = q();
7336
+ let t = n(() => cl(e.value ?? [])), r = q();
7340
7337
  function a(t) {
7341
7338
  e.onChange?.(t);
7342
7339
  }
@@ -7359,7 +7356,7 @@ var Qc = [
7359
7356
  placeholder: "显示文本",
7360
7357
  "aria-label": `第 ${n + 1} 项显示文本`,
7361
7358
  "onUpdate:modelValue"(e) {
7362
- fl(t.value, n, { label: e }, a);
7359
+ dl(t.value, n, { label: e }, a);
7363
7360
  }
7364
7361
  })), /* @__PURE__ */ i("div", {
7365
7362
  class: "sparq-static-options-row__field",
@@ -7369,7 +7366,7 @@ var Qc = [
7369
7366
  placeholder: "选项值",
7370
7367
  "aria-label": `第 ${n + 1} 项选项值`,
7371
7368
  "onUpdate:modelValue"(e) {
7372
- fl(t.value, n, { value: e }, a);
7369
+ dl(t.value, n, { value: e }, a);
7373
7370
  }
7374
7371
  })), /* @__PURE__ */ i("div", {
7375
7372
  class: "sparq-static-options-row__actions",
@@ -7378,32 +7375,32 @@ var Qc = [
7378
7375
  type: "button",
7379
7376
  disabled: n === 0,
7380
7377
  "aria-label": `上移第 ${n + 1} 项`,
7381
- onClick: () => ml(t.value, n, -1, a)
7378
+ onClick: () => pl(t.value, n, -1, a)
7382
7379
  }, "上移"), /* @__PURE__ */ i("button", {
7383
7380
  type: "button",
7384
7381
  disabled: n === t.value.length - 1,
7385
7382
  "aria-label": `下移第 ${n + 1} 项`,
7386
- onClick: () => ml(t.value, n, 1, a)
7383
+ onClick: () => pl(t.value, n, 1, a)
7387
7384
  }, "下移"), /* @__PURE__ */ i("button", {
7388
7385
  type: "button",
7389
7386
  "aria-label": `删除第 ${n + 1} 项`,
7390
- onClick: () => pl(t.value, n, a)
7387
+ onClick: () => fl(t.value, n, a)
7391
7388
  }, "删除"))))), t.value.length ? void 0 : /* @__PURE__ */ i("p", { class: "sparq-option-source-empty" }, "暂无选项。"), /* @__PURE__ */ i("div", { class: "sparq-option-source-toolbar" }, /* @__PURE__ */ i("button", {
7392
7389
  type: "button",
7393
- onClick: () => a([...t.value, dl(t.value.length + 1)])
7390
+ onClick: () => a([...t.value, ul(t.value.length + 1)])
7394
7391
  }, "新增选项"), /* @__PURE__ */ i("button", {
7395
7392
  type: "button",
7396
7393
  onClick: () => a([])
7397
7394
  }, "清空")));
7398
7395
  }
7399
7396
  });
7400
- function tl(e, t, n, r, i, a, o, s) {
7401
- let c = [nl("options.mode", "来源", t)], l = [{
7397
+ function el(e, t, n, r, i, a, o, s) {
7398
+ let c = [tl("options.mode", "来源", t)], l = [{
7402
7399
  type: "field",
7403
7400
  field: "options.mode",
7404
7401
  component: "radio"
7405
7402
  }];
7406
- return e === "reference" && n ? (c.push(nl("reference.resource", "关联资源", a), nl("reference.value_field", "值字段", o), nl("reference.label_field", "标题字段", o), nl("options.reference.search_field", "搜索字段", o), nl("options.reference.parent_field", "父级字段", o), nl("options.reference.load_mode", "加载模式", [
7403
+ return e === "reference" && n ? (c.push(tl("reference.resource", "关联资源", a), tl("reference.value_field", "值字段", o), tl("reference.label_field", "标题字段", o), tl("options.reference.search_field", "搜索字段", o), tl("options.reference.parent_field", "父级字段", o), tl("options.reference.load_mode", "加载模式", [
7407
7404
  {
7408
7405
  label: "分页",
7409
7406
  value: "paged"
@@ -7461,7 +7458,7 @@ function tl(e, t, n, r, i, a, o, s) {
7461
7458
  field: "options.reference.limit",
7462
7459
  component: "number",
7463
7460
  span: 12
7464
- })) : e === "dictionary" ? (c.push(nl("options.dictionary.code", "字典", s)), l.push({
7461
+ })) : e === "dictionary" ? (c.push(tl("options.dictionary.code", "字典", s)), l.push({
7465
7462
  type: "field",
7466
7463
  field: "options.dictionary.code",
7467
7464
  component: "select",
@@ -7500,7 +7497,7 @@ function tl(e, t, n, r, i, a, o, s) {
7500
7497
  } } }
7501
7498
  } };
7502
7499
  }
7503
- function nl(e, t, n) {
7500
+ function tl(e, t, n) {
7504
7501
  return {
7505
7502
  name: e,
7506
7503
  label: t,
@@ -7517,12 +7514,12 @@ function nl(e, t, n) {
7517
7514
  }
7518
7515
  };
7519
7516
  }
7520
- function rl(e) {
7517
+ function nl(e) {
7521
7518
  let t = e?.options;
7522
7519
  return t ? {
7523
7520
  "options.mode": t.mode,
7524
7521
  "options.value_policy_open": t.value_policy === "open",
7525
- "options.items": ll(t.items ?? []),
7522
+ "options.items": cl(t.items ?? []),
7526
7523
  "reference.resource": e?.reference?.resource ?? "",
7527
7524
  "reference.value_field": e?.reference?.value_field ?? "id",
7528
7525
  "reference.label_field": e?.reference?.label_field ?? "title",
@@ -7538,7 +7535,7 @@ function rl(e) {
7538
7535
  "options.items": []
7539
7536
  };
7540
7537
  }
7541
- function il(e, t) {
7538
+ function rl(e, t) {
7542
7539
  let n = Q(e);
7543
7540
  if (n === "reference") return {
7544
7541
  reference: {
@@ -7548,35 +7545,35 @@ function il(e, t) {
7548
7545
  },
7549
7546
  options: {
7550
7547
  mode: "reference",
7551
- value_policy: sl(e),
7548
+ value_policy: ol(e),
7552
7549
  reference: {
7553
7550
  search_field: $(e, "options.reference.search_field") || "title",
7554
7551
  parent_field: $(e, "options.reference.parent_field") || void 0,
7555
- load_mode: vl(e["options.reference.load_mode"]),
7556
- limit: yl(e["options.reference.limit"])
7552
+ load_mode: _l(e["options.reference.load_mode"]),
7553
+ limit: vl(e["options.reference.limit"])
7557
7554
  }
7558
7555
  }
7559
7556
  };
7560
7557
  if (n === "dictionary") return { options: {
7561
7558
  mode: "dictionary",
7562
- value_policy: sl(e),
7559
+ value_policy: ol(e),
7563
7560
  dictionary: { code: $(e, "options.dictionary.code") }
7564
7561
  } };
7565
7562
  if (n === "remote") {
7566
7563
  let t = e["options.remote"];
7567
7564
  return { options: {
7568
7565
  mode: "remote",
7569
- value_policy: sl(e),
7570
- remote: Sl(t) ? t : void 0
7566
+ value_policy: ol(e),
7567
+ remote: xl(t) ? t : void 0
7571
7568
  } };
7572
7569
  }
7573
7570
  return { options: {
7574
7571
  mode: "static",
7575
- value_policy: sl(e),
7576
- items: ul(Array.isArray(e["options.items"]) ? e["options.items"] : [], t)
7572
+ value_policy: ol(e),
7573
+ items: ll(Array.isArray(e["options.items"]) ? e["options.items"] : [], t)
7577
7574
  } };
7578
7575
  }
7579
- function al(e, t) {
7576
+ function il(e, t) {
7580
7577
  if (e["options.mode"] = t, t === "static") {
7581
7578
  e["options.items"] = Array.isArray(e["options.items"]) ? e["options.items"] : [];
7582
7579
  return;
@@ -7591,15 +7588,15 @@ function Q(e) {
7591
7588
  let t = e["options.mode"];
7592
7589
  return t === "reference" || t === "dictionary" || t === "remote" ? t : "static";
7593
7590
  }
7594
- function ol(e, t) {
7595
- let n = Qc.filter((t) => e.includes(t.value));
7591
+ function al(e, t) {
7592
+ let n = Zc.filter((t) => e.includes(t.value));
7596
7593
  if (t === "remote") return [...n, {
7597
7594
  label: "远程(只读保留)",
7598
7595
  value: "remote",
7599
7596
  disabled: !0
7600
7597
  }];
7601
7598
  if (!e.includes(t)) {
7602
- let e = Qc.find((e) => e.value === t)?.label ?? t;
7599
+ let e = Zc.find((e) => e.value === t)?.label ?? t;
7603
7600
  return [...n, {
7604
7601
  label: `${e}(当前组件不支持)`,
7605
7602
  value: t,
@@ -7612,90 +7609,90 @@ function $(e, t) {
7612
7609
  let n = e[t];
7613
7610
  return typeof n == "string" ? n : "";
7614
7611
  }
7615
- function sl(e) {
7612
+ function ol(e) {
7616
7613
  return e["options.value_policy_open"] === !0 ? "open" : "closed";
7617
7614
  }
7618
- function cl(e, t) {
7619
- return bl(bl(bl(bl(t, $(e, "reference.value_field")), $(e, "reference.label_field")), $(e, "options.reference.search_field")), $(e, "options.reference.parent_field"));
7615
+ function sl(e, t) {
7616
+ return yl(yl(yl(yl(t, $(e, "reference.value_field")), $(e, "reference.label_field")), $(e, "options.reference.search_field")), $(e, "options.reference.parent_field"));
7620
7617
  }
7621
- function ll(e) {
7618
+ function cl(e) {
7622
7619
  return e.map((e, t) => ({
7623
7620
  label: typeof e.label == "string" ? e.label : `选项${t + 1}`,
7624
- value: hl(e.value, t + 1)
7621
+ value: ml(e.value, t + 1)
7625
7622
  }));
7626
7623
  }
7627
- function ul(e, t) {
7624
+ function ll(e, t) {
7628
7625
  return e.map((e, n) => {
7629
- let r = typeof e.label == "string" ? e.label.trim() : "", i = gl(e.value, n + 1, t);
7626
+ let r = typeof e.label == "string" ? e.label.trim() : "", i = hl(e.value, n + 1, t);
7630
7627
  return {
7631
7628
  label: r || String(i),
7632
7629
  value: i
7633
7630
  };
7634
7631
  }).filter((e) => e.label !== "" && e.value !== "");
7635
7632
  }
7636
- function dl(e) {
7633
+ function ul(e) {
7637
7634
  return {
7638
7635
  label: `选项${e}`,
7639
7636
  value: `option_${e}`
7640
7637
  };
7641
7638
  }
7642
- function fl(e, t, n, r) {
7643
- let i = ll(e), a = i[t];
7639
+ function dl(e, t, n, r) {
7640
+ let i = cl(e), a = i[t];
7644
7641
  a && (i[t] = {
7645
7642
  ...a,
7646
- ..._l(n)
7647
- }, !Cl(a, i[t]) && r(i));
7643
+ ...gl(n)
7644
+ }, !Sl(a, i[t]) && r(i));
7648
7645
  }
7649
- function pl(e, t, n) {
7650
- let r = ll(e);
7646
+ function fl(e, t, n) {
7647
+ let r = cl(e);
7651
7648
  r.splice(t, 1), n(r);
7652
7649
  }
7653
- function ml(e, t, n, r) {
7654
- let i = ll(e), a = t + n;
7650
+ function pl(e, t, n, r) {
7651
+ let i = cl(e), a = t + n;
7655
7652
  if (a < 0 || a >= i.length) return;
7656
7653
  let o = i[t], s = i[a];
7657
7654
  !o || !s || (i[t] = s, i[a] = o, r(i));
7658
7655
  }
7659
- function hl(e, t) {
7656
+ function ml(e, t) {
7660
7657
  return typeof e == "string" ? e.trim() || `option_${t}` : typeof e == "number" || typeof e == "boolean" ? e : `option_${t}`;
7661
7658
  }
7662
- function gl(e, t, n) {
7663
- let r = hl(e, t);
7659
+ function hl(e, t, n) {
7660
+ let r = ml(e, t);
7664
7661
  if (n === "number" && typeof r == "string") {
7665
7662
  let e = Number(r);
7666
7663
  return r !== "" && Number.isFinite(e) ? e : r;
7667
7664
  }
7668
7665
  return n === "string" && typeof r != "string" ? String(r) : r;
7669
7666
  }
7670
- function _l(e) {
7667
+ function gl(e) {
7671
7668
  let t = {};
7672
7669
  return typeof e.label == "string" && (t.label = e.label), (typeof e.value == "string" || typeof e.value == "number" || typeof e.value == "boolean") && (t.value = e.value), t;
7673
7670
  }
7674
- function vl(e) {
7671
+ function _l(e) {
7675
7672
  return e === "tree" || e === "all" ? e : "paged";
7676
7673
  }
7677
- function yl(e) {
7674
+ function vl(e) {
7678
7675
  let t = typeof e == "number" ? e : Number(e);
7679
7676
  return Number.isFinite(t) && t > 0 ? t : void 0;
7680
7677
  }
7681
- function bl(e, t) {
7678
+ function yl(e, t) {
7682
7679
  return !t || e.some((e) => e.value === t) ? e : [...e, {
7683
7680
  label: t,
7684
7681
  value: t
7685
7682
  }];
7686
7683
  }
7687
- function xl(e, t) {
7684
+ function bl(e, t) {
7688
7685
  return JSON.stringify(e) === JSON.stringify(t);
7689
7686
  }
7690
- function Sl(e) {
7687
+ function xl(e) {
7691
7688
  return typeof e == "object" && !!e && !Array.isArray(e);
7692
7689
  }
7693
- function Cl(e, t) {
7690
+ function Sl(e, t) {
7694
7691
  return e.label === t.label && e.value === t.value;
7695
7692
  }
7696
7693
  //#endregion
7697
7694
  //#region src/inspector/computed-expression-editor.tsx
7698
- var wl = r({
7695
+ var Cl = r({
7699
7696
  name: "ComputedExpressionEditor",
7700
7697
  props: {
7701
7698
  expression: Object,
@@ -7704,10 +7701,10 @@ var wl = r({
7704
7701
  onChange: Function
7705
7702
  },
7706
7703
  setup(e) {
7707
- let t = J(), r = n(() => (e.fields ?? []).filter((t) => t.name !== e.targetField?.name)), a = n(() => El(e.expression)), o = n(() => Dl(e.targetField).some((t) => t.value === e.expression?.type));
7704
+ let t = J(), r = n(() => (e.fields ?? []).filter((t) => t.name !== e.targetField?.name)), a = n(() => Tl(e.expression)), o = n(() => El(e.targetField).some((t) => t.value === e.expression?.type));
7708
7705
  function s(t) {
7709
7706
  let n = t;
7710
- e.onChange?.(Ol(n, r.value, e.targetField));
7707
+ e.onChange?.(Dl(n, r.value, e.targetField));
7711
7708
  }
7712
7709
  function c(t) {
7713
7710
  let n = typeof t == "string" ? t : "";
@@ -7720,7 +7717,7 @@ var wl = r({
7720
7717
  });
7721
7718
  }
7722
7719
  function l(t, n) {
7723
- let i = new Set(kl(a.value, r.value).map((e) => e.name)), o = Al(e.expression).filter((e) => i.has(e)), s = n ? [...new Set([...o, t])] : o.filter((e) => e !== t);
7720
+ let i = new Set(Ol(a.value, r.value).map((e) => e.name)), o = kl(e.expression).filter((e) => i.has(e)), s = n ? [...new Set([...o, t])] : o.filter((e) => e !== t);
7724
7721
  if (a.value === "sum") {
7725
7722
  e.onChange?.({
7726
7723
  expression: {
@@ -7744,7 +7741,7 @@ var wl = r({
7744
7741
  });
7745
7742
  }
7746
7743
  function u(t) {
7747
- let n = Al(e.expression);
7744
+ let n = kl(e.expression);
7748
7745
  e.onChange?.({
7749
7746
  expression: {
7750
7747
  type: "concat",
@@ -7764,7 +7761,7 @@ var wl = r({
7764
7761
  type: "template",
7765
7762
  template: n
7766
7763
  },
7767
- triggers: jl(n, r.value)
7764
+ triggers: Al(n, r.value)
7768
7765
  });
7769
7766
  }
7770
7767
  return () => /* @__PURE__ */ i("section", {
@@ -7779,7 +7776,7 @@ var wl = r({
7779
7776
  label: `${a.value}(只读保留)`,
7780
7777
  value: a.value,
7781
7778
  disabled: !0
7782
- }), ...Dl(e.targetField).map((e) => t.option(e))] })), o.value ? void 0 : /* @__PURE__ */ i("p", {
7779
+ }), ...El(e.targetField).map((e) => t.option(e))] })), o.value ? void 0 : /* @__PURE__ */ i("p", {
7783
7780
  class: "sparq-computed-expression-editor__notice",
7784
7781
  role: "status"
7785
7782
  }, "当前表达式暂不支持可视化编辑。选择新的计算方式后会替换原表达式。"), a.value === "field" && o.value ? /* @__PURE__ */ i("label", { class: "sparq-computed-expression-editor__field" }, /* @__PURE__ */ i("span", null, "来源字段"), t.select({
@@ -7792,8 +7789,8 @@ var wl = r({
7792
7789
  }, { default: () => r.value.map((e) => t.option({
7793
7790
  label: e.label || e.name,
7794
7791
  value: e.name
7795
- })) })) : void 0, (a.value === "sum" || a.value === "concat") && o.value ? /* @__PURE__ */ i("fieldset", { class: "sparq-computed-expression-editor__fields" }, /* @__PURE__ */ i("legend", null, a.value === "sum" ? "参与求和的字段" : "参与拼接的字段"), kl(a.value, r.value).length > 0 ? kl(a.value, r.value).map((n) => t.checkbox({
7796
- modelValue: Al(e.expression).includes(n.name),
7792
+ })) })) : void 0, (a.value === "sum" || a.value === "concat") && o.value ? /* @__PURE__ */ i("fieldset", { class: "sparq-computed-expression-editor__fields" }, /* @__PURE__ */ i("legend", null, a.value === "sum" ? "参与求和的字段" : "参与拼接的字段"), Ol(a.value, r.value).length > 0 ? Ol(a.value, r.value).map((n) => t.checkbox({
7793
+ modelValue: kl(e.expression).includes(n.name),
7797
7794
  "aria-label": n.label || n.name,
7798
7795
  "onUpdate:modelValue": (e) => l(n.name, e === !0)
7799
7796
  }, { default: () => n.label || n.name })) : /* @__PURE__ */ i("p", { class: "sparq-computed-expression-editor__empty" }, "没有可用字段")) : void 0, a.value === "concat" && o.value ? /* @__PURE__ */ i("label", { class: "sparq-computed-expression-editor__field" }, /* @__PURE__ */ i("span", null, "分隔符"), t.text({
@@ -7811,14 +7808,14 @@ var wl = r({
7811
7808
  })) : void 0);
7812
7809
  }
7813
7810
  });
7814
- function Tl(e, t) {
7811
+ function wl(e, t) {
7815
7812
  let n = (e ?? []).filter((e) => e.name !== t?.name);
7816
- return Ol(t?.type === "number" ? "sum" : "field", n, t);
7813
+ return Dl(t?.type === "number" ? "sum" : "field", n, t);
7817
7814
  }
7818
- function El(e) {
7815
+ function Tl(e) {
7819
7816
  return typeof e?.type == "string" ? e.type : "field";
7820
7817
  }
7821
- function Dl(e) {
7818
+ function El(e) {
7822
7819
  return e?.type === "number" ? [{
7823
7820
  label: "引用字段",
7824
7821
  value: "field"
@@ -7840,7 +7837,7 @@ function Dl(e) {
7840
7837
  }
7841
7838
  ];
7842
7839
  }
7843
- function Ol(e, t, n) {
7840
+ function Dl(e, t, n) {
7844
7841
  if (e === "sum") {
7845
7842
  let n = t.filter((e) => e.type === "number").slice(0, 2).map((e) => e.name);
7846
7843
  return {
@@ -7881,25 +7878,25 @@ function Ol(e, t, n) {
7881
7878
  triggers: r ? [r] : []
7882
7879
  };
7883
7880
  }
7884
- function kl(e, t) {
7881
+ function Ol(e, t) {
7885
7882
  return e === "sum" ? t.filter((e) => e.type === "number") : t;
7886
7883
  }
7887
- function Al(e) {
7884
+ function kl(e) {
7888
7885
  return e?.type === "sum" ? e.fields ?? [] : e?.type === "concat" ? (e.items ?? []).filter((e) => e.type === "field" && typeof e.field == "string").map((e) => e.field) : e?.type === "field" && e.field ? [e.field] : [];
7889
7886
  }
7890
- function jl(e, t) {
7887
+ function Al(e, t) {
7891
7888
  let n = new Set(t.map((e) => e.name));
7892
7889
  return [...new Set([...e.matchAll(/\$\{form\.([a-z][a-z0-9_]*)\}/g)].map((e) => e[1]).filter((e) => !!(e && n.has(e))))];
7893
7890
  }
7894
7891
  //#endregion
7895
7892
  //#region src/inspector/value-strategy-editor.tsx
7896
- var Ml = [{
7893
+ var jl = [{
7897
7894
  label: "动态默认值",
7898
7895
  value: "dynamic"
7899
7896
  }, {
7900
7897
  label: "计算表达式",
7901
7898
  value: "computed"
7902
- }], Nl = [
7899
+ }], Ml = [
7903
7900
  {
7904
7901
  label: "当前时间",
7905
7902
  value: "now"
@@ -7924,7 +7921,7 @@ var Ml = [{
7924
7921
  label: "本月结束",
7925
7922
  value: "end_of_month"
7926
7923
  }
7927
- ], Pl = [
7924
+ ], Nl = [
7928
7925
  {
7929
7926
  label: "自动",
7930
7927
  value: ""
@@ -7945,7 +7942,7 @@ var Ml = [{
7945
7942
  label: "时间戳",
7946
7943
  value: "timestamp"
7947
7944
  }
7948
- ], Fl = r({
7945
+ ], Pl = r({
7949
7946
  name: "ValueStrategyEditor",
7950
7947
  props: {
7951
7948
  value: Object,
@@ -7953,38 +7950,38 @@ var Ml = [{
7953
7950
  props: Object
7954
7951
  },
7955
7952
  setup(e) {
7956
- let t = f(!1), r = f({}), a = se(), o = ja(), s = q(), c = n(() => e.props?.valueStrategies ?? Ml.map((e) => e.value)), l = n(() => zl(e.value)), u = n(() => Zl(l.value) !== void 0), d = n(() => Ql(l.value)), p = n(() => {
7957
- let e = Xl(r.value) ?? c.value[0];
7958
- return Il(e, Rl(c.value, e), e !== void 0 && c.value.includes(e));
7953
+ let t = f(!1), r = f({}), a = se(), o = ja(), s = q(), c = n(() => e.props?.valueStrategies ?? jl.map((e) => e.value)), l = n(() => Rl(e.value)), u = n(() => Xl(l.value) !== void 0), d = n(() => Zl(l.value)), p = n(() => {
7954
+ let e = Yl(r.value) ?? c.value[0];
7955
+ return Fl(e, Ll(c.value, e), e !== void 0 && c.value.includes(e));
7959
7956
  });
7960
7957
  m(() => e.value, (e) => {
7961
- t.value || (r.value = Bl(zl(e)));
7958
+ t.value || (r.value = zl(Rl(e)));
7962
7959
  }, {
7963
7960
  immediate: !0,
7964
7961
  deep: !0
7965
7962
  });
7966
7963
  function h() {
7967
- r.value = Bl(l.value), !Xl(r.value) && c.value[0] && Yl(r.value, c.value[0], e.props?.fields, e.props?.field), t.value = !0;
7964
+ r.value = zl(l.value), !Yl(r.value) && c.value[0] && Jl(r.value, c.value[0], e.props?.fields, e.props?.field), t.value = !0;
7968
7965
  }
7969
7966
  function g() {
7970
7967
  t.value = !1;
7971
7968
  }
7972
7969
  function _(t) {
7973
- let n = Xl(r.value), i = Xl(t), a = {
7970
+ let n = Yl(r.value), i = Yl(t), a = {
7974
7971
  ...r.value,
7975
7972
  ...t
7976
7973
  };
7977
- n !== i && i && Yl(a, i, e.props?.fields, e.props?.field), !tu(r.value, a) && (r.value = a);
7974
+ n !== i && i && Jl(a, i, e.props?.fields, e.props?.field), !eu(r.value, a) && (r.value = a);
7978
7975
  }
7979
7976
  function v() {
7980
- let t = Xl(r.value);
7981
- !t || !c.value.includes(t) || (e.onChange?.(Vl(r.value)), g());
7977
+ let t = Yl(r.value);
7978
+ !t || !c.value.includes(t) || (e.onChange?.(Bl(r.value)), g());
7982
7979
  }
7983
7980
  function y() {
7984
7981
  e.onChange?.({}), g();
7985
7982
  }
7986
7983
  function b() {
7987
- let e = Xl(r.value);
7984
+ let e = Yl(r.value);
7988
7985
  return e !== void 0 && c.value.includes(e);
7989
7986
  }
7990
7987
  function S(e) {
@@ -8024,8 +8021,8 @@ var Ml = [{
8024
8021
  uiAdapter: o,
8025
8022
  uiKit: s,
8026
8023
  "onUpdate:modelValue": _
8027
- }), Xl(r.value) === "computed" && c.value.includes("computed") ? /* @__PURE__ */ i(wl, {
8028
- expression: Ul(r.value.computed_expr),
8024
+ }), Yl(r.value) === "computed" && c.value.includes("computed") ? /* @__PURE__ */ i(Cl, {
8025
+ expression: Hl(r.value.computed_expr),
8029
8026
  fields: e.props?.fields ?? [],
8030
8027
  targetField: e.props?.field,
8031
8028
  onChange: S
@@ -8040,8 +8037,8 @@ var Ml = [{
8040
8037
  }, "确认")))) : void 0);
8041
8038
  }
8042
8039
  });
8043
- function Il(e, t, n) {
8044
- let r = [Ll("mode", "取值方式", t), {
8040
+ function Fl(e, t, n) {
8041
+ let r = [Il("mode", "取值方式", t), {
8045
8042
  name: "persisted",
8046
8043
  label: "写入后端",
8047
8044
  type: "boolean",
@@ -8056,7 +8053,7 @@ function Il(e, t, n) {
8056
8053
  component: "switch",
8057
8054
  span: 12
8058
8055
  }];
8059
- return e === "dynamic" && n && (r.push(Ll("default_expr.type", "表达式", Nl), Ll("default_expr.format", "输出格式", Pl), {
8056
+ return e === "dynamic" && n && (r.push(Il("default_expr.type", "表达式", Ml), Il("default_expr.format", "输出格式", Nl), {
8060
8057
  name: "default_expr.offset.years",
8061
8058
  label: "年偏移",
8062
8059
  type: "number",
@@ -8138,7 +8135,7 @@ function Il(e, t, n) {
8138
8135
  } } }
8139
8136
  } };
8140
8137
  }
8141
- function Ll(e, t, n) {
8138
+ function Il(e, t, n) {
8142
8139
  return {
8143
8140
  name: e,
8144
8141
  label: t,
@@ -8151,17 +8148,17 @@ function Ll(e, t, n) {
8151
8148
  }
8152
8149
  };
8153
8150
  }
8154
- function Rl(e, t) {
8155
- let n = Ml.filter((t) => e.includes(t.value));
8151
+ function Ll(e, t) {
8152
+ let n = jl.filter((t) => e.includes(t.value));
8156
8153
  if (!t || e.includes(t)) return n;
8157
- let r = Ml.find((e) => e.value === t)?.label ?? t;
8154
+ let r = jl.find((e) => e.value === t)?.label ?? t;
8158
8155
  return [...n, {
8159
8156
  label: `${r}(当前组件不支持)`,
8160
8157
  value: t,
8161
8158
  disabled: !0
8162
8159
  }];
8163
8160
  }
8164
- function zl(e) {
8161
+ function Rl(e) {
8165
8162
  return !e || typeof e != "object" ? { persisted: !0 } : e.mode === "dynamic" && e.default_expr ? {
8166
8163
  mode: "dynamic",
8167
8164
  default_expr: e.default_expr,
@@ -8173,8 +8170,8 @@ function zl(e) {
8173
8170
  persisted: e.persisted !== !1
8174
8171
  } : { persisted: e.persisted !== !1 };
8175
8172
  }
8176
- function Bl(e) {
8177
- let t = Zl(e);
8173
+ function zl(e) {
8174
+ let t = Xl(e);
8178
8175
  return t === "dynamic" ? {
8179
8176
  mode: t,
8180
8177
  persisted: e.persisted !== !1,
@@ -8196,83 +8193,83 @@ function Bl(e) {
8196
8193
  computed_triggers: e.computed_triggers ?? []
8197
8194
  } : { persisted: e.persisted !== !1 };
8198
8195
  }
8199
- function Vl(e) {
8196
+ function Bl(e) {
8200
8197
  let t = { persisted: e.persisted !== !1 };
8201
- return Xl(e) === "dynamic" ? {
8198
+ return Yl(e) === "dynamic" ? {
8202
8199
  ...t,
8203
8200
  mode: "dynamic",
8204
- default_expr: Hl(e)
8205
- } : Xl(e) === "computed" ? {
8201
+ default_expr: Vl(e)
8202
+ } : Yl(e) === "computed" ? {
8206
8203
  ...t,
8207
8204
  mode: "computed",
8208
- computed_expr: Ul(e.computed_expr),
8209
- computed_triggers: Jl(e.computed_triggers)
8205
+ computed_expr: Hl(e.computed_expr),
8206
+ computed_triggers: ql(e.computed_triggers)
8210
8207
  } : t;
8211
8208
  }
8212
- function Hl(e) {
8213
- let t = { type: Gl(e["default_expr.type"]) }, n = eu(e["default_expr.format"]), r = Kl(e);
8209
+ function Vl(e) {
8210
+ let t = { type: Wl(e["default_expr.type"]) }, n = $l(e["default_expr.format"]), r = Gl(e);
8214
8211
  return n && (t.format = n), Object.keys(r).length > 0 && (t.offset = r), t;
8215
8212
  }
8216
- function Ul(e) {
8217
- return Wl(e) ? e : {
8213
+ function Hl(e) {
8214
+ return Ul(e) ? e : {
8218
8215
  type: "literal",
8219
8216
  value: null
8220
8217
  };
8221
8218
  }
8222
- function Wl(e) {
8219
+ function Ul(e) {
8223
8220
  return typeof e == "object" && !!e && !Array.isArray(e) && typeof e.type == "string";
8224
8221
  }
8225
- function Gl(e) {
8226
- let t = eu(e);
8227
- return Nl.some((e) => e.value === t) ? t : "now";
8222
+ function Wl(e) {
8223
+ let t = $l(e);
8224
+ return Ml.some((e) => e.value === t) ? t : "now";
8228
8225
  }
8229
- function Kl(e) {
8226
+ function Gl(e) {
8230
8227
  return {
8231
- ...ql("years", e["default_expr.offset.years"]),
8232
- ...ql("months", e["default_expr.offset.months"]),
8233
- ...ql("weeks", e["default_expr.offset.weeks"]),
8234
- ...ql("days", e["default_expr.offset.days"]),
8235
- ...ql("hours", e["default_expr.offset.hours"]),
8236
- ...ql("minutes", e["default_expr.offset.minutes"])
8228
+ ...Kl("years", e["default_expr.offset.years"]),
8229
+ ...Kl("months", e["default_expr.offset.months"]),
8230
+ ...Kl("weeks", e["default_expr.offset.weeks"]),
8231
+ ...Kl("days", e["default_expr.offset.days"]),
8232
+ ...Kl("hours", e["default_expr.offset.hours"]),
8233
+ ...Kl("minutes", e["default_expr.offset.minutes"])
8237
8234
  };
8238
8235
  }
8239
- function ql(e, t) {
8236
+ function Kl(e, t) {
8240
8237
  let n = typeof t == "number" ? t : Number(t);
8241
8238
  return Number.isFinite(n) && n !== 0 ? { [e]: Math.trunc(n) } : {};
8242
8239
  }
8243
- function Jl(e) {
8240
+ function ql(e) {
8244
8241
  return Array.isArray(e) ? e.filter((e) => typeof e == "string" && e !== "") : typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : [];
8245
8242
  }
8246
- function Yl(e, t, n, r) {
8243
+ function Jl(e, t, n, r) {
8247
8244
  if (e.mode = t, t === "dynamic" && (e["default_expr.type"] ||= "now", e["default_expr.format"] ??= ""), t === "computed") {
8248
- let t = Tl(n, r);
8245
+ let t = wl(n, r);
8249
8246
  e.computed_expr ||= t.expression, e.computed_triggers ??= t.triggers;
8250
8247
  }
8251
8248
  e.persisted ??= !0;
8252
8249
  }
8253
- function Xl(e) {
8250
+ function Yl(e) {
8254
8251
  return e.mode === "dynamic" || e.mode === "computed" ? e.mode : void 0;
8255
8252
  }
8256
- function Zl(e) {
8253
+ function Xl(e) {
8257
8254
  return e.mode === "dynamic" || e.mode === "computed" ? e.mode : void 0;
8258
8255
  }
8259
- function Ql(e) {
8256
+ function Zl(e) {
8260
8257
  let t = e.persisted === !1 ? "不落库" : "落库";
8261
- return e.mode === "computed" ? `计算值 / ${t}` : e.mode === "dynamic" ? `动态默认值:${$l(e.default_expr)} / ${t}` : "未配置";
8258
+ return e.mode === "computed" ? `计算值 / ${t}` : e.mode === "dynamic" ? `动态默认值:${Ql(e.default_expr)} / ${t}` : "未配置";
8262
8259
  }
8263
- function $l(e) {
8264
- let t = Nl.find((t) => t.value === e?.type)?.label ?? e?.type ?? "当前时间", n = e?.format ? Pl.find((t) => t.value === e.format)?.label ?? e.format : "";
8260
+ function Ql(e) {
8261
+ let t = Ml.find((t) => t.value === e?.type)?.label ?? e?.type ?? "当前时间", n = e?.format ? Nl.find((t) => t.value === e.format)?.label ?? e.format : "";
8265
8262
  return n ? `${t} / ${n}` : t;
8266
8263
  }
8267
- function eu(e) {
8264
+ function $l(e) {
8268
8265
  return typeof e == "string" ? e : "";
8269
8266
  }
8270
- function tu(e, t) {
8267
+ function eu(e, t) {
8271
8268
  return JSON.stringify(e) === JSON.stringify(t);
8272
8269
  }
8273
8270
  //#endregion
8274
8271
  //#region src/inspector/condition-visual-editor.tsx
8275
- var nu = 1, ru = r({
8272
+ var tu = 1, nu = r({
8276
8273
  name: "ConditionVisualEditor",
8277
8274
  props: {
8278
8275
  values: {
@@ -8294,106 +8291,106 @@ var nu = 1, ru = r({
8294
8291
  }, r = (e) => {
8295
8292
  n({ root: e });
8296
8293
  }, a = (t, n) => {
8297
- r(du(e.values.root, t, (e) => ({
8294
+ r(uu(e.values.root, t, (e) => ({
8298
8295
  ...e,
8299
8296
  ...n
8300
8297
  })));
8301
8298
  }, o = (t, n) => {
8302
- r(fu(e.values.root, t, n));
8299
+ r(du(e.values.root, t, n));
8303
8300
  }, s = (t) => {
8304
- r(pu(e.values.root, t, sn()));
8301
+ r(fu(e.values.root, t, sn()));
8305
8302
  }, c = (t) => {
8306
- r(pu(e.values.root, t, cn()));
8303
+ r(fu(e.values.root, t, cn()));
8307
8304
  }, l = (t) => {
8308
- r(mu(e.values.root, t));
8305
+ r(pu(e.values.root, t));
8309
8306
  };
8310
- return () => /* @__PURE__ */ i("div", { class: "sparq-designer-condition-editor" }, e.values.mode === "json" ? iu(t, e.values, n) : /* @__PURE__ */ i("div", { class: "sparq-designer-condition-visual" }, /* @__PURE__ */ i("div", { class: "sparq-designer-condition-visual__toolbar" }, uu(t, "高级 JSON", () => n({
8307
+ return () => /* @__PURE__ */ i("div", { class: "sparq-designer-condition-editor" }, e.values.mode === "json" ? ru(t, e.values, n) : /* @__PURE__ */ i("div", { class: "sparq-designer-condition-visual" }, /* @__PURE__ */ i("div", { class: "sparq-designer-condition-visual__toolbar" }, lu(t, "高级 JSON", () => n({
8311
8308
  mode: "json",
8312
8309
  json: JSON.stringify(on(e.values), void 0, 2)
8313
- }), { size: "small" })), au(t, e.values.root, e.fields, [], 0, a, o, s, c, l)));
8310
+ }), { size: "small" })), iu(t, e.values.root, e.fields, [], 0, a, o, s, c, l)));
8314
8311
  }
8315
8312
  });
8316
- function iu(e, t, n) {
8313
+ function ru(e, t, n) {
8317
8314
  return e.form({
8318
8315
  labelPosition: "left",
8319
8316
  labelWidth: "76px",
8320
8317
  size: "small",
8321
8318
  showMessage: !1,
8322
8319
  class: "sparq-designer-condition-editor-form"
8323
- }, { default: () => [cu(e, "条件 JSON", e.textarea({
8320
+ }, { default: () => [su(e, "条件 JSON", e.textarea({
8324
8321
  value: t.json,
8325
8322
  rows: 12,
8326
8323
  placeholder: "{\"all\":[{\"field\":\"form.status\",\"op\":\"eq\",\"value\":\"published\"}]}",
8327
8324
  onChange: (e) => n({ json: e })
8328
- })), cu(e, "", uu(e, "转为可视化", () => n(an(on(t))), { size: "small" }))] });
8325
+ })), su(e, "", lu(e, "转为可视化", () => n(an(on(t))), { size: "small" }))] });
8329
8326
  }
8330
- function au(e, t, n, r, a, o, s, c, l, u) {
8327
+ function iu(e, t, n, r, a, o, s, c, l, u) {
8331
8328
  let d = r.length === 0;
8332
8329
  return /* @__PURE__ */ i("div", {
8333
8330
  class: ["sparq-designer-condition-group", d ? "is-root" : void 0],
8334
8331
  key: r.join("-") || "root"
8335
- }, /* @__PURE__ */ i("div", { class: "sparq-designer-condition-group__head" }, /* @__PURE__ */ i("strong", null, d ? "根条件组" : "子条件组"), /* @__PURE__ */ i("div", { class: "sparq-designer-condition-group__logic" }, lu(e, t.logic, [{
8332
+ }, /* @__PURE__ */ i("div", { class: "sparq-designer-condition-group__head" }, /* @__PURE__ */ i("strong", null, d ? "根条件组" : "子条件组"), /* @__PURE__ */ i("div", { class: "sparq-designer-condition-group__logic" }, cu(e, t.logic, [{
8336
8333
  label: "AND 全部满足",
8337
8334
  value: "all"
8338
8335
  }, {
8339
8336
  label: "OR 任一满足",
8340
8337
  value: "any"
8341
- }], (e) => o(r, { logic: e === "any" ? "any" : "all" }), { size: "small" })), d ? void 0 : uu(e, "删除", () => u(r), { size: "small" })), /* @__PURE__ */ i("div", { class: "sparq-designer-condition-group__items" }, t.items.map((t, i) => {
8338
+ }], (e) => o(r, { logic: e === "any" ? "any" : "all" }), { size: "small" })), d ? void 0 : lu(e, "删除", () => u(r), { size: "small" })), /* @__PURE__ */ i("div", { class: "sparq-designer-condition-group__items" }, t.items.map((t, i) => {
8342
8339
  let d = [...r, i];
8343
- return t.kind === "group" ? au(e, t, n, d, a + 1, o, s, c, l, u) : ou(e, t, n, d, s, u);
8344
- })), /* @__PURE__ */ i("div", { class: "sparq-designer-condition-group__actions" }, uu(e, "添加条件", () => c(r), {
8340
+ return t.kind === "group" ? iu(e, t, n, d, a + 1, o, s, c, l, u) : au(e, t, n, d, s, u);
8341
+ })), /* @__PURE__ */ i("div", { class: "sparq-designer-condition-group__actions" }, lu(e, "添加条件", () => c(r), {
8345
8342
  type: "primary",
8346
8343
  size: "small"
8347
- }), a < nu ? uu(e, "添加分组", () => l(r), { size: "small" }) : void 0));
8344
+ }), a < tu ? lu(e, "添加分组", () => l(r), { size: "small" }) : void 0));
8348
8345
  }
8349
- function ou(e, t, n, r, a, o) {
8346
+ function au(e, t, n, r, a, o) {
8350
8347
  let s = ln(n, t.field);
8351
8348
  return /* @__PURE__ */ i("div", {
8352
8349
  class: "sparq-designer-condition-rule",
8353
8350
  key: r.join("-")
8354
- }, lu(e, t.field, s, (e) => a(r, { field: e }), {
8351
+ }, cu(e, t.field, s, (e) => a(r, { field: e }), {
8355
8352
  placeholder: "选择字段",
8356
8353
  filterable: !0,
8357
8354
  size: "small"
8358
- }), lu(e, t.op, nn, (e) => a(r, { op: e }), {
8355
+ }), cu(e, t.op, nn, (e) => a(r, { op: e }), {
8359
8356
  placeholder: "操作符",
8360
8357
  size: "small"
8361
8358
  }), t.op !== "empty" && t.op !== "not_empty" ? e.text({
8362
8359
  value: t.value,
8363
- placeholder: su(t),
8360
+ placeholder: ou(t),
8364
8361
  class: "sparq-designer-condition-rule__value",
8365
8362
  size: "small",
8366
8363
  onChange: (e) => a(r, { value: e })
8367
- }) : /* @__PURE__ */ i("div", { class: "sparq-designer-condition-rule__value-placeholder" }, "无需比较值"), uu(e, "删除", () => o(r), { size: "small" }));
8364
+ }) : /* @__PURE__ */ i("div", { class: "sparq-designer-condition-rule__value-placeholder" }, "无需比较值"), lu(e, "删除", () => o(r), { size: "small" }));
8368
8365
  }
8369
- function su(e) {
8366
+ function ou(e) {
8370
8367
  return e.op === "in" || e.op === "not_in" ? "多个值用 JSON 数组,如 [\"draft\",\"pending\"]" : e.op === "contains" ? "包含的内容,如 \"keyword\"" : "比较值,如 \"published\" / true / 100";
8371
8368
  }
8372
- function cu(e, t, n) {
8369
+ function su(e, t, n) {
8373
8370
  return e.formItem({ label: t }, { default: () => n });
8374
8371
  }
8375
- function lu(e, t, n, r, i = {}) {
8372
+ function cu(e, t, n, r, i = {}) {
8376
8373
  return e.select({
8377
8374
  ...i,
8378
8375
  value: t,
8379
8376
  onChange: r
8380
8377
  }, { default: () => n.map((t) => e.option(t)) });
8381
8378
  }
8382
- function uu(e, t, n, r = {}) {
8379
+ function lu(e, t, n, r = {}) {
8383
8380
  return e.button({
8384
8381
  ...r,
8385
8382
  onClick: n
8386
8383
  }, { default: () => t });
8387
8384
  }
8388
- function du(e, t, n) {
8385
+ function uu(e, t, n) {
8389
8386
  if (!t.length) return n(e);
8390
8387
  let [r, ...i] = t;
8391
8388
  return {
8392
8389
  ...e,
8393
- items: e.items.map((e, t) => t !== r || e.kind !== "group" ? e : du(e, i, n))
8390
+ items: e.items.map((e, t) => t !== r || e.kind !== "group" ? e : uu(e, i, n))
8394
8391
  };
8395
8392
  }
8396
- function fu(e, t, n) {
8393
+ function du(e, t, n) {
8397
8394
  if (!t.length) return e;
8398
8395
  let [r, ...i] = t;
8399
8396
  return {
@@ -8402,16 +8399,16 @@ function fu(e, t, n) {
8402
8399
  ...e,
8403
8400
  ...n,
8404
8401
  kind: "rule"
8405
- } : e.kind === "group" ? fu(e, i, n) : e : e)
8402
+ } : e.kind === "group" ? du(e, i, n) : e : e)
8406
8403
  };
8407
8404
  }
8408
- function pu(e, t, n) {
8409
- return du(e, t, (e) => ({
8405
+ function fu(e, t, n) {
8406
+ return uu(e, t, (e) => ({
8410
8407
  ...e,
8411
8408
  items: [...e.items, n]
8412
8409
  }));
8413
8410
  }
8414
- function mu(e, t) {
8411
+ function pu(e, t) {
8415
8412
  if (!t.length) return e;
8416
8413
  let [n, ...r] = t;
8417
8414
  if (!r.length) {
@@ -8423,18 +8420,18 @@ function mu(e, t) {
8423
8420
  }
8424
8421
  return {
8425
8422
  ...e,
8426
- items: e.items.map((e, t) => t !== n || e.kind !== "group" ? e : mu(e, r))
8423
+ items: e.items.map((e, t) => t !== n || e.kind !== "group" ? e : pu(e, r))
8427
8424
  };
8428
8425
  }
8429
- function hu(e) {
8430
- return e.mode === "json" ? e.json.trim() !== "" : gu(e.root);
8426
+ function mu(e) {
8427
+ return e.mode === "json" ? e.json.trim() !== "" : hu(e.root);
8431
8428
  }
8432
- function gu(e) {
8433
- return e.items.some((e) => e.kind === "group" ? gu(e) : e.field.trim() !== "");
8429
+ function hu(e) {
8430
+ return e.items.some((e) => e.kind === "group" ? hu(e) : e.field.trim() !== "");
8434
8431
  }
8435
8432
  //#endregion
8436
8433
  //#region src/inspector/interaction-rules-editor.tsx
8437
- var _u = r({
8434
+ var gu = r({
8438
8435
  name: "InteractionRulesEditor",
8439
8436
  props: {
8440
8437
  value: Object,
@@ -8459,7 +8456,7 @@ var _u = r({
8459
8456
  let n = t.value;
8460
8457
  n && (e.onChange?.({
8461
8458
  ...a.value,
8462
- [n]: hu(r.value) ? on(r.value) : void 0
8459
+ [n]: mu(r.value) ? on(r.value) : void 0
8463
8460
  }), c());
8464
8461
  }
8465
8462
  function d(n) {
@@ -8494,7 +8491,7 @@ var _u = r({
8494
8491
  }), /* @__PURE__ */ i("section", { class: "sparq-interaction-rules-dialog__panel" }, /* @__PURE__ */ i("header", { class: "sparq-interaction-rules-dialog__header" }, /* @__PURE__ */ i("div", null, /* @__PURE__ */ i("h3", null, n.title), /* @__PURE__ */ i("p", null, n.description)), /* @__PURE__ */ i("button", {
8495
8492
  type: "button",
8496
8493
  onClick: c
8497
- }, "关闭")), /* @__PURE__ */ i("div", { class: "sparq-interaction-rules-dialog__body" }, /* @__PURE__ */ i(ru, {
8494
+ }, "关闭")), /* @__PURE__ */ i("div", { class: "sparq-interaction-rules-dialog__body" }, /* @__PURE__ */ i(nu, {
8498
8495
  values: r.value,
8499
8496
  fields: e.props?.fields ?? [],
8500
8497
  onChange: l
@@ -8511,7 +8508,7 @@ var _u = r({
8511
8508
  }, "确认")))) : void 0);
8512
8509
  };
8513
8510
  }
8514
- }), vu = r({
8511
+ }), _u = r({
8515
8512
  name: "ComponentSettingsEditor",
8516
8513
  props: {
8517
8514
  value: Object,
@@ -8519,15 +8516,15 @@ var _u = r({
8519
8516
  props: Object
8520
8517
  },
8521
8518
  setup(e) {
8522
- let t = f(!1), r = f({}), a = se(), o = ja(), s = q(), c = n(() => e.props?.settings ?? []), l = n(() => bu(c.value)), u = n(() => Tu(e.value, e.props));
8519
+ let t = f(!1), r = f({}), a = se(), o = ja(), s = q(), c = n(() => e.props?.settings ?? []), l = n(() => yu(c.value)), u = n(() => wu(e.value, e.props));
8523
8520
  m(() => e.value, (e) => {
8524
- t.value || (r.value = Eu(e));
8521
+ t.value || (r.value = Tu(e));
8525
8522
  }, {
8526
8523
  immediate: !0,
8527
8524
  deep: !0
8528
8525
  });
8529
8526
  function d() {
8530
- r.value = Eu(e.value), t.value = !0;
8527
+ r.value = Tu(e.value), t.value = !0;
8531
8528
  }
8532
8529
  function p() {
8533
8530
  t.value = !1;
@@ -8537,7 +8534,7 @@ var _u = r({
8537
8534
  ...r.value,
8538
8535
  ...E(e)
8539
8536
  };
8540
- Du(r.value, t) || (r.value = t);
8537
+ Eu(r.value, t) || (r.value = t);
8541
8538
  }
8542
8539
  function g() {
8543
8540
  e.onChange?.(E(r.value)), p();
@@ -8574,18 +8571,18 @@ var _u = r({
8574
8571
  onClick: g
8575
8572
  }, "确认")))) : void 0);
8576
8573
  }
8577
- }), yu = r({
8574
+ }), vu = r({
8578
8575
  name: "AdvancedConfigStatus",
8579
8576
  props: { props: Object },
8580
8577
  setup(e) {
8581
8578
  return () => /* @__PURE__ */ i("div", { class: "sparq-capability-editor" }, /* @__PURE__ */ i("div", { class: "sparq-capability-editor__summary" }, /* @__PURE__ */ i("span", { title: e.props?.capability?.summary?.detail }, e.props?.capability?.summary?.text ?? "已保留"), /* @__PURE__ */ i("span", { class: "sparq-capability-editor__readonly" }, "只读")));
8582
8579
  }
8583
8580
  });
8584
- function bu(e) {
8581
+ function yu(e) {
8585
8582
  return { schema: {
8586
8583
  version: "1.0",
8587
8584
  name: "designer_component_settings",
8588
- fields: e.map(xu),
8585
+ fields: e.map(bu),
8589
8586
  views: { forms: { default: {
8590
8587
  footer: !1,
8591
8588
  span: 24,
@@ -8595,13 +8592,13 @@ function bu(e) {
8595
8592
  size: "default",
8596
8593
  showMessage: !1
8597
8594
  },
8598
- children: e.map(Su)
8595
+ children: e.map(xu)
8599
8596
  } } }
8600
8597
  } };
8601
8598
  }
8602
- function xu(e) {
8599
+ function bu(e) {
8603
8600
  return {
8604
- name: Cu(e),
8601
+ name: Su(e),
8605
8602
  label: e.label,
8606
8603
  type: e.kind === "number" ? "number" : e.kind === "switch" || e.kind === "checkbox" ? "boolean" : "string",
8607
8604
  formable: !0,
@@ -8612,12 +8609,12 @@ function xu(e) {
8612
8609
  } : void 0
8613
8610
  };
8614
8611
  }
8615
- function Su(e) {
8612
+ function xu(e) {
8616
8613
  return {
8617
8614
  type: "field",
8618
- field: Cu(e),
8615
+ field: Su(e),
8619
8616
  tip: e.tip,
8620
- component: e.component ?? wu(e),
8617
+ component: e.component ?? Cu(e),
8621
8618
  span: e.kind === "switch" || e.kind === "checkbox" ? 12 : 24,
8622
8619
  props: {
8623
8620
  placeholder: e.placeholder,
@@ -8628,11 +8625,11 @@ function Su(e) {
8628
8625
  }
8629
8626
  };
8630
8627
  }
8631
- function Cu(e) {
8628
+ function Su(e) {
8632
8629
  if (e.storage.target !== "node" || !e.storage.path.startsWith("props.")) throw Error(`组件设置属性 ${e.key} 必须写入 node.props`);
8633
8630
  return e.storage.path.slice(6);
8634
8631
  }
8635
- function wu(e) {
8632
+ function Cu(e) {
8636
8633
  switch (e.kind) {
8637
8634
  case "number": return "number";
8638
8635
  case "switch":
@@ -8642,7 +8639,7 @@ function wu(e) {
8642
8639
  default: return "text";
8643
8640
  }
8644
8641
  }
8645
- function Tu(e, t) {
8642
+ function wu(e, t) {
8646
8643
  if (t?.settingsKind === "upload") {
8647
8644
  let t = [e?.valueMode === "id" ? "资源 ID" : e?.valueMode === "asset" ? "资源对象" : "URL"];
8648
8645
  return typeof e?.limit == "number" && e.limit > 0 && t.push(`最多 ${e.limit} 个`), e?.multiple === !0 && t.push("允许多选"), t.join(" / ");
@@ -8655,15 +8652,15 @@ function Tu(e, t) {
8655
8652
  fallback: "Fallback"
8656
8653
  }[e.editor] ?? e.editor : "默认编辑器" : t?.capability?.summary?.text ?? "默认配置";
8657
8654
  }
8658
- function Eu(e) {
8655
+ function Tu(e) {
8659
8656
  return e ? E(e) : {};
8660
8657
  }
8661
- function Du(e, t) {
8658
+ function Eu(e, t) {
8662
8659
  return JSON.stringify(e) === JSON.stringify(t);
8663
8660
  }
8664
8661
  //#endregion
8665
8662
  //#region src/inspector/boolean-checkbox.tsx
8666
- var Ou = r({
8663
+ var Du = r({
8667
8664
  name: "BooleanCheckbox",
8668
8665
  props: {
8669
8666
  value: Boolean,
@@ -8684,7 +8681,7 @@ var Ou = r({
8684
8681
  "onUpdate:modelValue": n
8685
8682
  }, { default: () => _e(e.props?.inlineBooleanLabel, e.props?.inlineBooleanTip, e.props?.inlineBooleanTipId) });
8686
8683
  }
8687
- }), ku = [
8684
+ }), Ou = [
8688
8685
  {
8689
8686
  name: "prefix",
8690
8687
  label: "内部前缀"
@@ -8701,31 +8698,31 @@ var Ou = r({
8701
8698
  name: "append",
8702
8699
  label: "外部后置"
8703
8700
  }
8704
- ], Au = r({
8701
+ ], ku = r({
8705
8702
  name: "InputSlotsEditor",
8706
8703
  props: {
8707
8704
  value: Object,
8708
8705
  onChange: Function
8709
8706
  },
8710
8707
  setup(e) {
8711
- let t = f(!1), r = f({}), a = se(), o = ja(), s = q(), c = ju(), l = n(() => {
8712
- let t = ku.filter(({ name: t }) => e.value?.[t]).length;
8708
+ let t = f(!1), r = f({}), a = se(), o = ja(), s = q(), c = Au(), l = n(() => {
8709
+ let t = Ou.filter(({ name: t }) => e.value?.[t]).length;
8713
8710
  return t ? `${t} 个插槽` : "未配置";
8714
8711
  });
8715
8712
  m(() => e.value, (e) => {
8716
- t.value || (r.value = Mu(e));
8713
+ t.value || (r.value = ju(e));
8717
8714
  }, {
8718
8715
  immediate: !0,
8719
8716
  deep: !0
8720
8717
  });
8721
8718
  function u() {
8722
- r.value = Mu(e.value), t.value = !0;
8719
+ r.value = ju(e.value), t.value = !0;
8723
8720
  }
8724
8721
  function d() {
8725
8722
  t.value = !1;
8726
8723
  }
8727
8724
  function p() {
8728
- e.onChange?.(Nu(r.value)), d();
8725
+ e.onChange?.(Mu(r.value)), d();
8729
8726
  }
8730
8727
  function h() {
8731
8728
  e.onChange?.({}), d();
@@ -8768,7 +8765,7 @@ var Ou = r({
8768
8765
  }, "确认")))) : void 0);
8769
8766
  }
8770
8767
  });
8771
- function ju() {
8768
+ function Au() {
8772
8769
  let e = [], t = [], n = [
8773
8770
  {
8774
8771
  label: "无",
@@ -8783,7 +8780,7 @@ function ju() {
8783
8780
  value: "icon"
8784
8781
  }
8785
8782
  ];
8786
- for (let r of ku) e.push({
8783
+ for (let r of Ou) e.push({
8787
8784
  name: `${r.name}.type`,
8788
8785
  label: r.label,
8789
8786
  type: "string",
@@ -8827,18 +8824,18 @@ function ju() {
8827
8824
  } } }
8828
8825
  } };
8829
8826
  }
8830
- function Mu(e) {
8827
+ function ju(e) {
8831
8828
  let t = {};
8832
- for (let { name: n } of ku) {
8829
+ for (let { name: n } of Ou) {
8833
8830
  let r = e?.[n];
8834
8831
  t[`${n}.type`] = r?.type ?? "none", t[`${n}.value`] = r?.type === "text" ? r.text : r?.type === "icon" ? r.icon : "";
8835
8832
  }
8836
8833
  return t;
8837
8834
  }
8838
- function Nu(e) {
8835
+ function Mu(e) {
8839
8836
  let t = {};
8840
- for (let { name: n } of ku) {
8841
- let r = Pu(e[`${n}.type`]), i = e[`${n}.value`], a = typeof i == "string" ? i : "";
8837
+ for (let { name: n } of Ou) {
8838
+ let r = Nu(e[`${n}.type`]), i = e[`${n}.value`], a = typeof i == "string" ? i : "";
8842
8839
  r === "text" && a !== "" ? t[n] = {
8843
8840
  type: r,
8844
8841
  text: a
@@ -8849,12 +8846,12 @@ function Nu(e) {
8849
8846
  }
8850
8847
  return t;
8851
8848
  }
8852
- function Pu(e) {
8849
+ function Nu(e) {
8853
8850
  return e === "text" || e === "icon" ? e : "none";
8854
8851
  }
8855
8852
  //#endregion
8856
8853
  //#region src/inspector/date-time-format-editor.tsx
8857
- var Fu = "__custom__", Iu = r({
8854
+ var Pu = "__custom__", Fu = r({
8858
8855
  name: "DateTimeFormatEditor",
8859
8856
  props: {
8860
8857
  value: String,
@@ -8865,12 +8862,12 @@ var Fu = "__custom__", Iu = r({
8865
8862
  props: Object
8866
8863
  },
8867
8864
  setup(e) {
8868
- let t = J(), r = f(!1), a = n(() => e.props?.presets ?? []), o = n(() => r.value ? Fu : e.value ? a.value.some((t) => t.value === e.value) ? e.value : Fu : "");
8865
+ let t = J(), r = f(!1), a = n(() => e.props?.presets ?? []), o = n(() => r.value ? Pu : e.value ? a.value.some((t) => t.value === e.value) ? e.value : Pu : "");
8869
8866
  m(() => e.value, (e) => {
8870
8867
  e && !a.value.some((t) => t.value === e) && (r.value = !0);
8871
8868
  }, { immediate: !0 });
8872
8869
  function s(t) {
8873
- if (t === Fu) {
8870
+ if (t === Pu) {
8874
8871
  r.value = !0;
8875
8872
  return;
8876
8873
  }
@@ -8893,7 +8890,7 @@ var Fu = "__custom__", Iu = r({
8893
8890
  value: e.value
8894
8891
  })), t.option({
8895
8892
  label: "高级自定义",
8896
- value: Fu
8893
+ value: Pu
8897
8894
  })] }), r.value ? t.text({
8898
8895
  value: e.value ?? "",
8899
8896
  class: "sparq-date-time-format-editor__control",
@@ -8904,7 +8901,7 @@ var Fu = "__custom__", Iu = r({
8904
8901
  onBlur: e.onBlur
8905
8902
  }) : void 0);
8906
8903
  }
8907
- }), Lu = r({
8904
+ }), Iu = r({
8908
8905
  name: "ColorPaletteEditor",
8909
8906
  props: {
8910
8907
  value: Array,
@@ -8922,7 +8919,7 @@ var Fu = "__custom__", Iu = r({
8922
8919
  r.value = [...e.value ?? []], a.value = "", n.value = !0;
8923
8920
  }
8924
8921
  function s() {
8925
- let t = zu(r.value);
8922
+ let t = Ru(r.value);
8926
8923
  if (t) {
8927
8924
  a.value = t;
8928
8925
  return;
@@ -8932,7 +8929,7 @@ var Fu = "__custom__", Iu = r({
8932
8929
  return () => /* @__PURE__ */ i("div", { class: "sparq-capability-editor sparq-color-palette-editor" }, /* @__PURE__ */ i("div", { class: "sparq-capability-editor__summary" }, /* @__PURE__ */ i("div", {
8933
8930
  class: "sparq-color-palette-editor__preview",
8934
8931
  "aria-label": "预设颜色预览"
8935
- }, Ru(e.value ?? [])), /* @__PURE__ */ i("div", { class: "sparq-capability-editor__actions" }, /* @__PURE__ */ i("button", {
8932
+ }, Lu(e.value ?? [])), /* @__PURE__ */ i("div", { class: "sparq-capability-editor__actions" }, /* @__PURE__ */ i("button", {
8936
8933
  type: "button",
8937
8934
  class: "sparq-capability-editor__button",
8938
8935
  onClick: o
@@ -8951,7 +8948,7 @@ var Fu = "__custom__", Iu = r({
8951
8948
  key: n
8952
8949
  }, t.colorPicker({
8953
8950
  class: "sparq-color-palette-dialog__swatch",
8954
- value: Bu(e),
8951
+ value: zu(e),
8955
8952
  "aria-label": `选择第 ${n + 1} 个颜色`,
8956
8953
  onChange: (e) => c(n, typeof e == "string" ? e : "")
8957
8954
  }), t.text({
@@ -9006,7 +9003,7 @@ var Fu = "__custom__", Iu = r({
9006
9003
  }
9007
9004
  }
9008
9005
  });
9009
- function Ru(e) {
9006
+ function Lu(e) {
9010
9007
  return e.length === 0 ? /* @__PURE__ */ i("span", null, "未配置") : e.slice(0, 6).map((e, t) => /* @__PURE__ */ i("span", {
9011
9008
  key: `${e}-${t}`,
9012
9009
  class: "sparq-color-palette-editor__swatch",
@@ -9014,12 +9011,12 @@ function Ru(e) {
9014
9011
  title: e
9015
9012
  }));
9016
9013
  }
9017
- function zu(e) {
9014
+ function Ru(e) {
9018
9015
  let t = e.findIndex((e) => !T("color", e));
9019
9016
  if (t >= 0) return `第 ${t + 1} 个颜色格式无效,请使用标准颜色格式。`;
9020
9017
  if (new Set(e.map((e) => e.toLowerCase())).size !== e.length) return "预设色板中存在重复颜色,请删除重复项后再确认。";
9021
9018
  }
9022
- function Bu(e) {
9019
+ function zu(e) {
9023
9020
  if (/^#[0-9a-fA-F]{6}$/.test(e)) return e;
9024
9021
  if (/^#[0-9a-fA-F]{3}$/.test(e)) return `#${[...e.slice(1)].map((e) => e + e).join("")}`;
9025
9022
  let t = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})/.exec(e);
@@ -9027,7 +9024,7 @@ function Bu(e) {
9027
9024
  }
9028
9025
  //#endregion
9029
9026
  //#region src/inspector/default-value-editor.tsx
9030
- var Vu = r({
9027
+ var Bu = r({
9031
9028
  name: "DefaultValueEditor",
9032
9029
  props: {
9033
9030
  value: null,
@@ -9037,9 +9034,9 @@ var Vu = r({
9037
9034
  richTextEditors: Object
9038
9035
  },
9039
9036
  setup(e) {
9040
- let t = f(!1), r = f({}), a = se(), o = ja(), s = q(), c = n(() => e.props?.defaultValueEditor), l = n(() => c.value?.upload === !0 && !e.assetService), u = n(() => c.value?.mode === "dialog" && !l.value), d = n(() => c.value?.configured === !0 && c.value.mode === "dialog" && !l.value), p = n(() => Hu(c.value)), m = n(() => l.value ? c.value?.configured === !0 ? "未配置资源服务,已有默认值只读保留" : "未配置资源服务,无法设置默认值" : c.value?.configured === !0 ? Wu(e.value, c.value.component) : "未设置");
9037
+ let t = f(!1), r = f({}), a = se(), o = ja(), s = q(), c = n(() => e.props?.defaultValueEditor), l = n(() => c.value?.upload === !0 && !e.assetService), u = n(() => c.value?.mode === "dialog" && !l.value), d = n(() => c.value?.configured === !0 && c.value.mode === "dialog" && !l.value), p = n(() => Vu(c.value)), m = n(() => l.value ? c.value?.configured === !0 ? "未配置资源服务,已有默认值只读保留" : "未配置资源服务,无法设置默认值" : c.value?.configured === !0 ? Uu(e.value, c.value.component) : "未设置");
9041
9038
  function h() {
9042
- u.value && (r.value = c.value?.configured === !0 ? { value: Gu(e.value) } : {}, t.value = !0);
9039
+ u.value && (r.value = c.value?.configured === !0 ? { value: Wu(e.value) } : {}, t.value = !0);
9043
9040
  }
9044
9041
  function g() {
9045
9042
  t.value = !1;
@@ -9096,9 +9093,9 @@ var Vu = r({
9096
9093
  }, "确认")))) : void 0);
9097
9094
  }
9098
9095
  });
9099
- function Hu(e) {
9096
+ function Vu(e) {
9100
9097
  if (!e?.field || !e.component) return;
9101
- let t = Uu(e.field), n = {
9098
+ let t = Hu(e.field), n = {
9102
9099
  type: "field",
9103
9100
  field: "value",
9104
9101
  component: e.component,
@@ -9124,11 +9121,11 @@ function Hu(e) {
9124
9121
  } } }
9125
9122
  } };
9126
9123
  }
9127
- function Uu(e) {
9124
+ function Hu(e) {
9128
9125
  let t = E(e);
9129
9126
  return t.name = "value", t.label = "默认值", t.formable = !0, t.readonly = !1, t.disabled = !1, t.required = !1, t.validation = t.validation?.filter((e) => e.type !== "required"), delete t.default, delete t.default_expr, delete t.computed_expr, delete t.computed_triggers, t;
9130
9127
  }
9131
- function Wu(e, t) {
9128
+ function Uu(e, t) {
9132
9129
  if (t === "rich-text") return "已设置初始内容";
9133
9130
  if (t === "image-upload" || t === "file-upload") {
9134
9131
  if (Array.isArray(e)) return `已选择 ${e.length} 个文件`;
@@ -9144,12 +9141,12 @@ function Wu(e, t) {
9144
9141
  }
9145
9142
  return Array.isArray(e) ? `已设置 ${e.length} 项` : e && typeof e == "object" ? "已设置结构值" : typeof e == "boolean" ? e ? "开启" : "关闭" : e === void 0 ? "未设置" : `已设置:${String(e)}`;
9146
9143
  }
9147
- function Gu(e) {
9144
+ function Wu(e) {
9148
9145
  return e === void 0 ? e : E(e);
9149
9146
  }
9150
9147
  //#endregion
9151
9148
  //#region src/inspector/container-items-editor.tsx
9152
- var Ku = {
9149
+ var Gu = {
9153
9150
  tabs: {
9154
9151
  itemType: "tab",
9155
9152
  namePrefix: "tab",
@@ -9160,7 +9157,7 @@ var Ku = {
9160
9157
  namePrefix: "panel",
9161
9158
  title: "面板"
9162
9159
  }
9163
- }, qu = r({
9160
+ }, Ku = r({
9164
9161
  name: "ContainerItemsEditor",
9165
9162
  props: {
9166
9163
  value: Array,
@@ -9178,7 +9175,7 @@ var Ku = {
9178
9175
  setup(e) {
9179
9176
  let t = J(), n = f([]), r = f(), a = /* @__PURE__ */ new Map(), o = () => e.disabled || e.readonly;
9180
9177
  m(() => e.value, (e) => {
9181
- n.value = E(e ?? []), n.value.some((e, t) => Xu(e, t) === r.value) || (r.value = void 0);
9178
+ n.value = E(e ?? []), n.value.some((e, t) => Yu(e, t) === r.value) || (r.value = void 0);
9182
9179
  }, {
9183
9180
  immediate: !0,
9184
9181
  deep: !0
@@ -9187,9 +9184,9 @@ var Ku = {
9187
9184
  n.value = E(t), r.value = void 0, e.onChange?.(E(t));
9188
9185
  }
9189
9186
  function l() {
9190
- let t = Yu(e.props?.containerItems?.containerType);
9187
+ let t = Ju(e.props?.containerItems?.containerType);
9191
9188
  if (!t || o()) return;
9192
- let r = E(n.value), i = Ju(r, t);
9189
+ let r = E(n.value), i = qu(r, t);
9193
9190
  r.push(i), c(r), s(() => a.get(i.id)?.focus());
9194
9191
  }
9195
9192
  function u(e, t) {
@@ -9197,9 +9194,9 @@ var Ku = {
9197
9194
  i && (i.title = t, n.value = r);
9198
9195
  }
9199
9196
  function d(t) {
9200
- let r = Yu(e.props?.containerItems?.containerType), i = n.value[t];
9197
+ let r = Ju(e.props?.containerItems?.containerType), i = n.value[t];
9201
9198
  if (!r || !i || o()) return;
9202
- let a = i.title?.trim() || `${Ku[r].title} ${t + 1}`;
9199
+ let a = i.title?.trim() || `${Gu[r].title} ${t + 1}`;
9203
9200
  if (a === e.value?.[t]?.title) return;
9204
9201
  let s = E(n.value), l = s[t];
9205
9202
  l && (l.title = a), c(s);
@@ -9214,7 +9211,7 @@ var Ku = {
9214
9211
  function h(e, t) {
9215
9212
  if (!(o() || n.value.length <= 1)) {
9216
9213
  if ((e.children?.length ?? 0) > 0) {
9217
- r.value = Xu(e, t);
9214
+ r.value = Yu(e, t);
9218
9215
  return;
9219
9216
  }
9220
9217
  g(t);
@@ -9226,9 +9223,9 @@ var Ku = {
9226
9223
  t.splice(e, 1), c(t);
9227
9224
  }
9228
9225
  return () => {
9229
- let s = Yu(e.props?.containerItems?.containerType);
9226
+ let s = Ju(e.props?.containerItems?.containerType);
9230
9227
  if (!s) return null;
9231
- let c = Ku[s];
9228
+ let c = Gu[s];
9232
9229
  return /* @__PURE__ */ i("div", { class: "sparq-container-items-editor" }, /* @__PURE__ */ i("div", { class: "sparq-container-items-editor__toolbar" }, /* @__PURE__ */ i("span", null, `${n.value.length} 个项目`), /* @__PURE__ */ i("button", {
9233
9230
  type: "button",
9234
9231
  class: "sparq-container-items-editor__add",
@@ -9238,7 +9235,7 @@ var Ku = {
9238
9235
  class: "sparq-container-items-editor__list",
9239
9236
  "aria-label": `${c.title}项目列表`
9240
9237
  }, n.value.map((e, s) => {
9241
- let l = Xu(e, s), f = r.value === l;
9238
+ let l = Yu(e, s), f = r.value === l;
9242
9239
  return /* @__PURE__ */ i("li", {
9243
9240
  key: l,
9244
9241
  class: "sparq-container-items-editor__item"
@@ -9246,7 +9243,7 @@ var Ku = {
9246
9243
  class: "sparq-container-items-editor__title",
9247
9244
  size: "small",
9248
9245
  ref: (e) => {
9249
- let t = Zu(e);
9246
+ let t = Xu(e);
9250
9247
  t ? a.set(l, t) : a.delete(l);
9251
9248
  },
9252
9249
  value: e.title ?? "",
@@ -9291,8 +9288,8 @@ var Ku = {
9291
9288
  };
9292
9289
  }
9293
9290
  });
9294
- function Ju(e, t) {
9295
- let n = Ku[t], r = new Set(e.flatMap((e) => e.name ? [e.name] : [])), i = e.length + 1;
9291
+ function qu(e, t) {
9292
+ let n = Gu[t], r = new Set(e.flatMap((e) => e.name ? [e.name] : [])), i = e.length + 1;
9296
9293
  for (; r.has(`${n.namePrefix}_${i}`);) i += 1;
9297
9294
  return Ae({
9298
9295
  type: n.itemType,
@@ -9301,20 +9298,20 @@ function Ju(e, t) {
9301
9298
  children: []
9302
9299
  });
9303
9300
  }
9304
- function Yu(e) {
9301
+ function Ju(e) {
9305
9302
  return e === "tabs" || e === "collapse" ? e : void 0;
9306
9303
  }
9307
- function Xu(e, t) {
9304
+ function Yu(e, t) {
9308
9305
  return e.id ?? e.name ?? `${e.type}_${t}`;
9309
9306
  }
9310
- function Zu(e) {
9307
+ function Xu(e) {
9311
9308
  if (!e || typeof e != "object") return;
9312
9309
  let t = e;
9313
9310
  return typeof t.focus == "function" && typeof t.blur == "function" ? t : void 0;
9314
9311
  }
9315
9312
  //#endregion
9316
9313
  //#region src/inspector/property-ui-adapter.ts
9317
- function Qu(e = {}) {
9314
+ function Zu(e = {}) {
9318
9315
  let t = ja(e);
9319
9316
  return {
9320
9317
  ...t,
@@ -9325,16 +9322,16 @@ function Qu(e = {}) {
9325
9322
  class: "sparq-designer-property-section",
9326
9323
  open: e.node.raw.props?.defaultOpen === !0,
9327
9324
  "data-sparq-property-section": n
9328
- }, [i("summary", { class: "sparq-designer-property-section__summary" }, e.node.raw.title), i("div", { class: "sparq-designer-property-section__body" }, $u(e.children))]);
9325
+ }, [i("summary", { class: "sparq-designer-property-section__summary" }, e.node.raw.title), i("div", { class: "sparq-designer-property-section__body" }, Qu(e.children))]);
9329
9326
  }
9330
9327
  };
9331
9328
  }
9332
- function $u(e) {
9329
+ function Qu(e) {
9333
9330
  return Array.isArray(e) ? e.filter((e) => !(o(e) && e.props?.["data-slot"] === "node-header")) : e == null || typeof e == "boolean" ? [] : [e];
9334
9331
  }
9335
9332
  //#endregion
9336
9333
  //#region src/inspector/inspector.tsx
9337
- var ed = r({
9334
+ var $u = r({
9338
9335
  name: "SparqDesignerInspector",
9339
9336
  props: {
9340
9337
  state: {
@@ -9359,89 +9356,89 @@ var ed = r({
9359
9356
  extensionContext: e.state.extensionContext,
9360
9357
  readonly: ce.value
9361
9358
  };
9362
- }), T = n(() => le.value ? vi(le.value) : []), ue = n(() => T.value.flatMap((e) => e.fields)), de = n(() => new Map(ue.value.map((e) => [e.key, e]))), fe = n(() => Qu(g.value)), pe = n(() => Qu(x.value));
9359
+ }), T = n(() => le.value ? vi(le.value) : []), ue = n(() => T.value.flatMap((e) => e.fields)), de = n(() => new Map(ue.value.map((e) => [e.key, e]))), fe = n(() => Zu(g.value)), pe = n(() => Zu(x.value));
9363
9360
  function me() {
9364
9361
  return le.value;
9365
9362
  }
9366
9363
  function he(t) {
9367
9364
  let n = t.filter((e) => b.value.has(e));
9368
9365
  if (n.length === 0) return;
9369
- let r = Us(e.state, {
9366
+ let r = Hs(e.state, {
9370
9367
  type: "update-form-properties",
9371
- values: cd(_.value, n)
9368
+ values: sd(_.value, n)
9372
9369
  });
9373
9370
  if (r.status === "rejected") {
9374
- x.value = fd(x.value, n, r.message, r.issues);
9371
+ x.value = dd(x.value, n, r.message, r.issues);
9375
9372
  return;
9376
9373
  }
9377
- b.value = ud(b.value, n), x.value = dd(x.value, n);
9374
+ b.value = ld(b.value, n), x.value = ud(x.value, n);
9378
9375
  }
9379
9376
  function ge(t) {
9380
9377
  let n = me(), i = t.filter((e) => h.value.has(e));
9381
9378
  if (!n || i.length === 0) return;
9382
- let a = us(n, cd(r.value, i), T.value), o = ds(e.state, a);
9379
+ let a = us(n, sd(r.value, i), T.value), o = ds(e.state, a);
9383
9380
  if (o.status === "confirmation-required") {
9384
9381
  C.value = o.plan;
9385
9382
  return;
9386
9383
  }
9387
9384
  if (o.status === "rejected") {
9388
- g.value = fd(g.value, i, o.message, o.issues);
9385
+ g.value = dd(g.value, i, o.message, o.issues);
9389
9386
  return;
9390
9387
  }
9391
- h.value = ud(h.value, i), g.value = dd(g.value, i), o.status === "applied" && (C.value = void 0, Ce(r.value));
9388
+ h.value = ld(h.value, i), g.value = ud(g.value, i), o.status === "applied" && (C.value = void 0, Ce(r.value));
9392
9389
  }
9393
9390
  let _e = (e) => {
9394
9391
  if (S.value) return;
9395
- let t = Gs(_.value, e);
9392
+ let t = Ws(_.value, e);
9396
9393
  if (t.length === 0) return;
9397
- _.value = e, b.value = ld(b.value, t, e, ks(w.value)), x.value = dd(x.value, t);
9394
+ _.value = e, b.value = cd(b.value, t, e, ks(w.value)), x.value = ud(x.value, t);
9398
9395
  let n = new Map(ws(w.value).map((e) => [e.key, e]));
9399
9396
  he(t.filter((e) => {
9400
9397
  let t = n.get(e);
9401
- return t ? Ks(t) : !1;
9398
+ return t ? Gs(t) : !1;
9402
9399
  }));
9403
9400
  }, ve = (e) => {
9404
9401
  let t = me();
9405
9402
  if (S.value || !t) return;
9406
- let n = Gs(r.value, e);
9407
- n.length !== 0 && (r.value = e, h.value = ld(h.value, n, e, co(t, T.value)), g.value = dd(g.value, n), Ce(e), ge(n.filter((e) => {
9403
+ let n = Ws(r.value, e);
9404
+ n.length !== 0 && (r.value = e, h.value = cd(h.value, n, e, co(t, T.value)), g.value = ud(g.value, n), Ce(e), ge(n.filter((e) => {
9408
9405
  let t = de.value.get(e);
9409
- return t ? Ks(t) : !1;
9406
+ return t ? Gs(t) : !1;
9410
9407
  })));
9411
9408
  }, ye = q(), be = ee({
9412
- "designer.validation-rule-editor": { component: ec },
9413
- "designer.option-source-editor": { component: $c },
9414
- "designer.value-strategy-editor": { component: Fl },
9409
+ "designer.validation-rule-editor": { component: $s },
9410
+ "designer.option-source-editor": { component: Qc },
9411
+ "designer.value-strategy-editor": { component: Pl },
9415
9412
  "designer.default-value-editor": { render(e, t, n) {
9416
- return i(Vu, {
9413
+ return i(Bu, {
9417
9414
  ...e,
9418
9415
  assetService: n?.assetService,
9419
9416
  richTextEditors: n?.richTextEditors
9420
9417
  });
9421
9418
  } },
9422
- "designer.container-items-editor": { component: qu },
9423
- "designer.interaction-rules-editor": { component: _u },
9424
- "designer.boolean-checkbox": { component: Ou },
9425
- "designer.component-settings-editor": { component: vu },
9426
- "designer.input-slots-editor": { component: Au },
9427
- "designer.advanced-config-status": { component: yu },
9428
- "designer.date-time-format-editor": { component: Iu },
9429
- "designer.color-palette-editor": { component: Lu }
9419
+ "designer.container-items-editor": { component: Ku },
9420
+ "designer.interaction-rules-editor": { component: gu },
9421
+ "designer.boolean-checkbox": { component: Du },
9422
+ "designer.component-settings-editor": { component: _u },
9423
+ "designer.input-slots-editor": { component: ku },
9424
+ "designer.advanced-config-status": { component: vu },
9425
+ "designer.date-time-format-editor": { component: Fu },
9426
+ "designer.color-palette-editor": { component: Iu }
9430
9427
  }), xe = n(() => ne(be, e.components)), E = () => {
9431
9428
  let e = me();
9432
9429
  if (!e) {
9433
9430
  r.value = {}, h.value = /* @__PURE__ */ new Set(), g.value = {};
9434
9431
  return;
9435
9432
  }
9436
- let t = Ys(co(e, T.value), r.value, h.value);
9437
- pd(r.value, t) || (S.value = !0, r.value = t, S.value = !1);
9433
+ let t = Js(co(e, T.value), r.value, h.value);
9434
+ fd(r.value, t) || (S.value = !0, r.value = t, S.value = !1);
9438
9435
  }, D = () => {
9439
9436
  let t = me();
9440
9437
  if (!t) {
9441
9438
  te += 1, o.value = void 0, s.value = "", l.value = !0;
9442
9439
  return;
9443
9440
  }
9444
- let n = T.value, r = `${io(t, n)}|${gd(a.value)}`;
9441
+ let n = T.value, r = `${io(t, n)}|${hd(a.value)}`;
9445
9442
  if (o.value && s.value === r) {
9446
9443
  l.value ||= (te += 1, o.value = ro(t, a.value, e.state.serviceRegistry, n), !0);
9447
9444
  return;
@@ -9472,18 +9469,18 @@ var ed = r({
9472
9469
  p.value?.abort(), a.value = {}, d.value = "";
9473
9470
  return;
9474
9471
  }
9475
- let i = T.value, o = `${io(n, i)}|${hd(md(t))}`;
9472
+ let i = T.value, o = `${io(n, i)}|${md(pd(t))}`;
9476
9473
  if (d.value === o) return;
9477
9474
  d.value = o, p.value?.abort();
9478
9475
  let s = new AbortController();
9479
9476
  p.value = s, ao(n, t, s.signal, e.state.serviceRegistry, i).then((e) => {
9480
- s.signal.aborted || gd(a.value) !== gd(e) && (a.value = e, D());
9477
+ s.signal.aborted || hd(a.value) !== hd(e) && (a.value = e, D());
9481
9478
  }).catch((e) => {
9482
9479
  s.signal.aborted || (console.warn("[sparq-designer] load field property options failed", e), Object.keys(a.value).length !== 0 && (a.value = {}, D()));
9483
9480
  });
9484
9481
  }, we = () => {
9485
- let e = Ys(ks(w.value), _.value, b.value);
9486
- pd(_.value, e) || (S.value = !0, _.value = e, S.value = !1);
9482
+ let e = Js(ks(w.value), _.value, b.value);
9483
+ fd(_.value, e) || (S.value = !0, _.value = e, S.value = !1);
9487
9484
  }, O = () => {
9488
9485
  let e = Os(w.value);
9489
9486
  v.value && y.value === e || (y.value = e, v.value = Ds(w.value));
@@ -9496,12 +9493,12 @@ var ed = r({
9496
9493
  confirmed: !0
9497
9494
  }]);
9498
9495
  if (C.value = void 0, n.status === "rejected") {
9499
- g.value = fd(g.value, ["node.component"], n.message, n.issues);
9496
+ g.value = dd(g.value, ["node.component"], n.message, n.issues);
9500
9497
  return;
9501
9498
  }
9502
- h.value = ud(h.value, ["node.component"]), g.value = dd(g.value, ["node.component"]), E(), D(), Ce();
9499
+ h.value = ld(h.value, ["node.component"]), g.value = ud(g.value, ["node.component"]), E(), D(), Ce();
9503
9500
  }, Te = () => {
9504
- C.value = void 0, h.value = ud(h.value, ["node.component"]), g.value = dd(g.value, ["node.component"]), E(), u.value += 1;
9501
+ C.value = void 0, h.value = ld(h.value, ["node.component"]), g.value = ud(g.value, ["node.component"]), E(), u.value += 1;
9505
9502
  };
9506
9503
  m(() => e.state.schemaVersion, () => {
9507
9504
  D(), O(), Ce();
@@ -9515,25 +9512,25 @@ var ed = r({
9515
9512
  C.value = void 0, h.value = /* @__PURE__ */ new Set(), g.value = {}, D(), E(), Ce();
9516
9513
  }, { immediate: !0 });
9517
9514
  let Ee = () => ws(w.value), De = (e) => {
9518
- ad(e, ue.value, ge);
9515
+ id(e, ue.value, ge);
9519
9516
  }, Oe = (e) => {
9520
- ad(e, Ee(), he);
9517
+ id(e, Ee(), he);
9521
9518
  }, ke = (e) => {
9522
- od(e, ue.value, ge);
9519
+ ad(e, ue.value, ge);
9523
9520
  }, Ae = (e) => {
9524
- od(e, Ee(), he);
9521
+ ad(e, Ee(), he);
9525
9522
  };
9526
9523
  return () => /* @__PURE__ */ i("aside", {
9527
9524
  class: "sparq-designer-inspector",
9528
9525
  "data-field-property-ready": l.value ? "" : void 0
9529
- }, /* @__PURE__ */ i("div", { class: "sparq-designer-inspector-tabs" }, id("字段属性", e.state.inspectorTab === "field", () => {
9526
+ }, /* @__PURE__ */ i("div", { class: "sparq-designer-inspector-tabs" }, rd("字段属性", e.state.inspectorTab === "field", () => {
9530
9527
  D(), E(), e.state.inspectorTab = "field";
9531
- }), e.showFormProperties ? id("表单属性", e.state.inspectorTab === "form", () => {
9528
+ }), e.showFormProperties ? rd("表单属性", e.state.inspectorTab === "form", () => {
9532
9529
  we(), e.state.inspectorTab = "form";
9533
- }) : void 0), e.state.inspectorTab === "form" && v.value ? nd(v.value, y.value, _.value, t, pe.value, ye, _e, Oe, Ae) : ie.value && o.value ? td(o.value, s.value + ":" + u.value, r.value, t, fe.value, ye, xe.value, e.state.extensionContext?.icons, e.richTextEditors, ve, De, ke) : /* @__PURE__ */ i("div", { class: "sparq-designer-empty" }, "从舞台中选择一个节点后编辑字段属性。"), C.value ? rd(C.value, k, Te) : void 0);
9530
+ }) : void 0), e.state.inspectorTab === "form" && v.value ? td(v.value, y.value, _.value, t, pe.value, ye, _e, Oe, Ae) : ie.value && o.value ? ed(o.value, s.value + ":" + u.value, r.value, t, fe.value, ye, xe.value, e.state.extensionContext?.icons, e.richTextEditors, ve, De, ke) : /* @__PURE__ */ i("div", { class: "sparq-designer-empty" }, "从舞台中选择一个节点后编辑字段属性。"), C.value ? nd(C.value, k, Te) : void 0);
9534
9531
  }
9535
9532
  });
9536
- function td(e, t, n, r, a, o, s, c, l, u, d, f) {
9533
+ function ed(e, t, n, r, a, o, s, c, l, u, d, f) {
9537
9534
  return /* @__PURE__ */ i("div", {
9538
9535
  class: "sparq-designer-property-view",
9539
9536
  onFocusout: d,
@@ -9553,7 +9550,7 @@ function td(e, t, n, r, a, o, s, c, l, u, d, f) {
9553
9550
  "onUpdate:modelValue": u
9554
9551
  }));
9555
9552
  }
9556
- function nd(e, t, n, r, a, o, s, c, l) {
9553
+ function td(e, t, n, r, a, o, s, c, l) {
9557
9554
  return /* @__PURE__ */ i("div", {
9558
9555
  class: "sparq-designer-property-view",
9559
9556
  onFocusout: c,
@@ -9570,7 +9567,7 @@ function nd(e, t, n, r, a, o, s, c, l) {
9570
9567
  "onUpdate:modelValue": s
9571
9568
  }));
9572
9569
  }
9573
- function rd(e, t, n) {
9570
+ function nd(e, t, n) {
9574
9571
  return /* @__PURE__ */ i("div", {
9575
9572
  class: "sparq-value-strategy-dialog sparq-component-migration-dialog",
9576
9573
  role: "dialog",
@@ -9590,63 +9587,63 @@ function rd(e, t, n) {
9590
9587
  onClick: t
9591
9588
  }, "确认切换"))));
9592
9589
  }
9593
- function id(e, t, n) {
9590
+ function rd(e, t, n) {
9594
9591
  return /* @__PURE__ */ i("button", {
9595
9592
  type: "button",
9596
9593
  class: t ? "is-active" : void 0,
9597
9594
  onClick: n
9598
9595
  }, e);
9599
9596
  }
9600
- function ad(e, t, n) {
9601
- let r = sd(e), i = t.find((e) => e.key === r);
9602
- i && qs(i) && n([i.key]);
9597
+ function id(e, t, n) {
9598
+ let r = od(e), i = t.find((e) => e.key === r);
9599
+ i && Ks(i) && n([i.key]);
9603
9600
  }
9604
- function od(e, t, n) {
9605
- let r = sd(e), i = t.find((e) => e.key === r);
9606
- !i || !Js(i, e) || (e.preventDefault(), n([i.key]));
9601
+ function ad(e, t, n) {
9602
+ let r = od(e), i = t.find((e) => e.key === r);
9603
+ !i || !qs(i, e) || (e.preventDefault(), n([i.key]));
9607
9604
  }
9608
- function sd(e) {
9605
+ function od(e) {
9609
9606
  let t = e.target;
9610
9607
  if (!(t instanceof Element)) return;
9611
9608
  let n = t.closest("[data-sparq-element-plus-control], [data-sparq-field]");
9612
9609
  return n?.getAttribute("data-sparq-element-plus-control") ?? n?.getAttribute("data-sparq-field") ?? void 0;
9613
9610
  }
9614
- function cd(e, t) {
9611
+ function sd(e, t) {
9615
9612
  return Object.fromEntries(t.map((t) => [t, e[t]]));
9616
9613
  }
9617
- function ld(e, t, n, r) {
9614
+ function cd(e, t, n, r) {
9618
9615
  let i = new Set(e);
9619
9616
  for (let e of t) JSON.stringify(n[e]) === JSON.stringify(r[e]) ? i.delete(e) : i.add(e);
9620
9617
  return i;
9621
9618
  }
9622
- function ud(e, t) {
9619
+ function ld(e, t) {
9623
9620
  let n = new Set(e);
9624
9621
  for (let e of t) n.delete(e);
9625
9622
  return n;
9626
9623
  }
9627
- function dd(e, t) {
9624
+ function ud(e, t) {
9628
9625
  let n = { ...e };
9629
9626
  for (let e of t) delete n[e];
9630
9627
  return n;
9631
9628
  }
9632
- function fd(e, t, n, r) {
9633
- let i = dd(e, t);
9629
+ function dd(e, t, n, r) {
9630
+ let i = ud(e, t);
9634
9631
  if (r?.length) for (let e of r) i[e.key] = [...i[e.key] ?? [], e.message];
9635
9632
  else t[0] && (i[t[0]] = [n]);
9636
9633
  return i;
9637
9634
  }
9638
- function pd(e, t) {
9639
- return hd(md(e)) === hd(md(t));
9635
+ function fd(e, t) {
9636
+ return md(pd(e)) === md(pd(t));
9640
9637
  }
9641
- function md(e) {
9638
+ function pd(e) {
9642
9639
  let t = {};
9643
9640
  for (let [n, r] of Object.entries(e)) r === void 0 || r === "" && n !== "field.value_strategy_editor" || (t[n] = r);
9644
9641
  return t;
9645
9642
  }
9646
- function hd(e) {
9643
+ function md(e) {
9647
9644
  return JSON.stringify(Object.keys(e).sort().reduce((t, n) => (t[n] = e[n], t), {}));
9648
9645
  }
9649
- function gd(e) {
9646
+ function hd(e) {
9650
9647
  let t = {};
9651
9648
  for (let n of Object.keys(e).sort()) t[n] = e[n]?.map((e) => ({
9652
9649
  label: e.label,
@@ -9657,20 +9654,20 @@ function gd(e) {
9657
9654
  }
9658
9655
  //#endregion
9659
9656
  //#region src/dialogs/resource-tree-model.ts
9660
- function _d(e) {
9657
+ function gd(e) {
9661
9658
  let { node: t, field: n } = e, r = t.id;
9662
9659
  return {
9663
9660
  id: r || `node:${e.index}`,
9664
9661
  nodeId: r,
9665
9662
  label: e.label,
9666
9663
  type: t.type || "node",
9667
- kind: yd(t),
9664
+ kind: vd(t),
9668
9665
  name: n?.name ?? t.name,
9669
9666
  dataType: n?.type,
9670
- component: xd(t),
9671
- multiple: Sd(t, n),
9672
- virtual: Cd(n),
9673
- conditional: wd(t),
9667
+ component: bd(t),
9668
+ multiple: xd(t, n),
9669
+ virtual: Sd(n),
9670
+ conditional: Cd(t),
9674
9671
  childCount: t.children?.length ?? 0,
9675
9672
  parentId: e.parentId,
9676
9673
  index: e.index,
@@ -9687,13 +9684,13 @@ function _d(e) {
9687
9684
  children: e.children
9688
9685
  };
9689
9686
  }
9690
- function vd(e, t) {
9687
+ function _d(e, t) {
9691
9688
  return Ye(e, t);
9692
9689
  }
9693
- function yd(e) {
9690
+ function vd(e) {
9694
9691
  return e.type === "field" ? "field" : e.type === "view" ? "view" : Je(e.type) ? "container" : "layout";
9695
9692
  }
9696
- function bd(e) {
9693
+ function yd(e) {
9697
9694
  switch (e) {
9698
9695
  case "field": return "字段";
9699
9696
  case "container": return "容器";
@@ -9701,21 +9698,21 @@ function bd(e) {
9701
9698
  case "layout": return "布局";
9702
9699
  }
9703
9700
  }
9704
- function xd(e) {
9701
+ function bd(e) {
9705
9702
  return e.type === "field" ? e.component || "field" : e.type === "view" && typeof e.mode == "string" ? `${e.type}:${e.mode}` : e.type;
9706
9703
  }
9707
- function Sd(e, t) {
9704
+ function xd(e, t) {
9708
9705
  return t?.multiple === !0 || e.props?.multiple === !0 || ["multi-select", "checkbox"].includes(e.component ?? "");
9709
9706
  }
9710
- function Cd(e) {
9707
+ function Sd(e) {
9711
9708
  return e?.persisted !== !0 || !!e?.computed_expr;
9712
9709
  }
9713
- function wd(e) {
9710
+ function Cd(e) {
9714
9711
  return !!e.show_when;
9715
9712
  }
9716
9713
  //#endregion
9717
9714
  //#region src/dialogs/dialogs.tsx
9718
- var Td = r({
9715
+ var wd = r({
9719
9716
  name: "SparqDesignerJsonDialog",
9720
9717
  props: { state: {
9721
9718
  type: Object,
@@ -9733,7 +9730,7 @@ var Td = r({
9733
9730
  }
9734
9731
  }, { default: () => /* @__PURE__ */ i("pre", { class: "sparq-designer-json-viewer" }, Fe(e.state.schema)) }) : void 0;
9735
9732
  }
9736
- }), Ed = r({
9733
+ }), Td = r({
9737
9734
  name: "SparqDesignerPreviewDialog",
9738
9735
  props: {
9739
9736
  state: {
@@ -9744,7 +9741,7 @@ var Td = r({
9744
9741
  richTextEditors: Object
9745
9742
  },
9746
9743
  setup(e) {
9747
- let t = Dd({
9744
+ let t = Ed({
9748
9745
  renderer: a(g, void 0),
9749
9746
  runtime: a(_, void 0),
9750
9747
  uiAdapter: a(v, void 0),
@@ -9808,14 +9805,14 @@ var Td = r({
9808
9805
  }), /* @__PURE__ */ i("span", null, "正在加载预览…")) }) : void 0;
9809
9806
  }
9810
9807
  });
9811
- function Dd(e) {
9808
+ function Ed(e) {
9812
9809
  return {
9813
9810
  runtime: e.runtime ?? e.renderer?.runtime ?? se(),
9814
9811
  uiAdapter: e.uiAdapter ?? e.renderer?.uiAdapter ?? ja(),
9815
9812
  uiKit: e.uiKit ?? e.renderer?.uiKit ?? q()
9816
9813
  };
9817
9814
  }
9818
- var Od = r({
9815
+ var Dd = r({
9819
9816
  name: "SparqDesignerResourceTreeDialog",
9820
9817
  props: { state: {
9821
9818
  type: Object,
@@ -9824,11 +9821,11 @@ var Od = r({
9824
9821
  setup(e) {
9825
9822
  let t = J();
9826
9823
  return m(() => [e.state.resourceTreeOpen, e.state.selection?.type === "form-node" ? e.state.selection.path : ""], () => {
9827
- let t = Xd(e.state);
9828
- !e.state.resourceTreeOpen || !t || s(() => Zd(t));
9824
+ let t = Yd(e.state);
9825
+ !e.state.resourceTreeOpen || !t || s(() => Xd(t));
9829
9826
  }, { flush: "post" }), () => {
9830
9827
  if (!e.state.resourceTreeOpen) return;
9831
- let n = D(e.state.schema, e.state.viewName), r = Se(e.state.schema, e.state.viewName).title || e.state.schema.schema.title || "当前表单", a = `${r}资源`, o = jt(e.state), s = `form:${e.state.viewName}`, c = kd(e.state, n);
9828
+ let n = D(e.state.schema, e.state.viewName), r = Se(e.state.schema, e.state.viewName).title || e.state.schema.schema.title || "当前表单", a = `${r}资源`, o = jt(e.state), s = `form:${e.state.viewName}`, c = Od(e.state, n);
9832
9829
  return t.drawer({
9833
9830
  modelValue: !0,
9834
9831
  title: a,
@@ -9850,7 +9847,7 @@ var Od = r({
9850
9847
  }],
9851
9848
  nodeKey: "id",
9852
9849
  defaultExpandAll: !0,
9853
- defaultExpandedKeys: Jd(s, c, o?.id),
9850
+ defaultExpandedKeys: qd(s, c, o?.id),
9854
9851
  draggable: !0,
9855
9852
  highlightCurrent: !0,
9856
9853
  expandOnClickNode: !1,
@@ -9864,117 +9861,117 @@ var Od = r({
9864
9861
  t.nodeId && At(e.state, t.nodeId);
9865
9862
  },
9866
9863
  allowDrag(e) {
9867
- let t = zd(e);
9864
+ let t = Rd(e);
9868
9865
  return !!(t?.nodeId && t.movable);
9869
9866
  },
9870
9867
  allowDrop(t, n, r) {
9871
- return Ld(e.state, t, n, r);
9868
+ return Id(e.state, t, n, r);
9872
9869
  },
9873
9870
  onNodeDrop(t, n, r) {
9874
- Rd(e.state, t, n, r);
9871
+ Ld(e.state, t, n, r);
9875
9872
  },
9876
9873
  "data-sparq-designer-resource-tree": ""
9877
- }, { default: (t) => Ad(e.state, t.data) }) : /* @__PURE__ */ i("div", { class: "sparq-designer-empty" }, "当前舞台还没有节点。")) });
9874
+ }, { default: (t) => kd(e.state, t.data) }) : /* @__PURE__ */ i("div", { class: "sparq-designer-empty" }, "当前舞台还没有节点。")) });
9878
9875
  };
9879
9876
  }
9880
9877
  });
9881
- function kd(e, t, n, r = []) {
9878
+ function Od(e, t, n, r = []) {
9882
9879
  let i = N(e.schema);
9883
9880
  return t.map((a, o) => {
9884
9881
  let s = a.id, c = a.field ? i.find((e) => e.name === a.field) : void 0, l = s ? Dt(e, s, { respectVisibility: !1 }) : {
9885
9882
  canMoveUp: !1,
9886
9883
  canMoveDown: !1
9887
9884
  }, u = s ? P(e, s) : void 0;
9888
- return _d({
9885
+ return gd({
9889
9886
  node: a,
9890
9887
  index: o,
9891
- label: Hd(e, a),
9888
+ label: Vd(e, a),
9892
9889
  field: c,
9893
9890
  parentId: n,
9894
9891
  canMoveUp: !!(u?.movable && l.canMoveUp),
9895
9892
  canMoveDown: !!(u?.movable && l.canMoveDown),
9896
- canMoveIn: !!(u?.movable && Ud(e, t, o)),
9897
- canMoveOut: !!(u?.movable && Wd(e, a, r)),
9893
+ canMoveIn: !!(u?.movable && Hd(e, t, o)),
9894
+ canMoveOut: !!(u?.movable && Ud(e, a, r)),
9898
9895
  selectable: u?.selectable,
9899
9896
  editable: u?.editable,
9900
9897
  movable: !!(u?.selectable && u.movable),
9901
9898
  copyable: !!(u?.selectable && u.copyable),
9902
9899
  deletable: !!(u?.selectable && u.deletable),
9903
- children: a.children?.length ? kd(e, a.children, s, [...r, a]) : void 0
9900
+ children: a.children?.length ? Od(e, a.children, s, [...r, a]) : void 0
9904
9901
  });
9905
9902
  });
9906
9903
  }
9907
- function Ad(e, t) {
9904
+ function kd(e, t) {
9908
9905
  return /* @__PURE__ */ i("div", {
9909
9906
  class: "sparq-designer-resource-tree-node",
9910
9907
  "data-sparq-designer-resource-tree-node-id": t.nodeId
9911
- }, /* @__PURE__ */ i("div", { class: "sparq-designer-resource-tree-node__main" }, /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__label" }, t.label), /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tags" }, /* @__PURE__ */ i("span", { class: ["sparq-designer-resource-tree-node__tag", `is-${t.kind}`] }, bd(t.kind)), t.conditional ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag is-conditional" }, "条件") : void 0, t.virtual ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag is-virtual" }, "virtual") : void 0, t.multiple ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag" }, "multi") : void 0, t.editable === !1 ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag is-readonly" }, K("lock"), "只读") : void 0, t.childCount ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag is-count" }, t.childCount) : void 0), t.nodeId ? jd(e, t) : void 0), /* @__PURE__ */ i("div", { class: "sparq-designer-resource-tree-node__meta" }, t.name ? /* @__PURE__ */ i("span", { title: "字段名" }, t.name) : void 0, t.dataType ? /* @__PURE__ */ i("span", { title: "数据类型" }, t.dataType) : void 0, t.component ? /* @__PURE__ */ i("span", { title: "组件类型" }, t.component) : void 0));
9908
+ }, /* @__PURE__ */ i("div", { class: "sparq-designer-resource-tree-node__main" }, /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__label" }, t.label), /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tags" }, /* @__PURE__ */ i("span", { class: ["sparq-designer-resource-tree-node__tag", `is-${t.kind}`] }, yd(t.kind)), t.conditional ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag is-conditional" }, "条件") : void 0, t.virtual ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag is-virtual" }, "virtual") : void 0, t.multiple ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag" }, "multi") : void 0, t.editable === !1 ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag is-readonly" }, K("lock"), "只读") : void 0, t.childCount ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__tag is-count" }, t.childCount) : void 0), t.nodeId ? Ad(e, t) : void 0), /* @__PURE__ */ i("div", { class: "sparq-designer-resource-tree-node__meta" }, t.name ? /* @__PURE__ */ i("span", { title: "字段名" }, t.name) : void 0, t.dataType ? /* @__PURE__ */ i("span", { title: "数据类型" }, t.dataType) : void 0, t.component ? /* @__PURE__ */ i("span", { title: "组件类型" }, t.component) : void 0));
9912
9909
  }
9913
- function jd(e, t) {
9910
+ function Ad(e, t) {
9914
9911
  return /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__actions" }, t.movable ? /* @__PURE__ */ i("span", { class: "sparq-designer-resource-tree-node__move-actions" }, /* @__PURE__ */ i("button", {
9915
9912
  type: "button",
9916
9913
  title: "上移",
9917
9914
  "aria-label": "上移",
9918
9915
  disabled: !t.canMoveUp,
9919
- onClick: (n) => Md(n, e, t, -1)
9916
+ onClick: (n) => jd(n, e, t, -1)
9920
9917
  }, K("up")), /* @__PURE__ */ i("button", {
9921
9918
  type: "button",
9922
9919
  title: "下移",
9923
9920
  "aria-label": "下移",
9924
9921
  disabled: !t.canMoveDown,
9925
- onClick: (n) => Md(n, e, t, 1)
9922
+ onClick: (n) => jd(n, e, t, 1)
9926
9923
  }, K("down")), /* @__PURE__ */ i("button", {
9927
9924
  type: "button",
9928
9925
  title: "移入",
9929
9926
  "aria-label": "移入",
9930
9927
  disabled: !t.canMoveIn,
9931
- onClick: (n) => Nd(n, e, t)
9928
+ onClick: (n) => Md(n, e, t)
9932
9929
  }, K("indent")), /* @__PURE__ */ i("button", {
9933
9930
  type: "button",
9934
9931
  title: "移出",
9935
9932
  "aria-label": "移出",
9936
9933
  disabled: !t.canMoveOut,
9937
- onClick: (n) => Pd(n, e, t)
9934
+ onClick: (n) => Nd(n, e, t)
9938
9935
  }, K("outdent"))) : void 0, t.copyable ? /* @__PURE__ */ i("button", {
9939
9936
  type: "button",
9940
9937
  title: "复制",
9941
9938
  "aria-label": "复制",
9942
- onClick: (n) => Fd(n, e, t)
9939
+ onClick: (n) => Pd(n, e, t)
9943
9940
  }, K("copy")) : void 0, t.deletable ? /* @__PURE__ */ i("button", {
9944
9941
  type: "button",
9945
9942
  title: "删除",
9946
9943
  "aria-label": "删除",
9947
- onClick: (n) => Id(n, e, t)
9944
+ onClick: (n) => Fd(n, e, t)
9948
9945
  }, K("remove")) : void 0);
9949
9946
  }
9950
- function Md(e, t, n, r) {
9947
+ function jd(e, t, n, r) {
9951
9948
  e.preventDefault(), e.stopPropagation(), !(!n.nodeId || r < 0 && !n.canMoveUp || r > 0 && !n.canMoveDown) && At(t, n.nodeId) && Gt(t, r, { respectVisibility: !1 });
9952
9949
  }
9953
- function Nd(e, t, n) {
9950
+ function Md(e, t, n) {
9954
9951
  e.preventDefault(), e.stopPropagation();
9955
- let r = Gd(t, n);
9952
+ let r = Wd(t, n);
9956
9953
  !n.nodeId || !r?.id || At(t, n.nodeId) && Vt(t, n.nodeId, r.id);
9957
9954
  }
9958
- function Pd(e, t, n) {
9959
- e.preventDefault(), e.stopPropagation(), !(!n.nodeId || !Kd(t, n.nodeId)) && At(t, n.nodeId) && Ht(t, n.nodeId);
9955
+ function Nd(e, t, n) {
9956
+ e.preventDefault(), e.stopPropagation(), !(!n.nodeId || !Gd(t, n.nodeId)) && At(t, n.nodeId) && Ht(t, n.nodeId);
9960
9957
  }
9961
- function Fd(e, t, n) {
9958
+ function Pd(e, t, n) {
9962
9959
  e.preventDefault(), e.stopPropagation(), n.nodeId && At(t, n.nodeId) && Wt(t);
9963
9960
  }
9964
- function Id(e, t, n) {
9961
+ function Fd(e, t, n) {
9965
9962
  e.preventDefault(), e.stopPropagation(), n.nodeId && At(t, n.nodeId) && Ut(t);
9966
9963
  }
9967
- function Ld(e, t, n, r) {
9968
- let i = zd(t), a = zd(n);
9964
+ function Id(e, t, n, r) {
9965
+ let i = Rd(t), a = Rd(n);
9969
9966
  if (!i?.nodeId || !a?.nodeId || i.nodeId === a.nodeId) return !1;
9970
- let o = Bd(e, a, r);
9971
- if (o?.id && Vd(e, i.nodeId, o.id)) return !1;
9967
+ let o = zd(e, a, r);
9968
+ if (o?.id && Bd(e, i.nodeId, o.id)) return !1;
9972
9969
  let s = O(D(e.schema, e.viewName), i.nodeId);
9973
- return !!(i.movable && s && vd(o, i) && vt(e, s, o?.id));
9970
+ return !!(i.movable && s && _d(o, i) && vt(e, s, o?.id));
9974
9971
  }
9975
- function Rd(e, t, n, r) {
9976
- if (!Ld(e, t, n, r)) return;
9977
- let i = zd(t), a = zd(n);
9972
+ function Ld(e, t, n, r) {
9973
+ if (!Id(e, t, n, r)) return;
9974
+ let i = Rd(t), a = Rd(n);
9978
9975
  if (!(!i?.nodeId || !a?.nodeId)) {
9979
9976
  if (r === "inner") {
9980
9977
  let t = O(D(e.schema, e.viewName), a.nodeId);
@@ -9984,44 +9981,44 @@ function Rd(e, t, n, r) {
9984
9981
  a.index !== void 0 && Bt(e, i.nodeId, a.parentId, r === "after" ? a.index + 1 : a.index);
9985
9982
  }
9986
9983
  }
9987
- function zd(e) {
9984
+ function Rd(e) {
9988
9985
  if (e) return "data" in e ? e.data : e;
9989
9986
  }
9990
- function Bd(e, t, n) {
9987
+ function zd(e, t, n) {
9991
9988
  let r = D(e.schema, e.viewName);
9992
9989
  return n === "inner" ? t.nodeId ? O(r, t.nodeId) : void 0 : t.parentId ? O(r, t.parentId) : void 0;
9993
9990
  }
9994
- function Vd(e, t, n) {
9991
+ function Bd(e, t, n) {
9995
9992
  let r = O(D(e.schema, e.viewName), t);
9996
9993
  return r ? !!O(r.children ?? [], n) : !1;
9997
9994
  }
9998
- function Hd(e, t) {
9995
+ function Vd(e, t) {
9999
9996
  return t.title ? t.title : t.field ? N(e.schema).find((e) => e.name === t.field)?.label || t.field : t.component || t.type || "未命名节点";
10000
9997
  }
10001
- function Ud(e, t, n) {
9998
+ function Hd(e, t, n) {
10002
9999
  let r = t[n], i = t[n - 1];
10003
- return !r?.id || !i?.id ? !1 : vd(i, r) && vt(e, r, i.id);
10000
+ return !r?.id || !i?.id ? !1 : _d(i, r) && vt(e, r, i.id);
10004
10001
  }
10005
- function Wd(e, t, n) {
10002
+ function Ud(e, t, n) {
10006
10003
  let r = n.at(-1);
10007
10004
  if (!t.id || !r?.id) return !1;
10008
10005
  let i = n.at(-2);
10009
- return vd(i, t) && vt(e, t, i?.id);
10006
+ return _d(i, t) && vt(e, t, i?.id);
10010
10007
  }
10011
- function Gd(e, t) {
10008
+ function Wd(e, t) {
10012
10009
  if (!t.nodeId) return;
10013
- let n = qd(D(e.schema, e.viewName), t.nodeId), r = n ? n.siblings[n.index - 1] : void 0;
10014
- if (!(!r?.id || !vd(r, n?.node ?? t))) return r;
10010
+ let n = Kd(D(e.schema, e.viewName), t.nodeId), r = n ? n.siblings[n.index - 1] : void 0;
10011
+ if (!(!r?.id || !_d(r, n?.node ?? t))) return r;
10015
10012
  }
10016
- function Kd(e, t) {
10017
- let n = D(e.schema, e.viewName), r = qd(n, t);
10013
+ function Gd(e, t) {
10014
+ let n = D(e.schema, e.viewName), r = Kd(n, t);
10018
10015
  if (!r?.parentId) return !1;
10019
10016
  let i = O(n, r.parentId);
10020
10017
  if (!i?.id) return !1;
10021
- let a = qd(n, i.id);
10022
- return vd(a?.parentId ? O(n, a.parentId) : void 0, r.node);
10018
+ let a = Kd(n, i.id);
10019
+ return _d(a?.parentId ? O(n, a.parentId) : void 0, r.node);
10023
10020
  }
10024
- function qd(e, t, n) {
10021
+ function Kd(e, t, n) {
10025
10022
  for (let r = 0; r < e.length; r += 1) {
10026
10023
  let i = e[r];
10027
10024
  if (!i) continue;
@@ -10031,48 +10028,48 @@ function qd(e, t, n) {
10031
10028
  index: r,
10032
10029
  node: i
10033
10030
  };
10034
- let a = qd(i.children ?? [], t, i.id);
10031
+ let a = Kd(i.children ?? [], t, i.id);
10035
10032
  if (a) return a;
10036
10033
  }
10037
10034
  }
10038
- function Jd(e, t, n) {
10035
+ function qd(e, t, n) {
10039
10036
  if (!n) return [e];
10040
- let r = Yd(t, n);
10037
+ let r = Jd(t, n);
10041
10038
  return r ? [e, ...r] : [e];
10042
10039
  }
10043
- function Yd(e, t, n = []) {
10040
+ function Jd(e, t, n = []) {
10044
10041
  for (let r of e) {
10045
10042
  if (r.nodeId === t) return n;
10046
- let e = r.nodeId ? [...n, r.nodeId] : n, i = Yd(r.children ?? [], t, e);
10043
+ let e = r.nodeId ? [...n, r.nodeId] : n, i = Jd(r.children ?? [], t, e);
10047
10044
  if (i) return i;
10048
10045
  }
10049
10046
  }
10050
- function Xd(e) {
10047
+ function Yd(e) {
10051
10048
  return e.selection?.type === "form-node" ? e.selection.path : void 0;
10052
10049
  }
10053
- function Zd(e) {
10050
+ function Xd(e) {
10054
10051
  if (typeof document > "u") return;
10055
- let t = `[data-sparq-designer-resource-tree-node-id="${Qd(e)}"]`;
10052
+ let t = `[data-sparq-designer-resource-tree-node-id="${Zd(e)}"]`;
10056
10053
  document.querySelector(t)?.scrollIntoView({ block: "nearest" });
10057
10054
  }
10058
- function Qd(e) {
10055
+ function Zd(e) {
10059
10056
  return e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
10060
10057
  }
10061
10058
  //#endregion
10062
10059
  //#region src/shared/component-registry.ts
10063
- function $d(e, t, n, r) {
10060
+ function Qd(e, t, n, r) {
10064
10061
  let i = [...n?.entries() ?? []];
10065
- for (let a of ef(D(e, t), n, r)) i.push([a, tf(a)]);
10062
+ for (let a of $d(D(e, t), n, r)) i.push([a, ef(a)]);
10066
10063
  return ee(i);
10067
10064
  }
10068
- function ef(e, t, n, r = /* @__PURE__ */ new Set()) {
10065
+ function $d(e, t, n, r = /* @__PURE__ */ new Set()) {
10069
10066
  for (let i of e) {
10070
10067
  let e = i.type === "field" ? i.component : void 0, a = n?.getComponentPropertyConfig(e) ?? fi(e);
10071
- e && !t?.has(e) && (!a || n?.hasExtensionComponentProperty(e)) && r.add(e), ef(i.children ?? [], t, n, r);
10068
+ e && !t?.has(e) && (!a || n?.hasExtensionComponentProperty(e)) && r.add(e), $d(i.children ?? [], t, n, r);
10072
10069
  }
10073
10070
  return r;
10074
10071
  }
10075
- function tf(e) {
10072
+ function ef(e) {
10076
10073
  return { render() {
10077
10074
  return i("div", {
10078
10075
  class: "sparq-designer-unavailable-component",
@@ -10082,7 +10079,7 @@ function tf(e) {
10082
10079
  }
10083
10080
  //#endregion
10084
10081
  //#region src/app/root.tsx
10085
- var nf = r({
10082
+ var tf = r({
10086
10083
  name: "SparqDesignerShell",
10087
10084
  props: {
10088
10085
  schema: {
@@ -10114,10 +10111,10 @@ var nf = r({
10114
10111
  let r = a(g, void 0), o = a(h, void 0), s = S(), c = n(() => e.richTextEditors ?? o ?? r?.richTextEditors ?? s), l = n(() => aa(e.extensions, e.components, e.services, e.icons, {
10115
10112
  materialKeys: e.materialKeys,
10116
10113
  nodePermissions: e.nodePermissions
10117
- })), f = d(Le(e.schema, e.view, l.value.services, l.value)), p = n(() => $d(f.schema, f.viewName, l.value.components, l.value)), _ = n(() => We(e.features));
10118
- of(l.value);
10114
+ })), f = d(Le(e.schema, e.view, l.value.services, l.value)), p = n(() => Qd(f.schema, f.viewName, l.value.components, l.value)), _ = n(() => We(e.features));
10115
+ af(l.value);
10119
10116
  let v, y = !1, b = () => {
10120
- e.onChange?.(rf(f.schema, e.outputScope));
10117
+ e.onChange?.(nf(f.schema, e.outputScope));
10121
10118
  };
10122
10119
  u(() => {
10123
10120
  v !== void 0 && (cancelAnimationFrame(v), v = void 0), y = !1;
@@ -10125,7 +10122,7 @@ var nf = r({
10125
10122
  let t = Pe(e, f.viewName);
10126
10123
  f.schema = t, f.schemaVersion += 1, f.savedSchema = Ne(t), f.history = [], f.future = [];
10127
10124
  }), m(l, (e) => {
10128
- f.extensionContext = e, f.serviceRegistry = Re(e.services), f.schemaVersion += 1, of(e);
10125
+ f.extensionContext = e, f.serviceRegistry = Re(e.services), f.schemaVersion += 1, af(e);
10129
10126
  }), m([() => f.schema, () => e.outputScope], () => {
10130
10127
  if (!(v !== void 0 || y)) {
10131
10128
  if (typeof requestAnimationFrame == "function") {
@@ -10138,13 +10135,13 @@ var nf = r({
10138
10135
  y && (y = !1, b());
10139
10136
  });
10140
10137
  }
10141
- }), m(() => f.schemaVersion, () => e.onDirtyChange?.(!af(f.schema, f.savedSchema)), { immediate: !0 });
10138
+ }), m(() => f.schemaVersion, () => e.onDirtyChange?.(!rf(f.schema, f.savedSchema)), { immediate: !0 });
10142
10139
  let x = async () => {
10143
10140
  if (f.saving) return;
10144
10141
  f.saving = !0;
10145
10142
  let t = Ne(f.schema);
10146
10143
  try {
10147
- let n = rf(t, e.outputScope);
10144
+ let n = nf(t, e.outputScope);
10148
10145
  await e.onSave?.(Ne(n)), f.savedSchema = t, f.future = [], f.schemaVersion += 1;
10149
10146
  } catch (t) {
10150
10147
  e.onSaveError ? await e.onSaveError(t) : console.error("[sparq-designer] 保存失败", t);
@@ -10152,9 +10149,9 @@ var nf = r({
10152
10149
  f.saving = !1;
10153
10150
  }
10154
10151
  };
10155
- t?.expose?.({ getOutputSchema: () => rf(f.schema, e.outputScope) });
10152
+ t?.expose?.({ getOutputSchema: () => nf(f.schema, e.outputScope) });
10156
10153
  let ee = () => {
10157
- let t = rf(f.schema, e.outputScope), n = new Blob([Fe(t)], { type: "application/json" }), r = URL.createObjectURL(n), i = document.createElement("a");
10154
+ let t = nf(f.schema, e.outputScope), n = new Blob([Fe(t)], { type: "application/json" }), r = URL.createObjectURL(n), i = document.createElement("a");
10158
10155
  i.href = r, i.download = `${f.schema.schema.name || "schema"}.json`, i.click(), URL.revokeObjectURL(r);
10159
10156
  }, C = () => {
10160
10157
  let t = document.createElement("input");
@@ -10185,28 +10182,28 @@ var nf = r({
10185
10182
  state: f,
10186
10183
  components: p.value,
10187
10184
  richTextEditors: c.value
10188
- })), /* @__PURE__ */ i(ed, {
10185
+ })), /* @__PURE__ */ i($u, {
10189
10186
  state: f,
10190
10187
  components: l.value.components,
10191
10188
  richTextEditors: c.value,
10192
10189
  showFormProperties: _.value.formProperties
10193
- })), _.value.resourceTree ? /* @__PURE__ */ i(Od, { state: f }) : void 0, _.value.jsonView ? /* @__PURE__ */ i(Td, { state: f }) : void 0, _.value.preview ? /* @__PURE__ */ i(Ed, {
10190
+ })), _.value.resourceTree ? /* @__PURE__ */ i(Dd, { state: f }) : void 0, _.value.jsonView ? /* @__PURE__ */ i(wd, { state: f }) : void 0, _.value.preview ? /* @__PURE__ */ i(Td, {
10194
10191
  state: f,
10195
10192
  components: l.value.components,
10196
10193
  richTextEditors: c.value
10197
10194
  }) : void 0);
10198
10195
  }
10199
10196
  });
10200
- function rf(e, t) {
10197
+ function nf(e, t) {
10201
10198
  return ze(e, t);
10202
10199
  }
10203
- function af(e, t) {
10200
+ function rf(e, t) {
10204
10201
  return t !== void 0 && JSON.stringify(e) === JSON.stringify(t);
10205
10202
  }
10206
- function of(e) {
10203
+ function af(e) {
10207
10204
  for (let t of e.diagnostics) console.warn(`[sparq-designer] ${t.message}`);
10208
10205
  }
10209
10206
  //#endregion
10210
- export { Ta as SortableList, nf as SparqDesigner, Ji as builtInDesignerMaterials, ui as createBuiltInDesignerComponentProperties, Na as createCanvasAdapter, aa as createDesignerExtensionContext, Ke as createDesignerNodePermissionPolicy, ze as createDesignerOutputSchema, Le as createState, Ue as defaultDesignerFeatures, Ge as defaultDesignerNodePermissions, I as designerCapabilityCardKeys, R as designerFieldCapabilityKeys, D as getFormChildren, Mt as insertDesignerMaterialInto, We as resolveDesignerFeatures };
10207
+ export { Ta as SortableList, tf as SparqDesigner, Ji as builtInDesignerMaterials, ui as createBuiltInDesignerComponentProperties, Na as createCanvasAdapter, aa as createDesignerExtensionContext, Ke as createDesignerNodePermissionPolicy, ze as createDesignerOutputSchema, Le as createState, Ue as defaultDesignerFeatures, Ge as defaultDesignerNodePermissions, I as designerCapabilityCardKeys, R as designerFieldCapabilityKeys, D as getFormChildren, Mt as insertDesignerMaterialInto, We as resolveDesignerFeatures };
10211
10208
 
10212
10209
  //# sourceMappingURL=index.js.map