@ibiz-template/vue3-components 0.7.41-alpha.12 → 0.7.41-alpha.14

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 (154) hide show
  1. package/dist/ibiz-markdown-editor-0VHzFa2l.js +1 -0
  2. package/dist/index-1fHusiqt.js +4 -0
  3. package/dist/index.min.css +1 -1
  4. package/dist/index.system.min.js +1 -1
  5. package/dist/{wang-editor-TYKjfyR5.js → wang-editor-z0RY8bO1.js} +1 -1
  6. package/dist/{xlsx-util-Q9msA8ef.js → xlsx-util-8Du1A340.js} +1 -1
  7. package/es/control/calendar/calendar.mjs +4 -1
  8. package/es/control/calendar/components/calendar-user/calendar-user.css +1 -1
  9. package/es/control/calendar/components/calendar-user/calendar-user.mjs +76 -2
  10. package/es/control/data-view/data-view.d.ts +1 -1
  11. package/es/control/data-view/index.d.ts +1 -1
  12. package/es/control/drbar/drbar.controller.d.ts +6 -0
  13. package/es/control/drbar/drbar.controller.mjs +8 -0
  14. package/es/control/drbar/drbar.mjs +6 -0
  15. package/es/control/drtab/drtab-control.util.mjs +1 -1
  16. package/es/control/drtab/drtab.controller.d.ts +6 -0
  17. package/es/control/drtab/drtab.controller.mjs +9 -0
  18. package/es/control/drtab/drtab.mjs +13 -0
  19. package/es/control/form/form/index.mjs +2 -0
  20. package/es/control/form/form-detail/form-iframe/form-iframe.css +1 -0
  21. package/es/control/form/form-detail/form-iframe/form-iframe.d.ts +29 -0
  22. package/es/control/form/form-detail/form-iframe/form-iframe.mjs +53 -0
  23. package/es/control/form/form-detail/form-iframe/form-iframe.provider.d.ts +13 -0
  24. package/es/control/form/form-detail/form-iframe/form-iframe.provider.mjs +21 -0
  25. package/es/control/form/form-detail/form-iframe/index.d.ts +25 -0
  26. package/es/control/form/form-detail/form-iframe/index.mjs +12 -0
  27. package/es/control/form/form-detail/form-item/form-item.css +1 -1
  28. package/es/control/form/form-detail/form-item/form-item.mjs +6 -4
  29. package/es/control/form/form-detail/index.d.ts +1 -0
  30. package/es/control/form/form-detail/index.mjs +1 -0
  31. package/es/control/form/index.mjs +1 -0
  32. package/es/control/gantt/gantt.d.ts +1 -1
  33. package/es/control/gantt/gantt.mjs +4 -1
  34. package/es/control/gantt/index.d.ts +1 -1
  35. package/es/control/grid/grid/grid.d.ts +1 -1
  36. package/es/control/grid/grid/index.d.ts +1 -1
  37. package/es/control/grid/grid/index.mjs +2 -0
  38. package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +4 -4
  39. package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +5 -8
  40. package/es/control/grid/virtualized-table/index.d.ts +136 -0
  41. package/es/control/grid/virtualized-table/index.mjs +18 -0
  42. package/es/control/grid/virtualized-table/virtualized-table.css +1 -0
  43. package/es/control/grid/virtualized-table/virtualized-table.d.ts +200 -0
  44. package/es/control/grid/virtualized-table/virtualized-table.mjs +325 -0
  45. package/es/control/grid/virtualized-table/virtualized-table.provider.d.ts +10 -0
  46. package/es/control/grid/virtualized-table/virtualized-table.provider.mjs +14 -0
  47. package/es/control/grid/virtualized-table/virtualized-table.util.d.ts +95 -0
  48. package/es/control/grid/virtualized-table/virtualized-table.util.mjs +191 -0
  49. package/es/control/index.mjs +1 -0
  50. package/es/control/kanban/index.d.ts +44 -1
  51. package/es/control/kanban/kanban.d.ts +56 -1
  52. package/es/control/kanban/kanban.mjs +36 -2
  53. package/es/control/list/index.d.ts +1 -1
  54. package/es/control/list/list.d.ts +1 -1
  55. package/es/control/list/list.mjs +1 -1
  56. package/es/control/search-bar/search-bar.mjs +3 -0
  57. package/es/control/tab-exp-panel/index.d.ts +1 -0
  58. package/es/control/tab-exp-panel/tab-exp-panel.css +1 -1
  59. package/es/control/tab-exp-panel/tab-exp-panel.d.ts +2 -1
  60. package/es/control/tab-exp-panel/tab-exp-panel.mjs +21 -2
  61. package/es/control/tree/index.d.ts +1 -1
  62. package/es/control/tree/tree.d.ts +1 -1
  63. package/es/control/tree/tree.mjs +4 -1
  64. package/es/control/tree-grid/index.d.ts +1 -1
  65. package/es/control/tree-grid/tree-grid.d.ts +1 -1
  66. package/es/editor/array/ibiz-array/ibiz-array.css +1 -1
  67. package/es/editor/array/ibiz-array/ibiz-array.mjs +4 -1
  68. package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.d.ts +1 -1
  69. package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.d.ts +1 -1
  70. package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.d.ts +3 -2
  71. package/es/editor/date-range-select/date-range-select-picker/date-range-select.d.ts +5 -5
  72. package/es/editor/date-range-select/date-range-select.controller.mjs +9 -0
  73. package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.d.ts +1 -0
  74. package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.d.ts +4 -3
  75. package/es/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.css +1 -1
  76. package/es/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.d.ts +10 -7
  77. package/es/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.mjs +5 -5
  78. package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +1 -1
  79. package/es/editor/slider/ibiz-slider/ibiz-slider.d.ts +3 -3
  80. package/es/editor/span/span/span.d.ts +1 -1
  81. package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.css +1 -1
  82. package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.d.ts +3 -77
  83. package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.mjs +167 -108
  84. package/es/editor/text-box/input/input.d.ts +4 -4
  85. package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.mjs +1 -1
  86. package/es/index.mjs +1 -0
  87. package/es/panel-component/panel-button/panel-button.controller.mjs +2 -1
  88. package/es/panel-component/panel-button/panel-button.mjs +1 -1
  89. package/es/util/app-util/app-util.d.ts +54 -2
  90. package/es/util/app-util/app-util.mjs +48 -1
  91. package/es/util/fullscreen/fullscreen-util.mjs +1 -1
  92. package/es/view-engine/custom-view.engine.d.ts +1 -1
  93. package/es/view-engine/custom-view.engine.mjs +5 -5
  94. package/es/view-engine/de-index-view-engine.mjs +1 -1
  95. package/es/view-engine/edit-view.engine.mjs +1 -1
  96. package/es/view-engine/md-custom-view.engine.d.ts +1 -1
  97. package/es/view-engine/md-custom-view.engine.mjs +5 -5
  98. package/es/view-engine/opt-view.engine.mjs +1 -1
  99. package/lib/control/calendar/calendar.cjs +4 -1
  100. package/lib/control/calendar/components/calendar-user/calendar-user.cjs +76 -2
  101. package/lib/control/calendar/components/calendar-user/calendar-user.css +1 -1
  102. package/lib/control/drbar/drbar.cjs +6 -0
  103. package/lib/control/drbar/drbar.controller.cjs +8 -0
  104. package/lib/control/drtab/drtab-control.util.cjs +1 -1
  105. package/lib/control/drtab/drtab.cjs +13 -0
  106. package/lib/control/drtab/drtab.controller.cjs +9 -0
  107. package/lib/control/form/form/index.cjs +2 -0
  108. package/lib/control/form/form-detail/form-iframe/form-iframe.cjs +58 -0
  109. package/lib/control/form/form-detail/form-iframe/form-iframe.css +1 -0
  110. package/lib/control/form/form-detail/form-iframe/form-iframe.provider.cjs +23 -0
  111. package/lib/control/form/form-detail/form-iframe/index.cjs +17 -0
  112. package/lib/control/form/form-detail/form-item/form-item.cjs +5 -3
  113. package/lib/control/form/form-detail/form-item/form-item.css +1 -1
  114. package/lib/control/form/form-detail/index.cjs +2 -0
  115. package/lib/control/form/index.cjs +6 -4
  116. package/lib/control/gantt/gantt.cjs +4 -1
  117. package/lib/control/grid/grid/index.cjs +2 -0
  118. package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +3 -6
  119. package/lib/control/grid/virtualized-table/index.cjs +23 -0
  120. package/lib/control/grid/virtualized-table/virtualized-table.cjs +327 -0
  121. package/lib/control/grid/virtualized-table/virtualized-table.css +1 -0
  122. package/lib/control/grid/virtualized-table/virtualized-table.provider.cjs +16 -0
  123. package/lib/control/grid/virtualized-table/virtualized-table.util.cjs +193 -0
  124. package/lib/control/index.cjs +82 -80
  125. package/lib/control/kanban/kanban.cjs +34 -0
  126. package/lib/control/list/list.cjs +1 -1
  127. package/lib/control/search-bar/search-bar.cjs +3 -0
  128. package/lib/control/tab-exp-panel/tab-exp-panel.cjs +20 -1
  129. package/lib/control/tab-exp-panel/tab-exp-panel.css +1 -1
  130. package/lib/control/tree/tree.cjs +4 -1
  131. package/lib/editor/array/ibiz-array/ibiz-array.cjs +4 -1
  132. package/lib/editor/array/ibiz-array/ibiz-array.css +1 -1
  133. package/lib/editor/date-range-select/date-range-select.controller.cjs +9 -0
  134. package/lib/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.cjs +5 -5
  135. package/lib/editor/dropdown-list/ibiz-virtualized-list/ibiz-virtualized-list.css +1 -1
  136. package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +1 -1
  137. package/lib/editor/text-box/ibiz-input-ip/ibiz-input-ip.cjs +166 -107
  138. package/lib/editor/text-box/ibiz-input-ip/ibiz-input-ip.css +1 -1
  139. package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.cjs +1 -1
  140. package/lib/index.cjs +112 -110
  141. package/lib/panel-component/panel-button/panel-button.cjs +1 -1
  142. package/lib/panel-component/panel-button/panel-button.controller.cjs +2 -1
  143. package/lib/util/app-util/app-util.cjs +47 -0
  144. package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
  145. package/lib/view-engine/custom-view.engine.cjs +5 -5
  146. package/lib/view-engine/de-index-view-engine.cjs +1 -1
  147. package/lib/view-engine/edit-view.engine.cjs +1 -1
  148. package/lib/view-engine/md-custom-view.engine.cjs +5 -5
  149. package/lib/view-engine/opt-view.engine.cjs +1 -1
  150. package/package.json +5 -5
  151. package/dist/ibiz-markdown-editor-KyK5mBTS.js +0 -1
  152. package/dist/index-pyv7Wdpx.js +0 -4
  153. /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.12_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.14_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
  154. /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.12_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.14_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
@@ -0,0 +1,325 @@
1
+ import { isVNode, onUnmounted, resolveComponent, createVNode, createTextVNode, defineComponent } from 'vue';
2
+ import { useControlController, useNamespace, useUIStore, hasEmptyPanelRenderer, IBizCustomRender } from '@ibiz-template/vue3-util';
3
+ import { GridController } from '@ibiz-template/runtime';
4
+ import { useVirtualizedTable } from './virtualized-table.util.mjs';
5
+ import '../../../util/index.mjs';
6
+ import './virtualized-table.css';
7
+ import { usePagination } from '../../../util/pagination/use-pagination.mjs';
8
+
9
+ "use strict";
10
+ function _isSlot(s) {
11
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
12
+ }
13
+ const VirtualizedTableControl = /* @__PURE__ */ defineComponent({
14
+ name: "IBizVirtualizedTableControl",
15
+ props: {
16
+ /**
17
+ * @description 表格模型数据
18
+ */
19
+ modelData: {
20
+ type: Object,
21
+ required: true
22
+ },
23
+ /**
24
+ * @description 应用上下文对象
25
+ */
26
+ context: {
27
+ type: Object,
28
+ required: true
29
+ },
30
+ /**
31
+ * @description 视图参数对象
32
+ * @default {}
33
+ */
34
+ params: {
35
+ type: Object,
36
+ default: () => ({})
37
+ },
38
+ /**
39
+ * @description 部件适配器
40
+ */
41
+ provider: {
42
+ type: Object
43
+ },
44
+ /**
45
+ * @description 部件行数据默认激活模式,值为0:不激活,值为1:单击激活,值为2:双击激活
46
+ */
47
+ mdctrlActiveMode: {
48
+ type: Number,
49
+ default: void 0
50
+ },
51
+ /**
52
+ * @description 是否单选
53
+ */
54
+ singleSelect: {
55
+ type: Boolean,
56
+ default: void 0
57
+ },
58
+ /**
59
+ * @description 是否启用行编辑
60
+ */
61
+ rowEditOpen: {
62
+ type: Boolean,
63
+ default: void 0
64
+ },
65
+ /**
66
+ * @description 是否是简单模式,即直接传入数据,不加载数据
67
+ */
68
+ isSimple: {
69
+ type: Boolean,
70
+ required: false
71
+ },
72
+ /**
73
+ * @description 简单模式下传入的数据
74
+ */
75
+ data: {
76
+ type: Array,
77
+ required: false
78
+ },
79
+ /**
80
+ * @description 是否默认加载数据
81
+ * @default true
82
+ */
83
+ loadDefault: {
84
+ type: Boolean,
85
+ default: true
86
+ }
87
+ },
88
+ setup(props) {
89
+ const c = useControlController((...args) => new GridController(...args));
90
+ const ns = useNamespace("control-virtualized-table");
91
+ const {
92
+ zIndex
93
+ } = useUIStore();
94
+ c.state.zIndex = zIndex.increment();
95
+ const {
96
+ tableRef,
97
+ tableData,
98
+ sortValue,
99
+ columnModel,
100
+ isSelected,
101
+ isAllSelected,
102
+ handleRowClick,
103
+ handleSortClick,
104
+ handleSelectAll,
105
+ calcColumnWidth,
106
+ handleDbRowClick,
107
+ handleHeaderCellClick,
108
+ handleSelectionChange
109
+ } = useVirtualizedTable(c, props);
110
+ const {
111
+ onPageChange,
112
+ onPageRefresh,
113
+ onPageSizeChange
114
+ } = usePagination(c);
115
+ onUnmounted(() => {
116
+ zIndex.decrement();
117
+ });
118
+ const calcRowClass = (params) => {
119
+ const {
120
+ rowData
121
+ } = params;
122
+ return "".concat(ns.is("selected", rowData && isSelected(rowData)));
123
+ };
124
+ const renderNoData = () => {
125
+ var _a;
126
+ const {
127
+ isLoaded
128
+ } = c.state;
129
+ if (isLoaded) {
130
+ const quickToolbar = (_a = c.model.controls) == null ? void 0 : _a.find((item) => item.name === "".concat(c.model.name, "_quicktoolbar"));
131
+ if (quickToolbar) {
132
+ return createVNode(resolveComponent("iBizToolbarControl"), {
133
+ "modelData": quickToolbar,
134
+ "context": c.context,
135
+ "params": c.params,
136
+ "class": ns.e("quick-toolbar")
137
+ }, null);
138
+ }
139
+ const noDataSlots = {};
140
+ if (hasEmptyPanelRenderer(c)) {
141
+ Object.assign(noDataSlots, {
142
+ customRender: () => createVNode(IBizCustomRender, {
143
+ "controller": c
144
+ }, null)
145
+ });
146
+ }
147
+ return createVNode(resolveComponent("iBizNoData"), {
148
+ "text": c.model.emptyText,
149
+ "emptyTextLanguageRes": c.model.emptyTextLanguageRes,
150
+ "hideNoDataImage": c.state.hideNoDataImage
151
+ }, _isSlot(noDataSlots) ? noDataSlots : {
152
+ default: () => [noDataSlots]
153
+ });
154
+ }
155
+ return createVNode("div", null, null);
156
+ };
157
+ const renderBatchToolBar = () => {
158
+ var _a;
159
+ const batchToolbar = (_a = c.model.controls) == null ? void 0 : _a.find((item) => {
160
+ return item.name === "".concat(c.model.name, "_batchtoolbar");
161
+ });
162
+ if (!batchToolbar || c.state.singleSelect || !c.state.selectedData.length)
163
+ return;
164
+ return createVNode("div", {
165
+ "class": [ns.e("batch-toolbar"), ns.is("show", c.state.selectedData.length > 0)]
166
+ }, [createVNode("div", {
167
+ "class": ns.em("batch-toolbar", "content")
168
+ }, [createVNode("div", {
169
+ "class": ns.em("batch-toolbar", "text")
170
+ }, [ibiz.i18n.t("control.common.itemsSelected", {
171
+ length: c.state.selectedData.length
172
+ })]), createVNode("div", {
173
+ "class": ns.em("batch-toolbar", "separator")
174
+ }, [createTextVNode("|")]), createVNode(resolveComponent("iBizToolbarControl"), {
175
+ "modelData": batchToolbar,
176
+ "context": c.context,
177
+ "params": c.params,
178
+ "class": ns.b("batch-toolbar-items")
179
+ }, null)])]);
180
+ };
181
+ const renderHeaderCell = (params) => {
182
+ const {
183
+ column
184
+ } = params;
185
+ const {
186
+ type,
187
+ enableSort,
188
+ key,
189
+ title,
190
+ align
191
+ } = column;
192
+ const {
193
+ prop,
194
+ order
195
+ } = sortValue.value;
196
+ if (type === "selection")
197
+ return createVNode("div", {
198
+ "class": [ns.e("cell"), ns.e("header-cell"), ns.em("cell", align || "left")]
199
+ }, [createVNode(resolveComponent("el-checkbox"), {
200
+ "modelValue": isAllSelected(),
201
+ "onChange": (val) => handleSelectAll(val),
202
+ "indeterminate": c.state.selectedData.length > 0 && !isAllSelected()
203
+ }, null)]);
204
+ return createVNode("div", {
205
+ "class": [ns.e("cell"), ns.e("header-cell"), ns.is("sortable", !!enableSort), ns.em("cell", align || "left")],
206
+ "onClick": (e) => handleHeaderCellClick(e, column)
207
+ }, [createVNode("span", {
208
+ "class": ns.em("header-cell", "caption")
209
+ }, [title]), enableSort && createVNode("span", {
210
+ "class": ns.e("caret-wrapper")
211
+ }, [createVNode("i", {
212
+ "class": [ns.em("caret-wrapper", "asc"), ns.em("caret-wrapper", "sort-caret"), ns.is("active", prop === key && order === "asc")],
213
+ "onClick": (e) => handleSortClick(e, column, "asc")
214
+ }, null), createVNode("i", {
215
+ "class": [ns.em("caret-wrapper", "desc"), ns.em("caret-wrapper", "sort-caret"), ns.is("active", prop === key && order === "desc")],
216
+ "onClick": (e) => handleSortClick(e, column, "desc")
217
+ }, null)])]);
218
+ };
219
+ const renderBodyCell = (params) => {
220
+ const {
221
+ column,
222
+ rowData
223
+ } = params;
224
+ const {
225
+ type,
226
+ key,
227
+ align
228
+ } = column;
229
+ if (type === "selection")
230
+ return createVNode("div", {
231
+ "class": [ns.e("cell"), ns.e("body-cell"), ns.em("cell", align || "left")],
232
+ "onClick": (evt) => evt.stopPropagation()
233
+ }, [createVNode(resolveComponent("el-checkbox"), {
234
+ "onChange": () => handleSelectionChange(rowData),
235
+ "modelValue": isSelected(rowData)
236
+ }, null)]);
237
+ const controller = c.columns[key];
238
+ const {
239
+ columnType
240
+ } = controller.model;
241
+ const row = c.findRowState(rowData);
242
+ return createVNode("div", {
243
+ "class": [ns.e("cell"), ns.e("body-cell"), ns.em("cell", align || "left")]
244
+ }, [columnType === "DEFGRIDCOLUMN" ? createVNode(resolveComponent("iBizGridFieldColumn"), {
245
+ "controller": controller,
246
+ "row": row
247
+ }, null) : createVNode(resolveComponent("iBizGridUAColumn"), {
248
+ "controller": controller,
249
+ "row": row
250
+ }, null)]);
251
+ };
252
+ return {
253
+ c,
254
+ ns,
255
+ tableRef,
256
+ tableData,
257
+ columnModel,
258
+ onPageChange,
259
+ onPageRefresh,
260
+ onPageSizeChange,
261
+ renderNoData,
262
+ calcRowClass,
263
+ renderBodyCell,
264
+ handleRowClick,
265
+ calcColumnWidth,
266
+ handleDbRowClick,
267
+ renderHeaderCell,
268
+ renderBatchToolBar
269
+ };
270
+ },
271
+ render() {
272
+ if (!this.c.state.isCreated)
273
+ return;
274
+ return createVNode(resolveComponent("iBizControlNavigation"), {
275
+ "controller": this.c
276
+ }, {
277
+ default: () => [createVNode(resolveComponent("iBizControlBase"), {
278
+ "controller": this.c,
279
+ "class": [this.ns.b(), this.ns.m(this.c.overflowMode), this.ns.is("dynamic-grid", this.c.state.isAutoGrid), this.ns.is("show-header", !this.c.state.hideHeader), this.ns.is("enable-page", this.c.state.enablePagingBar), this.ns.is("enable-group", this.c.model.enableGroup), this.ns.is("single-select", this.c.state.singleSelect), this.ns.is("empty", this.c.state.items.length === 0), this.ns.is("enable-customized", this.c.model.enableCustomized)]
280
+ }, {
281
+ default: () => [createVNode(resolveComponent("el-auto-resizer"), null, {
282
+ default: ({
283
+ height,
284
+ width
285
+ }) => {
286
+ const columns = this.calcColumnWidth(this.columnModel, width);
287
+ return createVNode(resolveComponent("el-table-v2"), {
288
+ "fixed": true,
289
+ "ref": "tableRef",
290
+ "width": width,
291
+ "height": height,
292
+ "row-height": 54,
293
+ "columns": columns,
294
+ "header-height": 54,
295
+ "data": this.tableData,
296
+ "class": this.ns.e("table"),
297
+ "row-class": this.calcRowClass,
298
+ "row-event-handlers": {
299
+ onClick: ({
300
+ event,
301
+ rowData
302
+ }) => this.handleRowClick(event, rowData),
303
+ onDblclick: ({
304
+ event,
305
+ rowData
306
+ }) => this.handleDbRowClick(event, rowData)
307
+ }
308
+ }, {
309
+ empty: this.renderNoData,
310
+ cell: this.renderBodyCell,
311
+ "header-cell": this.renderHeaderCell
312
+ });
313
+ }
314
+ }), this.c.model.enableCustomized && !this.c.state.hideHeader && createVNode("div", {
315
+ "class": this.ns.e("setting-box")
316
+ }, [createVNode(resolveComponent("iBizGridSetting"), {
317
+ "controller": this.c,
318
+ "columnStates": this.c.state.columnStates
319
+ }, null)]), this.renderBatchToolBar()]
320
+ })]
321
+ });
322
+ }
323
+ });
324
+
325
+ export { VirtualizedTableControl };
@@ -0,0 +1,10 @@
1
+ import { IControlProvider } from '@ibiz-template/runtime';
2
+ /**
3
+ * @description 虚拟表格适配器
4
+ * @export
5
+ * @class VirtualizedTableProvider
6
+ * @implements {IControlProvider}
7
+ */
8
+ export declare class VirtualizedTableProvider implements IControlProvider {
9
+ component: string;
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => {
5
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
+ return value;
7
+ };
8
+ class VirtualizedTableProvider {
9
+ constructor() {
10
+ __publicField(this, "component", "IBizVirtualizedTableControl");
11
+ }
12
+ }
13
+
14
+ export { VirtualizedTableProvider };
@@ -0,0 +1,95 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { ControlVO, GridController } from '@ibiz-template/runtime';
3
+ type orderDir = 'asc' | 'desc' | undefined;
4
+ /**
5
+ * @description 虚拟表格列模型
6
+ * @export
7
+ * @interface IColumn
8
+ */
9
+ export interface IColumn {
10
+ /**
11
+ * @description 列唯一标识(列模型代码标识)
12
+ * @type {string}
13
+ * @memberof IColumn
14
+ */
15
+ key: string;
16
+ /**
17
+ * @description 列类型
18
+ * @type {string}
19
+ * @memberof IColumn
20
+ */
21
+ type: string;
22
+ /**
23
+ * @description 列宽
24
+ * @type {number}
25
+ * @memberof IColumn
26
+ */
27
+ width: number;
28
+ /**
29
+ * @description 宽度单位
30
+ * @type {string}
31
+ * @memberof IColumn
32
+ */
33
+ widthUnit: string;
34
+ /**
35
+ * @description 是否隐藏列
36
+ * @type {boolean}
37
+ * @memberof IColumn
38
+ */
39
+ hidden: boolean;
40
+ /**
41
+ * @description 列标题
42
+ * @type {string}
43
+ * @memberof IColumn
44
+ */
45
+ title?: string;
46
+ /**
47
+ * @description 表格单元格内容对齐方式
48
+ * @type {('left' | 'center' | 'right')}
49
+ * @memberof IColumn
50
+ */
51
+ align?: string;
52
+ /**
53
+ * @description 列的类名
54
+ * @type {string}
55
+ * @memberof IColumn
56
+ */
57
+ class?: string;
58
+ /**
59
+ * @description 头部单元格样式
60
+ * @type {string}
61
+ * @memberof IColumn
62
+ */
63
+ headerClass?: string;
64
+ /**
65
+ * @description 固定列位置
66
+ * @type {('left' | 'right')}
67
+ * @memberof IColumn
68
+ */
69
+ fixed?: 'left' | 'right';
70
+ /**
71
+ * @description 设置列是否排序
72
+ * @type {boolean}
73
+ * @memberof IColumn
74
+ */
75
+ enableSort?: boolean;
76
+ }
77
+ export declare function useVirtualizedTable(c: GridController, props: IData): {
78
+ tableRef: Ref<any>;
79
+ tableData: ComputedRef<ControlVO[]>;
80
+ sortValue: ComputedRef<{
81
+ prop?: string;
82
+ order: orderDir;
83
+ }>;
84
+ columnModel: ComputedRef<IColumn[]>;
85
+ isAllSelected(): boolean;
86
+ isSelected(data: ControlVO): boolean;
87
+ handleSelectAll(state: boolean): void;
88
+ handleSelectionChange(data: ControlVO): void;
89
+ handleSortClick(event: MouseEvent, column: IColumn, newOrder: orderDir): void;
90
+ calcColumnWidth(_columns: IColumn[], bodyWidth: number): IColumn[];
91
+ handleRowClick(event: MouseEvent, data: ControlVO): Promise<void>;
92
+ handleDbRowClick(event: MouseEvent, data: ControlVO): Promise<void>;
93
+ handleHeaderCellClick(event: MouseEvent, column: IColumn): void;
94
+ };
95
+ export {};
@@ -0,0 +1,191 @@
1
+ import { watch, ref, computed } from 'vue';
2
+ import { ControlVO, GridRowState, Srfuf } from '@ibiz-template/runtime';
3
+
4
+ "use strict";
5
+ function useVirtualizedTable(c, props) {
6
+ const initSimpleData = () => {
7
+ if (!props.data)
8
+ return;
9
+ c.state.items = props.data;
10
+ c.state.rows = c.state.items.map((item) => {
11
+ const row = new GridRowState(new ControlVO(item), c);
12
+ return row;
13
+ });
14
+ c.calcAggResult(c.state.items);
15
+ c.calcTotalData();
16
+ };
17
+ c.evt.on("onCreated", async () => {
18
+ if (c.state.isSimple)
19
+ initSimpleData();
20
+ });
21
+ watch(
22
+ () => props.data,
23
+ () => {
24
+ if (c.state.isSimple)
25
+ initSimpleData();
26
+ },
27
+ {
28
+ deep: true
29
+ }
30
+ );
31
+ const tableRef = ref();
32
+ const tableData = computed(() => {
33
+ return c.state.rows.map((row) => row.data);
34
+ });
35
+ const sortValue = computed(() => {
36
+ var _a;
37
+ const [
38
+ prop = c.model.minorSortAppDEFieldId,
39
+ order = (_a = c.model.minorSortDir) == null ? void 0 : _a.toLowerCase()
40
+ ] = c.state.sortQuery.split(",");
41
+ return {
42
+ prop,
43
+ order
44
+ };
45
+ });
46
+ const columnModel = computed(() => {
47
+ const { columnStates, singleSelect } = c.state;
48
+ const columns = [];
49
+ if (!singleSelect)
50
+ columns.push({
51
+ key: c.id,
52
+ width: 55,
53
+ align: "center",
54
+ type: "selection",
55
+ widthUnit: "PX",
56
+ hidden: false,
57
+ class: "is-selection",
58
+ headerClass: "is-selection"
59
+ });
60
+ const { degridColumns } = c.model;
61
+ degridColumns == null ? void 0 : degridColumns.forEach((model) => {
62
+ const {
63
+ align,
64
+ width,
65
+ caption,
66
+ codeName,
67
+ widthUnit,
68
+ columnType,
69
+ cellSysCss,
70
+ enableSort
71
+ } = model;
72
+ const state = columnStates.find((s) => s.key === codeName);
73
+ columns.push({
74
+ key: codeName,
75
+ title: caption,
76
+ width: width || 160,
77
+ hidden: (state == null ? void 0 : state.hidden) === true,
78
+ enableSort: !!enableSort,
79
+ class: cellSysCss == null ? void 0 : cellSysCss.cssName,
80
+ widthUnit: widthUnit || "PX",
81
+ type: columnType.toLowerCase(),
82
+ headerClass: cellSysCss == null ? void 0 : cellSysCss.cssName,
83
+ align: (align == null ? void 0 : align.toLowerCase()) || "center"
84
+ });
85
+ });
86
+ return columns;
87
+ });
88
+ function toggleOrder(order) {
89
+ const sortOrders = ["asc", "desc", void 0];
90
+ if (order === void 0)
91
+ return sortOrders[0];
92
+ const index = sortOrders.indexOf(order || null);
93
+ return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
94
+ }
95
+ function handleSortChange(prop, order) {
96
+ const fieldName = c.fieldColumns[prop].model.appDEFieldId;
97
+ const sortQuery = "".concat(fieldName, ",").concat(order);
98
+ if (sortQuery === c.state.sortQuery)
99
+ return;
100
+ c.setSort(fieldName, order);
101
+ c.load({
102
+ isInitialLoad: c.model.pagingMode === 2 || c.model.pagingMode === 3
103
+ });
104
+ }
105
+ async function handleRowClick(event, data) {
106
+ if (data.srfuf === Srfuf.CREATE)
107
+ return;
108
+ await c.onRowClick(data);
109
+ }
110
+ async function handleDbRowClick(event, data) {
111
+ if (data.srfuf === Srfuf.CREATE)
112
+ return;
113
+ await c.onDbRowClick(data);
114
+ }
115
+ function handleHeaderCellClick(event, column) {
116
+ const { enableSort, key } = column;
117
+ if (enableSort) {
118
+ const { prop, order } = sortValue.value;
119
+ let newOrder = "asc";
120
+ if (prop === key)
121
+ newOrder = toggleOrder(order);
122
+ handleSortChange(key, newOrder);
123
+ }
124
+ }
125
+ function handleSortClick(event, column, newOrder) {
126
+ event.stopPropagation();
127
+ const { prop, order } = sortValue.value;
128
+ const { key } = column;
129
+ if (prop === key && newOrder === order)
130
+ newOrder = void 0;
131
+ handleSortChange(key, newOrder);
132
+ }
133
+ function isSelected(data) {
134
+ return !!c.state.selectedData.find((x) => x.srfkey === data.srfkey);
135
+ }
136
+ function isAllSelected() {
137
+ return tableData.value.length > 0 && tableData.value.every(
138
+ (data) => !!c.state.selectedData.find(
139
+ (selected) => data.srfkey === selected.srfkey
140
+ )
141
+ );
142
+ }
143
+ function handleSelectAll(state) {
144
+ c.setSelection(state ? [...c.state.items] : []);
145
+ }
146
+ function handleSelectionChange(data) {
147
+ const selection = [...c.state.selectedData];
148
+ const index = selection.findIndex(
149
+ (selected) => selected.srfkey === data.srfkey
150
+ );
151
+ index === -1 ? selection.push(data) : selection.splice(index, 1);
152
+ c.setSelection([...selection]);
153
+ }
154
+ function calcColumnWidth(_columns, bodyWidth) {
155
+ const columns = [..._columns];
156
+ const showColumns = columnModel.value.filter((model) => !model.hidden);
157
+ const totalWidth = showColumns.reduce(
158
+ (accumulator, currentValue) => accumulator + currentValue.width,
159
+ 0
160
+ );
161
+ if (bodyWidth > totalWidth && showColumns.length) {
162
+ let adaptiveColumn = showColumns.filter(
163
+ (model) => model.widthUnit === "STAR"
164
+ );
165
+ if (!adaptiveColumn.length)
166
+ adaptiveColumn = [showColumns[showColumns.length - 1]];
167
+ const width = (bodyWidth - totalWidth) / adaptiveColumn.length - 6;
168
+ adaptiveColumn.forEach(
169
+ (column) => Object.assign(column, { width: column.width + width })
170
+ );
171
+ }
172
+ return columns;
173
+ }
174
+ return {
175
+ tableRef,
176
+ tableData,
177
+ sortValue,
178
+ columnModel,
179
+ isSelected,
180
+ isAllSelected,
181
+ handleRowClick,
182
+ handleSortClick,
183
+ handleSelectAll,
184
+ calcColumnWidth,
185
+ handleDbRowClick,
186
+ handleHeaderCellClick,
187
+ handleSelectionChange
188
+ };
189
+ }
190
+
191
+ export { useVirtualizedTable };
@@ -47,6 +47,7 @@ export { IBizFormRawItem } from './form/form-detail/form-rawitem/index.mjs';
47
47
  export { IBizFormTabPanel } from './form/form-detail/form-tab-panel/index.mjs';
48
48
  export { IBizFormTabPage } from './form/form-detail/form-tab-page/index.mjs';
49
49
  export { IBizFormButtonList } from './form/form-detail/form-button-list/index.mjs';
50
+ export { IBizFormIFrame } from './form/form-detail/form-iframe/index.mjs';
50
51
  export { IBizEditFormControl } from './form/edit-form/index.mjs';
51
52
  export { IBizFormControl } from './form/form/index.mjs';
52
53
  export { DataViewControlProvider } from './data-view/data-view.provider.mjs';