@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
@@ -0,0 +1,1721 @@
1
+ var J = Object.defineProperty;
2
+ var z = (g, n, e) => n in g ? J(g, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : g[n] = e;
3
+ var h = (g, n, e) => z(g, typeof n != "symbol" ? n + "" : n, e);
4
+ import { FormSchemaEntityField$Type as R, FormSchemaEntityFieldType$Type as Y, withInstall as X } from "../../components/common/index.esm.js";
5
+ import { createVNode as v, Fragment as $, createTextVNode as _, nextTick as ee, defineComponent as N, ref as x, inject as H, onMounted as te, computed as E, watch as ie } from "vue";
6
+ import { DgControl as a, canvasChanged as w, refreshCanvas as ne, useDesignerComponent as re } from "../../components/designer-canvas/index.esm.js";
7
+ import { cloneDeep as se } from "lodash-es";
8
+ import { resolveAppearance as k, createPropsResolver as K } from "../../components/dynamic-resolver/index.esm.js";
9
+ import { LocaleService as V } from "../../components/locale/index.esm.js";
10
+ import { FNotifyService as oe } from "../../components/notify/index.esm.js";
11
+ function ae(g) {
12
+ const { formSchemaUtils: n, formStateMachineUtils: e } = g;
13
+ function t(o, u = "") {
14
+ return {
15
+ path: u + o.code,
16
+ field: o.id,
17
+ fullPath: o.code
18
+ };
19
+ }
20
+ function i(o, u = "") {
21
+ const d = n.getViewModelById(o);
22
+ return d ? d.states.map((l) => t(l, u)) : [];
23
+ }
24
+ function r(o) {
25
+ const u = n.getRootViewModelId(), d = i(o);
26
+ if (o === u)
27
+ return d;
28
+ const l = i(u, "root-component.");
29
+ return [...d, ...l];
30
+ }
31
+ function s(o) {
32
+ return o.binding && o.binding.path || o.id || "";
33
+ }
34
+ function c() {
35
+ return e && e.getRenderStates() || [];
36
+ }
37
+ return { getVariables: r, getControlName: s, getStateMachines: c };
38
+ }
39
+ class U {
40
+ constructor(n) {
41
+ h(this, "sessionVariables", [
42
+ {
43
+ key: "CurrentSysOrgName",
44
+ name: "当前组织Name",
45
+ description: "当前组织Name"
46
+ },
47
+ // {
48
+ // key: "CurrentSysOrgCode",
49
+ // name: "当前组织Code",
50
+ // description: "当前组织Code"
51
+ // },
52
+ {
53
+ key: "CurrentSysOrgId",
54
+ name: "当前组织Id",
55
+ description: "当前组织Id"
56
+ },
57
+ {
58
+ key: "CurrentUserName",
59
+ name: "当前用户Name",
60
+ description: "当前用户Name"
61
+ },
62
+ {
63
+ key: "CurrentUserCode",
64
+ name: "当前用户Code",
65
+ description: "当前用户Code"
66
+ },
67
+ {
68
+ key: "CurrentUserId",
69
+ name: "当前用户Id",
70
+ description: "当前用户Id"
71
+ },
72
+ {
73
+ key: "CurrentLanguage",
74
+ name: "当前语言编号",
75
+ description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
76
+ }
77
+ ]);
78
+ h(this, "expressionNames", {
79
+ compute: "计算表达式",
80
+ dependency: "依赖表达式",
81
+ validate: "验证表达式",
82
+ dataPicking: "帮助前表达式",
83
+ visible: "可见表达式",
84
+ readonly: "只读表达式",
85
+ required: "必填表达式"
86
+ });
87
+ h(this, "getExpressionConverter", (n, e) => ({
88
+ convertFrom: (t, i, r, s) => {
89
+ const c = r.getExpressionRuleValue(n, e || i);
90
+ return c && c.value || "";
91
+ },
92
+ convertTo: (t, i, r, s, c) => {
93
+ var o;
94
+ if (i === "dataPicking" && (r != null && r.target)) {
95
+ const u = `${r.target}_dataPicking`;
96
+ ((o = r.rules) == null ? void 0 : o.some(
97
+ (l) => l.id === u && l.value
98
+ )) ? t.dictPickingExpressionId = u : delete t.dictPickingExpressionId;
99
+ }
100
+ s.updateExpression(r);
101
+ }
102
+ }));
103
+ this.formSchemaService = n;
104
+ }
105
+ getExpressionRule(n, e) {
106
+ const t = this.formSchemaService.getExpressions();
107
+ if (!t)
108
+ return "";
109
+ const i = t.find((s) => s.target === n);
110
+ if (!i)
111
+ return "";
112
+ const r = i.rules.find((s) => s.type === e);
113
+ return r || "";
114
+ }
115
+ // 获取上下文表单变量
116
+ getContextFormVariables() {
117
+ const { module: n } = this.formSchemaService.getFormSchema();
118
+ if (!n.viewmodels || n.viewmodels.length === 0)
119
+ return [];
120
+ const e = this.formSchemaService.getRootViewModelId(), t = this.formSchemaService.getViewModelById(e);
121
+ if (!t || !t.states || t.states.length === 0)
122
+ return [];
123
+ const i = [];
124
+ return t.states.filter((r) => r.category === "remote").forEach((r) => {
125
+ i.push({
126
+ key: r.code,
127
+ name: r.name,
128
+ description: r.name,
129
+ category: r.category
130
+ });
131
+ }), i;
132
+ }
133
+ createTreeNode(n, e, t = "label") {
134
+ return {
135
+ id: n.id,
136
+ name: n.name,
137
+ bindingPath: n[t],
138
+ parents: e,
139
+ type: "field"
140
+ };
141
+ }
142
+ buildEntityFieldsTreeData(n = null, e) {
143
+ const t = [];
144
+ return n == null || n.forEach((i) => {
145
+ var c;
146
+ const r = this.createTreeNode(i, e);
147
+ let s = [];
148
+ (c = i.type) != null && c.fields && (s = this.buildEntityFieldsTreeData(i.type.fields, [...e, i.label])), t.push({
149
+ data: r,
150
+ children: s,
151
+ expanded: !0
152
+ });
153
+ }), t;
154
+ }
155
+ buildChildEntityTreeData(n = null, e) {
156
+ const t = [];
157
+ return n == null || n.forEach((i) => {
158
+ var o, u;
159
+ const r = this.createTreeNode(i, e);
160
+ r.type = "entity";
161
+ const s = this.buildEntityFieldsTreeData((o = i.type) == null ? void 0 : o.fields, [...e, i.label]), c = this.buildChildEntityTreeData((u = i.type) == null ? void 0 : u.entities, [...e, i.label]);
162
+ c != null && c.length && (s == null || s.push(...c)), t.push({
163
+ data: r,
164
+ children: s || [],
165
+ // 空值回退
166
+ expanded: !0
167
+ });
168
+ }), t;
169
+ }
170
+ getEntitiesTreeData() {
171
+ const n = this.formSchemaService.getSchemaEntities();
172
+ if (!(n != null && n.length))
173
+ return [];
174
+ const e = n[0];
175
+ if (!(e != null && e.type))
176
+ return [];
177
+ const t = this.buildEntityFieldsTreeData(e.type.fields, [e.code]), i = this.buildChildEntityTreeData(e.type.entities, [e.code]);
178
+ return i != null && i.length && (t == null || t.push(...i)), {
179
+ entityCode: e.code,
180
+ fields: [{
181
+ data: this.createTreeNode(e, [], "code"),
182
+ children: t || []
183
+ }]
184
+ };
185
+ }
186
+ getEntitiesAndVariables() {
187
+ return {
188
+ entities: this.getEntitiesTreeData(),
189
+ variables: {
190
+ session: {
191
+ name: "系统变量",
192
+ items: this.sessionVariables,
193
+ visible: !1
194
+ },
195
+ forms: {
196
+ name: "表单变量",
197
+ items: this.getContextFormVariables(),
198
+ visible: !0
199
+ }
200
+ }
201
+ };
202
+ }
203
+ onBeforeOpenExpression(n, e, t) {
204
+ const i = t === "Field" ? n.binding.field : n.id, r = this.getExpressionRule(i, e), s = this.getEntitiesAndVariables(), c = {
205
+ message: ["validate", "required", "dataPicking"].includes(e) && r ? r.message : "",
206
+ ...s
207
+ };
208
+ return r.messageType != null && (c.messageType = r.messageType), c;
209
+ }
210
+ buildRule(n, e, t, i) {
211
+ const { expression: r, message: s, messageType: c } = e, o = {
212
+ id: `${n}_${t}`,
213
+ type: t,
214
+ value: r
215
+ };
216
+ return (t === "validate" || t === "dataPicking" || t === "required") && (o.message = s), t === "dataPicking" && (o.messageType = c), t === "validate" && i && (o.elementId = i), o;
217
+ }
218
+ getExpressionData() {
219
+ const { expressions: n } = this.formSchemaService.getFormSchema().module;
220
+ return n || [];
221
+ }
222
+ updateExpression(n, e, t, i) {
223
+ const r = e === "Field" ? n.binding.field : n.id, s = this.buildRule(r, t, i, n.type === "form-group" ? n.id : "");
224
+ let o = this.getExpressionData().find((d) => d.targetType === e && d.target === r);
225
+ const u = (d) => d.value.trim() === "";
226
+ if (o) {
227
+ const d = o.rules.find((l) => l.id === s.id);
228
+ if (d)
229
+ u(s) ? o.rules = o.rules.filter((l) => l.id !== s.id) : (Object.assign(d, s), i === "validate" && n.type === "form-group" && (d.elementId = n.id));
230
+ else {
231
+ if (u(s))
232
+ return null;
233
+ o.rules = o.rules || [], o.rules.push(s);
234
+ }
235
+ } else {
236
+ if (u(s))
237
+ return null;
238
+ o = {
239
+ target: `${r}`,
240
+ rules: [s],
241
+ targetType: e
242
+ };
243
+ }
244
+ return o;
245
+ }
246
+ getExpressionEditorOptions(n, e, t, i) {
247
+ return t.reduce((r, s) => {
248
+ var o, u;
249
+ const c = e === "Field" ? (o = n == null ? void 0 : n.binding) == null ? void 0 : o.field : n.id;
250
+ return r[s] = {
251
+ hide: e === "Field" ? !!((u = n == null ? void 0 : n.binding) != null && u.field) : !1,
252
+ description: "",
253
+ title: this.expressionNames[s],
254
+ type: "string",
255
+ $converter: this.getExpressionConverter(c),
256
+ refreshPanelAfterChanged: !0,
257
+ editor: {
258
+ type: "expression-editor",
259
+ singleExpand: !1,
260
+ dialogTitle: `${this.expressionNames[s]}编辑器`,
261
+ showMessage: s === "validate" || s === "dataPicking" || s === "required",
262
+ showMessageType: s === "dataPicking",
263
+ beforeOpen: () => this.onBeforeOpenExpression(n, s, e),
264
+ onSubmitModal: (d) => {
265
+ const l = this.updateExpression(n, e, d, s);
266
+ if (i) {
267
+ const A = this.buildRule(c, d, s);
268
+ i(A);
269
+ }
270
+ return l;
271
+ }
272
+ }
273
+ }, r;
274
+ }, {});
275
+ }
276
+ getExpressionInfo(n, e, t) {
277
+ const i = e === "Field" ? n.binding.field : n.id, r = this.getExpressionRule(i, t), s = {
278
+ value: r && r.value,
279
+ targetId: i,
280
+ targetType: e,
281
+ expressionType: t
282
+ };
283
+ return r && r.message && (s.message = r.message), s;
284
+ }
285
+ getExpressionConfig(n, e, t = ["compute", "dependency", "validate"], i) {
286
+ return {
287
+ description: "表达式",
288
+ title: "表达式",
289
+ hide: !n.binding,
290
+ properties: {
291
+ ...this.getExpressionEditorOptions(n, e, t, i)
292
+ }
293
+ };
294
+ }
295
+ getExpressionOptions(n, e, t) {
296
+ const i = this.getExpressionInfo(n, e, t);
297
+ return {
298
+ dialogTitle: `${this.expressionNames[t]}编辑器`,
299
+ singleExpand: !1,
300
+ showMessage: t === "required",
301
+ beforeOpen: () => this.onBeforeOpenExpression(n, t, e),
302
+ expressionInfo: i
303
+ };
304
+ }
305
+ }
306
+ class le {
307
+ constructor(n, e) {
308
+ h(this, "componentId");
309
+ h(this, "viewModelId");
310
+ h(this, "eventsEditorUtils");
311
+ h(this, "formSchemaUtils");
312
+ h(this, "formMetadataConverter");
313
+ h(this, "designViewModelUtils");
314
+ h(this, "designViewModelField");
315
+ h(this, "controlCreatorUtils");
316
+ h(this, "designerHostService");
317
+ h(this, "designerContext");
318
+ h(this, "schemaService", null);
319
+ h(this, "metadataService", null);
320
+ h(this, "propertyConfig", {
321
+ type: "object",
322
+ categories: {}
323
+ });
324
+ var t;
325
+ this.componentId = n, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((t = this.formSchemaUtils) == null ? void 0 : t.getViewModelIdByComponentId(n)) || "", this.designViewModelUtils = e.designViewModelUtils, this.controlCreatorUtils = e.controlCreatorUtils, this.metadataService = e.metadataService, this.schemaService = e.schemaService, this.designerContext = e.designerContext;
326
+ }
327
+ getFormDesignerInstance() {
328
+ var n, e;
329
+ return (e = (n = this.designerContext) == null ? void 0 : n.instances) == null ? void 0 : e.formDesigner.value;
330
+ }
331
+ getTableInfo() {
332
+ var n;
333
+ return (n = this.schemaService) == null ? void 0 : n.getTableInfoByViewModelId(this.viewModelId);
334
+ }
335
+ setDesignViewModelField(n) {
336
+ var t;
337
+ const e = n.binding && n.binding.type === "Form" && n.binding.field;
338
+ if (e) {
339
+ if (!this.designViewModelField) {
340
+ const i = this.designViewModelUtils.getDgViewModel(this.viewModelId);
341
+ this.designViewModelField = i.fields.find((r) => r.id === e);
342
+ }
343
+ n.updateOn = (t = this.designViewModelField) == null ? void 0 : t.updateOn;
344
+ }
345
+ }
346
+ getBasicPropConfig(n) {
347
+ return {
348
+ description: "Basic Information",
349
+ title: "基本信息",
350
+ properties: {
351
+ id: {
352
+ description: "组件标识",
353
+ title: "标识",
354
+ type: "string",
355
+ readonly: !0
356
+ },
357
+ type: {
358
+ description: "组件类型",
359
+ title: "控件类型",
360
+ type: "select",
361
+ editor: {
362
+ type: "combo-list",
363
+ textField: "name",
364
+ valueField: "value",
365
+ idField: "value",
366
+ editable: !1,
367
+ data: [{ value: n.type, name: a[n.type] && a[n.type].name }]
368
+ }
369
+ }
370
+ }
371
+ };
372
+ }
373
+ getAppearanceConfig(n = null, e = {}, t) {
374
+ const i = {
375
+ title: "外观",
376
+ description: "Appearance"
377
+ }, r = {
378
+ class: {
379
+ title: "class样式",
380
+ type: "string",
381
+ description: "组件的CSS样式",
382
+ $converter: "/converter/appearance.converter",
383
+ parentPropertyID: "appearance"
384
+ },
385
+ style: {
386
+ title: "style样式",
387
+ type: "string",
388
+ description: "组件的样式",
389
+ $converter: "/converter/appearance.converter",
390
+ parentPropertyID: "appearance"
391
+ }
392
+ };
393
+ for (const s in e)
394
+ r[s] = Object.assign(r[s] || {}, e[s]);
395
+ return {
396
+ ...i,
397
+ properties: { ...r },
398
+ setPropertyRelates(s, c) {
399
+ if (s) {
400
+ switch (s && s.propertyID) {
401
+ case "class":
402
+ case "style": {
403
+ w.value++;
404
+ break;
405
+ }
406
+ }
407
+ t && t(s, n, c);
408
+ }
409
+ }
410
+ };
411
+ }
412
+ /**
413
+ *
414
+ * @param propertyData
415
+ * @param propertyTypes
416
+ * @param propertyName
417
+ * @param constInfos
418
+ * @param variableInfos
419
+ * @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
420
+ * @returns
421
+ */
422
+ getPropertyEditorParams(n, e = [], t = "visible", i = {}, r = {}, s = "") {
423
+ const { getVariables: c, getControlName: o, getStateMachines: u } = ae(this.designerHostService), d = this.getRealTargetType(n), l = e && e.length > 0 ? e : ["Const", "Variable", "StateMachine", "Expression"], A = {
424
+ type: "property-editor",
425
+ propertyTypes: l
426
+ };
427
+ return l.map((f) => {
428
+ switch (f) {
429
+ case "Const":
430
+ Object.assign(A, {
431
+ constType: "enum",
432
+ constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
433
+ }, i);
434
+ break;
435
+ case "Expression":
436
+ A.expressionConfig = this.getExpressionOptions(n, d, s || t);
437
+ break;
438
+ case "StateMachine":
439
+ A.stateMachines = u();
440
+ break;
441
+ case "Variable":
442
+ Object.assign(A, {
443
+ controlName: o(n),
444
+ newVariablePrefix: "is",
445
+ newVariableType: "Boolean",
446
+ variables: c(this.viewModelId),
447
+ parentComponentId: this.componentId === "root-component" ? "" : "root-component",
448
+ onBeforeOpenVariables: (p) => {
449
+ p.value = c(this.viewModelId);
450
+ }
451
+ }, r), this.designerContext.designerMode === "PC_RTC" && (A.newVariablePrefix = "ext_" + A.newVariablePrefix);
452
+ break;
453
+ }
454
+ }), A;
455
+ }
456
+ getVisibleProperty(n, e = "") {
457
+ var r;
458
+ let t = ["Const", "Variable", "StateMachine", "Expression"];
459
+ return e === "gridFieldEditor" ? t = ["Const", "Expression"] : e === "form-group" && !((r = n.binding) != null && r.field) ? t = ["Const", "Variable", "StateMachine"] : (e === "dataGrid" || e === "treeGrid" || e === "wizard") && (t = ["Const", "Variable", "Expression"]), {
460
+ visible: {
461
+ title: "是否可见",
462
+ type: "boolean",
463
+ description: "运行时组件是否可见",
464
+ editor: this.getPropertyEditorParams(n, t, "visible")
465
+ }
466
+ };
467
+ }
468
+ /**
469
+ * 获取行为
470
+ * @param propertyData
471
+ * @param viewModelId
472
+ * @returns
473
+ */
474
+ getBehaviorConfig(n, e = "", t = {}, i) {
475
+ const r = {
476
+ title: "行为",
477
+ description: ""
478
+ }, s = this.getVisibleProperty(n, e);
479
+ for (const o in t)
480
+ s[o] = Object.assign(s[o] || {}, t[o]);
481
+ const c = this;
482
+ return {
483
+ ...r,
484
+ properties: { ...s },
485
+ setPropertyRelates(o, u) {
486
+ if (o) {
487
+ switch (o.propertyID) {
488
+ case "disabled":
489
+ case "readonly":
490
+ case "visible":
491
+ c.afterMutilEditorChanged(n, o);
492
+ break;
493
+ }
494
+ i && i(o, u);
495
+ }
496
+ }
497
+ };
498
+ }
499
+ /**
500
+ * 当多值编辑器变更时
501
+ * @param propertyData
502
+ * @param changeObject
503
+ */
504
+ afterMutilEditorChanged(n, e) {
505
+ this.addNewVariableToViewModel(e, this.viewModelId), this.updateExpressionValue(e), this.clearExpression(e, n);
506
+ }
507
+ /**
508
+ *
509
+ * @param propertyId
510
+ * @param componentInstance
511
+ * @returns
512
+ */
513
+ updateElementByParentContainer(n, e) {
514
+ const t = e && e.parent && e.parent.schema;
515
+ if (!t)
516
+ return;
517
+ const i = t.contents.findIndex((s) => s.id === n), r = se(t.contents[i]);
518
+ t.contents.splice(i, 1), t.contents.splice(i, 0, r), ne();
519
+ }
520
+ /**
521
+ * 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
522
+ * @param changeObject
523
+ * @param viewModelId
524
+ * @returns
525
+ */
526
+ addNewVariableToViewModel(n, e) {
527
+ const t = n.propertyValue;
528
+ if (!(t && typeof t == "object") || !(t.type === "Variable" && t.isNewVariable))
529
+ return;
530
+ const s = {
531
+ id: t.field,
532
+ category: "locale",
533
+ code: t.fullPath,
534
+ name: t.fullPath,
535
+ type: t.newVariableType || "String",
536
+ isRtcVariable: this.designerContext.designerMode === "PC_RTC" ? !0 : void 0
537
+ };
538
+ delete t.newVariableType, delete t.isNewVariable, this.formSchemaUtils.getVariableByCode(s.code) || this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(s);
539
+ }
540
+ /**
541
+ * 更新表达式到expressions节点
542
+ * @param changeObject
543
+ */
544
+ updateExpressionValue(n) {
545
+ const e = n.propertyValue;
546
+ if (!((e && e.type) === "Expression" && e.expressionInfo))
547
+ return;
548
+ const { expressionId: r, expressionInfo: s } = e, { targetId: c, targetType: o, expressionType: u, value: d, message: l } = s, A = this.formSchemaUtils.getModule();
549
+ A.expressions = A.expressions || [];
550
+ const { expressions: f } = A;
551
+ let p = f.find((y) => y.target === c);
552
+ p || (p = { target: c, rules: [], targetType: o }, f.push(p));
553
+ const m = p.rules.find((y) => y.type === u);
554
+ if (m)
555
+ m.value = d, m.message = l;
556
+ else {
557
+ const y = { id: r, type: u, value: d, message: l };
558
+ p.rules.push(y);
559
+ }
560
+ delete e.expressionInfo;
561
+ }
562
+ /**
563
+ * 属性类型切换为非表达式后,清除原表达式
564
+ * @param changeObject
565
+ * @param propertyData
566
+ * @returns
567
+ */
568
+ clearExpression(n, e) {
569
+ const t = n.propertyValue;
570
+ if (t && t.type === "Expression")
571
+ return;
572
+ const r = n.propertyID, s = this.formSchemaUtils.getExpressions(), c = e.binding ? e.binding.field : e.id, o = s.find((u) => u.target === c);
573
+ !o || !o.rules || (o.rules = o.rules.filter((u) => u.type !== r));
574
+ }
575
+ getExpressionOptions(n, e, t) {
576
+ return new U(this.formSchemaUtils).getExpressionOptions(n, e, t);
577
+ }
578
+ getRealTargetType(n) {
579
+ return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item", "drawer-toolbar-item"].indexOf(n.type) > -1 ? "Button" : n.binding && n.binding.field ? "Field" : "Container";
580
+ }
581
+ createBaseEventProperty(n) {
582
+ const e = {};
583
+ return e[this.viewModelId] = {
584
+ type: "events-editor",
585
+ editor: {
586
+ initialData: n,
587
+ viewSourceHandle: (t) => {
588
+ var i;
589
+ ((i = t.controller) == null ? void 0 : i.label.indexOf(this.formSchemaUtils.getModule().code)) > -1 && this.eventsEditorUtils.jumpToMethod(t);
590
+ }
591
+ }
592
+ }, e;
593
+ }
594
+ }
595
+ const I = class I {
596
+ /**
597
+ * 根据绑定字段类型获取可用的输入类控件
598
+ */
599
+ static getEditorTypesByMDataType(n, e = !1, t = "") {
600
+ if (e)
601
+ return [{ key: a["language-textbox"].type, value: a["language-textbox"].name }];
602
+ let i = I.fieldControlTypeMapping[n];
603
+ if (t === "data-grid-column" && (i != null && i.length)) {
604
+ const r = [a["check-group"].type, a["radio-group"].type, a.image.type, a["rich-text-editor"].type];
605
+ i = i.filter((s) => !r.includes(s.key));
606
+ }
607
+ return i;
608
+ }
609
+ /**
610
+ * 获取所有输入类控件
611
+ */
612
+ static getAllInputTypes() {
613
+ const n = [];
614
+ for (const e in I.fieldControlTypeMapping)
615
+ I.fieldControlTypeMapping[e].forEach((t) => {
616
+ n.find((i) => i.key === t.key && i.value === t.value) || n.push({ key: t.key, value: t.value });
617
+ });
618
+ return n;
619
+ }
620
+ /**
621
+ * 提供schema字段基础属性和DOM控件属性的映射
622
+ * @param control 控件元数据
623
+ */
624
+ static mappingDomPropAndSchemaProp(n, e) {
625
+ var r;
626
+ const t = (r = n.editor) == null ? void 0 : r.type, i = [];
627
+ return (n.type === a["data-grid-column"].type || n.type === a["tree-grid-column"].type) && e && e.categoryId && e.categoryId.indexOf("gridFieldEditor") < 0 && i.push({ domField: "title", schemaField: "name" }), i.push({ domField: "label", schemaField: "name" }), i.push({ domField: "editor.required", schemaField: "require" }), i.push({ domField: "editor.readonly", schemaField: "readonly" }), (t === a["input-group"].type || t === a.textarea.type || t === a["number-spinner"].type) && i.push({ domField: "editor.maxLength", schemaField: "type.length" }), t === a["number-spinner"].type && i.push({ domField: "editor.precision", schemaField: "type.precision" }), (n.type === a["data-grid-column"].type || n.type === a["tree-grid-column"].type) && i.push({ domField: "formatter.precision", schemaField: "type.precision" }), (t === a["combo-list"].type || t === a["radio-group"].type) && i.push({ domField: "editor.data", schemaField: "type.enumValues" }), (n.type === a["data-grid-column"].type || n.type === a["tree-grid-column"].type) && i.push({ domField: "formatter.data", schemaField: "type.enumValues" }), t === a["date-picker"].type && (i.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), i.push({ domField: "editor.fieldType", schemaField: "type.name" })), t === a["number-spinner"].type && (i.push({ domField: "editor.max", schemaField: "editor.maxValue" }), i.push({ domField: "editor.min", schemaField: "editor.minValue" })), t === a.lookup.type && (i.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), i.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), i.push({ domField: "editor.textField", schemaField: "editor.textField" }), i.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), i.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), i.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), i.push({ domField: "path", schemaField: "bindingPath" }), i.push({ domField: "binding.path", schemaField: "bindingField" }), i.push({ domField: "binding.fullPath", schemaField: "path" }), (n.type === a["data-grid-column"].type || n.type === a["tree-grid-column"].type) && i.push({ domField: "field", schemaField: "bindingPath" }), i;
628
+ }
629
+ };
630
+ /**
631
+ * <字段类型,可配置的控件类型列表>的映射
632
+ */
633
+ h(I, "fieldControlTypeMapping", {
634
+ String: [
635
+ { key: a["input-group"].type, value: a["input-group"].name },
636
+ { key: a.lookup.type, value: a.lookup.name },
637
+ { key: a.image.type, value: a.image.name },
638
+ { key: a["date-picker"].type, value: a["date-picker"].name },
639
+ { key: a.switch.type, value: a.switch.name },
640
+ { key: a["check-box"].type, value: a["check-box"].name },
641
+ { key: a["check-group"].type, value: a["check-group"].name },
642
+ { key: a["radio-group"].type, value: a["radio-group"].name },
643
+ { key: a["combo-list"].type, value: a["combo-list"].name },
644
+ { key: a.textarea.type, value: a.textarea.name },
645
+ { key: a["time-picker"].type, value: a["time-picker"].name }
646
+ ],
647
+ Text: [
648
+ { key: a.textarea.type, value: a.textarea.name },
649
+ { key: a.lookup.type, value: a.lookup.name },
650
+ { key: a.image.type, value: a.image.name },
651
+ { key: a.avatar.type, value: a.avatar.name },
652
+ { key: a["rich-text-editor"].type, value: a["rich-text-editor"].name }
653
+ ],
654
+ Decimal: [
655
+ { key: a["number-spinner"].type, value: a["number-spinner"].name }
656
+ ],
657
+ Integer: [
658
+ { key: a["number-spinner"].type, value: a["number-spinner"].name }
659
+ ],
660
+ Number: [
661
+ { key: a["number-spinner"].type, value: a["number-spinner"].name },
662
+ { key: a.switch.type, value: a.switch.name },
663
+ { key: a["check-box"].type, value: a["check-box"].name }
664
+ ],
665
+ BigNumber: [
666
+ { key: a["number-spinner"].type, value: a["number-spinner"].name }
667
+ ],
668
+ Date: [
669
+ { key: a["date-picker"].type, value: a["date-picker"].name }
670
+ ],
671
+ DateTime: [
672
+ { key: a["date-picker"].type, value: a["date-picker"].name }
673
+ ],
674
+ Boolean: [
675
+ { key: a.switch.type, value: a.switch.name },
676
+ { key: a["check-box"].type, value: a["check-box"].name }
677
+ ],
678
+ Enum: [
679
+ { key: a["combo-list"].type, value: a["combo-list"].name },
680
+ { key: a["radio-group"].type, value: a["radio-group"].name }
681
+ ],
682
+ Object: [
683
+ { key: a.lookup.type, value: a.lookup.name },
684
+ { key: a["combo-list"].type, value: a["combo-list"].name },
685
+ { key: a["radio-group"].type, value: a["radio-group"].name }
686
+ ]
687
+ });
688
+ let S = I;
689
+ var P = /* @__PURE__ */ ((g) => (g.Form = "Form", g.Variable = "Variable", g))(P || {});
690
+ class de {
691
+ constructor() {
692
+ /** 控件标题 */
693
+ h(this, "label", "");
694
+ /** 控件id */
695
+ h(this, "id", "");
696
+ /** 每个控件占用的栅格数 */
697
+ h(this, "columnInSM", 12);
698
+ h(this, "columnInMD", 6);
699
+ h(this, "columnInLG", 3);
700
+ h(this, "columnInEL", 2);
701
+ /** 每个控件占用的列数 */
702
+ h(this, "displayWidthInSM", 1);
703
+ h(this, "displayWidthInMD", 1);
704
+ h(this, "displayWidthInLG", 1);
705
+ h(this, "displayWidthInEL", 1);
706
+ /** 编辑器内部默认显示的屏幕大小-----可以去掉 */
707
+ h(this, "displayColumnCountAtBreakPoint", "md");
708
+ /** 控件所在行,传0即可-----编辑器内部使用 */
709
+ h(this, "tagRow", 0);
710
+ /** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
711
+ h(this, "showTopBorder", 0);
712
+ /** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
713
+ h(this, "group", 1);
714
+ /** 控件是否符合标准的class配置(设计器用的) */
715
+ h(this, "isSupportedClass", !0);
716
+ /** 控件所在分组id(设计器用的) */
717
+ h(this, "fieldSetId", "");
718
+ }
719
+ }
720
+ function ce(g) {
721
+ let n, e;
722
+ const t = /* @__PURE__ */ new Map();
723
+ let i = [];
724
+ function r(d, l) {
725
+ const f = d.split(" ").filter((b) => b.startsWith("col-"));
726
+ if (f.length === 0) {
727
+ l.isSupportedClass = !1;
728
+ return;
729
+ }
730
+ let p = f.find((b) => /^col-([1-9]|10|11|12)$/.test(b)), m = f.find((b) => /^col-md-([1-9]|10|11|12)$/.test(b)), y = f.find((b) => /^col-xl-([1-9]|10|11|12)$/.test(b)), C = f.find((b) => /^col-el-([1-9]|10|11|12)$/.test(b));
731
+ p = p || "col-12", l.columnInSM = parseInt(p.replace("col-", ""), 10), l.displayWidthInSM = l.columnInSM / 12, l.displayWidthInSM !== 1 && (l.isSupportedClass = !1), m = m || "col-md-" + l.columnInSM, l.columnInMD = parseInt(m.replace("col-md-", ""), 10), l.displayWidthInMD = l.columnInMD / 6, [1, 2].includes(l.displayWidthInMD) || (l.isSupportedClass = !1), y = y || "col-xl-" + l.columnInMD, l.columnInLG = parseInt(y.replace("col-xl-", ""), 10), l.displayWidthInLG = l.columnInLG / 3, [1, 2, 3, 4].includes(l.displayWidthInLG) || (l.isSupportedClass = !1), C = C || "col-el-" + l.columnInLG, l.columnInEL = parseInt(C.replace("col-el-", ""), 10), l.displayWidthInEL = l.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(l.displayWidthInEL) || (l.isSupportedClass = !1);
732
+ }
733
+ function s(d, l, A, f = !1) {
734
+ let p = !1;
735
+ d.contents.forEach((m) => {
736
+ if (m.type === "fieldset") {
737
+ A += 1, s(m, l, A, !0), p = !0;
738
+ return;
739
+ }
740
+ p && (A += 1, p = !1);
741
+ const y = m.appearance && m.appearance.class, C = new de();
742
+ y ? r(y, C) : C.isSupportedClass = !1, C.label = m.label || m.id, C.id = m.id, C.group = A, f && (C.fieldSetId = d.id), e === m.id && (n = A), t.set(m.id, m), l.push(C);
743
+ });
744
+ }
745
+ function c(d) {
746
+ const l = g.getComponentById(d);
747
+ if (!l || !l.componentType || !l.componentType.startsWith("form"))
748
+ return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
749
+ const A = g.selectNode(l, (f) => f.type === a["response-form"].type);
750
+ return !A || !A.contents || A.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: A };
751
+ }
752
+ function o(d, l) {
753
+ l = l || d.id;
754
+ const { result: A, message: f, formNode: p } = c(l);
755
+ if (!A)
756
+ return { result: A, message: f };
757
+ e = d.id, i = [], t.clear();
758
+ const m = p.contents[0].type === a.fieldset.type ? 0 : 1;
759
+ s(p, i, m);
760
+ const y = i.find((b) => !b.isSupportedClass);
761
+ return {
762
+ defaultState: {
763
+ defaultGroupNumber: n || 1,
764
+ model: y ? "customize" : "standard"
765
+ },
766
+ importData: i
767
+ };
768
+ }
769
+ function u(d, l) {
770
+ l = l;
771
+ const { result: A, formNode: f } = c(l);
772
+ if (!A)
773
+ return "";
774
+ const p = [];
775
+ return d.forEach((m) => {
776
+ var b;
777
+ const y = t.get(m.id), C = y.appearance && y.appearance.class;
778
+ if (C) {
779
+ const F = C.split(" ").filter((O) => !O.startsWith("col-")), B = "col-" + m.columnInSM, W = "col-md-" + m.columnInMD, j = "col-xl-" + m.columnInLG, D = "col-el-" + m.columnInEL, Z = [B, W, j, D].concat(F);
780
+ y.appearance.class = Z.join(" ");
781
+ }
782
+ if (m.fieldSetId) {
783
+ const T = f.contents.find((B) => B.id === m.fieldSetId), F = p.find((B) => B.id === m.fieldSetId);
784
+ F ? (b = F.contents) == null || b.push(y) : (p.push(T), T.contents = [y]);
785
+ } else
786
+ p.push(y);
787
+ }), f.contents = p, f.id;
788
+ }
789
+ return {
790
+ checkCanFindFormNode: c,
791
+ checkCanOpenLayoutEditor: o,
792
+ changeFormControlsByResponseLayoutConfig: u,
793
+ getResonseFormLayoutConfig: s
794
+ };
795
+ }
796
+ const Ae = (g) => v($, null, [v("h5", null, [_("代码示例")]), v("pre", {
797
+ style: "background-color: #f5f5f5; padding: 10px; border-radius: 5px;"
798
+ }, [v("code", null, [`
799
+ <h3>Tips:</h3>
800
+ <span style="color: blue;">
801
+ 自定义提示内容
802
+ </span>
803
+ `])])]);
804
+ class ue extends le {
805
+ constructor(e, t) {
806
+ super(e, t);
807
+ h(this, "responseLayoutEditorFunction");
808
+ /** 控件绑定的变量 */
809
+ h(this, "bindingVarible");
810
+ h(this, "formGroupEvents", [
811
+ {
812
+ label: "fieldValueChanging",
813
+ name: "绑定字段值变化前事件"
814
+ },
815
+ {
816
+ label: "fieldValueChanged",
817
+ name: "绑定字段值变化后事件"
818
+ },
819
+ {
820
+ label: "onClickLabel",
821
+ name: "标签点击事件"
822
+ }
823
+ ]);
824
+ h(this, "numberEditorOptions", {
825
+ type: "number-spinner",
826
+ useThousands: !1,
827
+ keyboard: !1,
828
+ showButton: !1
829
+ });
830
+ this.responseLayoutEditorFunction = ce(this.formSchemaUtils);
831
+ }
832
+ getCommonPropertyConfig(e, t, i = "Card") {
833
+ if (this.propertyConfig.categories.basic = this.getBasicProperties(e, t, i), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e, t), this.propertyConfig.categories.behavior = this.getBehaviorConfig(e, "form-group"), i === "Card") {
834
+ const r = this.getTipsConfig(e);
835
+ this.propertyConfig.categories.behavior.properties = { ...this.propertyConfig.categories.behavior.properties, ...r }, ["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group", "language-textbox"].includes(e.editor.type) && (this.propertyConfig.categories.expansion = this.getExpandProperties(e));
836
+ }
837
+ }
838
+ getPropertyConfig(e, t) {
839
+ return this.getCommonPropertyConfig(e, t, "Card"), this.propertyConfig.categories.editor = this.getEditorProperties(e), this.propertyConfig.categories.expressions = this.getExpressionConfig(e, "Field"), this.propertyConfig.categories.eventsEditor = this.getEventPropertyConfig(e), this.propertyConfig;
840
+ }
841
+ getGridFieldEdtiorPropConfig(e, t) {
842
+ return this.propertyConfig.categories = {}, this.getCommonPropertyConfig(e, t, "Grid"), this.getGridFieldEdtiorProperties ? this.propertyConfig.categories.editor = this.getGridFieldEdtiorProperties(e) : this.propertyConfig.categories.editor = this.getEditorProperties(e), this.propertyConfig.categories.expressons = this.getExpressionConfig(e, "Field"), this.propertyConfig.categories;
843
+ }
844
+ getBasicProperties(e, t, i = "Card") {
845
+ var u;
846
+ const r = this;
847
+ this.setDesignViewModelField(e);
848
+ const { canChangeControlType: s, editorTypeList: c } = this.getAvailableEditorType(e), o = {
849
+ description: "Basic Information",
850
+ title: "基本信息",
851
+ properties: {
852
+ id: {
853
+ description: "组件标识",
854
+ title: "标识",
855
+ type: "string",
856
+ readonly: !0
857
+ },
858
+ type: {
859
+ description: "编辑器类型",
860
+ title: "编辑器类型",
861
+ type: "string",
862
+ $converter: "/converter/change-editor.converter",
863
+ parentPropertyID: "editor",
864
+ editor: {
865
+ type: "combo-list",
866
+ textField: "value",
867
+ valueField: "key",
868
+ idField: "key",
869
+ editable: !1,
870
+ data: c,
871
+ readonly: !s
872
+ }
873
+ },
874
+ label: {
875
+ title: "标签",
876
+ type: "string",
877
+ $converter: "/converter/form-group-label.converter"
878
+ },
879
+ showLabelType: {
880
+ description: "标签显示方式:1、显示:显示标签 2、占位:保留标签空间,但不显示文本 3、不显示:不显示标签",
881
+ title: "标签显示",
882
+ type: "enum",
883
+ editor: {
884
+ data: [{ id: "visible", name: "显示" }, { id: "reserve-space", name: "占位" }, { id: "none", name: "不显示" }]
885
+ },
886
+ defaultValue: ((u = e.editor) == null ? void 0 : u.type) === "image" ? "none" : "visible"
887
+ },
888
+ binding: {
889
+ description: "绑定的表单字段",
890
+ title: "绑定",
891
+ editor: {
892
+ type: "binding-selector",
893
+ bindingType: { enable: !0 },
894
+ editorParams: {
895
+ componentSchema: e,
896
+ needSyncToViewModel: !0,
897
+ viewModelId: this.viewModelId,
898
+ designerHostService: this.designerHostService,
899
+ disableOccupiedFields: !0
900
+ },
901
+ textField: "bindingField"
902
+ },
903
+ refreshPanelAfterChanged: !0,
904
+ readonly: this.formSchemaUtils.designerMode === "PC_RTC" && !e.isRtcControl
905
+ }
906
+ },
907
+ setPropertyRelates(d, l, A) {
908
+ if (d)
909
+ switch (d && d.propertyID) {
910
+ case "type": {
911
+ r.changeControlType(e, d, t);
912
+ break;
913
+ }
914
+ case "label": {
915
+ d.needRefreshControlTree = !0;
916
+ break;
917
+ }
918
+ case "binding": {
919
+ r.changeBindingField(e, d, A);
920
+ break;
921
+ }
922
+ }
923
+ }
924
+ };
925
+ return i.toLocaleLowerCase() !== "card" && delete o.properties.showLabelType, o;
926
+ }
927
+ getExpandProperties(e) {
928
+ const t = this, i = ["Const", "Variable"], r = this.getPropertyEditorParams(e, i, "expandable"), s = this.getPropertyEditorParams(e, i, "expandDisabled");
929
+ return {
930
+ description: "Expand Information",
931
+ title: "扩展区域",
932
+ properties: {
933
+ expandable: {
934
+ description: "是否启用扩展区域",
935
+ title: "启用扩展区域",
936
+ refreshPanelAfterChanged: !0,
937
+ $converter: "/converter/property-editor.converter",
938
+ editor: r
939
+ },
940
+ expandMode: {
941
+ description: "扩展模式 text | button",
942
+ title: "扩展模式",
943
+ type: "enum",
944
+ refreshPanelAfterChanged: !0,
945
+ $converter: "/converter/property-editor.converter",
946
+ editor: {
947
+ data: [{ id: "text", name: "静态文本" }, { id: "button", name: "交互按钮" }]
948
+ },
949
+ defaultValue: "text",
950
+ visible: !!e.editor.expandable
951
+ },
952
+ expandContent: {
953
+ $converter: "/converter/property-editor.converter",
954
+ description: "扩展内容",
955
+ title: "扩展内容",
956
+ type: "string",
957
+ visible: !!e.editor.expandable
958
+ },
959
+ expandDisabled: {
960
+ $converter: "/converter/property-editor.converter",
961
+ description: "是否隐藏扩展区域",
962
+ title: "隐藏扩展区域",
963
+ editor: s,
964
+ visible: !!e.editor.expandable
965
+ }
966
+ },
967
+ setPropertyRelates(o, u) {
968
+ if (o)
969
+ switch (o.propertyID) {
970
+ case "expandable":
971
+ case "expandDisabled":
972
+ t.afterMutilEditorChanged(e, o);
973
+ break;
974
+ }
975
+ }
976
+ };
977
+ }
978
+ /**
979
+ * 校验控件是否支持切换类型
980
+ * @param control 控件
981
+ */
982
+ checkCanChangeControlType(e, t) {
983
+ if (!e.binding)
984
+ return !1;
985
+ if (e.binding.type === "Variable") {
986
+ if (this.bindingVarible = this.formSchemaUtils.getVariableById(e.binding.field), !this.bindingVarible)
987
+ return !1;
988
+ } else if (!this.designViewModelField || this.designViewModelField.$type !== R.SimpleField)
989
+ return !1;
990
+ return !0;
991
+ }
992
+ /**
993
+ * 获取可选的编辑器类型
994
+ */
995
+ getAvailableEditorType(e) {
996
+ var r;
997
+ const t = this.checkCanChangeControlType(e, this.viewModelId);
998
+ if (!t)
999
+ return {
1000
+ canChangeControlType: !1,
1001
+ editorTypeList: [{
1002
+ key: e.editor.type,
1003
+ value: ((r = a[e.editor.type]) == null ? void 0 : r.name) || e.editor.type
1004
+ }]
1005
+ };
1006
+ let i = [];
1007
+ return this.designViewModelField && this.designViewModelField.$type === R.SimpleField ? i = S.getEditorTypesByMDataType(this.designViewModelField.type.name, this.designViewModelField.multiLanguage) : this.bindingVarible && (i = S.getEditorTypesByMDataType(this.bindingVarible.type, !1)), { canChangeControlType: t, editorTypeList: i };
1008
+ }
1009
+ changeBindingField(e, t, i) {
1010
+ t.needRefreshEntityTree = !0;
1011
+ }
1012
+ getAppearanceProperties(e, t) {
1013
+ const i = this;
1014
+ return {
1015
+ title: "外观",
1016
+ description: "Appearance",
1017
+ properties: {
1018
+ class: {
1019
+ title: "class样式",
1020
+ type: "string",
1021
+ description: "组件的CSS样式",
1022
+ $converter: "/converter/appearance.converter",
1023
+ parentPropertyID: "appearance"
1024
+ },
1025
+ style: {
1026
+ title: "style样式",
1027
+ type: "string",
1028
+ description: "组件的内联样式",
1029
+ $converter: "/converter/appearance.converter",
1030
+ parentPropertyID: "appearance"
1031
+ },
1032
+ fill: {
1033
+ title: "填充宽度",
1034
+ description: "启用后,控件占满父容器宽度",
1035
+ type: "boolean",
1036
+ parentPropertyID: "appearance"
1037
+ },
1038
+ responseLayout: {
1039
+ description: "响应式列宽",
1040
+ title: "响应式列宽",
1041
+ type: "boolean",
1042
+ visible: !0,
1043
+ // 这个属性,标记当属性变更得时候触发重新更新属性
1044
+ refreshPanelAfterChanged: !0,
1045
+ editor: {
1046
+ type: "response-layout-editor-setting",
1047
+ beforeOpen: () => i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e, i.componentId)
1048
+ }
1049
+ }
1050
+ },
1051
+ setPropertyRelates(r, s) {
1052
+ if (r)
1053
+ switch (r && r.propertyID) {
1054
+ case "responseLayout":
1055
+ i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(r.propertyValue, i.componentId || e.id), i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId), i.updateElementByParentContainer(e.id, t), delete e.responseLayout;
1056
+ break;
1057
+ case "class":
1058
+ i.updateUnifiedLayoutAfterControlChanged(r.propertyValue, e.id, this.componentId), w.value++;
1059
+ break;
1060
+ case "style": {
1061
+ w.value++;
1062
+ break;
1063
+ }
1064
+ }
1065
+ }
1066
+ };
1067
+ }
1068
+ getEditorProperties(e) {
1069
+ return this.getComponentConfig(e);
1070
+ }
1071
+ /**
1072
+ * 卡片控件:切换控件类型后事件
1073
+ * @param propertyData 控件DOM属性
1074
+ * @param newControlType 新控件类型
1075
+ */
1076
+ changeControlType(e, t, i) {
1077
+ const r = t.propertyValue, s = i && i.parent && i.parent.schema;
1078
+ if (!s)
1079
+ return;
1080
+ const c = s.contents.findIndex((d) => d.id === e.id);
1081
+ if (c === -1)
1082
+ return;
1083
+ const o = s.contents[c];
1084
+ let u;
1085
+ if (this.designViewModelField) {
1086
+ const A = this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find((p) => p.id === this.designViewModelField.id).fieldSchema || {};
1087
+ A.editor || (A.editor = {}), A.editor.$type = r, this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, A, !1), u = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, r);
1088
+ }
1089
+ u || (u = this.controlCreatorUtils.createFormGroupWithoutField(r)), Object.assign(u, {
1090
+ id: o.id,
1091
+ appearance: o.appearance,
1092
+ size: o.size,
1093
+ label: o.label,
1094
+ binding: o.binding
1095
+ }), Object.prototype.hasOwnProperty.call(o, "visible") && Object.assign(u, { visible: o.visible }), o.editor && ["readonly", "required", "placeholder"].map((d) => {
1096
+ Object.prototype.hasOwnProperty.call(o.editor, d) && (u.editor[d] = o.editor[d]);
1097
+ }), i != null && i.updateContextSchema ? i.updateContextSchema(u) : (i.schema = Object.assign(o, u), Object.assign(e, u)), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
1098
+ (d) => d.classList.remove("dgComponentSelected")
1099
+ ), Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(
1100
+ (d) => d.classList.remove("dgComponentFocused")
1101
+ ), w.value++, ee(() => {
1102
+ this.getFormDesignerInstance().reloadPropertyPanel();
1103
+ });
1104
+ }
1105
+ getTipsConfig(e) {
1106
+ return ["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group", "textarea", "rich-text-editor", "language-textbox"].includes(e.editor.type) ? {
1107
+ enableTips: {
1108
+ refreshPanelAfterChanged: !0,
1109
+ description: "",
1110
+ title: "启用提示",
1111
+ type: "boolean",
1112
+ default: !1
1113
+ },
1114
+ tipsContent: {
1115
+ description: "提示内容",
1116
+ title: "提示内容",
1117
+ type: "string",
1118
+ editor: {
1119
+ type: "code-editor",
1120
+ language: "html",
1121
+ leftTemplate: Ae
1122
+ },
1123
+ visible: !!e.enableTips
1124
+ }
1125
+ } : {};
1126
+ }
1127
+ getComponentConfig(e, t = {}, i = {}, r) {
1128
+ var A, f;
1129
+ const s = Object.assign({
1130
+ description: "编辑器",
1131
+ title: "编辑器",
1132
+ type: "input-group",
1133
+ $converter: "/converter/property-editor.converter",
1134
+ parentPropertyID: "editor"
1135
+ }, t), c = (A = e.binding) != null && A.field ? [] : ["Const", "Variable", "StateMachine"], o = this.getPropertyEditorParams(e, c, "readonly"), u = this.getPropertyEditorParams(e, c, "required"), d = {
1136
+ readonly: {
1137
+ description: "",
1138
+ title: "只读",
1139
+ editor: o
1140
+ },
1141
+ required: {
1142
+ description: "",
1143
+ title: "必填",
1144
+ type: "boolean",
1145
+ editor: u,
1146
+ visible: !!((f = e.binding) != null && f.field)
1147
+ },
1148
+ placeholder: {
1149
+ description: "当控件没有值时在输入框中显示的文本",
1150
+ title: "提示文本",
1151
+ type: "string"
1152
+ }
1153
+ };
1154
+ for (const p in i)
1155
+ d[p] = Object.assign(d[p] || {}, i[p]);
1156
+ const l = this;
1157
+ return {
1158
+ ...s,
1159
+ properties: { ...d },
1160
+ setPropertyRelates(p, m) {
1161
+ if (p) {
1162
+ switch (p.propertyID) {
1163
+ case "readonly":
1164
+ case "required":
1165
+ l.afterMutilEditorChanged(e, p);
1166
+ break;
1167
+ }
1168
+ r && r.bind(l)(p, e, m);
1169
+ }
1170
+ }
1171
+ };
1172
+ }
1173
+ /**
1174
+ * 修改某一输入控件的样式后更新Form的统一布局配置
1175
+ * @param controlClass 控件样式
1176
+ * @param controlId 控件Id
1177
+ * @param componentId 控件所在组件id
1178
+ */
1179
+ updateUnifiedLayoutAfterControlChanged(e, t, i) {
1180
+ const r = e.split(" ");
1181
+ let s = r.find((l) => /^col-([1-9]|10|11|12)$/.test(l)), c = r.find((l) => /^col-md-([1-9]|10|11|12)$/.test(l)), o = r.find((l) => /^col-xl-([1-9]|10|11|12)$/.test(l)), u = r.find((l) => /^col-el-([1-9]|10|11|12)$/.test(l));
1182
+ s = s || "col-12", c = c || "col-md-" + s.replace("col-", ""), o = o || "col-xl-" + c.replace("col-md-", ""), u = u || "col-el-" + o.replace("col-xl-", "");
1183
+ const d = {
1184
+ id: t,
1185
+ columnInSM: parseInt(s.replace("col-", ""), 10),
1186
+ columnInMD: parseInt(c.replace("col-md-", ""), 10),
1187
+ columnInLG: parseInt(o.replace("col-xl-", ""), 10),
1188
+ columnInEL: parseInt(u.replace("col-el-", ""), 10)
1189
+ };
1190
+ this.updateUnifiedLayoutAfterResponseLayoutChanged(i, d);
1191
+ }
1192
+ /**
1193
+ * 修改控件布局配置后更新Form统一布局配置
1194
+ * @param componentId 组件Id
1195
+ * @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
1196
+ */
1197
+ updateUnifiedLayoutAfterResponseLayoutChanged(e, t) {
1198
+ const { formNode: i } = this.responseLayoutEditorFunction.checkCanFindFormNode(e);
1199
+ if (!i || !i.unifiedLayout)
1200
+ return;
1201
+ const r = [];
1202
+ if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i, r, 1), t) {
1203
+ const p = r.find((m) => m.id === t.id);
1204
+ Object.assign(p || {}, t);
1205
+ }
1206
+ const s = r.map((p) => p.columnInSM), c = r.map((p) => p.columnInMD), o = r.map((p) => p.columnInLG), u = r.map((p) => p.columnInEL), d = this.checkIsUniqueColumn(s) ? s[0] : null, l = this.checkIsUniqueColumn(c) ? c[0] : null, A = this.checkIsUniqueColumn(o) ? o[0] : null, f = this.checkIsUniqueColumn(u) ? u[0] : null;
1207
+ Object.assign(i.unifiedLayout, {
1208
+ uniqueColClassInSM: d,
1209
+ uniqueColClassInMD: l,
1210
+ uniqueColClassInLG: A,
1211
+ uniqueColClassInEL: f
1212
+ });
1213
+ }
1214
+ /**
1215
+ * 校验宽度样式值是否一致
1216
+ */
1217
+ checkIsUniqueColumn(e) {
1218
+ const t = new Set(e);
1219
+ return Array.from(t).length === 1;
1220
+ }
1221
+ /**
1222
+ * 枚举项编辑器
1223
+ * @param propertyData
1224
+ * @param valueField
1225
+ * @param textField
1226
+ * @returns
1227
+ */
1228
+ getItemCollectionEditor(e, t, i) {
1229
+ return t = t || "value", i = i || "name", {
1230
+ editor: {
1231
+ columns: [
1232
+ { field: t, title: "值", dataType: "string" },
1233
+ { field: i, title: "名称", dataType: "string" }
1234
+ // { field: 'disabled', title: '禁用', dataType: 'boolean', editor: { type: 'switch' } },
1235
+ ],
1236
+ type: "item-collection-editor",
1237
+ valueField: t,
1238
+ nameField: i,
1239
+ requiredFields: [t, i],
1240
+ uniqueFields: [t, i],
1241
+ readonly: this.checkEnumDataReadonly(e)
1242
+ }
1243
+ };
1244
+ }
1245
+ /**
1246
+ * 判断枚举数据是否只读
1247
+ * 1、没有绑定信息或者绑定变量,可以新增、删除、修改
1248
+ * 2、绑定类型为字段,且字段为枚举字段,则不可新增、删除、修改枚举值。只能从be修改然后同步到表单上。
1249
+ * @param propertyData 下拉框控件属性值
1250
+ */
1251
+ checkEnumDataReadonly(e) {
1252
+ return !e.binding || e.binding.type !== "Form" ? !1 : !!(this.designViewModelField && this.designViewModelField.type && this.designViewModelField.type.$type === Y.EnumType);
1253
+ }
1254
+ /**
1255
+ * 将字段值变化前事件、变化后事件追加到交互面板
1256
+ * 注意:因为绑定字段值变化后事件与下拉框的值变化事件(valueChanged)重名,所以这里将事件label都重命名下
1257
+ */
1258
+ appendFieldValueChangeEvents(e, t) {
1259
+ e.binding && e.binding.type === P.Form && e.binding.field ? (t.find((i) => i.label === "fieldValueChanging"), t.find((i) => i.label === "fieldValueChanged"), this.designViewModelField && (e.fieldValueChanging = this.designViewModelField.valueChanging, e.fieldValueChanged = this.designViewModelField.valueChanged)) : t = t.filter((i) => i.label !== "fieldValueChanging" && i.label !== "fieldValueChanged");
1260
+ }
1261
+ getControlMethodType(e) {
1262
+ if (!e.binding)
1263
+ return e.type;
1264
+ switch (e.binding.type) {
1265
+ case P.Form:
1266
+ return e.binding.path || e.type;
1267
+ case P.Variable:
1268
+ return e.binding.fullPath || e.type;
1269
+ }
1270
+ return e.type;
1271
+ }
1272
+ updateLinkedLabel(e, t) {
1273
+ if (e.boundEventsList && e.boundEventsList.length > 0) {
1274
+ const i = e.boundEventsList.find((r) => r.boundEvents && r.boundEvents.label === "onClickLabel");
1275
+ t.linkLabel = !!i;
1276
+ } else
1277
+ t.linkLabel = !1;
1278
+ }
1279
+ /**
1280
+ * 组装输入类控件的交互面板:包含标签超链、绑定字段值变化前后事件等。
1281
+ * @param propertyData 属性值
1282
+ * @param viewModelId 视图模型id
1283
+ * @param showPosition 面板展示位置
1284
+ * @param customEvent 输入控件特有的事件配置
1285
+ */
1286
+ getEventPropertyConfig(e, t = "card", i, r) {
1287
+ const s = this;
1288
+ let c = [...this.formGroupEvents];
1289
+ if (["time-picker", "date-picker", "lookup", "combo-list", "number-spinner", "input-group"].includes(e.editor.type) && c.push({
1290
+ lable: "onClear",
1291
+ name: "清空事件"
1292
+ }), i && (c = c.concat(i)), c.length === 0)
1293
+ return {
1294
+ title: "事件",
1295
+ hideTitle: !0,
1296
+ properties: {},
1297
+ tabId: "commands",
1298
+ tabName: "交互",
1299
+ hide: !0
1300
+ };
1301
+ this.appendFieldValueChangeEvents(e, c);
1302
+ const u = s.eventsEditorUtils.formProperties(e, s.viewModelId, c);
1303
+ return {
1304
+ title: "事件",
1305
+ hideTitle: !0,
1306
+ properties: s.createBaseEventProperty(u),
1307
+ tabId: "commands",
1308
+ tabName: "交互",
1309
+ setPropertyRelates(A, f) {
1310
+ const p = A.propertyValue;
1311
+ delete e[s.viewModelId], p && (p.setPropertyRelates = this.setPropertyRelates, p.controlInfo = { type: s.getControlMethodType(e), name: e.title }, s.eventsEditorUtils.saveRelatedParameters(e, s.viewModelId, p.events, p), s.updateLinkedLabel(p, f)), r && r(A, f, p);
1312
+ const m = s.designViewModelUtils.getDgViewModel(s.viewModelId);
1313
+ m && s.designViewModelField && m.changeField(s.designViewModelField.id, { valueChanging: e.fieldValueChanging, valueChanged: e.fieldValueChanged });
1314
+ }
1315
+ };
1316
+ }
1317
+ getExpressionConfig(e, t, i = ["compute", "dependency", "validate"], r) {
1318
+ return new U(this.formSchemaUtils).getExpressionConfig(
1319
+ e,
1320
+ t,
1321
+ i,
1322
+ r
1323
+ );
1324
+ }
1325
+ getBindingDataType() {
1326
+ return this.designViewModelField ? this.designViewModelField.type.name === "Number" ? "number" : this.designViewModelField.type.name === "String" ? "string" : "boolean" : "boolean";
1327
+ }
1328
+ getEditor() {
1329
+ return this.getBindingDataType() === "number" ? this.numberEditorOptions : {};
1330
+ }
1331
+ updatePropertyValue(e, t, i) {
1332
+ var r;
1333
+ e.editor[t] !== i ? e.editor[t] = i : (r = this.getFormDesignerInstance()) == null || r.reloadPropertyPanel();
1334
+ }
1335
+ setBooleanValue(e, t, i) {
1336
+ let r = i;
1337
+ this.getBindingDataType() === "string" && (r = (r || "").trim() || (t === "trueValue" ? "true" : "false"));
1338
+ const c = t === "trueValue" ? "falseValue" : "trueValue";
1339
+ e.editor[c] === r && (r = r + 1), this.updatePropertyValue(e, t, r);
1340
+ }
1341
+ getBooleanValueConverter() {
1342
+ return {
1343
+ convertFrom: (e, t) => e.editor[t],
1344
+ convertTo: (e, t, i) => {
1345
+ this.setBooleanValue(e, t, i);
1346
+ }
1347
+ };
1348
+ }
1349
+ }
1350
+ class pe extends ue {
1351
+ constructor(n, e) {
1352
+ super(n, e);
1353
+ }
1354
+ getEditorProperties(n) {
1355
+ return this.getComponentConfig(n, {}, {
1356
+ placeholder: {
1357
+ visible: !1
1358
+ },
1359
+ maxSize: {
1360
+ description: "允许头像上传的大小,单位MB",
1361
+ title: "允许图片大小 (M)",
1362
+ type: "number"
1363
+ },
1364
+ cover: {
1365
+ description: "",
1366
+ title: "默认封面",
1367
+ type: "string"
1368
+ },
1369
+ title: {
1370
+ description: "鼠标滑过图像时的提示文字",
1371
+ title: "提示文字",
1372
+ type: "string"
1373
+ },
1374
+ avatarWidth: {
1375
+ description: "",
1376
+ title: "头像宽度",
1377
+ type: "number",
1378
+ editor: {
1379
+ nullable: !0,
1380
+ min: 0,
1381
+ useThousands: !1,
1382
+ needValid: !0
1383
+ }
1384
+ },
1385
+ avatarHeight: {
1386
+ description: "",
1387
+ title: "头像高度",
1388
+ type: "number",
1389
+ editor: {
1390
+ nullable: !0,
1391
+ min: 0,
1392
+ useThousands: !1,
1393
+ needValid: !0
1394
+ }
1395
+ },
1396
+ imageType: {
1397
+ description: "允许图片上传的类型",
1398
+ title: "允许图片格式",
1399
+ type: "array",
1400
+ editor: {
1401
+ type: "combo-list",
1402
+ placeholder: "",
1403
+ multiSelect: !0,
1404
+ data: [
1405
+ { id: "png", name: "png" },
1406
+ { id: "jpg", name: "jpg" },
1407
+ { id: "jpeg", name: "jpeg" },
1408
+ { id: "webp", name: "webp" },
1409
+ { id: "svg", name: "svg" },
1410
+ { id: "gif", name: "gif" },
1411
+ { id: "bmp", name: "bmp" }
1412
+ ]
1413
+ }
1414
+ }
1415
+ });
1416
+ }
1417
+ }
1418
+ function ge(g, n) {
1419
+ const e = g.schema;
1420
+ function t(i, r) {
1421
+ return new pe(i, n).getPropertyConfig(e, r);
1422
+ }
1423
+ return {
1424
+ getPropsConfig: t
1425
+ };
1426
+ }
1427
+ function L(g, n, e) {
1428
+ return n;
1429
+ }
1430
+ const fe = /* @__PURE__ */ new Map([
1431
+ ["appearance", k],
1432
+ ["imageType", k]
1433
+ ]), me = /* @__PURE__ */ new Map([
1434
+ ["appearance", k]
1435
+ ]), he = "https://json-schema.org/draft/2020-12/schema", ye = "https://farris-design.gitee.io/avatar.schema.json", Ce = "avatar", ve = "A Farris Component", be = "object", Ee = {
1436
+ id: {
1437
+ description: "The unique identifier for avatar",
1438
+ type: "string"
1439
+ },
1440
+ type: {
1441
+ description: "The type string of avatar",
1442
+ type: "string",
1443
+ default: "avatar"
1444
+ },
1445
+ appearance: {
1446
+ description: "",
1447
+ type: "object",
1448
+ properties: {
1449
+ class: {
1450
+ type: "string"
1451
+ },
1452
+ style: {
1453
+ type: "string"
1454
+ }
1455
+ },
1456
+ default: {}
1457
+ },
1458
+ binding: {
1459
+ description: "",
1460
+ type: "object",
1461
+ default: {}
1462
+ },
1463
+ disabled: {
1464
+ type: "boolean",
1465
+ default: !1
1466
+ },
1467
+ avatarWidth: {
1468
+ description: "",
1469
+ type: "number"
1470
+ },
1471
+ title: {
1472
+ description: "",
1473
+ type: "string"
1474
+ },
1475
+ avatarHeight: {
1476
+ description: "",
1477
+ type: "number"
1478
+ },
1479
+ readonly: {
1480
+ description: "",
1481
+ type: "boolean",
1482
+ default: !1
1483
+ },
1484
+ cover: {
1485
+ description: "",
1486
+ type: "string"
1487
+ },
1488
+ visible: {
1489
+ description: "",
1490
+ type: "boolean",
1491
+ default: !0
1492
+ }
1493
+ }, Ie = [
1494
+ "id",
1495
+ "type"
1496
+ ], Be = [
1497
+ "id",
1498
+ "appearance",
1499
+ "binding",
1500
+ "visible"
1501
+ ], q = {
1502
+ $schema: he,
1503
+ $id: ye,
1504
+ title: Ce,
1505
+ description: ve,
1506
+ type: be,
1507
+ properties: Ee,
1508
+ required: Ie,
1509
+ ignore: Be
1510
+ }, Q = {
1511
+ /**
1512
+ * 头像宽度
1513
+ */
1514
+ avatarWidth: { type: Number, default: 100 },
1515
+ /**
1516
+ * 头像高度
1517
+ */
1518
+ avatarHeight: { type: Number, default: 100 },
1519
+ /**
1520
+ * 组件标识
1521
+ */
1522
+ cover: { type: String },
1523
+ /**
1524
+ * 只读 readonly废弃
1525
+ */
1526
+ readonly: { type: Boolean, default: !1 },
1527
+ visible: { type: Boolean, default: !0 },
1528
+ /**
1529
+ * 头像形状
1530
+ */
1531
+ shape: { type: String, default: "circle" },
1532
+ /**
1533
+ * 允许头像上传大小, 单位MB
1534
+ */
1535
+ maxSize: { type: Number, default: 1 },
1536
+ /**
1537
+ * 组件值
1538
+ */
1539
+ modelValue: { type: String, default: "" },
1540
+ /**
1541
+ * 头像标题
1542
+ */
1543
+ title: { type: String, default: "" },
1544
+ /**
1545
+ * 支持的头像类型
1546
+ */
1547
+ imageType: { type: Array, default: [] }
1548
+ }, Fe = K(Q, q, fe, L), G = Object.assign({}, Q, {
1549
+ componentId: { type: String, default: "" }
1550
+ }), xe = K(G, q, me, L), M = /* @__PURE__ */ N({
1551
+ name: "FAvatarDesign",
1552
+ props: G,
1553
+ emits: ["change", "update:modelValue"],
1554
+ setup(g, n) {
1555
+ const e = x(), t = H("designer-host-service"), i = H("design-item-context"), r = ge(i, t), s = re(e, i, r);
1556
+ te(() => {
1557
+ e.value.componentInstance = s;
1558
+ }), n.expose(s.value);
1559
+ const c = E(() => ({
1560
+ "f-avatar": !0,
1561
+ "f-avatar-readonly": g.readonly === !0 || g.disabled === !0,
1562
+ "f-avatar-circle": g.shape === "circle",
1563
+ "f-avatar-square": g.shape === "square"
1564
+ })), o = E(() => g.readonly === !1 ? g.disabled : g.readonly), u = E(() => ({
1565
+ width: g.avatarWidth + "px",
1566
+ height: g.avatarHeight + "px"
1567
+ })), d = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAZABkAAD/2wBDAAwICQoJBwwKCQoNDAwOER0TERAQESMZGxUdKiUsKyklKCguNEI4LjE/MigoOk46P0RHSktKLTdRV1FIVkJJSkf/2wBDAQwNDREPESITEyJHMCgwR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAEsASwDASIAAhEBAxEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAECAwQFB//EADMQAQEAAQEECAQGAgMBAAAAAAABAhEDITFBBBRRUmFxgaESkcHwEyIysdHhM3IjQvE0/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAXEQEBAQEAAAAAAAAAAAAAAAAAEQEh/9oADAMBAAIRAxEAPwD9BBYqCiyAGhougIqyGgEhIui6AyuixdATQ0WQA0BdA4houhoCaGgugMrouhoCaJoum80BNDRdDQGTRbEBNCxdDQGTRUBE0asQGRTQGTT71WxNPP5AugqyACyAC6dpIsgGgshoBISKAiroQDQ0OSyAgoBoaABoaABomigJTRQGV0XRATRGizUGRSwGdEsaq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PuUcB36rl3sfc6rn3sfco4DvejZd7H3OrZd7H3KOA79Wy72PudWz72PuDg7dG/y3/W/Q6tl3sfdvY7K7PO25S6yzSdoOqWlEBmhaBamt+6J6AnmqaqDQy0CxYyoNCKC6m/VAGhPJdQBOSgKi6+QGu41QBRAF1LUABbUABNdAVOYUC0tE13gIWloCcTXeloFQLQTmffMtT74gixOa6gqysrzBVSVQVdWdQGpRNV1BV10SUlBYIvIF1E1Ne0F5iAKIAohaCmqWgBaapqC2ohqC6pqWoC2paa70tAqCACACa+F+RanyAWJ/a8vkAuqT6fVf7AVOz0X+AXVYh2egNSifx9T+wVWefyX+PqCyrqn807PQFEn0+p/YKH9H37gAc/kC6onL0P5BRP6OV8vqC2of2l/gAOSAuqan9J/AKmon9AUtL9PqnP1oCWl5ehfv5gh635nP1qWg//Z";
1568
+ return () => v("div", {
1569
+ ref: e,
1570
+ class: c.value,
1571
+ style: u.value
1572
+ }, [v("img", {
1573
+ title: g.title,
1574
+ class: "f-avatar-image",
1575
+ src: d
1576
+ }, null), !o.value && v("div", {
1577
+ class: "f-avatar-icon"
1578
+ }, [v("span", {
1579
+ class: "f-icon f-icon-camera"
1580
+ }, null)])]);
1581
+ }
1582
+ });
1583
+ function we(g, n, e, t) {
1584
+ function i(A) {
1585
+ return A.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/) != null;
1586
+ }
1587
+ const r = ["image/image", "image/webp", "image/png", "image/svg", "image/gif", "image/jpg", "image/jpeg", "image/bmp"];
1588
+ function s(A) {
1589
+ return A.indexOf("data:image/") > -1;
1590
+ }
1591
+ function c(A) {
1592
+ return A ? "data:image/jpeg;base64," + A : "";
1593
+ }
1594
+ const o = E(() => {
1595
+ var f;
1596
+ if (!g.imageType || !g.imageType.length)
1597
+ return r;
1598
+ const A = (f = g.imageType) == null ? void 0 : f.map((p) => (p === "jpg" && (p = "jpeg"), `image/${p}`));
1599
+ return !A || !A.length ? "image/*" : A.join(",");
1600
+ }), u = E(() => i(t.value) || s(t.value) ? t.value : c(t.value)), d = E(() => g.readonly ? "" : g.title);
1601
+ function l() {
1602
+ g.readonly || e && e.value && e.value.click();
1603
+ }
1604
+ return { acceptTypes: o, imageSource: u, imageTitle: d, onClickImage: l };
1605
+ }
1606
+ function Ve(g, n, e, t, i) {
1607
+ const r = new oe();
1608
+ function s(d) {
1609
+ t.value = d;
1610
+ }
1611
+ function c(d) {
1612
+ return new Promise((A, f) => {
1613
+ const p = new FileReader();
1614
+ p.readAsDataURL(d), p.onload = () => {
1615
+ A({ state: "done", content: p.result });
1616
+ }, p.onerror = function() {
1617
+ f({ state: "error", content: p.result });
1618
+ };
1619
+ });
1620
+ }
1621
+ function o(d) {
1622
+ const l = {
1623
+ size: d.size,
1624
+ name: d.name,
1625
+ type: d.type,
1626
+ lastModified: String(d.lastModified)
1627
+ };
1628
+ c(d).then((A) => {
1629
+ A.state === "done" && (s(A.content), l.state = A.state, l.base64 = A.content, n.emit("imageChange", l)), i.value = !1;
1630
+ }).catch((A) => {
1631
+ i.value = !1;
1632
+ const f = V.getLocaleValue("avatar.uploadError");
1633
+ r.error({ message: f, position: "top-center" });
1634
+ });
1635
+ }
1636
+ function u(d) {
1637
+ if (g.readonly)
1638
+ return;
1639
+ const l = d.target, A = l.files;
1640
+ if (!A || !A[0])
1641
+ return;
1642
+ const f = A[0].type, p = A[0].size / 1024 / 1024 < g.maxSize;
1643
+ if (e.value && e.value.split(",").indexOf(f) < 0) {
1644
+ const m = V.getLocaleValue("avatar.typeError");
1645
+ r.error({ message: m, position: "top-center" }), l.value = "";
1646
+ return;
1647
+ }
1648
+ if (!p) {
1649
+ const m = V.getLocaleValue("avatar.sizeError") + g.maxSize + "MB!";
1650
+ r.error({ message: m, position: "top-center" }), l.value = "";
1651
+ return;
1652
+ }
1653
+ i.value = !0, o(A[0]), l.value = "";
1654
+ }
1655
+ return { onFileChange: u };
1656
+ }
1657
+ const Pe = /* @__PURE__ */ N({
1658
+ name: "FAvatar",
1659
+ props: Q,
1660
+ emits: ["change", "update:modelValue"],
1661
+ setup(g, n) {
1662
+ const e = x(), t = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAZABkAAD/2wBDAAwICQoJBwwKCQoNDAwOER0TERAQESMZGxUdKiUsKyklKCguNEI4LjE/MigoOk46P0RHSktKLTdRV1FIVkJJSkf/2wBDAQwNDREPESITEyJHMCgwR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAEsASwDASIAAhEBAxEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAECAwQFB//EADMQAQEAAQEECAQGAgMBAAAAAAABAhEDITFBBBRRUmFxgaESkcHwEyIysdHhM3IjQvE0/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAXEQEBAQEAAAAAAAAAAAAAAAAAEQEh/9oADAMBAAIRAxEAPwD9BBYqCiyAGhougIqyGgEhIui6AyuixdATQ0WQA0BdA4houhoCaGgugMrouhoCaJoum80BNDRdDQGTRbEBNCxdDQGTRUBE0asQGRTQGTT71WxNPP5AugqyACyAC6dpIsgGgshoBISKAiroQDQ0OSyAgoBoaABoaABomigJTRQGV0XRATRGizUGRSwGdEsaqAljLQDOiNWJQZNJ4KffEFIRYAsFkAkFkAJFFkAkNCLIAAAC6AguhoCCl3TW2TzugIHx4S788Z6wmWN4ZY3ysoA1pu+qAgpYCAAaIoDIoCaJZvVAQ03LUBlGqWAzYmimn3vAaRYA1IkWASKKACgirIgAsgBoBdJNbZNN9t3aeIHNw2vSccbZhPxLN27dJ68/Rx222u1/LjbNn8vi/ieHPm58N03SKN5bfa58c7jOzHd78XOyXfd98bqoCaScp8jSdk+SgLjlljdccssfK12w6TlN2cmXjN1/iuAD34Z47Sa43XTjLus82nz5bjl8WNss4WPXsNtNpNLuzk3zlZ2wHUsBBF5CAFgAhouiUGRUBErSAyffFamgKqKCqkUBYcgBpADiuhoAKeYA8fStp8WX4WPCfq8b2eT1bXObPZZZ8bJr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FY8HP50AeQ0UUUAFFFFAH//0/7MKKKKACvffG8viWSOyk8PGYiRWL+SD/skZI6dTXgVd3D8RfEkFsltG0eI1ChiuTgcc84oAoX+n+MYVXVdUS4IgIYPIS205GDyTjmvRfFehXfjCysdc0ZVMjR/MCQODyBk+hyK831Lxn4i1a1ayvJ8xP8AeVVUZx7gZrMste1rToxBY3UsaDooY7R+HSgDrP7A+Itj/qvtCgf3Jgf0DUv2/wCJNl1F1x3MZcfmQay4vHniyH7t2T/vKh/mK0oviZ4mj++YpP8AeT/AigB//CdeNbP/AI+ucf8APSID+QFbvxUlcw6dG/3iHY/XC1Ri+KurL/r7aFv93cv8ya5XxT4om8T3EU0sQiESkAA569TnigDlqKKKACiiigD/1P7MKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/V/swooooAKKKKACiiigAooooAKKKKACiiigAooooA/9k=", r = E(() => ({
1663
+ "f-avatar": !0,
1664
+ "f-avatar-readonly": g.readonly,
1665
+ "f-avatar-circle": g.shape === "circle",
1666
+ "f-avatar-square": g.shape === "square"
1667
+ })), s = E(() => ({
1668
+ width: g.avatarWidth + "px",
1669
+ height: g.avatarHeight + "px"
1670
+ })), c = x(!1), o = x(g.modelValue || t), {
1671
+ acceptTypes: u,
1672
+ imageSource: d,
1673
+ onClickImage: l
1674
+ } = we(g, n, e, o), {
1675
+ onFileChange: A
1676
+ } = Ve(g, n, u, o, c);
1677
+ ie(() => g.modelValue, (p) => {
1678
+ o.value = p || t;
1679
+ });
1680
+ function f() {
1681
+ o.value = i;
1682
+ }
1683
+ return () => v("div", {
1684
+ class: r.value,
1685
+ style: s.value,
1686
+ onClick: l
1687
+ }, [c.value && v("div", {
1688
+ class: "f-avatar-upload-loading"
1689
+ }, [v("div", {
1690
+ class: "loading-inner"
1691
+ }, [V.getLocaleValue("avatar.loading")])]), v("img", {
1692
+ title: g.title,
1693
+ class: "f-avatar-image",
1694
+ src: d.value,
1695
+ onError: f
1696
+ }, null), !g.readonly && v("div", {
1697
+ class: "f-avatar-icon"
1698
+ }, [v("span", {
1699
+ class: "f-icon f-icon-camera"
1700
+ }, null)]), !g.readonly && v("input", {
1701
+ ref: e,
1702
+ name: "file-input",
1703
+ type: "file",
1704
+ class: "f-avatar-upload",
1705
+ accept: u.value,
1706
+ onChange: A,
1707
+ style: "display: none;"
1708
+ }, null)]);
1709
+ }
1710
+ });
1711
+ M.register = (g, n, e, t) => {
1712
+ g.avatar = Pe, n.avatar = Fe;
1713
+ };
1714
+ M.registerDesigner = (g, n, e) => {
1715
+ g.avatar = M, n.avatar = xe;
1716
+ };
1717
+ const Ke = X(M);
1718
+ export {
1719
+ M as FAvatarDesign,
1720
+ Ke as default
1721
+ };