@farris/ui-vue 1.2.7 → 1.2.9

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 (246) hide show
  1. package/components/accordion/index.esm.js +136 -136
  2. package/components/accordion/index.umd.cjs +1 -1
  3. package/components/avatar/index.esm.js +418 -456
  4. package/components/avatar/index.umd.cjs +1 -1
  5. package/components/border-editor/index.esm.js +4 -4
  6. package/components/border-editor/index.umd.cjs +1 -1
  7. package/components/button/index.esm.js +1 -1
  8. package/components/button/index.umd.cjs +1 -1
  9. package/components/button-edit/index.esm.js +363 -436
  10. package/components/button-edit/index.umd.cjs +1 -1
  11. package/components/button-group/index.esm.js +5 -5
  12. package/components/button-group/index.umd.cjs +1 -1
  13. package/components/calendar/index.esm.js +417 -417
  14. package/components/calendar/index.umd.cjs +1 -1
  15. package/components/capsule/index.esm.js +176 -176
  16. package/components/capsule/index.umd.cjs +1 -1
  17. package/components/checkbox/index.esm.js +557 -594
  18. package/components/checkbox/index.umd.cjs +1 -1
  19. package/components/color-picker/index.esm.js +119 -119
  20. package/components/color-picker/index.umd.cjs +2 -2
  21. package/components/combo-list/index.esm.js +502 -535
  22. package/components/combo-list/index.umd.cjs +1 -1
  23. package/components/combo-tree/index.esm.js +69 -69
  24. package/components/combo-tree/index.umd.cjs +1 -1
  25. package/components/component/index.esm.js +387 -275
  26. package/components/component/index.umd.cjs +1 -1
  27. package/components/condition/index.esm.js +1219 -983
  28. package/components/condition/index.umd.cjs +1 -1
  29. package/components/content-container/index.esm.js +292 -219
  30. package/components/content-container/index.umd.cjs +1 -1
  31. package/components/data-grid/index.css +1 -1
  32. package/components/data-grid/index.esm.js +5718 -5546
  33. package/components/data-grid/index.umd.cjs +1 -1
  34. package/components/data-view/index.esm.js +3291 -2930
  35. package/components/data-view/index.umd.cjs +1 -1
  36. package/components/date-picker/index.esm.js +2650 -2682
  37. package/components/date-picker/index.umd.cjs +1 -1
  38. package/components/dependent-base/style.js +1 -0
  39. package/components/dependent-fluid/style.js +1 -0
  40. package/components/dependent-icon/style.js +1 -0
  41. package/components/dependent-input/style.js +1 -0
  42. package/components/dependent-table/style.js +1 -0
  43. package/components/designer-canvas/index.css +1 -1
  44. package/components/designer-canvas/index.esm.js +945 -932
  45. package/components/designer-canvas/index.umd.cjs +1 -1
  46. package/components/designer-outline/index.css +1 -1
  47. package/components/designer-outline/index.esm.js +175 -133
  48. package/components/designer-outline/index.umd.cjs +1 -1
  49. package/components/designer-toolbox/index.esm.js +36 -12
  50. package/components/designer-toolbox/index.umd.cjs +1 -1
  51. package/components/discussion-editor/index.esm.js +1 -1
  52. package/components/discussion-editor/index.umd.cjs +1 -1
  53. package/components/dropdown/index.esm.js +246 -246
  54. package/components/dropdown/index.umd.cjs +2 -2
  55. package/components/dynamic-form/index.esm.js +1319 -1172
  56. package/components/dynamic-form/index.umd.cjs +1 -1
  57. package/components/dynamic-resolver/index.esm.js +119 -82
  58. package/components/dynamic-resolver/index.umd.cjs +1 -1
  59. package/components/dynamic-view/index.esm.js +258 -249
  60. package/components/dynamic-view/index.umd.cjs +1 -1
  61. package/components/enum-editor/index.esm.js +3 -3
  62. package/components/enum-editor/index.umd.cjs +1 -1
  63. package/components/events-editor/index.esm.js +569 -514
  64. package/components/events-editor/index.umd.cjs +1 -1
  65. package/components/expression-editor/index.esm.js +104 -104
  66. package/components/expression-editor/index.umd.cjs +1 -1
  67. package/components/external-container/index.css +1 -1
  68. package/components/external-container/index.esm.js +3122 -2686
  69. package/components/external-container/index.umd.cjs +1 -1
  70. package/components/field-selector/index.css +1 -1
  71. package/components/field-selector/index.esm.js +6780 -6608
  72. package/components/field-selector/index.umd.cjs +1 -1
  73. package/components/filter-bar/index.css +1 -1
  74. package/components/filter-bar/index.esm.js +1466 -1523
  75. package/components/filter-bar/index.umd.cjs +1 -1
  76. package/components/flow-canvas/index.css +1 -1
  77. package/components/flow-canvas/index.esm.js +1048 -1035
  78. package/components/flow-canvas/index.umd.cjs +1 -1
  79. package/components/image-cropper/index.esm.js +422 -422
  80. package/components/image-cropper/index.umd.cjs +1 -1
  81. package/components/input-group/index.esm.js +674 -716
  82. package/components/input-group/index.umd.cjs +1 -1
  83. package/components/layout/index.esm.js +291 -291
  84. package/components/layout/index.umd.cjs +1 -1
  85. package/components/list-nav/index.esm.js +303 -230
  86. package/components/list-nav/index.umd.cjs +1 -1
  87. package/components/list-view/index.css +1 -1
  88. package/components/list-view/index.esm.js +2486 -2130
  89. package/components/list-view/index.umd.cjs +1 -1
  90. package/components/lookup/index.css +1 -1
  91. package/components/lookup/index.esm.js +7474 -7272
  92. package/components/lookup/index.umd.cjs +1 -1
  93. package/components/mapping-editor/index.css +1 -1
  94. package/components/mapping-editor/index.esm.js +6139 -5949
  95. package/components/mapping-editor/index.umd.cjs +1 -1
  96. package/components/message-box/index.esm.js +1 -1
  97. package/components/message-box/index.umd.cjs +1 -1
  98. package/components/modal/index.esm.js +1 -1
  99. package/components/modal/index.umd.cjs +1 -1
  100. package/components/nav/index.esm.js +432 -371
  101. package/components/nav/index.umd.cjs +3 -3
  102. package/components/number-range/index.esm.js +1124 -0
  103. package/components/number-range/index.umd.cjs +1 -0
  104. package/components/number-range/package.json +8 -0
  105. package/components/number-range/style.js +6 -0
  106. package/components/number-spinner/index.esm.js +1155 -0
  107. package/components/number-spinner/index.umd.cjs +1 -0
  108. package/components/number-spinner/package.json +8 -0
  109. package/components/number-spinner/style.js +4 -0
  110. package/components/order/index.css +1 -1
  111. package/components/order/index.esm.js +1215 -1178
  112. package/components/order/index.umd.cjs +1 -1
  113. package/components/page-footer/index.esm.js +147 -147
  114. package/components/page-footer/index.umd.cjs +1 -1
  115. package/components/page-header/index.esm.js +1240 -1346
  116. package/components/page-header/index.umd.cjs +1 -1
  117. package/components/pagination/index.esm.js +489 -428
  118. package/components/pagination/index.umd.cjs +1 -1
  119. package/components/progress/index.esm.js +220 -220
  120. package/components/progress/index.umd.cjs +3 -3
  121. package/components/property-editor/index.esm.js +1512 -1540
  122. package/components/property-editor/index.umd.cjs +3 -3
  123. package/components/property-panel/index.css +1 -1
  124. package/components/property-panel/index.esm.js +749 -815
  125. package/components/property-panel/index.umd.cjs +1 -1
  126. package/components/query-solution/index.css +1 -0
  127. package/components/query-solution/index.esm.js +7074 -0
  128. package/components/query-solution/index.umd.cjs +1 -0
  129. package/components/query-solution/package.json +8 -0
  130. package/components/query-solution/style.js +2 -0
  131. package/components/radio-button/index.esm.js +86 -86
  132. package/components/radio-button/index.umd.cjs +1 -1
  133. package/components/radio-group/index.esm.js +442 -479
  134. package/components/radio-group/index.umd.cjs +1 -1
  135. package/components/rate/index.esm.js +213 -208
  136. package/components/rate/index.umd.cjs +1 -1
  137. package/components/response-layout/index.esm.js +116 -116
  138. package/components/response-layout/index.umd.cjs +1 -1
  139. package/components/response-layout-editor/index.esm.js +943 -918
  140. package/components/response-layout-editor/index.umd.cjs +1 -1
  141. package/components/response-toolbar/index.esm.js +1174 -1295
  142. package/components/response-toolbar/index.umd.cjs +1 -1
  143. package/components/schema-selector/index.css +1 -1
  144. package/components/schema-selector/index.esm.js +5383 -5171
  145. package/components/schema-selector/index.umd.cjs +2 -2
  146. package/components/search-box/index.esm.js +201 -201
  147. package/components/search-box/index.umd.cjs +1 -1
  148. package/components/section/index.esm.js +684 -542
  149. package/components/section/index.umd.cjs +1 -1
  150. package/components/smoke-detector/index.esm.js +121 -121
  151. package/components/smoke-detector/index.umd.cjs +1 -1
  152. package/components/spacing-editor/index.esm.js +2 -2
  153. package/components/spacing-editor/index.umd.cjs +1 -1
  154. package/components/splitter/index.esm.js +1158 -382
  155. package/components/splitter/index.umd.cjs +1 -1
  156. package/components/step/index.esm.js +232 -232
  157. package/components/step/index.umd.cjs +1 -1
  158. package/components/switch/index.esm.js +451 -487
  159. package/components/switch/index.umd.cjs +1 -1
  160. package/components/tabs/index.esm.js +2078 -2168
  161. package/components/tabs/index.umd.cjs +1 -1
  162. package/components/tags/index.esm.js +318 -320
  163. package/components/tags/index.umd.cjs +1 -1
  164. package/components/text/index.esm.js +192 -192
  165. package/components/text/index.umd.cjs +1 -1
  166. package/components/textarea/index.esm.js +471 -497
  167. package/components/textarea/index.umd.cjs +1 -1
  168. package/components/time-picker/index.esm.js +1421 -1441
  169. package/components/time-picker/index.umd.cjs +1 -1
  170. package/components/transfer/index.css +1 -1
  171. package/components/transfer/index.esm.js +430 -421
  172. package/components/transfer/index.umd.cjs +1 -1
  173. package/components/tree-grid/index.css +1 -1
  174. package/components/tree-grid/index.esm.js +6806 -6624
  175. package/components/tree-grid/index.umd.cjs +1 -1
  176. package/components/tree-view/index.esm.js +2793 -2433
  177. package/components/tree-view/index.umd.cjs +1 -1
  178. package/components/uploader/index.esm.js +165 -165
  179. package/components/uploader/index.umd.cjs +2 -2
  180. package/components/verify-detail/index.esm.js +255 -255
  181. package/components/verify-detail/index.umd.cjs +1 -1
  182. package/components/video/index.esm.js +413 -334
  183. package/components/video/index.umd.cjs +1 -1
  184. package/components/weather/index.esm.js +902 -902
  185. package/components/weather/index.umd.cjs +4 -4
  186. package/farris.all.esm.js +54155 -52847
  187. package/farris.all.umd.cjs +9 -9
  188. package/index.css +1 -1
  189. package/package.json +1 -1
  190. package/types/button-edit/src/designer/button-group.design.component.d.ts +7 -0
  191. package/types/checkbox/index.d.ts +1 -0
  192. package/types/combo-list/src/components/list-container.component.d.ts +3 -0
  193. package/types/combo-list/src/components/list-container.props.d.ts +5 -1
  194. package/types/common/entity/entity-schema.d.ts +258 -0
  195. package/types/component/src/component-ref.props.d.ts +4 -0
  196. package/types/component/src/composition/inner-component-build-info.d.ts +27 -0
  197. package/types/component/src/designer/use-designer-rules.d.ts +2 -2
  198. package/types/data-grid/index.d.ts +5 -2
  199. package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +33 -0
  200. package/types/data-grid/src/data-grid.component.d.ts +2 -1
  201. package/types/data-grid/src/data-grid.props.d.ts +2 -2
  202. package/types/data-grid/src/designer/column-header.design.component.d.ts +1 -1
  203. package/types/data-grid/src/designer/data-grid-column.props.d.ts +1 -0
  204. package/types/data-grid/src/designer/use-group-column.d.ts +20 -0
  205. package/types/data-grid/src/property-config/data-grid.property-config.d.ts +4 -0
  206. package/types/data-grid/src/schema/schema-resolver.d.ts +2 -1
  207. package/types/data-view/components/column-format/boolean.component.d.ts +4 -0
  208. package/types/data-view/components/column-format/column-format.component.d.ts +4 -0
  209. package/types/data-view/components/column-format/date.component.d.ts +4 -0
  210. package/types/data-view/components/column-format/enum.component.d.ts +4 -0
  211. package/types/data-view/components/column-format/number.component.d.ts +4 -0
  212. package/types/data-view/composition/pagination/use-pagination.d.ts +1 -0
  213. package/types/data-view/composition/types.d.ts +19 -7
  214. package/types/data-view/composition/use-edit.d.ts +2 -1
  215. package/types/designer-canvas/src/composition/dg-control.d.ts +16 -350
  216. package/types/designer-canvas/src/composition/function/use-dragula.d.ts +2 -2
  217. package/types/designer-canvas/src/types.d.ts +3 -3
  218. package/types/dynamic-form/index.d.ts +3 -1
  219. package/types/dynamic-form/src/composition/response-form-component-creator.service.d.ts +31 -0
  220. package/types/dynamic-form/src/schema/schema-resolver.d.ts +2 -1
  221. package/types/dynamic-form/src/types.d.ts +1 -1
  222. package/types/dynamic-resolver/index.d.ts +1 -0
  223. package/types/dynamic-resolver/src/binding-resolver.d.ts +1 -0
  224. package/types/dynamic-resolver/src/schema-resolver.d.ts +2 -1
  225. package/types/dynamic-resolver/src/types.d.ts +3 -2
  226. package/types/dynamic-view/src/dynamic-view.component.d.ts +1 -1
  227. package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -1
  228. package/types/modal/src/modal.props.d.ts +1 -4
  229. package/types/property-panel/src/composition/entity/base-property.d.ts +0 -12
  230. package/types/property-panel/src/composition/entity/input-base-property.d.ts +11 -26
  231. package/types/property-panel/src/composition/entity/schema-dom-mapping.d.ts +10 -8
  232. package/types/response-toolbar/src/response-toolbar.props.d.ts +2 -2
  233. package/types/response-toolbar/src/schema/schema-mapper.d.ts +4 -0
  234. package/types/section/src/property-config/section.property-config.d.ts +93 -0
  235. package/types/section/src/schema/schema-resolver.d.ts +2 -1
  236. package/types/tabs/src/composition/types.d.ts +2 -2
  237. package/types/tabs/src/designer/tab-header-item.design.component.d.ts +3 -1
  238. package/types/tabs/src/designer/tab-toolbar-item.props.d.ts +19 -0
  239. package/types/tabs/src/property-config/tab-page.property-config.d.ts +60 -0
  240. package/types/tabs/src/property-config/tabs.property-config.d.ts +6 -6
  241. package/types/tabs/src/schema/schema-resolver.d.ts +2 -1
  242. package/types/tags/index.d.ts +36 -5
  243. package/types/tree-grid/src/designer/use-designer-rules.d.ts +3 -0
  244. package/types/tree-grid/src/property-config/tree-grid.property-config.d.ts +11 -0
  245. package/types/tree-grid/src/schema/column-resolver.d.ts +1 -1
  246. package/types/tree-grid/src/tree-grid.props.d.ts +8 -0
@@ -0,0 +1,1155 @@
1
+ var ee = Object.defineProperty;
2
+ var te = (t, e, n) => e in t ? ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var C = (t, e, n) => te(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { computed as M, ref as k, createVNode as V, onMounted as L, nextTick as G, defineComponent as J, watch as U, inject as z } from "vue";
5
+ import { cloneDeep as ne } from "lodash-es";
6
+ import S from "bignumber.js";
7
+ import { getSchemaByType as Z } from "../dynamic-resolver/index.esm.js";
8
+ const Q = {}, X = {};
9
+ function W(t) {
10
+ const { properties: e, title: n, ignore: r } = t, l = r && Array.isArray(r), d = Object.keys(e).reduce((u, c) => ((!l || !r.find((s) => s == c)) && (u[c] = e[c].type === "object" && e[c].properties ? W(e[c]) : ne(e[c].default)), u), {});
11
+ return (!l || !r.find((u) => u == "id")) && (d.id = `${n}-${Date.now()}`), d;
12
+ }
13
+ function $(t, e = {}, n) {
14
+ const r = Q[t];
15
+ if (r) {
16
+ let l = W(r);
17
+ const d = X[t];
18
+ return l = d ? d({ getSchemaByType: $ }, l, e, n) : l, l;
19
+ }
20
+ return null;
21
+ }
22
+ function oe(t, e) {
23
+ const n = W(e);
24
+ return Object.keys(t).reduce((r, l) => (r[l] && typeof r[l] == "object" ? Object.assign(r[l], t[l]) : r[l] = t[l], r), n), n;
25
+ }
26
+ function re(t, e) {
27
+ return Object.keys(t).filter((r) => t[r] != null).reduce((r, l) => {
28
+ if (e.has(l)) {
29
+ const d = e.get(l);
30
+ if (typeof d == "string")
31
+ r[d] = t[l];
32
+ else {
33
+ const u = d(l, t[l], t);
34
+ Object.assign(r, u);
35
+ }
36
+ } else
37
+ r[l] = t[l];
38
+ return r;
39
+ }, {});
40
+ }
41
+ function ie(t, e, n = /* @__PURE__ */ new Map()) {
42
+ const r = oe(t, e);
43
+ return re(r, n);
44
+ }
45
+ function ae(t = {}) {
46
+ function e(o, i, a, p) {
47
+ if (typeof a == "number")
48
+ return p[o].length === a;
49
+ if (typeof a == "object") {
50
+ const f = Object.keys(a)[0], y = a[f];
51
+ if (f === "not")
52
+ return Number(p[o].length) !== Number(y);
53
+ if (f === "moreThan")
54
+ return Number(p[o].length) >= Number(y);
55
+ if (f === "lessThan")
56
+ return Number(p[o].length) <= Number(y);
57
+ }
58
+ return !1;
59
+ }
60
+ function n(o, i, a, p) {
61
+ return p[o] && p[o].propertyValue && String(p[o].propertyValue.value) === String(a);
62
+ }
63
+ const r = /* @__PURE__ */ new Map([
64
+ ["length", e],
65
+ ["getProperty", n]
66
+ ]);
67
+ Object.keys(t).reduce((o, i) => (o.set(i, t[i]), o), r);
68
+ function l(o, i) {
69
+ const a = o;
70
+ return typeof i == "number" ? [{ target: a, operator: "length", param: null, value: Number(i) }] : typeof i == "boolean" ? [{ target: a, operator: "getProperty", param: o, value: !!i }] : typeof i == "object" ? Object.keys(i).map((p) => {
71
+ if (p === "length")
72
+ return { target: a, operator: "length", param: null, value: i[p] };
73
+ const f = p, y = i[p];
74
+ return { target: a, operator: "getProperty", param: f, value: y };
75
+ }) : [];
76
+ }
77
+ function d(o) {
78
+ return Object.keys(o).reduce((a, p) => {
79
+ const f = l(p, o[p]);
80
+ return a.push(...f), a;
81
+ }, []);
82
+ }
83
+ function u(o, i) {
84
+ if (r.has(o.operator)) {
85
+ const a = r.get(o.operator);
86
+ return a && a(o.target, o.param, o.value, i) || !1;
87
+ }
88
+ return !1;
89
+ }
90
+ function c(o, i) {
91
+ return d(o).reduce((f, y) => f && u(y, i), !0);
92
+ }
93
+ function s(o, i) {
94
+ const a = Object.keys(o), p = a.includes("allOf"), f = a.includes("anyOf"), y = p || f, F = (y ? o[y ? p ? "allOf" : "anyOf" : "allOf"] : [o]).map((P) => c(P, i));
95
+ return p ? !F.includes(!1) : F.includes(!0);
96
+ }
97
+ return { parseValueSchema: s };
98
+ }
99
+ const m = {
100
+ button: { type: "button", name: "按钮", icon: "Button" },
101
+ "response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
102
+ "response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
103
+ "content-container": { type: "content-container", name: "容器", icon: "ContentContainer" },
104
+ "input-group": { type: "input-group", name: "文本", icon: "TextBox" },
105
+ textarea: { type: "textarea", name: "多行文本", icon: "MultiTextBox" },
106
+ lookup: { type: "lookup", name: "帮助", icon: "LookupEdit" },
107
+ "number-spinner": { type: "number-spinner", name: "数值", icon: "NumericBox" },
108
+ "date-picker": { type: "date-picker", name: "日期", icon: "DateBox" },
109
+ switch: { type: "switch", name: "开关", icon: "SwitchField" },
110
+ "radio-group": { type: "radio-group", name: "单选组", icon: "RadioGroup" },
111
+ "check-box": { type: "check-box", name: "复选框", icon: "CheckBox" },
112
+ "check-group": { type: "check-group", name: "复选框组", icon: "CheckGroup" },
113
+ "combo-list": { type: "combo-list", name: "下拉列表", icon: "EnumField" },
114
+ "response-form": { type: "response-form", name: "卡片面板", icon: "Form" },
115
+ "response-layout": { type: "response-layout", name: "布局容器", icon: "ResponseLayout3" },
116
+ "response-layout-item": { type: "response-layout-item", name: "布局", icon: "ResponseLayout1" },
117
+ "tree-grid": { type: "tree-grid", name: "树表格", icon: "TreeGrid" },
118
+ "tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
119
+ "data-grid": { type: "data-grid", name: "表格", icon: "DataGrid" },
120
+ "data-grid-column": { type: "data-grid-column", name: "表格列" },
121
+ module: { type: "Module", name: "模块", icon: "Module" },
122
+ component: { type: "component", name: "组件", icon: "Component" },
123
+ tabs: { type: "tabs", name: "标签页", icon: "Tab" },
124
+ "tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
125
+ "tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮", icon: "Button" },
126
+ "time-picker": { type: "time-picker", name: "时间选择", icon: "TimePicker" },
127
+ section: { type: "section", name: "分组面板", icon: "Section" },
128
+ "section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
129
+ "section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
130
+ splitter: { type: "splitter", name: "分栏面板", icon: "Splitter" },
131
+ "splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
132
+ "component-ref": { type: "component-ref", name: "组件引用节点" },
133
+ uploader: { type: "uploader", name: "附件上传", icon: "FileUpload" },
134
+ "page-header": { type: "page-header", name: "页头", icon: "Header" },
135
+ "page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
136
+ "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" }
137
+ }, le = {}, ce = {};
138
+ ae();
139
+ function ue(t, e, n = /* @__PURE__ */ new Map(), r = (u, c, s) => c, l = {}, d = (u) => u) {
140
+ return Q[e.title] = e, X[e.title] = r, le[e.title] = l, ce[e.title] = d, (u = {}) => {
141
+ const c = ie(u, e, n), s = Object.keys(t).reduce((o, i) => (o[i] = t[i].default, o), {});
142
+ return Object.assign(s, c);
143
+ };
144
+ }
145
+ function se(t, e) {
146
+ return { customClass: e.class, customStyle: e.style };
147
+ }
148
+ const pe = /* @__PURE__ */ new Map([
149
+ ["appearance", se]
150
+ ]), de = "https://json-schema.org/draft/2020-12/schema", me = "https://farris-design.gitee.io/number-spinner.schema.json", fe = "number-spinner", ye = "A Farris Input Component", ge = "object", be = {
151
+ id: {
152
+ description: "The unique identifier for a number spinner",
153
+ type: "string"
154
+ },
155
+ type: {
156
+ description: "The type string of number spinner component",
157
+ type: "string",
158
+ default: "number-spinner"
159
+ },
160
+ appearance: {
161
+ description: "",
162
+ type: "object",
163
+ properties: {
164
+ class: {
165
+ type: "string"
166
+ },
167
+ style: {
168
+ type: "string"
169
+ }
170
+ },
171
+ default: {}
172
+ },
173
+ binding: {
174
+ description: "",
175
+ type: "object",
176
+ default: {}
177
+ },
178
+ editable: {
179
+ description: "",
180
+ type: "boolean",
181
+ default: !0
182
+ },
183
+ enableLinkLabel: {
184
+ description: "",
185
+ type: "boolean",
186
+ default: !1
187
+ },
188
+ label: {
189
+ description: "",
190
+ type: "string",
191
+ default: ""
192
+ },
193
+ lableWidth: {
194
+ description: "",
195
+ type: "number"
196
+ },
197
+ placeholder: {
198
+ description: "",
199
+ type: "string",
200
+ default: ""
201
+ },
202
+ readonly: {
203
+ description: "",
204
+ type: "boolean",
205
+ default: !1
206
+ },
207
+ disabled: {
208
+ description: "",
209
+ type: "boolean",
210
+ default: !1
211
+ },
212
+ required: {
213
+ description: "",
214
+ type: "boolean",
215
+ default: !1
216
+ },
217
+ tabindex: {
218
+ description: "",
219
+ type: "number",
220
+ default: -1
221
+ },
222
+ textAlign: {
223
+ description: "",
224
+ type: "string",
225
+ enum: [
226
+ "left",
227
+ "middle",
228
+ "right"
229
+ ],
230
+ default: "left"
231
+ },
232
+ visible: {
233
+ description: "",
234
+ type: "boolean",
235
+ default: !0
236
+ },
237
+ max: {
238
+ description: "",
239
+ type: "number"
240
+ },
241
+ onBlur: {
242
+ description: "",
243
+ type: "string",
244
+ default: ""
245
+ },
246
+ onClickLinkLabel: {
247
+ description: "",
248
+ type: "sting",
249
+ default: ""
250
+ }
251
+ }, he = [
252
+ "id",
253
+ "type"
254
+ ], ve = [
255
+ "id",
256
+ "appearance",
257
+ "binding"
258
+ ], we = {
259
+ $schema: de,
260
+ $id: me,
261
+ title: fe,
262
+ description: ye,
263
+ type: ge,
264
+ properties: be,
265
+ required: he,
266
+ ignore: ve
267
+ };
268
+ function Ce(t, e, n) {
269
+ return e;
270
+ }
271
+ const q = {
272
+ /**
273
+ * 组件标识
274
+ */
275
+ id: String,
276
+ /**
277
+ * 是否禁用
278
+ */
279
+ disabled: { type: Boolean, default: !1 },
280
+ /**
281
+ * 是否只读
282
+ */
283
+ readonly: { type: Boolean, default: !1 },
284
+ /**
285
+ * 是否可编辑
286
+ */
287
+ editable: { type: Boolean, default: !0 },
288
+ /**
289
+ * 格式化 formatter 和 parser 必须同时存在
290
+ * formatter: (val: number) => string;
291
+ * parser: (val: string | number) => number;
292
+ */
293
+ formatter: { type: Function },
294
+ parser: { type: Function },
295
+ /**
296
+ * 空白提示文本
297
+ */
298
+ placeholder: { type: String, default: "请输入数字" },
299
+ /**
300
+ * up or down 步长
301
+ */
302
+ step: { type: Number, default: 1 },
303
+ /**
304
+ * 最大值
305
+ */
306
+ max: { type: [Number, String] },
307
+ /**
308
+ * 最小值
309
+ */
310
+ min: { type: [Number, String] },
311
+ /**
312
+ * 是否显示加减按钮
313
+ */
314
+ showButton: { type: Boolean, default: !0 },
315
+ /**
316
+ * 是否使用千分值
317
+ */
318
+ useThousands: { type: Boolean, default: !0 },
319
+ /**
320
+ * 文本方向
321
+ */
322
+ textAlign: { type: String, default: "left" },
323
+ /**
324
+ * 自动补全小数---未实现
325
+ */
326
+ autoDecimal: { type: Boolean, default: !0 },
327
+ /**
328
+ * 允许为空
329
+ */
330
+ canNull: { type: Boolean, default: !1 },
331
+ /**
332
+ * 精度
333
+ */
334
+ precision: { type: Number, default: 0 },
335
+ /**
336
+ * 前缀
337
+ */
338
+ prefix: { type: String, default: "" },
339
+ /**
340
+ * 后缀
341
+ */
342
+ suffix: { type: String, default: "" },
343
+ /**
344
+ * 小数点符号
345
+ */
346
+ decimalSeparator: { type: String, default: "." },
347
+ /**
348
+ * 千分位符号
349
+ */
350
+ groupSeparator: { type: String, default: "," },
351
+ /**
352
+ * 使用千分位时,每组显示的字符数
353
+ */
354
+ groupSize: { type: Number, default: 3 },
355
+ /**
356
+ * 值
357
+ */
358
+ value: { type: [Number, String], default: "" },
359
+ /**
360
+ * 显示0值
361
+ */
362
+ showZero: { type: Boolean, default: !0 },
363
+ /**
364
+ * 组件值
365
+ */
366
+ modelValue: { type: [Number, String], default: "" },
367
+ /**
368
+ * 作为内嵌编辑器被创建后默认获得焦点
369
+ */
370
+ focusOnCreated: { type: Boolean, default: !1 },
371
+ /**
372
+ * 作为内嵌编辑器被创建后默认选中文本
373
+ */
374
+ selectOnCreated: { type: Boolean, default: !1 }
375
+ }, Y = ue(q, we, pe, Ce);
376
+ function _(t, e, n, r) {
377
+ const { format: l } = n, { displayValue: d, getRealValue: u, modelValue: c, onNumberValueChanged: s } = r;
378
+ function o() {
379
+ const w = new S(c.value || 0);
380
+ return !(t.max && !new S(t.max).isNaN() && w.gte(new S(t.max)));
381
+ }
382
+ function i() {
383
+ const w = new S(c.value || 0);
384
+ return !(t.min && !new S(t.min).isNaN() && w.lte(new S(t.min)));
385
+ }
386
+ function a(w) {
387
+ if (t.readonly || t.disabled)
388
+ return;
389
+ const F = w === "up" ? o : i, D = w === "up" ? "plus" : "minus";
390
+ if (F()) {
391
+ const b = new S(c.value || 0)[D](Number(t.step)), N = b.toFixed();
392
+ d.value = l(N), s(u(b));
393
+ }
394
+ }
395
+ function p() {
396
+ a("up");
397
+ }
398
+ function f() {
399
+ a("down");
400
+ }
401
+ function y(w) {
402
+ p(), w.stopPropagation();
403
+ }
404
+ function v(w) {
405
+ f(), w.stopPropagation();
406
+ }
407
+ return { canDownward: i, canUpward: o, downward: f, onClickDownButton: v, onClickUpButton: y, upward: p };
408
+ }
409
+ function H(t, e, n) {
410
+ const r = M(() => ({
411
+ prefix: t.prefix,
412
+ suffix: t.suffix,
413
+ decimalSeparator: t.decimalSeparator,
414
+ groupSeparator: t.useThousands ? t.groupSeparator : "",
415
+ groupSize: t.groupSize
416
+ })), { getValidNumberObject: l, precision: d } = n;
417
+ function u(o) {
418
+ return o = o == null || o === "" ? "" : String(o), o = o.replace(new RegExp(t.prefix, "g"), "").replace(new RegExp(t.suffix, "g"), "").replace(/,/g, ""), t.groupSeparator && t.groupSeparator !== "," && (o = o.replace(new RegExp(`\\${t.groupSeparator}`, "g"), "")), t.decimalSeparator && t.decimalSeparator !== "." && (o = o.replace(new RegExp(`\\${t.decimalSeparator}`, "g"), ".")), o;
419
+ }
420
+ function c(o, i) {
421
+ return t.precision !== null && t.precision !== void 0 ? o.toFormat(d.value, i) : o.toFormat(i);
422
+ }
423
+ function s(o) {
424
+ const i = u(o), a = new S(i, 10), p = l(a);
425
+ return p.valueOf() === "0" && !t.showZero || p.isNaN() ? "" : t.formatter ? t.formatter(p.toNumber()) : c(p, r.value);
426
+ }
427
+ return { cleanFormat: u, format: s };
428
+ }
429
+ function R(t, e) {
430
+ const n = k(""), r = k(t.modelValue), l = M(() => Number(t.precision) || 0);
431
+ function d(i) {
432
+ return i.toFixed(l.value);
433
+ }
434
+ function u(i) {
435
+ return isNaN(i) || i === null || i === void 0 || i === "";
436
+ }
437
+ function c(i) {
438
+ const a = u(t.max) ? null : new S(String(t.max), 10), p = u(t.min) ? null : new S(String(t.min), 10);
439
+ return a && i.gt(a) ? a : p && i.lt(p) ? p : i;
440
+ }
441
+ function s(i) {
442
+ if (t.parser)
443
+ return isNaN(Number(i)) ? t.parser(i) : i;
444
+ let a = c(new S(i, 10));
445
+ if (a.isNaN()) {
446
+ if (t.canNull)
447
+ return null;
448
+ const f = new S("" + t.min, 10), y = new S("" + t.max, 10);
449
+ if (!f.isNaN())
450
+ a = f;
451
+ else if (!y.isNaN())
452
+ a = y;
453
+ else
454
+ return 0;
455
+ }
456
+ return d(a);
457
+ }
458
+ function o(i) {
459
+ const a = Number(i);
460
+ r.value = a, e.emit("update:modelValue", a), e.emit("valueChange", a), e.emit("change", a);
461
+ }
462
+ return { displayValue: n, getRealValue: s, modelValue: r, isEmpty: u, onNumberValueChanged: o, precision: l, getValidNumberObject: c };
463
+ }
464
+ function Se(t, e, n, r, l) {
465
+ const { cleanFormat: d, format: u } = n, { displayValue: c, getRealValue: s, modelValue: o, isEmpty: i, onNumberValueChanged: a } = r, { downward: p, upward: f } = l, y = k(!1), v = M(() => c.value);
466
+ function w(b) {
467
+ var h;
468
+ if (b.stopPropagation(), y.value = !1, t.readonly || t.disabled)
469
+ return;
470
+ let N = (h = b.target) == null ? void 0 : h.value;
471
+ t.canNull || (N = N || 0);
472
+ const g = d(N);
473
+ c.value = u(g), a(s(g)), e.emit("blur", { event: b, formatted: c.value, value: o.value });
474
+ }
475
+ function F(b) {
476
+ b.stopPropagation(), y.value = !0, !(t.readonly || t.disabled) && (c.value = i(o.value) || !t.showZero && o.value === "0" ? "" : String(o.value), e.emit("focus", { event: b, formatted: c.value, value: o.value }));
477
+ }
478
+ function D(b) {
479
+ var h;
480
+ b.stopPropagation();
481
+ let N = (h = b.target) == null ? void 0 : h.value;
482
+ t.canNull || (N = N || 0);
483
+ const g = d(N);
484
+ c.value = g, a(s(g));
485
+ }
486
+ function P(b) {
487
+ b.key === "ArrowDown" && (b.preventDefault(), p()), b.key === "ArrowUp" && (b.preventDefault(), f()), b.stopPropagation();
488
+ }
489
+ return { textBoxValue: v, onBlurTextBox: w, onFocusTextBox: F, onInput: D, onKeyDown: P, isFocus: y };
490
+ }
491
+ function I(t, e, n) {
492
+ const {
493
+ canDownward: r,
494
+ canUpward: l,
495
+ onClickDownButton: d,
496
+ onClickUpButton: u
497
+ } = n, c = M(() => ({
498
+ "input-group-append": !0,
499
+ "btn-group": !0,
500
+ "btn-group-number": !0
501
+ })), s = M(() => ({
502
+ btn: !0,
503
+ "btn-secondary": !0,
504
+ "btn-number-flag": !0
505
+ })), o = M(() => ({
506
+ cursor: l() ? "pointer" : "not-allowed",
507
+ "margin-left": 0
508
+ })), i = M(() => ({
509
+ cursor: r() ? "pointer" : "not-allowed",
510
+ "margin-left": 0
511
+ }));
512
+ return () => V("div", {
513
+ class: c.value
514
+ }, [V("button", {
515
+ title: "upButton",
516
+ class: s.value,
517
+ style: o.value,
518
+ onClick: u,
519
+ disabled: !l()
520
+ }, [V("span", {
521
+ class: "f-icon f-icon-arrow-chevron-up number-arrow-chevron"
522
+ }, null)]), V("button", {
523
+ title: "downButton",
524
+ class: s.value,
525
+ style: i.value,
526
+ onClick: d,
527
+ disabled: !r()
528
+ }, [V("span", {
529
+ class: "f-icon f-icon-arrow-chevron-down number-arrow-chevron"
530
+ }, null)])]);
531
+ }
532
+ function ke(t, e, n) {
533
+ const r = k(), {
534
+ onBlurTextBox: l,
535
+ onFocusTextBox: d,
536
+ onInput: u,
537
+ onKeyDown: c,
538
+ textBoxValue: s
539
+ } = n, o = M(() => t.disabled || t.readonly || !t.editable ? "" : t.placeholder), i = M(() => ({
540
+ "form-control": !0,
541
+ "f-utils-fill": !0
542
+ })), a = M(() => ({
543
+ "text-align": t.textAlign
544
+ }));
545
+ function p(v) {
546
+ v.stopPropagation();
547
+ }
548
+ function f() {
549
+ t.selectOnCreated, t.focusOnCreated;
550
+ }
551
+ async function y(v) {
552
+ d(v), await G, f();
553
+ }
554
+ return L(async () => {
555
+ await G, f();
556
+ }), () => V("input", {
557
+ ref: r,
558
+ class: i.value,
559
+ style: a.value,
560
+ type: "text",
561
+ value: s.value,
562
+ disabled: t.disabled,
563
+ readonly: t.readonly || !t.editable,
564
+ placeholder: o.value,
565
+ onBlur: l,
566
+ onChange: p,
567
+ onFocus: y,
568
+ onInput: u,
569
+ onKeydown: c
570
+ }, null);
571
+ }
572
+ const A = /* @__PURE__ */ J({
573
+ name: "FNumberSpinner",
574
+ props: q,
575
+ emits: ["update:modelValue", "valueChange", "change", "blur", "focus", "click", "input"],
576
+ setup(t, e) {
577
+ const n = R(t, e), r = H(t, e, n), l = _(t, e, r, n), d = Se(t, e, r, n, l), u = I(t, e, l), {
578
+ displayValue: c,
579
+ modelValue: s,
580
+ getRealValue: o
581
+ } = n, i = ke(t, e, d), {
582
+ format: a
583
+ } = r, {
584
+ isFocus: p
585
+ } = d, f = M(() => !t.disabled && !t.readonly && t.showButton);
586
+ return L(() => {
587
+ const y = o(t.modelValue);
588
+ c.value = a(y);
589
+ }), U(() => [t.value], ([y]) => {
590
+ const v = o(y);
591
+ s.value = v, c.value = a(v);
592
+ }), U(() => [t.modelValue], ([y]) => {
593
+ y !== s.value && (s.value = y, !p.value && (c.value = a(o(y))));
594
+ }), U(() => [t.precision, t.useThousands, t.prefix, t.suffix, t.showZero], () => {
595
+ c.value = a(s.value);
596
+ }), () => V("div", {
597
+ class: "input-group f-state-hover flex-row f-cmp-number-spinner"
598
+ }, [i(), f.value && u()]);
599
+ }
600
+ });
601
+ function Ne(t, e, n) {
602
+ var N;
603
+ function r() {
604
+ n != null && n.resolveComponentContext && n.resolveComponentContext();
605
+ }
606
+ r();
607
+ const l = n && n.getStyles && n.getStyles() || "", d = n && n.getDesignerClass && n.getDesignerClass() || "", u = k();
608
+ function c() {
609
+ return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
610
+ }
611
+ function s() {
612
+ return !1;
613
+ }
614
+ function o() {
615
+ return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0;
616
+ }
617
+ function i() {
618
+ return (e == null ? void 0 : e.schema.componentType) === "frame" ? !0 : n && n.hideNestedPaddingInDesginerView ? n.hideNestedPaddingInDesginerView() : !1;
619
+ }
620
+ function a(g) {
621
+ if (!g || !g.value)
622
+ return null;
623
+ if (g.value.schema && g.value.schema.type === "component")
624
+ return g.value;
625
+ const h = k(g == null ? void 0 : g.value.parent), B = a(h);
626
+ return B || null;
627
+ }
628
+ function p(g = e) {
629
+ const { componentInstance: h, designerItemElementRef: B } = g;
630
+ return !h || !h.value ? null : h.value.canMove ? B : p(g.parent);
631
+ }
632
+ function f(g) {
633
+ return !!n && n.canAccepts(g);
634
+ }
635
+ function y() {
636
+ return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
637
+ }
638
+ function v() {
639
+ }
640
+ function w(g, h) {
641
+ h && n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(h);
642
+ }
643
+ function F(g, h) {
644
+ const { componentType: B } = g;
645
+ let T = $(B, g, h);
646
+ n && n.onResolveNewComponentSchema && (T = n.onResolveNewComponentSchema(g, T));
647
+ const O = B.toLowerCase().replace("-", "_");
648
+ return T && !T.id && T.type === B && (T.id = `${O}_${Math.random().toString().slice(2, 6)}`), T;
649
+ }
650
+ function D(g, h) {
651
+ const B = String(g.getAttribute("data-controltype")), T = g.getAttribute("data-feature"), O = T ? JSON.parse(T) : {};
652
+ O.parentComponentInstance = u.value;
653
+ let x = $(B, O);
654
+ n && n.onAcceptNewChildElement && (x = n.onAcceptNewChildElement(g, h, x));
655
+ const K = B.toLowerCase().replace("-", "_");
656
+ return x && !x.id && x.type === B && (x.id = `${K}_${Math.random().toString().slice(2, 6)}`), x;
657
+ }
658
+ function P(g) {
659
+ }
660
+ function b(...g) {
661
+ if (n && n.getPropsConfig)
662
+ return n.getPropsConfig(...g);
663
+ }
664
+ return u.value = {
665
+ canMove: c(),
666
+ canSelectParent: s(),
667
+ canDelete: o(),
668
+ canNested: !i(),
669
+ contents: e == null ? void 0 : e.schema.contents,
670
+ elementRef: t,
671
+ parent: (N = e == null ? void 0 : e.parent) == null ? void 0 : N.componentInstance,
672
+ schema: e == null ? void 0 : e.schema,
673
+ styles: l,
674
+ designerClass: d,
675
+ canAccepts: f,
676
+ getBelongedComponentInstance: a,
677
+ getDraggableDesignItemElement: p,
678
+ getDraggingDisplayText: y,
679
+ getPropConfig: b,
680
+ getDragScopeElement: v,
681
+ onAcceptMovedChildElement: w,
682
+ onAcceptNewChildElement: D,
683
+ onChildElementMovedOut: P,
684
+ addNewChildComponentSchema: F,
685
+ updateDragAndDropRules: r,
686
+ triggerBelongedComponentToMoveWhenMoved: !!n && n.triggerBelongedComponentToMoveWhenMoved || k(!1),
687
+ triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || k(!1)
688
+ }, u;
689
+ }
690
+ class Be {
691
+ constructor(e, n) {
692
+ C(this, "componentId");
693
+ C(this, "viewModelId");
694
+ C(this, "eventsEditorUtils");
695
+ C(this, "formSchemaUtils");
696
+ C(this, "formMetadataConverter");
697
+ C(this, "designViewModelUtils");
698
+ C(this, "designViewModelField");
699
+ C(this, "controlCreatorUtils");
700
+ C(this, "designerHostService");
701
+ C(this, "schemaService", null);
702
+ C(this, "metadataService", null);
703
+ C(this, "propertyConfig", {
704
+ type: "object",
705
+ categories: {}
706
+ });
707
+ var r;
708
+ this.componentId = e, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((r = this.formSchemaUtils) == null ? void 0 : r.getViewModelIdByComponentId(e)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService, this.schemaService = n.schemaService;
709
+ }
710
+ getTableInfo() {
711
+ var e;
712
+ return (e = this.schemaService) == null ? void 0 : e.getTableInfoByViewModelId(this.viewModelId);
713
+ }
714
+ setDesignViewModelField(e) {
715
+ const n = e.binding && e.binding.type === "Form" && e.binding.field;
716
+ if (n) {
717
+ if (!this.designViewModelField) {
718
+ const r = this.designViewModelUtils.getDgViewModel(this.viewModelId);
719
+ this.designViewModelField = r.fields.find((l) => l.id === n);
720
+ }
721
+ e.updateOn = this.designViewModelField.updateOn;
722
+ }
723
+ }
724
+ changeFieldEditorType(e, n) {
725
+ }
726
+ getBasicPropConfig(e) {
727
+ return {
728
+ description: "Basic Information",
729
+ title: "基本信息",
730
+ properties: {
731
+ id: {
732
+ description: "组件标识",
733
+ title: "标识",
734
+ type: "string",
735
+ readonly: !0
736
+ },
737
+ type: {
738
+ description: "组件类型",
739
+ title: "控件类型",
740
+ type: "select",
741
+ editor: {
742
+ type: "combo-list",
743
+ textField: "name",
744
+ valueField: "value",
745
+ data: [{ value: e.type, name: m[e.type].name }]
746
+ }
747
+ }
748
+ }
749
+ };
750
+ }
751
+ getAppearanceConfig(e = null) {
752
+ return {
753
+ title: "样式",
754
+ description: "Appearance",
755
+ properties: {
756
+ class: {
757
+ title: "class样式",
758
+ type: "string",
759
+ description: "组件的CSS样式",
760
+ $converter: "/converter/appearance.converter"
761
+ },
762
+ style: {
763
+ title: "style样式",
764
+ type: "string",
765
+ description: "组件的样式",
766
+ $converter: "/converter/appearance.converter"
767
+ }
768
+ }
769
+ };
770
+ }
771
+ }
772
+ const E = class E {
773
+ /**
774
+ * 根据绑定字段类型获取可用的输入类控件
775
+ */
776
+ static getEditorTypesByMDataType(e) {
777
+ const n = E.fieldControlTypeMapping[e];
778
+ return n || [{ key: "", value: "" }];
779
+ }
780
+ /**
781
+ * 获取所有输入类控件
782
+ */
783
+ static getAllInputTypes() {
784
+ const e = [];
785
+ for (let n in E.fieldControlTypeMapping)
786
+ E.fieldControlTypeMapping[n].forEach((r) => {
787
+ e.find((l) => l.key === r.key && l.value === r.value) || e.push({ key: r.key, value: r.value });
788
+ });
789
+ return e;
790
+ }
791
+ };
792
+ /**
793
+ * <字段类型,可配置的控件类型列表>的映射
794
+ */
795
+ C(E, "fieldControlTypeMapping", {
796
+ String: [
797
+ { key: m["input-group"].type, value: m["input-group"].name },
798
+ { key: m.lookup.type, value: m.lookup.name },
799
+ { key: m["date-picker"].type, value: m["date-picker"].name },
800
+ { key: m["check-box"].type, value: m["check-box"].name },
801
+ { key: m["radio-group"].type, value: m["radio-group"].name },
802
+ { key: m["combo-list"].type, value: m["combo-list"].name },
803
+ { key: m.textarea.type, value: m.textarea.name }
804
+ ],
805
+ Text: [
806
+ { key: m.textarea.type, value: m.textarea.name },
807
+ { key: m.lookup.type, value: m.lookup.name }
808
+ ],
809
+ Decimal: [
810
+ { key: m["number-spinner"].type, value: m["number-spinner"].name }
811
+ ],
812
+ Integer: [
813
+ { key: m["number-spinner"].type, value: m["number-spinner"].name }
814
+ ],
815
+ Number: [
816
+ { key: m["number-spinner"].type, value: m["number-spinner"].name }
817
+ ],
818
+ BigNumber: [
819
+ { key: m["number-spinner"].type, value: m["number-spinner"].name }
820
+ ],
821
+ Date: [
822
+ { key: m["date-picker"].type, value: m["date-picker"].name }
823
+ ],
824
+ DateTime: [
825
+ { key: m["date-picker"].type, value: m["date-picker"].name }
826
+ ],
827
+ Boolean: [
828
+ { key: m.switch.type, value: m.switch.name },
829
+ { key: m["check-box"].type, value: m["check-box"].name }
830
+ ],
831
+ Enum: [
832
+ { key: m["combo-list"].type, value: m["combo-list"].name },
833
+ { key: m["radio-group"].type, value: m["radio-group"].name }
834
+ ],
835
+ Object: [
836
+ { key: m.lookup.type, value: m.lookup.name },
837
+ { key: m["combo-list"].type, value: m["combo-list"].name },
838
+ { key: m["radio-group"].type, value: m["radio-group"].name }
839
+ ]
840
+ });
841
+ let j = E;
842
+ const Me = k(0);
843
+ class Te extends Be {
844
+ constructor(e, n) {
845
+ super(e, n);
846
+ }
847
+ getPropertyConfig(e, n) {
848
+ return this.propertyConfig.categories.basic = this.getBasicProperties(e, n), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e), this.propertyConfig.categories.editor = this.getEditorProperties(e), this.propertyConfig;
849
+ }
850
+ getBasicProperties(e, n) {
851
+ var u;
852
+ var r = this;
853
+ this.setDesignViewModelField(e);
854
+ const l = this.formSchemaUtils.getFormMetadataBasicInfo(), d = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);
855
+ return {
856
+ description: "Basic Information",
857
+ title: "基本信息",
858
+ properties: {
859
+ id: {
860
+ description: "组件标识",
861
+ title: "标识",
862
+ type: "string",
863
+ readonly: !0
864
+ },
865
+ type: {
866
+ description: "编辑器类型",
867
+ title: "编辑器类型",
868
+ type: "string",
869
+ refreshPanelAfterChanged: !0,
870
+ $converter: "/converter/change-editor.converter",
871
+ editor: {
872
+ type: "combo-list",
873
+ textField: "value",
874
+ valueField: "key",
875
+ editable: !1,
876
+ data: r.designViewModelField ? j.getEditorTypesByMDataType((u = r.designViewModelField.type) == null ? void 0 : u.name) : j.getAllInputTypes()
877
+ }
878
+ },
879
+ label: {
880
+ title: "标签",
881
+ type: "string",
882
+ $converter: "/converter/form-group-label.converter"
883
+ },
884
+ binding: {
885
+ description: "绑定的表单字段",
886
+ title: "绑定",
887
+ $converter: "/converter/field-selector.converter",
888
+ editor: {
889
+ type: "field-selector",
890
+ bindingType: { enable: !1 },
891
+ editorParams: {
892
+ propertyData: e,
893
+ formBasicInfo: l
894
+ },
895
+ columns: [
896
+ { field: "name", title: "字段名称" },
897
+ { field: "bindingField", title: "绑定字段" },
898
+ { field: "fieldType", title: "字段类型" }
899
+ ],
900
+ textField: "bindingField",
901
+ data: d
902
+ }
903
+ }
904
+ },
905
+ setPropertyRelates(c, s) {
906
+ if (c)
907
+ switch (c && c.propertyID) {
908
+ case "type": {
909
+ r.changeControlType(e, c, n);
910
+ break;
911
+ }
912
+ case "label": {
913
+ c.needRefreshControlTree = !0;
914
+ break;
915
+ }
916
+ }
917
+ }
918
+ };
919
+ }
920
+ getAppearanceProperties(e) {
921
+ return {
922
+ title: "样式",
923
+ description: "Appearance",
924
+ properties: {
925
+ class: {
926
+ title: "class样式",
927
+ type: "string",
928
+ description: "组件的CSS样式",
929
+ $converter: "/converter/appearance.converter"
930
+ },
931
+ style: {
932
+ title: "style样式",
933
+ type: "string",
934
+ description: "组件的样式",
935
+ $converter: "/converter/appearance.converter"
936
+ },
937
+ responseLayout: {
938
+ description: "响应式列宽",
939
+ title: "响应式列宽",
940
+ type: "boolean",
941
+ visible: !1,
942
+ editor: {
943
+ type: "response-layout-editor-setting"
944
+ },
945
+ $converter: "/converter/response-form-layout.converter"
946
+ }
947
+ }
948
+ };
949
+ }
950
+ getEditorProperties(e) {
951
+ return this.getComponentConfig(e);
952
+ }
953
+ /**
954
+ * 卡片控件:切换控件类型后事件
955
+ * @param propertyData 控件DOM属性
956
+ * @param newControlType 新控件类型
957
+ */
958
+ changeControlType(e, n, r) {
959
+ var o, i, a, p;
960
+ const l = n.propertyValue, d = r && r.parent && r.parent.schema;
961
+ if (!d)
962
+ return;
963
+ const u = d.contents.findIndex((f) => f.id === e.id), c = d.contents[u];
964
+ let s;
965
+ this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
966
+ editor: {
967
+ $type: l
968
+ },
969
+ name: this.designViewModelField.name,
970
+ require: this.designViewModelField.require,
971
+ readonly: this.designViewModelField.readonly
972
+ }, !1), s = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, l)), s || (s = Z("form-group") || {}, s.editor = Z(l) || {}, delete s.editor.id, delete s.editor.binding, delete s.editor.appearance), Object.assign(s, {
973
+ id: c.id,
974
+ appearance: c.appearance,
975
+ size: c.size,
976
+ label: c.label,
977
+ binding: c.binding,
978
+ visible: c.visible
979
+ }), Object.assign(s.editor, {
980
+ isTextArea: s.isTextArea && c.isTextArea,
981
+ placeholder: (o = c.editor) == null ? void 0 : o.placeholder,
982
+ holdPlace: (i = c.editor) == null ? void 0 : i.holdPlace,
983
+ readonly: (a = c.editor) == null ? void 0 : a.readonly,
984
+ require: (p = c.editor) == null ? void 0 : p.require
985
+ }), d.contents.splice(u, 1), d.contents.splice(u, 0, s), r.schema = Object.assign(c, s), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
986
+ (f) => f.classList.remove("dgComponentSelected")
987
+ ), Me.value++;
988
+ }
989
+ getComponentConfig(e, n = {}, r = {}) {
990
+ const l = Object.assign({
991
+ description: "编辑器",
992
+ title: "编辑器",
993
+ type: "input-group",
994
+ $converter: "/converter/property-editor.converter"
995
+ }, n), d = Object.assign({
996
+ readonly: {
997
+ description: "",
998
+ title: "只读",
999
+ type: "boolean"
1000
+ },
1001
+ disabled: {
1002
+ description: "",
1003
+ title: "禁用",
1004
+ type: "boolean"
1005
+ },
1006
+ // required: {
1007
+ // description: "",
1008
+ // title: "必填",
1009
+ // type: "boolean"
1010
+ // },
1011
+ placeholder: {
1012
+ description: "空值时,输入控件内的占位文本",
1013
+ title: "提示文本",
1014
+ type: "string"
1015
+ }
1016
+ }, r);
1017
+ return { ...l, properties: { ...d } };
1018
+ }
1019
+ }
1020
+ class Ve extends Te {
1021
+ constructor(e, n) {
1022
+ super(e, n);
1023
+ }
1024
+ getEditorProperties(e) {
1025
+ return this.getComponentConfig(e, { type: "number-spinner" }, {
1026
+ textAlign: {
1027
+ description: "",
1028
+ title: "对齐方式",
1029
+ type: "enum",
1030
+ editor: {
1031
+ type: "combo-list",
1032
+ textField: "name",
1033
+ valueField: "value",
1034
+ data: [
1035
+ {
1036
+ value: "left",
1037
+ name: "左对齐"
1038
+ },
1039
+ {
1040
+ value: "center",
1041
+ name: "居中对齐"
1042
+ },
1043
+ {
1044
+ value: "right",
1045
+ name: "右对齐"
1046
+ }
1047
+ ]
1048
+ }
1049
+ }
1050
+ });
1051
+ }
1052
+ }
1053
+ function Fe(t, e) {
1054
+ t.schema;
1055
+ const n = k(!0), r = k(!0);
1056
+ function l(a) {
1057
+ return !1;
1058
+ }
1059
+ function d() {
1060
+ return !1;
1061
+ }
1062
+ function u() {
1063
+ return !1;
1064
+ }
1065
+ function c() {
1066
+ return !0;
1067
+ }
1068
+ function s(a) {
1069
+ }
1070
+ function o() {
1071
+ }
1072
+ function i(a) {
1073
+ return null;
1074
+ }
1075
+ return {
1076
+ canAccepts: l,
1077
+ checkCanDeleteComponent: d,
1078
+ checkCanMoveComponent: u,
1079
+ hideNestedPaddingInDesginerView: c,
1080
+ onAcceptMovedChildElement: s,
1081
+ resolveComponentContext: o,
1082
+ triggerBelongedComponentToMoveWhenMoved: n,
1083
+ triggerBelongedComponentToDeleteWhenDeleted: r,
1084
+ getPropsConfig: i
1085
+ };
1086
+ }
1087
+ function xe(t, e) {
1088
+ const {
1089
+ canAccepts: n,
1090
+ checkCanDeleteComponent: r,
1091
+ checkCanMoveComponent: l,
1092
+ hideNestedPaddingInDesginerView: d,
1093
+ onAcceptMovedChildElement: u,
1094
+ resolveComponentContext: c,
1095
+ triggerBelongedComponentToMoveWhenMoved: s,
1096
+ triggerBelongedComponentToDeleteWhenDeleted: o
1097
+ } = Fe(t), i = t.schema;
1098
+ function a(p, f) {
1099
+ return new Ve(p, e).getPropertyConfig(i, f);
1100
+ }
1101
+ return {
1102
+ canAccepts: n,
1103
+ checkCanDeleteComponent: r,
1104
+ checkCanMoveComponent: l,
1105
+ hideNestedPaddingInDesginerView: d,
1106
+ onAcceptMovedChildElement: u,
1107
+ resolveComponentContext: c,
1108
+ triggerBelongedComponentToMoveWhenMoved: s,
1109
+ triggerBelongedComponentToDeleteWhenDeleted: o,
1110
+ getPropsConfig: a
1111
+ };
1112
+ }
1113
+ const De = /* @__PURE__ */ J({
1114
+ name: "FNumberSpinnerDesign",
1115
+ props: q,
1116
+ emits: ["update:modelValue", "valueChange", "change", "blur", "focus", "click", "input"],
1117
+ setup(t, e) {
1118
+ const n = R(t, e), r = H(t, e, n), l = _(t, e, r, n), d = I(t, e, l), u = k(), c = z("designer-host-service"), s = z("design-item-context"), o = xe(s, c), i = Ne(u, s, o);
1119
+ L(() => {
1120
+ u.value.componentInstance = i, t.readonly = !0;
1121
+ }), e.expose(i.value);
1122
+ const a = k();
1123
+ return () => V("div", {
1124
+ ref: u,
1125
+ class: "input-group f-state-hover flex-row f-cmp-number-spinner test"
1126
+ }, [V("input", {
1127
+ ref: a,
1128
+ class: "form-control",
1129
+ readonly: !0,
1130
+ placeholder: t.placeholder
1131
+ }, null), d()]);
1132
+ }
1133
+ }), Pe = (t) => {
1134
+ const e = t;
1135
+ return e.install = function(n) {
1136
+ n.component(e.name, t);
1137
+ }, t;
1138
+ };
1139
+ A.register = (t, e, n, r) => {
1140
+ t["number-spinner"] = A, e["number-spinner"] = Y;
1141
+ };
1142
+ A.registerDesigner = (t, e, n) => {
1143
+ t["number-spinner"] = De, e["number-spinner"] = Y;
1144
+ };
1145
+ const $e = Pe(A);
1146
+ export {
1147
+ A as FNumberSpinner,
1148
+ $e as default,
1149
+ q as numberSpinnerProps,
1150
+ Y as propsResolver,
1151
+ H as useFormat,
1152
+ R as useNumber,
1153
+ _ as useSpinner,
1154
+ Se as useTextBox
1155
+ };