@farris/ui-vue 1.8.0-alpha.0 → 1.8.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/components/avatar/index.esm.js +138 -1526
  2. package/components/avatar/index.umd.cjs +1 -6
  3. package/components/button/index.css +1 -1
  4. package/components/button/index.esm.js +15951 -15410
  5. package/components/button/index.umd.cjs +27 -27
  6. package/components/calendar/index.esm.js +269 -255
  7. package/components/calendar/index.umd.cjs +3 -3
  8. package/components/collection-property-editor/index.esm.js +243 -229
  9. package/components/collection-property-editor/index.umd.cjs +2 -2
  10. package/components/combo-list/index.esm.js +32 -32
  11. package/components/combo-list/index.umd.cjs +1 -1
  12. package/components/comment/index.esm.js +473 -456
  13. package/components/comment/index.umd.cjs +6 -6
  14. package/components/component/index.css +1 -1
  15. package/components/component/index.esm.js +2503 -2239
  16. package/components/component/index.umd.cjs +2 -2
  17. package/components/condition/index.esm.js +1064 -954
  18. package/components/condition/index.umd.cjs +2 -2
  19. package/components/data-grid/index.esm.js +1 -1
  20. package/components/data-grid/index.umd.cjs +1 -1
  21. package/components/designer-canvas/index.css +1 -1
  22. package/components/designer-canvas/index.esm.js +3894 -3058
  23. package/components/designer-canvas/index.umd.cjs +1 -1
  24. package/components/drawer/index.esm.js +91 -77
  25. package/components/drawer/index.umd.cjs +2 -2
  26. package/components/dynamic-form/index.esm.js +220 -215
  27. package/components/dynamic-form/index.umd.cjs +1 -1
  28. package/components/dynamic-resolver/index.esm.js +145 -131
  29. package/components/dynamic-resolver/index.umd.cjs +2 -2
  30. package/components/dynamic-view/index.esm.js +336 -329
  31. package/components/dynamic-view/index.umd.cjs +1 -1
  32. package/components/events-editor/index.esm.js +1611 -1536
  33. package/components/events-editor/index.umd.cjs +3 -3
  34. package/components/expression-editor/index.esm.js +219 -219
  35. package/components/expression-editor/index.umd.cjs +2 -2
  36. package/components/external-container/index.esm.js +179 -178
  37. package/components/external-container/index.umd.cjs +1 -1
  38. package/components/fieldset/index.esm.js +285 -221
  39. package/components/fieldset/index.umd.cjs +1 -1
  40. package/components/filter-bar/index.css +1 -0
  41. package/components/filter-bar/index.esm.js +1512 -1290
  42. package/components/filter-bar/index.umd.cjs +7 -7
  43. package/components/filter-condition-editor/index.esm.js +851 -831
  44. package/components/filter-condition-editor/index.umd.cjs +3 -3
  45. package/components/flow-canvas/index.esm.js +520 -501
  46. package/components/flow-canvas/index.umd.cjs +8 -8
  47. package/components/image/index.esm.js +101 -79
  48. package/components/image/index.umd.cjs +3 -3
  49. package/components/language-textbox/index.esm.js +330 -251
  50. package/components/language-textbox/index.umd.cjs +2 -2
  51. package/components/list-nav/index.esm.js +399 -313
  52. package/components/list-nav/index.umd.cjs +1 -1
  53. package/components/locale/index.esm.js +3 -0
  54. package/components/locale/index.umd.cjs +1 -1
  55. package/components/lookup/index.esm.js +997 -976
  56. package/components/lookup/index.umd.cjs +2 -2
  57. package/components/mapping-editor/index.esm.js +725 -705
  58. package/components/mapping-editor/index.umd.cjs +1 -1
  59. package/components/message-box/index.esm.js +542 -522
  60. package/components/message-box/index.umd.cjs +1 -1
  61. package/components/nav/index.esm.js +95 -308
  62. package/components/nav/index.umd.cjs +1 -1
  63. package/components/number-range/index.esm.js +115 -107
  64. package/components/number-range/index.umd.cjs +2 -2
  65. package/components/order/index.esm.js +56 -54
  66. package/components/order/index.umd.cjs +1 -1
  67. package/components/page-footer/index.esm.js +135 -123
  68. package/components/page-footer/index.umd.cjs +1 -1
  69. package/components/page-header/index.esm.js +266 -222
  70. package/components/page-header/index.umd.cjs +1 -1
  71. package/components/property-panel/index.esm.js +402 -375
  72. package/components/property-panel/index.umd.cjs +4 -4
  73. package/components/query-solution/index.esm.js +3171 -3061
  74. package/components/query-solution/index.umd.cjs +7 -7
  75. package/components/response-toolbar/index.esm.js +1 -1
  76. package/components/response-toolbar/index.umd.cjs +1 -1
  77. package/components/schema-selector/index.esm.js +1620 -1608
  78. package/components/schema-selector/index.umd.cjs +5 -5
  79. package/components/scroll-navbar/index.esm.js +150 -136
  80. package/components/scroll-navbar/index.umd.cjs +2 -2
  81. package/components/section/index.esm.js +323 -311
  82. package/components/section/index.umd.cjs +2 -2
  83. package/components/sort-condition-editor/index.esm.js +850 -830
  84. package/components/sort-condition-editor/index.umd.cjs +3 -3
  85. package/components/step/index.esm.js +991 -224
  86. package/components/step/index.umd.cjs +1 -1
  87. package/components/tabs/index.esm.js +356 -334
  88. package/components/tabs/index.umd.cjs +1 -1
  89. package/components/wizard/index.esm.js +159 -162
  90. package/components/wizard/index.umd.cjs +1 -1
  91. package/designer/avatar/index.esm.js +1721 -0
  92. package/designer/avatar/index.umd.cjs +6 -0
  93. package/designer/button-edit/index.esm.js +2 -1
  94. package/designer/button-edit/index.umd.cjs +1 -1
  95. package/designer/data-grid/index.esm.js +693 -659
  96. package/designer/data-grid/index.umd.cjs +6 -6
  97. package/designer/data-view/index.esm.js +90 -78
  98. package/designer/data-view/index.umd.cjs +2 -2
  99. package/designer/date-picker/index.esm.js +203 -203
  100. package/designer/date-picker/index.umd.cjs +1 -1
  101. package/designer/drawer/index.esm.js +181 -167
  102. package/designer/drawer/index.umd.cjs +2 -2
  103. package/designer/dynamic-form/index.esm.js +228 -206
  104. package/designer/dynamic-form/index.umd.cjs +2 -2
  105. package/designer/farris-designer.all.esm.js +10014 -9692
  106. package/designer/farris-designer.all.umd.cjs +18 -18
  107. package/designer/index.css +1 -1
  108. package/designer/input-group/index.esm.js +15 -15
  109. package/designer/input-group/index.umd.cjs +1 -1
  110. package/designer/nav/index.esm.js +1719 -0
  111. package/designer/nav/index.umd.cjs +6 -0
  112. package/designer/number-spinner/index.esm.js +8 -7
  113. package/designer/number-spinner/index.umd.cjs +1 -1
  114. package/designer/radio-group/index.esm.js +133 -125
  115. package/designer/radio-group/index.umd.cjs +2 -2
  116. package/designer/response-toolbar/index.esm.js +864 -863
  117. package/designer/response-toolbar/index.umd.cjs +1 -1
  118. package/designer/section/index.esm.js +245 -183
  119. package/designer/section/index.umd.cjs +1 -1
  120. package/designer/tabs/index.css +1 -1
  121. package/designer/tabs/index.esm.js +3667 -2810
  122. package/designer/tabs/index.umd.cjs +2 -2
  123. package/designer/time-picker/index.esm.js +26 -17
  124. package/designer/time-picker/index.umd.cjs +2 -2
  125. package/designer/tree-grid/index.esm.js +69 -37
  126. package/designer/tree-grid/index.umd.cjs +1 -1
  127. package/designer/wizard/index.esm.js +110 -110
  128. package/designer/wizard/index.umd.cjs +3 -3
  129. package/farris.all.esm.js +39993 -39089
  130. package/farris.all.umd.cjs +36 -36
  131. package/index.css +1 -1
  132. package/locales/filter-bar/ui/en.json +1 -0
  133. package/locales/filter-bar/ui/zh-CHS.json +1 -0
  134. package/locales/filter-bar/ui/zh-CHT.json +1 -0
  135. package/locales/ui/en.json +1 -0
  136. package/locales/ui/zh-CHS.json +1 -0
  137. package/locales/ui/zh-CHT.json +1 -0
  138. package/package.json +1 -1
  139. package/types/avatar/designer.d.ts +28 -0
  140. package/types/avatar/index.d.ts +0 -15
  141. package/types/avatar/src/composition/types.d.ts +3 -0
  142. package/types/avatar/src/composition/use-file.d.ts +19 -0
  143. package/types/avatar/src/composition/use-image.d.ts +1 -1
  144. package/types/avatar/src/designer/avatar.design.props.d.ts +24 -0
  145. package/types/avatar/src/property-config/avatar.property-config.d.ts +11 -13
  146. package/types/avatar/src/schema/schema-mapper.d.ts +2 -0
  147. package/types/components.d.ts +3 -0
  148. package/types/condition/index.d.ts +18 -6
  149. package/types/condition/src/condition-fields.component.d.ts +9 -3
  150. package/types/condition/src/condition-fields.design.component.d.ts +9 -3
  151. package/types/condition/src/condition-list.component.d.ts +9 -3
  152. package/types/condition/src/condition.props.d.ts +11 -0
  153. package/types/data-view/designer/property-config/use-appearance.d.ts +17 -10
  154. package/types/data-view/designer/property-config/use-pagination.d.ts +0 -6
  155. package/types/designer-canvas/src/composition/dg-control.d.ts +13 -0
  156. package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -0
  157. package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.props.d.ts +4 -0
  158. package/types/dynamic-resolver/src/converter/tree-auto-check.converter.d.ts +3 -0
  159. package/types/dynamic-view/src/components/maps.d.ts +130 -4
  160. package/types/filter-bar/src/composition/types.d.ts +2 -0
  161. package/types/filter-bar/src/filter-bar.props.d.ts +0 -1
  162. package/types/filter-bar/src/locale/locale.d.ts +2 -1
  163. package/types/filter-bar/src/property-config/filter-bar.property-config.d.ts +0 -1
  164. package/types/language-textbox/index.d.ts +65 -2
  165. package/types/language-textbox/src/designer/language-textbox.design.component.d.ts +36 -0
  166. package/types/language-textbox/src/language-textbox.component.d.ts +38 -1
  167. package/types/language-textbox/src/language-textbox.props.d.ts +20 -0
  168. package/types/lookup/src/components/popup-container.component.d.ts +3 -3
  169. package/types/lookup/src/composition/use-compat.d.ts +28 -0
  170. package/types/lookup/src/composition/use-state.d.ts +1 -0
  171. package/types/message-box/src/message-box.service.d.ts +2 -1
  172. package/types/nav/designer.d.ts +28 -0
  173. package/types/nav/index.d.ts +24 -20
  174. package/types/nav/src/designer/nav.design.props.d.ts +29 -0
  175. package/types/nav/src/designer/use-design-rules.d.ts +3 -0
  176. package/types/nav/src/property-config/nav.property-config.d.ts +9 -0
  177. package/types/nav/src/schema/schema-mapper.d.ts +4 -0
  178. package/types/page-footer/src/designer/use-designer-rules.d.ts +2 -2
  179. package/types/page-header/src/designer/use-designer-rules.d.ts +2 -2
  180. package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -0
  181. package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +1 -1
  182. package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +1 -1
  183. package/types/section/src/designer/section.design.props.d.ts +4 -0
  184. package/types/section/src/property-config/section.property-config.d.ts +39 -0
  185. package/types/section/src/schema/toolbar-resolver.d.ts +0 -1
  186. package/types/step/src/designer/use-designer-rules.d.ts +3 -0
  187. package/types/step/src/designer/use-step-creator.d.ts +6 -0
  188. package/types/step/src/property-config/step.property-config.d.ts +15 -0
  189. package/types/step/src/schema/schema-resolver.d.ts +2 -1
  190. package/types/tabs/src/composition/types.d.ts +4 -0
  191. package/types/tabs/src/tabs.props.d.ts +6 -0
  192. package/types/tooltip/index.d.ts +3 -3
  193. package/types/tooltip/src/tooltip.component.d.ts +2 -2
@@ -1,14 +1,63 @@
1
- import { defineComponent as A, ref as u, computed as d, watch as N, createVNode as c, inject as V, onMounted as E } from "vue";
2
- import { resolveAppearance as G, createPropsResolver as H } from "../dynamic-resolver/index.esm.js";
3
- import { getCustomClass as q } from "../common/index.esm.js";
4
- import { useDesignerComponent as J } from "../designer-canvas/index.esm.js";
5
- const K = /* @__PURE__ */ new Map([
6
- ["appearance", G]
1
+ var z = Object.defineProperty;
2
+ var A = (a, e, t) => e in a ? z(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
+ var w = (a, e, t) => A(a, typeof e != "symbol" ? e + "" : e, t);
4
+ import { defineComponent as j, ref as T, computed as M, watch as q, createVNode as b, inject as O, onMounted as L } from "vue";
5
+ import { resolveAppearance as _, createPropsResolver as G } from "../dynamic-resolver/index.esm.js";
6
+ import { getCustomClass as B } from "../common/index.esm.js";
7
+ import { DgControl as U, canvasChanged as J, refreshCanvas as K, useDesignerComponent as Q } from "../designer-canvas/index.esm.js";
8
+ import { cloneDeep as W } from "lodash-es";
9
+ const X = /* @__PURE__ */ new Map([
10
+ ["appearance", _]
7
11
  ]);
8
- function Q(l, p, a) {
9
- return p;
12
+ function Y(a, e) {
13
+ const {
14
+ formSchemaUtils: t,
15
+ designViewModelUtils: s
16
+ } = e;
17
+ function i(l, o) {
18
+ var c, p, m, h;
19
+ return (p = (c = o == null ? void 0 : o.parentComponentInstance) == null ? void 0 : c.schema) == null || p.type, (h = (m = t.getFormSchema()) == null ? void 0 : m.module) == null || h.templateId, l;
20
+ }
21
+ function r(l) {
22
+ const o = a.getSchemaByType("component");
23
+ return Object.assign(o, {
24
+ id: `${l.componentId}-component`,
25
+ contents: [],
26
+ type: "wizard",
27
+ appearance: {
28
+ class: "h-100"
29
+ },
30
+ steps: [],
31
+ clickable: !0,
32
+ fill: !1,
33
+ direction: "vertical",
34
+ activeIndex: 0
35
+ }), o;
36
+ }
37
+ function n(l) {
38
+ const o = r(l);
39
+ return i(o, l);
40
+ }
41
+ return { createComponent: n };
42
+ }
43
+ function Z(a, e, t, s) {
44
+ var r, n, l, o, c, p;
45
+ const i = t.parentComponentInstance;
46
+ if (i && s) {
47
+ const m = Math.random().toString(36).slice(2, 6), h = {
48
+ componentId: `step-${m}`,
49
+ componentName: ((r = t.bindingSourceContext) == null ? void 0 : r.entityTitle) || ((l = (n = t.bindingSourceContext) == null ? void 0 : n.bindingEntity) == null ? void 0 : l.name) || `列表-${m}`,
50
+ componentType: "step",
51
+ parentContainerId: i.schema.id,
52
+ parentComponentInstance: i,
53
+ bindTo: ((o = t.bindingSourceContext) == null ? void 0 : o.bindTo) || "",
54
+ dataSource: (p = (c = t.bindingSourceContext) == null ? void 0 : c.bindingEntity) == null ? void 0 : p.label
55
+ }, { createComponent: V } = Y(a, s);
56
+ return V(h);
57
+ } else
58
+ return e;
10
59
  }
11
- const U = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-design.gitee.io/step.schema.json", X = "step", Y = "A Farris Component", Z = "object", _ = {
60
+ const D = "https://json-schema.org/draft/2020-12/schema", H = "https://farris-design.gitee.io/step.schema.json", ee = "step", te = "A Farris Component", se = "object", ie = {
12
61
  id: {
13
62
  description: "The unique identifier for step",
14
63
  type: "string"
@@ -40,75 +89,47 @@ const U = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-de
40
89
  type: "string",
41
90
  default: !1
42
91
  },
43
- editable: {
92
+ visible: {
44
93
  description: "",
45
94
  type: "boolean",
46
95
  default: !0
47
96
  },
48
- placeholder: {
49
- description: "",
50
- type: "string",
51
- default: ""
52
- },
53
- readonly: {
54
- description: "",
55
- type: "boolean",
56
- default: !1
97
+ direction: {
98
+ description: "排列方式",
99
+ type: "enum",
100
+ default: "horizontal"
57
101
  },
58
- require: {
59
- description: "",
60
- type: "boolean",
61
- default: !1
102
+ steps: {
103
+ description: "步骤条",
104
+ type: "array"
62
105
  },
63
- tabindex: {
64
- description: "",
106
+ activeIndex: {
107
+ description: "当前索引",
65
108
  type: "number",
66
109
  default: -1
67
110
  },
68
- visible: {
69
- description: "",
111
+ clickable: {
112
+ description: "是否允许点击",
113
+ type: "boolean",
114
+ default: !0
115
+ },
116
+ fill: {
117
+ description: "是否填充",
70
118
  type: "boolean",
71
119
  default: !0
72
120
  }
73
- }, I = [
121
+ }, ne = [
74
122
  "id",
75
123
  "type"
76
- ], x = {
77
- $schema: U,
78
- $id: W,
79
- title: X,
80
- description: Y,
81
- type: Z,
82
- properties: _,
83
- required: I
84
- }, ee = "step", te = "A Farris Component", se = "object", ne = {
85
- basic: {
86
- description: "Basic Infomation",
87
- title: "基本信息",
88
- properties: {
89
- id: {
90
- description: "组件标识",
91
- title: "标识",
92
- type: "string",
93
- readonly: !0
94
- },
95
- type: {
96
- description: "组件类型",
97
- title: "控件类型",
98
- type: "select",
99
- editor: {
100
- type: "waiting for modification",
101
- enum: []
102
- }
103
- }
104
- }
105
- }
106
- }, le = {
124
+ ], re = {
125
+ $schema: D,
126
+ $id: H,
107
127
  title: ee,
108
128
  description: te,
109
129
  type: se,
110
- categories: ne
111
- }, F = {
130
+ properties: ie,
131
+ required: ne
132
+ }, R = {
112
133
  /** 步骤条方向 */
113
134
  direction: { type: String, default: "horizontal" },
114
135
  /** 是否平铺 */
@@ -139,237 +160,983 @@ const U = "https://json-schema.org/draft/2020-12/schema", W = "https://farris-de
139
160
  /** 步骤条点击后事件 */
140
161
  onClick: { type: Function, default: () => {
141
162
  } }
142
- }, B = H(F, x, K, Q, le), g = /* @__PURE__ */ A({
163
+ }, $ = G(R, re, X, Z), I = /* @__PURE__ */ j({
143
164
  name: "FStep",
144
- props: F,
165
+ props: R,
145
166
  emits: ["click"],
146
- setup(l, p) {
147
- const a = u(l.direction), v = u(l.fill), O = u(l.height), o = u(l.activeIndex), f = d(() => ({
148
- "f-progress-step-list": a.value === "horizontal",
149
- "f-progress-step-list-block": a.value === "vertical",
150
- "f-progress-step-horizontal-fill": a.value === "horizontal" && v.value,
151
- "f-progress-step-vertical-fill": a.value === "vertical" && v.value
152
- })), C = d(() => ({
153
- height: a.value === "vertical" ? `${O.value}px` : ""
167
+ setup(a, e) {
168
+ const t = T(a.activeIndex), s = M(() => ({
169
+ "f-progress-step-list": a.direction === "horizontal",
170
+ "f-progress-step-list-block": a.direction === "vertical",
171
+ "f-progress-step-horizontal-fill": a.direction === "horizontal" && a.fill,
172
+ "f-progress-step-vertical-fill": a.direction === "vertical" && a.fill
173
+ })), i = M(() => ({
174
+ overflow: "auto"
175
+ // height: props.direction === 'vertical' ? `${props.height || 300}px` : ''
154
176
  }));
155
- function k(t, e) {
156
- const i = {
177
+ function r(d, u) {
178
+ const v = {
157
179
  step: !0,
158
- active: e === o.value,
159
- clickable: l.clickable,
160
- current: e === o.value,
161
- finish: e < o.value
180
+ active: u === t.value,
181
+ clickable: a.clickable,
182
+ current: u === t.value,
183
+ finish: u < t.value
162
184
  };
163
- return t.status && (i[t.status] = !0), q(i, t.class || "");
185
+ return d.status && (v[d.status] = !0), B(v, d.class || "");
164
186
  }
165
- function b(t, e) {
166
- if (!l.clickable)
187
+ function n(d, u) {
188
+ if (!a.clickable)
167
189
  return;
168
- const i = {
169
- step: t,
170
- stepIndex: e
190
+ t.value = u;
191
+ const v = {
192
+ step: d,
193
+ stepIndex: u
171
194
  };
172
- p.emit("click", i);
195
+ e.emit("click", v);
173
196
  }
174
- function S(t, e) {
175
- const i = {
197
+ function l(d, u) {
198
+ const v = {
176
199
  "f-progressstep-row": !0,
177
- "step-active": e === o.value,
178
- "step-current": e === o.value,
179
- "step-finish": e < o.value
200
+ "step-active": u === t.value,
201
+ "step-current": u === t.value,
202
+ "step-finish": u < t.value
180
203
  };
181
- return t.status && (i["step-" + t.status] = !0), i;
204
+ return d.status && (v["step-" + d.status] = !0), v;
182
205
  }
183
- function h(t, e) {
184
- return q({
206
+ function o(d, u) {
207
+ return B({
185
208
  "step-icon": !0,
186
- "step-success": e,
187
- "f-icon": e,
188
- "f-icon-check": e
189
- }, t.icon || "");
209
+ "step-success": u,
210
+ "f-icon": u,
211
+ "f-icon-check": u
212
+ }, d.icon || "");
190
213
  }
191
- function T(t, e) {
192
- const i = [];
193
- return t.icon ? i.push(c("span", {
194
- class: h(t, !1)
195
- }, null)) : e >= o.value ? i.push(c("span", {
214
+ function c(d, u) {
215
+ const v = [];
216
+ return d.icon ? v.push(b("span", {
217
+ class: o(d, !1)
218
+ }, null)) : u >= t.value ? v.push(b("span", {
196
219
  class: "step-icon"
197
- }, [e + 1])) : i.push(c("span", {
198
- class: h(t, !0)
199
- }, null)), i;
220
+ }, [u + 1])) : v.push(b("span", {
221
+ class: o(d, !0)
222
+ }, null)), v;
200
223
  }
201
- function $(t, e) {
224
+ function p(d, u) {
202
225
  return {
203
226
  "step-name": !0,
204
- "step-name-success": e < o.value
227
+ "step-name-success": u < t.value
205
228
  };
206
229
  }
207
- function R(t, e) {
208
- return c("div", {
230
+ function m(d, u) {
231
+ return b("div", {
209
232
  class: "f-progress-step-title"
210
- }, [c("p", {
211
- class: $(t, e)
212
- }, [t.title])]);
233
+ }, [b("p", {
234
+ class: p(d, u)
235
+ }, [d.title])]);
213
236
  }
214
- function L(t, e) {
237
+ function h(d, u) {
215
238
  return {
216
239
  "f-progress-step-line": !0,
217
- "f-progress-step-line-success": e === o.value
240
+ "f-progress-step-line-success": u === t.value
218
241
  };
219
242
  }
220
- function w(t, e) {
221
- return e !== l.steps.length - 1;
243
+ function V(d, u) {
244
+ return u !== a.steps.length - 1;
222
245
  }
223
- const m = d(() => ({
224
- triangle: !0,
225
- "": a.value === "vertical"
246
+ const E = M(() => ({
247
+ triangle: !0
226
248
  }));
227
- function j() {
228
- return l.steps.map((t, e, i) => c("li", {
229
- class: k(t, e),
230
- onClick: (M) => b(t, e)
231
- }, [p.slots.stepTemplate ? p.slots.stepTemplate({
232
- step: t,
233
- index: e,
234
- length: i.length,
235
- activeIndex: o.value,
236
- direction: a.value
237
- }) : c("div", {
238
- class: S(t, e)
239
- }, [c("div", {
249
+ function x() {
250
+ return a.steps.map((d, u, v) => b("li", {
251
+ class: r(d, u),
252
+ onClick: (P) => n(d, u)
253
+ }, [e.slots.stepTemplate ? e.slots.stepTemplate({
254
+ step: d,
255
+ index: u,
256
+ length: v.length,
257
+ activeIndex: t.value,
258
+ direction: a.direction
259
+ }) : b("div", {
260
+ class: l(d, u)
261
+ }, [b("div", {
240
262
  class: "f-progress-step-content"
241
- }, [T(t, e), R(t, e)]), w(t, e) && c("div", {
242
- class: L(t, e)
243
- }, [c("span", {
244
- class: m.value
263
+ }, [c(d, u), m(d, u)]), V(d, u) && b("div", {
264
+ class: h(d, u)
265
+ }, [b("span", {
266
+ class: E.value
245
267
  }, null)])])]));
246
268
  }
247
- return N(() => l.activeIndex, () => {
248
- l.activeIndex > -1 && l.activeIndex <= l.steps.length && (o.value = l.activeIndex, j());
249
- }), () => l.visible && c("div", {
269
+ return q(() => a.activeIndex, () => {
270
+ a.activeIndex > -1 && a.activeIndex <= a.steps.length && (t.value = a.activeIndex);
271
+ }), () => a.visible && b("div", {
250
272
  class: "f-progress-step"
251
- }, [c("ul", {
252
- class: f.value,
253
- style: C.value
254
- }, [j()])]);
273
+ }, [b("ul", {
274
+ class: s.value,
275
+ style: i.value
276
+ }, [x()])]);
277
+ }
278
+ }), F = {
279
+ "tab-page": { type: "tab-page" },
280
+ section: { type: "section" },
281
+ "list-view": { name: "列表" }
282
+ };
283
+ function oe(a) {
284
+ const { formSchemaUtils: e, formStateMachineUtils: t } = a;
285
+ function s(o, c = "") {
286
+ return {
287
+ path: c + o.code,
288
+ field: o.id,
289
+ fullPath: o.code
290
+ };
291
+ }
292
+ function i(o, c = "") {
293
+ const p = e.getViewModelById(o);
294
+ return p ? p.states.map((m) => s(m, c)) : [];
295
+ }
296
+ function r(o) {
297
+ const c = e.getRootViewModelId(), p = i(o);
298
+ if (o === c)
299
+ return p;
300
+ const m = i(c, "root-component.");
301
+ return [...p, ...m];
302
+ }
303
+ function n(o) {
304
+ return o.binding && o.binding.path || o.id || "";
305
+ }
306
+ function l() {
307
+ return t && t.getRenderStates() || [];
308
+ }
309
+ return { getVariables: r, getControlName: n, getStateMachines: l };
310
+ }
311
+ class ae {
312
+ constructor(e) {
313
+ w(this, "sessionVariables", [
314
+ {
315
+ key: "CurrentSysOrgName",
316
+ name: "当前组织Name",
317
+ description: "当前组织Name"
318
+ },
319
+ // {
320
+ // key: "CurrentSysOrgCode",
321
+ // name: "当前组织Code",
322
+ // description: "当前组织Code"
323
+ // },
324
+ {
325
+ key: "CurrentSysOrgId",
326
+ name: "当前组织Id",
327
+ description: "当前组织Id"
328
+ },
329
+ {
330
+ key: "CurrentUserName",
331
+ name: "当前用户Name",
332
+ description: "当前用户Name"
333
+ },
334
+ {
335
+ key: "CurrentUserCode",
336
+ name: "当前用户Code",
337
+ description: "当前用户Code"
338
+ },
339
+ {
340
+ key: "CurrentUserId",
341
+ name: "当前用户Id",
342
+ description: "当前用户Id"
343
+ },
344
+ {
345
+ key: "CurrentLanguage",
346
+ name: "当前语言编号",
347
+ description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
348
+ }
349
+ ]);
350
+ w(this, "expressionNames", {
351
+ compute: "计算表达式",
352
+ dependency: "依赖表达式",
353
+ validate: "验证表达式",
354
+ dataPicking: "帮助前表达式",
355
+ visible: "可见表达式",
356
+ readonly: "只读表达式",
357
+ required: "必填表达式"
358
+ });
359
+ w(this, "getExpressionConverter", (e, t) => ({
360
+ convertFrom: (s, i, r, n) => {
361
+ const l = r.getExpressionRuleValue(e, t || i);
362
+ return l && l.value || "";
363
+ },
364
+ convertTo: (s, i, r, n, l) => {
365
+ var o;
366
+ if (i === "dataPicking" && (r != null && r.target)) {
367
+ const c = `${r.target}_dataPicking`;
368
+ ((o = r.rules) == null ? void 0 : o.some(
369
+ (m) => m.id === c && m.value
370
+ )) ? s.dictPickingExpressionId = c : delete s.dictPickingExpressionId;
371
+ }
372
+ n.updateExpression(r);
373
+ }
374
+ }));
375
+ this.formSchemaService = e;
376
+ }
377
+ getExpressionRule(e, t) {
378
+ const s = this.formSchemaService.getExpressions();
379
+ if (!s)
380
+ return "";
381
+ const i = s.find((n) => n.target === e);
382
+ if (!i)
383
+ return "";
384
+ const r = i.rules.find((n) => n.type === t);
385
+ return r || "";
386
+ }
387
+ // 获取上下文表单变量
388
+ getContextFormVariables() {
389
+ const { module: e } = this.formSchemaService.getFormSchema();
390
+ if (!e.viewmodels || e.viewmodels.length === 0)
391
+ return [];
392
+ const t = this.formSchemaService.getRootViewModelId(), s = this.formSchemaService.getViewModelById(t);
393
+ if (!s || !s.states || s.states.length === 0)
394
+ return [];
395
+ const i = [];
396
+ return s.states.filter((r) => r.category === "remote").forEach((r) => {
397
+ i.push({
398
+ key: r.code,
399
+ name: r.name,
400
+ description: r.name,
401
+ category: r.category
402
+ });
403
+ }), i;
404
+ }
405
+ createTreeNode(e, t, s = "label") {
406
+ return {
407
+ id: e.id,
408
+ name: e.name,
409
+ bindingPath: e[s],
410
+ parents: t,
411
+ type: "field"
412
+ };
413
+ }
414
+ buildEntityFieldsTreeData(e = null, t) {
415
+ const s = [];
416
+ return e == null || e.forEach((i) => {
417
+ var l;
418
+ const r = this.createTreeNode(i, t);
419
+ let n = [];
420
+ (l = i.type) != null && l.fields && (n = this.buildEntityFieldsTreeData(i.type.fields, [...t, i.label])), s.push({
421
+ data: r,
422
+ children: n,
423
+ expanded: !0
424
+ });
425
+ }), s;
426
+ }
427
+ buildChildEntityTreeData(e = null, t) {
428
+ const s = [];
429
+ return e == null || e.forEach((i) => {
430
+ var o, c;
431
+ const r = this.createTreeNode(i, t);
432
+ r.type = "entity";
433
+ const n = this.buildEntityFieldsTreeData((o = i.type) == null ? void 0 : o.fields, [...t, i.label]), l = this.buildChildEntityTreeData((c = i.type) == null ? void 0 : c.entities, [...t, i.label]);
434
+ l != null && l.length && (n == null || n.push(...l)), s.push({
435
+ data: r,
436
+ children: n || [],
437
+ // 空值回退
438
+ expanded: !0
439
+ });
440
+ }), s;
441
+ }
442
+ getEntitiesTreeData() {
443
+ const e = this.formSchemaService.getSchemaEntities();
444
+ if (!(e != null && e.length))
445
+ return [];
446
+ const t = e[0];
447
+ if (!(t != null && t.type))
448
+ return [];
449
+ const s = this.buildEntityFieldsTreeData(t.type.fields, [t.code]), i = this.buildChildEntityTreeData(t.type.entities, [t.code]);
450
+ return i != null && i.length && (s == null || s.push(...i)), {
451
+ entityCode: t.code,
452
+ fields: [{
453
+ data: this.createTreeNode(t, [], "code"),
454
+ children: s || []
455
+ }]
456
+ };
457
+ }
458
+ getEntitiesAndVariables() {
459
+ return {
460
+ entities: this.getEntitiesTreeData(),
461
+ variables: {
462
+ session: {
463
+ name: "系统变量",
464
+ items: this.sessionVariables,
465
+ visible: !1
466
+ },
467
+ forms: {
468
+ name: "表单变量",
469
+ items: this.getContextFormVariables(),
470
+ visible: !0
471
+ }
472
+ }
473
+ };
474
+ }
475
+ onBeforeOpenExpression(e, t, s) {
476
+ const i = s === "Field" ? e.binding.field : e.id, r = this.getExpressionRule(i, t), n = this.getEntitiesAndVariables(), l = {
477
+ message: ["validate", "required", "dataPicking"].includes(t) && r ? r.message : "",
478
+ ...n
479
+ };
480
+ return r.messageType != null && (l.messageType = r.messageType), l;
481
+ }
482
+ buildRule(e, t, s, i) {
483
+ const { expression: r, message: n, messageType: l } = t, o = {
484
+ id: `${e}_${s}`,
485
+ type: s,
486
+ value: r
487
+ };
488
+ return (s === "validate" || s === "dataPicking" || s === "required") && (o.message = n), s === "dataPicking" && (o.messageType = l), s === "validate" && i && (o.elementId = i), o;
489
+ }
490
+ getExpressionData() {
491
+ const { expressions: e } = this.formSchemaService.getFormSchema().module;
492
+ return e || [];
493
+ }
494
+ updateExpression(e, t, s, i) {
495
+ const r = t === "Field" ? e.binding.field : e.id, n = this.buildRule(r, s, i, e.type === "form-group" ? e.id : "");
496
+ let o = this.getExpressionData().find((p) => p.targetType === t && p.target === r);
497
+ const c = (p) => p.value.trim() === "";
498
+ if (o) {
499
+ const p = o.rules.find((m) => m.id === n.id);
500
+ if (p)
501
+ c(n) ? o.rules = o.rules.filter((m) => m.id !== n.id) : (Object.assign(p, n), i === "validate" && e.type === "form-group" && (p.elementId = e.id));
502
+ else {
503
+ if (c(n))
504
+ return null;
505
+ o.rules = o.rules || [], o.rules.push(n);
506
+ }
507
+ } else {
508
+ if (c(n))
509
+ return null;
510
+ o = {
511
+ target: `${r}`,
512
+ rules: [n],
513
+ targetType: t
514
+ };
515
+ }
516
+ return o;
517
+ }
518
+ getExpressionEditorOptions(e, t, s, i) {
519
+ return s.reduce((r, n) => {
520
+ var o, c;
521
+ const l = t === "Field" ? (o = e == null ? void 0 : e.binding) == null ? void 0 : o.field : e.id;
522
+ return r[n] = {
523
+ hide: t === "Field" ? !!((c = e == null ? void 0 : e.binding) != null && c.field) : !1,
524
+ description: "",
525
+ title: this.expressionNames[n],
526
+ type: "string",
527
+ $converter: this.getExpressionConverter(l),
528
+ refreshPanelAfterChanged: !0,
529
+ editor: {
530
+ type: "expression-editor",
531
+ singleExpand: !1,
532
+ dialogTitle: `${this.expressionNames[n]}编辑器`,
533
+ showMessage: n === "validate" || n === "dataPicking" || n === "required",
534
+ showMessageType: n === "dataPicking",
535
+ beforeOpen: () => this.onBeforeOpenExpression(e, n, t),
536
+ onSubmitModal: (p) => {
537
+ const m = this.updateExpression(e, t, p, n);
538
+ if (i) {
539
+ const h = this.buildRule(l, p, n);
540
+ i(h);
541
+ }
542
+ return m;
543
+ }
544
+ }
545
+ }, r;
546
+ }, {});
547
+ }
548
+ getExpressionInfo(e, t, s) {
549
+ const i = t === "Field" ? e.binding.field : e.id, r = this.getExpressionRule(i, s), n = {
550
+ value: r && r.value,
551
+ targetId: i,
552
+ targetType: t,
553
+ expressionType: s
554
+ };
555
+ return r && r.message && (n.message = r.message), n;
556
+ }
557
+ getExpressionConfig(e, t, s = ["compute", "dependency", "validate"], i) {
558
+ return {
559
+ description: "表达式",
560
+ title: "表达式",
561
+ hide: !e.binding,
562
+ properties: {
563
+ ...this.getExpressionEditorOptions(e, t, s, i)
564
+ }
565
+ };
566
+ }
567
+ getExpressionOptions(e, t, s) {
568
+ const i = this.getExpressionInfo(e, t, s);
569
+ return {
570
+ dialogTitle: `${this.expressionNames[s]}编辑器`,
571
+ singleExpand: !1,
572
+ showMessage: s === "required",
573
+ beforeOpen: () => this.onBeforeOpenExpression(e, s, t),
574
+ expressionInfo: i
575
+ };
576
+ }
577
+ }
578
+ class le {
579
+ constructor(e, t) {
580
+ w(this, "componentId");
581
+ w(this, "viewModelId");
582
+ w(this, "eventsEditorUtils");
583
+ w(this, "formSchemaUtils");
584
+ w(this, "formMetadataConverter");
585
+ w(this, "designViewModelUtils");
586
+ w(this, "designViewModelField");
587
+ w(this, "controlCreatorUtils");
588
+ w(this, "designerHostService");
589
+ w(this, "designerContext");
590
+ w(this, "schemaService", null);
591
+ w(this, "metadataService", null);
592
+ w(this, "propertyConfig", {
593
+ type: "object",
594
+ categories: {}
595
+ });
596
+ var s;
597
+ this.componentId = e, this.designerHostService = t, this.eventsEditorUtils = t.eventsEditorUtils, this.formSchemaUtils = t.formSchemaUtils, this.formMetadataConverter = t.formMetadataConverter, this.viewModelId = ((s = this.formSchemaUtils) == null ? void 0 : s.getViewModelIdByComponentId(e)) || "", this.designViewModelUtils = t.designViewModelUtils, this.controlCreatorUtils = t.controlCreatorUtils, this.metadataService = t.metadataService, this.schemaService = t.schemaService, this.designerContext = t.designerContext;
598
+ }
599
+ getFormDesignerInstance() {
600
+ var e, t;
601
+ return (t = (e = this.designerContext) == null ? void 0 : e.instances) == null ? void 0 : t.formDesigner.value;
602
+ }
603
+ getTableInfo() {
604
+ var e;
605
+ return (e = this.schemaService) == null ? void 0 : e.getTableInfoByViewModelId(this.viewModelId);
606
+ }
607
+ setDesignViewModelField(e) {
608
+ var s;
609
+ const t = e.binding && e.binding.type === "Form" && e.binding.field;
610
+ if (t) {
611
+ if (!this.designViewModelField) {
612
+ const i = this.designViewModelUtils.getDgViewModel(this.viewModelId);
613
+ this.designViewModelField = i.fields.find((r) => r.id === t);
614
+ }
615
+ e.updateOn = (s = this.designViewModelField) == null ? void 0 : s.updateOn;
616
+ }
617
+ }
618
+ getBasicPropConfig(e) {
619
+ return {
620
+ description: "Basic Information",
621
+ title: "基本信息",
622
+ properties: {
623
+ id: {
624
+ description: "组件标识",
625
+ title: "标识",
626
+ type: "string",
627
+ readonly: !0
628
+ },
629
+ type: {
630
+ description: "组件类型",
631
+ title: "控件类型",
632
+ type: "select",
633
+ editor: {
634
+ type: "combo-list",
635
+ textField: "name",
636
+ valueField: "value",
637
+ idField: "value",
638
+ editable: !1,
639
+ data: [{ value: e.type, name: U[e.type] && U[e.type].name }]
640
+ }
641
+ }
642
+ }
643
+ };
644
+ }
645
+ getAppearanceConfig(e = null, t = {}, s) {
646
+ const i = {
647
+ title: "外观",
648
+ description: "Appearance"
649
+ }, r = {
650
+ class: {
651
+ title: "class样式",
652
+ type: "string",
653
+ description: "组件的CSS样式",
654
+ $converter: "/converter/appearance.converter",
655
+ parentPropertyID: "appearance"
656
+ },
657
+ style: {
658
+ title: "style样式",
659
+ type: "string",
660
+ description: "组件的样式",
661
+ $converter: "/converter/appearance.converter",
662
+ parentPropertyID: "appearance"
663
+ }
664
+ };
665
+ for (const n in t)
666
+ r[n] = Object.assign(r[n] || {}, t[n]);
667
+ return {
668
+ ...i,
669
+ properties: { ...r },
670
+ setPropertyRelates(n, l) {
671
+ if (n) {
672
+ switch (n && n.propertyID) {
673
+ case "class":
674
+ case "style": {
675
+ J.value++;
676
+ break;
677
+ }
678
+ }
679
+ s && s(n, e, l);
680
+ }
681
+ }
682
+ };
683
+ }
684
+ /**
685
+ *
686
+ * @param propertyData
687
+ * @param propertyTypes
688
+ * @param propertyName
689
+ * @param constInfos
690
+ * @param variableInfos
691
+ * @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
692
+ * @returns
693
+ */
694
+ getPropertyEditorParams(e, t = [], s = "visible", i = {}, r = {}, n = "") {
695
+ const { getVariables: l, getControlName: o, getStateMachines: c } = oe(this.designerHostService), p = this.getRealTargetType(e), m = t && t.length > 0 ? t : ["Const", "Variable", "StateMachine", "Expression"], h = {
696
+ type: "property-editor",
697
+ propertyTypes: m
698
+ };
699
+ return m.map((V) => {
700
+ switch (V) {
701
+ case "Const":
702
+ Object.assign(h, {
703
+ constType: "enum",
704
+ constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
705
+ }, i);
706
+ break;
707
+ case "Expression":
708
+ h.expressionConfig = this.getExpressionOptions(e, p, n || s);
709
+ break;
710
+ case "StateMachine":
711
+ h.stateMachines = c();
712
+ break;
713
+ case "Variable":
714
+ Object.assign(h, {
715
+ controlName: o(e),
716
+ newVariablePrefix: "is",
717
+ newVariableType: "Boolean",
718
+ variables: l(this.viewModelId),
719
+ parentComponentId: this.componentId === "root-component" ? "" : "root-component",
720
+ onBeforeOpenVariables: (E) => {
721
+ E.value = l(this.viewModelId);
722
+ }
723
+ }, r), this.designerContext.designerMode === "PC_RTC" && (h.newVariablePrefix = "ext_" + h.newVariablePrefix);
724
+ break;
725
+ }
726
+ }), h;
727
+ }
728
+ getVisibleProperty(e, t = "") {
729
+ var r;
730
+ let s = ["Const", "Variable", "StateMachine", "Expression"];
731
+ return t === "gridFieldEditor" ? s = ["Const", "Expression"] : t === "form-group" && !((r = e.binding) != null && r.field) ? s = ["Const", "Variable", "StateMachine"] : (t === "dataGrid" || t === "treeGrid" || t === "wizard") && (s = ["Const", "Variable", "Expression"]), {
732
+ visible: {
733
+ title: "是否可见",
734
+ type: "boolean",
735
+ description: "运行时组件是否可见",
736
+ editor: this.getPropertyEditorParams(e, s, "visible")
737
+ }
738
+ };
739
+ }
740
+ /**
741
+ * 获取行为
742
+ * @param propertyData
743
+ * @param viewModelId
744
+ * @returns
745
+ */
746
+ getBehaviorConfig(e, t = "", s = {}, i) {
747
+ const r = {
748
+ title: "行为",
749
+ description: ""
750
+ }, n = this.getVisibleProperty(e, t);
751
+ for (const o in s)
752
+ n[o] = Object.assign(n[o] || {}, s[o]);
753
+ const l = this;
754
+ return {
755
+ ...r,
756
+ properties: { ...n },
757
+ setPropertyRelates(o, c) {
758
+ if (o) {
759
+ switch (o.propertyID) {
760
+ case "disabled":
761
+ case "readonly":
762
+ case "visible":
763
+ l.afterMutilEditorChanged(e, o);
764
+ break;
765
+ }
766
+ i && i(o, c);
767
+ }
768
+ }
769
+ };
770
+ }
771
+ /**
772
+ * 当多值编辑器变更时
773
+ * @param propertyData
774
+ * @param changeObject
775
+ */
776
+ afterMutilEditorChanged(e, t) {
777
+ this.addNewVariableToViewModel(t, this.viewModelId), this.updateExpressionValue(t), this.clearExpression(t, e);
778
+ }
779
+ /**
780
+ *
781
+ * @param propertyId
782
+ * @param componentInstance
783
+ * @returns
784
+ */
785
+ updateElementByParentContainer(e, t) {
786
+ const s = t && t.parent && t.parent.schema;
787
+ if (!s)
788
+ return;
789
+ const i = s.contents.findIndex((n) => n.id === e), r = W(s.contents[i]);
790
+ s.contents.splice(i, 1), s.contents.splice(i, 0, r), K();
791
+ }
792
+ /**
793
+ * 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
794
+ * @param changeObject
795
+ * @param viewModelId
796
+ * @returns
797
+ */
798
+ addNewVariableToViewModel(e, t) {
799
+ const s = e.propertyValue;
800
+ if (!(s && typeof s == "object") || !(s.type === "Variable" && s.isNewVariable))
801
+ return;
802
+ const n = {
803
+ id: s.field,
804
+ category: "locale",
805
+ code: s.fullPath,
806
+ name: s.fullPath,
807
+ type: s.newVariableType || "String",
808
+ isRtcVariable: this.designerContext.designerMode === "PC_RTC" ? !0 : void 0
809
+ };
810
+ delete s.newVariableType, delete s.isNewVariable, this.formSchemaUtils.getVariableByCode(n.code) || this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(n);
255
811
  }
256
- }), ce = /* @__PURE__ */ A({
812
+ /**
813
+ * 更新表达式到expressions节点
814
+ * @param changeObject
815
+ */
816
+ updateExpressionValue(e) {
817
+ const t = e.propertyValue;
818
+ if (!((t && t.type) === "Expression" && t.expressionInfo))
819
+ return;
820
+ const { expressionId: r, expressionInfo: n } = t, { targetId: l, targetType: o, expressionType: c, value: p, message: m } = n, h = this.formSchemaUtils.getModule();
821
+ h.expressions = h.expressions || [];
822
+ const { expressions: V } = h;
823
+ let E = V.find((d) => d.target === l);
824
+ E || (E = { target: l, rules: [], targetType: o }, V.push(E));
825
+ const x = E.rules.find((d) => d.type === c);
826
+ if (x)
827
+ x.value = p, x.message = m;
828
+ else {
829
+ const d = { id: r, type: c, value: p, message: m };
830
+ E.rules.push(d);
831
+ }
832
+ delete t.expressionInfo;
833
+ }
834
+ /**
835
+ * 属性类型切换为非表达式后,清除原表达式
836
+ * @param changeObject
837
+ * @param propertyData
838
+ * @returns
839
+ */
840
+ clearExpression(e, t) {
841
+ const s = e.propertyValue;
842
+ if (s && s.type === "Expression")
843
+ return;
844
+ const r = e.propertyID, n = this.formSchemaUtils.getExpressions(), l = t.binding ? t.binding.field : t.id, o = n.find((c) => c.target === l);
845
+ !o || !o.rules || (o.rules = o.rules.filter((c) => c.type !== r));
846
+ }
847
+ getExpressionOptions(e, t, s) {
848
+ return new ae(this.formSchemaUtils).getExpressionOptions(e, t, s);
849
+ }
850
+ getRealTargetType(e) {
851
+ return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item", "drawer-toolbar-item"].indexOf(e.type) > -1 ? "Button" : e.binding && e.binding.field ? "Field" : "Container";
852
+ }
853
+ createBaseEventProperty(e) {
854
+ const t = {};
855
+ return t[this.viewModelId] = {
856
+ type: "events-editor",
857
+ editor: {
858
+ initialData: e,
859
+ viewSourceHandle: (s) => {
860
+ var i;
861
+ ((i = s.controller) == null ? void 0 : i.label.indexOf(this.formSchemaUtils.getModule().code)) > -1 && this.eventsEditorUtils.jumpToMethod(s);
862
+ }
863
+ }
864
+ }, t;
865
+ }
866
+ }
867
+ class ce extends le {
868
+ constructor(e, t) {
869
+ super(e, t);
870
+ }
871
+ getPropertyConfig(e) {
872
+ return this.getBasicPropConfig(e), this.getAppearanceProperties(), this.propertyConfig.categories.behavior = this.getBehaviorConfig(
873
+ e,
874
+ "step",
875
+ {
876
+ clickable: {
877
+ description: "是否支持点击",
878
+ title: "是否支持点击",
879
+ type: "boolean"
880
+ },
881
+ steps: {
882
+ title: "步骤条",
883
+ type: "array",
884
+ description: "是否填充",
885
+ editor: {
886
+ columns: [
887
+ { field: "id", title: "值", dataType: "string" },
888
+ { field: "title", title: "名称", dataType: "string" }
889
+ ],
890
+ type: "item-collection-editor",
891
+ valueField: "id",
892
+ nameField: "title",
893
+ requiredFields: ["id", "title"],
894
+ uniqueFields: ["id", "title"]
895
+ },
896
+ refreshPanelAfterChanged: !0
897
+ }
898
+ }
899
+ ), this.getEventPropConfig(e), this.propertyConfig;
900
+ }
901
+ getBasicPropConfig(e) {
902
+ const t = super.getBasicPropConfig(e);
903
+ this.propertyConfig.categories.basic = {
904
+ description: "Basic Information",
905
+ title: "基本信息",
906
+ properties: {
907
+ ...t.properties
908
+ }
909
+ };
910
+ }
911
+ /**
912
+ * 将schema实体表组装成树
913
+ */
914
+ assembleSchemaEntityToTree(e, t, s, i = "", r = []) {
915
+ const n = i ? `${i}/${e.label}` : "/";
916
+ return r.push({
917
+ id: e.id,
918
+ name: e.name,
919
+ label: e.label,
920
+ layer: t,
921
+ parent: s && s.id,
922
+ bindTo: n.replace("//", "/")
923
+ }), e.type.entities && e.type.entities.length && e.type.entities.map((l) => this.assembleSchemaEntityToTree(l, t + 1, e, n, r)), r;
924
+ }
925
+ getAppearanceProperties() {
926
+ this.propertyConfig.categories.appearance = {
927
+ title: "外观",
928
+ properties: {
929
+ fill: {
930
+ title: "是否填充",
931
+ type: "boolean",
932
+ description: "是否填充"
933
+ },
934
+ direction: {
935
+ title: "排列方式",
936
+ type: "enum",
937
+ description: "排列方式",
938
+ editor: {
939
+ data: [
940
+ { id: "vertical", name: "垂直" },
941
+ { id: "horizontal", name: "水平" }
942
+ ]
943
+ }
944
+ }
945
+ }
946
+ };
947
+ }
948
+ getEventPropConfig(e) {
949
+ var n;
950
+ const t = [
951
+ {
952
+ label: "onClick",
953
+ name: "点击事件"
954
+ }
955
+ ];
956
+ (n = e.pagination) == null || n.enable;
957
+ const s = this, i = s.eventsEditorUtils.formProperties(e, s.viewModelId, t), r = s.createBaseEventProperty(i);
958
+ this.propertyConfig.categories.eventsEditor = {
959
+ title: "事件",
960
+ hideTitle: !0,
961
+ properties: r,
962
+ // 这个属性,标记当属性变更得时候触发重新更新属性
963
+ refreshPanelAfterChanged: !0,
964
+ tabId: "commands",
965
+ tabName: "交互",
966
+ setPropertyRelates(l, o) {
967
+ const c = l.propertyValue;
968
+ delete e[s.viewModelId], c && (c.setPropertyRelates = this.setPropertyRelates, s.eventsEditorUtils.saveRelatedParameters(e, s.viewModelId, c.events, c));
969
+ }
970
+ };
971
+ }
972
+ }
973
+ function de(a, e) {
974
+ const t = a.schema;
975
+ function s() {
976
+ return "";
977
+ }
978
+ function i(p) {
979
+ return !1;
980
+ }
981
+ function r() {
982
+ return !0;
983
+ }
984
+ function n() {
985
+ return !0;
986
+ }
987
+ function l() {
988
+ return !0;
989
+ }
990
+ function o(p) {
991
+ return new ce(p, e).getPropertyConfig(t);
992
+ }
993
+ function c() {
994
+ var p, m, h, V;
995
+ if (a && e) {
996
+ const E = (p = a == null ? void 0 : a.componentInstance) == null ? void 0 : p.value.belongedComponentId;
997
+ let x = "", d = "";
998
+ const { formSchemaUtils: u } = e;
999
+ if (E) {
1000
+ const P = u.getRootViewModelId(), k = u.getComponentByViewModelId(P), C = u.selectNode(k, (f) => f.contents && f.contents.find((g) => g.component === E));
1001
+ (C == null ? void 0 : C.type) === ((m = F["tab-page"]) == null ? void 0 : m.type) && ((h = C == null ? void 0 : C.contents) != null && h.length) && (x = C.title || ""), (C == null ? void 0 : C.type) === ((V = F.section) == null ? void 0 : V.type) && (C == null ? void 0 : C.showHeader) !== !1 && (x = C.mainTitle || ""), x = x ? `${x} > ` : "", d = x ? C.id : "";
1002
+ }
1003
+ const v = F["list-view"].name;
1004
+ e == null || e.formSchemaUtils.getControlBasicInfoMap().set(a.schema.id, {
1005
+ componentTitle: v,
1006
+ parentPathName: `${x}${v}`,
1007
+ reliedComponentId: d
1008
+ });
1009
+ }
1010
+ }
1011
+ return {
1012
+ canAccepts: i,
1013
+ checkCanDeleteComponent: r,
1014
+ checkCanMoveComponent: n,
1015
+ hideNestedPaddingInDesginerView: l,
1016
+ // triggerBelongedComponentToMoveWhenMoved,
1017
+ // triggerBelongedComponentToDeleteWhenDeleted,
1018
+ getPropsConfig: o,
1019
+ setComponentBasicInfoMap: c,
1020
+ getDesignerClass: s
1021
+ };
1022
+ }
1023
+ const ue = /* @__PURE__ */ j({
257
1024
  name: "FStepDesign",
258
- props: F,
1025
+ props: R,
259
1026
  emits: [],
260
- setup(l, p) {
261
- const a = u(l.direction), v = u(l.fill), O = u(l.height), o = u(l.steps), f = u(0), C = u(l.clickable), k = u(0), b = u(), S = V("design-item-context"), h = J(b, S);
262
- E(() => {
263
- b.value.componentInstance = h;
264
- }), p.expose(h.value);
265
- const T = d(() => ({
266
- "f-progress-step-list": a.value === "horizontal",
267
- "f-progress-step-list-block": a.value === "vertical",
268
- "f-progress-step-horizontal-fill": a.value === "horizontal" && v.value,
269
- "f-progress-step-vertical-fill": a.value === "vertical" && v.value
270
- })), $ = d(() => ({
271
- height: a.value === "vertical" ? `${O.value}px` : ""
1027
+ setup(a, e) {
1028
+ const t = T(0), s = T(0), i = T(), r = O("designer-host-service"), n = O("design-item-context"), l = de(n, r), o = Q(i, n, l);
1029
+ L(() => {
1030
+ i.value.componentInstance = o;
1031
+ }), e.expose(o.value);
1032
+ const c = M(() => ({
1033
+ "f-progress-step-list": a.direction === "horizontal",
1034
+ "f-progress-step-list-block": a.direction === "vertical",
1035
+ "f-progress-step-horizontal-fill": a.direction === "horizontal" && a.fill,
1036
+ "f-progress-step-vertical-fill": a.direction === "vertical" && a.fill
1037
+ })), p = M(() => ({
1038
+ overflow: "auto"
272
1039
  }));
273
- function R(s, n) {
274
- const r = {
1040
+ function m(f, g) {
1041
+ const y = {
275
1042
  step: !0,
276
- active: n === f.value,
277
- clickable: C.value,
278
- "click-disable": s.disable,
279
- current: n === f.value
1043
+ active: g === t.value,
1044
+ clickable: a.clickable,
1045
+ "click-disable": f.disable,
1046
+ current: g === t.value
280
1047
  };
281
- return n < f.value && (r.finish = !0), s.status && (r[s.status] = !0), s.hasOwnProperty("class") && s.class.split(" ").reduce((y, z) => (y[z] = !0, y), r), r;
1048
+ return g < t.value && (y.finish = !0), f.status && (y[f.status] = !0), f.hasOwnProperty("class") && f.class.split(" ").reduce((S, N) => (S[N] = !0, S), y), y;
282
1049
  }
283
- function L(s, n) {
1050
+ function h(f, g) {
284
1051
  }
285
- function w(s, n) {
286
- const r = {
1052
+ function V(f, g) {
1053
+ const y = {
287
1054
  "f-progressstep-row": !0,
288
- "step-active": n === f.value,
289
- "step-current": n === f.value
1055
+ "step-active": g === t.value,
1056
+ "step-current": g === t.value
290
1057
  };
291
- return n < f.value && (r["step-finish"] = !0), s.status && (r["step-" + s.status] = !0), r;
1058
+ return g < t.value && (y["step-finish"] = !0), f.status && (y["step-" + f.status] = !0), y;
292
1059
  }
293
- function m(s, n) {
294
- const r = {
1060
+ function E(f, g) {
1061
+ const y = {
295
1062
  "step-icon": !0,
296
- "step-success": n,
297
- "k-icon": n,
298
- "k-i-check": n
1063
+ "step-success": g,
1064
+ "k-icon": g,
1065
+ "k-i-check": g
299
1066
  };
300
- return s.hasOwnProperty("icon") && s.class.split(" ").reduce((y, z) => (y[z] = !0, y), r), r;
1067
+ return f.hasOwnProperty("icon") && f.class.split(" ").reduce((S, N) => (S[N] = !0, S), y), y;
301
1068
  }
302
- function j(s, n) {
303
- const r = [];
304
- return s.icon ? r.push(c("span", {
305
- class: m(s, !1)
306
- }, null)) : n >= f.value || n === k.value ? r.push(c("span", {
1069
+ function x(f, g) {
1070
+ const y = [];
1071
+ return f.icon ? y.push(b("span", {
1072
+ class: E(f, !1)
1073
+ }, null)) : g >= t.value || g === s.value ? y.push(b("span", {
307
1074
  class: "step-icon"
308
- }, [n + 1])) : r.push(c("span", {
309
- class: m(s, !0)
310
- }, null)), r;
1075
+ }, [g + 1])) : y.push(b("span", {
1076
+ class: E(f, !0)
1077
+ }, null)), y;
311
1078
  }
312
- function t(s, n) {
1079
+ function d(f, g) {
313
1080
  return {
314
1081
  "step-name": !0,
315
- "step-name-success": n < f.value
1082
+ "step-name-success": g < t.value
316
1083
  };
317
1084
  }
318
- function e(s, n) {
319
- return c("div", {
1085
+ function u(f, g) {
1086
+ return b("div", {
320
1087
  class: "f-progress-step-title"
321
- }, [c("p", {
322
- class: t(s, n)
323
- }, [s.title])]);
1088
+ }, [b("p", {
1089
+ class: d(f, g)
1090
+ }, [f.title])]);
324
1091
  }
325
- function i(s, n) {
1092
+ function v(f, g) {
326
1093
  return {
327
1094
  "f-progress-step-line": !0,
328
- "f-progress-step-line-success": n === f.value
1095
+ "f-progress-step-line-success": g === t.value
329
1096
  };
330
1097
  }
331
- function M(s, n) {
332
- return n !== o.value.length - 1;
1098
+ function P(f, g) {
1099
+ return g !== a.steps.length - 1;
333
1100
  }
334
- const D = d(() => ({
335
- triangle: !0,
336
- "": a.value === "vertical"
1101
+ const k = M(() => ({
1102
+ triangle: !0
1103
+ // '': props.direction === 'vertical'
337
1104
  }));
338
- function P() {
339
- return o.value.map((s, n) => c("li", {
340
- class: R(s, n),
341
- onClick: (r) => void 0
342
- }, [c("div", {
343
- class: w(s, n)
344
- }, [c("div", {
1105
+ function C() {
1106
+ return a.steps.map((f, g) => b("li", {
1107
+ class: m(f, g),
1108
+ onClick: (y) => void 0
1109
+ }, [b("div", {
1110
+ class: V(f, g)
1111
+ }, [b("div", {
345
1112
  class: "f-progress-step-content"
346
- }, [j(s, n), e(s, n)]), M(s, n) && c("div", {
347
- class: i(s, n)
348
- }, [c("span", {
349
- class: D.value
1113
+ }, [x(f, g), u(f, g)]), P(f, g) && b("div", {
1114
+ class: v(f, g)
1115
+ }, [b("span", {
1116
+ class: k.value
350
1117
  }, null)])])]));
351
1118
  }
352
- return () => c("div", {
353
- ref: b,
1119
+ return () => b("div", {
1120
+ ref: i,
354
1121
  class: "f-progress-step"
355
- }, [c("ul", {
356
- class: T.value,
357
- style: $.value
358
- }, [P()])]);
1122
+ }, [b("ul", {
1123
+ class: c.value,
1124
+ style: p.value
1125
+ }, [C()])]);
359
1126
  }
360
1127
  });
361
- g.install = (l) => {
362
- l.component(g.name, g);
1128
+ I.install = (a) => {
1129
+ a.component(I.name, I);
363
1130
  };
364
- g.register = (l, p, a, v) => {
365
- l.step = g, p.step = B;
1131
+ I.register = (a, e, t, s) => {
1132
+ a.step = I, e.step = $;
366
1133
  };
367
- g.registerDesigner = (l, p, a) => {
368
- l.step = ce, p.step = B;
1134
+ I.registerDesigner = (a, e, t) => {
1135
+ a.step = ue, e.step = $;
369
1136
  };
370
1137
  export {
371
- g as FStep,
372
- g as default,
373
- B as propsResolver,
374
- F as stepProps
1138
+ I as FStep,
1139
+ I as default,
1140
+ $ as propsResolver,
1141
+ R as stepProps
375
1142
  };