vxe-table 4.23.7 → 4.23.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +5859 -4018
- package/es/colgroup/index.js +1 -1
- package/es/column/index.js +1 -1
- package/es/components.d.ts +3 -0
- package/es/components.js +4 -8
- package/es/grid/index.js +1 -1
- package/es/grid/src/emits.js +1 -15
- package/es/grid/src/grid.js +398 -121
- package/es/grid/src/props.js +1 -1
- package/es/index.esm.js +6 -0
- package/es/index.js +6 -0
- package/es/table/index.js +1 -1
- package/es/table/module/custom/hook.js +50 -43
- package/es/table/module/custom/panel.js +778 -528
- package/es/table/module/edit/hook.js +141 -63
- package/es/table/module/export/export-panel.js +400 -317
- package/es/table/module/export/hook.js +396 -338
- package/es/table/module/export/import-panel.js +153 -124
- package/es/table/module/filter/hook.js +17 -3
- package/es/table/module/filter/panel.js +147 -85
- package/es/table/module/keyboard/hook.js +9 -5
- package/es/table/module/menu/hook.js +1 -1
- package/es/table/module/menu/panel.js +198 -127
- package/es/table/module/validator/hook.js +1 -1
- package/es/table/render/index.js +152 -99
- package/es/table/src/body.js +356 -234
- package/es/table/src/cell.js +427 -270
- package/es/table/src/columnInfo.js +2 -1
- package/es/table/src/footer.js +145 -100
- package/es/table/src/group.js +7 -3
- package/es/table/src/header.js +230 -173
- package/es/table/src/props.js +1 -1
- package/es/table/src/table.js +1504 -1031
- package/es/table/src/util.js +15 -19
- package/es/toolbar/index.js +1 -1
- package/es/toolbar/src/toolbar.js +133 -76
- package/es/ui/index.d.ts +0 -1
- package/es/ui/index.js +1 -2
- package/es/ui/src/dom.js +9 -6
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.d.ts +1 -1
- package/es/v-x-e-table/index.d.ts +0 -1
- package/es/v-x-e-table/index.js +0 -1
- package/lib/colgroup/index.js +5 -5
- package/lib/column/index.js +5 -5
- package/lib/components.js +8 -12
- package/lib/grid/index.js +4 -4
- package/lib/grid/src/emits.js +1 -15
- package/lib/grid/src/grid.js +419 -142
- package/lib/grid/src/props.js +2 -2
- package/lib/index.common.js +6 -0
- package/lib/index.js +6 -0
- package/lib/index.umd.js +5825 -3945
- package/lib/index.umd.min.js +3 -3
- package/lib/table/index.js +5 -5
- package/lib/table/module/custom/hook.js +51 -44
- package/lib/table/module/custom/panel.js +790 -540
- package/lib/table/module/edit/hook.js +142 -64
- package/lib/table/module/export/export-panel.js +406 -323
- package/lib/table/module/export/hook.js +419 -361
- package/lib/table/module/export/import-panel.js +157 -128
- package/lib/table/module/filter/hook.js +18 -4
- package/lib/table/module/filter/panel.js +149 -87
- package/lib/table/module/keyboard/hook.js +10 -6
- package/lib/table/module/menu/hook.js +2 -2
- package/lib/table/module/menu/panel.js +199 -128
- package/lib/table/module/validator/hook.js +2 -2
- package/lib/table/render/index.js +153 -100
- package/lib/table/src/body.js +357 -235
- package/lib/table/src/cell.js +428 -271
- package/lib/table/src/columnInfo.js +3 -2
- package/lib/table/src/footer.js +146 -101
- package/lib/table/src/group.js +7 -3
- package/lib/table/src/header.js +231 -174
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/table.js +1487 -1045
- package/lib/table/src/util.js +15 -19
- package/lib/toolbar/index.js +4 -4
- package/lib/toolbar/src/toolbar.js +135 -78
- package/lib/ui/index.js +1 -3
- package/lib/ui/src/dom.js +9 -6
- package/lib/ui/src/log.js +1 -1
- package/lib/v-x-e-table/index.js +0 -2
- package/package.json +8 -3
- package/packages/colgroup/index.ts +22 -22
- package/packages/column/index.ts +22 -22
- package/packages/components.ts +41 -43
- package/packages/grid/index.ts +18 -18
- package/packages/grid/src/emits.ts +5 -19
- package/packages/grid/src/grid.ts +2229 -1925
- package/packages/grid/src/props.ts +22 -23
- package/packages/index.ts +11 -4
- package/packages/locale/lang/fr-FR.ts +15 -15
- package/packages/locale/lang/it-IT.ts +4 -4
- package/packages/locale/lang/uk-UA.ts +1 -1
- package/packages/locale/lang/uz-UZ.ts +13 -13
- package/packages/locale/lang/zh-CN.ts +907 -907
- package/packages/table/index.ts +26 -26
- package/packages/table/module/custom/hook.ts +510 -503
- package/packages/table/module/custom/panel.ts +2002 -1743
- package/packages/table/module/edit/hook.ts +1224 -1131
- package/packages/table/module/export/export-panel.ts +697 -611
- package/packages/table/module/export/hook.ts +2160 -2059
- package/packages/table/module/export/import-panel.ts +319 -279
- package/packages/table/module/export/util.ts +25 -24
- package/packages/table/module/filter/hook.ts +519 -501
- package/packages/table/module/filter/panel.ts +368 -304
- package/packages/table/module/keyboard/hook.ts +498 -494
- package/packages/table/module/menu/hook.ts +330 -330
- package/packages/table/module/menu/panel.ts +272 -201
- package/packages/table/module/validator/hook.ts +653 -635
- package/packages/table/render/index.ts +1819 -1744
- package/packages/table/src/body.ts +1078 -955
- package/packages/table/src/cell.ts +1524 -1359
- package/packages/table/src/column.ts +192 -192
- package/packages/table/src/columnInfo.ts +232 -232
- package/packages/table/src/emits.ts +134 -134
- package/packages/table/src/footer.ts +425 -380
- package/packages/table/src/group.ts +67 -63
- package/packages/table/src/header.ts +642 -581
- package/packages/table/src/props.ts +336 -336
- package/packages/table/src/store.ts +14 -14
- package/packages/table/src/table.ts +16011 -15454
- package/packages/table/src/use/cell-view.ts +41 -44
- package/packages/table/src/use/index.ts +1 -1
- package/packages/table/src/util.ts +1206 -1216
- package/packages/toolbar/index.ts +18 -18
- package/packages/toolbar/src/toolbar.ts +768 -706
- package/packages/ui/index.ts +519 -521
- package/packages/ui/src/anime.ts +51 -52
- package/packages/ui/src/comp.ts +3 -3
- package/packages/ui/src/dom.ts +466 -463
- package/packages/ui/src/log.ts +19 -19
- package/packages/ui/src/utils.ts +66 -66
- package/packages/ui/src/vn.ts +55 -55
- package/packages/v-x-e-table/index.d.ts +3 -4
- package/packages/v-x-e-table/index.ts +3 -4
- package/types/all.d.ts +76 -76
- package/types/index.d.ts +4 -4
- /package/dist/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
- /package/dist/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
- /package/dist/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
- /package/es/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
- /package/es/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
- /package/es/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
- /package/lib/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
- /package/lib/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
- /package/lib/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
|
@@ -33,12 +33,12 @@ __export(import_panel_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(import_panel_exports);
|
|
34
34
|
var import_vue = require("vue");
|
|
35
35
|
var import_comp = require("../../../ui/src/comp");
|
|
36
|
-
var
|
|
36
|
+
var import_core = require("@vxe-ui/core");
|
|
37
37
|
var import_xe_utils = __toESM(require("xe-utils"));
|
|
38
38
|
var import_utils = require("../../../ui/src/utils");
|
|
39
39
|
var import_log = require("../../../ui/src/log");
|
|
40
40
|
const { errLog } = (0, import_log.createComponentLog)("table");
|
|
41
|
-
const { getI18n, getIcon, renderEmptyElement } =
|
|
41
|
+
const { getI18n, getIcon, renderEmptyElement } = import_core.VxeUI;
|
|
42
42
|
var import_panel_default = (0, import_comp.defineVxeComponent)({
|
|
43
43
|
name: "VxeTableImportPanel",
|
|
44
44
|
props: {
|
|
@@ -52,9 +52,9 @@ var import_panel_default = (0, import_comp.defineVxeComponent)({
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
setup(props) {
|
|
55
|
-
const VxeUIModalComponent =
|
|
56
|
-
const VxeUIButtonComponent =
|
|
57
|
-
const VxeUISelectComponent =
|
|
55
|
+
const VxeUIModalComponent = import_core.VxeUI.getComponent("VxeModal");
|
|
56
|
+
const VxeUIButtonComponent = import_core.VxeUI.getComponent("VxeButton");
|
|
57
|
+
const VxeUISelectComponent = import_core.VxeUI.getComponent("VxeSelect");
|
|
58
58
|
const $xeTable = (0, import_vue.inject)("$xeTable", {});
|
|
59
59
|
const { computeImportOpts } = $xeTable.getComputeMaps();
|
|
60
60
|
const reactData = (0, import_vue.reactive)({
|
|
@@ -132,135 +132,164 @@ var import_panel_default = (0, import_comp.defineVxeComponent)({
|
|
|
132
132
|
const bottomSlot = slots.bottom;
|
|
133
133
|
const defaultSlot = slots.default;
|
|
134
134
|
const footerSlot = slots.footer;
|
|
135
|
-
return VxeUIModalComponent ? (0, import_vue.h)(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
135
|
+
return VxeUIModalComponent ? (0, import_vue.h)(
|
|
136
|
+
VxeUIModalComponent,
|
|
137
|
+
{
|
|
138
|
+
id: "VXE_IMPORT_MODAL",
|
|
139
|
+
modelValue: storeData.visible,
|
|
140
|
+
title: modelOptions.title || getI18n("vxe.import.impTitle"),
|
|
141
|
+
className: "vxe-table-export-popup-wrapper",
|
|
142
|
+
width: modelOptions.width || 540,
|
|
143
|
+
height: modelOptions.height,
|
|
144
|
+
minWidth: modelOptions.minWidth || 360,
|
|
145
|
+
minHeight: modelOptions.minHeight || 240,
|
|
146
|
+
mask: (0, import_utils.getDefaultConfig)(modelOptions.mask, true),
|
|
147
|
+
lockView: (0, import_utils.getDefaultConfig)(modelOptions.lockView, true),
|
|
148
|
+
showFooter: true,
|
|
149
|
+
escClosable: true,
|
|
150
|
+
maskClosable: true,
|
|
151
|
+
position: modelOptions.position,
|
|
152
|
+
fullscreen: modelOptions.fullscreen,
|
|
153
|
+
remember: modelOptions.remember,
|
|
154
|
+
showMinimize: modelOptions.showMinimize,
|
|
155
|
+
showMaximize: (0, import_utils.getDefaultConfig)(modelOptions.showMaximize, true),
|
|
156
|
+
resize: (0, import_utils.getDefaultConfig)(modelOptions.resize, true),
|
|
157
|
+
loading: reactData.loading,
|
|
158
|
+
"onUpdate:modelValue"(value) {
|
|
159
|
+
storeData.visible = value;
|
|
160
|
+
},
|
|
161
|
+
onShow: showEvent
|
|
158
162
|
},
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return (0, import_vue.h)("div", {
|
|
170
|
-
class: "vxe-table-export--panel"
|
|
171
|
-
}, [
|
|
172
|
-
topSlot ? (0, import_vue.h)("div", {
|
|
173
|
-
class: "vxe-table-export--panel-top"
|
|
174
|
-
}, $xeTable.callSlot(topSlot, params)) : renderEmptyElement($xeTable),
|
|
175
|
-
(0, import_vue.h)(
|
|
163
|
+
{
|
|
164
|
+
default: () => {
|
|
165
|
+
const params = {
|
|
166
|
+
$table: $xeTable,
|
|
167
|
+
$grid: $xeGrid,
|
|
168
|
+
$gantt: $xeGantt,
|
|
169
|
+
options: defaultOptions,
|
|
170
|
+
params: defaultOptions.params
|
|
171
|
+
};
|
|
172
|
+
return (0, import_vue.h)(
|
|
176
173
|
"div",
|
|
177
174
|
{
|
|
178
|
-
class: "vxe-table-export--panel
|
|
175
|
+
class: "vxe-table-export--panel"
|
|
179
176
|
},
|
|
180
|
-
|
|
181
|
-
(0, import_vue.h)(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
177
|
+
[
|
|
178
|
+
topSlot ? (0, import_vue.h)(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
class: "vxe-table-export--panel-top"
|
|
182
|
+
},
|
|
183
|
+
$xeTable.callSlot(topSlot, params)
|
|
184
|
+
) : renderEmptyElement($xeTable),
|
|
185
|
+
(0, import_vue.h)(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
class: "vxe-table-export--panel-body"
|
|
189
|
+
},
|
|
190
|
+
defaultSlot ? $xeTable.callSlot(defaultSlot, params) : [
|
|
191
|
+
(0, import_vue.h)(
|
|
192
|
+
"table",
|
|
193
|
+
{
|
|
194
|
+
class: "vxe-table-export--panel-table",
|
|
195
|
+
cellspacing: 0,
|
|
196
|
+
cellpadding: 0,
|
|
197
|
+
border: 0
|
|
198
|
+
},
|
|
199
|
+
[
|
|
200
|
+
(0, import_vue.h)("tbody", [
|
|
201
|
+
(0, import_vue.h)("tr", [
|
|
202
|
+
(0, import_vue.h)("td", getI18n("vxe.import.impFile")),
|
|
203
|
+
(0, import_vue.h)("td", [
|
|
204
|
+
hasFile ? (0, import_vue.h)(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
class: "vxe-table-export--selected--file",
|
|
208
|
+
title: selectName
|
|
209
|
+
},
|
|
210
|
+
[
|
|
211
|
+
(0, import_vue.h)("span", selectName),
|
|
212
|
+
(0, import_vue.h)("i", {
|
|
213
|
+
class: getIcon().INPUT_CLEAR,
|
|
214
|
+
onClick: clearFileEvent
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
) : (0, import_vue.h)(
|
|
218
|
+
"button",
|
|
219
|
+
{
|
|
220
|
+
ref: refFileBtn,
|
|
221
|
+
class: "vxe-table-export--select--file",
|
|
222
|
+
onClick: selectFileEvent
|
|
223
|
+
},
|
|
224
|
+
getI18n("vxe.import.impSelect")
|
|
225
|
+
)
|
|
226
|
+
])
|
|
227
|
+
]),
|
|
228
|
+
(0, import_vue.h)("tr", [(0, import_vue.h)("td", getI18n("vxe.import.impType")), (0, import_vue.h)("td", parseTypeLabel)]),
|
|
229
|
+
settingOptions.showMode === false ? renderEmptyElement($xeTable) : (0, import_vue.h)("tr", [
|
|
230
|
+
(0, import_vue.h)("td", getI18n("vxe.import.impMode")),
|
|
231
|
+
(0, import_vue.h)("td", [
|
|
232
|
+
VxeUISelectComponent ? (0, import_vue.h)(VxeUISelectComponent, {
|
|
233
|
+
modelValue: defaultOptions.mode,
|
|
234
|
+
options: storeData.modeList,
|
|
235
|
+
"onUpdate:modelValue"(value) {
|
|
236
|
+
defaultOptions.mode = value;
|
|
237
|
+
}
|
|
238
|
+
}) : renderEmptyElement($xeTable)
|
|
239
|
+
])
|
|
240
|
+
])
|
|
241
|
+
])
|
|
242
|
+
]
|
|
243
|
+
)
|
|
244
|
+
]
|
|
245
|
+
),
|
|
246
|
+
bottomSlot ? (0, import_vue.h)(
|
|
247
|
+
"div",
|
|
248
|
+
{
|
|
249
|
+
class: "vxe-table-export--panel-bottom"
|
|
250
|
+
},
|
|
251
|
+
$xeTable.callSlot(bottomSlot, params)
|
|
252
|
+
) : renderEmptyElement($xeTable)
|
|
225
253
|
]
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
254
|
+
);
|
|
255
|
+
},
|
|
256
|
+
footer() {
|
|
257
|
+
const params = {
|
|
258
|
+
$table: $xeTable,
|
|
259
|
+
$grid: $xeGrid,
|
|
260
|
+
$gantt: $xeGantt,
|
|
261
|
+
options: defaultOptions,
|
|
262
|
+
params: defaultOptions.params
|
|
263
|
+
};
|
|
264
|
+
return (0, import_vue.h)(
|
|
265
|
+
"div",
|
|
266
|
+
{
|
|
267
|
+
class: "vxe-table-export--panel-footer"
|
|
268
|
+
},
|
|
269
|
+
footerSlot ? $xeTable.callSlot(footerSlot, params) : [
|
|
270
|
+
(0, import_vue.h)(
|
|
271
|
+
"div",
|
|
272
|
+
{
|
|
273
|
+
class: "vxe-table-export--panel-btns"
|
|
274
|
+
},
|
|
275
|
+
[
|
|
276
|
+
VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
277
|
+
content: getI18n("vxe.import.impCancel"),
|
|
278
|
+
onClick: cancelEvent
|
|
279
|
+
}) : renderEmptyElement($xeTable),
|
|
280
|
+
VxeUIButtonComponent ? (0, import_vue.h)(VxeUIButtonComponent, {
|
|
281
|
+
status: "primary",
|
|
282
|
+
disabled: !hasFile || reactData.loading,
|
|
283
|
+
content: getI18n("vxe.import.impConfirm"),
|
|
284
|
+
onClick: importEvent
|
|
285
|
+
}) : renderEmptyElement($xeTable)
|
|
286
|
+
]
|
|
287
|
+
)
|
|
288
|
+
]
|
|
289
|
+
);
|
|
290
|
+
}
|
|
262
291
|
}
|
|
263
|
-
|
|
292
|
+
) : renderEmptyElement($xeTable);
|
|
264
293
|
};
|
|
265
294
|
(0, import_vue.nextTick)(() => {
|
|
266
295
|
if (!VxeUIModalComponent) {
|
|
@@ -23,12 +23,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
));
|
|
24
24
|
var import_vue = require("vue");
|
|
25
25
|
var import_xe_utils = __toESM(require("xe-utils"));
|
|
26
|
-
var
|
|
26
|
+
var import_core = require("@vxe-ui/core");
|
|
27
27
|
var import_util = require("../../src/util");
|
|
28
28
|
var import_dom = require("../../../ui/src/dom");
|
|
29
29
|
var import_utils = require("../../../ui/src/utils");
|
|
30
|
-
const { renderer, hooks } =
|
|
31
|
-
const tableFilterMethodKeys = [
|
|
30
|
+
const { renderer, hooks } = import_core.VxeUI;
|
|
31
|
+
const tableFilterMethodKeys = [
|
|
32
|
+
"openFilter",
|
|
33
|
+
"setFilter",
|
|
34
|
+
"clearFilter",
|
|
35
|
+
"saveFilter",
|
|
36
|
+
"saveFilterByEvent",
|
|
37
|
+
"saveFilterPanel",
|
|
38
|
+
"saveFilterPanelByEvent",
|
|
39
|
+
"resetFilter",
|
|
40
|
+
"resetFilterByEvent",
|
|
41
|
+
"resetFilterPanel",
|
|
42
|
+
"resetFilterPanelByEvent",
|
|
43
|
+
"getCheckedFilters",
|
|
44
|
+
"updateFilterOptionStatus"
|
|
45
|
+
];
|
|
32
46
|
const sourceType = "table";
|
|
33
47
|
hooks.add("tableFilterModule", {
|
|
34
48
|
setupTable($xeTable) {
|
|
@@ -221,7 +235,7 @@ hooks.add("tableFilterModule", {
|
|
|
221
235
|
$xeTable.closeFilter();
|
|
222
236
|
return $xeTable.updateFooter().then(() => {
|
|
223
237
|
const { scrollXLoad, scrollYLoad } = reactData;
|
|
224
|
-
if (oldScrollXLoad || scrollXLoad ||
|
|
238
|
+
if (oldScrollXLoad || scrollXLoad || oldScrollYLoad || scrollYLoad) {
|
|
225
239
|
if (oldScrollXLoad || scrollXLoad) {
|
|
226
240
|
$xeTable.updateScrollXSpace();
|
|
227
241
|
}
|
|
@@ -33,14 +33,14 @@ __export(panel_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(panel_exports);
|
|
34
34
|
var import_vue = require("vue");
|
|
35
35
|
var import_comp = require("../../../ui/src/comp");
|
|
36
|
-
var
|
|
36
|
+
var import_core = require("@vxe-ui/core");
|
|
37
37
|
var import_utils = require("../../../ui/src/utils");
|
|
38
38
|
var import_dom = require("../../../ui/src/dom");
|
|
39
39
|
var import_vn = require("../../../ui/src/vn");
|
|
40
40
|
var import_log = require("../../../ui/src/log");
|
|
41
41
|
var import_xe_utils = __toESM(require("xe-utils"));
|
|
42
42
|
const { warnLog } = (0, import_log.createComponentLog)("table");
|
|
43
|
-
const { getI18n, getIcon, renderer, renderEmptyElement } =
|
|
43
|
+
const { getI18n, getIcon, renderer, renderEmptyElement } = import_core.VxeUI;
|
|
44
44
|
var panel_default = (0, import_comp.defineVxeComponent)({
|
|
45
45
|
name: "VxeTableFilterPanel",
|
|
46
46
|
props: {
|
|
@@ -51,7 +51,7 @@ var panel_default = (0, import_comp.defineVxeComponent)({
|
|
|
51
51
|
},
|
|
52
52
|
setup(props, context) {
|
|
53
53
|
const xID = import_xe_utils.default.uniqueId();
|
|
54
|
-
const VxeUIScrollbarComponent =
|
|
54
|
+
const VxeUIScrollbarComponent = import_core.VxeUI.getComponent("VxeScrollbar");
|
|
55
55
|
const $xeTable = (0, import_vue.inject)("$xeTable", {});
|
|
56
56
|
const { reactData: tableReactData, internalData: tableInternalData, getComputeMaps } = $xeTable;
|
|
57
57
|
const { computeFilterOpts, computeRendererOpts } = getComputeMaps();
|
|
@@ -135,15 +135,23 @@ var panel_default = (0, import_comp.defineVxeComponent)({
|
|
|
135
135
|
const rtFilter = compConf ? compConf.renderTableFilter || compConf.renderFilter : null;
|
|
136
136
|
if (filterSlot) {
|
|
137
137
|
return [
|
|
138
|
-
(0, import_vue.h)(
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
(0, import_vue.h)(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
class: "vxe-table--filter-template"
|
|
142
|
+
},
|
|
143
|
+
$xeTable.callSlot(filterSlot, params)
|
|
144
|
+
)
|
|
141
145
|
];
|
|
142
146
|
} else if (filterRender && rtFilter) {
|
|
143
147
|
return [
|
|
144
|
-
(0, import_vue.h)(
|
|
145
|
-
|
|
146
|
-
|
|
148
|
+
(0, import_vue.h)(
|
|
149
|
+
"div",
|
|
150
|
+
{
|
|
151
|
+
class: "vxe-table--filter-template"
|
|
152
|
+
},
|
|
153
|
+
(0, import_vn.getSlotVNs)(rtFilter(filterRender, params))
|
|
154
|
+
)
|
|
147
155
|
];
|
|
148
156
|
}
|
|
149
157
|
const isAllChecked = filterMultiple ? filterStore.isAllSelected : !filterOptions.some((item) => item._checked);
|
|
@@ -151,55 +159,89 @@ var panel_default = (0, import_comp.defineVxeComponent)({
|
|
|
151
159
|
const optVNs = filterOptions.map((item) => {
|
|
152
160
|
const isChecked = item._checked;
|
|
153
161
|
const isIndeterminate = false;
|
|
154
|
-
return (0, import_vue.h)(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
class: ["vxe-checkbox--icon", isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
165
|
-
})
|
|
166
|
-
] : []).concat([
|
|
167
|
-
(0, import_vue.h)("span", {
|
|
168
|
-
class: "vxe-checkbox--label"
|
|
169
|
-
}, (0, import_utils.formatText)(item.label, 1))
|
|
170
|
-
]));
|
|
171
|
-
});
|
|
172
|
-
return [
|
|
173
|
-
(0, import_vue.h)("div", {
|
|
174
|
-
class: "vxe-table--filter-header"
|
|
175
|
-
}, [
|
|
176
|
-
(0, import_vue.h)("div", {
|
|
177
|
-
class: ["vxe-table--filter-option", {
|
|
178
|
-
"is--checked": isAllChecked,
|
|
179
|
-
"is--indeterminate": isAllIndeterminate
|
|
180
|
-
}],
|
|
181
|
-
title: getI18n(filterMultiple ? "vxe.table.allTitle" : "vxe.table.allFilter"),
|
|
162
|
+
return (0, import_vue.h)(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
class: [
|
|
166
|
+
"vxe-table--filter-option",
|
|
167
|
+
{
|
|
168
|
+
"is--checked": item._checked
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
title: item.label,
|
|
182
172
|
onClick: (evnt) => {
|
|
183
|
-
|
|
173
|
+
changeOption(evnt, !item._checked, item);
|
|
184
174
|
}
|
|
185
|
-
},
|
|
175
|
+
},
|
|
176
|
+
(filterMultiple ? [
|
|
186
177
|
(0, import_vue.h)("span", {
|
|
187
|
-
class: ["vxe-checkbox--icon",
|
|
178
|
+
class: ["vxe-checkbox--icon", isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
188
179
|
})
|
|
189
180
|
] : []).concat([
|
|
190
|
-
(0, import_vue.h)(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
181
|
+
(0, import_vue.h)(
|
|
182
|
+
"span",
|
|
183
|
+
{
|
|
184
|
+
class: "vxe-checkbox--label"
|
|
185
|
+
},
|
|
186
|
+
(0, import_utils.formatText)(item.label, 1)
|
|
187
|
+
)
|
|
188
|
+
])
|
|
189
|
+
);
|
|
190
|
+
});
|
|
191
|
+
return [
|
|
192
|
+
(0, import_vue.h)(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
class: "vxe-table--filter-header"
|
|
196
|
+
},
|
|
197
|
+
[
|
|
198
|
+
(0, import_vue.h)(
|
|
199
|
+
"div",
|
|
200
|
+
{
|
|
201
|
+
class: [
|
|
202
|
+
"vxe-table--filter-option",
|
|
203
|
+
{
|
|
204
|
+
"is--checked": isAllChecked,
|
|
205
|
+
"is--indeterminate": isAllIndeterminate
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
title: getI18n(filterMultiple ? "vxe.table.allTitle" : "vxe.table.allFilter"),
|
|
209
|
+
onClick: (evnt) => {
|
|
210
|
+
changeAllOption(evnt, !filterStore.isAllSelected);
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
(filterMultiple ? [
|
|
214
|
+
(0, import_vue.h)("span", {
|
|
215
|
+
class: ["vxe-checkbox--icon", isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
216
|
+
})
|
|
217
|
+
] : []).concat([
|
|
218
|
+
(0, import_vue.h)(
|
|
219
|
+
"span",
|
|
220
|
+
{
|
|
221
|
+
class: "vxe-checkbox--label"
|
|
222
|
+
},
|
|
223
|
+
getI18n("vxe.table.allFilter")
|
|
224
|
+
)
|
|
225
|
+
])
|
|
226
|
+
)
|
|
227
|
+
]
|
|
228
|
+
),
|
|
229
|
+
useScrollbar ? (0, import_vue.h)(
|
|
230
|
+
VxeUIScrollbarComponent,
|
|
231
|
+
{
|
|
232
|
+
class: "vxe-table--scrollbar-filter-body",
|
|
233
|
+
viewClassName: "vxe-table--scrollbar-filter-body-view"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
default: () => optVNs
|
|
237
|
+
}
|
|
238
|
+
) : (0, import_vue.h)(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
class: "vxe-table--filter-body"
|
|
242
|
+
},
|
|
243
|
+
optVNs
|
|
244
|
+
)
|
|
203
245
|
];
|
|
204
246
|
};
|
|
205
247
|
const renderFooters = () => {
|
|
@@ -222,20 +264,32 @@ var panel_default = (0, import_comp.defineVxeComponent)({
|
|
|
222
264
|
showFlFoot = !(compConf.showTableFilterFooter === false || compConf.showFilterFooter === false || compConf.isFooter === false);
|
|
223
265
|
}
|
|
224
266
|
return showFlFoot ? [
|
|
225
|
-
(0, import_vue.h)(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
267
|
+
(0, import_vue.h)(
|
|
268
|
+
"div",
|
|
269
|
+
{
|
|
270
|
+
class: "vxe-table--filter-footer"
|
|
271
|
+
},
|
|
272
|
+
[
|
|
273
|
+
(0, import_vue.h)(
|
|
274
|
+
"button",
|
|
275
|
+
{
|
|
276
|
+
class: {
|
|
277
|
+
"is--disabled": isDisabled
|
|
278
|
+
},
|
|
279
|
+
disabled: isDisabled,
|
|
280
|
+
onClick: confirmFilter
|
|
281
|
+
},
|
|
282
|
+
confirmButtonText || getI18n("vxe.table.confirmFilter")
|
|
283
|
+
),
|
|
284
|
+
(0, import_vue.h)(
|
|
285
|
+
"button",
|
|
286
|
+
{
|
|
287
|
+
onClick: resetFilter
|
|
288
|
+
},
|
|
289
|
+
resetButtonText || getI18n("vxe.table.resetFilter")
|
|
290
|
+
)
|
|
291
|
+
]
|
|
292
|
+
)
|
|
239
293
|
] : [];
|
|
240
294
|
};
|
|
241
295
|
const renderVN = () => {
|
|
@@ -255,27 +309,35 @@ var panel_default = (0, import_comp.defineVxeComponent)({
|
|
|
255
309
|
const vSize = computeSize.value;
|
|
256
310
|
const filterOpts = computeFilterOpts.value;
|
|
257
311
|
const { transfer, destroyOnClose, className } = filterOpts;
|
|
258
|
-
return (0, import_vue.h)(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
"
|
|
267
|
-
className,
|
|
268
|
-
(0, import_dom.getPropClass)(filterClassName, params),
|
|
312
|
+
return (0, import_vue.h)(
|
|
313
|
+
import_vue.Teleport,
|
|
314
|
+
{
|
|
315
|
+
to: "body",
|
|
316
|
+
disabled: !transfer
|
|
317
|
+
},
|
|
318
|
+
[
|
|
319
|
+
(0, import_vue.h)(
|
|
320
|
+
"div",
|
|
269
321
|
{
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
322
|
+
ref: refElem,
|
|
323
|
+
class: [
|
|
324
|
+
"vxe-table--filter-wrapper",
|
|
325
|
+
"filter--prevent-default",
|
|
326
|
+
className,
|
|
327
|
+
(0, import_dom.getPropClass)(filterClassName, params),
|
|
328
|
+
{
|
|
329
|
+
[`size--${vSize}`]: vSize,
|
|
330
|
+
"is--animat": tableProps.animat,
|
|
331
|
+
"is--multiple": column.filterMultiple,
|
|
332
|
+
"is--active": visible
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
style: filterStore.style
|
|
336
|
+
},
|
|
337
|
+
initStore.filter && (destroyOnClose ? visible : true) && column ? renderOptions(filterRender, compConf).concat(renderFooters()) : []
|
|
338
|
+
)
|
|
339
|
+
]
|
|
340
|
+
);
|
|
279
341
|
};
|
|
280
342
|
$xeFilterPanel.renderVN = renderVN;
|
|
281
343
|
return $xeFilterPanel;
|