vxe-pc-ui 4.1.20 → 4.1.21
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/README.md +82 -1
- package/es/anchor/src/anchor-link.js +1 -1
- package/es/anchor/src/anchor.js +1 -1
- package/es/breadcrumb/src/breadcrumb.js +1 -1
- package/es/button/src/button-group.js +4 -1
- package/es/calendar/src/calendar.js +64 -32
- package/es/carousel/src/carousel-item.js +13 -3
- package/es/carousel/src/carousel.js +16 -8
- package/es/checkbox/src/checkbox.js +30 -14
- package/es/checkbox/src/group.js +17 -8
- package/es/collapse-pane/index.js +1 -1
- package/es/countdown/src/countdown.js +1 -1
- package/es/date-picker/src/date-picker.js +12 -12
- package/es/drawer/src/drawer.js +1 -1
- package/es/form/render/index.js +1 -2
- package/es/form/src/form-config-item.js +4 -3
- package/es/form/src/form-gather.js +5 -3
- package/es/form/src/form-item.js +15 -10
- package/es/form/src/form.js +11 -8
- package/es/form/src/render.js +2 -1
- package/es/form/src/util.js +2 -1
- package/es/icon/style.css +1 -1
- package/es/icon-picker/src/icon-picker.js +22 -10
- package/es/image/src/group.js +4 -1
- package/es/image/src/preview.js +1 -1
- package/es/input/src/input.js +129 -65
- package/es/layout-aside/src/layout-aside.js +1 -1
- package/es/list/src/list.js +7 -5
- package/es/list-design/src/list-design.js +1 -1
- package/es/list-design/src/list-view.js +1 -1
- package/es/loading/src/loading.js +1 -1
- package/es/menu/src/menu.js +1 -1
- package/es/number-input/src/number-input.js +6 -6
- package/es/pager/src/pager.js +85 -45
- package/es/password-input/src/password-input.js +2 -2
- package/es/print/src/page-break.js +11 -2
- package/es/print/src/print.js +6 -4
- package/es/radio/src/group.js +5 -2
- package/es/row/src/row.js +1 -1
- package/es/select/src/optgroup.js +11 -8
- package/es/select/src/option.js +9 -7
- package/es/select/src/select.js +32 -29
- package/es/select/src/util.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tabs/src/tab-pane.js +13 -3
- package/es/tabs/src/tabs.js +57 -47
- package/es/textarea/src/textarea.js +4 -4
- package/es/tooltip/src/tooltip.js +1 -1
- package/es/tree/src/tree.js +6 -3
- package/es/tree-select/src/tree-select.js +16 -9
- package/es/ui/index.js +1 -7
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +5 -5
- package/lib/anchor/src/anchor-link.js +1 -1
- package/lib/anchor/src/anchor-link.min.js +1 -1
- package/lib/anchor/src/anchor.js +1 -1
- package/lib/anchor/src/anchor.min.js +1 -1
- package/lib/breadcrumb/src/breadcrumb.js +1 -1
- package/lib/breadcrumb/src/breadcrumb.min.js +1 -1
- package/lib/button/src/button-group.js +4 -1
- package/lib/button/src/button-group.min.js +1 -1
- package/lib/calendar/src/calendar.js +42 -24
- package/lib/calendar/src/calendar.min.js +1 -1
- package/lib/carousel/src/carousel-item.js +16 -3
- package/lib/carousel/src/carousel-item.min.js +1 -1
- package/lib/carousel/src/carousel.js +18 -8
- package/lib/carousel/src/carousel.min.js +1 -1
- package/lib/checkbox/src/checkbox.js +16 -12
- package/lib/checkbox/src/checkbox.min.js +1 -1
- package/lib/checkbox/src/group.js +10 -7
- package/lib/checkbox/src/group.min.js +1 -1
- package/lib/collapse-pane/index.js +1 -1
- package/lib/collapse-pane/index.min.js +1 -1
- package/lib/countdown/src/countdown.js +1 -1
- package/lib/countdown/src/countdown.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +12 -12
- package/lib/drawer/src/drawer.js +1 -1
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/form/render/index.js +1 -4
- package/lib/form/render/index.min.js +1 -1
- package/lib/form/src/form-config-item.js +4 -5
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-gather.js +11 -9
- package/lib/form/src/form-gather.min.js +1 -1
- package/lib/form/src/form-item.js +11 -12
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +7 -7
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +2 -1
- package/lib/form/src/util.js +2 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/icon-picker/src/icon-picker.js +20 -11
- package/lib/icon-picker/src/icon-picker.min.js +1 -1
- package/lib/image/src/group.js +4 -1
- package/lib/image/src/group.min.js +1 -1
- package/lib/image/src/preview.js +1 -1
- package/lib/image/src/preview.min.js +1 -1
- package/lib/index.umd.js +522 -377
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +77 -50
- package/lib/input/src/input.min.js +1 -1
- package/lib/layout-aside/src/layout-aside.js +1 -1
- package/lib/layout-aside/src/layout-aside.min.js +1 -1
- package/lib/list/src/list.js +9 -5
- package/lib/list/src/list.min.js +1 -1
- package/lib/list-design/src/list-design.js +1 -1
- package/lib/list-design/src/list-design.min.js +1 -1
- package/lib/list-design/src/list-view.js +1 -1
- package/lib/list-design/src/list-view.min.js +1 -1
- package/lib/loading/src/loading.js +1 -1
- package/lib/loading/src/loading.min.js +1 -1
- package/lib/menu/src/menu.js +1 -1
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/number-input/src/number-input.js +6 -6
- package/lib/pager/src/pager.js +40 -39
- package/lib/pager/src/pager.min.js +1 -1
- package/lib/password-input/src/password-input.js +2 -2
- package/lib/print/src/page-break.js +14 -2
- package/lib/print/src/page-break.min.js +1 -1
- package/lib/print/src/print.js +8 -6
- package/lib/print/src/print.min.js +1 -1
- package/lib/radio/src/group.js +5 -2
- package/lib/radio/src/group.min.js +1 -1
- package/lib/row/src/row.js +1 -1
- package/lib/row/src/row.min.js +1 -1
- package/lib/select/src/optgroup.js +12 -9
- package/lib/select/src/optgroup.min.js +1 -1
- package/lib/select/src/option.js +9 -7
- package/lib/select/src/option.min.js +1 -1
- package/lib/select/src/select.js +33 -32
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/src/util.js +2 -2
- package/lib/select/src/util.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tabs/src/tab-pane.js +16 -3
- package/lib/tabs/src/tab-pane.min.js +1 -1
- package/lib/tabs/src/tabs.js +62 -50
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/textarea/src/textarea.js +4 -4
- package/lib/tooltip/src/tooltip.js +1 -1
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tree/src/tree.js +2 -2
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree-select/src/tree-select.js +11 -7
- package/lib/tree-select/src/tree-select.min.js +1 -1
- package/lib/ui/index.js +3 -10
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/upload/src/upload.js +5 -5
- package/lib/upload/src/upload.min.js +1 -1
- package/package.json +2 -2
- package/packages/anchor/src/anchor-link.ts +2 -2
- package/packages/anchor/src/anchor.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb.ts +2 -2
- package/packages/button/src/button-group.ts +4 -1
- package/packages/calendar/src/calendar.ts +67 -35
- package/packages/carousel/src/carousel-item.ts +19 -4
- package/packages/carousel/src/carousel.ts +19 -11
- package/packages/checkbox/src/checkbox.ts +34 -15
- package/packages/checkbox/src/group.ts +22 -10
- package/packages/collapse-pane/index.ts +1 -1
- package/packages/countdown/src/countdown.ts +2 -2
- package/packages/date-picker/src/date-picker.ts +12 -12
- package/packages/drawer/src/drawer.ts +2 -2
- package/packages/form/render/index.ts +1 -3
- package/packages/form/src/form-config-item.ts +4 -3
- package/packages/form/src/form-gather.ts +5 -3
- package/packages/form/src/form-item.ts +15 -10
- package/packages/form/src/form.ts +12 -10
- package/packages/form/src/render.ts +2 -1
- package/packages/form/src/util.ts +2 -1
- package/packages/icon-picker/src/icon-picker.ts +26 -13
- package/packages/image/src/group.ts +4 -1
- package/packages/image/src/preview.ts +2 -2
- package/packages/input/src/input.ts +133 -71
- package/packages/layout-aside/src/layout-aside.ts +2 -2
- package/packages/list/src/list.ts +12 -11
- package/packages/list-design/src/list-design.ts +2 -2
- package/packages/list-design/src/list-view.ts +2 -2
- package/packages/loading/src/loading.ts +2 -2
- package/packages/menu/src/menu.ts +2 -2
- package/packages/number-input/src/number-input.ts +6 -6
- package/packages/pager/src/pager.ts +91 -50
- package/packages/password-input/src/password-input.ts +2 -2
- package/packages/print/src/page-break.ts +18 -4
- package/packages/print/src/print.ts +10 -5
- package/packages/radio/src/group.ts +6 -3
- package/packages/row/src/row.ts +2 -2
- package/packages/select/src/optgroup.ts +16 -13
- package/packages/select/src/option.ts +10 -8
- package/packages/select/src/select.ts +42 -36
- package/packages/select/src/util.ts +3 -3
- package/packages/tabs/src/tab-pane.ts +20 -5
- package/packages/tabs/src/tabs.ts +59 -49
- package/packages/textarea/src/textarea.ts +4 -4
- package/packages/tooltip/src/tooltip.ts +2 -2
- package/packages/tree/src/tree.ts +7 -4
- package/packages/tree-select/src/tree-select.ts +20 -12
- package/packages/ui/index.ts +0 -7
- package/packages/upload/src/upload.ts +6 -6
- package/types/components/calendar.d.ts +6 -0
- package/types/components/carousel.d.ts +5 -0
- package/types/components/form.d.ts +4 -2
- package/types/components/icon-picker.d.ts +4 -0
- package/types/components/input.d.ts +9 -1
- package/types/components/list.d.ts +1 -0
- package/types/components/optgroup.d.ts +10 -4
- package/types/components/tabs.d.ts +4 -0
- package/types/components/toolbar.d.ts +5 -0
- package/types/components/tree-select.d.ts +4 -0
- package/types/ui/index.d.ts +0 -22
- /package/es/{collapse-pane → collapse}/src/collapse-pane.js +0 -0
- /package/es/icon/style/{iconfont.1725680652286.ttf → iconfont.1725941866604.ttf} +0 -0
- /package/es/icon/style/{iconfont.1725680652286.woff → iconfont.1725941866604.woff} +0 -0
- /package/es/icon/style/{iconfont.1725680652286.woff2 → iconfont.1725941866604.woff2} +0 -0
- /package/es/{iconfont.1725680652286.ttf → iconfont.1725941866604.ttf} +0 -0
- /package/es/{iconfont.1725680652286.woff → iconfont.1725941866604.woff} +0 -0
- /package/es/{iconfont.1725680652286.woff2 → iconfont.1725941866604.woff2} +0 -0
- /package/lib/{collapse-pane → collapse}/src/collapse-pane.js +0 -0
- /package/lib/{collapse-pane → collapse}/src/collapse-pane.min.js +0 -0
- /package/lib/icon/style/{iconfont.1725680652286.ttf → iconfont.1725941866604.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1725680652286.woff → iconfont.1725941866604.woff} +0 -0
- /package/lib/icon/style/{iconfont.1725680652286.woff2 → iconfont.1725941866604.woff2} +0 -0
- /package/lib/{iconfont.1725680652286.ttf → iconfont.1725941866604.ttf} +0 -0
- /package/lib/{iconfont.1725680652286.woff → iconfont.1725941866604.woff} +0 -0
- /package/lib/{iconfont.1725680652286.woff2 → iconfont.1725941866604.woff2} +0 -0
- /package/packages/{collapse-pane → collapse}/src/collapse-pane.ts +0 -0
|
@@ -226,7 +226,7 @@ export default defineComponent({
|
|
|
226
226
|
const { inputValue } = reactData;
|
|
227
227
|
numberInputMethods.dispatchEvent(evnt.type, { value: inputValue }, evnt);
|
|
228
228
|
};
|
|
229
|
-
const
|
|
229
|
+
const handleChange = (val, inputValue, evnt) => {
|
|
230
230
|
const value = val ? Number(val) : null;
|
|
231
231
|
const isChange = Number(value) !== props.modelValue;
|
|
232
232
|
if (isChange) {
|
|
@@ -247,7 +247,7 @@ export default defineComponent({
|
|
|
247
247
|
const value = inputValue ? XEUtils.toNumber(inputValue) : null;
|
|
248
248
|
reactData.inputValue = inputValue;
|
|
249
249
|
if (inpImmediate) {
|
|
250
|
-
|
|
250
|
+
handleChange(value, inputValue, evnt);
|
|
251
251
|
}
|
|
252
252
|
else {
|
|
253
253
|
numberInputMethods.dispatchEvent('input', { value }, evnt);
|
|
@@ -277,7 +277,7 @@ export default defineComponent({
|
|
|
277
277
|
};
|
|
278
278
|
const clearValueEvent = (evnt, value) => {
|
|
279
279
|
focus();
|
|
280
|
-
|
|
280
|
+
handleChange(null, '', evnt);
|
|
281
281
|
numberInputMethods.dispatchEvent('clear', { value }, evnt);
|
|
282
282
|
};
|
|
283
283
|
const clickSuffixEvent = (evnt) => {
|
|
@@ -303,7 +303,7 @@ export default defineComponent({
|
|
|
303
303
|
validValue = Number(textValue);
|
|
304
304
|
}
|
|
305
305
|
if (inputValue !== validValue) {
|
|
306
|
-
|
|
306
|
+
handleChange(validValue, textValue, { type: 'init' });
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
}
|
|
@@ -334,7 +334,7 @@ export default defineComponent({
|
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
const inpValue = getNumberValue(inpNumVal);
|
|
337
|
-
|
|
337
|
+
handleChange(inpValue === null ? null : Number(inpValue), inpValue, { type: 'check' });
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
};
|
|
@@ -343,7 +343,7 @@ export default defineComponent({
|
|
|
343
343
|
const inpImmediate = computeInpImmediate.value;
|
|
344
344
|
const value = inputValue ? Number(inputValue) : null;
|
|
345
345
|
if (!inpImmediate) {
|
|
346
|
-
|
|
346
|
+
handleChange(value, `${inputValue || ''}`, evnt);
|
|
347
347
|
}
|
|
348
348
|
afterCheckValue();
|
|
349
349
|
reactData.isActivated = false;
|
package/es/pager/src/pager.js
CHANGED
|
@@ -7,34 +7,73 @@ import VxeInputComponent from '../../input/src/input';
|
|
|
7
7
|
export default defineComponent({
|
|
8
8
|
name: 'VxePager',
|
|
9
9
|
props: {
|
|
10
|
-
size: {
|
|
10
|
+
size: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: () => getConfig().pager.size || getConfig().size
|
|
13
|
+
},
|
|
11
14
|
// 自定义布局
|
|
12
|
-
layouts: {
|
|
15
|
+
layouts: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => getConfig().pager.layouts || ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
|
|
18
|
+
},
|
|
13
19
|
// 当前页
|
|
14
|
-
currentPage: {
|
|
20
|
+
currentPage: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 1
|
|
23
|
+
},
|
|
15
24
|
// 加载中
|
|
16
25
|
loading: Boolean,
|
|
17
26
|
// 每页大小
|
|
18
|
-
pageSize: {
|
|
27
|
+
pageSize: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: () => getConfig().pager.pageSize || 10
|
|
30
|
+
},
|
|
19
31
|
// 总条数
|
|
20
32
|
total: { type: Number, default: 0 },
|
|
21
33
|
// 显示页码按钮的数量
|
|
22
|
-
pagerCount: {
|
|
34
|
+
pagerCount: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: () => getConfig().pager.pagerCount || 7
|
|
37
|
+
},
|
|
23
38
|
// 每页大小选项列表
|
|
24
|
-
pageSizes: {
|
|
39
|
+
pageSizes: {
|
|
40
|
+
type: Array,
|
|
41
|
+
default: () => getConfig().pager.pageSizes || [10, 15, 20, 50, 100]
|
|
42
|
+
},
|
|
25
43
|
// 列对其方式
|
|
26
|
-
align: {
|
|
44
|
+
align: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: () => getConfig().pager.align
|
|
47
|
+
},
|
|
27
48
|
// 带边框
|
|
28
|
-
border: {
|
|
49
|
+
border: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: () => getConfig().pager.border
|
|
52
|
+
},
|
|
29
53
|
// 带背景颜色
|
|
30
|
-
background: {
|
|
54
|
+
background: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: () => getConfig().pager.background
|
|
57
|
+
},
|
|
31
58
|
// 配套的样式
|
|
32
|
-
perfect: {
|
|
59
|
+
perfect: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: () => getConfig().pager.perfect
|
|
62
|
+
},
|
|
33
63
|
// 当只有一页时隐藏
|
|
34
|
-
autoHidden: {
|
|
35
|
-
|
|
64
|
+
autoHidden: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: () => getConfig().pager.autoHidden
|
|
67
|
+
},
|
|
68
|
+
transfer: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: () => getConfig().pager.transfer
|
|
71
|
+
},
|
|
36
72
|
className: [String, Function],
|
|
37
|
-
pageSizePlacement: {
|
|
73
|
+
pageSizePlacement: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: () => getConfig().pager.pageSizePlacement
|
|
76
|
+
},
|
|
38
77
|
// 自定义图标
|
|
39
78
|
iconPrevPage: String,
|
|
40
79
|
iconJumpPrev: String,
|
|
@@ -61,6 +100,33 @@ export default defineComponent({
|
|
|
61
100
|
const refMaps = {
|
|
62
101
|
refElem
|
|
63
102
|
};
|
|
103
|
+
const computePageCount = computed(() => {
|
|
104
|
+
return getPageCount(props.total, props.pageSize);
|
|
105
|
+
});
|
|
106
|
+
const computeNumList = computed(() => {
|
|
107
|
+
const { pagerCount } = props;
|
|
108
|
+
const pageCount = computePageCount.value;
|
|
109
|
+
const len = pageCount > pagerCount ? pagerCount - 2 : pagerCount;
|
|
110
|
+
const rest = [];
|
|
111
|
+
for (let index = 0; index < len; index++) {
|
|
112
|
+
rest.push(index);
|
|
113
|
+
}
|
|
114
|
+
return rest;
|
|
115
|
+
});
|
|
116
|
+
const computeOffsetNumber = computed(() => {
|
|
117
|
+
return Math.floor((props.pagerCount - 2) / 2);
|
|
118
|
+
});
|
|
119
|
+
const computeSizeList = computed(() => {
|
|
120
|
+
return props.pageSizes.map((item) => {
|
|
121
|
+
if (XEUtils.isNumber(item)) {
|
|
122
|
+
return {
|
|
123
|
+
value: item,
|
|
124
|
+
label: `${getI18n('vxe.pager.pagesize', [item])}`
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return Object.assign({ value: '', label: '' }, item);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
64
130
|
const $xePager = {
|
|
65
131
|
xID,
|
|
66
132
|
props,
|
|
@@ -72,9 +138,6 @@ export default defineComponent({
|
|
|
72
138
|
const getPageCount = (total, size) => {
|
|
73
139
|
return Math.max(Math.ceil(total / size), 1);
|
|
74
140
|
};
|
|
75
|
-
const computePageCount = computed(() => {
|
|
76
|
-
return getPageCount(props.total, props.pageSize);
|
|
77
|
-
});
|
|
78
141
|
const jumpPageEvent = (evnt, currentPage) => {
|
|
79
142
|
emit('update:currentPage', currentPage);
|
|
80
143
|
if (evnt && currentPage !== props.currentPage) {
|
|
@@ -98,30 +161,6 @@ export default defineComponent({
|
|
|
98
161
|
reactData.inpCurrPage = currPage;
|
|
99
162
|
changeCurrentPage(current, $event);
|
|
100
163
|
};
|
|
101
|
-
const computeNumList = computed(() => {
|
|
102
|
-
const { pagerCount } = props;
|
|
103
|
-
const pageCount = computePageCount.value;
|
|
104
|
-
const len = pageCount > pagerCount ? pagerCount - 2 : pagerCount;
|
|
105
|
-
const rest = [];
|
|
106
|
-
for (let index = 0; index < len; index++) {
|
|
107
|
-
rest.push(index);
|
|
108
|
-
}
|
|
109
|
-
return rest;
|
|
110
|
-
});
|
|
111
|
-
const computeOffsetNumber = computed(() => {
|
|
112
|
-
return Math.floor((props.pagerCount - 2) / 2);
|
|
113
|
-
});
|
|
114
|
-
const computeSizeList = computed(() => {
|
|
115
|
-
return props.pageSizes.map((item) => {
|
|
116
|
-
if (XEUtils.isNumber(item)) {
|
|
117
|
-
return {
|
|
118
|
-
value: item,
|
|
119
|
-
label: `${getI18n('vxe.pager.pagesize', [item])}`
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
return Object.assign({ value: '', label: '' }, item);
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
164
|
const handleHomePage = (evnt) => {
|
|
126
165
|
const { currentPage } = props;
|
|
127
166
|
if (currentPage > 1) {
|
|
@@ -313,7 +352,7 @@ export default defineComponent({
|
|
|
313
352
|
class: 'vxe-pager--num-btn',
|
|
314
353
|
type: 'button',
|
|
315
354
|
onClick: (evnt) => jumpPageEvent(evnt, 1)
|
|
316
|
-
}, 1), renderPrevJump('span'));
|
|
355
|
+
}, '1'), renderPrevJump('span'));
|
|
317
356
|
}
|
|
318
357
|
numList.forEach((item, index) => {
|
|
319
358
|
const number = startNumber + index;
|
|
@@ -325,7 +364,7 @@ export default defineComponent({
|
|
|
325
364
|
}],
|
|
326
365
|
type: 'button',
|
|
327
366
|
onClick: (evnt) => jumpPageEvent(evnt, number)
|
|
328
|
-
}, number));
|
|
367
|
+
}, `${number}`));
|
|
329
368
|
}
|
|
330
369
|
});
|
|
331
370
|
if (showJump && isGt) {
|
|
@@ -410,10 +449,11 @@ export default defineComponent({
|
|
|
410
449
|
class: 'vxe-pager--total'
|
|
411
450
|
}, getI18n('vxe.pager.total', [props.total]));
|
|
412
451
|
};
|
|
452
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
453
|
+
emit(type, createEvent(evnt, { $pager: $xePager }, params));
|
|
454
|
+
};
|
|
413
455
|
pagerMethods = {
|
|
414
|
-
dispatchEvent
|
|
415
|
-
emit(type, createEvent(evnt, { $pager: $xePager }, params));
|
|
416
|
-
},
|
|
456
|
+
dispatchEvent,
|
|
417
457
|
homePage() {
|
|
418
458
|
handleHomePage();
|
|
419
459
|
return nextTick();
|
|
@@ -99,7 +99,7 @@ export default defineComponent({
|
|
|
99
99
|
const value = inputElem.value;
|
|
100
100
|
emitInputEvent(value, evnt);
|
|
101
101
|
};
|
|
102
|
-
const
|
|
102
|
+
const handleChange = (value, evnt) => {
|
|
103
103
|
reactData.inputValue = value;
|
|
104
104
|
emit('update:modelValue', value);
|
|
105
105
|
passwordInputMethods.dispatchEvent('input', { value }, evnt);
|
|
@@ -140,7 +140,7 @@ export default defineComponent({
|
|
|
140
140
|
};
|
|
141
141
|
const clearValueEvent = (evnt, value) => {
|
|
142
142
|
focus();
|
|
143
|
-
|
|
143
|
+
handleChange('', evnt);
|
|
144
144
|
passwordInputMethods.dispatchEvent('clear', { value }, evnt);
|
|
145
145
|
};
|
|
146
146
|
const clickSuffixEvent = (evnt) => {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { defineComponent, ref, h, reactive, inject, onMounted, onUnmounted, createCommentVNode } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
|
+
import { createEvent } from '../../ui';
|
|
3
4
|
import { assemblePageBreak, destroyPageBreak } from './util';
|
|
4
5
|
export default defineComponent({
|
|
5
6
|
name: 'VxePrintPageBreak',
|
|
6
7
|
props: {},
|
|
7
8
|
emits: [],
|
|
8
9
|
setup(props, context) {
|
|
9
|
-
const { slots } = context;
|
|
10
|
+
const { slots, emit } = context;
|
|
10
11
|
const xID = XEUtils.uniqueId();
|
|
11
12
|
const $xePrint = inject('$xePrint', null);
|
|
12
13
|
const refElem = ref();
|
|
@@ -27,6 +28,14 @@ export default defineComponent({
|
|
|
27
28
|
getRefMaps: () => refMaps,
|
|
28
29
|
getComputeMaps: () => computeMaps
|
|
29
30
|
};
|
|
31
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
32
|
+
emit(type, createEvent(evnt, { $print: $xePrint }, params));
|
|
33
|
+
};
|
|
34
|
+
const printPageBreakMethods = {
|
|
35
|
+
dispatchEvent
|
|
36
|
+
};
|
|
37
|
+
const printPageBreakPrivateMethods = {};
|
|
38
|
+
Object.assign($xePrintPageBreak, printPageBreakMethods, printPageBreakPrivateMethods);
|
|
30
39
|
if (!$xePrint) {
|
|
31
40
|
$xePrintPageBreak.renderVN = () => {
|
|
32
41
|
return createCommentVNode();
|
|
@@ -38,7 +47,6 @@ export default defineComponent({
|
|
|
38
47
|
ref: refElem
|
|
39
48
|
});
|
|
40
49
|
};
|
|
41
|
-
$xePrintPageBreak.renderVN = renderVN;
|
|
42
50
|
onMounted(() => {
|
|
43
51
|
const elem = refElem.value;
|
|
44
52
|
if ($xePrint && elem) {
|
|
@@ -50,6 +58,7 @@ export default defineComponent({
|
|
|
50
58
|
destroyPageBreak($xePrint, pageBreakConfig);
|
|
51
59
|
}
|
|
52
60
|
});
|
|
61
|
+
$xePrintPageBreak.renderVN = renderVN;
|
|
53
62
|
return $xePrintPageBreak;
|
|
54
63
|
},
|
|
55
64
|
render() {
|
package/es/print/src/print.js
CHANGED
|
@@ -61,10 +61,11 @@ export default defineComponent({
|
|
|
61
61
|
getRefMaps: () => refMaps,
|
|
62
62
|
getComputeMaps: () => computeMaps
|
|
63
63
|
};
|
|
64
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
65
|
+
emit(type, createEvent(evnt, { $print: $xePrint }, params));
|
|
66
|
+
};
|
|
64
67
|
const printMethods = {
|
|
65
|
-
dispatchEvent
|
|
66
|
-
emit(type, createEvent(evnt, { $print: $xePrint }, params));
|
|
67
|
-
},
|
|
68
|
+
dispatchEvent,
|
|
68
69
|
print() {
|
|
69
70
|
const elem = refElem.value;
|
|
70
71
|
return printHtml(Object.assign({}, props, {
|
|
@@ -73,7 +74,8 @@ export default defineComponent({
|
|
|
73
74
|
}));
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
+
const printPrivateMethods = {};
|
|
78
|
+
Object.assign($xePrint, printMethods, printPrivateMethods);
|
|
77
79
|
const renderPageConfigLayouts = () => {
|
|
78
80
|
const { title, showPageNumber, showAllPageTitle, align, headerAlign, footerAlign } = props;
|
|
79
81
|
const pageBreaks = props.pageBreaks || [];
|
package/es/radio/src/group.js
CHANGED
|
@@ -109,8 +109,11 @@ export default defineComponent({
|
|
|
109
109
|
})
|
|
110
110
|
: []));
|
|
111
111
|
};
|
|
112
|
-
$xeRadioGroup.renderVN = renderVN;
|
|
113
112
|
provide('$xeRadioGroup', $xeRadioGroup);
|
|
114
|
-
|
|
113
|
+
$xeRadioGroup.renderVN = renderVN;
|
|
114
|
+
return $xeRadioGroup;
|
|
115
|
+
},
|
|
116
|
+
render() {
|
|
117
|
+
return this.renderVN();
|
|
115
118
|
}
|
|
116
119
|
});
|
package/es/row/src/row.js
CHANGED
|
@@ -14,24 +14,27 @@ export default defineComponent({
|
|
|
14
14
|
className: [String, Function],
|
|
15
15
|
disabled: Boolean
|
|
16
16
|
},
|
|
17
|
+
emits: [],
|
|
17
18
|
setup(props, { slots }) {
|
|
18
19
|
const elem = ref();
|
|
19
20
|
const $xeSelect = inject('$xeSelect', {});
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
provide('$xeOptgroup',
|
|
24
|
-
watchOption(props,
|
|
21
|
+
const optionConfig = createOption($xeSelect, props);
|
|
22
|
+
const $xeOptgroup = { optionConfig };
|
|
23
|
+
optionConfig.options = [];
|
|
24
|
+
provide('$xeOptgroup', $xeOptgroup);
|
|
25
|
+
watchOption(props, optionConfig);
|
|
25
26
|
onMounted(() => {
|
|
26
|
-
|
|
27
|
+
const el = elem.value;
|
|
28
|
+
assembleOption($xeSelect, el, optionConfig);
|
|
27
29
|
});
|
|
28
30
|
onUnmounted(() => {
|
|
29
|
-
destroyOption($xeSelect,
|
|
31
|
+
destroyOption($xeSelect, optionConfig);
|
|
30
32
|
});
|
|
31
33
|
return () => {
|
|
34
|
+
const defaultSlot = slots.default;
|
|
32
35
|
return h('div', {
|
|
33
36
|
ref: elem
|
|
34
|
-
},
|
|
37
|
+
}, defaultSlot ? defaultSlot({}) : []);
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
});
|
package/es/select/src/option.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createOption, watchOption, destroyOption, assembleOption } from './util
|
|
|
3
3
|
export default defineComponent({
|
|
4
4
|
name: 'VxeOption',
|
|
5
5
|
props: {
|
|
6
|
-
value:
|
|
6
|
+
value: [String, Number, Boolean],
|
|
7
7
|
label: {
|
|
8
8
|
type: [String, Number, Boolean],
|
|
9
9
|
default: ''
|
|
@@ -15,18 +15,20 @@ export default defineComponent({
|
|
|
15
15
|
className: [String, Function],
|
|
16
16
|
disabled: Boolean
|
|
17
17
|
},
|
|
18
|
+
emits: [],
|
|
18
19
|
setup(props, { slots }) {
|
|
19
20
|
const elem = ref();
|
|
20
21
|
const $xeSelect = inject('$xeSelect', {});
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
watchOption(props,
|
|
22
|
+
const $xeOptgroup = inject('$xeOptgroup', null);
|
|
23
|
+
const optionConfig = createOption($xeSelect, props);
|
|
24
|
+
optionConfig.slots = slots;
|
|
25
|
+
watchOption(props, optionConfig);
|
|
25
26
|
onMounted(() => {
|
|
26
|
-
|
|
27
|
+
const el = elem.value;
|
|
28
|
+
assembleOption($xeSelect, el, optionConfig, $xeOptgroup);
|
|
27
29
|
});
|
|
28
30
|
onUnmounted(() => {
|
|
29
|
-
destroyOption($xeSelect,
|
|
31
|
+
destroyOption($xeSelect, optionConfig);
|
|
30
32
|
});
|
|
31
33
|
return () => {
|
|
32
34
|
return h('div', {
|
package/es/select/src/select.js
CHANGED
|
@@ -167,10 +167,10 @@ export default defineComponent({
|
|
|
167
167
|
return getI18n('vxe.base.pleaseSelect');
|
|
168
168
|
});
|
|
169
169
|
const computePropsOpts = computed(() => {
|
|
170
|
-
return props.optionProps
|
|
170
|
+
return Object.assign({}, props.optionProps);
|
|
171
171
|
});
|
|
172
172
|
const computeGroupPropsOpts = computed(() => {
|
|
173
|
-
return props.optionGroupProps
|
|
173
|
+
return Object.assign({}, props.optionGroupProps);
|
|
174
174
|
});
|
|
175
175
|
const computeLabelField = computed(() => {
|
|
176
176
|
const propsOpts = computePropsOpts.value;
|
|
@@ -204,6 +204,27 @@ export default defineComponent({
|
|
|
204
204
|
const computeMultiMaxCharNum = computed(() => {
|
|
205
205
|
return XEUtils.toNumber(props.multiCharOverflow);
|
|
206
206
|
});
|
|
207
|
+
const computeSelectLabel = computed(() => {
|
|
208
|
+
const { modelValue, multiple, remote } = props;
|
|
209
|
+
const multiMaxCharNum = computeMultiMaxCharNum.value;
|
|
210
|
+
if (modelValue && multiple) {
|
|
211
|
+
const vals = XEUtils.isArray(modelValue) ? modelValue : [modelValue];
|
|
212
|
+
if (remote) {
|
|
213
|
+
return vals.map(val => getRemoteSelectLabel(val)).join(', ');
|
|
214
|
+
}
|
|
215
|
+
return vals.map((val) => {
|
|
216
|
+
const label = getSelectLabel(val);
|
|
217
|
+
if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
|
|
218
|
+
return `${label.substring(0, multiMaxCharNum)}...`;
|
|
219
|
+
}
|
|
220
|
+
return label;
|
|
221
|
+
}).join(', ');
|
|
222
|
+
}
|
|
223
|
+
if (remote) {
|
|
224
|
+
return getRemoteSelectLabel(modelValue);
|
|
225
|
+
}
|
|
226
|
+
return getSelectLabel(modelValue);
|
|
227
|
+
});
|
|
207
228
|
const callSlot = (slotFunc, params) => {
|
|
208
229
|
if (slotFunc) {
|
|
209
230
|
if (XEUtils.isString(slotFunc)) {
|
|
@@ -265,27 +286,6 @@ export default defineComponent({
|
|
|
265
286
|
const item = findOption(value);
|
|
266
287
|
return XEUtils.toValueString(item ? item[labelField] : value);
|
|
267
288
|
};
|
|
268
|
-
const computeSelectLabel = computed(() => {
|
|
269
|
-
const { modelValue, multiple, remote } = props;
|
|
270
|
-
const multiMaxCharNum = computeMultiMaxCharNum.value;
|
|
271
|
-
if (modelValue && multiple) {
|
|
272
|
-
const vals = XEUtils.isArray(modelValue) ? modelValue : [modelValue];
|
|
273
|
-
if (remote) {
|
|
274
|
-
return vals.map(val => getRemoteSelectLabel(val)).join(', ');
|
|
275
|
-
}
|
|
276
|
-
return vals.map((val) => {
|
|
277
|
-
const label = getSelectLabel(val);
|
|
278
|
-
if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
|
|
279
|
-
return `${label.substring(0, multiMaxCharNum)}...`;
|
|
280
|
-
}
|
|
281
|
-
return label;
|
|
282
|
-
}).join(', ');
|
|
283
|
-
}
|
|
284
|
-
if (remote) {
|
|
285
|
-
return getRemoteSelectLabel(modelValue);
|
|
286
|
-
}
|
|
287
|
-
return getSelectLabel(modelValue);
|
|
288
|
-
});
|
|
289
289
|
const getOptkey = () => {
|
|
290
290
|
const optionOpts = computeOptionOpts.value;
|
|
291
291
|
return optionOpts.keyField || props.optionId || '_X_OPTION_KEY';
|
|
@@ -498,8 +498,8 @@ export default defineComponent({
|
|
|
498
498
|
}, 350);
|
|
499
499
|
};
|
|
500
500
|
const changeEvent = (evnt, selectValue) => {
|
|
501
|
+
emit('update:modelValue', selectValue);
|
|
501
502
|
if (selectValue !== props.modelValue) {
|
|
502
|
-
emit('update:modelValue', selectValue);
|
|
503
503
|
selectMethods.dispatchEvent('change', { value: selectValue }, evnt);
|
|
504
504
|
// 自动更新校验状态
|
|
505
505
|
if ($xeForm && formItemInfo) {
|
|
@@ -734,12 +734,14 @@ export default defineComponent({
|
|
|
734
734
|
const focusSearchEvent = () => {
|
|
735
735
|
reactData.isActivated = true;
|
|
736
736
|
};
|
|
737
|
-
const
|
|
737
|
+
const handleSearchEvent = () => {
|
|
738
738
|
const { remote, remoteMethod } = props;
|
|
739
739
|
const { searchValue } = reactData;
|
|
740
740
|
if (remote && remoteMethod) {
|
|
741
741
|
reactData.searchLoading = true;
|
|
742
|
-
Promise.resolve(remoteMethod({ searchValue })).then(() => nextTick())
|
|
742
|
+
Promise.resolve(remoteMethod({ searchValue })).then(() => nextTick())
|
|
743
|
+
.catch(() => nextTick())
|
|
744
|
+
.finally(() => {
|
|
743
745
|
reactData.searchLoading = false;
|
|
744
746
|
refreshOption();
|
|
745
747
|
});
|
|
@@ -747,7 +749,8 @@ export default defineComponent({
|
|
|
747
749
|
else {
|
|
748
750
|
refreshOption();
|
|
749
751
|
}
|
|
750
|
-
}
|
|
752
|
+
};
|
|
753
|
+
const triggerSearchEvent = XEUtils.debounce(handleSearchEvent, 350, { trailing: true });
|
|
751
754
|
const togglePanelEvent = (params) => {
|
|
752
755
|
const { $event } = params;
|
|
753
756
|
$event.preventDefault();
|
|
@@ -956,7 +959,7 @@ export default defineComponent({
|
|
|
956
959
|
}, defaultSlot ? defaultSlot({}) : []),
|
|
957
960
|
h('span', {
|
|
958
961
|
class: 'vxe-select-label'
|
|
959
|
-
}, selectLabel)
|
|
962
|
+
}, [selectLabel])
|
|
960
963
|
]);
|
|
961
964
|
}
|
|
962
965
|
return h('div', {
|
|
@@ -1055,7 +1058,6 @@ export default defineComponent({
|
|
|
1055
1058
|
])
|
|
1056
1059
|
]);
|
|
1057
1060
|
};
|
|
1058
|
-
$xeSelect.renderVN = renderVN;
|
|
1059
1061
|
watch(() => reactData.staticOptions, (value) => {
|
|
1060
1062
|
if (value.some((item) => item.options && item.options.length)) {
|
|
1061
1063
|
reactData.fullOptionList = [];
|
|
@@ -1100,6 +1102,7 @@ export default defineComponent({
|
|
|
1100
1102
|
globalEvents.off($xeSelect, 'blur');
|
|
1101
1103
|
});
|
|
1102
1104
|
provide('$xeSelect', $xeSelect);
|
|
1105
|
+
$xeSelect.renderVN = renderVN;
|
|
1103
1106
|
return $xeSelect;
|
|
1104
1107
|
},
|
|
1105
1108
|
render() {
|
package/es/select/src/util.js
CHANGED
|
@@ -14,11 +14,11 @@ export function watchOption(props, option) {
|
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
export function assembleOption($xeSelect, el, option,
|
|
17
|
+
export function assembleOption($xeSelect, el, option, $xeOptgroup) {
|
|
18
18
|
const { reactData } = $xeSelect;
|
|
19
19
|
const { staticOptions } = reactData;
|
|
20
20
|
const parentElem = el.parentNode;
|
|
21
|
-
const parentOption =
|
|
21
|
+
const parentOption = $xeOptgroup ? $xeOptgroup.optionConfig : null;
|
|
22
22
|
const parentCols = parentOption ? parentOption.options : staticOptions;
|
|
23
23
|
if (parentElem && parentCols) {
|
|
24
24
|
parentCols.splice(XEUtils.arrayIndexOf(parentElem.children, el), 0, option);
|