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