@farris/ui-vue 1.6.5-beta.8 → 1.6.5

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 (121) hide show
  1. package/components/avatar/index.esm.js +334 -334
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/button-edit/index.esm.js +4 -4
  4. package/components/button-edit/index.umd.cjs +1 -1
  5. package/components/combo-list/index.esm.js +136 -133
  6. package/components/combo-list/index.umd.cjs +1 -1
  7. package/components/component/index.esm.js +300 -300
  8. package/components/component/index.umd.cjs +1 -1
  9. package/components/condition/index.esm.js +4 -4
  10. package/components/condition/index.umd.cjs +1 -1
  11. package/components/content-container/index.esm.js +295 -295
  12. package/components/content-container/index.umd.cjs +1 -1
  13. package/components/data-grid/index.esm.js +99 -99
  14. package/components/data-grid/index.umd.cjs +1 -1
  15. package/components/data-view/index.esm.js +3416 -3350
  16. package/components/data-view/index.umd.cjs +1 -1
  17. package/components/designer-canvas/index.esm.js +4 -4
  18. package/components/designer-canvas/index.umd.cjs +1 -1
  19. package/components/dynamic-form/index.esm.js +170 -170
  20. package/components/dynamic-form/index.umd.cjs +1 -1
  21. package/components/events-editor/index.esm.js +637 -637
  22. package/components/events-editor/index.umd.cjs +3 -3
  23. package/components/expression-editor/index.esm.js +699 -696
  24. package/components/expression-editor/index.umd.cjs +4 -4
  25. package/components/filter-bar/index.esm.js +446 -446
  26. package/components/filter-bar/index.umd.cjs +1 -1
  27. package/components/filter-condition-editor/index.esm.js +377 -374
  28. package/components/filter-condition-editor/index.umd.cjs +2 -2
  29. package/components/flow-canvas/index.esm.js +204 -204
  30. package/components/flow-canvas/index.umd.cjs +1 -1
  31. package/components/list-view/index.esm.js +42 -40
  32. package/components/list-view/index.umd.cjs +2 -2
  33. package/components/mapping-editor/index.esm.js +427 -427
  34. package/components/mapping-editor/index.umd.cjs +1 -1
  35. package/components/message-box/index.esm.js +212 -212
  36. package/components/message-box/index.umd.cjs +1 -1
  37. package/components/modal/index.esm.js +276 -276
  38. package/components/modal/index.umd.cjs +1 -1
  39. package/components/number-range/index.esm.js +160 -160
  40. package/components/number-range/index.umd.cjs +1 -1
  41. package/components/number-spinner/index.esm.js +314 -314
  42. package/components/number-spinner/index.umd.cjs +1 -1
  43. package/components/order/index.esm.js +468 -463
  44. package/components/order/index.umd.cjs +2 -2
  45. package/components/popover/index.esm.js +58 -56
  46. package/components/popover/index.umd.cjs +1 -1
  47. package/components/property-panel/index.esm.js +215 -215
  48. package/components/property-panel/index.umd.cjs +2 -2
  49. package/components/query-solution/index.esm.js +4 -4
  50. package/components/query-solution/index.umd.cjs +1 -1
  51. package/components/response-layout/index.esm.js +282 -282
  52. package/components/response-layout/index.umd.cjs +1 -1
  53. package/components/response-layout-editor/index.esm.js +944 -941
  54. package/components/response-layout-editor/index.umd.cjs +1 -1
  55. package/components/schema-selector/index.esm.js +498 -492
  56. package/components/schema-selector/index.umd.cjs +6 -6
  57. package/components/search-box/index.esm.js +76 -72
  58. package/components/search-box/index.umd.cjs +1 -1
  59. package/components/section/index.esm.js +211 -211
  60. package/components/section/index.umd.cjs +1 -1
  61. package/components/sort-condition-editor/index.esm.js +377 -374
  62. package/components/sort-condition-editor/index.umd.cjs +2 -2
  63. package/components/switch/index.esm.js +78 -77
  64. package/components/switch/index.umd.cjs +1 -1
  65. package/components/tabs/index.esm.js +579 -579
  66. package/components/tabs/index.umd.cjs +2 -2
  67. package/components/textarea/index.esm.js +362 -362
  68. package/components/textarea/index.umd.cjs +2 -2
  69. package/components/time-picker/index.css +1 -0
  70. package/components/time-picker/index.esm.js +9799 -0
  71. package/components/time-picker/index.umd.cjs +1 -0
  72. package/components/time-picker/package.json +8 -0
  73. package/components/time-picker/style.js +6 -0
  74. package/components/transfer/index.esm.js +81 -79
  75. package/components/transfer/index.umd.cjs +2 -2
  76. package/components/tree-grid/index.esm.js +100 -100
  77. package/components/tree-grid/index.umd.cjs +1 -1
  78. package/components/tree-view/index.esm.js +2361 -2279
  79. package/components/tree-view/index.umd.cjs +1 -1
  80. package/components/video/index.esm.js +219 -219
  81. package/components/video/index.umd.cjs +1 -1
  82. package/designer/button-edit/index.css +1 -0
  83. package/designer/button-edit/index.esm.js +4856 -0
  84. package/designer/button-edit/index.umd.cjs +1 -0
  85. package/designer/checkbox/index.esm.js +254 -0
  86. package/designer/checkbox/index.umd.cjs +1 -0
  87. package/designer/checkbox-group/index.esm.js +382 -0
  88. package/designer/checkbox-group/index.umd.cjs +1 -0
  89. package/designer/data-grid/index.css +1 -0
  90. package/designer/data-grid/index.esm.js +15439 -0
  91. package/designer/data-grid/index.umd.cjs +23 -0
  92. package/designer/data-view/index.esm.js +854 -0
  93. package/designer/data-view/index.umd.cjs +38 -0
  94. package/designer/drawer/index.css +1 -0
  95. package/designer/drawer/index.esm.js +525 -0
  96. package/designer/drawer/index.umd.cjs +1 -0
  97. package/designer/farris-designer.all.esm.js +22330 -0
  98. package/designer/farris-designer.all.umd.cjs +34 -0
  99. package/designer/index.css +1 -0
  100. package/designer/input-group/index.esm.js +1098 -0
  101. package/designer/input-group/index.umd.cjs +1 -0
  102. package/designer/list-view/index.css +1 -0
  103. package/designer/list-view/index.esm.js +4689 -0
  104. package/designer/list-view/index.umd.cjs +40 -0
  105. package/designer/radio-group/index.css +1 -0
  106. package/designer/radio-group/index.esm.js +6985 -0
  107. package/designer/radio-group/index.umd.cjs +1 -0
  108. package/designer/tree-grid/index.esm.js +1099 -0
  109. package/designer/tree-grid/index.umd.cjs +1 -0
  110. package/farris.all.esm.js +9619 -9535
  111. package/farris.all.umd.cjs +24 -24
  112. package/locales/data-grid/ui/en.json +2 -2
  113. package/locales/designer/en.json +7 -6
  114. package/locales/designer/zh-CHS.json +2 -1
  115. package/locales/designer/zh-CHT.json +2 -1
  116. package/locales/ui/en.json +7 -6
  117. package/locales/ui/zh-CHS.json +2 -1
  118. package/locales/ui/zh-CHT.json +2 -1
  119. package/package.json +1 -1
  120. package/types/combo-list/src/property-config/combo-list.property-config.d.ts +0 -6
  121. package/types/data-view/composition/types.d.ts +10 -4
@@ -0,0 +1,4689 @@
1
+ var en = Object.defineProperty;
2
+ var tn = (e, t, n) => t in e ? en(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var pe = (e, t, n) => tn(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { useGuid as nn, useNumberFormat as st, resolveField as se, useCommonUtils as lt, useDateFormat as on, setFieldValue as We, getCustomClass as Ke, getCustomStyle as et, excludeProperties as rn, withInstall as an } from "../../components/common/index.esm.js";
5
+ import sn, { listViewProps as ln, FListViewTable as cn } from "../../components/list-view/index.esm.js";
6
+ import { getSchemaByTypeForDesigner as un, createPropsResolver as dn, createCollectionBindingResolver as fn } from "../../components/dynamic-resolver/index.esm.js";
7
+ import { ref as O, createVNode as F, createTextVNode as ke, computed as W, defineComponent as Le, watch as Ne, Fragment as De, reactive as ct, createApp as mn, onUnmounted as vn, onMounted as Je, Transition as pn, mergeProps as gn, withModifiers as hn, withDirectives as _n, vModelText as yn, inject as Ye } from "vue";
8
+ import "../../components/popover/index.esm.js";
9
+ import { useI18n as je } from "vue-i18n";
10
+ import "../../components/modal/index.esm.js";
11
+ import { cloneDeep as Ae, isUndefined as tt, isPlainObject as nt } from "lodash-es";
12
+ import "../../components/transfer/index.esm.js";
13
+ import "../../components/tabs/index.esm.js";
14
+ import { FCheckbox as Qe } from "../../components/checkbox/index.esm.js";
15
+ import "../../components/filter-bar/index.esm.js";
16
+ import "../../components/pagination/index.esm.js";
17
+ import ot from "../../components/button/index.esm.js";
18
+ import "../../components/date-picker/index.esm.js";
19
+ import "../../components/number-spinner/index.esm.js";
20
+ import "../../components/search-box/index.esm.js";
21
+ import { LocaleService as bn } from "../../components/locale/index.esm.js";
22
+ import { useCondition as wn, CompareType as we, ValueType as xe, TextValue as qe, RadioGroupValue as Cn, NumberSpinnerValue as Sn, NumberRangeValue as Tn, MonthRangeValue as En, MonthPickerValue as kn, DateRangeValue as rt, DateTimePickerValue as Fn, DatePickerValue as Mn, ComboLookupValue as Nn, ComboListValue as Vn, CheckBoxValue as xn } from "../../components/condition/index.esm.js";
23
+ import { FDynamicFormInput as On } from "../../components/dynamic-form/index.esm.js";
24
+ import { DgControl as ze } from "../../components/designer-canvas/index.esm.js";
25
+ function In(e, t) {
26
+ function n(a) {
27
+ const r = [];
28
+ let c = a.nextNode();
29
+ for (; c; )
30
+ r.push(c), c = a.nextNode();
31
+ return r;
32
+ }
33
+ function o(a, r) {
34
+ const c = document.createTreeWalker(a, NodeFilter.SHOW_TEXT);
35
+ return n(c).map((s) => ({ textNode: s, text: (s.textContent || "").toLocaleLowerCase() })).map(({ textNode: s, text: l }) => {
36
+ const y = [];
37
+ let d = 0;
38
+ for (; d < l.length; ) {
39
+ const w = l.indexOf(r, d);
40
+ if (w === -1)
41
+ break;
42
+ y.push(w), d = w + r.length;
43
+ }
44
+ return y.map((w) => {
45
+ const C = new Range();
46
+ return C.setStart(s, w), C.setEnd(s, w + r.length), C;
47
+ });
48
+ }).flat();
49
+ }
50
+ function i(a) {
51
+ if (!CSS.highlights || (CSS.highlights.clear(), !a || !t))
52
+ return;
53
+ const r = o(t.value, a.toLocaleLowerCase()), c = new Highlight(...r);
54
+ CSS.highlights.set("search-result", c);
55
+ }
56
+ return { search: i };
57
+ }
58
+ const Oe = {
59
+ button: { type: "button", name: "按钮" },
60
+ "response-toolbar": { type: "response-toolbar", name: "工具栏" },
61
+ "response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
62
+ "content-container": { type: "content-container", name: "容器" },
63
+ "input-group": { type: "input-group", name: "文本" },
64
+ textarea: { type: "textarea", name: "多行文本" },
65
+ lookup: { type: "lookup", name: "帮助" },
66
+ "number-spinner": { type: "number-spinner", name: "数值" },
67
+ "date-picker": { type: "date-picker", name: "日期" },
68
+ switch: { type: "switch", name: "开关" },
69
+ "radio-group": { type: "radio-group", name: "单选组" },
70
+ "check-box": { type: "check-box", name: "复选框" },
71
+ "check-group": { type: "check-group", name: "复选框组" },
72
+ "combo-list": { type: "combo-list", name: "下拉列表" },
73
+ "response-form": { type: "response-form", name: "卡片面板" },
74
+ "response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
75
+ "response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
76
+ "tree-grid": { type: "tree-grid", name: "树表格" },
77
+ "tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
78
+ "data-grid": { type: "data-grid", name: "表格" },
79
+ "data-grid-column": { type: "data-grid-column", name: "表格列" },
80
+ module: { type: "Module", name: "模块" },
81
+ component: { type: "component", name: "组件" },
82
+ tabs: { type: "tabs", name: "标签页" },
83
+ "tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
84
+ "tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
85
+ "html-template": { type: "html-template", name: "模板容器" },
86
+ "time-picker": { type: "time-picker", name: "时间选择" },
87
+ section: { type: "section", name: "分组面板" },
88
+ "section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
89
+ "section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
90
+ splitter: { type: "splitter", name: "分栏面板" },
91
+ "splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
92
+ "component-ref": { type: "component-ref", name: "组件引用节点" },
93
+ uploader: { type: "uploader", name: "附件上传" },
94
+ "page-header": { type: "page-header", name: "页头" },
95
+ "page-footer": { type: "page-footer", name: "页脚" },
96
+ "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
97
+ fieldset: { type: "fieldset", name: "分组" },
98
+ "query-solution": { type: "query-solution", name: "筛选方案" },
99
+ drawer: { type: "drawer", name: "抽屉" },
100
+ "external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
101
+ "list-nav": { type: "list-nav", name: "列表导航" },
102
+ "list-view": { type: "list-view", name: "列表" },
103
+ "filter-bar": { type: "filter-bar", name: "筛选条" },
104
+ "language-textbox": { type: "language-textbox", name: "多语输入框" }
105
+ };
106
+ function ut(e, t, n) {
107
+ var Y;
108
+ const o = n && n.getStyles && n.getStyles() || "", i = n && n.getDesignerClass && n.getDesignerClass() || "", a = O();
109
+ let r;
110
+ function c() {
111
+ return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
112
+ }
113
+ function v() {
114
+ return !1;
115
+ }
116
+ function f() {
117
+ return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0;
118
+ }
119
+ function u() {
120
+ return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : n && n.hideNestedPaddingInDesginerView ? n.hideNestedPaddingInDesginerView() : !1;
121
+ }
122
+ function s(M) {
123
+ if (!M || !M.value)
124
+ return null;
125
+ if (M.value.schema && M.value.schema.type === "component")
126
+ return M.value;
127
+ const L = O(M == null ? void 0 : M.value.parent), D = s(L);
128
+ return D || null;
129
+ }
130
+ function l(M = t) {
131
+ var k;
132
+ if (n != null && n.getDraggableDesignItemElement)
133
+ return n.getDraggableDesignItemElement(M);
134
+ const { componentInstance: L, designerItemElementRef: D } = M;
135
+ if (!L || !L.value)
136
+ return null;
137
+ const { getCustomButtons: x } = L.value;
138
+ return L.value.canMove || x && ((k = x()) != null && k.length) ? D : l(M.parent);
139
+ }
140
+ function y(M) {
141
+ return !!n && n.canAccepts(M);
142
+ }
143
+ function d() {
144
+ return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
145
+ }
146
+ function w() {
147
+ }
148
+ function C(M, L) {
149
+ var D;
150
+ !M || !L || (n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(M, L), (D = t == null ? void 0 : t.setupContext) == null || D.emit("dragEnd"));
151
+ }
152
+ function T(M, L) {
153
+ const { componentType: D } = M;
154
+ let x = un(D, M, L);
155
+ n && n.onResolveNewComponentSchema && (x = n.onResolveNewComponentSchema(M, x));
156
+ const k = D.toLowerCase().replace(/-/g, "_");
157
+ return x && !x.id && x.type === D && (x.id = `${k}_${Math.random().toString().slice(2, 6)}`), x;
158
+ }
159
+ function S(M) {
160
+ M && n != null && n.onChildElementMovedOut && n.onChildElementMovedOut(M);
161
+ }
162
+ function b(...M) {
163
+ if (n && n.getPropsConfig)
164
+ return n.getPropsConfig(...M);
165
+ }
166
+ function g(M) {
167
+ if (!M)
168
+ return;
169
+ const L = t == null ? void 0 : t.schema, { formSchemaUtils: D } = M;
170
+ if (L && D.getExpressions().length) {
171
+ const x = D.getExpressions().findIndex((k) => k.target === L.id);
172
+ x > -1 && D.getExpressions().splice(x, 1);
173
+ }
174
+ }
175
+ function m(M) {
176
+ if (!M || !(t != null && t.schema))
177
+ return;
178
+ const L = t.schema, { formSchemaUtils: D } = M;
179
+ D.removeCommunicationInComponent(L);
180
+ }
181
+ function p(M) {
182
+ n && n.onRemoveComponent && n.onRemoveComponent(), g(M), m(M), t != null && t.schema.contents && t.schema.contents.map((L) => {
183
+ let D = L.id;
184
+ L.type === "component-ref" && (D = L.component);
185
+ const x = e.value.querySelectorAll(`#${D}-design-item`);
186
+ x != null && x.length && Array.from(x).map((k) => {
187
+ var $;
188
+ ($ = k == null ? void 0 : k.componentInstance) != null && $.value.onRemoveComponent && k.componentInstance.value.onRemoveComponent(M);
189
+ });
190
+ });
191
+ }
192
+ function _() {
193
+ if (n && n.getCustomButtons)
194
+ return n.getCustomButtons();
195
+ }
196
+ function E(M) {
197
+ var D, x;
198
+ if (!((D = t == null ? void 0 : t.schema) != null && D.id))
199
+ return;
200
+ if (!r && M && (r = M.formSchemaUtils), n != null && n.setComponentBasicInfoMap) {
201
+ n.setComponentBasicInfoMap();
202
+ return;
203
+ }
204
+ let L = "";
205
+ if (n != null && n.getComponentTitle)
206
+ L = n.getComponentTitle();
207
+ else {
208
+ const { text: k, title: $, label: A, mainTitle: Q, name: ne, type: I } = t.schema;
209
+ L = k || $ || A || Q || ne || ((x = Oe[I]) == null ? void 0 : x.name);
210
+ }
211
+ L && r.getControlBasicInfoMap().set(t.schema.id, {
212
+ componentTitle: L,
213
+ parentPathName: L
214
+ });
215
+ }
216
+ function h(M) {
217
+ var k;
218
+ const { changeObject: L } = M, { propertyID: D, propertyValue: x } = L;
219
+ if (["text", "title", "label", "name", "mainTitle"].includes((k = M == null ? void 0 : M.changeObject) == null ? void 0 : k.propertyID) && D && x && (E(), r)) {
220
+ const $ = r.getControlBasicInfoMap(), A = $.keys().toArray().filter((Q) => {
221
+ var ne, I;
222
+ return ((ne = $.get(Q)) == null ? void 0 : ne.reliedComponentId) === ((I = t == null ? void 0 : t.schema) == null ? void 0 : I.id);
223
+ });
224
+ A != null && A.length && A.forEach((Q) => {
225
+ const ne = $.get(Q).parentPathName.split(" > ");
226
+ ne[0] = x, $.get(Q).parentPathName = ne.join(" > ");
227
+ });
228
+ }
229
+ }
230
+ function B(M) {
231
+ if (h(M), n && n.onPropertyChanged)
232
+ return n.onPropertyChanged(M);
233
+ }
234
+ return a.value = {
235
+ canMove: c(),
236
+ canSelectParent: v(),
237
+ canDelete: f(),
238
+ canNested: !u(),
239
+ contents: t == null ? void 0 : t.schema.contents,
240
+ elementRef: e,
241
+ parent: (Y = t == null ? void 0 : t.parent) == null ? void 0 : Y.componentInstance,
242
+ schema: t == null ? void 0 : t.schema,
243
+ styles: o,
244
+ designerClass: i,
245
+ canAccepts: y,
246
+ getBelongedComponentInstance: s,
247
+ getDraggableDesignItemElement: l,
248
+ getDraggingDisplayText: d,
249
+ getPropConfig: b,
250
+ getDragScopeElement: w,
251
+ onAcceptMovedChildElement: C,
252
+ onChildElementMovedOut: S,
253
+ addNewChildComponentSchema: T,
254
+ triggerBelongedComponentToMoveWhenMoved: !!n && n.triggerBelongedComponentToMoveWhenMoved || O(!1),
255
+ triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || O(!1),
256
+ onRemoveComponent: p,
257
+ getCustomButtons: _,
258
+ onPropertyChanged: B,
259
+ setComponentBasicInfoMap: E,
260
+ updateContextSchema: t == null ? void 0 : t.updateContextSchema
261
+ }, a;
262
+ }
263
+ var _e = /* @__PURE__ */ ((e) => (e[e.readonly = 0] = "readonly", e[e.editable = 1] = "editable", e[e.editing = 2] = "editing", e))(_e || {}), Fe = /* @__PURE__ */ ((e) => (e[e.initial = 0] = "initial", e[e.editing = 1] = "editing", e))(Fe || {}), Ie = /* @__PURE__ */ ((e) => (e[e.data = 0] = "data", e[e.group = 1] = "group", e[e.summary = 2] = "summary", e))(Ie || {}), Ee = /* @__PURE__ */ ((e) => (e.DATE = "date", e.DATE_TIME = "datetime", e.NUMBER = "number", e.ENUM = "enum", e.IMAGE = "image", e.BOOLEAN = "boolean", e.BOOLEAN2 = "boolean2", e.TIMEAGO = "timeago", e.NONE = "none", e.CUSTOM = "custom", e.MULTI_LINGUAL = "multilingual", e))(Ee || {});
264
+ function Dn(e) {
265
+ const {
266
+ t
267
+ } = je();
268
+ function n(r, c) {
269
+ switch (r.command) {
270
+ case "edit":
271
+ case "remove":
272
+ return c.status === Fe.initial;
273
+ case "accept":
274
+ case "cancel":
275
+ return c.status === Fe.editing;
276
+ default:
277
+ return !r.hidden;
278
+ }
279
+ }
280
+ function o(r, c, v, f) {
281
+ var u, s, l, y, d;
282
+ switch ((u = r.onClick) == null || u.call(r, c, v.dataIndex, v), r.command) {
283
+ case "edit":
284
+ v.status, Fe.editing, (l = (s = e.commandOption) == null ? void 0 : s.onClickEditCommand) == null || l.call(s, f, v);
285
+ break;
286
+ case "accept":
287
+ case "cancel":
288
+ v.status, Fe.initial;
289
+ break;
290
+ case "remove":
291
+ (d = (y = e.commandOption) == null ? void 0 : y.onClickDeleteCommand) == null || d.call(y, f, v);
292
+ break;
293
+ }
294
+ }
295
+ function i(r) {
296
+ return r === "编辑" ? t("datagrid.commandColumn.edit") : r === "确定" ? t("datagrid.commandColumn.accept") : r === "取消" ? t("datagrid.commandColumn.cancel") : r === "删除" ? t("datagrid.commandColumn.remove") : r;
297
+ }
298
+ function a(r, c) {
299
+ const {
300
+ column: v
301
+ } = r;
302
+ return v.commands && v.commands.map((f, u) => u ? n(f, c) && F(ot, {
303
+ class: "ml-1",
304
+ type: f.type,
305
+ size: f.size || "small",
306
+ onClick: (s) => o(f, s, c, r),
307
+ style: {
308
+ "margin-bottom": "3px"
309
+ }
310
+ }, {
311
+ default: () => [ke(" "), i(f.text), ke(" ")]
312
+ }) : n(f, c) && F(ot, {
313
+ type: f.type,
314
+ size: f.size || "small",
315
+ onClick: (s) => o(f, s, c, r),
316
+ style: {
317
+ "margin-bottom": "3px"
318
+ }
319
+ }, {
320
+ default: () => [ke(" "), i(f.text), ke(" ")]
321
+ }));
322
+ }
323
+ return {
324
+ renderCommandColumn: a
325
+ };
326
+ }
327
+ function dt(e, t) {
328
+ var S;
329
+ nn();
330
+ const { idField: n } = t, o = O(e.summary), i = O(e.group), a = O(((S = e.group) == null ? void 0 : S.groupFields) || []), r = W(() => {
331
+ var b;
332
+ return (b = e.group) == null ? void 0 : b.enable;
333
+ }), c = W(() => {
334
+ var b;
335
+ return (b = e.group) == null ? void 0 : b.showGroupPanel;
336
+ }), v = W(() => {
337
+ const b = o.value;
338
+ return (b == null ? void 0 : b.groupFields) || [];
339
+ }), f = W(() => {
340
+ const b = i.value;
341
+ return b && b.showSummary;
342
+ }), u = O(0), s = /* @__PURE__ */ new Map();
343
+ let l = [];
344
+ function y(b, g, m, p, _) {
345
+ const E = p[m];
346
+ E && (g.reduce((h, B, Y) => {
347
+ var D;
348
+ const M = B[E];
349
+ let L = h.get(M);
350
+ if (!L) {
351
+ const x = v.value.reduce((k, $) => (k.set($, 0), k), /* @__PURE__ */ new Map());
352
+ L = {
353
+ field: E,
354
+ title: ((D = _.get(E)) == null ? void 0 : D.title) || E,
355
+ value: M,
356
+ layer: m,
357
+ details: [],
358
+ groupSummaries: x
359
+ }, h.set(M, L);
360
+ }
361
+ return v.value && v.value.forEach((x) => {
362
+ if (L) {
363
+ const k = L.groupSummaries.get(x) || 0;
364
+ L.groupSummaries.set(x, k + B[x]);
365
+ }
366
+ }), v.value && v.value.forEach((x) => {
367
+ if (L) {
368
+ const k = L.groupSummaries.get(x) || 0;
369
+ L.groupSummaries.set(x, Number(k.toFixed(2)));
370
+ }
371
+ }), L.details.push(B), h;
372
+ }, b), m < p.length - 1 && b.forEach((h, B) => {
373
+ h.nestGroup = /* @__PURE__ */ new Map(), y(h.nestGroup, h.details, m + 1, p, _), h.details = [];
374
+ }));
375
+ }
376
+ function d(b, g) {
377
+ return e.group && e.group.formatter ? e.group.formatter(b.value, { ...b, total: g }) : `${b.title}:${b.value} (${g})`;
378
+ }
379
+ function w(b, g) {
380
+ const m = [];
381
+ return b.forEach((p) => {
382
+ const _ = {
383
+ // 如果存在二级分组,分组行标识保持唯一
384
+ [n.value]: `group_of_${g ? g[n.value] + "_" : ""}${p.field}_${p.value}`,
385
+ __fv_data_grid_group_collapse__: !1,
386
+ __fv_data_grid_group_field__: p.field,
387
+ __fv_data_grid_group_layer__: p.layer,
388
+ __fv_data_grid_group_row__: !0,
389
+ __fv_data_grid_group_value__: p.value,
390
+ groupParents: []
391
+ };
392
+ g && (_.groupParents = [...g.groupParents, g]);
393
+ let E = 0;
394
+ if (m.push(_), p.nestGroup) {
395
+ const h = w(p.nestGroup, _);
396
+ m.push(...h), E += h.length;
397
+ }
398
+ if (p.details && p.details.length && (m.push(...p.details), E += p.details.length), f.value) {
399
+ const h = {
400
+ __fv_data_grid_group_field__: p.field,
401
+ __fv_data_grid_group_layer__: p.layer,
402
+ __fv_data_grid_group_summary__: !0
403
+ };
404
+ h[n.value] = `summary_of_${p.field}_${p.value}`, h[p.field] = Array.from(p.groupSummaries.entries()).reduce(
405
+ (B, [Y, M]) => `${B} ${Y} total:${M} `,
406
+ ""
407
+ ), m.push(h);
408
+ }
409
+ p.groupSummaries && p.groupSummaries.size && p.groupSummaries.forEach((h, B) => {
410
+ _[B] = h;
411
+ }), _[p.field] = d(p, E), _.value = p.value;
412
+ }), m.forEach((p, _) => {
413
+ p.__fv_data_index__ = _;
414
+ }), m;
415
+ }
416
+ function C(b, g, m) {
417
+ return !b || b.length === 0 || !g.length ? g : (b.join(","), s.clear(), l = [], g = g.filter((p) => !p.__fv_data_grid_group_row__), y(s, g, 0, b, m), l = w(s), l);
418
+ }
419
+ function T(b) {
420
+ return {
421
+ "f-icon": !0,
422
+ "f-icon-arrow-chevron-down": !0,
423
+ "fv-grid-group-row-icon-collapse": b.collapse
424
+ };
425
+ }
426
+ return { collpaseGroupIconClass: T, generateGroupData: C, groupFields: a, shouldGroupingData: r, showGroupPanel: c, groupRowSize: u };
427
+ }
428
+ function ft(e) {
429
+ const t = "parent", n = "layer", o = "hasChildren", i = (r, c = 1, v = [], f = null) => (r = r || [], r.reduce((u, s) => (s.id = s.id || s.data[e.idField], s[t] = f, s[n] = c, s[o] = s[o] === void 0 ? !1 : s[o], s.data && Object.keys(s.data).forEach((l) => {
430
+ Object.keys(s).includes(l) || (s[l] = s.data[l]);
431
+ }), v.push(s), s.children && s.children.length && (s[o] = !0, i(s.children, c + 1, v, s.id)), u), v), v);
432
+ return { flatTreeData: i, isNestedTree: (r) => r.some((c) => Array.isArray(c.children)) };
433
+ }
434
+ function Pn(e, t, n, o) {
435
+ const i = O(0), a = O(!!e.hierarchy), { idField: r } = o, { collapseField: c, hasChildrenField: v, parentIdField: f } = n, u = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), { flatTreeData: y, isNestedTree: d } = ft(e);
436
+ function w(P, R) {
437
+ s.clear(), P.reduce((j, U) => {
438
+ const Z = U[f.value] !== void 0 ? U[f.value] : "";
439
+ if (Z && R.has(Z)) {
440
+ const ie = R.get(Z), te = isNaN(Number(ie.__fv_layer__)) ? 1 : Number(ie.__fv_layer__);
441
+ U.__fv_layer__ = te + 1, U.__fv_parent_index__ = ie.__fv_index__, ie.__fv_hasChildren__ = !0;
442
+ } else
443
+ U.__fv_layer__ = 1;
444
+ const ae = j.has(Z) ? j.get(Z) : [];
445
+ return ae.push(U), j.set(Z, ae), j;
446
+ }, s);
447
+ }
448
+ function C(P) {
449
+ l.clear(), P.reduce((R, j) => {
450
+ const U = j[r.value];
451
+ return R.set(U, j), R;
452
+ }, l);
453
+ }
454
+ function T(P) {
455
+ P.forEach((R) => {
456
+ const j = R[r.value];
457
+ R.__fv_children_index__.map((Z) => P[Z]).forEach((Z) => {
458
+ Z.__fv_parents__ = new Map([
459
+ ...R.__fv_parents__.entries(),
460
+ [j, !0]
461
+ ]);
462
+ });
463
+ });
464
+ }
465
+ function S(P) {
466
+ P.forEach((R) => {
467
+ const j = new Set(R.__fv_children_index__);
468
+ R.__fv_children_index__ = [...j].sort((U, Z) => U - Z);
469
+ });
470
+ }
471
+ function b(P) {
472
+ P.forEach((R) => {
473
+ const j = R.__fv_parents__;
474
+ Array.from(j.keys()).map((U) => l.get(U)).forEach((U) => {
475
+ U.__fv_children_index__.push(R.__fv_index__);
476
+ });
477
+ }), S(P);
478
+ }
479
+ function g(P) {
480
+ P.forEach((R) => {
481
+ R.__fv_child_with_lines__ = [], R.__fv_child_length__ = R.__fv_descendant_index__.length, R.__fv_descendant_index__.map((j) => P[j]).reduce((j, U) => (j.__fv_child_length__ += U.__fv_children_index__.length, j.__fv_child_with_lines__.push(...U.__fv_children_index__, U.__fv_index__), j), R);
482
+ });
483
+ }
484
+ function m(P, R) {
485
+ return { id: P, index: R, parentId: "", parentIndex: -1, parents: /* @__PURE__ */ new Map(), children: /* @__PURE__ */ new Map(), descendant: /* @__PURE__ */ new Map(), collapsed: !1, visibleInHierarchy: !0 };
486
+ }
487
+ function p(P, R, j) {
488
+ Array.from(R.keys()).forEach((U) => {
489
+ R.get(U).reduce((ae, ie) => {
490
+ const te = ie[r.value], ue = P.get(ie[r.value]), be = P.get(U), fe = j.get(U);
491
+ return be && fe && (be.children.set(te, ue), be.children.set(te, ue), ue.parentId = U, ue.parentIndex = be.index, ue.parents.set(U, be)), ae;
492
+ }, P);
493
+ });
494
+ }
495
+ function _(P) {
496
+ P.children.forEach((j) => {
497
+ j.parents = new Map([
498
+ ...P.parents.entries(),
499
+ [P.id, P]
500
+ ]), _(j);
501
+ });
502
+ }
503
+ function E(P, R) {
504
+ P.filter((j) => j[f.value] === void 0 || j[f.value] === "").forEach((j) => {
505
+ const U = j[r.value], Z = R.get(U);
506
+ _(Z);
507
+ });
508
+ }
509
+ function h(P) {
510
+ Array.from(P.values()).forEach((R) => {
511
+ Array.from(R.parents.values()).forEach((j) => {
512
+ j.descendant.set(R.id, R);
513
+ });
514
+ });
515
+ }
516
+ function B(P) {
517
+ u.clear(), P.forEach((R, j) => {
518
+ const U = R[r.value];
519
+ u.set(U, m(U, j));
520
+ }), C(P), w(P, l), p(u, s, l), E(P, u), h(u);
521
+ }
522
+ function Y(P) {
523
+ const R = P[r.value], j = u.get(R);
524
+ return j && j.children.size > 0;
525
+ }
526
+ function M(P) {
527
+ return P[v.value] && !Y(P);
528
+ }
529
+ function L(P) {
530
+ const R = P[r.value], j = u.get(R);
531
+ return j && j.visibleInHierarchy;
532
+ }
533
+ function D() {
534
+ i.value = Date.now();
535
+ }
536
+ function x(P, R) {
537
+ R.forEach((j) => {
538
+ const U = u.get(j[r.value]), Z = u.get(P), ae = l.get(P);
539
+ Z && ae && (U.visibleInHierarchy = !ae[c.value] && Z.visibleInHierarchy);
540
+ }), D();
541
+ }
542
+ function k(P) {
543
+ if (s.has(P)) {
544
+ const j = s.get(P);
545
+ x(P, j), j.map((U) => U[r.value]).forEach((U) => k(U));
546
+ }
547
+ }
548
+ function $(P) {
549
+ const R = P[r.value];
550
+ k(R);
551
+ }
552
+ function A(P, R, j = 0) {
553
+ P.forEach((U) => {
554
+ const Z = M(U), ae = U.__fv_layer__ <= j, ie = R === "ToCollapse" ? U.__fv_layer__ <= j : !(U.__fv_layer__ <= j), te = ae ? ie : U[c.value];
555
+ U[c.value] = Z || te;
556
+ });
557
+ for (const [U, Z] of s.entries())
558
+ x(U, Z);
559
+ return P;
560
+ }
561
+ function Q(P, R) {
562
+ A(P, "ToCollapse", R);
563
+ }
564
+ function ne(P, R) {
565
+ A(P, "ToExpand", R);
566
+ }
567
+ function I(P) {
568
+ P.forEach((R, j) => {
569
+ var ie;
570
+ const U = R[r.value], Z = s.has(U) ? (ie = s.get(U)) == null ? void 0 : ie.map((te) => te.__fv_index__) : [], ae = m(U, j);
571
+ R.__fv_graph_node__ = ae, R.__fv_children_index__ = Z, R.__fv_descendant_index__ = [...Z], R.__fv_parents__ = /* @__PURE__ */ new Map(), M(R) && (R[c.value] = !0);
572
+ });
573
+ }
574
+ function z(P) {
575
+ var U, Z;
576
+ B(t.value), I(P), T(P), b(P), e.showLines && g(P);
577
+ const j = ((U = e.hierarchy) == null ? void 0 : U.collapseTo) !== void 0 ? Number((Z = e.hierarchy) == null ? void 0 : Z.collapseTo) : 0;
578
+ return A(P, "ToCollapse", j), P;
579
+ }
580
+ function J(P, R, j) {
581
+ const Z = j.value[P][r.value], ae = u.get(Z);
582
+ if (ae) {
583
+ const ie = u.get(ae.parentId);
584
+ let te = j.value.length - 1;
585
+ if (ie) {
586
+ const ue = Array.from(ie.children.keys()).indexOf(ae.id);
587
+ if (ue === ie.children.size - 1) {
588
+ const fe = Array.from(ie.descendant.values())[ie.descendant.size - 1];
589
+ te = j.value.findIndex((N) => N[r.value] === fe.id) + 1;
590
+ } else {
591
+ const fe = Array.from(ie.children.values())[ue + 1];
592
+ te = j.value.findIndex((N) => N[r.value] === fe.id);
593
+ }
594
+ R[v.value] = !1, R[f.value] = ie.id, j.value.splice(te, 0, R);
595
+ }
596
+ }
597
+ }
598
+ function K(P, R, j) {
599
+ const U = j.value[P], Z = U[r.value];
600
+ if (u.get(Z)) {
601
+ const te = j.value.findIndex((ue) => ue[r.value] === Z) + 1;
602
+ U[v.value] = !0, U[c.value] = !1, R[v.value] = !1, R[f.value] = Z, j.value.splice(te, 0, R);
603
+ }
604
+ }
605
+ function re(P, R, j) {
606
+ const Z = j.value[P][r.value];
607
+ if (u.get(Z)) {
608
+ const te = j.value.findIndex((be) => be[r.value] === Z) + 1;
609
+ let ue = R;
610
+ d(R) && (ue = y(R)), ue.forEach((be) => {
611
+ be[f.value] = Z;
612
+ }), j.value.splice(te, 0, ...ue);
613
+ }
614
+ }
615
+ function ee(P, R) {
616
+ const j = P[r.value], U = u.get(j), Z = Array.from(U.descendant.keys());
617
+ Z.unshift(j);
618
+ const ae = u.get(U.parentId);
619
+ if (ae && (ae.children.delete(j), ae.children.size === 0)) {
620
+ const te = R.find((ue) => ue[r.value] === U.parentId);
621
+ te[v.value] = !1, te[c.value] = !1;
622
+ }
623
+ return R.filter((te) => Z.indexOf(te.id) === -1);
624
+ }
625
+ return {
626
+ checkVisibleInHierarchy: i,
627
+ collapseTo: Q,
628
+ expandTo: ne,
629
+ generateHierarchyData: z,
630
+ hasRealChildren: Y,
631
+ insertSibling: J,
632
+ insertChild: K,
633
+ insertChildren: re,
634
+ isVisibleInTree: L,
635
+ shouldStratifyData: a,
636
+ toggleChildrenVisibiltyByCollapseStatus: $,
637
+ trimmedOriginalData: ee
638
+ };
639
+ }
640
+ const Bn = {
641
+ showCloseButton: { type: Boolean, default: !0 },
642
+ position: { type: String, default: "top-center" },
643
+ timeout: { type: Number, default: 3e3 },
644
+ theme: { type: String, default: "bootstrap" },
645
+ left: { type: Number },
646
+ right: { type: Number },
647
+ top: { type: Number },
648
+ bottom: { type: Number },
649
+ id: { type: String },
650
+ animate: { type: String, default: "fadeIn" },
651
+ options: { type: Object },
652
+ safeHtml: { type: Boolean, default: !0 }
653
+ }, Rn = {
654
+ showCloseButton: { type: Boolean, default: !0 },
655
+ animate: { type: String, default: "fadeIn" },
656
+ options: { type: Object }
657
+ }, Xe = /* @__PURE__ */ Le({
658
+ name: "Toast",
659
+ props: Rn,
660
+ emits: ["close", "click"],
661
+ setup: (e, t) => {
662
+ const {
663
+ locale: n,
664
+ t: o
665
+ } = je(), i = O(e.animate), a = "fadeOut", r = W(() => e.options), c = O(!1), v = W(() => r.value.title && r.value.message), f = W(() => !r.value.title && r.value.message), u = W(() => {
666
+ const g = {
667
+ animated: c.value,
668
+ toast: !0,
669
+ "toast--only-content": !v.value
670
+ };
671
+ return g[e.animate] = !1, g[a] = c.value, g["toasty-type-" + r.value.type] = !0, r.value.theme && (g[r.value.theme] = !0), g;
672
+ }), s = W(() => {
673
+ const p = `f-icon-${r.value && r.value.type ? r.value.type.replace("toasty-type-", "") : "default"}`, _ = {
674
+ "f-icon": !0
675
+ };
676
+ return _[p] = !0, _;
677
+ }), l = W(() => r.value.title || r.value.message), y = W(() => e.showCloseButton), d = W(() => !!r.value.buttons || !!t.slots.default), w = W(() => n.value === "en" ? {
678
+ wordBreak: "keep-all",
679
+ overflowWrap: "break-word"
680
+ } : {});
681
+ function C(g) {
682
+ g.stopPropagation(), g.preventDefault(), c.value = !1, setTimeout(() => {
683
+ t.emit("close", r.value);
684
+ }, 200);
685
+ }
686
+ function T(g, m) {
687
+ }
688
+ function S(g) {
689
+ return `f-preten-link ${g.customClass ? g.customClass : ""}`;
690
+ }
691
+ Ne(i, () => {
692
+ i.value;
693
+ });
694
+ const b = () => {
695
+ var g;
696
+ return F(De, null, [F("div", {
697
+ class: "after-toast-msg text-right"
698
+ }, [!t.slots.default && ((g = r.value.buttons) == null ? void 0 : g.map((m) => F("span", {
699
+ class: S(m),
700
+ onClick: (p) => void 0
701
+ }, [m.text]))), t.slots.default && t.slots.default()])]);
702
+ };
703
+ return () => F("div", {
704
+ class: u.value,
705
+ style: "min-height:44px"
706
+ }, [y.value && F("button", {
707
+ title: o("messageBox.close"),
708
+ class: "toast-close f-btn-icon f-bare",
709
+ onClick: C
710
+ }, [F("span", {
711
+ class: "f-icon modal_close"
712
+ }, null)]), l.value && F("section", {
713
+ class: "modal-tips"
714
+ }, [!v.value && F("div", {
715
+ class: "float-left modal-tips-iconwrap"
716
+ }, [F("span", {
717
+ class: s.value
718
+ }, null)]), F("div", {
719
+ class: "modal-tips-content"
720
+ }, [v.value && F(De, null, [F("h5", {
721
+ class: "toast-title modal-tips-title",
722
+ innerHTML: r.value.title
723
+ }, null), F("p", {
724
+ class: "toast-msg",
725
+ innerHTML: r.value.message,
726
+ style: w.value
727
+ }, null), d.value && b()]), f.value && (r.value.buttons ? F("div", {
728
+ class: "toast-title-btns-wrapper d-flex"
729
+ }, [F("h5", {
730
+ class: "toast-title modal-tips-title only-toast-msg",
731
+ style: w.value,
732
+ innerHTML: r.value.message
733
+ }, null), F("div", {
734
+ class: "after-toast-title text-right ml-auto"
735
+ }, [b()])]) : F("h5", {
736
+ class: "toast-title modal-tips-title only-toast-msg",
737
+ style: w.value,
738
+ innerHTML: r.value.message
739
+ }, null))])])]);
740
+ }
741
+ }), Re = /* @__PURE__ */ Le({
742
+ name: "Notify",
743
+ props: Bn,
744
+ emits: ["close", "empty"],
745
+ setup(e, t) {
746
+ const n = W(() => ({
747
+ "farris-notify": !0
748
+ })), o = {
749
+ left: 12,
750
+ right: 12,
751
+ top: 20,
752
+ bottom: 12
753
+ }, i = O(), a = O(e.options), r = O(e.showCloseButton), c = W(() => e.position || "bottom-right"), v = W(() => e.timeout != null ? e.timeout : 3e3), f = W(() => {
754
+ const l = e.bottom ? e.bottom : o.bottom, y = e.top ? e.top : o.top, d = {
755
+ transition: "all 0.2s ease",
756
+ left: c.value.indexOf("left") > -1 ? `${e.left ? e.left : o.left}px` : "",
757
+ right: c.value.indexOf("right") > -1 ? `${e.right ? e.right : o.right}px` : "",
758
+ top: c.value.indexOf("top") > -1 ? `${y}px` : "",
759
+ bottom: c.value.indexOf("bottom") > -1 ? `${l}px` : ""
760
+ };
761
+ return c.value.indexOf("center") > -1 && (d.left = "50%", d.marginLeft = "calc(-24rem / 2)", c.value === "center-center" && (d.top = "50%", d.transform = "translate(-50%, -50%)")), d;
762
+ });
763
+ function u(l) {
764
+ t.emit("close");
765
+ }
766
+ v.value && setTimeout(() => {
767
+ u();
768
+ }, v.value), t.expose({
769
+ closeToast: u,
770
+ container: i,
771
+ notifyPosition: c
772
+ });
773
+ function s(l, y) {
774
+ u();
775
+ }
776
+ return () => F("div", {
777
+ class: n.value,
778
+ style: f.value,
779
+ ref: i
780
+ }, [F(Xe, {
781
+ options: a.value,
782
+ showCloseButton: r.value,
783
+ animate: e.animate,
784
+ onClose: (l) => s(l, a.value)
785
+ }, null)]);
786
+ }
787
+ });
788
+ class mt {
789
+ constructor() {
790
+ pe(this, "notifyRefs", []);
791
+ pe(this, "globalConfig", ct({}));
792
+ }
793
+ escapeAllHtml(t) {
794
+ if (typeof t != "string" || !t)
795
+ return "";
796
+ const n = document.createElement("div");
797
+ return n.textContent = t || "", n.innerHTML.replace(/\\n/g, "<br>").replace(/\\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g, "");
798
+ }
799
+ createNotifyInstance(t) {
800
+ const n = this, i = Object.assign({
801
+ timeout: 3e3,
802
+ position: "bottom-right",
803
+ showCloseButton: !0,
804
+ safeHtml: !0
805
+ }, this.globalConfig, {
806
+ ...t
807
+ }), a = document.createElement("div");
808
+ a.style.display = "contents";
809
+ const r = mn({
810
+ setup() {
811
+ var f;
812
+ const c = O();
813
+ function v() {
814
+ c.value.container.style.transform = "scale(0)", setTimeout(() => {
815
+ n.updateNotifyPositionForClose(i, c), r.unmount();
816
+ }, 220);
817
+ }
818
+ if (i.position.indexOf("top") > -1) {
819
+ const u = n.getNotifyInstances(i.position), s = u[u.length - 1];
820
+ if (s) {
821
+ const l = s.value.container.getBoundingClientRect();
822
+ i.top = l.bottom;
823
+ }
824
+ }
825
+ return i.safeHtml && ((f = i.options) != null && f.message) && (i.options.message = n.escapeAllHtml(i.options.message)), vn(() => {
826
+ document.body.removeChild(a);
827
+ }), Je(() => {
828
+ n.updateNotifyPositionForCreate(i, c);
829
+ }), () => F(pn, {
830
+ mode: "out-in",
831
+ name: "fade",
832
+ appear: !0
833
+ }, {
834
+ default: () => [F(Re, gn({
835
+ ref: c
836
+ }, i, {
837
+ onClose: v
838
+ }), null)]
839
+ });
840
+ }
841
+ });
842
+ return r.provide("NotifyService", this), document.body.appendChild(a), r.use(bn.i18n), r.mount(a), r;
843
+ }
844
+ getNotifyInstances(t) {
845
+ return this.notifyRefs.filter((n) => n.value.notifyPosition === t);
846
+ }
847
+ updateNotifyPositionForCreate(t, n) {
848
+ if (this.notifyRefs && this.notifyRefs.length) {
849
+ const o = window.innerHeight;
850
+ t.position.indexOf("bottom") > -1 && this.getNotifyInstances(t.position).forEach((i) => {
851
+ const a = i.value.container.getBoundingClientRect();
852
+ i.value.container.style.bottom = a.height + o - a.bottom + "px";
853
+ });
854
+ }
855
+ this.notifyRefs = [...this.notifyRefs, n];
856
+ }
857
+ updateNotifyPositionForClose(t, n) {
858
+ const o = this.notifyRefs.indexOf(n);
859
+ if (t.position.indexOf("top") > -1) {
860
+ const i = this.getNotifyInstances(t.position), a = i.indexOf(n);
861
+ i.slice(a + 1).forEach((r) => {
862
+ r.value.container.style.top = r.value.container.offsetTop - r.value.container.offsetHeight + "px";
863
+ });
864
+ }
865
+ o > -1 && this.notifyRefs.splice(o, 1);
866
+ }
867
+ show(t) {
868
+ return this.createNotifyInstance(t);
869
+ }
870
+ buildNotifyProps(t, n) {
871
+ let o = "", i = "", a, r, c;
872
+ typeof n == "string" ? o = n : n && (o = n.message || "", i = n.title || "", r = n.position || null, c = n.showCloseButton != null ? n.showCloseButton : null, a = n.timeout != null ? n.timeout : null);
873
+ const f = {
874
+ options: {
875
+ type: t,
876
+ message: o,
877
+ title: i
878
+ }
879
+ };
880
+ return r != null && (f.position = r), c != null && (f.showCloseButton = c), a != null && (f.timeout = a), f;
881
+ }
882
+ info(t) {
883
+ const n = this.buildNotifyProps("info", t);
884
+ return this.show(n);
885
+ }
886
+ success(t) {
887
+ const n = this.buildNotifyProps("success", t);
888
+ return this.show(n);
889
+ }
890
+ warning(t) {
891
+ const n = this.buildNotifyProps("warning", t);
892
+ return this.show(n);
893
+ }
894
+ error(t) {
895
+ const n = this.buildNotifyProps("error", t);
896
+ return this.show(n);
897
+ }
898
+ close(t) {
899
+ t && t.unmount();
900
+ }
901
+ closeAll() {
902
+ this.notifyRefs.forEach((t) => {
903
+ t == null || t.value.closeToast();
904
+ }), this.notifyRefs.length = 0;
905
+ }
906
+ }
907
+ const An = Symbol("NOTIFY_SERVICE_TOKEN");
908
+ Re.install = (e) => {
909
+ e.component(Re.name, Re), e.component(Xe.name, Xe);
910
+ const t = new mt();
911
+ e.provide(An, t), e.provide("FNotifyService", t);
912
+ };
913
+ function $n(e, t, n, o, i) {
914
+ const { toNumber: a } = st(), r = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), s = O([]), l = O([]), y = dt(e, i), { generateGroupData: d, groupFields: w, shouldGroupingData: C } = y, T = O(e.data || []), S = Pn(e, T, o, i), {
915
+ collapseTo: b,
916
+ expandTo: g,
917
+ generateHierarchyData: m,
918
+ hasRealChildren: p,
919
+ insertSibling: _,
920
+ insertChild: E,
921
+ insertChildren: h,
922
+ isVisibleInTree: B,
923
+ shouldStratifyData: Y,
924
+ toggleChildrenVisibiltyByCollapseStatus: M,
925
+ trimmedOriginalData: L,
926
+ checkVisibleInHierarchy: D
927
+ } = S, { idField: x, reviseIdentifyField: k } = i, $ = O(e.newDataItem), A = O(e.data || []), Q = O(e.data), { flatTreeData: ne, isNestedTree: I } = ft(e);
928
+ if (e.hierarchy && I(e.data)) {
929
+ const V = ne(e.data);
930
+ T.value = V, A.value = V, Q.value = V;
931
+ }
932
+ const z = O(e.summary), J = W(() => {
933
+ const V = z.value;
934
+ return (V == null ? void 0 : V.groupFields) || [];
935
+ });
936
+ let K = /* @__PURE__ */ new Map();
937
+ const re = O(A.value.length), ee = O(e.pagination);
938
+ function P() {
939
+ return ee.value && ee.value.enable && ee.value.size > 0 ? ee.value.size : A.value.length;
940
+ }
941
+ const R = O(1), j = W(() => ee.value && ee.value.enable && ee.value.mode !== "server"), U = W(() => ee.value && ee.value.enable && ee.value.mode === "server"), Z = new mt();
942
+ function ae(V, H) {
943
+ const X = Math.ceil(V.length / H);
944
+ let oe = 0;
945
+ const ve = [], Ce = [], Te = [];
946
+ for (; oe < X; ) {
947
+ const ye = V.slice(oe * H, (oe + 1) * H), le = d(w.value, ye, t);
948
+ Ce[oe] = le.filter((ce) => ce.__fv_data_grid_group_row__).length, ve.push(...le), oe++;
949
+ }
950
+ return Ce.reduce((ye, le, ce) => (ye = ye + le, Te.push(ye), ye), 0), {
951
+ groupData: ve,
952
+ groupRowSizeList: Ce,
953
+ accumulateGroupRowSize: Te
954
+ };
955
+ }
956
+ function ie() {
957
+ var le;
958
+ A.value = T.value, j.value && (re.value = A.value.length), C.value && !j.value && (A.value = d(w.value, T.value, t)), K = J.value.reduce((ce, me) => (ce.set(me, 0), ce), K);
959
+ const V = 0, H = P(), X = (R.value - 1) * H;
960
+ let ve = X > A.value.length - 1 || U.value ? V : X, Ce = U.value ? A.value.length : Math.min(ve + H, A.value.length);
961
+ if (C.value && j.value) {
962
+ const { accumulateGroupRowSize: ce, groupData: me, groupRowSizeList: de } = ae(T.value, H);
963
+ A.value = me;
964
+ const Ve = de[R.value - 1];
965
+ ve += R.value - 2 < 0 ? 0 : ce[R.value - 2], Ce = ve + H + Ve;
966
+ }
967
+ let Te = 0;
968
+ const ye = [];
969
+ if (A.value.length) {
970
+ k(A.value);
971
+ const ce = x.value !== e.idField;
972
+ for (let me = ve; me < Ce; me++) {
973
+ const de = A.value[me];
974
+ de.__fv_data_grid_group_row__ ? (Te = 0, de.__fv_data_index__ = "") : de.__fv_data_grid_group_summary__ ? de.__fv_data_index__ = "" : (Te++, de.__fv_data_index__ = Te + (R.value - 1) * H), de.__fv_index__ = me, de.__fv_visible_index__ = me, e.rowOption && e.rowOption.disabledField && (de.__fv_disabled__ = de[(le = e.rowOption) == null ? void 0 : le.disabledField]), ce && (de[x.value] = me), J.value.forEach((Ve) => {
975
+ const Ue = K.get(Ve) || 0;
976
+ K.set(Ve, Ue + se(de, Ve));
977
+ }), ye.push(de);
978
+ }
979
+ }
980
+ return Y.value && m(ye), J.value.forEach((ce) => {
981
+ const me = K.get(ce) || 0;
982
+ K.set(ce, a(me.toFixed(2)));
983
+ }), Q.value = [...ye], ye;
984
+ }
985
+ const te = O(ie()), ue = W(() => (D.value, te.value.filter((V) => Y.value ? V.__fv_visible__ !== !1 && B(V) : V.__fv_visible__ !== !1)));
986
+ function be() {
987
+ ue.value.forEach((V, H) => (V.__fv_visible_index__ = H, V));
988
+ }
989
+ function fe(V, H, X = !1) {
990
+ var ye;
991
+ const oe = X ? ie() : [...Q.value];
992
+ let ve = oe;
993
+ ((ye = e.filter) == null ? void 0 : ye.mode) !== "server" && (ve = oe.filter((le) => n.apply(le)));
994
+ const Ce = V && V.length ? ve.filter((le) => V.reduce((ce, me) => ce && me.filter(le), !0)) : ve, Te = H && H.length ? Ce.sort((le, ce) => {
995
+ const me = [...H], de = me.shift(), Ve = se(le, de.field) === void 0 || se(le, de.field) === null ? "" : se(le, de.field), Ue = se(ce, de.field) === void 0 || se(ce, de.field) === null ? "" : se(ce, de.field);
996
+ let Ge = de.compare(
997
+ Ve,
998
+ Ue
999
+ );
1000
+ for (; Ge === 0 && me.length !== 0; ) {
1001
+ const Me = me.shift();
1002
+ if (Me) {
1003
+ const Zt = se(le, Me.field) === void 0 || se(le, Me.field) === null ? "" : se(le, Me.field), Kt = se(ce, Me.field) === void 0 || se(ce, Me.field) === null ? "" : se(ce, Me.field);
1004
+ Ge = Me.compare(Zt, Kt);
1005
+ }
1006
+ }
1007
+ return Ge;
1008
+ }) : Ce;
1009
+ return te.value = Te.map((le, ce) => {
1010
+ if (le.__fv_data_grid_group_row__) {
1011
+ const me = `group_of_${le.__fv_data_grid_group_field__}_${le.__fv_data_grid_group_value__}`;
1012
+ le.__fv_data_grid_group_collapse__ = !!r.get(me);
1013
+ }
1014
+ return le.__fv_index__ = ce, le.__fv_visible_index__ = ce, le;
1015
+ }), te.value;
1016
+ }
1017
+ function Be(V) {
1018
+ return u.clear(), l.value = V, l.value.reduce((H, X) => (H.set(X.field, X), H), u), fe([], l.value);
1019
+ }
1020
+ function N(V, H) {
1021
+ return u.set(V, H), l.value = Array.from(u.values()), fe([], l.value);
1022
+ }
1023
+ function G(V) {
1024
+ return u.delete(V), l.value = Array.from(u.values()), fe([], l.value);
1025
+ }
1026
+ function q(V, H) {
1027
+ return c.set(V, H), s.value = Array.from(c.values()), fe([], Array.from(u.values()));
1028
+ }
1029
+ function ge(V) {
1030
+ return c.delete(V), s.value = Array.from(c.values()), fe([], Array.from(u.values()), !0);
1031
+ }
1032
+ function he() {
1033
+ return c.clear(), s.value = [], fe([], Array.from(u.values()), !0);
1034
+ }
1035
+ function Pe(V, H, X) {
1036
+ const oe = `group_of_${V}_${H}`;
1037
+ r.set(oe, !0);
1038
+ const ve = (Ce) => Ce[V] !== H;
1039
+ return v.set(`collapse_${V}_${H}`, {
1040
+ field: V,
1041
+ fieldName: V,
1042
+ fieldType: "string",
1043
+ filterValue: H,
1044
+ filter: ve
1045
+ }), fe(Array.from(v.values()), Array.from(u.values()));
1046
+ }
1047
+ function xt(V) {
1048
+ b(te.value, V);
1049
+ }
1050
+ function Ot(V) {
1051
+ g(te.value, V);
1052
+ }
1053
+ function It(V, H, X) {
1054
+ const oe = `group_of_${V}_${H}`;
1055
+ return r.set(oe, !1), v.delete(`collapse_${V}_${H}`), fe(Array.from(v.values()), Array.from(u.values()), !0);
1056
+ }
1057
+ function Dt(V) {
1058
+ const H = V.raw[x.value], X = (oe) => !oe.__fv_parents__.has(H);
1059
+ f.set(`fold_${H}`, {
1060
+ field: "id",
1061
+ fieldName: "id",
1062
+ fieldType: "string",
1063
+ filterValue: String(H),
1064
+ filter: X
1065
+ }), fe(Array.from(f.values()), Array.from(u.values())), m(te.value);
1066
+ }
1067
+ function He(V) {
1068
+ const H = V[x.value];
1069
+ f.delete(`fold_${H}`);
1070
+ }
1071
+ function Pt(V) {
1072
+ He(V.raw), fe(Array.from(f.values()), Array.from(u.values()), !0), m(te.value);
1073
+ }
1074
+ function Se() {
1075
+ const V = ie();
1076
+ te.value = V, fe(Array.from(f.values()), Array.from(u.values())), e.hierarchy && m(te.value);
1077
+ }
1078
+ function Bt(V) {
1079
+ const X = e.hierarchy && I(V) ? ne(V) : V;
1080
+ T.value = X, Se();
1081
+ }
1082
+ function Rt(V, H, X) {
1083
+ return (V && V.length ? te.value.filter((ve, Ce) => V.reduce((Te, ye) => Te && ye.filter(ve), !0)) : te.value).slice(H, X);
1084
+ }
1085
+ function At(V) {
1086
+ const H = P(), X = Math.ceil(re.value / H);
1087
+ 0 <= V && V <= X && (R.value = V, Se());
1088
+ }
1089
+ function $t(V) {
1090
+ T.value.push(Ae(V)), te.value = ie();
1091
+ }
1092
+ function Lt(V = 0) {
1093
+ if (!(V > -1))
1094
+ return !1;
1095
+ const X = $.value();
1096
+ e.hierarchy ? _(V, X, T) : T.value.splice(V, 0, X), Se();
1097
+ }
1098
+ function jt(V = 0) {
1099
+ if (!(V > -1 && e.hierarchy))
1100
+ return !1;
1101
+ const X = $.value(), oe = T.value[V];
1102
+ He(oe), E(V, X, T), Se();
1103
+ }
1104
+ function Ht(V, H = 0) {
1105
+ if (!(H > -1 && e.hierarchy))
1106
+ return !1;
1107
+ const oe = T.value[H];
1108
+ He(oe), h(H, V, T), Se();
1109
+ }
1110
+ function Ut(V) {
1111
+ const H = V ? V - 1 : 0;
1112
+ T.value.splice(H, 1), Se();
1113
+ }
1114
+ function Gt(V) {
1115
+ const H = T.value.findIndex((X) => X[x.value] === V);
1116
+ H !== -1 && (T.value.splice(H, 1), Se());
1117
+ }
1118
+ function qt(V) {
1119
+ const H = V > -1 ? T.value[V] : null;
1120
+ if (!(H && H.deletable !== !1))
1121
+ return !1;
1122
+ T.value = L(H, T.value), Se();
1123
+ }
1124
+ function zt() {
1125
+ const V = v.size > 0 ? Array.from(v.values()) : [];
1126
+ return fe(V, Array.from(u.values()));
1127
+ }
1128
+ function Ze(V) {
1129
+ ee.value.size = V;
1130
+ }
1131
+ function Wt(V) {
1132
+ ee.value && (Ze(V), Se());
1133
+ }
1134
+ function Yt(V, H) {
1135
+ const X = T.value[Number(V) - 1];
1136
+ X.editable !== !1 ? (X.name = H, Se()) : Z.show({
1137
+ showCloseButton: !1,
1138
+ timeout: 3e3,
1139
+ animate: "fadeIn",
1140
+ toasts: [{ type: "string", title: "提示", msg: "当前节点禁止编辑" }]
1141
+ });
1142
+ }
1143
+ function Xt(V) {
1144
+ return V.map((X) => {
1145
+ const oe = Q.value.findIndex((ve) => "" + ve[x.value] == "" + X);
1146
+ return oe > -1 ? Q.value[oe] : null;
1147
+ }).filter((X) => X != null);
1148
+ }
1149
+ function Jt() {
1150
+ const V = e.summary.groupFields;
1151
+ K = V.reduce((H, X) => (H.set(X, 0), H), K);
1152
+ for (const H of A.value)
1153
+ V.forEach((X) => {
1154
+ const oe = K.get(X) || 0;
1155
+ K.set(X, oe + se(H, X));
1156
+ });
1157
+ V.forEach((H) => {
1158
+ const X = K.get(H) || 0;
1159
+ K.set(H, a(X.toFixed(2)));
1160
+ });
1161
+ }
1162
+ function Qt(V) {
1163
+ const H = e.summary.groupFields;
1164
+ K = H.reduce((X, oe) => (X.set(oe, 0), X), K);
1165
+ for (const X of V)
1166
+ H.forEach((oe) => {
1167
+ const ve = K.get(oe) || 0;
1168
+ K.set(oe, ve + se(X.raw, oe));
1169
+ });
1170
+ H.forEach((X) => {
1171
+ const oe = K.get(X) || 0;
1172
+ K.set(X, a(oe.toFixed(2)));
1173
+ });
1174
+ }
1175
+ return {
1176
+ addFilter: q,
1177
+ addNewDataItem: $t,
1178
+ addSorter: N,
1179
+ updatePageSize: Ze,
1180
+ changePageSizeTo: Wt,
1181
+ collapse: Pe,
1182
+ collapseTo: xt,
1183
+ dataView: te,
1184
+ editDataItem: Yt,
1185
+ expand: It,
1186
+ expandTo: Ot,
1187
+ filters: s,
1188
+ fold: Dt,
1189
+ getRange: Rt,
1190
+ getSelectionItems: Xt,
1191
+ hasRealChildren: p,
1192
+ insertNewChildDataItem: jt,
1193
+ insertNewChildDataItems: Ht,
1194
+ insertNewDataItem: Lt,
1195
+ isVisibleInTree: B,
1196
+ load: Bt,
1197
+ navigatePageTo: At,
1198
+ pageIndex: R,
1199
+ rawView: Q,
1200
+ refresh: zt,
1201
+ removeAllFilter: he,
1202
+ removeDataItem: Ut,
1203
+ removeDataItemById: Gt,
1204
+ removeFilter: ge,
1205
+ removeHierarchyDataItem: qt,
1206
+ removeSorter: G,
1207
+ reOrderVisibleIndex: be,
1208
+ setSorters: Be,
1209
+ sorters: l,
1210
+ summaries: K,
1211
+ updateSummary: Jt,
1212
+ toggleChildrenVisibiltyByCollapseStatus: M,
1213
+ totalItems: re,
1214
+ unFold: Pt,
1215
+ updateDataView: Se,
1216
+ visibleDataItems: ue,
1217
+ shouldGroupingData: C,
1218
+ pagination: ee,
1219
+ updateVisibleDataSummary: Qt
1220
+ };
1221
+ }
1222
+ const Ln = [
1223
+ "equal",
1224
+ "notEqual",
1225
+ "greaterThan",
1226
+ "greaterThanOrEqual",
1227
+ "lessThan",
1228
+ "lessThanOrEqual",
1229
+ "contain",
1230
+ "startWidth",
1231
+ "endWidth",
1232
+ "in",
1233
+ "notIn"
1234
+ ], jn = {
1235
+ equal: (e, t, n) => e && e[t] === n,
1236
+ notEqual: (e, t, n) => e && e[t] !== n,
1237
+ contain: (e, t, n) => e ? (e[t] || "").indexOf(n) > -1 : !1,
1238
+ startWidth: (e, t, n) => e ? (e[t] || "").startsWith(n) : !1,
1239
+ endWidth: (e, t, n) => e ? (e[t] || "").endsWith(n) : !1
1240
+ }, Hn = {
1241
+ equal: (e, t, n) => e && e[t] === n,
1242
+ in: (e, t, n) => {
1243
+ if (e) {
1244
+ const o = e[t];
1245
+ return n.indexOf(o) > -1;
1246
+ }
1247
+ return !1;
1248
+ },
1249
+ notEqual: (e, t, n) => e && e[t] !== n
1250
+ }, Un = {
1251
+ equal: (e, t, n) => {
1252
+ if (e) {
1253
+ const o = new Date(n).getTime();
1254
+ return new Date(e[t]).getTime() === o;
1255
+ }
1256
+ return !1;
1257
+ },
1258
+ notEqual: (e, t, n) => {
1259
+ if (e) {
1260
+ const o = new Date(n).getTime();
1261
+ return new Date(e[t]).getTime() !== o;
1262
+ }
1263
+ return !1;
1264
+ },
1265
+ greaterThan: (e, t, n) => {
1266
+ if (e) {
1267
+ const o = new Date(new Date(n).toLocaleDateString()).valueOf();
1268
+ return new Date(new Date(e[t]).toLocaleDateString()).valueOf() > o;
1269
+ }
1270
+ return !1;
1271
+ },
1272
+ greaterThanOrEqual: (e, t, n) => {
1273
+ if (e) {
1274
+ const o = new Date(new Date(n).toLocaleDateString()).valueOf();
1275
+ return new Date(new Date(e[t]).toLocaleDateString()).valueOf() >= o;
1276
+ }
1277
+ return !1;
1278
+ },
1279
+ lessThan: (e, t, n) => {
1280
+ if (e) {
1281
+ const o = new Date(new Date(n).toLocaleDateString()).valueOf();
1282
+ return new Date(new Date(e[t]).toLocaleDateString()).valueOf() < o;
1283
+ }
1284
+ return !1;
1285
+ },
1286
+ lessThanOrEqual: (e, t, n) => {
1287
+ if (e) {
1288
+ const o = new Date(new Date(n).toLocaleDateString()).valueOf();
1289
+ return new Date(new Date(e[t]).toLocaleDateString()).valueOf() <= o;
1290
+ }
1291
+ return !1;
1292
+ }
1293
+ }, Gn = {
1294
+ equal: (e, t, n) => e ? String(n).split(",").includes(String(e[t])) : !1,
1295
+ in: (e, t, n) => {
1296
+ if (e) {
1297
+ const o = e[t];
1298
+ return n.indexOf(o) > -1;
1299
+ }
1300
+ return !1;
1301
+ },
1302
+ notEqual: (e, t, n) => e ? String(n).split(",").findIndex((i) => i === String(e[t])) === -1 : !1
1303
+ }, qn = {
1304
+ equal: (e, t, n) => {
1305
+ if (e) {
1306
+ const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
1307
+ return isNaN(o) ? isNaN(i) : o === i;
1308
+ }
1309
+ return !1;
1310
+ },
1311
+ notEqual: (e, t, n) => {
1312
+ if (e) {
1313
+ const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
1314
+ return isNaN(o) ? !0 : o !== i;
1315
+ }
1316
+ return !1;
1317
+ },
1318
+ greaterThan: (e, t, n) => {
1319
+ if (e) {
1320
+ const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
1321
+ return isNaN(o) ? isNaN(i) : i > o;
1322
+ }
1323
+ return !1;
1324
+ },
1325
+ greaterThanOrEqual: (e, t, n) => {
1326
+ if (e) {
1327
+ const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
1328
+ return isNaN(o) ? isNaN(i) : i >= o;
1329
+ }
1330
+ return !1;
1331
+ },
1332
+ lessThan: (e, t, n) => {
1333
+ if (e) {
1334
+ const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
1335
+ return isNaN(o) ? isNaN(i) : i < o;
1336
+ }
1337
+ return !1;
1338
+ },
1339
+ lessThanOrEqual: (e, t, n) => {
1340
+ if (e) {
1341
+ const o = Number.parseFloat(String(n)), i = Number.parseFloat(String(e[t]));
1342
+ return isNaN(o) ? isNaN(i) : i <= o;
1343
+ }
1344
+ return !1;
1345
+ }
1346
+ }, zn = /* @__PURE__ */ new Map([
1347
+ ["boolean", Hn],
1348
+ ["datetime", Un],
1349
+ ["enum", Gn],
1350
+ ["number", qn],
1351
+ ["text", jn]
1352
+ ]);
1353
+ function Wn(e, t) {
1354
+ const n = O([]), o = /* @__PURE__ */ new Map(), { loadConditionGroup: i } = wn();
1355
+ function a(g, m) {
1356
+ switch (g) {
1357
+ case "check-box":
1358
+ return new xn({ value: m });
1359
+ case "combo-list":
1360
+ return new Vn({ value: m });
1361
+ case "combo-lookup":
1362
+ return new Nn({ value: m });
1363
+ case "input-group":
1364
+ return new qe({ value: m });
1365
+ case "date-picker":
1366
+ return new Mn({ value: m });
1367
+ case "date-range":
1368
+ return new rt({ value: m });
1369
+ case "datetime-picker":
1370
+ return new Fn({ value: m });
1371
+ case "datetime-range":
1372
+ return new rt({ value: m });
1373
+ case "lookup":
1374
+ return new qe({ value: m });
1375
+ case "month-picker":
1376
+ return new kn({ value: m });
1377
+ case "month-range":
1378
+ return new En({ value: m });
1379
+ case "number-range":
1380
+ return new Tn({ value: m });
1381
+ case "number-spinner":
1382
+ return new Sn({ value: m });
1383
+ case "radio-group":
1384
+ return new Cn({ value: m });
1385
+ default:
1386
+ return new qe({ value: m });
1387
+ }
1388
+ }
1389
+ const r = /* @__PURE__ */ new Map([
1390
+ ["boolean", "check-box"],
1391
+ ["date", "date-picker"],
1392
+ ["datetime", "datetime-picker"],
1393
+ ["number", "number-spinner"],
1394
+ ["string", "text"],
1395
+ ["text", "text"],
1396
+ ["enum", "combo-list"],
1397
+ ["reference", "lookup"]
1398
+ ]), c = /* @__PURE__ */ new Map([
1399
+ // ['boolean', CompareType.In],
1400
+ ["boolean", we.Equal],
1401
+ ["date", we.Equal],
1402
+ ["datetime", we.Equal],
1403
+ ["number", we.Equal],
1404
+ ["string", we.Equal],
1405
+ ["text", we.Equal],
1406
+ ["enum", we.In],
1407
+ ["reference", we.Equal]
1408
+ ]);
1409
+ function v() {
1410
+ n.value.forEach((m, p) => {
1411
+ p === n.value.length - 1 ? m.relation = 0 : m.relation = 1;
1412
+ });
1413
+ const g = [];
1414
+ return n.value.forEach((m) => {
1415
+ const { valueType: p } = m.value, _ = m.value.value;
1416
+ if (p === "boolean") {
1417
+ const E = [];
1418
+ _.length === 1 && E.push({
1419
+ filterField: m.fieldCode,
1420
+ compare: m.compareType || m.compareType === 0 ? m.compareType : we.Like,
1421
+ value: m.value.value[0],
1422
+ relation: n.value.length > 1 ? m.relation || m.relation === 0 ? m.relation : 1 : 0,
1423
+ expresstype: xe.Value,
1424
+ lbracket: m.lBracket || null,
1425
+ rbracket: m.rBracket || null
1426
+ }), _.length > 1 && E.push({
1427
+ filterField: m.fieldCode,
1428
+ compare: m.compareType || m.compareType === 0 ? m.compareType : we.Like,
1429
+ value: m.value.value[0],
1430
+ relation: 2,
1431
+ expresstype: xe.Value,
1432
+ lbracket: m.lBracket ? m.lBracket + "(" : "(",
1433
+ rbracket: m.rBracket || null
1434
+ }, {
1435
+ filterField: m.fieldCode,
1436
+ compare: m.compareType || m.compareType === 0 ? m.compareType : we.Like,
1437
+ value: m.value.value[1],
1438
+ relation: n.value.length > 1 ? m.relation || m.relation === 0 ? m.relation : 1 : 0,
1439
+ expresstype: xe.Value,
1440
+ lbracket: m.lBracket || null,
1441
+ rbracket: m.rBracket ? m.rBracket + ")" : ")"
1442
+ }), g.push(...E);
1443
+ } else
1444
+ g.push({
1445
+ filterField: m.fieldCode,
1446
+ compare: m.compareType || m.compareType === 0 ? m.compareType : we.Like,
1447
+ value: m.value.value,
1448
+ relation: n.value.length > 1 ? m.relation || m.relation === 0 ? m.relation : 1 : 0,
1449
+ expresstype: xe.Value,
1450
+ lbracket: m.lBracket || null,
1451
+ rbracket: m.rBracket || null
1452
+ });
1453
+ }), g;
1454
+ }
1455
+ function f(g) {
1456
+ var p;
1457
+ const m = g.dataType || "string";
1458
+ return ((p = g.editor) == null ? void 0 : p.type) || r.get(m) || "text";
1459
+ }
1460
+ function u(g) {
1461
+ var D, x, k, $, A;
1462
+ const m = `field_filter_${g.field}`, p = Date.now(), _ = g.field, E = ((D = g.column) == null ? void 0 : D.title) || "", h = ((x = g.column) == null ? void 0 : x.dataType) || "string", B = c.get(h) || we.Equal, Y = (($ = (k = g.column) == null ? void 0 : k.editor) == null ? void 0 : $.type) || r.get(h) || "text", M = a(Y, (A = g.column) == null ? void 0 : A.filter), L = Y === "lookup" || Y === "combo-lookup" ? xe.SmartHelp : Y === "combo-list" ? xe.Enum : xe.Value;
1463
+ o.set(m, { id: m, fieldCode: _, fieldName: E, compareType: B, valueType: L, value: M, conditionId: p, relation: 1 }), n.value = Array.from(o.values());
1464
+ }
1465
+ function s(g) {
1466
+ const m = `field_filter_${g.field}`;
1467
+ o.delete(m), n.value = Array.from(o.values());
1468
+ }
1469
+ function l(g) {
1470
+ o.delete(g), n.value = Array.from(o.values());
1471
+ }
1472
+ function y() {
1473
+ o.clear(), n.value = [];
1474
+ }
1475
+ function d(g) {
1476
+ const { valueType: m } = g.value, p = g.compareType || "0", _ = Ln[Number(p)];
1477
+ return zn.get(m)[_];
1478
+ }
1479
+ function w(g) {
1480
+ const m = g.relation === 2 ? 0 : 1, p = g.items.map((E) => {
1481
+ const h = d(E);
1482
+ return (Y) => h(Y, E.fieldCode, E.value.getValue());
1483
+ }), _ = g.children && g.children.length ? g.children.map((E) => w(E)) : [];
1484
+ return { relation: m, filterFunctions: p, children: _ };
1485
+ }
1486
+ function C() {
1487
+ const g = i(n.value);
1488
+ return w(g);
1489
+ }
1490
+ function T(g, m) {
1491
+ const p = m.filterFunctions.map((E) => E(g)), _ = m.children.map((E) => T(g, E));
1492
+ return m.relation === 1 ? p.every((E) => E) && _.every((E) => E) : p.includes(!0) || _.includes(!0);
1493
+ }
1494
+ function S(g) {
1495
+ const m = C();
1496
+ return T(g, m);
1497
+ }
1498
+ function b(g) {
1499
+ t.emit("filterChanged", g);
1500
+ }
1501
+ return {
1502
+ addColumnFilter: u,
1503
+ apply: S,
1504
+ clearCondition: y,
1505
+ conditions: n,
1506
+ getFilterEditorType: f,
1507
+ removeColumnFilter: s,
1508
+ removeCondition: l,
1509
+ filterFromServer: b,
1510
+ createFilterConditions: v
1511
+ };
1512
+ }
1513
+ function Yn(e) {
1514
+ O(e.selection.showCheckbox || !1);
1515
+ const t = W(() => {
1516
+ var r;
1517
+ return ((r = e.hierarchy) == null ? void 0 : r.collapseField) || "__fv_collapse__";
1518
+ }), n = W(() => {
1519
+ var r;
1520
+ return ((r = e.hierarchy) == null ? void 0 : r.hasChildrenField) || "__fv_hasChildren__";
1521
+ }), o = W(() => {
1522
+ var r;
1523
+ return ((r = e.hierarchy) == null ? void 0 : r.parentIdField) || "parent";
1524
+ }), i = W(() => e.hierarchy && e.selection.showCheckbox), a = W(() => (e.treeNodeIconsData.fold || e.iconField) && e.showTreeNodeIcons);
1525
+ return { collapseField: t, hasChildrenField: n, parentIdField: o, shouldShowCheckBox: i, shouldShowIcon: a };
1526
+ }
1527
+ function Xn(e, t, n, o, i, a, r, c) {
1528
+ const v = O(o.value - 1 + i), f = O(0), { renderDataRow: u } = a, s = r ? r.renderGroupRow : u, l = c ? c.renderSummaryRow : u;
1529
+ function y(C) {
1530
+ let T = u;
1531
+ return C.__fv_data_grid_group_row__ && (T = s), C.__fv_data_grid_group_summary__ && (T = l), T;
1532
+ }
1533
+ function d(C, T, S, b) {
1534
+ const { dataView: g, visibleDataItems: m } = n, p = [], _ = e.virtualized ? m.value : g.value;
1535
+ if (_.length > 0) {
1536
+ const E = b ? Date.now().toString() : "";
1537
+ let h = C, B = 0;
1538
+ const Y = T - C + 1;
1539
+ for (; p.length < Y && h < _.length; ) {
1540
+ const M = _[h], L = _[h - 1] || S, D = p[B - 1], x = L ? (L.__fv_data_position__ || 0) + (L.__fv_data_height__ || 0) : 0, $ = y(M)(M, L, D, h, x, t.value);
1541
+ $.refreshKey = E, $.visible && (p.push($), B++), h++;
1542
+ }
1543
+ }
1544
+ return f.value = p.length > 0 ? p[0].raw.__fv_visible_index__ : 0, v.value = p.length > 0 ? p[p.length - 1].raw.__fv_visible_index__ : 0, p;
1545
+ }
1546
+ function w(C, T, S) {
1547
+ const b = T.groupField || "", { groupValue: g, raw: m } = T;
1548
+ n[C](b, g, m.groupParents || []);
1549
+ const { dataView: p } = n, _ = S[0].index, E = Math.min(_ + o.value + i + 1, p.value.length - 1);
1550
+ return d(_, E);
1551
+ }
1552
+ return { getVisualData: d, maxVisibleRowIndex: v, minVisibleRowIndex: f, toggleGroupRow: w };
1553
+ }
1554
+ function Jn(e) {
1555
+ var a;
1556
+ const { isUndefined: t } = lt(), n = ((a = e.rowOption) == null ? void 0 : a.height) || 28;
1557
+ function o(r, c) {
1558
+ const v = r.pre;
1559
+ if (v) {
1560
+ let f = v.__fv_data_position__, u = v.__fv_data_height__;
1561
+ (t(f) || // when virtual loading, position of tree node should recalculate after collapse tree node.
1562
+ e.virtualized && e.hierarchy && v.__fv_visible_index__ * n !== f) && (f = v.__fv_visible_index__ * n), t(u) && (u = n);
1563
+ const s = r.visible ? f + u : v.__fv_data_position__;
1564
+ r.top = s, c.__fv_data_position__ = s;
1565
+ } else
1566
+ r.top = 0, c.__fv_data_position__ = 0;
1567
+ }
1568
+ function i(r, c, v) {
1569
+ if (r && !c.ref) {
1570
+ c.ref = r;
1571
+ const f = c.parent;
1572
+ c.cellHeight !== r.offsetHeight && (c.cellHeight = r.offsetHeight), c.cellHeight && c.cellHeight > (f.height || 0) && (f.height = c.cellHeight, v.__fv_data_height__ = f.height), o(f, v);
1573
+ }
1574
+ !r && c.ref && (c.ref = r);
1575
+ }
1576
+ return { updateRowPosition: o, updateVisualInfomation: i };
1577
+ }
1578
+ function Qn() {
1579
+ function e(t, n) {
1580
+ var r, c;
1581
+ if (!n.data || !n.data.length)
1582
+ return "";
1583
+ const o = Object.prototype.hasOwnProperty.call(n, "valueField") && n.valueField || "value", i = Object.prototype.hasOwnProperty.call(n, "textField") && n.textField || "name";
1584
+ if (t != null && t.includes(",")) {
1585
+ const v = t.split(",");
1586
+ if (!n.data.filter((l) => v.includes(l[o])).length)
1587
+ return "";
1588
+ const u = (r = n.data) == null ? void 0 : r.reduce((l, y) => (l[y[o]] = y, l), {});
1589
+ return v.map((l) => {
1590
+ var y;
1591
+ return (y = u[l]) == null ? void 0 : y[i];
1592
+ }).join(",") || t;
1593
+ }
1594
+ const a = (c = n.data) == null ? void 0 : c.find((v) => v[o] === t);
1595
+ return (a == null ? void 0 : a[i]) || t || "";
1596
+ }
1597
+ return {
1598
+ renderEnumColumn: e
1599
+ };
1600
+ }
1601
+ function Zn() {
1602
+ function e(t, n) {
1603
+ return t ? n == null ? void 0 : n.trueText : n == null ? void 0 : n.falseText;
1604
+ }
1605
+ return {
1606
+ renderText: e
1607
+ };
1608
+ }
1609
+ function Kn() {
1610
+ const {
1611
+ formatTo: e
1612
+ } = on();
1613
+ function t(o, i) {
1614
+ if (o) {
1615
+ let a = "yyyy-MM-dd";
1616
+ if (typeof i == "string" ? a = i : typeof i == "object" && (a = i.format || "yyyy-MM-dd"), a = a.replace("YYYY", "yyyy").replace("-DD", "-dd"), typeof i == "object" && i.dateRange) {
1617
+ const r = i.dateRangeDatesDelimiter || "~";
1618
+ let [c, v] = o.split(r);
1619
+ return c = e(c, a), v = e(v, a), c + r + v;
1620
+ }
1621
+ return e(o, a);
1622
+ }
1623
+ return o;
1624
+ }
1625
+ function n(o, i) {
1626
+ const a = i.dateFormat || "yyyy-MM-dd";
1627
+ return e(o, a);
1628
+ }
1629
+ return {
1630
+ renderDateColumn: n,
1631
+ renderDateTimeColumn: t
1632
+ };
1633
+ }
1634
+ function eo() {
1635
+ const {
1636
+ formatTo: e
1637
+ } = st();
1638
+ function t(n, o) {
1639
+ const i = {
1640
+ precision: o.precision,
1641
+ prefix: o.prefix || "",
1642
+ suffix: o.suffix || "",
1643
+ decimalSeparator: o.decimal || ".",
1644
+ groupSeparator: o.thousand || ""
1645
+ };
1646
+ return e(n, i) || n;
1647
+ }
1648
+ return {
1649
+ renderNumberColumn: t
1650
+ };
1651
+ }
1652
+ function to() {
1653
+ function e(t, n) {
1654
+ if (t) {
1655
+ const o = {};
1656
+ return n != null && n.width && (o.width = `${n.width}px`), n != null && n.height && (o.height = `${n.height}px`), F("img", {
1657
+ src: t,
1658
+ style: o
1659
+ }, null);
1660
+ }
1661
+ return t;
1662
+ }
1663
+ return {
1664
+ renderImageColumn: e
1665
+ };
1666
+ }
1667
+ function no() {
1668
+ const {
1669
+ locale: e
1670
+ } = je();
1671
+ function t(n, o) {
1672
+ return (n == null ? void 0 : n[e.value || "zh-CHS"]) || "";
1673
+ }
1674
+ return {
1675
+ renderMultilingualColumn: t
1676
+ };
1677
+ }
1678
+ function oo() {
1679
+ const {
1680
+ renderText: e
1681
+ } = Zn(), {
1682
+ renderEnumColumn: t
1683
+ } = Qn(), {
1684
+ renderNumberColumn: n
1685
+ } = eo(), {
1686
+ renderDateColumn: o,
1687
+ renderDateTimeColumn: i
1688
+ } = Kn(), {
1689
+ renderImageColumn: a
1690
+ } = to(), {
1691
+ renderMultilingualColumn: r
1692
+ } = no();
1693
+ function c(u) {
1694
+ return typeof u == "boolean" ? u.toString() : u;
1695
+ }
1696
+ function v(u, s, l) {
1697
+ return s.customFormat ? (
1698
+ // new Function(`return ${options.customFormat}`)() :
1699
+ s.customFormat(u, l.raw)
1700
+ ) : c(u);
1701
+ }
1702
+ function f(u, s, l) {
1703
+ const {
1704
+ column: y
1705
+ } = u, d = se(s.raw, y.field), w = l.options || l;
1706
+ return l.type === Ee.NONE ? c(d) : l.type === Ee.CUSTOM ? v(d, l, s) : l.type === Ee.ENUM ? t(d, w) : l.type === Ee.NUMBER ? n(d, w) : l.type === Ee.BOOLEAN ? e(d, w) : l.type === Ee.DATE ? o(d, w) : l.type === Ee.DATE_TIME ? i(d, l) : l.type === Ee.IMAGE ? a(d, w) : l.type === Ee.MULTI_LINGUAL ? r(d, w) : c(d);
1707
+ }
1708
+ return {
1709
+ renderFormatColumn: f
1710
+ };
1711
+ }
1712
+ function ro(e, t, n) {
1713
+ var T;
1714
+ const { isUndefined: o } = lt(), i = O(e.mergeCell);
1715
+ (T = O(e.rowOption).value) != null && T.wrapContent;
1716
+ const { updateVisualInfomation: r } = n, { renderCommandColumn: c } = Dn(e), { renderFormatColumn: v } = oo();
1717
+ function f(S, b, g, m, p, _ = 1) {
1718
+ const E = {
1719
+ colSpan: _,
1720
+ rowSpan: 1,
1721
+ index: g,
1722
+ field: S,
1723
+ data: se(m, S),
1724
+ editingData: se(m, S),
1725
+ parent: p,
1726
+ mode: b,
1727
+ align: "left",
1728
+ valign: "start",
1729
+ showEllipsis: !0,
1730
+ getEditor: (h) => h.data,
1731
+ setRef: (h) => r(h, E, m),
1732
+ update: () => {
1733
+ },
1734
+ accept: () => {
1735
+ },
1736
+ cancel: () => {
1737
+ },
1738
+ updateData: () => {
1739
+ }
1740
+ };
1741
+ return E;
1742
+ }
1743
+ function u(S, b, g) {
1744
+ return S.getEditor = (m) => t.getEditor(m, b, m.parent), S.setRef = (m) => r(m, S, g), S.update = (m) => {
1745
+ m !== void 0 && (S.editingData = m);
1746
+ }, S.accept = () => {
1747
+ We(S.editingData, g, b.field), S.data = se(g, b.field);
1748
+ }, S.cancel = () => {
1749
+ S.editingData = S.data;
1750
+ }, S.updateData = (m) => {
1751
+ We(se(m, b.field), g, b.field), S.data = se(g, b.field), S.editingData = se(g, b.field);
1752
+ }, S;
1753
+ }
1754
+ function s(S, b) {
1755
+ b.dataType === "commands" ? S.formatter = (g, m) => b.formatter ? b.formatter(S, m) : c(S, m) : b.formatter && (S.formatter = (g, m) => typeof b.formatter == "function" ? b.formatter(g, m) : v(S, m, b.formatter));
1756
+ }
1757
+ function l(S, b, g) {
1758
+ const m = b && b.data[g];
1759
+ if (m && m.data === S.data) {
1760
+ const _ = m && m.spannedBy || m;
1761
+ _.rowSpan++, _.spanned = _.spanned || [], _.spanned.push(S), S.colSpan = 0, S.rowSpan = 0, S.spannedBy = _;
1762
+ }
1763
+ }
1764
+ function y(S, b, g) {
1765
+ i.value && l(S, b, g.field);
1766
+ }
1767
+ function d(S, b) {
1768
+ b.showEllipsis !== void 0 && (S.showEllipsis = b.showEllipsis), S.showTips = o(b.showTips) ? !0 : b.showTips, S.column = b, S.align = b.align || "left", S.valign = b.valign || "middle", S.mode = e.editable ? _e.editable : _e.readonly;
1769
+ }
1770
+ function w(S, b, g, m) {
1771
+ d(S, b), u(S, b, m), s(S, b), y(S, g, b);
1772
+ }
1773
+ function C(S, b, g, m, p) {
1774
+ const _ = e.editable ? _e.editable : _e.readonly, E = f(S.field, _, b, g, m);
1775
+ return w(E, S, p, g), E;
1776
+ }
1777
+ return { createCellByColumn: C, createCellByField: f, updateCellByColumn: w };
1778
+ }
1779
+ function io(e, t, n, o, i, a, r) {
1780
+ var b, g;
1781
+ const c = O(e.rowOption), v = ((b = c.value) == null ? void 0 : b.height) || 28, f = ((g = c.value) == null ? void 0 : g.wrapContent) || !1, { idField: u } = i, { collapseField: s } = o, { updateRowPosition: l } = a, { createCellByColumn: y } = r, d = (m, p, _, E) => {
1782
+ We(se(m, E), p, E), _.data[E].data = se(p, E), _.data[E].editingData = se(p, E);
1783
+ };
1784
+ function w(m, p, _, E, h, B) {
1785
+ var J, K, re;
1786
+ const {
1787
+ __fv_data_grid_group_field__: Y,
1788
+ __fv_data_grid_group_value__: M,
1789
+ __fv_data_index__: L
1790
+ } = _, D = _.__fv_data_grid_group_layer__ || (_.__fv_parents__ ? (J = _.__fv_parents__) == null ? void 0 : J.size : 0) || 0, x = typeof _.parent == "number" ? Number(_.parent) : -1, k = _.__fv_data_grid_group_collapse__ || _[s.value], $ = _.__fv_visible__ === void 0 ? !0 : _.__fv_visible__, A = _.__fv_checked__, Q = _.__fv_indeterminate__, ne = _.__fv_disabled__ || _[((K = e.rowOption) == null ? void 0 : K.disabledField) || "disabled"], I = e.hierarchy && t.isVisibleInTree(_), z = {
1791
+ collapse: k,
1792
+ data: {},
1793
+ dataIndex: L,
1794
+ groupField: Y,
1795
+ groupValue: M,
1796
+ layer: D,
1797
+ index: p,
1798
+ parentIndex: x,
1799
+ pre: E,
1800
+ top: B,
1801
+ type: m,
1802
+ raw: _,
1803
+ checked: A,
1804
+ disabled: ne,
1805
+ indeterminate: Q,
1806
+ setRef: (ee) => {
1807
+ z.ref = ee;
1808
+ },
1809
+ visible: $ && I || $ && !e.hierarchy,
1810
+ status: Fe.initial,
1811
+ updateCell: (ee, P) => {
1812
+ d(ee, _, z, P), t.updateSummary();
1813
+ },
1814
+ updateCells: (ee, P) => {
1815
+ P.forEach((R) => {
1816
+ d(ee, _, z, R);
1817
+ });
1818
+ }
1819
+ };
1820
+ return E || (_.__fv_data_position__ = 0), f || (z.height = v, _.__fv_data_height__ = z.height, l(z, _)), (re = c.value) != null && re.customRowStatus && (c.value.customRowStatus(z), _.__fv_disabled__ = z.disabled), z;
1821
+ }
1822
+ function C(m, p, _, E, h, B) {
1823
+ const Y = w(Ie.data, h, p, _, E, B);
1824
+ return m.forEach((M, L) => {
1825
+ Y.data[M.field] = y(M, L, p, Y, E);
1826
+ }), Y;
1827
+ }
1828
+ function T(m, p, _, E, h) {
1829
+ return Object.assign(m, { index: p, dataIndex: _, top: E, pre: h });
1830
+ }
1831
+ function S(m, p, _, E, h, B) {
1832
+ const Y = m.__fv_data_index__, M = m[u.value], L = n.getEditingSnapshot(M);
1833
+ return L === null ? C(
1834
+ B,
1835
+ m,
1836
+ p,
1837
+ _,
1838
+ E,
1839
+ h
1840
+ ) : T(L, E, Y, h, p);
1841
+ }
1842
+ return { createEmptyRow: w, createNewRowFromDataItem: C, renderDataRow: S };
1843
+ }
1844
+ function ao(e, t, n, o) {
1845
+ const i = O(e.summary), { idField: a } = t, { createCellByField: r } = n, { createEmptyRow: c } = o, v = W(() => {
1846
+ const l = i.value;
1847
+ return (l == null ? void 0 : l.groupFields) || [];
1848
+ }), f = W(() => {
1849
+ const l = i.value;
1850
+ return l && l.enable && l.groupFields && l.groupFields.length > 0;
1851
+ });
1852
+ function u(l, y, d, w) {
1853
+ if (f.value) {
1854
+ const C = l.data[y];
1855
+ let T = C.colSpan;
1856
+ const S = v.value.reduce((b, g) => (b.set(g, !0), b), /* @__PURE__ */ new Map());
1857
+ w.reduce((b, g, m) => {
1858
+ if (S.has(g.field)) {
1859
+ const p = r(g.field, _e.readonly, m, d, l);
1860
+ l.data[g.field] = p, T - 1 > m && (T = m);
1861
+ }
1862
+ return b;
1863
+ }, l), C.colSpan = T;
1864
+ }
1865
+ }
1866
+ function s(l, y, d, w, C, T, S) {
1867
+ const b = l.__fv_data_grid_group_field__, g = c(Ie.group, w, l, y, d, C);
1868
+ return g.data[a.value] = r(a.value, _e.readonly, -1, l, g, 0), g.data[b] = r(b, _e.readonly, 1, l, g, T.length), u(g, b, l, T), g;
1869
+ }
1870
+ return { renderGroupRow: s };
1871
+ }
1872
+ function so(e, t, n, o) {
1873
+ const { idField: i } = t, { createCellByField: a } = n, { createEmptyRow: r } = o;
1874
+ function c(v, f, u, s, l, y, d) {
1875
+ const w = v.__fv_data_grid_group_field__, C = r(Ie.summary, s, v, f, u, l);
1876
+ return C.data[i.value] = a(i.value, _e.readonly, -1, v, C), C.data[w] = a(w, _e.readonly, 1, v, C, y.length), C;
1877
+ }
1878
+ return { renderSummaryRow: c };
1879
+ }
1880
+ function lo(e, t, n, o, i) {
1881
+ var ne;
1882
+ const {
1883
+ idField: a
1884
+ } = n, r = O(e.editable), c = O(e.editOption), v = O(((ne = e.rowOption) == null ? void 0 : ne.wrapContent) || !1), {
1885
+ onClickRow: f,
1886
+ onClickRowExcludeDblclick: u
1887
+ } = o, s = /* @__PURE__ */ new Map([["boolean", "check-box"], ["datetime", "date-picker"], ["enum", "combo-list"], ["number", "number-spinner"], ["string", "input-group"], ["text", "text"], ["commands", "commands-editor"]]);
1888
+ let l, y, d, w, C;
1889
+ function T(I) {
1890
+ return y && y.raw[a.value] === I ? y : null;
1891
+ }
1892
+ const S = ct({});
1893
+ function b(I, z, J = {}) {
1894
+ I.mode = _e.editing, l = I, y = z, d = se(z == null ? void 0 : z.raw, I.field), w = J;
1895
+ for (const K in S)
1896
+ delete S[K];
1897
+ }
1898
+ function g(I) {
1899
+ I.accept(), I.mode = _e.editable, l = null;
1900
+ const z = {};
1901
+ y && (Object.keys(y).forEach((J) => {
1902
+ z[J] = y == null ? void 0 : y[J];
1903
+ }), y = null), t.emit("endEditCell", {
1904
+ cell: I,
1905
+ row: z,
1906
+ newValue: se(z == null ? void 0 : z.raw, I.field),
1907
+ oldValue: d,
1908
+ column: w,
1909
+ editor: S
1910
+ });
1911
+ }
1912
+ function m(I) {
1913
+ const z = Promise.resolve(!0);
1914
+ return I ? z.then(() => tt(e.beforeEndEditCell) ? !0 : typeof e.beforeEndEditCell == "function" ? e.beforeEndEditCell({
1915
+ cell: I,
1916
+ row: y,
1917
+ newValue: I.editingData,
1918
+ oldValue: d
1919
+ }) : () => !0).then((J) => (J && (g(I), y && (y = null)), J)) : z;
1920
+ }
1921
+ function p(I) {
1922
+ if (C && C !== I.target) {
1923
+ C = null;
1924
+ return;
1925
+ }
1926
+ if (document.body.classList.contains("lookup-modal-open"))
1927
+ return;
1928
+ const J = I.target;
1929
+ if (!(J != null && J.closest(".popover"))) {
1930
+ if (I instanceof MouseEvent || I.key !== "Enter") {
1931
+ const K = J.closest(".fv-grid-cell");
1932
+ if (l && l.ref && l.ref === K)
1933
+ return;
1934
+ }
1935
+ m(l).then((K) => {
1936
+ K && document.body.removeEventListener("click", p, !0);
1937
+ });
1938
+ }
1939
+ }
1940
+ function _(I, z, J) {
1941
+ return Promise.resolve().then(() => {
1942
+ var re;
1943
+ const K = (re = J.editor) == null ? void 0 : re.readonly;
1944
+ return !tt(e.beforeEditCell) && typeof e.beforeEditCell == "function" ? e.beforeEditCell({
1945
+ row: I,
1946
+ cell: z,
1947
+ rawData: I.raw,
1948
+ column: J
1949
+ }) : !K;
1950
+ }).then((K) => {
1951
+ K && (b(z, I, J), document.body.removeEventListener("click", p, !0), document.body.addEventListener("click", p, !0));
1952
+ });
1953
+ }
1954
+ function E(I, z, J, K = {}) {
1955
+ I.stopPropagation(), u(I, J), r.value && c.value.editMode === "cell" && z.mode === _e.editable && m(l).then(() => {
1956
+ l || _(J, z, K);
1957
+ });
1958
+ }
1959
+ function h(I, z, J, K = {}) {
1960
+ I.stopPropagation(), f(I, J), r.value && c.value.editMode === "cell" && z.mode === _e.editable && m(l).then(() => {
1961
+ l || _(J, z, K);
1962
+ });
1963
+ }
1964
+ function B(I) {
1965
+ I.stopPropagation(), C = I.target;
1966
+ }
1967
+ function Y(I) {
1968
+ I.stopPropagation(), C && (C = null);
1969
+ }
1970
+ function M(I) {
1971
+ Object.values(I.data).filter((z) => z.mode === _e.editable && z.field !== "__commands__").forEach((z) => {
1972
+ z.mode = _e.editing;
1973
+ }), I.status = Fe.editing, y = I;
1974
+ }
1975
+ function L(I, z) {
1976
+ Object.values(I.data).filter((J) => J.mode === _e.editing).forEach((J) => {
1977
+ z ? J.accept() : J.cancel(), J.mode = _e.editable;
1978
+ }), I.status = Fe.initial, y === I && (y = null);
1979
+ }
1980
+ function D(I) {
1981
+ r.value && c.value.editMode === "row" && y !== I && (y && L(y, !1), M(I));
1982
+ }
1983
+ function x(I) {
1984
+ L(I, !0), I.status = Fe.initial;
1985
+ }
1986
+ function k(I) {
1987
+ L(I, !1), I.status = Fe.initial;
1988
+ }
1989
+ function $(I, z, J) {
1990
+ const K = z.dataType, re = z.editor || {
1991
+ type: s.get(K) || "input-group"
1992
+ };
1993
+ return !v.value && re.type === "text" && (re.type = "input-group"), re ? (re.type === "input-group" && (re.textAlign = z.align !== "center" && z.align !== "right" ? "left" : z.align, re.updateOn = "change"), re.type === "number-spinner" && (re.updateOn = "change"), re.type === "textarea" && (re.lineBreak = "alt enter"), re.context = {
1994
+ rowData: J.raw,
1995
+ column: z,
1996
+ cell: I,
1997
+ editor: S
1998
+ }, re.readonly = !1, F(On, {
1999
+ focusOnCreated: e.focusOnEditingCell,
2000
+ selectOnCreated: e.selectOnEditingCell,
2001
+ editor: re,
2002
+ modelValue: I.editingData,
2003
+ "onUpdate:modelValue": (ee) => I.editingData = ee,
2004
+ id: z.id,
2005
+ onMousedown: (ee) => B(ee),
2006
+ onMouseup: (ee) => Y(ee)
2007
+ }, null)) : I.data;
2008
+ }
2009
+ function A() {
2010
+ m(l);
2011
+ }
2012
+ Ne(() => e.editable, () => {
2013
+ r.value = e.editable;
2014
+ }), Ne(() => {
2015
+ var I;
2016
+ return (I = e.editOption) == null ? void 0 : I.editMode;
2017
+ }, (I) => {
2018
+ c.value.editMode = I;
2019
+ });
2020
+ function Q() {
2021
+ l = null, y = null, w = null, C = null, document.body.removeEventListener("click", p, !0);
2022
+ }
2023
+ return {
2024
+ clear: Q,
2025
+ onClickOutOfCell: p,
2026
+ onClickCell: h,
2027
+ onClickCellByKeyboard: E,
2028
+ onEditingRow: D,
2029
+ acceptEditingRow: x,
2030
+ cancelEditingRow: k,
2031
+ getEditingSnapshot: T,
2032
+ getEditor: $,
2033
+ endEditCell: A,
2034
+ onMousedownCell: B,
2035
+ onMouseupCell: Y
2036
+ };
2037
+ }
2038
+ function co(e) {
2039
+ const t = O(e.idField);
2040
+ function n(o) {
2041
+ if (o && o.length) {
2042
+ const i = o[0];
2043
+ Object.keys(i).includes(t.value) || (t.value = "__fv_indetify__");
2044
+ }
2045
+ }
2046
+ return { idField: t, reviseIdentifyField: n };
2047
+ }
2048
+ function uo(e, t, n, o) {
2049
+ const { idField: i } = o, {
2050
+ currentSelectedDataId: a,
2051
+ multiSelectOnClickRow: r,
2052
+ multiSelectOnClickRowWithShift: c,
2053
+ selectItem: v,
2054
+ selectedValues: f,
2055
+ toggleSelectItem: u,
2056
+ updateSelectAllStatus: s,
2057
+ enableSelectRow: l,
2058
+ multiSelectMode: y,
2059
+ isSingleSelect: d,
2060
+ getSelectedItems: w
2061
+ } = n, C = O(0), T = O(-1);
2062
+ function S(k) {
2063
+ a.value = k;
2064
+ }
2065
+ function b(k) {
2066
+ return k.raw[i.value] === a.value;
2067
+ }
2068
+ function g(k, $) {
2069
+ var ne;
2070
+ const A = $ ?? k.dataIndex, Q = {
2071
+ "fv-grid-row": k.type === Ie.data,
2072
+ "fv-grid-group-row": k.type === Ie.group,
2073
+ "fv-grid-summary-row": k.type === Ie.summary,
2074
+ "fv-grid-row-hover": A === T.value,
2075
+ "fv-grid-row-selected": b(k),
2076
+ "fv-grid-row-odd": A % 2 > 0,
2077
+ "fv-grid-row-even": A % 2 === 0,
2078
+ "fv-grid-disabled": k.disabled
2079
+ };
2080
+ if ((ne = e.rowOption) != null && ne.customRowStyle) {
2081
+ const I = e.rowOption.customRowStyle(k.raw) || {};
2082
+ return Object.assign({}, Q, I.class || {});
2083
+ }
2084
+ return Q;
2085
+ }
2086
+ function m(k, $) {
2087
+ var Q;
2088
+ const A = {
2089
+ "fv-grid-cell": !0
2090
+ };
2091
+ if ((Q = e.rowOption) != null && Q.customCellStyle) {
2092
+ const ne = e.rowOption.customCellStyle(k, $) || {};
2093
+ return Object.assign({}, A, ne.class || {});
2094
+ }
2095
+ return A;
2096
+ }
2097
+ function p(k, $) {
2098
+ var Q;
2099
+ const A = {
2100
+ "fv-grid-hierarchy-cell": !0
2101
+ };
2102
+ if ((Q = e.rowOption) != null && Q.customCellStyle) {
2103
+ const ne = e.rowOption.customCellStyle(k, $) || {};
2104
+ return Object.assign({}, A, ne.class || {});
2105
+ }
2106
+ return A;
2107
+ }
2108
+ function _(k) {
2109
+ const $ = a.value, A = k.raw[i.value];
2110
+ S(A), $ !== A && t.emit("selectionChange", [k.raw], { id: A, data: k.raw });
2111
+ }
2112
+ function E(k, $) {
2113
+ var ne, I;
2114
+ if (c.value && !($ != null && $.shiftKey) || d.value) {
2115
+ (ne = e.selection) != null && ne.keepSelectingOnClick ? v(k) : u(k, (I = e.selection) == null ? void 0 : I.keepSelectingOnClick), s();
2116
+ return;
2117
+ }
2118
+ if (c.value && ($ == null ? void 0 : $.shiftKey) || r.value) {
2119
+ u(k), s();
2120
+ return;
2121
+ }
2122
+ }
2123
+ function h(k, $) {
2124
+ $.disabled || (t.emit("clickRow", $.index, $.raw), _($), E($, k));
2125
+ }
2126
+ function B(k) {
2127
+ C.value += 1, setTimeout(() => {
2128
+ C.value === 1 && t.emit("clickRow", k.index, k.raw), C.value = 0;
2129
+ }, 250), C.value > 1 && (t.emit("doubleClickRow", k.index, k.raw), C.value = 0);
2130
+ }
2131
+ function Y(k, $) {
2132
+ $.disabled || (B($), _($), E($, k));
2133
+ }
2134
+ function M(k) {
2135
+ k.disabled || B(k);
2136
+ }
2137
+ function L(k, $) {
2138
+ }
2139
+ function D(k, $) {
2140
+ }
2141
+ function x(k, $) {
2142
+ var ne;
2143
+ const A = $ ?? k.dataIndex, Q = {
2144
+ "fv-grid-sidebar-row": !0,
2145
+ "fv-grid-sidebar-row-hover": A === T.value,
2146
+ "fv-grid-sidebar-row-selected": b(k),
2147
+ "fv-grid-sidebar-row-odd": A % 2 > 0,
2148
+ "fv-grid-sidebar-row-even": A % 2 === 0,
2149
+ "d-flex": !0,
2150
+ "align-items-center": !0
2151
+ };
2152
+ if ((ne = e.rowOption) != null && ne.customRowStyle) {
2153
+ const I = e.rowOption.customRowStyle(k.raw) || {};
2154
+ return Object.assign({}, Q, I.class || {});
2155
+ }
2156
+ return Q;
2157
+ }
2158
+ return {
2159
+ activeRowById: S,
2160
+ clickRowItem: M,
2161
+ selectRow: E,
2162
+ changeRow: _,
2163
+ gridCellClass: m,
2164
+ gridHierarchyCellClass: p,
2165
+ gridRowClass: g,
2166
+ onClickRow: Y,
2167
+ onClickRowExcludeDblclick: h,
2168
+ onMouseoverRow: L,
2169
+ sidebarRowClass: x,
2170
+ onMouseoutRow: D
2171
+ };
2172
+ }
2173
+ function fo(e, t, n, o, i) {
2174
+ const { idField: a } = n, { dataView: r, getSelectionItems: c } = t, v = O(""), f = W(() => e.selection.enableSelectRow), u = O(e.selection.multiSelect ?? !1), s = O(e.selection.multiSelectMode || "DependOnCheck"), l = O(e.selection.showCheckbox), y = O(e.selection.showSelectAll), d = O(e.selectionValues || []), w = W(() => e.selection.showSelection), C = W(() => {
2175
+ var N;
2176
+ return ((N = e.selection) == null ? void 0 : N.keepSelectingOnPaging) === void 0 ? !0 : e.selection.keepSelectingOnPaging;
2177
+ }), T = O(!!d.value.length && o.value.length === d.value.length), S = O(!!d.value.length && o.value.length !== d.value.length);
2178
+ Ne(() => e.selection.showSelectAll, (N, G) => {
2179
+ N !== G && (y.value = N);
2180
+ });
2181
+ function b() {
2182
+ if (!C.value) {
2183
+ const N = r.value.map((G) => G[a.value]);
2184
+ d.value = d.value.filter((G) => N.includes(G));
2185
+ }
2186
+ }
2187
+ function g() {
2188
+ const N = r.value.every((q) => d.value.includes(q[a.value])), G = r.value.every((q) => !d.value.includes(q[a.value]));
2189
+ N && (T.value = !0, S.value = !1), G && (T.value = !1, S.value = !1), !N && !G && (T.value = !1, S.value = !0);
2190
+ }
2191
+ function m() {
2192
+ return c(d.value);
2193
+ }
2194
+ function p() {
2195
+ const N = o.value.reduce((q, ge) => (q.set(ge.raw[a.value], ge), q), /* @__PURE__ */ new Map());
2196
+ return d.value.map((q) => N.get(q)).filter((q) => !!q);
2197
+ }
2198
+ function _(N) {
2199
+ var q;
2200
+ const G = N.raw.__fv_children_index__;
2201
+ if (G && G.length) {
2202
+ const ge = G.map((he) => r.value[he]);
2203
+ (q = d.value) != null && q.length && ge.some((Pe) => !d.value.includes(Pe[a.value])) && (N.indeterminate = !0, N.raw.__fv_indeterminate__ = !0);
2204
+ }
2205
+ }
2206
+ const E = W(() => f.value && u.value), h = W(
2207
+ () => f.value && !u.value && !l.value
2208
+ ), B = W(() => !!e.hierarchy), Y = W(() => {
2209
+ const N = l.value && s.value === "DependOnCheck";
2210
+ return E.value && N;
2211
+ }), M = W(() => E.value && !l.value), L = W(() => E.value && l.value && s.value === "OnCheckAndClick");
2212
+ W(() => L.value);
2213
+ function D() {
2214
+ const N = c(d.value);
2215
+ i.emit("selectionUpdate", N, d.value);
2216
+ }
2217
+ function x(N) {
2218
+ i.emit("unSelectItem", N);
2219
+ }
2220
+ function k(N) {
2221
+ i.emit("selectItem", N);
2222
+ }
2223
+ function $() {
2224
+ const N = o.value.filter((q) => q.indeterminate).map((q) => q.raw[a.value]);
2225
+ o.value.forEach((q) => {
2226
+ q.checked = !1, q.indeterminate = !1, q.raw.__fv_checked__ = !1, q.raw.__fv_indeterminate__ = !1;
2227
+ }), p().forEach((q) => {
2228
+ q.checked = !0, q.raw.__fv_checked__ = !0;
2229
+ }), N.forEach((q) => {
2230
+ const ge = o.value.find((he) => he.raw[a.value] === q);
2231
+ _(ge);
2232
+ });
2233
+ }
2234
+ Ne(() => o.value, () => {
2235
+ $();
2236
+ }), Ne(() => e.selectionValues, (N) => {
2237
+ d.value = N, $();
2238
+ }, { immediate: !0 }), Ne(() => e.selection, (N) => {
2239
+ u.value = !!N.multiSelect, s.value = N.multiSelectMode || "DependOnCheck", l.value = !!N.showCheckbox;
2240
+ });
2241
+ const A = W(() => !u.value);
2242
+ function Q(N) {
2243
+ return N.raw[a.value];
2244
+ }
2245
+ function ne(N) {
2246
+ return d.value.findIndex((q) => q === Q(N));
2247
+ }
2248
+ function I() {
2249
+ p().forEach((q) => {
2250
+ q.checked = !1;
2251
+ }), c(d.value).forEach((q) => {
2252
+ q.__fv_checked__ = !1;
2253
+ }), d.value = [], v.value = "", g();
2254
+ }
2255
+ function z(N) {
2256
+ const G = N;
2257
+ G.__fv_checked__ = !0, G.__fv_indeterminate__ = !1;
2258
+ const q = new Set(d.value);
2259
+ q.add(G[a.value]), d.value = Array.from(q.values()), b();
2260
+ }
2261
+ function J(N) {
2262
+ const G = N;
2263
+ G.__fv_checked__ = !1, G.__fv_indeterminate__ = !1, d.value = d.value.filter((q) => q !== G[a.value]), b();
2264
+ }
2265
+ function K(N) {
2266
+ const G = N.raw;
2267
+ G.__fv_checked__ = !0, G.__fv_indeterminate__ = !1;
2268
+ const q = new Set(d.value);
2269
+ q.add(G[a.value]), d.value = Array.from(q.values()), b(), N.checked = !0, N.indeterminate = !1, D(), k(N);
2270
+ }
2271
+ function re(N) {
2272
+ const G = N.raw;
2273
+ G.__fv_checked__ = !1, G.__fv_indeterminate__ = !1, d.value = d.value.filter((q) => q !== G[a.value]), b(), N.checked = !1, N.indeterminate = !1, D(), x(N);
2274
+ }
2275
+ function ee(N) {
2276
+ K(N), v.value = N.raw[a.value];
2277
+ }
2278
+ function P(N) {
2279
+ re(N), v.value = "";
2280
+ }
2281
+ function R(N) {
2282
+ N.__fv_checked__ = !1, N.__fv_indeterminate__ = !0, d.value = d.value.filter((G) => G !== N[a.value]), b();
2283
+ }
2284
+ function j(N) {
2285
+ const G = N.raw;
2286
+ G.__fv_checked__ = !1, G.__fv_indeterminate__ = !0, d.value = d.value.filter((q) => q !== G[a.value]), b(), N.checked = !1, N.indeterminate = !0;
2287
+ }
2288
+ function U(N) {
2289
+ A.value && I(), N.checked ? re(N) : K(N);
2290
+ }
2291
+ function Z(N, G = !0) {
2292
+ const q = N.checked;
2293
+ A.value && I(), G ? N.checked ? P(N) : ee(N) : q ? P(N) : ee(N);
2294
+ }
2295
+ function ae(N) {
2296
+ N.raw[a.value] !== v.value && (I(), ee(N));
2297
+ }
2298
+ function ie(N) {
2299
+ const G = o.value.find((q) => q.raw[a.value] === N);
2300
+ if (G)
2301
+ ae(G);
2302
+ else {
2303
+ const q = r.value.find((ge) => ge[a.value] === N);
2304
+ q && z(q);
2305
+ }
2306
+ }
2307
+ function te(N) {
2308
+ const G = o.value.filter((he) => N.includes(he.raw[a.value])), q = G.map((he) => he.raw[a.value]), ge = r.value.filter((he) => {
2309
+ const Pe = he[a.value];
2310
+ return !q.includes(Pe) && N.includes(Pe);
2311
+ });
2312
+ (G.length || ge.length) && h.value && (v.value = N[0]), G.forEach((he) => {
2313
+ ee(he);
2314
+ }), ge.forEach((he) => {
2315
+ z(he);
2316
+ });
2317
+ }
2318
+ function ue(N) {
2319
+ for (const G of N) {
2320
+ if (!d.value.includes(G))
2321
+ continue;
2322
+ const q = o.value.find((ge) => ge.raw[a.value] === G);
2323
+ if (q)
2324
+ P(q);
2325
+ else {
2326
+ const ge = r.value.find((he) => he[a.value] === G);
2327
+ ge && J(ge);
2328
+ }
2329
+ }
2330
+ d.value = d.value.filter(
2331
+ (G) => !N.includes(G)
2332
+ ), b();
2333
+ }
2334
+ function be() {
2335
+ o.value.forEach((N) => {
2336
+ const G = N.raw;
2337
+ G.__fv_checked__ = !0, G.__fv_indeterminate__ = !1;
2338
+ const q = new Set(d.value);
2339
+ q.add(G[a.value]), d.value = Array.from(q.values()), b(), N.checked = !0, N.indeterminate = !1;
2340
+ }), D();
2341
+ }
2342
+ function fe() {
2343
+ o.value.forEach((N) => {
2344
+ const G = N.raw;
2345
+ G.__fv_checked__ = !1, G.__fv_indeterminate__ = !1, d.value = d.value.filter((q) => q !== G[a.value]), b(), N.checked = !1, N.indeterminate = !1;
2346
+ }), D();
2347
+ }
2348
+ function Be() {
2349
+ return o.value.find((N) => N.raw[a.value] === v.value);
2350
+ }
2351
+ return {
2352
+ clearSelection: I,
2353
+ currentSelectedDataId: v,
2354
+ enableMultiSelect: u,
2355
+ enableSelectRow: f,
2356
+ findIndexInSelectedItems: ne,
2357
+ getSelectedItems: m,
2358
+ getSelectionRow: Be,
2359
+ indeterminate: j,
2360
+ indeterminateDataItem: R,
2361
+ isSelectingHirarchyItem: B,
2362
+ multiSelectMode: s,
2363
+ multiSelectOnClickRow: L,
2364
+ multiSelectOnClickRowWithShift: M,
2365
+ multiSelectOnlyOnCheck: Y,
2366
+ select: ee,
2367
+ selectAll: be,
2368
+ selectedValues: d,
2369
+ selectDataItem: z,
2370
+ selectItem: ae,
2371
+ selectItemById: ie,
2372
+ selectItemByIds: te,
2373
+ showCheckBox: l,
2374
+ showSelectAll: y,
2375
+ toggleSelectItem: Z,
2376
+ toggleSelectItemWithoutRow: U,
2377
+ unSelect: P,
2378
+ unSelectAll: fe,
2379
+ unSelectDataItem: J,
2380
+ unSelectItemByIds: ue,
2381
+ updateSelectAllStatus: g,
2382
+ selectAllStatus: T,
2383
+ indeterminateStatus: S,
2384
+ isSingleSelect: h,
2385
+ showSelection: w,
2386
+ keepSelectingOnPaging: C,
2387
+ emitSelectionChanged: D
2388
+ };
2389
+ }
2390
+ function it(e, t, n, o, i, a, r, c, v, f) {
2391
+ const u = O(e.size), s = O(e.textField), l = O(e.titleField), y = O(e.disableField), d = W(() => {
2392
+ var h, B;
2393
+ return ((h = e.selection) == null ? void 0 : h.multiSelect) && ((B = e.selection) == null ? void 0 : B.showCheckbox);
2394
+ }), {
2395
+ onMouseenterItem: w,
2396
+ onMouseoverItem: C,
2397
+ onMouseoutItem: T
2398
+ } = a, {
2399
+ getKey: S,
2400
+ listViewItemClass: b,
2401
+ listViewItemStyle: g,
2402
+ onCheckItem: m,
2403
+ onClickItem: p
2404
+ } = r, _ = W(() => {
2405
+ const h = {
2406
+ "text-overflow": "ellipsis",
2407
+ overflow: "hidden",
2408
+ "white-space": "nowrap"
2409
+ };
2410
+ return e.itemClass ? h : {
2411
+ margin: u.value === "small" ? "0.25rem 0" : "8px 0",
2412
+ ...h
2413
+ };
2414
+ });
2415
+ function E(h, B, Y) {
2416
+ return h.checked = c.findIndexInSelectedItems(h) > -1, F("li", {
2417
+ class: b(h, B),
2418
+ id: S(h, B),
2419
+ key: S(h, B),
2420
+ style: g(h, B),
2421
+ onClick: (M) => p(h, B, M),
2422
+ onMouseenter: (M) => w(M, h, B),
2423
+ onMouseover: (M) => C(M, h, B),
2424
+ onMouseout: (M) => T(M, h, B)
2425
+ }, [d.value && F("div", {
2426
+ class: "f-list-select",
2427
+ onClick: (M) => M.stopPropagation()
2428
+ }, [F(Qe, {
2429
+ id: "list-" + S(h, B),
2430
+ customClass: "listview-checkbox float-left",
2431
+ disabled: h[y.value],
2432
+ checked: h.checked,
2433
+ "onUpdate:checked": (M) => h.checked = M,
2434
+ onChange: (M) => {
2435
+ m(h, B, !M.checked);
2436
+ }
2437
+ }, null)]), F("div", {
2438
+ class: "f-list-content"
2439
+ }, [F("div", {
2440
+ class: e.itemContentClass,
2441
+ style: _.value,
2442
+ title: h.raw[l.value] || h.raw[s.value]
2443
+ }, [h.raw[s.value]])])]);
2444
+ }
2445
+ return {
2446
+ renderItem: E
2447
+ };
2448
+ }
2449
+ function mo(e, t, n, o, i, a, r, c, v, f) {
2450
+ const u = O(e.multiSelect), s = O(e.disableField), l = O(e.textField), {
2451
+ onMouseenterItem: y,
2452
+ onMouseoverItem: d,
2453
+ onMouseoutItem: w
2454
+ } = a, {
2455
+ getKey: C,
2456
+ listViewItemClass: T,
2457
+ listViewItemStyle: S,
2458
+ onCheckItem: b,
2459
+ onClickItem: g
2460
+ } = r;
2461
+ function m(_, E, h) {
2462
+ return e.contentTemplate ? F(De, null, [e.contentTemplate({
2463
+ item: _.raw,
2464
+ index: E,
2465
+ selectedItem: h
2466
+ })]) : t.slots.content ? F(De, null, [t.slots.content && t.slots.content({
2467
+ item: _.raw,
2468
+ index: E,
2469
+ selectedItem: h
2470
+ })]) : F("div", {
2471
+ style: "margin: 10px 0;"
2472
+ }, [_.raw[l.value || "name"]]);
2473
+ }
2474
+ function p(_, E, h) {
2475
+ return F("li", {
2476
+ class: T(_, E),
2477
+ id: C(_, E),
2478
+ key: C(_, E),
2479
+ style: S(_, E),
2480
+ onClick: (B) => g(_, E, B),
2481
+ onMouseenter: (B) => y(B, _, E),
2482
+ onMouseover: (B) => d(B, _, E),
2483
+ onMouseout: (B) => w(B, _, E)
2484
+ }, [u.value && F("div", {
2485
+ class: "f-list-select",
2486
+ onClick: (B) => B.stopPropagation()
2487
+ }, [F(Qe, {
2488
+ id: "list-" + C(_, E),
2489
+ customClass: "listview-checkbox",
2490
+ disabled: _[s.value] || !_.checked,
2491
+ checked: _.checked,
2492
+ "onUpdate:checked": (B) => _.checked = B,
2493
+ onChange: (B) => b(_, E, !B.checked)
2494
+ }, null)]), F("div", {
2495
+ class: "f-list-content"
2496
+ }, [m(_, E, h)])]);
2497
+ }
2498
+ return {
2499
+ renderItem: p
2500
+ };
2501
+ }
2502
+ function vo(e, t, n, o, i, a, r, c, v, f) {
2503
+ const u = O(e.multiSelect), s = O(e.disableField), l = O(e.textField), {
2504
+ onMouseenterItem: y,
2505
+ onMouseoverItem: d,
2506
+ onMouseoutItem: w
2507
+ } = a, {
2508
+ getKey: C,
2509
+ listViewItemClass: T,
2510
+ onCheckItem: S,
2511
+ onClickItem: b
2512
+ } = r, {
2513
+ dragstart: g,
2514
+ dragenter: m,
2515
+ dragover: p,
2516
+ dragend: _
2517
+ } = o, {
2518
+ removeItem: E
2519
+ } = v, h = W(() => ({
2520
+ margin: u.value ? "10px 0" : "10px 0px 10px 14px"
2521
+ }));
2522
+ function B(x, k = "") {
2523
+ const $ = x.target;
2524
+ $.title = $.scrollWidth > $.clientWidth ? k : "";
2525
+ }
2526
+ function Y(x) {
2527
+ return F("div", {
2528
+ style: h.value,
2529
+ onMouseenter: (k) => B(k, x.raw[l.value || "name"])
2530
+ }, [x.raw[l.value || "name"]]);
2531
+ }
2532
+ function M() {
2533
+ return t.slots.itemContent ? t.slots.itemContent : Y;
2534
+ }
2535
+ const L = M();
2536
+ function D(x, k, $) {
2537
+ return F("li", {
2538
+ class: T(x, k),
2539
+ id: C(x, k),
2540
+ key: C(x, k),
2541
+ onClick: (A) => b(x, k, A),
2542
+ onMouseenter: (A) => y(A, x, k),
2543
+ onMouseover: (A) => d(A, x, k),
2544
+ onMouseout: (A) => w(A, x, k),
2545
+ draggable: "true",
2546
+ onDragstart: (A) => g(A, x, k),
2547
+ onDragenter: (A) => m(A, k),
2548
+ onDragend: (A) => _(A, x),
2549
+ onDragover: (A) => p(A)
2550
+ }, [u.value && F("div", {
2551
+ class: "f-list-select",
2552
+ onClick: (A) => A.stopPropagation()
2553
+ }, [F(Qe, {
2554
+ id: "list-" + C(x, k),
2555
+ customClass: "listview-checkbox",
2556
+ disabled: x[s.value] || !x.checked,
2557
+ checked: x.checked,
2558
+ "onUpdate:checked": (A) => x.checked = A,
2559
+ onChange: (A) => S(x, k, !A.checked)
2560
+ }, null)]), F("div", {
2561
+ class: "f-list-content"
2562
+ }, [L(x)]), F("div", {
2563
+ class: "f-list-remove",
2564
+ onClick: (A) => {
2565
+ A.stopPropagation(), E(k);
2566
+ }
2567
+ }, [F("div", {
2568
+ class: "f-list-remove-icon"
2569
+ }, [F("i", {
2570
+ class: "f-icon f-icon-remove_face"
2571
+ }, null)])]), F("div", {
2572
+ class: "f-list-handle"
2573
+ }, [F("div", null, [F("i", {
2574
+ class: "f-icon f-icon-drag-vertical"
2575
+ }, null)])])]);
2576
+ }
2577
+ return {
2578
+ renderItem: D
2579
+ };
2580
+ }
2581
+ function po(e, t, n, o, i, a, r, c, v, f) {
2582
+ var C;
2583
+ const u = O(((C = e.group) == null ? void 0 : C.groupFields) || []), {
2584
+ collpaseGroupIconClass: s
2585
+ } = i, {
2586
+ toggleGroupRow: l
2587
+ } = f;
2588
+ function y(T, S) {
2589
+ S.collapse = !S.collapse, n.value = l(S.collapse ? "collapse" : "expand", S, n.value);
2590
+ }
2591
+ function d(T, S, b) {
2592
+ return t.slots.group ? F(De, null, [t.slots.content && t.slots.group({
2593
+ item: T.raw,
2594
+ index: S,
2595
+ selectedItem: b
2596
+ })]) : F("div", {
2597
+ class: "f-navlookup-recentHeader",
2598
+ onClick: (g) => y(g, T)
2599
+ }, [F("div", {
2600
+ class: "fv-grid-group-row-icon"
2601
+ }, [F("span", {
2602
+ class: s(T)
2603
+ }, null)]), F("div", {
2604
+ class: "f-navlookup-recommandLabel"
2605
+ }, [T.raw[u.value[T.layer]]])]);
2606
+ }
2607
+ function w(T, S, b) {
2608
+ return T.layer > -1 && d(T, S, b);
2609
+ }
2610
+ return {
2611
+ renderItem: w
2612
+ };
2613
+ }
2614
+ function go(e, t, n, o) {
2615
+ const { dataView: i } = n, { updateSelectedItems: a } = o;
2616
+ function r(c) {
2617
+ if (c > -1 && c < i.value.length) {
2618
+ if (e != null && e.checkBeforeRemoveItem && !e.checkBeforeRemoveItem(i.value[c]))
2619
+ return;
2620
+ const v = i.value.splice(c, 1);
2621
+ a(), t.emit("removeItem", v[0]);
2622
+ }
2623
+ }
2624
+ return { removeItem: r };
2625
+ }
2626
+ function ho(e, t, n, o, i, a, r, c, v, f) {
2627
+ const {
2628
+ t: u
2629
+ } = je(), s = O(e.view), l = O(e.view === "CardView"), y = O({}), d = O(u("listView.emptyMessage")), w = go(e, t, o, v), C = W(() => ({
2630
+ "f-list-view-group": !0,
2631
+ "f-list-view-group-multiselect": e.multiSelect,
2632
+ "d-flex": l.value,
2633
+ "flex-wrap": l.value
2634
+ })), T = W(() => !!n.value && n.value.length > 0), S = W(() => n.value.length === 0);
2635
+ W(() => S.value && !t.slots.empty);
2636
+ function b() {
2637
+ return s.value === "SingleView" ? it : s.value === "DraggableView" ? vo : (s.value === "ContentView" || s.value === "CardView") && (e.contentTemplate || t.slots.content) ? mo : it;
2638
+ }
2639
+ const g = b(), {
2640
+ renderItem: m
2641
+ } = g(e, t, n, f, i, a, v, r, w, c), {
2642
+ renderItem: p
2643
+ } = po(e, t, n, f, i, a, v, r, w, c), _ = [m, p];
2644
+ function E() {
2645
+ return n.value.filter((Y) => Y.visible !== !1).map((Y, M) => _[Y.type](Y, M, y));
2646
+ }
2647
+ function h() {
2648
+ return F("div", {
2649
+ class: "f-list-view-emptydata",
2650
+ style: "margin: 0 auto;"
2651
+ }, [F("p", {
2652
+ class: "f-empty-title"
2653
+ }, [e.emptyTemplate ? e.emptyTemplate() : t.slots.empty ? t.slots.empty() : d.value])]);
2654
+ }
2655
+ function B() {
2656
+ return F("ul", {
2657
+ class: C.value,
2658
+ style: "list-style: none;"
2659
+ }, [T.value && E(), S.value && h()]);
2660
+ }
2661
+ return {
2662
+ renderListArea: B
2663
+ };
2664
+ }
2665
+ function _o(e, t, n) {
2666
+ function o() {
2667
+ return t.slots.header && F("div", {
2668
+ class: "f-list-view-header"
2669
+ }, [t.slots.header()]);
2670
+ }
2671
+ return {
2672
+ renderHeader: o
2673
+ };
2674
+ }
2675
+ function at(e, t, n) {
2676
+ const o = O(e.headerClass), i = O(e.placeholder), a = O(""), r = W(() => !a.value), c = W(() => !!a.value);
2677
+ function v(l) {
2678
+ a.value = "";
2679
+ }
2680
+ Ne(a, (l) => {
2681
+ e.enableHighlightSearch && n.search(l), t.emit("afterSearch", l);
2682
+ });
2683
+ const f = W(() => {
2684
+ const l = {
2685
+ "form-group": !0,
2686
+ "farris-form-group": !0
2687
+ };
2688
+ return o.value && o.value.split(" ").reduce((d, w) => (d[w] = !0, d), l), l;
2689
+ });
2690
+ function u(l) {
2691
+ }
2692
+ function s() {
2693
+ return F("div", {
2694
+ class: "f-list-view-header",
2695
+ onClick: hn(() => u, ["prevent", "stop"])
2696
+ }, [F("div", {
2697
+ class: f.value
2698
+ }, [F("div", {
2699
+ class: "farris-input-wrap"
2700
+ }, [F("div", {
2701
+ class: "f-cmp-inputgroup"
2702
+ }, [F("div", {
2703
+ class: "input-group f-state-editable"
2704
+ }, [_n(F("input", {
2705
+ class: "form-control f-utils-fill text-left",
2706
+ "onUpdate:modelValue": (l) => a.value = l,
2707
+ name: "input-group-value",
2708
+ type: "text",
2709
+ placeholder: i.value,
2710
+ autocomplete: "off"
2711
+ }, null), [[yn, a.value]]), F("div", {
2712
+ class: "input-group-append"
2713
+ }, [c.value && F("span", {
2714
+ class: "input-group-text input-group-clear",
2715
+ onClick: (l) => v()
2716
+ }, [F("i", {
2717
+ class: "f-icon f-icon-close-circle"
2718
+ }, null)]), r.value && F("span", {
2719
+ class: "input-group-text"
2720
+ }, [F("span", {
2721
+ class: "f-icon f-icon-search"
2722
+ }, null)])])])])])])]);
2723
+ }
2724
+ return {
2725
+ renderHeader: s
2726
+ };
2727
+ }
2728
+ function yo() {
2729
+ const e = O(""), t = O(-1), n = O(""), o = O(-1), i = O(!1);
2730
+ function a(s, l, y) {
2731
+ o.value = y;
2732
+ }
2733
+ function r(s, l, y) {
2734
+ i.value || (o.value = y);
2735
+ }
2736
+ function c(s, l, y) {
2737
+ o.value = -1;
2738
+ }
2739
+ function v() {
2740
+ i.value = !0;
2741
+ }
2742
+ function f() {
2743
+ i.value = !1;
2744
+ }
2745
+ function u() {
2746
+ t.value = -1, e.value = "";
2747
+ }
2748
+ return {
2749
+ activeIndex: t,
2750
+ focusedItemId: n,
2751
+ hoverIndex: o,
2752
+ clearActiveItem: u,
2753
+ onMouseenterItem: a,
2754
+ onMouseoverItem: r,
2755
+ onMouseoutItem: c,
2756
+ resumeHover: f,
2757
+ suspendHover: v
2758
+ };
2759
+ }
2760
+ function bo(e, t, n, o) {
2761
+ const i = O(e.idField), { dataView: a } = n, r = O(-1), c = O(!1), { activeIndex: v, focusedItemId: f, hoverIndex: u, resumeHover: s, suspendHover: l } = o;
2762
+ let y, d = 0, w = 0;
2763
+ function C(p, _) {
2764
+ const E = p - d, h = _ - w;
2765
+ y.style.left = parseInt(y.style.left) + E + "px", y.style.top = parseInt(y.style.top) + h + "px", d = p, w = _;
2766
+ }
2767
+ function T(p) {
2768
+ const { left: _, top: E } = p.getBoundingClientRect(), h = p.cloneNode(!0);
2769
+ return h.style.cssText = `
2770
+ position:absolute;
2771
+ left:${_}px;
2772
+ top:${document.documentElement.scrollTop ? E + document.documentElement.scrollTop : E}px;
2773
+ z-index: 999999;
2774
+ border: 1px solid #e2e3e5;
2775
+ pointer-events: none;
2776
+ background-color: #edf5ff;
2777
+ border-radius: 10px;
2778
+ margin: 4px 2px;
2779
+ display: flex;
2780
+ align-items: center;
2781
+ float: none;
2782
+ text-align: initial;
2783
+ width:${getComputedStyle(p).width};
2784
+ height:${getComputedStyle(p).height};
2785
+ `, h.children[0].style.cssText = "overflow: hidden;flex: 1 1 auto;width: 100%;", h.children[0].children[0].style.cssText = `
2786
+ margin: 10px 0px 10px 14px;
2787
+ overflow: hidden;text-overflow: ellipsis;white-space: nowrap;
2788
+ `, h.children[1].style.cssText = "width: 30px;color: #f4625f;padding: 0 14px 0 0", h.children[2].style.cssText = "padding: 0 14px 0 0;", document.body.appendChild(h), h;
2789
+ }
2790
+ function S(p, _, E) {
2791
+ if (p.stopPropagation(), l(), _) {
2792
+ if (y = T(p.target), p.dataTransfer) {
2793
+ const h = new Image();
2794
+ h.src = "", p.dataTransfer.setDragImage(h, 0, 0);
2795
+ }
2796
+ d = p.pageX, w = p.pageY, setTimeout(() => {
2797
+ r.value = E, c.value = !0, _.moving = !0;
2798
+ });
2799
+ }
2800
+ }
2801
+ function b(p, _) {
2802
+ if (p.preventDefault(), r.value !== _) {
2803
+ const E = a.value[r.value], h = a.value;
2804
+ h.splice(r.value, 1), h.splice(_, 0, E), r.value = _, C(p.pageX, p.pageY);
2805
+ }
2806
+ }
2807
+ function g(p) {
2808
+ p.preventDefault(), p.dataTransfer && (p.dataTransfer.dropEffect = "move"), C(p.pageX, p.pageY);
2809
+ }
2810
+ function m(p, _) {
2811
+ _ && (_.moving = !1, y && (document.body.removeChild(y), y = null)), a.value.forEach((E, h) => {
2812
+ E.__fv_index__ = h;
2813
+ }), c.value = !1, s(), u.value = _.raw.__fv_index__, v.value = _.raw.__fv_index__, f.value = _.raw[i.value], t.emit("change", a.value), t.emit("activeChange", [_.raw]);
2814
+ }
2815
+ return {
2816
+ dragstart: S,
2817
+ dragenter: b,
2818
+ dragover: g,
2819
+ dragend: m,
2820
+ isDragging: c
2821
+ };
2822
+ }
2823
+ function wo(e, t, n, o, i, a) {
2824
+ const r = O(e.idField), c = O(e.disableField), v = O(e.draggable);
2825
+ O(e.itemClass);
2826
+ const f = O(e.selection.multiSelect ?? !1), u = O(e.selection.multiSelectMode), { isDragging: s } = o, { activeIndex: l, focusedItemId: y, hoverIndex: d } = i, { clearSelection: w, getSelectedItems: C, toggleSelectItem: T, currentSelectedDataId: S } = a, b = O(C()), g = (D) => b.value.length === 0 ? !1 : b.value.some((x) => {
2827
+ let k = "";
2828
+ return x.data ? k = x.data[r.value] : k = x[r.value], k === D;
2829
+ });
2830
+ function m() {
2831
+ b.value = C();
2832
+ }
2833
+ function p(D, x) {
2834
+ return D.raw[r.value] != null ? D.raw[r.value] : "";
2835
+ }
2836
+ function _(D, x) {
2837
+ const k = {
2838
+ "f-list-view-group-item": !0,
2839
+ "f-list-view-draggable-item": v.value,
2840
+ "f-un-click": !D.checked,
2841
+ "f-un-select": !!D.raw[c.value],
2842
+ "f-listview-active": (
2843
+ // 多选
2844
+ f.value && g(p(D)) || // 单选
2845
+ !f.value && D.raw[r.value] === S.value
2846
+ ),
2847
+ "f-listview-hover": !s.value && x === d.value,
2848
+ moving: !!D.moving
2849
+ };
2850
+ if (typeof e.itemClass == "string")
2851
+ return Ke(k, e.itemClass);
2852
+ if (typeof e.itemClass == "function") {
2853
+ const $ = e.itemClass(D);
2854
+ return Ke(k, $);
2855
+ }
2856
+ return k;
2857
+ }
2858
+ function E(D, x) {
2859
+ const k = (
2860
+ // 多选
2861
+ f.value && g(p(D)) || // 单选
2862
+ !f.value && D.raw[r.value] === S.value
2863
+ ), $ = {};
2864
+ if (k && ($.backgroundColor = "#dae9ff"), typeof e.itemStyle == "string")
2865
+ return et($, e.itemStyle);
2866
+ if (typeof e.itemStyle == "function") {
2867
+ const A = e.itemStyle(D);
2868
+ return et($, A);
2869
+ }
2870
+ return $;
2871
+ }
2872
+ const h = W(() => !f.value);
2873
+ function B(D, x, k) {
2874
+ D.checked = k, !D.raw[c.value] && (h.value && (y.value = D.raw[r.value]), T(D));
2875
+ }
2876
+ const Y = W(() => f.value && u.value === "OnCheckClearByClick"), M = W(() => !f.value || f.value && (u.value === "OnCheckAndClick" || u.value === "OnClick"));
2877
+ function L(D, x, k) {
2878
+ if (D.raw[c.value]) {
2879
+ k == null || k.preventDefault(), k == null || k.stopPropagation();
2880
+ return;
2881
+ }
2882
+ y.value = D.raw[r.value], l.value = x, Y.value && w(), M.value && (T(D), m()), t.emit("clickItem", { data: b.value, index: x, dataItem: D.raw }), t.emit("activeChange", b.value);
2883
+ }
2884
+ return {
2885
+ getKey: p,
2886
+ selectedItems: b,
2887
+ listViewItemClass: _,
2888
+ listViewItemStyle: E,
2889
+ updateSelectedItems: m,
2890
+ onCheckItem: B,
2891
+ onClickItem: L
2892
+ };
2893
+ }
2894
+ function vt(e, t) {
2895
+ let n;
2896
+ function o(s) {
2897
+ const { properties: l, title: y, ignore: d } = s, w = d && Array.isArray(d), C = Object.keys(l).reduce((T, S) => ((!w || !d.find((b) => b === S)) && (T[S] = l[S].type === "object" && l[S].properties ? o(l[S]) : Ae(l[S].default)), T), {});
2898
+ if (y && (!w || !d.find((T) => T === "id"))) {
2899
+ const T = y.toLowerCase().replace(/-/g, "_");
2900
+ C.id = `${T}_${Math.random().toString().slice(2, 6)}`;
2901
+ }
2902
+ return C;
2903
+ }
2904
+ function i(s) {
2905
+ const { properties: l, title: y, required: d } = s;
2906
+ if (d && Array.isArray(d)) {
2907
+ const w = d.reduce((C, T) => (C[T] = l[T].type === "object" && l[T].properties ? o(l[T]) : Ae(l[T].default), C), {});
2908
+ if (y && d.find((C) => C === "id")) {
2909
+ const C = y.toLowerCase().replace(/-/g, "_");
2910
+ w.id = `${C}_${Math.random().toString().slice(2, 6)}`;
2911
+ }
2912
+ return w;
2913
+ }
2914
+ return {
2915
+ type: y
2916
+ };
2917
+ }
2918
+ function a(s, l = {}, y) {
2919
+ const d = e[s];
2920
+ if (d) {
2921
+ let w = i(d);
2922
+ const C = t[s];
2923
+ return w = C ? C({ getSchemaByType: a }, w, l, y) : w, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(w), w;
2924
+ }
2925
+ return null;
2926
+ }
2927
+ function r(s, l) {
2928
+ const y = o(l);
2929
+ return Object.keys(y).reduce((d, w) => (Object.prototype.hasOwnProperty.call(s, w) && (d[w] && nt(d[w]) && nt(s[w] || !s[w]) ? Object.assign(d[w], s[w] || {}) : d[w] = s[w]), d), y), y;
2930
+ }
2931
+ function c(s, l) {
2932
+ return Object.keys(s).filter((d) => s[d] != null).reduce((d, w) => {
2933
+ if (l.has(w)) {
2934
+ const C = l.get(w);
2935
+ if (typeof C == "string")
2936
+ d[C] = s[w];
2937
+ else {
2938
+ const T = C(w, s[w], s);
2939
+ Object.assign(d, T);
2940
+ }
2941
+ } else
2942
+ d[w] = s[w];
2943
+ return d;
2944
+ }, {});
2945
+ }
2946
+ function v(s, l, y = /* @__PURE__ */ new Map()) {
2947
+ const d = r(s, l);
2948
+ return c(d, y);
2949
+ }
2950
+ function f(s) {
2951
+ var y;
2952
+ const l = s.type;
2953
+ if (l) {
2954
+ const d = e[l];
2955
+ if (!d)
2956
+ return s;
2957
+ const w = r(s, d), C = ((y = s.editor) == null ? void 0 : y.type) || "";
2958
+ if (C) {
2959
+ const T = e[C], S = r(s.editor, T);
2960
+ w.editor = S;
2961
+ }
2962
+ return w;
2963
+ }
2964
+ return s;
2965
+ }
2966
+ function u(s) {
2967
+ n = s;
2968
+ }
2969
+ return { getSchemaByType: a, resolveSchemaWithDefaultValue: f, resolveSchemaToProps: v, mappingSchemaToProps: c, setDesignerContext: u };
2970
+ }
2971
+ const pt = {}, gt = {}, { getSchemaByType: Qr, resolveSchemaWithDefaultValue: Co, resolveSchemaToProps: So, mappingSchemaToProps: To, setDesignerContext: Zr } = vt(pt, gt);
2972
+ function Eo(e = {}) {
2973
+ function t(f, u, s, l) {
2974
+ if (typeof s == "number")
2975
+ return l[f].length === s;
2976
+ if (typeof s == "object") {
2977
+ const y = Object.keys(s)[0], d = s[y];
2978
+ if (y === "not")
2979
+ return Number(l[f].length) !== Number(d);
2980
+ if (y === "moreThan")
2981
+ return Number(l[f].length) >= Number(d);
2982
+ if (y === "lessThan")
2983
+ return Number(l[f].length) <= Number(d);
2984
+ }
2985
+ return !1;
2986
+ }
2987
+ function n(f, u, s, l) {
2988
+ return l[f] && l[f].propertyValue && String(l[f].propertyValue.value) === String(s);
2989
+ }
2990
+ const o = /* @__PURE__ */ new Map([
2991
+ ["length", t],
2992
+ ["getProperty", n]
2993
+ ]);
2994
+ Object.keys(e).reduce((f, u) => (f.set(u, e[u]), f), o);
2995
+ function i(f, u) {
2996
+ const s = f;
2997
+ return typeof u == "number" ? [{ target: s, operator: "length", param: null, value: Number(u) }] : typeof u == "boolean" ? [{ target: s, operator: "getProperty", param: f, value: !!u }] : typeof u == "object" ? Object.keys(u).map((l) => {
2998
+ if (l === "length")
2999
+ return { target: s, operator: "length", param: null, value: u[l] };
3000
+ const y = l, d = u[l];
3001
+ return { target: s, operator: "getProperty", param: y, value: d };
3002
+ }) : [];
3003
+ }
3004
+ function a(f) {
3005
+ return Object.keys(f).reduce((s, l) => {
3006
+ const y = i(l, f[l]);
3007
+ return s.push(...y), s;
3008
+ }, []);
3009
+ }
3010
+ function r(f, u) {
3011
+ if (o.has(f.operator)) {
3012
+ const s = o.get(f.operator);
3013
+ return s && s(f.target, f.param, f.value, u) || !1;
3014
+ }
3015
+ return !1;
3016
+ }
3017
+ function c(f, u) {
3018
+ return a(f).reduce((y, d) => y && r(d, u), !0);
3019
+ }
3020
+ function v(f, u) {
3021
+ const s = Object.keys(f), l = s.includes("allOf"), y = s.includes("anyOf"), d = l || y, T = (d ? f[d ? l ? "allOf" : "anyOf" : "allOf"] : [f]).map((b) => c(b, u));
3022
+ return l ? !T.includes(!1) : T.includes(!0);
3023
+ }
3024
+ return { parseValueSchema: v };
3025
+ }
3026
+ const ko = {
3027
+ convertTo: (e, t, n, o) => {
3028
+ e.appearance || (e.appearance = {}), e.appearance[t] = n;
3029
+ },
3030
+ convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
3031
+ }, Fo = {
3032
+ convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
3033
+ }, Mo = {
3034
+ convertTo: (e, t, n, o) => {
3035
+ e.editor && (e.editor[t] = n);
3036
+ },
3037
+ convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
3038
+ }, No = {
3039
+ convertFrom: (e, t, n) => {
3040
+ var i;
3041
+ const o = e.editor && e.editor[t] ? e.editor[t] : e[t];
3042
+ return ((i = Oe[o]) == null ? void 0 : i.name) || o;
3043
+ }
3044
+ }, Vo = {
3045
+ convertTo: (e, t, n, o) => {
3046
+ e[t] = e[t];
3047
+ },
3048
+ convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
3049
+ }, xo = {
3050
+ convertTo: (e, t, n, o) => {
3051
+ (e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = {
3052
+ [t]: n
3053
+ });
3054
+ },
3055
+ convertFrom: (e, t, n) => {
3056
+ if (e.formatter) {
3057
+ if (t === "trueText")
3058
+ return e.formatter.trueText;
3059
+ if (t === "falseText")
3060
+ return e.formatter.falseText;
3061
+ if (t === "prefix")
3062
+ return e.formatter.prefix;
3063
+ if (t === "suffix")
3064
+ return e.formatter.suffix;
3065
+ if (t === "precision")
3066
+ return e.formatter.precision;
3067
+ if (t === "decimal")
3068
+ return e.formatter.decimal;
3069
+ if (t === "thousand")
3070
+ return e.formatter.thousand;
3071
+ if (t === "dateFormat")
3072
+ return e.formatter.dateFormat || "yyyy-MM-dd";
3073
+ if (t === "customFormat")
3074
+ return e.formatter.customFormat;
3075
+ if (t === "type")
3076
+ return e.formatter.type || "none";
3077
+ }
3078
+ return "none";
3079
+ }
3080
+ }, Oo = {
3081
+ convertTo: (e, t, n, o) => {
3082
+ e.command ? e.command[t] = n : e.command = {
3083
+ [t]: n
3084
+ }, t === "enable" && n && (e.command.commands || (e.command.commands = [
3085
+ {
3086
+ text: "编辑",
3087
+ type: "primary",
3088
+ command: "edit"
3089
+ },
3090
+ {
3091
+ text: "删除",
3092
+ type: "danger",
3093
+ command: "remove"
3094
+ }
3095
+ ]));
3096
+ },
3097
+ convertFrom: (e, t, n) => e.command && t === "enable" ? e.command.enable : ""
3098
+ }, Io = {
3099
+ convertTo: (e, t, n, o) => {
3100
+ e.column ? e.column[t] = n : e.column = {
3101
+ [t]: n
3102
+ }, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average"));
3103
+ },
3104
+ convertFrom: (e, t, n) => {
3105
+ if (e.column) {
3106
+ if (t === "fitColumns")
3107
+ return e.column.fitColumns;
3108
+ if (t === "fitMode")
3109
+ return e.column.fitMode;
3110
+ }
3111
+ return "";
3112
+ }
3113
+ }, Do = {
3114
+ convertTo: (e, t, n, o) => {
3115
+ e.summary ? e.summary[t] = n : e.summary = {
3116
+ [t]: n
3117
+ }, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
3118
+ enable: n,
3119
+ groupFields: []
3120
+ });
3121
+ },
3122
+ convertFrom: (e, t, n) => e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : ""
3123
+ }, Po = {
3124
+ convertTo: (e, t, n, o) => {
3125
+ e.group ? e.group[t] = n : e.group = {
3126
+ [t]: n
3127
+ }, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
3128
+ enable: n,
3129
+ groupFields: [],
3130
+ showSummary: !1
3131
+ });
3132
+ },
3133
+ convertFrom: (e, t, n) => {
3134
+ if (e.group) {
3135
+ if (t === "enable")
3136
+ return e.group.enable;
3137
+ if (t === "showSummary")
3138
+ return e.group.showSummary;
3139
+ }
3140
+ }
3141
+ }, Bo = {
3142
+ convertFrom: (e, t) => e.binding ? e.binding.path : "",
3143
+ convertTo: (e, t, n) => {
3144
+ if (n && n.length > 0) {
3145
+ const o = n[0];
3146
+ e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = o.bindingField, e.binding.field = o.id, e.binding.fullPath = o.path, e.path = o.bindingPath;
3147
+ }
3148
+ }
3149
+ }, Ro = {
3150
+ convertTo: (e, t, n, o) => {
3151
+ e.pagination || (e.pagination = {}), e.pagination[t] = n;
3152
+ },
3153
+ convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t]
3154
+ }, Ao = {
3155
+ convertTo: (e, t, n, o) => {
3156
+ e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
3157
+ },
3158
+ convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
3159
+ }, $o = {
3160
+ convertTo: (e, t, n, o) => {
3161
+ e.selection || (e.selection = {}), e.selection[t] = n;
3162
+ },
3163
+ convertFrom: (e, t, n) => {
3164
+ var o, i;
3165
+ return t === "showCheckbox" ? (o = e.selection) != null && o.multiSelect ? !0 : (i = e.selection) == null ? void 0 : i.showCheckbox : e.selection ? e.selection[t] : e[t];
3166
+ }
3167
+ }, Lo = {
3168
+ convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
3169
+ }, jo = {
3170
+ convertFrom: (e, t) => e[t] || "",
3171
+ convertTo: (e, t, n) => {
3172
+ e[t] = n;
3173
+ }
3174
+ }, Ho = {
3175
+ convertTo: (e, t, n, o) => {
3176
+ e.size || (e.size = {}), e.size[t] = n;
3177
+ },
3178
+ convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
3179
+ }, Uo = {
3180
+ convertFrom: (e, t, n) => {
3181
+ var o, i;
3182
+ return (o = e.formatter) != null && o.data && t === "formatterEnumData" && !e.formatterEnumData ? (i = e.formatter) == null ? void 0 : i.data : e.formatterEnumData;
3183
+ }
3184
+ }, Go = {
3185
+ convertTo: (e, t, n, o) => {
3186
+ e.sort || (e.sort = {}), e.sort[t] = n;
3187
+ },
3188
+ convertFrom: (e, t, n) => {
3189
+ var o, i;
3190
+ if (t === "mode")
3191
+ return ((o = e.sort) == null ? void 0 : o.mode) || "client";
3192
+ if (t === "multiSort")
3193
+ return !!((i = e.sort) != null && i.multiSort);
3194
+ }
3195
+ }, qo = {
3196
+ convertTo: (e, t, n, o) => {
3197
+ e.filter || (e.filter = {}), e.filter[t] = n;
3198
+ },
3199
+ convertFrom: (e, t, n) => {
3200
+ var o;
3201
+ if (t === "mode")
3202
+ return ((o = e.filter) == null ? void 0 : o.mode) || "client";
3203
+ }
3204
+ }, zo = {
3205
+ convertTo: (e, t, n, o) => {
3206
+ e.rowOption ? e.rowOption[t] = n : e.rowOption = {
3207
+ [t]: n
3208
+ };
3209
+ },
3210
+ convertFrom: (e, t, n) => {
3211
+ if (e.rowOption) {
3212
+ if (t === "customRowStyle")
3213
+ return e.rowOption.customRowStyle;
3214
+ if (t === "customCellStyle")
3215
+ return e.rowOption.customCellStyle;
3216
+ }
3217
+ return "";
3218
+ }
3219
+ };
3220
+ function ht(e, t, n) {
3221
+ const o = /* @__PURE__ */ new Map([
3222
+ ["/converter/appearance.converter", ko],
3223
+ ["/converter/buttons.converter", Fo],
3224
+ ["/converter/property-editor.converter", Mo],
3225
+ ["/converter/items-count.converter", Lo],
3226
+ ["/converter/type.converter", No],
3227
+ ["/converter/change-editor.converter", Vo],
3228
+ ["/converter/change-formatter.converter", xo],
3229
+ ["/converter/column-command.converter", Oo],
3230
+ ["/converter/column-option.converter", Io],
3231
+ ["/converter/summary.converter", Do],
3232
+ ["/converter/group.converter", Po],
3233
+ ["/converter/form-group-label.converter", jo],
3234
+ ["/converter/field-selector.converter", Bo],
3235
+ ["/converter/pagination.converter", Ro],
3236
+ ["/converter/row-number.converter", Ao],
3237
+ ["/converter/grid-selection.converter", $o],
3238
+ ["/converter/size.converter", Ho],
3239
+ ["/converter/change-formatter-enum.converter", Uo],
3240
+ ["/converter/grid-sort.converter", Go],
3241
+ ["/converter/grid-filter.converter", qo],
3242
+ ["/converter/row-option.converter", zo]
3243
+ ]), i = /* @__PURE__ */ new Map([
3244
+ ["string", { type: "input-group", enableClear: !1 }],
3245
+ ["boolean", {
3246
+ type: "combo-list",
3247
+ textField: "name",
3248
+ valueField: "value",
3249
+ idField: "value",
3250
+ enableClear: !1,
3251
+ editable: !1,
3252
+ data: [
3253
+ {
3254
+ value: !0,
3255
+ name: "是"
3256
+ },
3257
+ {
3258
+ value: !1,
3259
+ name: "否"
3260
+ }
3261
+ ]
3262
+ }],
3263
+ ["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }],
3264
+ ["array", { type: "button-edit" }],
3265
+ ["number", { type: "number-spinner", placeholder: "" }],
3266
+ ["events-editor", { type: "events-editor", hide: !0 }]
3267
+ ]), a = Eo();
3268
+ function r(d, w) {
3269
+ return () => a.parseValueSchema(d, w);
3270
+ }
3271
+ function c(d, w, C) {
3272
+ return d.includes("visible") && w.visible !== void 0 ? typeof w.visible == "boolean" ? () => !!w.visible : w.visible === void 0 ? !0 : r(w.visible, C) : () => !0;
3273
+ }
3274
+ function v(d, w, C) {
3275
+ return d.includes("readonly") && w.readonly !== void 0 ? typeof w.readonly == "boolean" ? () => !!w.readonly : r(w.readonly, C) : () => !1;
3276
+ }
3277
+ function f(d, w) {
3278
+ const C = d.$converter || w;
3279
+ return typeof C == "string" && C && o.has(C) ? o.get(C) || null : C || null;
3280
+ }
3281
+ function u(d, w, C, T, S, b = "", g = "") {
3282
+ return Object.keys(d).map((p) => {
3283
+ const _ = O(1), E = p, h = d[p], B = Object.keys(h), Y = h.title, M = h.type, L = i.get(M) || { type: "input-group", enableClear: !1 }, D = h.editor ? Object.assign({}, L, h.editor) : Object.assign({}, L), x = c(B, h, w), k = v(B, h, w);
3284
+ D.readonly = D.readonly === void 0 ? k() : D.readonly;
3285
+ const $ = h.type === "cascade" ? u(h.properties, w, C, T, S, b, g) : [], A = !0;
3286
+ let Q = f(h, g);
3287
+ const ne = W({
3288
+ get() {
3289
+ if (_.value) {
3290
+ if (["class", "style"].find((P) => P === E) && !Q && (Q = o.get("/converter/appearance.converter") || null), Q && Q.convertFrom)
3291
+ return Q.convertFrom(C, p, S, b);
3292
+ const ee = C[p];
3293
+ return Object.prototype.hasOwnProperty.call(h, "defaultValue") && (ee === void 0 || typeof ee == "string" && ee === "") ? h.type === "boolean" ? h.defaultValue : h.defaultValue || "" : ee;
3294
+ }
3295
+ return null;
3296
+ },
3297
+ set(ee) {
3298
+ _.value += 1, Q && Q.convertTo ? (Q.convertTo(T, p, ee, S, b), Q.convertTo(C, p, ee, S, b)) : (T[p] = ee, C[p] = ee);
3299
+ }
3300
+ }), { refreshPanelAfterChanged: I, description: z, isExpand: J, parentPropertyID: K } = h, re = { propertyID: E, propertyName: Y, propertyType: M, propertyValue: ne, editor: D, visible: x, readonly: k, cascadeConfig: $, hideCascadeTitle: A, refreshPanelAfterChanged: I, description: z, isExpand: J, parentPropertyID: K };
3301
+ return w[E] = re, re;
3302
+ });
3303
+ }
3304
+ function s(d, w, C = {}) {
3305
+ const T = {}, S = e[d];
3306
+ return S && S.categories ? Object.keys(S.categories).map((g) => {
3307
+ const m = S.categories[g], p = m == null ? void 0 : m.title, _ = u(m.properties || {}, T, {}, C, w);
3308
+ return { categoryId: g, categoryName: p, properties: _ };
3309
+ }) : [];
3310
+ }
3311
+ function l(d, w, C, T, S = "") {
3312
+ const b = w.$ref.schema, g = w.$ref.converter, m = C[b], p = m.type, _ = n(m), E = {}, h = e[p];
3313
+ if (h && h.categories) {
3314
+ const B = h.categories[d], Y = B == null ? void 0 : B.title;
3315
+ g && Object.keys(B.properties).forEach((D) => {
3316
+ B.properties[D].$converter = g;
3317
+ });
3318
+ const M = (B == null ? void 0 : B.properties) || {}, L = u(M, E, _, m, T, S);
3319
+ return { categoryId: d, categoryName: Y, properties: L };
3320
+ }
3321
+ return { categoryId: d, categoryName: "", properties: [] };
3322
+ }
3323
+ function y(d, w, C, T, S) {
3324
+ const b = d.type, g = n(d), m = {};
3325
+ let p = S || e[b];
3326
+ if (p && Object.keys(p).length === 0 && C && C.getPropConfig && (p = C.getPropConfig(T)), p && p.categories) {
3327
+ const _ = [];
3328
+ return Object.keys(p.categories).map((E) => {
3329
+ const h = p.categories[E];
3330
+ if (h.$ref) {
3331
+ _.push(l(E, h, d, w, T));
3332
+ return;
3333
+ }
3334
+ const B = h == null ? void 0 : h.title, Y = h == null ? void 0 : h.tabId, M = h == null ? void 0 : h.tabName, L = h == null ? void 0 : h.hide, D = h == null ? void 0 : h.hideTitle, x = u(h.properties || {}, m, g, d, w, T, h.$converter), { setPropertyRelates: k } = h, $ = h == null ? void 0 : h.parentPropertyID;
3335
+ _.push({ categoryId: E, categoryName: B, tabId: Y, tabName: M, hide: L, properties: x, hideTitle: D, setPropertyRelates: k, parentPropertyID: $ });
3336
+ }), _;
3337
+ }
3338
+ return [];
3339
+ }
3340
+ return {
3341
+ getPropertyConfigBySchema: y,
3342
+ getPropertyConfigByType: s,
3343
+ propertyConverterMap: o
3344
+ };
3345
+ }
3346
+ const _t = {}, yt = {};
3347
+ ht(_t, yt, Co);
3348
+ const bt = {}, wt = {}, { getSchemaByType: Kr, resolveSchemaWithDefaultValue: Wo, resolveSchemaToProps: ei, mappingSchemaToProps: ti, setDesignerContext: ni } = vt(bt, wt), Ct = {}, St = {};
3349
+ ht(Ct, St, Wo);
3350
+ function Yo(e, t, n = /* @__PURE__ */ new Map(), o = (r, c, v, f) => c, i = {}, a = (r) => r) {
3351
+ return pt[t.title] = t, gt[t.title] = o, _t[t.title] = i, yt[t.title] = a, bt[t.title] = t, wt[t.title] = o, Ct[t.title] = i, St[t.title] = a, (r = {}, c = !0) => {
3352
+ if (!c)
3353
+ return To(r, n);
3354
+ const v = So(r, t, n), f = Object.keys(e).reduce((u, s) => (u[s] = e[s].default, u), {});
3355
+ return Object.assign(f, v);
3356
+ };
3357
+ }
3358
+ function Xo(e, t) {
3359
+ return { customClass: t.class, customStyle: t.style };
3360
+ }
3361
+ const Tt = /* @__PURE__ */ new Map([
3362
+ ["appearance", Xo]
3363
+ ]), Jo = "root-viewmodel";
3364
+ function Qo(e, t) {
3365
+ const {
3366
+ formSchemaUtils: n,
3367
+ designViewModelUtils: o
3368
+ } = t;
3369
+ function i(u) {
3370
+ return {
3371
+ id: `${u.componentId}-component-viewmodel`,
3372
+ code: `${u.componentId}-component-viewmodel`,
3373
+ name: u.componentName,
3374
+ bindTo: u.bindTo,
3375
+ parent: Jo,
3376
+ fields: [],
3377
+ commands: [],
3378
+ states: [],
3379
+ enableValidation: !0
3380
+ };
3381
+ }
3382
+ function a(u) {
3383
+ const s = e.getSchemaByType("component-ref");
3384
+ return Object.assign(s, {
3385
+ id: `${u.componentId}-component-ref`,
3386
+ component: `${u.componentId}-component`
3387
+ }), s;
3388
+ }
3389
+ function r(u, s, l) {
3390
+ var C, T, S, b;
3391
+ const y = (T = (C = s == null ? void 0 : s.parentComponentInstance) == null ? void 0 : C.schema) == null ? void 0 : T.type, d = (b = (S = n.getFormSchema()) == null ? void 0 : S.module) == null ? void 0 : b.templateId;
3392
+ if (["double-list-template", "tree-list-template", "list-template"].includes(d))
3393
+ return u;
3394
+ const w = [ze["content-container"].type, ze["response-layout-item"].type, ze["splitter-pane"].type];
3395
+ if (y && w.includes(y)) {
3396
+ const g = e.getSchemaByType(
3397
+ "section",
3398
+ {
3399
+ parentComponentInstance: s.parentComponentInstance,
3400
+ mainTitle: s.componentName
3401
+ },
3402
+ t
3403
+ );
3404
+ if (g && g.contents && g.contents.length) {
3405
+ const m = g.contents[0];
3406
+ return m.contents = [u], g;
3407
+ }
3408
+ }
3409
+ return u;
3410
+ }
3411
+ function c(u) {
3412
+ const s = e.getSchemaByType("list-view");
3413
+ return Object.assign(s, {
3414
+ id: u.componentId + "-listView",
3415
+ appearance: {
3416
+ class: ""
3417
+ },
3418
+ type: "list-view",
3419
+ dataSource: u.dataSource || "",
3420
+ pagination: {
3421
+ enable: !1
3422
+ }
3423
+ }), [s];
3424
+ }
3425
+ function v(u) {
3426
+ var w, C;
3427
+ const s = e.getSchemaByType("component"), l = c(u);
3428
+ let y = "";
3429
+ const d = (C = (w = n.getFormSchema()) == null ? void 0 : w.module) == null ? void 0 : C.templateId;
3430
+ return ["double-list-template", "tree-list-template", "list-template"].includes(d) && (y = "f-struct-wrapper f-utils-fill-flex-column"), Object.assign(s, {
3431
+ id: `${u.componentId}-component`,
3432
+ viewModel: `${u.componentId}-component-viewmodel`,
3433
+ componentType: u.componentType,
3434
+ contents: l,
3435
+ appearance: { class: y }
3436
+ }), s;
3437
+ }
3438
+ function f(u) {
3439
+ const s = a(u), l = v(u), y = i(u), d = n.getFormSchema();
3440
+ return d.module.viewmodels.push(y), d.module.components.push(l), o.assembleDesignViewModel(), r(s, u);
3441
+ }
3442
+ return { createComponent: f };
3443
+ }
3444
+ function Et(e, t, n, o) {
3445
+ var a, r, c, v, f, u;
3446
+ const i = n.parentComponentInstance;
3447
+ if (i && o) {
3448
+ const s = Math.random().toString(36).slice(2, 6), l = {
3449
+ componentId: `list-view-${s}`,
3450
+ componentName: ((a = n.bindingSourceContext) == null ? void 0 : a.entityTitle) || ((c = (r = n.bindingSourceContext) == null ? void 0 : r.bindingEntity) == null ? void 0 : c.name) || `列表-${s}`,
3451
+ componentType: "list-view",
3452
+ parentContainerId: i.schema.id,
3453
+ parentComponentInstance: i,
3454
+ // editable: true,
3455
+ bindTo: ((v = n.bindingSourceContext) == null ? void 0 : v.bindTo) || "",
3456
+ dataSource: (u = (f = n.bindingSourceContext) == null ? void 0 : f.bindingEntity) == null ? void 0 : u.label
3457
+ // selectedFields: context.bindingSourceContext?.bindingEntityFields
3458
+ }, { createComponent: y } = Qo(e, o);
3459
+ return y(l);
3460
+ } else
3461
+ return t;
3462
+ }
3463
+ const Zo = "https://json-schema.org/draft/2020-12/schema", Ko = "https://farris-design.gitee.io/list-view.schema.json", er = "list-view", tr = "A Farris Component", nr = "object", or = {
3464
+ id: {
3465
+ description: "The unique identifier for list-view",
3466
+ type: "string"
3467
+ },
3468
+ type: {
3469
+ description: "The type string of list-view",
3470
+ type: "string",
3471
+ default: "list-view"
3472
+ },
3473
+ dataSource: {
3474
+ description: "",
3475
+ type: "string",
3476
+ default: ""
3477
+ },
3478
+ appearance: {
3479
+ description: "",
3480
+ type: "object",
3481
+ properties: {
3482
+ class: {
3483
+ type: "string"
3484
+ },
3485
+ style: {
3486
+ type: "string"
3487
+ }
3488
+ },
3489
+ default: {}
3490
+ },
3491
+ binding: {
3492
+ description: "",
3493
+ type: "object",
3494
+ default: {}
3495
+ },
3496
+ disable: {
3497
+ type: "string",
3498
+ default: !1
3499
+ },
3500
+ editable: {
3501
+ description: "",
3502
+ type: "boolean",
3503
+ default: !0
3504
+ },
3505
+ placeholder: {
3506
+ description: "",
3507
+ type: "string",
3508
+ default: ""
3509
+ },
3510
+ readonly: {
3511
+ description: "",
3512
+ type: "boolean",
3513
+ default: !1
3514
+ },
3515
+ require: {
3516
+ description: "",
3517
+ type: "boolean",
3518
+ default: !1
3519
+ },
3520
+ tabindex: {
3521
+ description: "",
3522
+ type: "number",
3523
+ default: -1
3524
+ },
3525
+ visible: {
3526
+ description: "",
3527
+ type: "boolean",
3528
+ default: !0
3529
+ },
3530
+ itemClass: {
3531
+ description: "",
3532
+ type: "string",
3533
+ default: ""
3534
+ },
3535
+ itemStyle: {
3536
+ description: "",
3537
+ type: "string",
3538
+ default: ""
3539
+ },
3540
+ contentTemplate: {
3541
+ description: "",
3542
+ type: "string",
3543
+ default: ""
3544
+ },
3545
+ footerTemplate: {
3546
+ description: "",
3547
+ type: "string",
3548
+ default: ""
3549
+ },
3550
+ emptyTemplate: {
3551
+ description: "",
3552
+ type: "string",
3553
+ default: ""
3554
+ }
3555
+ }, rr = [
3556
+ "id",
3557
+ "type"
3558
+ ], ir = {
3559
+ onClickItem: "行点击事件"
3560
+ }, ar = {
3561
+ $schema: Zo,
3562
+ $id: Ko,
3563
+ title: er,
3564
+ description: tr,
3565
+ type: nr,
3566
+ properties: or,
3567
+ required: rr,
3568
+ events: ir
3569
+ }, kt = rn(ln, "headerTemplate"), Ft = dn(kt, ar, Tt, Et), sr = O(0);
3570
+ function lr() {
3571
+ sr.value++;
3572
+ }
3573
+ const cr = O(0);
3574
+ function ur(e) {
3575
+ const { formSchemaUtils: t, formStateMachineUtils: n } = e;
3576
+ function o(v, f = "") {
3577
+ return {
3578
+ path: f + v.code,
3579
+ field: v.id,
3580
+ fullPath: v.code
3581
+ };
3582
+ }
3583
+ function i(v, f = "") {
3584
+ return t.getViewModelById(v).states.map((s) => o(s, f));
3585
+ }
3586
+ function a(v) {
3587
+ const f = t.getRootViewModelId(), u = i(v);
3588
+ if (v === f)
3589
+ return u;
3590
+ const s = i(f, "root-component.");
3591
+ return [...u, ...s];
3592
+ }
3593
+ function r(v) {
3594
+ return v.binding && v.binding.path || v.id || "";
3595
+ }
3596
+ function c() {
3597
+ return n && n.getRenderStates() || [];
3598
+ }
3599
+ return { getVariables: a, getControlName: r, getStateMachines: c };
3600
+ }
3601
+ class dr {
3602
+ constructor(t) {
3603
+ pe(this, "sessionVariables", [
3604
+ {
3605
+ key: "CurrentSysOrgName",
3606
+ name: "当前组织Name",
3607
+ description: "当前组织Name"
3608
+ },
3609
+ // {
3610
+ // key: "CurrentSysOrgCode",
3611
+ // name: "当前组织Code",
3612
+ // description: "当前组织Code"
3613
+ // },
3614
+ {
3615
+ key: "CurrentSysOrgId",
3616
+ name: "当前组织Id",
3617
+ description: "当前组织Id"
3618
+ },
3619
+ {
3620
+ key: "CurrentUserName",
3621
+ name: "当前用户Name",
3622
+ description: "当前用户Name"
3623
+ },
3624
+ {
3625
+ key: "CurrentUserCode",
3626
+ name: "当前用户Code",
3627
+ description: "当前用户Code"
3628
+ },
3629
+ {
3630
+ key: "CurrentUserId",
3631
+ name: "当前用户Id",
3632
+ description: "当前用户Id"
3633
+ },
3634
+ {
3635
+ key: "CurrentLanguage",
3636
+ name: "当前语言编号",
3637
+ description: "当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"
3638
+ }
3639
+ ]);
3640
+ pe(this, "expressionNames", {
3641
+ compute: "计算表达式",
3642
+ dependency: "依赖表达式",
3643
+ validate: "验证表达式",
3644
+ dataPicking: "帮助前表达式",
3645
+ visible: "可见表达式",
3646
+ readonly: "只读表达式",
3647
+ required: "必填表达式"
3648
+ });
3649
+ pe(this, "getExpressionConverter", (t, n) => ({
3650
+ convertFrom: (o, i, a, r) => {
3651
+ const c = a.getExpressionRuleValue(t, n || i);
3652
+ return c && c.value || "";
3653
+ },
3654
+ convertTo: (o, i, a, r, c) => {
3655
+ var v;
3656
+ if (i === "dataPicking" && (a != null && a.target)) {
3657
+ const f = `${a.target}_dataPicking`;
3658
+ ((v = a.rules) == null ? void 0 : v.some(
3659
+ (s) => s.id === f && s.value
3660
+ )) ? o.dictPickingExpressionId = f : delete o.dictPickingExpressionId;
3661
+ }
3662
+ r.updateExpression(a);
3663
+ }
3664
+ }));
3665
+ this.formSchemaService = t;
3666
+ }
3667
+ getExpressionRule(t, n) {
3668
+ const o = this.formSchemaService.getExpressions();
3669
+ if (!o)
3670
+ return "";
3671
+ const i = o.find((r) => r.target === t);
3672
+ if (!i)
3673
+ return "";
3674
+ const a = i.rules.find((r) => r.type === n);
3675
+ return a || "";
3676
+ }
3677
+ // 获取上下文表单变量
3678
+ getContextFormVariables() {
3679
+ const { module: t } = this.formSchemaService.getFormSchema();
3680
+ if (!t.viewmodels || t.viewmodels.length === 0)
3681
+ return [];
3682
+ const n = this.formSchemaService.getRootViewModelId(), o = this.formSchemaService.getViewModelById(n);
3683
+ if (!o || !o.states || o.states.length === 0)
3684
+ return [];
3685
+ const i = [];
3686
+ return o.states.forEach((a) => {
3687
+ i.push({
3688
+ key: a.code,
3689
+ name: a.name,
3690
+ description: a.name,
3691
+ category: a.category
3692
+ });
3693
+ }), i;
3694
+ }
3695
+ createTreeNode(t, n, o = "label") {
3696
+ return {
3697
+ id: t.id,
3698
+ name: t.name,
3699
+ bindingPath: t[o],
3700
+ parents: n,
3701
+ type: "field"
3702
+ };
3703
+ }
3704
+ buildEntityFieldsTreeData(t = null, n) {
3705
+ const o = [];
3706
+ return t == null || t.forEach((i) => {
3707
+ var c;
3708
+ const a = this.createTreeNode(i, n);
3709
+ let r = [];
3710
+ (c = i.type) != null && c.fields && (r = this.buildEntityFieldsTreeData(i.type.fields, [...n, i.label])), o.push({
3711
+ data: a,
3712
+ children: r,
3713
+ expanded: !0
3714
+ });
3715
+ }), o;
3716
+ }
3717
+ buildChildEntityTreeData(t = null, n) {
3718
+ const o = [];
3719
+ return t == null || t.forEach((i) => {
3720
+ var v, f;
3721
+ const a = this.createTreeNode(i, n);
3722
+ a.type = "entity";
3723
+ const r = this.buildEntityFieldsTreeData((v = i.type) == null ? void 0 : v.fields, [...n, i.label]), c = this.buildChildEntityTreeData((f = i.type) == null ? void 0 : f.entities, [...n, i.label]);
3724
+ c != null && c.length && (r == null || r.push(...c)), o.push({
3725
+ data: a,
3726
+ children: r || [],
3727
+ // 空值回退
3728
+ expanded: !0
3729
+ });
3730
+ }), o;
3731
+ }
3732
+ getEntitiesTreeData() {
3733
+ const t = this.formSchemaService.getSchemaEntities();
3734
+ if (!(t != null && t.length))
3735
+ return [];
3736
+ const n = t[0];
3737
+ if (!(n != null && n.type))
3738
+ return [];
3739
+ const o = this.buildEntityFieldsTreeData(n.type.fields, [n.code]), i = this.buildChildEntityTreeData(n.type.entities, [n.code]);
3740
+ return i != null && i.length && (o == null || o.push(...i)), {
3741
+ entityCode: n.code,
3742
+ fields: [{
3743
+ data: this.createTreeNode(n, [], "code"),
3744
+ children: o || []
3745
+ }]
3746
+ };
3747
+ }
3748
+ getEntitiesAndVariables() {
3749
+ return {
3750
+ entities: this.getEntitiesTreeData(),
3751
+ variables: {
3752
+ session: {
3753
+ name: "系统变量",
3754
+ items: this.sessionVariables,
3755
+ visible: !1
3756
+ },
3757
+ forms: {
3758
+ name: "表单变量",
3759
+ items: this.getContextFormVariables(),
3760
+ visible: !0
3761
+ }
3762
+ }
3763
+ };
3764
+ }
3765
+ onBeforeOpenExpression(t, n, o) {
3766
+ const i = o === "Field" ? t.binding.field : t.id, a = this.getExpressionRule(i, n), r = this.getEntitiesAndVariables(), c = {
3767
+ message: ["validate", "required", "dataPicking"].includes(n) && a ? a.message : "",
3768
+ ...r
3769
+ };
3770
+ return a.messageType != null && (c.messageType = a.messageType), c;
3771
+ }
3772
+ buildRule(t, n, o, i) {
3773
+ const { expression: a, message: r, messageType: c } = n, v = {
3774
+ id: `${t}_${o}`,
3775
+ type: o,
3776
+ value: a
3777
+ };
3778
+ return (o === "validate" || o === "dataPicking" || o === "required") && (v.message = r), o === "dataPicking" && (v.messageType = c), o === "validate" && i && (v.elementId = i), v;
3779
+ }
3780
+ getExpressionData() {
3781
+ const { expressions: t } = this.formSchemaService.getFormSchema().module;
3782
+ return t || [];
3783
+ }
3784
+ updateExpression(t, n, o, i) {
3785
+ const a = n === "Field" ? t.binding.field : t.id, r = this.buildRule(a, o, i, t.type === "form-group" ? t.id : "");
3786
+ let v = this.getExpressionData().find((u) => u.targetType === n && u.target === a);
3787
+ const f = (u) => u.value.trim() === "";
3788
+ if (v) {
3789
+ const u = v.rules.find((s) => s.id === r.id);
3790
+ if (u)
3791
+ f(r) ? v.rules = v.rules.filter((s) => s.id !== r.id) : (Object.assign(u, r), i === "validate" && t.type === "form-group" && (u.elementId = t.id));
3792
+ else {
3793
+ if (f(r))
3794
+ return null;
3795
+ v.rules = v.rules || [], v.rules.push(r);
3796
+ }
3797
+ } else {
3798
+ if (f(r))
3799
+ return null;
3800
+ v = {
3801
+ target: `${a}`,
3802
+ rules: [r],
3803
+ targetType: n
3804
+ };
3805
+ }
3806
+ return v;
3807
+ }
3808
+ getExpressionEditorOptions(t, n, o, i) {
3809
+ return o.reduce((a, r) => {
3810
+ var v, f;
3811
+ const c = n === "Field" ? (v = t == null ? void 0 : t.binding) == null ? void 0 : v.field : t.id;
3812
+ return a[r] = {
3813
+ hide: n === "Field" ? !!((f = t == null ? void 0 : t.binding) != null && f.field) : !1,
3814
+ description: "",
3815
+ title: this.expressionNames[r],
3816
+ type: "string",
3817
+ $converter: this.getExpressionConverter(c),
3818
+ refreshPanelAfterChanged: !0,
3819
+ editor: {
3820
+ type: "expression-editor",
3821
+ singleExpand: !1,
3822
+ dialogTitle: `${this.expressionNames[r]}编辑器`,
3823
+ showMessage: r === "validate" || r === "dataPicking" || r === "required",
3824
+ showMessageType: r === "dataPicking",
3825
+ beforeOpen: () => this.onBeforeOpenExpression(t, r, n),
3826
+ onSubmitModal: (u) => {
3827
+ const s = this.updateExpression(t, n, u, r);
3828
+ if (i) {
3829
+ const l = this.buildRule(c, u, r);
3830
+ i(l);
3831
+ }
3832
+ return s;
3833
+ }
3834
+ }
3835
+ }, a;
3836
+ }, {});
3837
+ }
3838
+ getExpressionInfo(t, n, o) {
3839
+ const i = n === "Field" ? t.binding.field : t.id, a = this.getExpressionRule(i, o), r = {
3840
+ value: a && a.value,
3841
+ targetId: i,
3842
+ targetType: n,
3843
+ expressionType: o
3844
+ };
3845
+ return a && a.message && (r.message = a.message), r;
3846
+ }
3847
+ getExpressionConfig(t, n, o = ["compute", "dependency", "validate"], i) {
3848
+ return {
3849
+ description: "表达式",
3850
+ title: "表达式",
3851
+ hide: !t.binding,
3852
+ properties: {
3853
+ ...this.getExpressionEditorOptions(t, n, o, i)
3854
+ }
3855
+ };
3856
+ }
3857
+ getExpressionOptions(t, n, o) {
3858
+ const i = this.getExpressionInfo(t, n, o);
3859
+ return {
3860
+ dialogTitle: `${this.expressionNames[o]}编辑器`,
3861
+ singleExpand: !1,
3862
+ showMessage: o === "required",
3863
+ beforeOpen: () => this.onBeforeOpenExpression(t, o, n),
3864
+ expressionInfo: i
3865
+ };
3866
+ }
3867
+ }
3868
+ class fr {
3869
+ constructor(t, n) {
3870
+ pe(this, "componentId");
3871
+ pe(this, "viewModelId");
3872
+ pe(this, "eventsEditorUtils");
3873
+ pe(this, "formSchemaUtils");
3874
+ pe(this, "formMetadataConverter");
3875
+ pe(this, "designViewModelUtils");
3876
+ pe(this, "designViewModelField");
3877
+ pe(this, "controlCreatorUtils");
3878
+ pe(this, "designerHostService");
3879
+ pe(this, "designerContext");
3880
+ pe(this, "schemaService", null);
3881
+ pe(this, "metadataService", null);
3882
+ pe(this, "propertyConfig", {
3883
+ type: "object",
3884
+ categories: {}
3885
+ });
3886
+ var o;
3887
+ this.componentId = t, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService, this.schemaService = n.schemaService, this.designerContext = n.designerContext;
3888
+ }
3889
+ getFormDesignerInstance() {
3890
+ var t, n;
3891
+ return (n = (t = this.designerContext) == null ? void 0 : t.instances) == null ? void 0 : n.formDesigner.value;
3892
+ }
3893
+ getTableInfo() {
3894
+ var t;
3895
+ return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
3896
+ }
3897
+ setDesignViewModelField(t) {
3898
+ var o;
3899
+ const n = t.binding && t.binding.type === "Form" && t.binding.field;
3900
+ if (n) {
3901
+ if (!this.designViewModelField) {
3902
+ const i = this.designViewModelUtils.getDgViewModel(this.viewModelId);
3903
+ this.designViewModelField = i.fields.find((a) => a.id === n);
3904
+ }
3905
+ t.updateOn = (o = this.designViewModelField) == null ? void 0 : o.updateOn;
3906
+ }
3907
+ }
3908
+ getBasicPropConfig(t) {
3909
+ return {
3910
+ description: "Basic Information",
3911
+ title: "基本信息",
3912
+ properties: {
3913
+ id: {
3914
+ description: "组件标识",
3915
+ title: "标识",
3916
+ type: "string",
3917
+ readonly: !0
3918
+ },
3919
+ type: {
3920
+ description: "组件类型",
3921
+ title: "控件类型",
3922
+ type: "select",
3923
+ editor: {
3924
+ type: "combo-list",
3925
+ textField: "name",
3926
+ valueField: "value",
3927
+ idField: "value",
3928
+ editable: !1,
3929
+ data: [{ value: t.type, name: Oe[t.type] && Oe[t.type].name }]
3930
+ }
3931
+ }
3932
+ }
3933
+ };
3934
+ }
3935
+ getAppearanceConfig(t = null, n = {}, o) {
3936
+ const i = {
3937
+ title: "外观",
3938
+ description: "Appearance"
3939
+ }, a = {
3940
+ class: {
3941
+ title: "class样式",
3942
+ type: "string",
3943
+ description: "组件的CSS样式",
3944
+ $converter: "/converter/appearance.converter",
3945
+ parentPropertyID: "appearance"
3946
+ },
3947
+ style: {
3948
+ title: "style样式",
3949
+ type: "string",
3950
+ description: "组件的样式",
3951
+ $converter: "/converter/appearance.converter",
3952
+ parentPropertyID: "appearance"
3953
+ }
3954
+ };
3955
+ for (const r in n)
3956
+ a[r] = Object.assign(a[r] || {}, n[r]);
3957
+ return {
3958
+ ...i,
3959
+ properties: { ...a },
3960
+ setPropertyRelates(r, c) {
3961
+ if (r) {
3962
+ switch (r && r.propertyID) {
3963
+ case "class":
3964
+ case "style": {
3965
+ cr.value++;
3966
+ break;
3967
+ }
3968
+ }
3969
+ o && o(r, t, c);
3970
+ }
3971
+ }
3972
+ };
3973
+ }
3974
+ /**
3975
+ *
3976
+ * @param propertyData
3977
+ * @param propertyTypes
3978
+ * @param propertyName
3979
+ * @param constInfos
3980
+ * @param variableInfos
3981
+ * @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
3982
+ * @returns
3983
+ */
3984
+ getPropertyEditorParams(t, n = [], o = "visible", i = {}, a = {}, r = "") {
3985
+ const { getVariables: c, getControlName: v, getStateMachines: f } = ur(this.designerHostService), u = this.getRealTargetType(t), s = n && n.length > 0 ? n : ["Const", "Variable", "StateMachine", "Expression"], l = {
3986
+ type: "property-editor",
3987
+ propertyTypes: s
3988
+ };
3989
+ return s.map((y) => {
3990
+ switch (y) {
3991
+ case "Const":
3992
+ Object.assign(l, {
3993
+ constType: "enum",
3994
+ constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
3995
+ }, i);
3996
+ break;
3997
+ case "Expression":
3998
+ l.expressionConfig = this.getExpressionOptions(t, u, r || o);
3999
+ break;
4000
+ case "StateMachine":
4001
+ l.stateMachines = f();
4002
+ break;
4003
+ case "Variable":
4004
+ Object.assign(l, {
4005
+ controlName: v(t),
4006
+ newVariablePrefix: "is",
4007
+ newVariableType: "Boolean",
4008
+ variables: c(this.viewModelId),
4009
+ onBeforeOpenVariables: (d) => {
4010
+ d.value = c(this.viewModelId);
4011
+ }
4012
+ }, a);
4013
+ break;
4014
+ }
4015
+ }), l;
4016
+ }
4017
+ getVisibleProperty(t, n = "") {
4018
+ var a;
4019
+ let o = ["Const", "Variable", "StateMachine", "Expression"];
4020
+ return n === "gridFieldEditor" ? o = ["Const", "Expression"] : n === "form-group" && !((a = t.binding) != null && a.field) && (o = ["Const", "Variable", "StateMachine"]), {
4021
+ visible: {
4022
+ title: "是否可见",
4023
+ type: "boolean",
4024
+ description: "运行时组件是否可见",
4025
+ editor: this.getPropertyEditorParams(t, o, "visible")
4026
+ }
4027
+ };
4028
+ }
4029
+ /**
4030
+ * 获取行为
4031
+ * @param propertyData
4032
+ * @param viewModelId
4033
+ * @returns
4034
+ */
4035
+ getBehaviorConfig(t, n = "", o = {}, i) {
4036
+ const a = {
4037
+ title: "行为",
4038
+ description: ""
4039
+ }, r = this.getVisibleProperty(t, n);
4040
+ for (const v in o)
4041
+ r[v] = Object.assign(r[v] || {}, o[v]);
4042
+ const c = this;
4043
+ return {
4044
+ ...a,
4045
+ properties: { ...r },
4046
+ setPropertyRelates(v, f) {
4047
+ if (v) {
4048
+ switch (v.propertyID) {
4049
+ case "disabled":
4050
+ case "readonly":
4051
+ case "visible":
4052
+ c.afterMutilEditorChanged(t, v);
4053
+ break;
4054
+ }
4055
+ i && i(v, f);
4056
+ }
4057
+ }
4058
+ };
4059
+ }
4060
+ /**
4061
+ * 当多值编辑器变更时
4062
+ * @param propertyData
4063
+ * @param changeObject
4064
+ */
4065
+ afterMutilEditorChanged(t, n) {
4066
+ this.addNewVariableToViewModel(n, this.viewModelId), this.updateExpressionValue(n), this.clearExpression(n, t);
4067
+ }
4068
+ /**
4069
+ *
4070
+ * @param propertyId
4071
+ * @param componentInstance
4072
+ * @returns
4073
+ */
4074
+ updateElementByParentContainer(t, n) {
4075
+ const o = n && n.parent && n.parent.schema;
4076
+ if (!o)
4077
+ return;
4078
+ const i = o.contents.findIndex((r) => r.id === t), a = Ae(o.contents[i]);
4079
+ o.contents.splice(i, 1), o.contents.splice(i, 0, a), lr();
4080
+ }
4081
+ /**
4082
+ * 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
4083
+ * @param changeObject
4084
+ * @param viewModelId
4085
+ * @returns
4086
+ */
4087
+ addNewVariableToViewModel(t, n) {
4088
+ const o = t.propertyValue;
4089
+ if (!(o && typeof o == "object") || !(o.type === "Variable" && o.isNewVariable))
4090
+ return;
4091
+ const r = {
4092
+ id: o.field,
4093
+ category: "locale",
4094
+ code: o.fullPath,
4095
+ name: o.fullPath,
4096
+ type: o.newVariableType || "String"
4097
+ };
4098
+ delete o.newVariableType, delete o.isNewVariable, this.formSchemaUtils.getVariableByCode(r.code) || this.formSchemaUtils.getViewModelById(n).states.push(r);
4099
+ }
4100
+ /**
4101
+ * 更新表达式到expressions节点
4102
+ * @param changeObject
4103
+ */
4104
+ updateExpressionValue(t) {
4105
+ const n = t.propertyValue;
4106
+ if (!((n && n.type) === "Expression" && n.expressionInfo))
4107
+ return;
4108
+ const { expressionId: a, expressionInfo: r } = n, { targetId: c, targetType: v, expressionType: f, value: u, message: s } = r, l = this.formSchemaUtils.getModule();
4109
+ l.expressions = l.expressions || [];
4110
+ const { expressions: y } = l;
4111
+ let d = y.find((C) => C.target === c);
4112
+ d || (d = { target: c, rules: [], targetType: v }, y.push(d));
4113
+ const w = d.rules.find((C) => C.type === f);
4114
+ if (w)
4115
+ w.value = u, w.message = s;
4116
+ else {
4117
+ const C = { id: a, type: f, value: u, message: s };
4118
+ d.rules.push(C);
4119
+ }
4120
+ delete n.expressionInfo;
4121
+ }
4122
+ /**
4123
+ * 属性类型切换为非表达式后,清除原表达式
4124
+ * @param changeObject
4125
+ * @param propertyData
4126
+ * @returns
4127
+ */
4128
+ clearExpression(t, n) {
4129
+ const o = t.propertyValue;
4130
+ if (o && o.type === "Expression")
4131
+ return;
4132
+ const a = t.propertyID, r = this.formSchemaUtils.getExpressions(), c = n.binding ? n.binding.field : n.id, v = r.find((f) => f.target === c);
4133
+ !v || !v.rules || (v.rules = v.rules.filter((f) => f.type !== a));
4134
+ }
4135
+ getExpressionOptions(t, n, o) {
4136
+ return new dr(this.formSchemaUtils).getExpressionOptions(t, n, o);
4137
+ }
4138
+ getRealTargetType(t) {
4139
+ return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item"].indexOf(t.type) > -1 ? "Button" : t.binding && t.binding.field ? "Field" : "Container";
4140
+ }
4141
+ createBaseEventProperty(t) {
4142
+ const n = {};
4143
+ return n[this.viewModelId] = {
4144
+ type: "events-editor",
4145
+ editor: {
4146
+ initialData: t,
4147
+ viewSourceHandle: (o) => {
4148
+ var i;
4149
+ ((i = o.controller) == null ? void 0 : i.label.indexOf(this.formSchemaUtils.getModule().code)) > -1 && this.eventsEditorUtils.jumpToMethod(o);
4150
+ }
4151
+ }
4152
+ }, n;
4153
+ }
4154
+ }
4155
+ class mr extends fr {
4156
+ constructor(t, n) {
4157
+ super(t, n);
4158
+ }
4159
+ getPropertyConfig(t) {
4160
+ return this.getBasicPropConfig(t), this.getAppearanceProperties(t), this.getEventPropConfig(t), this.propertyConfig;
4161
+ }
4162
+ getBasicPropConfig(t) {
4163
+ var r, c, v;
4164
+ const n = (v = (c = (r = this.formSchemaUtils.getFormSchema()) == null ? void 0 : r.module) == null ? void 0 : c.entity[0]) == null ? void 0 : v.entities[0], o = this.assembleSchemaEntityToTree(n, 0), i = this, a = super.getBasicPropConfig(t);
4165
+ this.propertyConfig.categories.basic = {
4166
+ description: "Basic Information",
4167
+ title: "基本信息",
4168
+ properties: {
4169
+ ...a.properties,
4170
+ dataSource: {
4171
+ description: "绑定数据源",
4172
+ title: "绑定数据源",
4173
+ editor: {
4174
+ type: "combo-tree",
4175
+ textField: "name",
4176
+ valueField: "label",
4177
+ data: o,
4178
+ editable: !1
4179
+ },
4180
+ readonly: !0
4181
+ }
4182
+ },
4183
+ setPropertyRelates(f, u) {
4184
+ switch (f && f.propertyID) {
4185
+ case "dataSource": {
4186
+ const s = i.formSchemaUtils.getViewModelById(i.viewModelId);
4187
+ if (s) {
4188
+ const l = o.find((y) => y.label === f.propertyValue);
4189
+ s.bindTo = l.bindTo;
4190
+ }
4191
+ i.designViewModelUtils.assembleDesignViewModel();
4192
+ break;
4193
+ }
4194
+ }
4195
+ }
4196
+ };
4197
+ }
4198
+ /**
4199
+ * 将schema实体表组装成树
4200
+ */
4201
+ assembleSchemaEntityToTree(t, n, o, i = "", a = []) {
4202
+ const r = i ? `${i}/${t.label}` : "/";
4203
+ return a.push({
4204
+ id: t.id,
4205
+ name: t.name,
4206
+ label: t.label,
4207
+ layer: n,
4208
+ parent: o && o.id,
4209
+ bindTo: r.replace("//", "/")
4210
+ }), t.type.entities && t.type.entities.length && t.type.entities.map((c) => this.assembleSchemaEntityToTree(c, n + 1, t, r, a)), a;
4211
+ }
4212
+ getAppearanceProperties(t) {
4213
+ this.propertyConfig.categories.appearance = {
4214
+ title: "外观",
4215
+ properties: {
4216
+ class: {
4217
+ title: "列表class样式",
4218
+ type: "string",
4219
+ description: "组件的CSS样式"
4220
+ },
4221
+ itemClass: {
4222
+ title: "行样式class",
4223
+ type: "string",
4224
+ description: "行样式class",
4225
+ editor: {
4226
+ type: "code-editor",
4227
+ language: "javascript",
4228
+ leftTemplate: () => F(De, null, [F("h5", null, [ke("示例代码")]), F("pre", null, [`
4229
+ (dataItem) => {
4230
+ if(dataItem.code === '0001') {
4231
+ return 'bg-danger text-center';
4232
+ }
4233
+ return '';
4234
+ }
4235
+
4236
+ 注:dataItem 行数据
4237
+ 函数返回值是一个字符串,
4238
+ 是由空格分隔的class组成 `])])
4239
+ }
4240
+ },
4241
+ itemStyle: {
4242
+ title: "行样式style",
4243
+ type: "string",
4244
+ description: "行样式style",
4245
+ editor: {
4246
+ type: "code-editor",
4247
+ language: "javascript",
4248
+ leftTemplate: () => F(De, null, [F("h5", null, [ke("示例代码")]), F("pre", null, [`
4249
+ (dataItem) => {
4250
+ if(dataItem.code === '0001') {
4251
+ return 'textAlign:center;color:green';
4252
+ }
4253
+ return '';
4254
+ }
4255
+
4256
+ 注:dataItem 行数据
4257
+ 函数返回值是一个字符串,
4258
+ 由分号分隔的css样式组成 `])])
4259
+ }
4260
+ },
4261
+ contentTemplate: {
4262
+ description: "内容模板",
4263
+ title: "内容模板",
4264
+ type: "string",
4265
+ refreshPanelAfterChanged: !0,
4266
+ editor: {
4267
+ type: "code-editor",
4268
+ language: "html"
4269
+ }
4270
+ },
4271
+ footerTemplate: {
4272
+ description: "底部模板",
4273
+ title: "底部模板",
4274
+ type: "string",
4275
+ refreshPanelAfterChanged: !0,
4276
+ editor: {
4277
+ type: "code-editor",
4278
+ language: "html"
4279
+ }
4280
+ },
4281
+ emptyTemplate: {
4282
+ description: "空数据模板",
4283
+ title: "空数据模板",
4284
+ type: "string",
4285
+ refreshPanelAfterChanged: !0,
4286
+ editor: {
4287
+ type: "code-editor",
4288
+ language: "html"
4289
+ }
4290
+ }
4291
+ },
4292
+ setPropertyRelates(n, o) {
4293
+ switch (n && n.propertyID) {
4294
+ case "useBlankWhenDataIsEmpty":
4295
+ t.emptyDataHeight = t.useBlankWhenDataIsEmpty ? 36 : 240;
4296
+ break;
4297
+ case "columns":
4298
+ t.columns = n.propertyValue || [];
4299
+ break;
4300
+ }
4301
+ }
4302
+ };
4303
+ }
4304
+ getEventPropConfig(t) {
4305
+ var r;
4306
+ const n = [{
4307
+ label: "onClickItem",
4308
+ name: "行点击事件"
4309
+ }];
4310
+ (r = t.pagination) == null || r.enable;
4311
+ const o = this, i = o.eventsEditorUtils.formProperties(t, o.viewModelId, n), a = o.createBaseEventProperty(i);
4312
+ this.propertyConfig.categories.eventsEditor = {
4313
+ title: "事件",
4314
+ hideTitle: !0,
4315
+ properties: a,
4316
+ // 这个属性,标记当属性变更得时候触发重新更新属性
4317
+ refreshPanelAfterChanged: !0,
4318
+ tabId: "commands",
4319
+ tabName: "交互",
4320
+ setPropertyRelates(c, v) {
4321
+ const f = c.propertyValue;
4322
+ delete t[o.viewModelId], f && (f.setPropertyRelates = this.setPropertyRelates, o.eventsEditorUtils.saveRelatedParameters(t, o.viewModelId, f.events, f)), t.remoteSort = !!t.columnSorted, t.command && (t.command.onClickEditCommand = t.onClickEditCommand, t.command.onClickDeleteCommand = t.onClickDeleteCommand);
4323
+ }
4324
+ };
4325
+ }
4326
+ isSubGrid() {
4327
+ const t = this.formSchemaUtils.getViewModelById(this.viewModelId);
4328
+ return t && t.bindTo ? t.bindTo.trim() !== "/" : !1;
4329
+ }
4330
+ }
4331
+ function vr(e, t) {
4332
+ const n = e.schema, o = O(!0), i = O(!0);
4333
+ function a(s) {
4334
+ return !1;
4335
+ }
4336
+ function r() {
4337
+ return !1;
4338
+ }
4339
+ function c() {
4340
+ return !1;
4341
+ }
4342
+ function v() {
4343
+ return !0;
4344
+ }
4345
+ function f(s) {
4346
+ return new mr(s, t).getPropertyConfig(n);
4347
+ }
4348
+ function u() {
4349
+ var s, l, y, d;
4350
+ if (e && t) {
4351
+ const w = (s = e == null ? void 0 : e.componentInstance) == null ? void 0 : s.value.belongedComponentId;
4352
+ let C = "", T = "";
4353
+ const { formSchemaUtils: S } = t;
4354
+ if (w) {
4355
+ const g = S.getRootViewModelId(), m = S.getComponentByViewModelId(g), p = S.selectNode(m, (_) => _.contents && _.contents.find((E) => E.component === w));
4356
+ (p == null ? void 0 : p.type) === ((l = Oe["tab-page"]) == null ? void 0 : l.type) && ((y = p == null ? void 0 : p.contents) != null && y.length) && (C = p.title || ""), (p == null ? void 0 : p.type) === ((d = Oe.section) == null ? void 0 : d.type) && (p == null ? void 0 : p.showHeader) !== !1 && (C = p.mainTitle || ""), C = C ? `${C} > ` : "", T = C ? p.id : "";
4357
+ }
4358
+ const b = Oe["list-view"].name;
4359
+ t == null || t.formSchemaUtils.getControlBasicInfoMap().set(e.schema.id, {
4360
+ componentTitle: b,
4361
+ parentPathName: `${C}${b}`,
4362
+ reliedComponentId: T
4363
+ });
4364
+ }
4365
+ }
4366
+ return {
4367
+ canAccepts: a,
4368
+ checkCanDeleteComponent: r,
4369
+ checkCanMoveComponent: c,
4370
+ hideNestedPaddingInDesginerView: v,
4371
+ triggerBelongedComponentToMoveWhenMoved: o,
4372
+ triggerBelongedComponentToDeleteWhenDeleted: i,
4373
+ getPropsConfig: f,
4374
+ setComponentBasicInfoMap: u
4375
+ };
4376
+ }
4377
+ const pr = "https://json-schema.org/draft/2020-12/schema", gr = "https://farris-design.gitee.io/list-view-table.schema.json", hr = "list-view-table", _r = "A Farris Component", yr = "object", br = {
4378
+ id: {
4379
+ description: "The unique identifier for list-view-table",
4380
+ type: "string"
4381
+ },
4382
+ type: {
4383
+ description: "The type string of list-view-table",
4384
+ type: "string",
4385
+ default: "list-view-table"
4386
+ },
4387
+ appearance: {
4388
+ description: "",
4389
+ type: "object",
4390
+ properties: {
4391
+ class: {
4392
+ type: "string"
4393
+ },
4394
+ style: {
4395
+ type: "string"
4396
+ }
4397
+ },
4398
+ default: {}
4399
+ },
4400
+ binding: {
4401
+ description: "",
4402
+ type: "object",
4403
+ default: {}
4404
+ },
4405
+ disable: {
4406
+ type: "string",
4407
+ default: !1
4408
+ },
4409
+ editable: {
4410
+ description: "",
4411
+ type: "boolean",
4412
+ default: !0
4413
+ },
4414
+ placeholder: {
4415
+ description: "",
4416
+ type: "string",
4417
+ default: ""
4418
+ },
4419
+ readonly: {
4420
+ description: "",
4421
+ type: "boolean",
4422
+ default: !1
4423
+ },
4424
+ require: {
4425
+ description: "",
4426
+ type: "boolean",
4427
+ default: !1
4428
+ },
4429
+ tabindex: {
4430
+ description: "",
4431
+ type: "number",
4432
+ default: -1
4433
+ },
4434
+ visible: {
4435
+ description: "",
4436
+ type: "boolean",
4437
+ default: !0
4438
+ }
4439
+ }, wr = [
4440
+ "id",
4441
+ "type"
4442
+ ], Cr = {
4443
+ $schema: pr,
4444
+ $id: gr,
4445
+ title: hr,
4446
+ description: _r,
4447
+ type: yr,
4448
+ properties: br,
4449
+ required: wr
4450
+ }, Sr = "list-view-table", Tr = "A Farris Component", Er = "object", kr = {
4451
+ basic: {
4452
+ description: "Basic Infomation",
4453
+ title: "基本信息",
4454
+ properties: {
4455
+ id: {
4456
+ description: "组件标识",
4457
+ title: "标识",
4458
+ type: "string",
4459
+ readonly: !0
4460
+ },
4461
+ type: {
4462
+ description: "组件类型",
4463
+ title: "控件类型",
4464
+ type: "select",
4465
+ editor: {
4466
+ type: "waiting for modification",
4467
+ enum: []
4468
+ }
4469
+ }
4470
+ }
4471
+ }
4472
+ }, Fr = {
4473
+ title: Sr,
4474
+ description: Tr,
4475
+ type: Er,
4476
+ categories: kr
4477
+ }, Mt = {
4478
+ data: { type: Array, default: [] }
4479
+ }, Nt = Yo(Mt, Cr, Tt, Et, Fr), Vt = /* @__PURE__ */ Le({
4480
+ name: "FListViewTableDesign",
4481
+ props: Mt,
4482
+ emits: ["outputValue", "currentEvent", "selectionChanged"],
4483
+ setup(e, t) {
4484
+ const n = [{
4485
+ name: "任芳",
4486
+ code: "1.山东大学",
4487
+ date: "2024-02-19",
4488
+ desc: "山东济南",
4489
+ amount: 63.85,
4490
+ avatar: "./assets/avatar1.png"
4491
+ }, {
4492
+ name: "戴秀兰",
4493
+ code: "2.山东建筑大学",
4494
+ date: "2024-03-17",
4495
+ desc: "山东济南",
4496
+ amount: 60.13,
4497
+ avatar: "./assets/avatar2.png"
4498
+ }, {
4499
+ name: "尹磊",
4500
+ code: "3.山东财经大学",
4501
+ date: "2024-04-09",
4502
+ desc: "山东济南",
4503
+ amount: 36.54,
4504
+ avatar: "./assets/avatar3.png"
4505
+ }, {
4506
+ name: "赵明",
4507
+ code: "4.北京大学",
4508
+ date: "2024-03-27",
4509
+ desc: "北京市",
4510
+ amount: 52.76,
4511
+ avatar: "./assets/avatar4.png"
4512
+ }, {
4513
+ name: "吕洋",
4514
+ code: "5.南京大学",
4515
+ date: "2024-11-17",
4516
+ desc: "江苏南京",
4517
+ amount: 84.13,
4518
+ avatar: "./assets/avatar5.png"
4519
+ }, {
4520
+ name: "吕娥",
4521
+ code: "6.清华大学",
4522
+ date: "2024-03-17",
4523
+ desc: "北京市",
4524
+ amount: 52.76,
4525
+ avatar: "./assets/avatar6.png"
4526
+ }, {
4527
+ name: "赵强",
4528
+ code: "7.浙江大学",
4529
+ date: "2024-08-01",
4530
+ desc: "浙江杭州",
4531
+ amount: 84.13,
4532
+ avatar: "./assets/avatar7.png"
4533
+ }];
4534
+ W(() => e.data.length > 0 ? e.data : n);
4535
+ const o = O(), i = Ye("design-item-context"), a = ut(o, i);
4536
+ return Je(() => {
4537
+ o.value.componentInstance = a;
4538
+ }), t.expose(a.value), () => F("div", {
4539
+ ref: o
4540
+ }, [F("div", {
4541
+ class: "ide-list-view h-100"
4542
+ }, [F("div", {
4543
+ class: "f-list-view"
4544
+ }, [F("div", {
4545
+ class: "f-list-view-content"
4546
+ }, [F("ul", {
4547
+ class: "f-list-view-group"
4548
+ }, [F("li", {
4549
+ class: "ide-list-view-group-item"
4550
+ }, [F("div", {
4551
+ class: "ide-list-content"
4552
+ }, [F("div", {
4553
+ class: "f-template-common-row d-flex"
4554
+ }, [F("div", {
4555
+ class: "item-action-primary"
4556
+ }, [F("img", {
4557
+ class: "ap-img",
4558
+ src: "./assets/avatar1.png",
4559
+ title: "img1"
4560
+ }, null)]), F("div", {
4561
+ class: "listview-item-content d-flex k-align-items-center"
4562
+ }, [F("div", {
4563
+ class: "listview-item-main"
4564
+ }, [F("h4", {
4565
+ class: "listview-item-title"
4566
+ }, null), F("h5", {
4567
+ class: "listview-item-subtitle"
4568
+ }, null)]), F("div", {
4569
+ class: "listview-item-btns"
4570
+ }, [F("button", {
4571
+ class: "btn btn-link"
4572
+ }, [ke(" "), "编辑"]), F("button", {
4573
+ class: "btn btn-link"
4574
+ }, [ke(" "), "删除"])])])])])]), F("li", {
4575
+ class: "ide-list-view-group-item"
4576
+ }, [F("div", {
4577
+ class: "ide-list-content"
4578
+ }, [F("div", {
4579
+ class: "f-template-common-row d-flex"
4580
+ }, [F("div", {
4581
+ class: "item-action-primary"
4582
+ }, [F("img", {
4583
+ class: "ap-img",
4584
+ src: "./assets/avatar2.png",
4585
+ title: "img2"
4586
+ }, null)]), F("div", {
4587
+ class: "listview-item-content d-flex k-align-items-center"
4588
+ }, [F("div", {
4589
+ class: "listview-item-main"
4590
+ }, [F("h4", {
4591
+ class: "listview-item-title"
4592
+ }, null), F("h5", {
4593
+ class: "listview-item-subtitle"
4594
+ }, null)]), F("div", {
4595
+ class: "listview-item-btns"
4596
+ }, [F("button", {
4597
+ class: "btn btn-link"
4598
+ }, [ke(" "), "编辑"]), F("button", {
4599
+ class: "btn btn-link"
4600
+ }, ["删除"])])])])])]), F("li", {
4601
+ class: "ide-list-view-group-item"
4602
+ }, [F("div", {
4603
+ class: "ide-list-content"
4604
+ }, [F("div", {
4605
+ class: "f-template-common-row d-flex"
4606
+ }, [F("div", {
4607
+ class: "item-action-primary"
4608
+ }, [F("img", {
4609
+ class: "ap-img",
4610
+ src: "./assets/avatar3.png",
4611
+ title: "img3"
4612
+ }, null)]), F("div", {
4613
+ class: "listview-item-content d-flex k-align-items-center"
4614
+ }, [F("div", {
4615
+ class: "listview-item-main"
4616
+ }, [F("h4", {
4617
+ class: "listview-item-title"
4618
+ }, null), F("h5", {
4619
+ class: "listview-item-subtitle"
4620
+ }, null)]), F("div", {
4621
+ class: "listview-item-btns"
4622
+ }, [F("button", {
4623
+ class: "btn btn-link"
4624
+ }, [ke(" "), "编辑"]), F("button", {
4625
+ class: "btn btn-link"
4626
+ }, ["删除"])])])])])])])])])])]);
4627
+ }
4628
+ }), $e = /* @__PURE__ */ Le({
4629
+ name: "FListViewDesign",
4630
+ props: kt,
4631
+ emits: ["checkValuesChange", "clickItem", "selectionChange", "removeItem", "change"],
4632
+ setup(e, t) {
4633
+ const n = O(), o = O(!0), i = O(!1), a = O([]), r = 0, c = O(e.columns), v = Wn(e, t), f = co(e), u = Yn(e), s = dt(e, f), l = $n(e, /* @__PURE__ */ new Map(), v, u, f), y = fo(e, l, f, a, t), d = In(e, n), w = O(), C = Ye("designer-host-service"), T = Ye("design-item-context"), S = vr(T, C), b = ut(w, T, S), g = W(() => l.dataView.value.length), m = uo(e, t, y, f), p = lo(e, t, f, m), _ = Jn(e), E = ro(e, {}, _), h = io(e, l, p, u, f, _, E), B = ao(e, f, E, h), Y = so(e, f, E, h), M = Xn(e, c, l, g, r, h, B, Y), {
4634
+ getVisualData: L
4635
+ } = M;
4636
+ a.value = L(0, g.value + r - 1), Je(() => {
4637
+ w.value.componentInstance = b;
4638
+ }), t.expose(b.value);
4639
+ const D = W(() => {
4640
+ const J = {
4641
+ "f-list-view": !0,
4642
+ "f-list-view-multiple": e.multiSelect,
4643
+ "w-100": !0,
4644
+ "h-100": !0
4645
+ };
4646
+ return e.size !== "default" && (J[`${e.size}-item`] = !0), J;
4647
+ }), x = W(() => !!t.slots.footer || o.value);
4648
+ function k() {
4649
+ return e.header === "SearchBar" ? at : e.header === "ContentHeader" ? _o : at;
4650
+ }
4651
+ const $ = k(), {
4652
+ renderHeader: A
4653
+ } = $(e, t, d), Q = yo(), ne = bo(e, t, l, Q), I = wo(e, t, a, ne, Q, y);
4654
+ ho(e, t, a, l, s, Q, y, M, I, ne);
4655
+ function z(J) {
4656
+ e.multiSelect && (J.preventDefault(), J.stopPropagation());
4657
+ }
4658
+ return () => F("div", {
4659
+ ref: w,
4660
+ class: D.value,
4661
+ onClick: z
4662
+ }, [A(), F("div", {
4663
+ ref: n,
4664
+ class: "f-list-view-content",
4665
+ onMouseover: () => {
4666
+ i.value = !0;
4667
+ },
4668
+ onMouseleave: () => {
4669
+ i.value = !1;
4670
+ }
4671
+ }, [F(Vt, null, null)]), x.value && F("div", {
4672
+ class: "f-list-view-footer"
4673
+ }, [t.slots.footer && t.slots.footer()])]);
4674
+ }
4675
+ }), Mr = fn();
4676
+ $e.register = (e, t, n, o) => {
4677
+ e["list-view"] = sn, t["list-view"] = Ft, e["list-view-table"] = cn, t["list-view-table"] = Nt, o["list-view"] = { bindingResolver: Mr };
4678
+ };
4679
+ $e.registerDesigner = (e, t, n) => {
4680
+ e["list-view"] = $e, t["list-view"] = Ft, e["list-view-table"] = Vt, t["list-view-table"] = Nt;
4681
+ };
4682
+ const oi = an($e);
4683
+ export {
4684
+ $e as FListViewDesign,
4685
+ Mr as bindingResolver,
4686
+ oi as default,
4687
+ kt as listViewDesignProps,
4688
+ Ft as propsResolver
4689
+ };