@farris/ui-vue 1.2.6 → 1.2.8

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