@shwfed/config 2.8.0 → 2.9.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.
Files changed (110) hide show
  1. package/dist/mcp.mjs +61 -10
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{badge-BI1mdo92.js → badge-Ddz0ExD-.js} +1 -1
  4. package/dist/preview/assets/{config-XgVqueyq.js → config---5_lEKG.js} +1 -1
  5. package/dist/preview/assets/{config-OrJljNWU.js → config-5qIYVWZh.js} +1 -1
  6. package/dist/preview/assets/config-B8zbFg3y.js +1 -0
  7. package/dist/preview/assets/{config-DqUnpWZk.js → config-Bn619USg.js} +1 -1
  8. package/dist/preview/assets/{config-DuzQXHvg.js → config-CUeBTyLb.js} +1 -1
  9. package/dist/preview/assets/config-DN_3WauN.js +1 -0
  10. package/dist/preview/assets/config-U-3fWb-2.js +1 -0
  11. package/dist/preview/assets/config-q5VV9rp7.js +1 -0
  12. package/dist/preview/assets/config-vePqHFvZ.js +1 -0
  13. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-lEhYVEcN.js → definition.vue_vue_type_script_setup_true_lang-fQa65UMX.js} +1 -1
  14. package/dist/preview/assets/index-BKaqQGb-.js +688 -0
  15. package/dist/preview/assets/index-Bj8xIK5h.js +1 -0
  16. package/dist/preview/assets/index-BlHAyQdm.css +1 -0
  17. package/dist/preview/assets/{index-BvLLQuQr.js → index-CzWhSvDG.js} +1 -1
  18. package/dist/preview/assets/{item-DMtXi_cx.js → item-DHarupON.js} +1 -1
  19. package/dist/preview/assets/{runtime-CA58Mif7.js → runtime-560tuaHv.js} +1 -1
  20. package/dist/preview/assets/{runtime-CjJBU_e1.js → runtime-C2rQ3L3-.js} +1 -1
  21. package/dist/preview/assets/{runtime-DeUmGsM_.js → runtime-CKghL8I_.js} +1 -1
  22. package/dist/preview/assets/runtime-CMsaNery.js +1 -0
  23. package/dist/preview/assets/runtime-CMuCGJZm.js +1 -0
  24. package/dist/preview/assets/{runtime-wVZ1xP8L.js → runtime-DOM_La4X.js} +1 -1
  25. package/dist/preview/assets/{runtime-BUPuX-Gq.js → runtime-DQHb9t0r.js} +1 -1
  26. package/dist/preview/assets/{runtime-DnXoWy2A.js → runtime-Dgl3wVfD.js} +1 -1
  27. package/dist/preview/assets/{runtime-CWqQzWuc.js → runtime-aLgWVLET.js} +1 -1
  28. package/dist/preview/index.html +2 -2
  29. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.d.vue.ts +8 -0
  30. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue +28 -0
  31. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue.d.ts +8 -0
  32. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/runtime.vue +17 -17
  33. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.d.ts +4 -0
  34. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.js +8 -0
  35. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.d.vue.ts +8 -0
  36. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue +25 -0
  37. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue.d.ts +8 -0
  38. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/runtime.vue +2 -7
  39. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.d.ts +4 -0
  40. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.js +8 -0
  41. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +13 -2
  42. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.d.ts +1 -0
  43. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.js +4 -1
  44. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +10 -2
  45. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.d.ts +1 -0
  46. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.js +4 -1
  47. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +16 -0
  48. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +1 -0
  49. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +4 -1
  50. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +13 -5
  51. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +1 -0
  52. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +4 -1
  53. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +25 -5
  54. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +1 -0
  55. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +4 -1
  56. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +18 -8
  57. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +1 -0
  58. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +4 -1
  59. package/dist/runtime/components/form/index.vue +11 -3
  60. package/dist/runtime/components/form/schema.d.ts +4 -0
  61. package/dist/runtime/components/form/schema.js +1 -0
  62. package/dist/runtime/components/form/unit-config.vue +6 -1
  63. package/dist/runtime/components/form/utils/form-vars.js +2 -0
  64. package/dist/runtime/components/form/utils/resolve.d.ts +10 -0
  65. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue +13 -2
  66. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
  67. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.js +4 -1
  68. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +10 -2
  69. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
  70. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.js +4 -1
  71. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue +16 -0
  72. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
  73. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +3 -1
  74. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue +13 -5
  75. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
  76. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +3 -1
  77. package/dist/runtime/components/table/config.vue +5 -1
  78. package/dist/runtime/components/table/row-provider.vue +8 -0
  79. package/dist/runtime/components/table/utils/resolve.d.ts +7 -0
  80. package/dist/runtime/components/table/utils/shared.js +4 -0
  81. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.d.vue.ts +1 -0
  82. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue +9 -1
  83. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue.d.ts +1 -0
  84. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +2 -2
  85. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +33 -4
  86. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +2 -2
  87. package/dist/runtime/components/ui/expression-editor/picker-entries.d.ts +3 -2
  88. package/dist/runtime/components/ui/expression-editor/picker-entries.js +14 -3
  89. package/dist/runtime/components/ui/expression-editor/selection-chip-extension.d.ts +4 -0
  90. package/dist/runtime/components/ui/expression-editor/selection-chip-extension.js +119 -0
  91. package/dist/runtime/components/ui/expression-editor/selection-refs.d.ts +8 -0
  92. package/dist/runtime/components/ui/expression-editor/selection-refs.js +29 -0
  93. package/dist/runtime/share/event-bus.d.ts +12 -12
  94. package/dist/runtime/utils/cel-context.d.ts +22 -0
  95. package/dist/runtime/utils/cel-context.js +8 -0
  96. package/dist/runtime/utils/selections-registry.d.ts +77 -0
  97. package/dist/runtime/utils/selections-registry.js +49 -0
  98. package/package.json +1 -1
  99. package/dist/preview/assets/config-BNF2r9jW.js +0 -1
  100. package/dist/preview/assets/config-BxuGYvER.js +0 -1
  101. package/dist/preview/assets/config-Cy5w3JWQ.js +0 -1
  102. package/dist/preview/assets/config-Du5SuNSb.js +0 -1
  103. package/dist/preview/assets/config-ggyCcWNZ.js +0 -1
  104. package/dist/preview/assets/index-DsMR5NfK.css +0 -1
  105. package/dist/preview/assets/index-Yv78vz4W.js +0 -680
  106. package/dist/preview/assets/index-yrBKwEfk.js +0 -1
  107. package/dist/preview/assets/runtime-2S3Yr051.js +0 -1
  108. package/dist/preview/assets/runtime-C4jFTZ4Z.js +0 -1
  109. package/dist/runtime/share/form-validate.d.ts +0 -18
  110. package/dist/runtime/share/form-validate.js +0 -8
package/dist/mcp.mjs CHANGED
@@ -81637,6 +81637,14 @@ function schema$1h(configure) {
81637
81637
  用户确认后将立即被求值,当 HTTP 请求被成功构造后,调度器将尽可能快地安排执行这个请求
81638
81638
  `
81639
81639
  }),
81640
+ before: optional(Triggers.annotations({
81641
+ title: "确认前",
81642
+ description: md`
81643
+ 确认弹窗弹出前按列表顺序执行的操作。任一操作中止(例如表单校验未通过)将取消确认弹窗与请求。
81644
+
81645
+ 放在表单里的提交按钮应在此处首先触发所在表单的「校验」操作,使校验成为显式的提交前步骤。
81646
+ `
81647
+ })),
81640
81648
  markdown: Locale.annotations({
81641
81649
  title: "确认信息",
81642
81650
  description: "弹窗确认信息,支持 `{{ expression }}` 插值"
@@ -81719,6 +81727,14 @@ function schema$1g(configure) {
81719
81727
  点击后将立即被求值,当 HTTP 请求被成功构造后,调度器将尽可能快地安排执行这个请求
81720
81728
  `
81721
81729
  }),
81730
+ before: optional(Triggers.annotations({
81731
+ title: "请求前",
81732
+ description: md`
81733
+ 请求发起前按列表顺序执行的操作。任一操作中止(例如表单校验未通过)将取消本次请求。
81734
+
81735
+ 放在表单里的提交按钮应在此处首先触发所在表单的「校验」操作,使校验成为显式的提交前步骤。
81736
+ `
81737
+ })),
81722
81738
  messageExpression: optional(CelMessage.annotations({
81723
81739
  title: "消息",
81724
81740
  description: md`
@@ -90988,6 +91004,7 @@ const Icon = vueExports.defineComponent((props, { emit }) => {
90988
91004
  ],
90989
91005
  emits: ["load"]
90990
91006
  });
91007
+ const SELECTIONS_VAR = "selections";
90991
91008
  const Align = Literal2("left", "center", "right").annotations({
90992
91009
  description: "对齐方式"
90993
91010
  });
@@ -91080,6 +91097,9 @@ function registerRowVariablesIfAbsent(env) {
91080
91097
  if (!declared.has("index")) {
91081
91098
  env.registerVariable("index", "number", { label: "行序号", description: "行索引" });
91082
91099
  }
91100
+ if (!declared.has(SELECTIONS_VAR)) {
91101
+ env.registerVariable(SELECTIONS_VAR, "dyn", { label: "选中项", description: "本行各选择列当前选中项的完整对象(按列标识)" });
91102
+ }
91083
91103
  }
91084
91104
  function configureWithRow(configure) {
91085
91105
  return (env) => {
@@ -94059,7 +94079,10 @@ const type$p = "com.shwfed.table.column.combobox-multi";
94059
94079
  const compatibilityDate$p = "2026-05-28";
94060
94080
  const metadata$p = {
94061
94081
  name: "多选",
94062
- icon: "fluent:chevron-down-20-regular"
94082
+ icon: "fluent:chevron-down-20-regular",
94083
+ // Publishes its resolved options (array) to the per-row `selections` registry
94084
+ // (runtime.vue), readable via `selections["<id>"]`.
94085
+ selection: true
94063
94086
  };
94064
94087
  const isListType$5 = (actual) => actual === "dyn" || actual.startsWith("list");
94065
94088
  const isKeywordsType$1 = (actual) => actual === "dyn" || actual.startsWith("list") || actual.startsWith("optional");
@@ -94345,7 +94368,10 @@ const type$o = "com.shwfed.table.column.combobox-single";
94345
94368
  const compatibilityDate$o = "2026-05-28";
94346
94369
  const metadata$o = {
94347
94370
  name: "单选",
94348
- icon: "fluent:chevron-down-20-regular"
94371
+ icon: "fluent:chevron-down-20-regular",
94372
+ // Publishes its resolved option (the source record) to the per-row
94373
+ // `selections` registry (runtime.vue), readable via `selections["<id>"]`.
94374
+ selection: true
94349
94375
  };
94350
94376
  const isListType$4 = (actual) => actual === "dyn" || actual.startsWith("list");
94351
94377
  const isKeywordsType = (actual) => actual === "dyn" || actual.startsWith("list") || actual.startsWith("optional");
@@ -94631,7 +94657,9 @@ const type$n = "com.shwfed.table.column.tree-combobox-multi";
94631
94657
  const compatibilityDate$n = "2026-05-28";
94632
94658
  const metadata$n = {
94633
94659
  name: "下拉树(多选)",
94634
- icon: "fluent:tree-evergreen-20-regular"
94660
+ icon: "fluent:tree-evergreen-20-regular",
94661
+ // Publishes its resolved nodes (array) to the per-row `selections` registry (runtime.vue), readable via `selections["<id>"]`.
94662
+ selection: true
94635
94663
  };
94636
94664
  const isListLike$5 = (t) => t === "dyn" || t.startsWith("list") || t.startsWith("optional");
94637
94665
  const isKeyType$5 = (t) => t === "string" || t === "number" || t === "dyn";
@@ -94795,7 +94823,9 @@ const type$m = "com.shwfed.table.column.tree-combobox-single";
94795
94823
  const compatibilityDate$m = "2026-05-28";
94796
94824
  const metadata$m = {
94797
94825
  name: "下拉树(单选)",
94798
- icon: "fluent:tree-evergreen-20-regular"
94826
+ icon: "fluent:tree-evergreen-20-regular",
94827
+ // Publishes its resolved node (backend record) to the per-row `selections` registry (runtime.vue), readable via `selections["<id>"]`.
94828
+ selection: true
94799
94829
  };
94800
94830
  const isListLike$4 = (t) => t === "dyn" || t.startsWith("list") || t.startsWith("optional");
94801
94831
  const isKeyType$4 = (t) => t === "string" || t === "number" || t === "dyn";
@@ -96244,7 +96274,10 @@ const metadata$d = {
96244
96274
  name: "下拉多选",
96245
96275
  icon: "fluent:chevron-down-20-regular",
96246
96276
  w: { initial: 8, min: 4, max: Infinity },
96247
- h: { initial: 2, min: 2, max: 2 }
96277
+ h: { initial: 2, min: 2, max: 2 },
96278
+ // Publishes its resolved options (array, in selection order) to the
96279
+ // `selections` registry (runtime.vue), readable via `selections["<id>"]`.
96280
+ selection: true
96248
96281
  };
96249
96282
  const isListType$2 = (actual) => actual === "dyn" || actual.startsWith("list") || actual.startsWith("optional");
96250
96283
  function configureWithOption$1(configure) {
@@ -96436,7 +96469,10 @@ const metadata$c = {
96436
96469
  name: "下拉单选",
96437
96470
  icon: "fluent:chevron-down-20-regular",
96438
96471
  w: { initial: 8, min: 4, max: Infinity },
96439
- h: { initial: 2, min: 2, max: 2 }
96472
+ h: { initial: 2, min: 2, max: 2 },
96473
+ // Publishes its resolved option to the `selections` registry (runtime.vue), so
96474
+ // a sibling expression can read the full chosen record via `selections["<id>"]`.
96475
+ selection: true
96440
96476
  };
96441
96477
  const isListType$1 = (actual) => actual === "dyn" || actual.startsWith("list") || actual.startsWith("optional");
96442
96478
  function configureWithOption(configure) {
@@ -96654,7 +96690,10 @@ const metadata$b = {
96654
96690
  name: "下拉树(多选)",
96655
96691
  icon: "fluent:tree-evergreen-20-regular",
96656
96692
  w: { initial: 8, min: 4, max: Infinity },
96657
- h: { initial: 2, min: 2, max: 2 }
96693
+ h: { initial: 2, min: 2, max: 2 },
96694
+ // Publishes its resolved nodes (array, in selection order) to the `selections`
96695
+ // registry (runtime.vue), readable via `selections["<id>"]`.
96696
+ selection: true
96658
96697
  };
96659
96698
  const NODE_VAR$1 = {
96660
96699
  type: "dyn",
@@ -96791,7 +96830,10 @@ const metadata$a = {
96791
96830
  name: "下拉树(单选)",
96792
96831
  icon: "fluent:tree-evergreen-20-regular",
96793
96832
  w: { initial: 8, min: 4, max: Infinity },
96794
- h: { initial: 2, min: 2, max: 2 }
96833
+ h: { initial: 2, min: 2, max: 2 },
96834
+ // Publishes its resolved node (the backend record) to the `selections`
96835
+ // registry (runtime.vue), readable via `selections["<id>"]`.
96836
+ selection: true
96795
96837
  };
96796
96838
  const NODE_VAR = {
96797
96839
  type: "dyn",
@@ -96920,7 +96962,10 @@ const metadata$9 = {
96920
96962
  name: "树(多选)",
96921
96963
  icon: "fluent:tree-evergreen-20-regular",
96922
96964
  w: { initial: 8, min: 4, max: Infinity },
96923
- h: { initial: 8, min: 4, max: Infinity, grow: true }
96965
+ h: { initial: 8, min: 4, max: Infinity, grow: true },
96966
+ // Publishes its resolved nodes (array, in selection order) to the `selections`
96967
+ // registry (runtime.vue), readable via `selections["<id>"]`.
96968
+ selection: true
96924
96969
  };
96925
96970
  function schema$9(configure) {
96926
96971
  const CelBool = Expression({ configure, resultType: "bool" });
@@ -97067,7 +97112,10 @@ const metadata$8 = {
97067
97112
  name: "树(单选)",
97068
97113
  icon: "fluent:tree-evergreen-20-regular",
97069
97114
  w: { initial: 8, min: 4, max: Infinity },
97070
- h: { initial: 8, min: 4, max: Infinity, grow: true }
97115
+ h: { initial: 8, min: 4, max: Infinity, grow: true },
97116
+ // Publishes its resolved node (the backend record) to the `selections`
97117
+ // registry (runtime.vue), readable via `selections["<id>"]`.
97118
+ selection: true
97071
97119
  };
97072
97120
  function schema$8(configure) {
97073
97121
  const CelBool = Expression({ configure, resultType: "bool" });
@@ -97388,6 +97436,7 @@ function registerFormVariablesIfAbsent(env) {
97388
97436
  if (!declared.has("form")) env.registerVariable("form", "dyn", { label: "表单值", description: "当前表单状态" });
97389
97437
  if (!declared.has("undoable")) env.registerVariable("undoable", "bool", { label: "可撤销", description: "当前是否有可撤销的修改" });
97390
97438
  if (!declared.has("redoable")) env.registerVariable("redoable", "bool", { label: "可重做", description: "当前是否有可重做的修改" });
97439
+ if (!declared.has(SELECTIONS_VAR)) env.registerVariable(SELECTIONS_VAR, "dyn", { label: "选中项", description: "各选择字段当前选中项的完整对象(按字段标识)" });
97391
97440
  }
97392
97441
  const KIND$1 = "shwfed.component.form";
97393
97442
  function unitFields(configure) {
@@ -98437,6 +98486,7 @@ const formSubmitCancel = {
98437
98486
  '取消按钮用 `event.dispatch` 触发 `close` operation,target 是打开本表单的那个外层按钮的 id(`<modal-button-id>`)。modal.layout 类型的 action 在挂载时会把"打开它的按钮"作为可达 target 暴露给内部环境。',
98438
98487
  "保存按钮用 `http.request.json`:",
98439
98488
  " - `expression` 构造 HTTP 调用;`hostname` 和 `token` 是页面级全局 CEL 变量(见 MCP server 说明),不要在 fragment 内硬编码。`body(form)` 把整个表单当 body 发出去。",
98489
+ " - `before` 在请求发起前先触发所在表单的 `validate` 操作 —— 表单校验现在是显式的提交前步骤(不再隐式)。`<form-id>` 是包裹本 actions 字段的那个 form 的 id。校验不通过会中止链路,请求不会发出。",
98440
98490
  " - `messageExpression` 从响应里抽消息字符串显示给用户(成功 / 失败统一走这个)。",
98441
98491
  ' - `resultExpression` 返回字面量 `"success"` 或 `"error"` —— 只有 `"success"` 才会触发 `onSuccess`。',
98442
98492
  " - `onSuccess` 先关闭 modal,再触发外层表格的 `search` 操作让数据刷新。`<table-id>` 是 page 里那张 table 的 id。",
@@ -98474,6 +98524,7 @@ const formSubmitCancel = {
98474
98524
  type: "com.shwfed.actions.button.http.request.json",
98475
98525
  compatibilityDate: "2026-04-18",
98476
98526
  expression: "http.post(hostname + '/api/endpoint').header('access_token', token).header('Content-Type', 'application/json').body(form)",
98527
+ before: [{ target: "<form-id>", operation: "validate" }],
98477
98528
  messageExpression: "string(json.message)",
98478
98529
  resultExpression: "json.code == 0 ? 'success' : 'error'",
98479
98530
  onSuccess: [
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shwfed",
3
3
  "configKey": "shwfed",
4
- "version": "2.8.0",
4
+ "version": "2.9.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -1 +1 @@
1
- import{d as M,G as $,u as z,o as E,w as p,a as f,z as F,c as w,A as x,b as m,_ as y,H as I,I as L,J as N,K as O,L as A,e as t,g as J,f as P,h as g,i as S,j as V,p as G,l as H,k as K,r as T,m as U,s as W,M as D,N as Q,t as R,q as X,v as Y}from"./index-Yv78vz4W.js";const ee=M({name:"ShwfedBlockCardBadge",inheritAttrs:!1,__name:"badge",props:{badge:{}},setup(n){const a=n,{locale:k}=$(),j=W(),o=T(void 0);function i(){return U(j)}const b=t(()=>o.value===void 0?X():Y(o.value)),l=t(()=>D(a.badge.content,k.value)||""),C=t(()=>l.value?Q(l.value,g,{...i(),json:b.value}):""),B=t(()=>{const e=a.badge.show;if(!e)return!0;try{return R(g(e,{...i(),json:b.value}))}catch(r){return console.warn("[shwfed-card-badge] show evaluation failed",r),!0}});async function s(){const e=a.badge.request;if(!e)return;const r=i(),q=J(function*(){const v=yield*P(yield*g(e,r));return S(v)});try{o.value=await V(G(q,H))}catch(v){console.warn("[shwfed-card-badge] fetch failed",v)}}const c=t(()=>!!a.badge.request&&(a.badge.interval??0)>0),_=t(()=>Math.max(1,a.badge.interval??1)*1e3),u=K(),{pause:h,resume:d}=z(()=>{s()},_,{immediate:!1});return E(()=>{s(),c.value&&u.value&&d()}),p(u,e=>{c.value&&(e?(s(),d()):h())}),p(()=>[a.badge.request??"",a.badge.interval??0].join("|"),()=>{s(),c.value&&u.value?d():h()}),(e,r)=>l.value&&B.value?(f(),F(O,{key:0},[n.badge.dot?(f(),w(m(y),x({key:0,variant:n.badge.variant??"default",class:"size-2.5 min-w-0 rounded-full p-0"},e.$attrs),null,16,["variant"])):(f(),w(m(y),x({key:1,variant:n.badge.variant??"default"},e.$attrs),{default:I(()=>[L(m(N),{source:C.value,class:"max-w-none text-inherit [&_*]:text-inherit [&_p]:m-0"},null,8,["source"])]),_:1},16,["variant"]))],64)):A("",!0)}});export{ee as default};
1
+ import{d as M,G as $,u as z,o as E,w as p,a as f,z as F,c as w,A as x,b as m,_ as y,H as I,I as L,J as N,K as O,L as A,e as t,g as J,f as P,h as g,i as S,j as V,p as G,l as H,k as K,r as T,m as U,s as W,M as D,N as Q,t as R,q as X,v as Y}from"./index-BKaqQGb-.js";const ee=M({name:"ShwfedBlockCardBadge",inheritAttrs:!1,__name:"badge",props:{badge:{}},setup(n){const a=n,{locale:k}=$(),j=W(),o=T(void 0);function i(){return U(j)}const b=t(()=>o.value===void 0?X():Y(o.value)),l=t(()=>D(a.badge.content,k.value)||""),C=t(()=>l.value?Q(l.value,g,{...i(),json:b.value}):""),B=t(()=>{const e=a.badge.show;if(!e)return!0;try{return R(g(e,{...i(),json:b.value}))}catch(r){return console.warn("[shwfed-card-badge] show evaluation failed",r),!0}});async function s(){const e=a.badge.request;if(!e)return;const r=i(),q=J(function*(){const v=yield*P(yield*g(e,r));return S(v)});try{o.value=await V(G(q,H))}catch(v){console.warn("[shwfed-card-badge] fetch failed",v)}}const c=t(()=>!!a.badge.request&&(a.badge.interval??0)>0),_=t(()=>Math.max(1,a.badge.interval??1)*1e3),u=K(),{pause:h,resume:d}=z(()=>{s()},_,{immediate:!1});return E(()=>{s(),c.value&&u.value&&d()}),p(u,e=>{c.value&&(e?(s(),d()):h())}),p(()=>[a.badge.request??"",a.badge.interval??0].join("|"),()=>{s(),c.value&&u.value?d():h()}),(e,r)=>l.value&&B.value?(f(),F(O,{key:0},[n.badge.dot?(f(),w(m(y),x({key:0,variant:n.badge.variant??"default",class:"size-2.5 min-w-0 rounded-full p-0"},e.$attrs),null,16,["variant"])):(f(),w(m(y),x({key:1,variant:n.badge.variant??"default"},e.$attrs),{default:I(()=>[L(m(N),{source:C.value,class:"max-w-none text-inherit [&_*]:text-inherit [&_p]:m-0"},null,8,["source"])]),_:1},16,["variant"]))],64)):A("",!0)}});export{ee as default};
@@ -1 +1 @@
1
- import{d as k,Q as V,ae as b,z as m,I as e,H as l,b as a,a as f,U as _,V as v,W as u,X as r,J as p,Y as S,T as x,af as h,ag as y,ah as z,ai as T,K as w,a1 as D,aj as N,a3 as C,a4 as F}from"./index-Yv78vz4W.js";const M={class:"flex flex-col gap-3"},U=k({name:"ShwfedNavigationActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(g){const t=V(g,"modelValue"),c=b(()=>{}),d=o=>C(c,o)??o,n=o=>F(c,o),$=[{value:"_self",label:"当前页面打开"},{value:"_blank",label:"新页面打开"}];return(o,i)=>(f(),m("div",M,[e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[u(" "+r(d("url")),1)]),_:2},[n("url")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("url"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(S),{"model-value":t.value.url??"",placeholder:"例:'/detail/' + string(row.id)","result-type":"string",class:"min-h-10","onUpdate:modelValue":i[0]||(i[0]=s=>t.value={...t.value,url:s})},null,8,["model-value"])]),_:1}),e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[u(" "+r(d("mode")),1)]),_:2},[n("mode")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("mode"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(h),{"model-value":t.value.mode??"_self","onUpdate:modelValue":i[1]||(i[1]=s=>t.value={...t.value,mode:s})},{default:l(()=>[e(a(y),{class:"w-full"},{default:l(()=>[e(a(z))]),_:1}),e(a(T),null,{default:l(()=>[(f(),m(w,null,D($,s=>e(a(N),{key:s.value,value:s.value},{default:l(()=>[u(r(s.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])]),_:1})]))}});export{U as default};
1
+ import{d as k,Q as V,ae as b,z as m,I as e,H as l,b as a,a as f,U as _,V as v,W as u,X as r,J as p,Y as S,T as x,af as h,ag as y,ah as z,ai as T,K as w,a2 as D,aj as N,a3 as C,a4 as F}from"./index-BKaqQGb-.js";const M={class:"flex flex-col gap-3"},U=k({name:"ShwfedNavigationActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(g){const t=V(g,"modelValue"),c=b(()=>{}),d=o=>C(c,o)??o,n=o=>F(c,o),$=[{value:"_self",label:"当前页面打开"},{value:"_blank",label:"新页面打开"}];return(o,i)=>(f(),m("div",M,[e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[u(" "+r(d("url")),1)]),_:2},[n("url")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("url"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(S),{"model-value":t.value.url??"",placeholder:"例:'/detail/' + string(row.id)","result-type":"string",class:"min-h-10","onUpdate:modelValue":i[0]||(i[0]=s=>t.value={...t.value,url:s})},null,8,["model-value"])]),_:1}),e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[u(" "+r(d("mode")),1)]),_:2},[n("mode")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("mode"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(h),{"model-value":t.value.mode??"_self","onUpdate:modelValue":i[1]||(i[1]=s=>t.value={...t.value,mode:s})},{default:l(()=>[e(a(y),{class:"w-full"},{default:l(()=>[e(a(z))]),_:1}),e(a(T),null,{default:l(()=>[(f(),m(w,null,D($,s=>e(a(N),{key:s.value,value:s.value},{default:l(()=>[u(r(s.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])]),_:1})]))}});export{U as default};
@@ -1 +1 @@
1
- import{d as G,Q as ee,ak as le,al as te,w as I,am as A,z as v,c as H,I as n,H as s,b as l,an as ae,L as oe,K as W,ao as ne,X as p,S as c,ap as F,aq as R,ar as se,e as x,r as ie,y as K,a as d,as as O,at as h,a9 as j,au as q,U as B,V as b,W as L,J as U,Z as de,T as V,av as X,a3 as ue,a4 as ve,aw as ce,ax as re,ay as me,az as fe}from"./index-Yv78vz4W.js";const pe={key:0,class:"flex min-h-96 items-center justify-center p-8 text-sm text-zinc-400"},xe={key:1},ke={key:2,class:"p-6 text-sm text-red-500"},ye={key:2,class:"flex flex-col gap-4"},ge={class:"grid grid-cols-2 gap-4"},Ie={key:0,class:"flex gap-2 min-h-96"},Be={class:"flex w-56 shrink-0 flex-col"},be={class:"flex flex-1 flex-col gap-2"},Le={class:"flex-1"},Ue={key:1,class:"flex flex-col gap-2"},Ve={class:"h-96"},De=G({name:"ShwfedModalLayoutActionConfig",__name:"config",props:se({configure:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(_){const i=ee(_,"modelValue"),Y=_,D=x(()=>Y.configure??(()=>{})),E=le(()=>{}),k=a=>ue(E,a)??a,r=a=>ve(E,a),J=x({get:()=>i.value.slot??ce(),set:a=>{i.value={...i.value,slot:a}}}),t=te(J,{configure:D.value});function P(a){i.value={...i.value,modalTitle:a}}function T(a,e){const o=e.trim(),g={...i.value};o.length===0?Reflect.deleteProperty(g,a):g[a]=o,i.value=g}function S(){const a=t.layouts.value;t.layouts.value=[...a,{name:"新布局",layout:{columns:1,placements:{}}}],t.activeLayoutIndex.value=a.length}function z(a,e){t.addBlock(a,e)}function M(a){t.removeBlock(a)}function w(a){t.removeBlocks(a)}const u=ie(null),m=x(()=>{const a=u.value;return a?t.blocks.value.find(e=>e.id===a)??null:null}),$=x(()=>{const a=m.value;return a?re()?.(a.type,a.compatibilityDate)??null:null});function C(a){u.value=a}function Q(){u.value=null}I(()=>t.blocks.value.map(a=>a.id),a=>{const e=u.value;e&&!a.includes(e)&&(u.value=null)});function Z(a){const e=u.value;e&&t.updateBlock(e,a)}const N=K(me,null);if(N){const a=N.add();I(m,e=>{e?(a.label.value=t.getBlockLabel(e),a.back.value=Q):(a.label.value=null,a.back.value=null)},{immediate:!0}),A(()=>{a.dispose()})}const f=K(fe,null),y=x(()=>f?.target.value??null);return I(u,a=>{f?.drilled&&(f.drilled.value=!!a)},{immediate:!0}),A(()=>{f?.drilled&&(f.drilled.value=!1)}),(a,e)=>(d(),v(W,null,[y.value&&!u.value?(d(),H(ae,{key:0,to:y.value},[n(l(h),{class:"flex-1"},{default:s(()=>[n(O,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[0]||(e[0]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[1]||(e[1]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(q),{variant:"ghost",size:"sm",onClick:e[2]||(e[2]=o=>S())},{default:s(()=>[n(l(j),{icon:"fluent:add-20-regular",class:"size-4"}),e[17]||(e[17]=c("span",null,"新增布局",-1))]),_:1})],8,["to"])):oe("",!0),u.value?(d(),v(W,{key:1},[m.value?$.value?(d(),v("div",xe,[(d(),H(ne($.value.config),{"model-value":m.value,configure:D.value,"onUpdate:modelValue":e[3]||(e[3]=o=>Z(o))},null,8,["model-value","configure"]))])):(d(),v("div",ke," 未注册的块类型:"+p(m.value.type)+"@"+p(m.value.compatibilityDate),1)):(d(),v("div",pe," 块已不存在 "))],64)):(d(),v("div",ye,[n(l(V),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[L(" "+p(k("modalTitle")),1)]),_:2},[r("modalTitle")?{name:"tooltip",fn:s(()=>[n(l(U),{source:r("modalTitle"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(de),{markdown:"","model-value":i.value.modalTitle,"translate-hint":k("modalTitle"),"onUpdate:modelValue":P},null,8,["model-value","translate-hint"])]),_:1}),c("div",ge,[n(l(V),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[L(" "+p(k("modalWidth")),1)]),_:2},[r("modalWidth")?{name:"tooltip",fn:s(()=>[n(l(U),{source:r("modalWidth"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(X),{"model-value":i.value.modalWidth??"",placeholder:"例:720px / 60vw","onUpdate:modelValue":e[4]||(e[4]=o=>T("modalWidth",String(o)))},null,8,["model-value"])]),_:1}),n(l(V),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[L(" "+p(k("modalMinHeight")),1)]),_:2},[r("modalMinHeight")?{name:"tooltip",fn:s(()=>[n(l(U),{source:r("modalMinHeight"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(X),{"model-value":i.value.modalMinHeight??"",placeholder:"例:400px / 60vh","onUpdate:modelValue":e[5]||(e[5]=o=>T("modalMinHeight",String(o)))},null,8,["model-value"])]),_:1})]),y.value?(d(),v("div",Ue,[n(F,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[13]||(e[13]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",Ve,[n(R,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[14]||(e[14]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[15]||(e[15]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[16]||(e[16]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:z,onDrillDown:C,onDeleteItem:M,onDeleteItems:w},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])):(d(),v("div",Ie,[c("div",Be,[n(l(h),{class:"flex-1"},{default:s(()=>[n(O,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[6]||(e[6]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[7]||(e[7]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(q),{variant:"ghost",size:"sm",onClick:e[8]||(e[8]=o=>S())},{default:s(()=>[n(l(j),{icon:"fluent:add-20-regular",class:"size-4"}),e[18]||(e[18]=c("span",null,"新增布局",-1))]),_:1})]),c("div",be,[n(F,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[9]||(e[9]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",Le,[n(R,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[10]||(e[10]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[11]||(e[11]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[12]||(e[12]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:z,onDrillDown:C,onDeleteItem:M,onDeleteItems:w},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])]))]))],64))}});export{De as default};
1
+ import{d as G,Q as ee,ak as le,al as te,w as I,am as A,z as v,c as H,I as n,H as s,b as l,an as ae,L as oe,K as W,ao as ne,X as p,S as c,ap as F,aq as R,ar as se,e as x,r as ie,y as K,a as d,as as O,at as h,a9 as j,au as q,U as B,V as b,W as L,J as U,Z as de,T as V,av as X,a3 as ue,a4 as ve,aw as ce,ax as re,ay as me,az as fe}from"./index-BKaqQGb-.js";const pe={key:0,class:"flex min-h-96 items-center justify-center p-8 text-sm text-zinc-400"},xe={key:1},ke={key:2,class:"p-6 text-sm text-red-500"},ye={key:2,class:"flex flex-col gap-4"},ge={class:"grid grid-cols-2 gap-4"},Ie={key:0,class:"flex gap-2 min-h-96"},Be={class:"flex w-56 shrink-0 flex-col"},be={class:"flex flex-1 flex-col gap-2"},Le={class:"flex-1"},Ue={key:1,class:"flex flex-col gap-2"},Ve={class:"h-96"},De=G({name:"ShwfedModalLayoutActionConfig",__name:"config",props:se({configure:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(_){const i=ee(_,"modelValue"),Y=_,D=x(()=>Y.configure??(()=>{})),E=le(()=>{}),k=a=>ue(E,a)??a,r=a=>ve(E,a),J=x({get:()=>i.value.slot??ce(),set:a=>{i.value={...i.value,slot:a}}}),t=te(J,{configure:D.value});function P(a){i.value={...i.value,modalTitle:a}}function T(a,e){const o=e.trim(),g={...i.value};o.length===0?Reflect.deleteProperty(g,a):g[a]=o,i.value=g}function S(){const a=t.layouts.value;t.layouts.value=[...a,{name:"新布局",layout:{columns:1,placements:{}}}],t.activeLayoutIndex.value=a.length}function z(a,e){t.addBlock(a,e)}function M(a){t.removeBlock(a)}function w(a){t.removeBlocks(a)}const u=ie(null),m=x(()=>{const a=u.value;return a?t.blocks.value.find(e=>e.id===a)??null:null}),$=x(()=>{const a=m.value;return a?re()?.(a.type,a.compatibilityDate)??null:null});function C(a){u.value=a}function Q(){u.value=null}I(()=>t.blocks.value.map(a=>a.id),a=>{const e=u.value;e&&!a.includes(e)&&(u.value=null)});function Z(a){const e=u.value;e&&t.updateBlock(e,a)}const N=K(me,null);if(N){const a=N.add();I(m,e=>{e?(a.label.value=t.getBlockLabel(e),a.back.value=Q):(a.label.value=null,a.back.value=null)},{immediate:!0}),A(()=>{a.dispose()})}const f=K(fe,null),y=x(()=>f?.target.value??null);return I(u,a=>{f?.drilled&&(f.drilled.value=!!a)},{immediate:!0}),A(()=>{f?.drilled&&(f.drilled.value=!1)}),(a,e)=>(d(),v(W,null,[y.value&&!u.value?(d(),H(ae,{key:0,to:y.value},[n(l(h),{class:"flex-1"},{default:s(()=>[n(O,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[0]||(e[0]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[1]||(e[1]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(q),{variant:"ghost",size:"sm",onClick:e[2]||(e[2]=o=>S())},{default:s(()=>[n(l(j),{icon:"fluent:add-20-regular",class:"size-4"}),e[17]||(e[17]=c("span",null,"新增布局",-1))]),_:1})],8,["to"])):oe("",!0),u.value?(d(),v(W,{key:1},[m.value?$.value?(d(),v("div",xe,[(d(),H(ne($.value.config),{"model-value":m.value,configure:D.value,"onUpdate:modelValue":e[3]||(e[3]=o=>Z(o))},null,8,["model-value","configure"]))])):(d(),v("div",ke," 未注册的块类型:"+p(m.value.type)+"@"+p(m.value.compatibilityDate),1)):(d(),v("div",pe," 块已不存在 "))],64)):(d(),v("div",ye,[n(l(V),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[L(" "+p(k("modalTitle")),1)]),_:2},[r("modalTitle")?{name:"tooltip",fn:s(()=>[n(l(U),{source:r("modalTitle"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(de),{markdown:"","model-value":i.value.modalTitle,"translate-hint":k("modalTitle"),"onUpdate:modelValue":P},null,8,["model-value","translate-hint"])]),_:1}),c("div",ge,[n(l(V),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[L(" "+p(k("modalWidth")),1)]),_:2},[r("modalWidth")?{name:"tooltip",fn:s(()=>[n(l(U),{source:r("modalWidth"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(X),{"model-value":i.value.modalWidth??"",placeholder:"例:720px / 60vw","onUpdate:modelValue":e[4]||(e[4]=o=>T("modalWidth",String(o)))},null,8,["model-value"])]),_:1}),n(l(V),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[L(" "+p(k("modalMinHeight")),1)]),_:2},[r("modalMinHeight")?{name:"tooltip",fn:s(()=>[n(l(U),{source:r("modalMinHeight"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(X),{"model-value":i.value.modalMinHeight??"",placeholder:"例:400px / 60vh","onUpdate:modelValue":e[5]||(e[5]=o=>T("modalMinHeight",String(o)))},null,8,["model-value"])]),_:1})]),y.value?(d(),v("div",Ue,[n(F,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[13]||(e[13]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",Ve,[n(R,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[14]||(e[14]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[15]||(e[15]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[16]||(e[16]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:z,onDrillDown:C,onDeleteItem:M,onDeleteItems:w},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])):(d(),v("div",Ie,[c("div",Be,[n(l(h),{class:"flex-1"},{default:s(()=>[n(O,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[6]||(e[6]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[7]||(e[7]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(q),{variant:"ghost",size:"sm",onClick:e[8]||(e[8]=o=>S())},{default:s(()=>[n(l(j),{icon:"fluent:add-20-regular",class:"size-4"}),e[18]||(e[18]=c("span",null,"新增布局",-1))]),_:1})]),c("div",be,[n(F,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[9]||(e[9]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",Le,[n(R,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[10]||(e[10]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[11]||(e[11]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[12]||(e[12]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:z,onDrillDown:C,onDeleteItem:M,onDeleteItems:w},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])]))]))],64))}});export{De as default};
@@ -0,0 +1 @@
1
+ import{d as U,Q as k,aB as y,z as w,S as x,I as t,H as n,b as s,K as D,a2 as C,a as z,U as i,W as u,J as c,Y as d,T as p,aC as g,V as f,X as _,$ as F,a3 as H,a4 as $,e as S}from"./index-BKaqQGb-.js";const B={class:"flex flex-col gap-3"},L={class:"grid grid-cols-2 gap-3"},N={class:"flex items-start gap-2"},I={class:"grid grid-cols-2 gap-3"},A=U({name:"ShwfedHttpDownloadActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(q){const l=k(q,"modelValue"),E=y(()=>{}),m=a=>H(E,a)??a,r=a=>$(E,a),T=["onSuccess","onWarning","onError","onInfo"],h=S({get:()=>l.value.template?.request??"",set:a=>{l.value={...l.value,template:{...l.value.template,request:a}}}}),V=S({get:()=>l.value.template?.download??"",set:a=>{const e=l.value.template??{request:""};if(a.length===0){const{download:o,...v}=e;l.value={...l.value,template:v}}else l.value={...l.value,template:{...e,download:a}}}});function b(a){const e={...l.value};a.length===0?delete e.messageExpression:e.messageExpression=a,l.value=e}function j(a){const e={...l.value};a.length===0?delete e.resultExpression:e.resultExpression=a,l.value=e}function R(a,e){const o={...l.value};e.length===0?Reflect.deleteProperty(o,a):o[a]=e,l.value=o}return(a,e)=>(z(),w("div",B,[x("div",L,[t(s(p),{orientation:"vertical"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},{tooltip:n(()=>[t(s(c),{source:r("template")??"返回 `HttpRequest` 的 CEL 表达式;未配置「下载请求」时直接下载其响应",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:n(()=>[e[2]||(e[2]=u(" 请求 ",-1))]),_:1}),t(s(d),{"model-value":h.value,multiline:"",placeholder:"例:http.get('https://api.example.com/files/123')","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":e[0]||(e[0]=o=>h.value=o)},null,8,["model-value"])]),_:1}),t(s(p),{orientation:"vertical"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},{tooltip:n(()=>[t(s(c),{source:"可选的第二步:用第一步响应 `json` 中的凭据构造真正的下载请求,例如 `json.data.key`",block:"",class:"prose prose-sm prose-zinc"})]),default:n(()=>[e[3]||(e[3]=u(" 下载请求 ",-1))]),_:1}),t(s(d),{"model-value":V.value,multiline:"",placeholder:"例:http.get('https://api.example.com/download').query('key', json.data.key)","result-type":"HttpRequest","extra-vars":{json:s(g)},class:"min-h-16","onUpdate:modelValue":e[1]||(e[1]=o=>V.value=o)},null,8,["model-value","extra-vars"])]),_:1})]),x("div",N,[t(s(p),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m("messageExpression")),1)]),_:2},[r("messageExpression")?{name:"tooltip",fn:n(()=>[t(s(c),{source:r("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(s(d),{"model-value":l.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:s(g)},"onUpdate:modelValue":b},null,8,["model-value","extra-vars"])]),_:1}),t(s(p),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m("resultExpression")),1)]),_:2},[r("resultExpression")?{name:"tooltip",fn:n(()=>[t(s(c),{source:r("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(s(d),{"model-value":l.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:s(g)},"onUpdate:modelValue":j},null,8,["model-value","extra-vars"])]),_:1})]),x("div",I,[(z(),w(D,null,C(T,o=>t(s(p),{key:o,orientation:"vertical",class:"min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m(o)),1)]),_:2},[r(o)?{name:"tooltip",fn:n(()=>[t(s(c),{source:r(o),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(F,{triggers:l.value[o]??[],"onUpdate:triggers":v=>R(o,v)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{A as default};
@@ -1 +1 @@
1
- import{d as x,Q as k,b1 as V,z as g,I as e,H as l,b as a,a as S,U as u,V as m,W as d,X as f,J as p,av as z,T as _,Z as $,a3 as b,a4 as w}from"./index-Yv78vz4W.js";const T={class:"flex flex-col gap-4"},y=x({name:"ShwfedMarkdownItemConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(v){const t=k(v,"modelValue"),c=V(),r=o=>b(c,o)??o,s=o=>w(c,o);return(o,n)=>(S(),g("div",T,[e(a(_),{orientation:"vertical"},{default:l(()=>[e(a(u),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(r("name")),1)]),_:2},[s("name")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("name"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(z),{"model-value":t.value.name,placeholder:"仅用于编辑器内识别","onUpdate:modelValue":n[0]||(n[0]=i=>t.value={...t.value,name:String(i)})},null,8,["model-value"])]),_:1}),e(a(_),{orientation:"vertical"},{default:l(()=>[e(a(u),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(r("content")),1)]),_:2},[s("content")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("content"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a($),{markdown:"",multiline:"","model-value":t.value.content,"onUpdate:modelValue":n[1]||(n[1]=i=>t.value={...t.value,content:i})},null,8,["model-value"])]),_:1})]))}});export{y as default};
1
+ import{d as x,Q as k,b0 as V,z as g,I as e,H as l,b as a,a as S,U as u,V as m,W as d,X as f,J as p,av as z,T as _,Z as $,a3 as b,a4 as w}from"./index-BKaqQGb-.js";const T={class:"flex flex-col gap-4"},y=x({name:"ShwfedMarkdownItemConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(v){const t=k(v,"modelValue"),c=V(),r=o=>b(c,o)??o,s=o=>w(c,o);return(o,n)=>(S(),g("div",T,[e(a(_),{orientation:"vertical"},{default:l(()=>[e(a(u),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(r("name")),1)]),_:2},[s("name")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("name"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(z),{"model-value":t.value.name,placeholder:"仅用于编辑器内识别","onUpdate:modelValue":n[0]||(n[0]=i=>t.value={...t.value,name:String(i)})},null,8,["model-value"])]),_:1}),e(a(_),{orientation:"vertical"},{default:l(()=>[e(a(u),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(r("content")),1)]),_:2},[s("content")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("content"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a($),{markdown:"",multiline:"","model-value":t.value.content,"onUpdate:modelValue":n[1]||(n[1]=i=>t.value={...t.value,content:i})},null,8,["model-value"])]),_:1})]))}});export{y as default};
@@ -1 +1 @@
1
- import{d as _,Q as y,a6 as x,a7 as b,z as c,S as i,I as n,H as o,b as t,a as l,a8 as v,a9 as u,aa as g,ab as D,K as S,a1 as h,c as $,ac as k,X as p,ad as w}from"./index-Yv78vz4W.js";const z={class:"flex flex-col gap-3"},B={class:"flex-1"},C={class:"ml-auto text-xs tabular-nums text-zinc-400"},I=_({name:"ShwfedPrototypeActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(m){const r=y(m,"modelValue"),d=(()=>{const s=new Map;for(const e of x){if(e.type===b||e.deprecated)continue;const a=s.get(e.type);(!a||e.compatibilityDate>a.compatibilityDate)&&s.set(e.type,{type:e.type,compatibilityDate:e.compatibilityDate,name:e.metadata.name,icon:e.metadata.icon})}return[...s.values()].sort((e,a)=>e.name.localeCompare(a.name,"zh"))})();function f(s,e){r.value={type:s,compatibilityDate:e}}return(s,e)=>(l(),c("div",z,[e[0]||(e[0]=i("p",{class:"text-xs text-zinc-500"}," 原型按钮点击后无任何副作用,用于占位。选择下方任意类型可将其转换为正式按钮 —— 此转换仅能进行一次。 ",-1)),n(t(w),null,{default:o(()=>[n(t(v),{align:"inline-start"},{default:o(()=>[n(t(u),{icon:"fluent:arrow-swap-20-regular"})]),_:1}),n(t(g),null,{default:o(()=>[n(t(D),null,{default:o(()=>[(l(!0),c(S,null,h(t(d),a=>(l(),$(t(k),{key:a.type,value:a.type,onSelect:V=>f(a.type,a.compatibilityDate)},{default:o(()=>[n(t(u),{icon:a.icon,class:"size-4 shrink-0"},null,8,["icon"]),i("span",B,p(a.name),1),i("span",C,p(a.compatibilityDate),1)]),_:2},1032,["value","onSelect"]))),128))]),_:1})]),_:1})]),_:1})]))}});export{I as default};
1
+ import{d as _,Q as y,a6 as x,a7 as b,z as c,S as i,I as n,H as o,b as t,a as l,a8 as v,a9 as u,aa as g,ab as D,K as S,a2 as h,c as $,ac as k,X as p,ad as w}from"./index-BKaqQGb-.js";const z={class:"flex flex-col gap-3"},B={class:"flex-1"},C={class:"ml-auto text-xs tabular-nums text-zinc-400"},I=_({name:"ShwfedPrototypeActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(m){const r=y(m,"modelValue"),d=(()=>{const s=new Map;for(const e of x){if(e.type===b||e.deprecated)continue;const a=s.get(e.type);(!a||e.compatibilityDate>a.compatibilityDate)&&s.set(e.type,{type:e.type,compatibilityDate:e.compatibilityDate,name:e.metadata.name,icon:e.metadata.icon})}return[...s.values()].sort((e,a)=>e.name.localeCompare(a.name,"zh"))})();function f(s,e){r.value={type:s,compatibilityDate:e}}return(s,e)=>(l(),c("div",z,[e[0]||(e[0]=i("p",{class:"text-xs text-zinc-500"}," 原型按钮点击后无任何副作用,用于占位。选择下方任意类型可将其转换为正式按钮 —— 此转换仅能进行一次。 ",-1)),n(t(w),null,{default:o(()=>[n(t(v),{align:"inline-start"},{default:o(()=>[n(t(u),{icon:"fluent:arrow-swap-20-regular"})]),_:1}),n(t(g),null,{default:o(()=>[n(t(D),null,{default:o(()=>[(l(!0),c(S,null,h(t(d),a=>(l(),$(t(k),{key:a.type,value:a.type,onSelect:V=>f(a.type,a.compatibilityDate)},{default:o(()=>[n(t(u),{icon:a.icon,class:"size-4 shrink-0"},null,8,["icon"]),i("span",B,p(a.name),1),i("span",C,p(a.compatibilityDate),1)]),_:2},1032,["value","onSelect"]))),128))]),_:1})]),_:1})]),_:1})]))}});export{I as default};
@@ -0,0 +1 @@
1
+ import{d as E,a as z,z as S,x as U,O as $,b as s,P as j,Q as B,R as F,c as C,H as l,S as v,I as e,T as u,U as d,V as p,W as m,X as f,J as g,Y as k,Z as H,$ as y,a0 as N,a1 as O,K as R,a2 as h,a3 as D,a4 as P}from"./index-BKaqQGb-.js";const q=E({__name:"FieldGroup",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(_){const n=_;return(x,i)=>(z(),S("div",{"data-slot":"field-group",class:$(s(j)("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",n.class))},[U(x.$slots,"default")],2))}}),I={class:"grid grid-cols-2 gap-4"},J={class:"grid grid-cols-2 gap-4"},L={class:"flex items-start gap-2"},A={class:"grid grid-cols-2 gap-3"},W=E({name:"ShwfedHttpRequestConfirmActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const n=B(_,"modelValue"),x=F(()=>{}),i=r=>D(x,r)??r,a=r=>P(x,r);function c(r){const t={...n.value,...r};for(const[o,b]of Object.entries(r))b===void 0&&Reflect.deleteProperty(t,o);n.value=t}const w=["onSuccess","onWarning","onError","onInfo"];function V(r,t){c({[r]:t.length===0?void 0:t})}function T(r){c({before:r.length===0?void 0:r})}return(r,t)=>(z(),C(s(q),null,{default:l(()=>[v("div",I,[e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("expression")),1)]),_:2},[a("expression")?{name:"tooltip",fn:l(()=>[e(s(g),{source:a("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(k),{"model-value":n.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":t[0]||(t[0]=o=>c({expression:o}))},null,8,["model-value"])]),_:1}),e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("markdown")),1)]),_:2},[a("markdown")?{name:"tooltip",fn:l(()=>[e(s(g),{source:a("markdown"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(H),{markdown:"","model-value":n.value.markdown,"onUpdate:modelValue":t[1]||(t[1]=o=>c({markdown:o}))},null,8,["model-value"])]),_:1})]),e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("before")),1)]),_:2},[a("before")?{name:"tooltip",fn:l(()=>[e(s(g),{source:a("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(y,{triggers:n.value.before??[],"onUpdate:triggers":t[2]||(t[2]=o=>T(o))},null,8,["triggers"])]),_:1}),v("div",J,[e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("icon")),1)]),_:2},[a("icon")?{name:"tooltip",fn:l(()=>[e(s(g),{source:a("icon"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(N),{"model-value":n.value.icon??"","onUpdate:modelValue":t[3]||(t[3]=o=>c(o.trim()===""?{icon:void 0}:{icon:o}))},null,8,["model-value"])]),_:1}),e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("color")),1)]),_:2},[a("color")?{name:"tooltip",fn:l(()=>[e(s(g),{source:a("color"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(O),{"model-value":n.value.color??"","onUpdate:modelValue":t[4]||(t[4]=o=>c(o.trim()===""?{color:void 0}:{color:o}))},null,8,["model-value"])]),_:1})]),v("div",L,[e(s(u),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("messageExpression")),1)]),_:2},[a("messageExpression")?{name:"tooltip",fn:l(()=>[e(s(g),{source:a("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(k),{"model-value":n.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[5]||(t[5]=o=>c({messageExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1}),e(s(u),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("resultExpression")),1)]),_:2},[a("resultExpression")?{name:"tooltip",fn:l(()=>[e(s(g),{source:a("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(k),{"model-value":n.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[6]||(t[6]=o=>c({resultExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1})]),v("div",A,[(z(),S(R,null,h(w,o=>e(s(u),{key:o,orientation:"vertical",class:"min-w-0"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i(o)),1)]),_:2},[a(o)?{name:"tooltip",fn:l(()=>[e(s(g),{source:a(o),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(y,{triggers:n.value[o]??[],"onUpdate:triggers":b=>V(o,b)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]),_:1}))}});export{W as default};
@@ -0,0 +1 @@
1
+ import{d as k,Q as w,a5 as R,z as v,I as e,H as a,b as t,S as _,K as F,a2 as H,a as E,U as u,V as c,W as d,X as p,J as f,Y as g,T as m,$ as b,a3 as N,a4 as $}from"./index-BKaqQGb-.js";const j={class:"flex flex-col gap-3"},B={class:"flex items-start gap-2"},D={class:"grid grid-cols-2 gap-3"},q=k({name:"ShwfedHttpRequestActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(h){const l=w(h,"modelValue"),x=R(()=>{}),i=o=>N(x,o)??o,n=o=>$(x,o),S=["onSuccess","onWarning","onError","onInfo"];function z(o){const s={...l.value};o.length===0?delete s.messageExpression:s.messageExpression=o,l.value=s}function T(o){const s={...l.value};o.length===0?delete s.resultExpression:s.resultExpression=o,l.value=s}function y(o,s){const r={...l.value};s.length===0?Reflect.deleteProperty(r,o):r[o]=s,l.value=r}function V(o){const s={...l.value};o.length===0?Reflect.deleteProperty(s,"before"):s.before=o,l.value=s}return(o,s)=>(E(),v("div",j,[e(t(m),{orientation:"vertical"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":s[0]||(s[0]=r=>l.value={...l.value,expression:r})},null,8,["model-value"])]),_:1}),e(t(m),{orientation:"vertical"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("before")),1)]),_:2},[n("before")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(b,{triggers:l.value.before??[],"onUpdate:triggers":s[1]||(s[1]=r=>V(r))},null,8,["triggers"])]),_:1}),_("div",B,[e(t(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("messageExpression")),1)]),_:2},[n("messageExpression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":z},null,8,["model-value"])]),_:1}),e(t(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("resultExpression")),1)]),_:2},[n("resultExpression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":T},null,8,["model-value"])]),_:1})]),_("div",D,[(E(),v(F,null,H(S,r=>e(t(m),{key:r,orientation:"vertical",class:"min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i(r)),1)]),_:2},[n(r)?{name:"tooltip",fn:a(()=>[e(t(f),{source:n(r),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(b,{triggers:l.value[r]??[],"onUpdate:triggers":U=>y(r,U)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{q as default};
@@ -0,0 +1 @@
1
+ import{d as g,Q as d,a3 as u,aA as f,z as m,I as s,H as i,b as r,a as p,U as _,W as v,X as x,$ as h,T,e as V}from"./index-BKaqQGb-.js";const C={class:"flex flex-col gap-3"},$=g({name:"ShwfedEventDispatchActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(l){const t=d(l,"modelValue"),o=u(f(),"triggers")??"触发的操作",n=V(()=>t.value.triggers??[]);function c(a){const e={...t.value};a.length===0?Reflect.deleteProperty(e,"triggers"):e.triggers=a,t.value=e}return(a,e)=>(p(),m("div",C,[s(r(T),{orientation:"vertical"},{default:i(()=>[s(r(_),{class:"text-xs text-zinc-500"},{default:i(()=>[v(x(r(o)),1)]),_:1}),s(h,{triggers:n.value,"onUpdate:triggers":c},null,8,["triggers"])]),_:1})]))}});export{$ as default};
@@ -0,0 +1 @@
1
+ import{d as v,Q as S,aD as h,a as V,z as k,I as s,H as l,b as t,U as r,V as u,W as d,X as p,J as m,Y as T,T as f,$ as y,a3 as z,a4 as $}from"./index-BKaqQGb-.js";const w={class:"flex flex-col gap-3"},b=v({name:"ShwfedStateWriteActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const o=S(_,"modelValue"),i=h(()=>{}),c=e=>z(i,e)??e,n=e=>$(i,e);function g(e){const a={...o.value};e.length===0?Reflect.deleteProperty(a,"onSuccess"):a.onSuccess=e,o.value=a}return(e,a)=>(V(),k("div",w,[s(t(f),{orientation:"vertical"},{default:l(()=>[s(t(r),{class:"text-xs text-zinc-500"},u({default:l(()=>[d(" "+p(c("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:l(()=>[s(t(m),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(t(T),{"model-value":o.value.expression,multiline:"",placeholder:"例:{ invoices: rows, totalAmount: rows.map(r, r.amount).sum() }","result-type":"map",class:"min-h-16","onUpdate:modelValue":a[0]||(a[0]=x=>o.value={...o.value,expression:x})},null,8,["model-value"])]),_:1}),s(t(f),{orientation:"vertical"},{default:l(()=>[s(t(r),{class:"text-xs text-zinc-500"},u({default:l(()=>[d(" "+p(c("onSuccess")),1)]),_:2},[n("onSuccess")?{name:"tooltip",fn:l(()=>[s(t(m),{source:n("onSuccess"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(y,{triggers:o.value.onSuccess??[],"onUpdate:triggers":g},null,8,["triggers"])]),_:1})]))}});export{b as default};
@@ -1 +1 @@
1
- import{d as f,a_ as u,o as m,a$ as p,am as g,L as l,y,b0 as I}from"./index-Yv78vz4W.js";const w=f({name:"ShwfedActionDefinition",inheritAttrs:!1,__name:"definition",props:{actionId:{},effect:{}},setup(r){const n=r,a=u(),t=y(I,void 0),i=crypto.randomUUID(),c=import.meta.dev;let e,s=!1;function d(){!c||s||(s=!0,console.warn("[shwfed-action-definition] must be used inside <shwfed-actions>."))}function o(){if(!t){d();return}e&&e!==n.actionId&&t.unregisterAction(e,i),t.registerAction({ownerId:i,actionId:n.actionId,effect:n.effect,render:a.default}),e=n.actionId}return o(),m(()=>{o()}),p(()=>{o()}),g(()=>{!t||!e||t.unregisterAction(e,i)}),(_,A)=>l("",!0)}});export{w as _};
1
+ import{d as f,aZ as u,o as m,a_ as p,am as g,L as l,y,a$ as I}from"./index-BKaqQGb-.js";const w=f({name:"ShwfedActionDefinition",inheritAttrs:!1,__name:"definition",props:{actionId:{},effect:{}},setup(r){const n=r,a=u(),t=y(I,void 0),i=crypto.randomUUID(),c=import.meta.dev;let e,s=!1;function d(){!c||s||(s=!0,console.warn("[shwfed-action-definition] must be used inside <shwfed-actions>."))}function o(){if(!t){d();return}e&&e!==n.actionId&&t.unregisterAction(e,i),t.registerAction({ownerId:i,actionId:n.actionId,effect:n.effect,render:a.default}),e=n.actionId}return o(),m(()=>{o()}),p(()=>{o()}),g(()=>{!t||!e||t.unregisterAction(e,i)}),(_,A)=>l("",!0)}});export{w as _};