vxe-table 4.2.6-beta.0 → 4.2.6-beta.3
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/es/edit/src/hook.js +3 -2
- package/es/form/src/form.js +8 -9
- package/es/form/style.css +2 -1
- package/es/grid/src/grid.js +8 -5
- package/es/list/src/list.js +8 -9
- package/es/loading/index.js +7 -0
- package/es/loading/src/loading.js +31 -0
- package/es/locale/lang/en-US.js +3 -0
- package/es/locale/lang/ja-JP.js +3 -0
- package/es/locale/lang/zh-CN.js +3 -0
- package/es/locale/lang/zh-TC.js +3 -0
- package/es/modal/src/modal.js +17 -13
- package/es/select/style.css +0 -64
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/table.js +10 -10
- package/es/table/style.css +0 -63
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +1 -1
- package/es/v-x-e-table/src/conf.js +3 -0
- package/es/v-x-e-table/style.css +558 -0
- package/lib/edit/src/hook.js +3 -3
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/form/src/form.js +10 -7
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/style/style.css +2 -1
- package/lib/form/style/style.min.css +1 -1
- package/lib/grid/src/grid.js +12 -7
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +108 -46
- package/lib/index.umd.min.js +1 -1
- package/lib/list/src/list.js +10 -7
- package/lib/list/src/list.min.js +1 -1
- package/lib/loading/index.js +19 -0
- package/lib/loading/index.min.js +1 -0
- package/lib/loading/src/loading.js +39 -0
- package/lib/loading/src/loading.min.js +1 -0
- package/lib/locale/lang/en-US.js +3 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +3 -0
- package/lib/locale/lang/ja-JP.js +3 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +3 -0
- package/lib/locale/lang/zh-CN.js +3 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +3 -0
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +3 -0
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +3 -0
- package/lib/locale/lang/zh-TC.js +3 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +3 -0
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +3 -0
- package/lib/modal/src/modal.js +19 -11
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/select/style/style.css +0 -64
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/table.js +13 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +0 -63
- package/lib/table/style/style.min.css +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +3 -0
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +558 -0
- package/lib/v-x-e-table/style/style.min.css +1 -0
- package/package.json +1 -1
- package/packages/edit/src/hook.ts +3 -2
- package/packages/form/src/form.ts +8 -9
- package/packages/grid/src/grid.ts +8 -5
- package/packages/list/src/list.ts +8 -9
- package/packages/loading/index.ts +10 -0
- package/packages/loading/src/loading.ts +32 -0
- package/packages/locale/lang/en-US.ts +3 -0
- package/packages/locale/lang/ja-JP.ts +3 -0
- package/packages/locale/lang/zh-CN.ts +3 -0
- package/packages/locale/lang/zh-TC.ts +3 -0
- package/packages/modal/src/modal.ts +16 -13
- package/packages/table/src/table.ts +10 -10
- package/packages/v-x-e-table/src/conf.ts +4 -0
- package/styles/form.scss +1 -0
- package/styles/{base/loading.scss → loading.scss} +17 -4
- package/styles/modules.scss +1 -0
- package/styles/select.scss +0 -1
- package/styles/table.scss +0 -1
- package/styles/v-x-e-table.scss +2 -0
- package/types/table.d.ts +12 -0
package/es/edit/src/hook.js
CHANGED
|
@@ -607,17 +607,18 @@ var editHook = {
|
|
|
607
607
|
var editConfig = props.editConfig, mouseConfig = props.mouseConfig;
|
|
608
608
|
var editStore = reactData.editStore, tableColumn = reactData.tableColumn;
|
|
609
609
|
var editOpts = computeEditOpts.value;
|
|
610
|
-
var mode = editOpts.mode
|
|
610
|
+
var mode = editOpts.mode;
|
|
611
611
|
var actived = editStore.actived;
|
|
612
612
|
var row = params.row, column = params.column;
|
|
613
613
|
var editRender = column.editRender;
|
|
614
614
|
var cell = (params.cell || $xetable.getCell(row, column));
|
|
615
|
+
var beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
615
616
|
params.cell = cell;
|
|
616
617
|
if (isEnableConf(editConfig) && isEnableConf(editRender) && cell) {
|
|
617
618
|
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
618
619
|
// 判断是否禁用编辑
|
|
619
620
|
var type = 'edit-disabled';
|
|
620
|
-
if (!
|
|
621
|
+
if (!beforeEditMethod || beforeEditMethod(__assign(__assign({}, params), { $table: $xetable }))) {
|
|
621
622
|
if (mouseConfig) {
|
|
622
623
|
editMethods.clearSelected();
|
|
623
624
|
if ($xetable.clearCellAreas) {
|
package/es/form/src/form.js
CHANGED
|
@@ -19,6 +19,7 @@ import { scrollToView } from '../../tools/dom';
|
|
|
19
19
|
import { createItem, handleFieldOrItem } from './util';
|
|
20
20
|
import { useSize } from '../../hooks/size';
|
|
21
21
|
import VxeFormConfigItem from './form-config-item';
|
|
22
|
+
import VxeLoading from '../../loading/index';
|
|
22
23
|
var Rule = /** @class */ (function () {
|
|
23
24
|
function Rule(rule) {
|
|
24
25
|
Object.assign(this, {
|
|
@@ -567,15 +568,13 @@ export default defineComponent({
|
|
|
567
568
|
class: 'vxe-form-slots',
|
|
568
569
|
ref: 'hideItem'
|
|
569
570
|
}, customLayout ? [] : (defaultSlot ? defaultSlot({}) : [])),
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
})
|
|
578
|
-
]),
|
|
571
|
+
/**
|
|
572
|
+
* 加载中
|
|
573
|
+
*/
|
|
574
|
+
h(VxeLoading, {
|
|
575
|
+
class: 'vxe-form--loading',
|
|
576
|
+
loading: loading
|
|
577
|
+
}),
|
|
579
578
|
/**
|
|
580
579
|
* 工具提示
|
|
581
580
|
*/
|
package/es/form/style.css
CHANGED
|
@@ -162,7 +162,8 @@
|
|
|
162
162
|
flex-shrink: 0; }
|
|
163
163
|
.vxe-form--item .vxe-form--item-inner .vxe-form--item-content {
|
|
164
164
|
position: relative;
|
|
165
|
-
flex-grow: 1;
|
|
165
|
+
flex-grow: 1;
|
|
166
|
+
word-break: break-all; }
|
|
166
167
|
|
|
167
168
|
.vxe-form--item .vxe-default-input,
|
|
168
169
|
.vxe-form--item .vxe-default-textarea,
|
package/es/grid/src/grid.js
CHANGED
|
@@ -59,7 +59,7 @@ export default defineComponent({
|
|
|
59
59
|
tZindex: 0,
|
|
60
60
|
tablePage: {
|
|
61
61
|
total: 0,
|
|
62
|
-
pageSize: 10,
|
|
62
|
+
pageSize: GlobalConfig.pager.pageSize || 10,
|
|
63
63
|
currentPage: 1
|
|
64
64
|
}
|
|
65
65
|
});
|
|
@@ -162,12 +162,15 @@ export default defineComponent({
|
|
|
162
162
|
clss.push(rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : '');
|
|
163
163
|
return clss;
|
|
164
164
|
};
|
|
165
|
-
var
|
|
165
|
+
var handleBeforeEditMethod = function (params) {
|
|
166
166
|
var editConfig = props.editConfig;
|
|
167
167
|
var pendingRecords = reactData.pendingRecords;
|
|
168
168
|
var $xetable = refTable.value;
|
|
169
|
-
var
|
|
170
|
-
|
|
169
|
+
var beforeEditMethod = editConfig ? (editConfig.beforeEditMethod || editConfig.activeMethod) : null;
|
|
170
|
+
if ($xetable.findRowIndexOf(pendingRecords, params.row) === -1) {
|
|
171
|
+
return !beforeEditMethod || beforeEditMethod(__assign(__assign({}, params), { $grid: $xegrid }));
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
171
174
|
};
|
|
172
175
|
var computeTableProps = computed(function () {
|
|
173
176
|
var seqConfig = props.seqConfig, pagerConfig = props.pagerConfig, loading = props.loading, editConfig = props.editConfig, proxyConfig = props.proxyConfig;
|
|
@@ -192,7 +195,7 @@ export default defineComponent({
|
|
|
192
195
|
}
|
|
193
196
|
}
|
|
194
197
|
if (editConfig) {
|
|
195
|
-
tableProps.editConfig = Object.assign({}, editConfig, {
|
|
198
|
+
tableProps.editConfig = Object.assign({}, editConfig, { beforeEditMethod: handleBeforeEditMethod });
|
|
196
199
|
}
|
|
197
200
|
return tableProps;
|
|
198
201
|
});
|
package/es/list/src/list.js
CHANGED
|
@@ -5,6 +5,7 @@ import { useSize } from '../../hooks/size';
|
|
|
5
5
|
import { createResizeEvent } from '../../tools/resize';
|
|
6
6
|
import { browse } from '../../tools/dom';
|
|
7
7
|
import { GlobalEvent } from '../../tools/event';
|
|
8
|
+
import VxeLoading from '../../loading/index';
|
|
8
9
|
export default defineComponent({
|
|
9
10
|
name: 'VxeList',
|
|
10
11
|
props: {
|
|
@@ -305,15 +306,13 @@ export default defineComponent({
|
|
|
305
306
|
}
|
|
306
307
|
}, slots.default ? slots.default({ items: items, $list: $xelist }) : [])
|
|
307
308
|
]),
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
})
|
|
316
|
-
])
|
|
309
|
+
/**
|
|
310
|
+
* 加载中
|
|
311
|
+
*/
|
|
312
|
+
h(VxeLoading, {
|
|
313
|
+
class: 'vxe-list--loading',
|
|
314
|
+
loading: loading
|
|
315
|
+
})
|
|
317
316
|
]);
|
|
318
317
|
};
|
|
319
318
|
$xelist.renderVN = renderVN;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
import GlobalConfig from '../../v-x-e-table/src/conf';
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
name: 'VxeLoading',
|
|
5
|
+
props: {
|
|
6
|
+
loading: Boolean
|
|
7
|
+
},
|
|
8
|
+
render: function () {
|
|
9
|
+
var icon = GlobalConfig.icon.LOADING;
|
|
10
|
+
var loadingText = GlobalConfig.loadingText;
|
|
11
|
+
var text = loadingText === null ? loadingText : GlobalConfig.i18n('vxe.loading.text');
|
|
12
|
+
return h('div', {
|
|
13
|
+
class: ['vxe-loading', {
|
|
14
|
+
'is--visible': this.loading
|
|
15
|
+
}]
|
|
16
|
+
}, [
|
|
17
|
+
h('div', {
|
|
18
|
+
class: 'vxe-loading--chunk'
|
|
19
|
+
}, [
|
|
20
|
+
icon ? h('i', {
|
|
21
|
+
class: icon
|
|
22
|
+
}) : h('div', {
|
|
23
|
+
class: 'vxe-loading--spinner'
|
|
24
|
+
}),
|
|
25
|
+
text ? h('div', {
|
|
26
|
+
class: 'vxe-loading--text'
|
|
27
|
+
}, "" + text) : null
|
|
28
|
+
])
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
});
|
package/es/locale/lang/en-US.js
CHANGED
package/es/locale/lang/ja-JP.js
CHANGED
package/es/locale/lang/zh-CN.js
CHANGED
package/es/locale/lang/zh-TC.js
CHANGED
package/es/modal/src/modal.js
CHANGED
|
@@ -18,6 +18,7 @@ import { errLog } from '../../tools/log';
|
|
|
18
18
|
import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event';
|
|
19
19
|
import GlobalConfig from '../../v-x-e-table/src/conf';
|
|
20
20
|
import VxeButtonConstructor from '../../button/src/button';
|
|
21
|
+
import VxeLoading from '../../loading/index';
|
|
21
22
|
export var allActivedModals = [];
|
|
22
23
|
export var msgQueue = [];
|
|
23
24
|
export default defineComponent({
|
|
@@ -89,7 +90,7 @@ export default defineComponent({
|
|
|
89
90
|
modalTop: 0,
|
|
90
91
|
modalZindex: 0,
|
|
91
92
|
zoomLocat: null,
|
|
92
|
-
firstOpen:
|
|
93
|
+
firstOpen: true
|
|
93
94
|
});
|
|
94
95
|
var refElem = ref();
|
|
95
96
|
var refModalBox = ref();
|
|
@@ -347,13 +348,13 @@ export default defineComponent({
|
|
|
347
348
|
nextTick(function () {
|
|
348
349
|
var fullscreen = props.fullscreen;
|
|
349
350
|
var firstOpen = reactData.firstOpen;
|
|
350
|
-
if (!remember ||
|
|
351
|
+
if (!remember || firstOpen) {
|
|
351
352
|
updatePosition().then(function () {
|
|
352
353
|
setTimeout(function () { return updatePosition(); }, 20);
|
|
353
354
|
});
|
|
354
355
|
}
|
|
355
|
-
if (
|
|
356
|
-
reactData.firstOpen =
|
|
356
|
+
if (firstOpen) {
|
|
357
|
+
reactData.firstOpen = false;
|
|
357
358
|
if (hasPosStorage()) {
|
|
358
359
|
restorePosStorage();
|
|
359
360
|
}
|
|
@@ -361,6 +362,11 @@ export default defineComponent({
|
|
|
361
362
|
nextTick(function () { return maximize(); });
|
|
362
363
|
}
|
|
363
364
|
}
|
|
365
|
+
else {
|
|
366
|
+
if (fullscreen) {
|
|
367
|
+
nextTick(function () { return maximize(); });
|
|
368
|
+
}
|
|
369
|
+
}
|
|
364
370
|
});
|
|
365
371
|
}
|
|
366
372
|
}
|
|
@@ -717,15 +723,13 @@ export default defineComponent({
|
|
|
717
723
|
class: 'vxe-modal--content'
|
|
718
724
|
}, defaultSlot ? (!reactData.inited || (props.destroyOnClose && !reactData.visible) ? [] : defaultSlot({ $modal: $xemodal })) : getFuncText(content)));
|
|
719
725
|
if (!isMsg) {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
})
|
|
728
|
-
]));
|
|
726
|
+
/**
|
|
727
|
+
* 加载中
|
|
728
|
+
*/
|
|
729
|
+
contVNs.push(h(VxeLoading, {
|
|
730
|
+
class: 'vxe-modal--loading',
|
|
731
|
+
loading: props.loading
|
|
732
|
+
}));
|
|
729
733
|
}
|
|
730
734
|
return [
|
|
731
735
|
h('div', {
|
package/es/select/style.css
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
1
|
/*font*/
|
|
3
2
|
/*size*/
|
|
4
3
|
/*icon*/
|
|
@@ -24,69 +23,6 @@
|
|
|
24
23
|
/*select*/
|
|
25
24
|
/*switch*/
|
|
26
25
|
/*pulldown*/
|
|
27
|
-
/*加载中*/
|
|
28
|
-
.vxe-loading {
|
|
29
|
-
display: none;
|
|
30
|
-
position: absolute;
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
top: 0;
|
|
34
|
-
left: 0;
|
|
35
|
-
z-index: 99;
|
|
36
|
-
-webkit-user-select: none;
|
|
37
|
-
-moz-user-select: none;
|
|
38
|
-
-ms-user-select: none;
|
|
39
|
-
user-select: none;
|
|
40
|
-
background-color: rgba(0, 0, 0, 0.2); }
|
|
41
|
-
.vxe-loading.is--visible {
|
|
42
|
-
display: block; }
|
|
43
|
-
.vxe-loading .vxe-loading--spinner {
|
|
44
|
-
width: 56px;
|
|
45
|
-
height: 56px;
|
|
46
|
-
position: absolute;
|
|
47
|
-
top: 50%;
|
|
48
|
-
left: 50%;
|
|
49
|
-
transform: translate(-50%, -50%); }
|
|
50
|
-
.vxe-loading .vxe-loading--spinner:before, .vxe-loading .vxe-loading--spinner:after {
|
|
51
|
-
content: "";
|
|
52
|
-
width: 100%;
|
|
53
|
-
height: 100%;
|
|
54
|
-
border-radius: 50%;
|
|
55
|
-
background-color: #409eff;
|
|
56
|
-
opacity: 0.6;
|
|
57
|
-
position: absolute;
|
|
58
|
-
top: 0;
|
|
59
|
-
left: 0;
|
|
60
|
-
-webkit-animation: bounce 2.0s infinite ease-in-out;
|
|
61
|
-
animation: bounce 2.0s infinite ease-in-out; }
|
|
62
|
-
.vxe-loading .vxe-loading--spinner:after {
|
|
63
|
-
-webkit-animation-delay: -1.0s;
|
|
64
|
-
animation-delay: -1.0s; }
|
|
65
|
-
|
|
66
|
-
@-webkit-keyframes bounce {
|
|
67
|
-
0%, 100% {
|
|
68
|
-
transform: scale(0); }
|
|
69
|
-
50% {
|
|
70
|
-
transform: scale(1); } }
|
|
71
|
-
|
|
72
|
-
@keyframes bounce {
|
|
73
|
-
0%, 100% {
|
|
74
|
-
transform: scale(0); }
|
|
75
|
-
50% {
|
|
76
|
-
transform: scale(1); } }
|
|
77
|
-
|
|
78
|
-
.size--mini .vxe-loading .vxe-loading--spinner {
|
|
79
|
-
width: 38px;
|
|
80
|
-
height: 38px; }
|
|
81
|
-
|
|
82
|
-
.size--small .vxe-loading .vxe-loading--spinner {
|
|
83
|
-
width: 44px;
|
|
84
|
-
height: 44px; }
|
|
85
|
-
|
|
86
|
-
.size--medium .vxe-loading .vxe-loading--spinner {
|
|
87
|
-
width: 50px;
|
|
88
|
-
height: 50px; }
|
|
89
|
-
|
|
90
26
|
.vxe-select {
|
|
91
27
|
position: relative;
|
|
92
28
|
display: inline-block;
|