vxe-pc-ui 4.15.2 → 4.15.4
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 +866 -257
- package/es/backtop/src/backtop.js +2 -1
- package/es/button/src/button.js +3 -2
- package/es/calendar/src/calendar.js +2 -1
- package/es/cascader/src/cascader.js +72 -29
- package/es/checkbox/src/group.js +5 -1
- package/es/date-panel/src/util.js +27 -16
- package/es/date-picker/src/date-picker.js +572 -74
- package/es/date-range-picker/src/date-range-picker.js +3 -2
- package/es/drawer/src/drawer.js +2 -0
- package/es/form/render/index.js +3 -2
- package/es/form/src/form.js +6 -5
- package/es/form/src/itemInfo.js +6 -5
- package/es/input/src/input.js +2 -1
- package/es/menu/src/menu.js +2 -1
- package/es/modal/src/modal.js +5 -2
- package/es/pager/src/pager.js +4 -3
- package/es/radio/src/group.js +5 -1
- package/es/select/src/select.js +25 -20
- package/es/splitter/src/splitter.js +7 -6
- package/es/table-select/src/table-select.js +21 -16
- package/es/tabs/src/tabs.js +4 -3
- package/es/textarea/src/textarea.js +2 -1
- package/es/tree/src/tree.js +3 -2
- package/es/tree-select/src/tree-select.js +16 -19
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +14 -4
- package/es/upload/src/upload.js +12 -3
- package/lib/backtop/src/backtop.js +5 -2
- package/lib/backtop/src/backtop.min.js +1 -1
- package/lib/button/src/button.js +4 -1
- package/lib/button/src/button.min.js +1 -1
- package/lib/calendar/src/calendar.js +4 -1
- package/lib/calendar/src/calendar.min.js +1 -1
- package/lib/cascader/src/cascader.js +80 -30
- package/lib/cascader/src/cascader.min.js +1 -1
- package/lib/checkbox/src/group.js +5 -1
- package/lib/checkbox/src/group.min.js +1 -1
- package/lib/date-panel/src/util.js +37 -19
- package/lib/date-panel/src/util.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +620 -77
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +4 -1
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/drawer/src/drawer.js +2 -0
- package/lib/drawer/src/drawer.min.js +1 -1
- package/lib/form/render/index.js +4 -1
- package/lib/form/render/index.min.js +1 -1
- package/lib/form/src/form.js +8 -4
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/itemInfo.js +7 -4
- package/lib/form/src/itemInfo.min.js +1 -1
- package/lib/index.umd.js +941 -215
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +6 -3
- package/lib/input/src/input.min.js +1 -1
- package/lib/menu/src/menu.js +4 -1
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/modal/src/modal.js +8 -2
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/pager/src/pager.js +6 -2
- package/lib/pager/src/pager.min.js +1 -1
- package/lib/radio/src/group.js +5 -1
- package/lib/radio/src/group.min.js +1 -1
- package/lib/select/src/select.js +27 -20
- package/lib/select/src/select.min.js +1 -1
- package/lib/splitter/src/splitter.js +12 -8
- package/lib/splitter/src/splitter.min.js +1 -1
- package/lib/table-select/src/table-select.js +22 -15
- package/lib/table-select/src/table-select.min.js +1 -1
- package/lib/tabs/src/tabs.js +7 -3
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/textarea/src/textarea.js +4 -1
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/tree/src/tree.js +7 -4
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree-select/src/tree-select.js +14 -10
- package/lib/tree-select/src/tree-select.min.js +1 -1
- package/lib/ui/index.js +4 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +16 -3
- package/lib/ui/src/log.min.js +1 -1
- package/lib/upload/src/upload.js +20 -3
- package/lib/upload/src/upload.min.js +1 -1
- package/package.json +1 -1
- package/packages/backtop/src/backtop.ts +3 -1
- package/packages/button/src/button.ts +4 -2
- package/packages/calendar/src/calendar.ts +3 -1
- package/packages/cascader/src/cascader.ts +71 -29
- package/packages/checkbox/src/group.ts +6 -2
- package/packages/date-panel/src/util.ts +28 -16
- package/packages/date-picker/src/date-picker.ts +583 -75
- package/packages/date-range-picker/src/date-range-picker.ts +4 -2
- package/packages/drawer/src/drawer.ts +2 -0
- package/packages/form/render/index.ts +4 -2
- package/packages/form/src/form.ts +7 -5
- package/packages/form/src/itemInfo.ts +7 -5
- package/packages/input/src/input.ts +3 -1
- package/packages/menu/src/menu.ts +3 -1
- package/packages/modal/src/modal.ts +6 -2
- package/packages/pager/src/pager.ts +5 -3
- package/packages/radio/src/group.ts +6 -2
- package/packages/select/src/select.ts +29 -22
- package/packages/splitter/src/splitter.ts +8 -6
- package/packages/table-select/src/table-select.ts +24 -17
- package/packages/tabs/src/tabs.ts +5 -3
- package/packages/textarea/src/textarea.ts +3 -1
- package/packages/tree/src/tree.ts +4 -2
- package/packages/tree-select/src/tree-select.ts +17 -19
- package/packages/ui/index.ts +3 -0
- package/packages/ui/src/log.ts +16 -4
- package/packages/upload/src/upload.ts +14 -3
- package/types/components/cascader.d.ts +4 -0
- package/types/components/date-picker.d.ts +14 -6
- package/types/components/drawer.d.ts +2 -0
- package/types/components/modal.d.ts +2 -0
- package/types/components/upload.d.ts +28 -1
- /package/es/icon/{iconfont.1781753592499.ttf → iconfont.1781876596706.ttf} +0 -0
- /package/es/icon/{iconfont.1781753592499.woff → iconfont.1781876596706.woff} +0 -0
- /package/es/icon/{iconfont.1781753592499.woff2 → iconfont.1781876596706.woff2} +0 -0
- /package/es/{iconfont.1781753592499.ttf → iconfont.1781876596706.ttf} +0 -0
- /package/es/{iconfont.1781753592499.woff → iconfont.1781876596706.woff} +0 -0
- /package/es/{iconfont.1781753592499.woff2 → iconfont.1781876596706.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1781753592499.ttf → iconfont.1781876596706.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1781753592499.woff → iconfont.1781876596706.woff} +0 -0
- /package/lib/icon/style/{iconfont.1781753592499.woff2 → iconfont.1781876596706.woff2} +0 -0
- /package/lib/{iconfont.1781753592499.ttf → iconfont.1781876596706.ttf} +0 -0
- /package/lib/{iconfont.1781753592499.woff → iconfont.1781876596706.woff} +0 -0
- /package/lib/{iconfont.1781753592499.woff2 → iconfont.1781876596706.woff2} +0 -0
|
@@ -2,10 +2,11 @@ import { ref, h, reactive, watch, onMounted, nextTick, computed, onBeforeUnmount
|
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { getConfig, getIcon, createEvent, useSize, renderEmptyElement } from '../../ui';
|
|
5
|
-
import {
|
|
5
|
+
import { createComponentLog } from '../../ui/src/log';
|
|
6
6
|
import { getLastZIndex, nextZIndex } from '../../ui/src/utils';
|
|
7
7
|
import { toCssUnit } from '../../ui/src/dom';
|
|
8
8
|
import VxeButtonComponent from '../../button';
|
|
9
|
+
const { errLog } = createComponentLog('backtop');
|
|
9
10
|
function createInternalData() {
|
|
10
11
|
return {
|
|
11
12
|
targetEl: null
|
package/es/button/src/button.js
CHANGED
|
@@ -5,8 +5,9 @@ import { getConfig, globalEvents, getIcon, createEvent, useSize, renderer, usePe
|
|
|
5
5
|
import { getEventTargetNode, updatePanelPlacement } from '../../ui/src/dom';
|
|
6
6
|
import { getFuncText, getLastZIndex, nextZIndex } from '../../ui/src/utils';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
|
-
import {
|
|
8
|
+
import { createComponentLog } from '../../ui/src/log';
|
|
9
9
|
import VxeTooltipComponent from '../../tooltip';
|
|
10
|
+
const { warnLog } = createComponentLog('button');
|
|
10
11
|
const VxeButtonComponent = defineVxeComponent({
|
|
11
12
|
name: 'VxeButton',
|
|
12
13
|
props: {
|
|
@@ -725,7 +726,7 @@ const VxeButtonComponent = defineVxeComponent({
|
|
|
725
726
|
$xeButton.renderVN = renderVN;
|
|
726
727
|
onMounted(() => {
|
|
727
728
|
if (props.type === 'text') {
|
|
728
|
-
warnLog('vxe.error.delProp', ['
|
|
729
|
+
warnLog('vxe.error.delProp', ['type=text', 'mode=text']);
|
|
729
730
|
}
|
|
730
731
|
globalEvents.on($xeButton, 'mousewheel', handleGlobalMousewheelEvent);
|
|
731
732
|
globalEvents.on($xeButton, 'mousedown', handleGlobalMousedownEvent);
|
|
@@ -4,9 +4,10 @@ import { VxeUI, createEvent, useSize, renderEmptyElement } from '../../ui';
|
|
|
4
4
|
import { getDateQuarter } from '../../date-panel/src/util';
|
|
5
5
|
import { toCssUnit } from '../../ui/src/dom';
|
|
6
6
|
import { isEnableConf } from '../../ui/src/utils';
|
|
7
|
-
import {
|
|
7
|
+
import { createComponentLog } from '../../ui/src/log';
|
|
8
8
|
import VxeButtonComponent from '../../button/src/button';
|
|
9
9
|
import XEUtils from 'xe-utils';
|
|
10
|
+
const { errLog } = createComponentLog('calendar');
|
|
10
11
|
const { menus, getConfig, getI18n } = VxeUI;
|
|
11
12
|
export default defineVxeComponent({
|
|
12
13
|
name: 'VxeCalendar',
|
|
@@ -4,7 +4,6 @@ import { getConfig, getI18n, getIcon, globalEvents, createEvent, useSize, render
|
|
|
4
4
|
import { getEventTargetNode, updatePanelPlacement, toCssUnit } from '../../ui/src/dom';
|
|
5
5
|
import { getLastZIndex, nextZIndex } from '../../ui/src/utils';
|
|
6
6
|
import { enNodeValue, deNodeValue } from './util';
|
|
7
|
-
import { errLog } from '../../ui/src/log';
|
|
8
7
|
import XEUtils from 'xe-utils';
|
|
9
8
|
import VxeListComponent from '../../list/src/list';
|
|
10
9
|
import VxeInputComponent from '../../input/src/input';
|
|
@@ -584,7 +583,6 @@ export default defineVxeComponent({
|
|
|
584
583
|
return internalData.afterVisibleList;
|
|
585
584
|
};
|
|
586
585
|
const handleData = (force) => {
|
|
587
|
-
const { nodeMaps } = internalData;
|
|
588
586
|
let fullList = internalData.afterVisibleList;
|
|
589
587
|
if (force) {
|
|
590
588
|
// 更新数据,处理筛选和排序
|
|
@@ -593,16 +591,56 @@ export default defineVxeComponent({
|
|
|
593
591
|
fullList = handleTreeToList();
|
|
594
592
|
}
|
|
595
593
|
const treeList = fullList.slice(0);
|
|
596
|
-
treeList.forEach((item, $index) => {
|
|
597
|
-
const nodeid = getNodeId(item);
|
|
598
|
-
const itemRest = nodeMaps[nodeid];
|
|
599
|
-
if (itemRest) {
|
|
600
|
-
itemRest.$index = $index;
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
594
|
reactData.treeList = treeList;
|
|
604
595
|
};
|
|
605
|
-
|
|
596
|
+
/**
|
|
597
|
+
* 获取第一个拥有子节点的节点
|
|
598
|
+
*/
|
|
599
|
+
function handleHasChildNodeIds(treeList, type) {
|
|
600
|
+
const childrenField = computeChildrenField.value;
|
|
601
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
602
|
+
const treeOpts = computeTreeOpts.value;
|
|
603
|
+
const { transform } = treeOpts;
|
|
604
|
+
const childField = transform ? mapChildrenField : childrenField;
|
|
605
|
+
const nodeIds = [];
|
|
606
|
+
let currList = treeList;
|
|
607
|
+
while (currList.length) {
|
|
608
|
+
let targetNode = null;
|
|
609
|
+
for (const item of currList) {
|
|
610
|
+
const kids = item[childField];
|
|
611
|
+
if (XEUtils.isArray(kids) && kids.length > 0) {
|
|
612
|
+
targetNode = item;
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
if (targetNode) {
|
|
617
|
+
nodeIds.push(getNodeId(targetNode));
|
|
618
|
+
currList = targetNode[childField];
|
|
619
|
+
}
|
|
620
|
+
else {
|
|
621
|
+
const endNode = XEUtils[type](currList);
|
|
622
|
+
nodeIds.push(getNodeId(endNode));
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
return nodeIds;
|
|
627
|
+
}
|
|
628
|
+
const triggerSearchEvent = XEUtils.debounce(() => {
|
|
629
|
+
handleData(true);
|
|
630
|
+
updateModelChecked();
|
|
631
|
+
const filterOpts = computeFilterOpts.value;
|
|
632
|
+
const { autoExpandMode } = filterOpts;
|
|
633
|
+
const { afterTreeList } = internalData;
|
|
634
|
+
// 默认展开第
|
|
635
|
+
if (autoExpandMode === 'first' || autoExpandMode === 'last') {
|
|
636
|
+
const stItems = handleHasChildNodeIds(afterTreeList, autoExpandMode);
|
|
637
|
+
reactData.currentItems = stItems;
|
|
638
|
+
}
|
|
639
|
+
else {
|
|
640
|
+
handleCurrentItems();
|
|
641
|
+
}
|
|
642
|
+
updateCurrentChunk();
|
|
643
|
+
}, 350, { trailing: true });
|
|
606
644
|
const loadData = (list) => {
|
|
607
645
|
const treeOpts = computeTreeOpts.value;
|
|
608
646
|
const keyField = computeKeyField.value;
|
|
@@ -629,17 +667,20 @@ export default defineVxeComponent({
|
|
|
629
667
|
};
|
|
630
668
|
const updateCurrentChunk = () => {
|
|
631
669
|
const { currentItems } = reactData;
|
|
632
|
-
const {
|
|
670
|
+
const { afterTreeList } = internalData;
|
|
633
671
|
const childrenField = computeChildrenField.value;
|
|
634
|
-
const
|
|
672
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
673
|
+
const treeOpts = computeTreeOpts.value;
|
|
674
|
+
const { transform } = treeOpts;
|
|
675
|
+
const currentCunkList = [afterTreeList];
|
|
635
676
|
if (currentItems.length) {
|
|
636
677
|
let chunkIndex = 0;
|
|
637
678
|
let stNodeid = currentItems[chunkIndex];
|
|
638
|
-
let optList =
|
|
679
|
+
let optList = afterTreeList;
|
|
639
680
|
while (stNodeid && optList && optList.length) {
|
|
640
681
|
stNodeid = currentItems[chunkIndex++];
|
|
641
682
|
const currOption = optList.find(item => stNodeid === getNodeId(item));
|
|
642
|
-
optList = currOption ? currOption[childrenField] : [];
|
|
683
|
+
optList = currOption ? currOption[transform ? mapChildrenField : childrenField] : [];
|
|
643
684
|
if (!optList || !optList.length) {
|
|
644
685
|
break;
|
|
645
686
|
}
|
|
@@ -649,7 +690,7 @@ export default defineVxeComponent({
|
|
|
649
690
|
reactData.currentCunkList = currentCunkList;
|
|
650
691
|
};
|
|
651
692
|
const handleCurrentItems = () => {
|
|
652
|
-
const {
|
|
693
|
+
const { afterTreeList } = internalData;
|
|
653
694
|
const selectVals = computeSelectVals.value;
|
|
654
695
|
const childrenField = computeChildrenField.value;
|
|
655
696
|
const mapChildrenField = computeMapChildrenField.value;
|
|
@@ -659,7 +700,7 @@ export default defineVxeComponent({
|
|
|
659
700
|
const expandedMaps = {};
|
|
660
701
|
if (selectVals.length) {
|
|
661
702
|
const lastVal = enNodeValue(XEUtils.last(selectVals));
|
|
662
|
-
const stRest = XEUtils.findTree(
|
|
703
|
+
const stRest = XEUtils.findTree(afterTreeList, (item) => lastVal === getNodeId(item), { children: transform ? mapChildrenField : childrenField });
|
|
663
704
|
if (stRest) {
|
|
664
705
|
const { nodes } = stRest;
|
|
665
706
|
nodes.forEach(item => {
|
|
@@ -765,10 +806,11 @@ export default defineVxeComponent({
|
|
|
765
806
|
return { checkNodeKeys: checkKeys, checkNodes };
|
|
766
807
|
});
|
|
767
808
|
};
|
|
768
|
-
const
|
|
809
|
+
const clearSelectedNode = () => {
|
|
769
810
|
internalData.indeterminateRowMaps = {};
|
|
770
811
|
internalData.selectCheckboxMaps = {};
|
|
771
812
|
reactData.updateCheckboxFlag++;
|
|
813
|
+
reactData.selectRadioKey = null;
|
|
772
814
|
updateCheckboxStatus();
|
|
773
815
|
return nextTick().then(() => {
|
|
774
816
|
return { checkNodeKeys: [], checkNodes: [] };
|
|
@@ -810,7 +852,7 @@ export default defineVxeComponent({
|
|
|
810
852
|
const { $event } = params;
|
|
811
853
|
const { multiple, checkedClosable } = props;
|
|
812
854
|
const value = multiple ? [] : null;
|
|
813
|
-
|
|
855
|
+
clearSelectedNode().then(() => {
|
|
814
856
|
if (checkedClosable) {
|
|
815
857
|
hideOptionPanel($event);
|
|
816
858
|
}
|
|
@@ -892,9 +934,12 @@ export default defineVxeComponent({
|
|
|
892
934
|
const { nodeMaps } = internalData;
|
|
893
935
|
const radioOpts = computeRadioOpts.value;
|
|
894
936
|
const childrenField = computeChildrenField.value;
|
|
937
|
+
const treeOpts = computeTreeOpts.value;
|
|
938
|
+
const { transform } = treeOpts;
|
|
939
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
895
940
|
const { checkMode, checkMethod } = radioOpts;
|
|
896
941
|
const nodeid = getNodeId(node);
|
|
897
|
-
const childList = node[childrenField];
|
|
942
|
+
const childList = node[transform ? mapChildrenField : childrenField];
|
|
898
943
|
const isExistChild = childList && childList.length > 0;
|
|
899
944
|
const nodeItem = nodeMaps[nodeid] || {};
|
|
900
945
|
const nLevel = nodeItem.level;
|
|
@@ -1054,7 +1099,7 @@ export default defineVxeComponent({
|
|
|
1054
1099
|
const childRowList = [];
|
|
1055
1100
|
XEUtils.eachTree(afterTreeList, (node) => {
|
|
1056
1101
|
const nodeid = getNodeId(node);
|
|
1057
|
-
const childList = node[childrenField];
|
|
1102
|
+
const childList = node[transform ? mapChildrenField : childrenField];
|
|
1058
1103
|
if (childList && childList.length && !childRowMaps[nodeid]) {
|
|
1059
1104
|
childRowMaps[nodeid] = 1;
|
|
1060
1105
|
childRowList.unshift([node, nodeid, childList]);
|
|
@@ -1158,7 +1203,7 @@ export default defineVxeComponent({
|
|
|
1158
1203
|
const treeOpts = computeTreeOpts.value;
|
|
1159
1204
|
const { transform } = treeOpts;
|
|
1160
1205
|
const nodeid = getNodeId(node);
|
|
1161
|
-
const childList = node[childrenField];
|
|
1206
|
+
const childList = node[transform ? mapChildrenField : childrenField];
|
|
1162
1207
|
const isExistChild = childList && childList.length > 0;
|
|
1163
1208
|
const nodeItem = nodeMaps[nodeid] || {};
|
|
1164
1209
|
const nLevel = nodeItem.level;
|
|
@@ -1404,11 +1449,12 @@ export default defineVxeComponent({
|
|
|
1404
1449
|
const { currentNode, selectRadioKey, updateCheckboxFlag, updateExpandedFlag } = reactData;
|
|
1405
1450
|
const { nodeMaps, selectCheckboxMaps, indeterminateRowMaps, treeExpandedMaps, treeExpandLazyLoadedMaps } = internalData;
|
|
1406
1451
|
const treeOpts = computeTreeOpts.value;
|
|
1407
|
-
const { lazy, iconLoaded, iconOpen, iconClose } = treeOpts;
|
|
1452
|
+
const { lazy, transform, iconLoaded, iconOpen, iconClose } = treeOpts;
|
|
1408
1453
|
const childrenField = computeChildrenField.value;
|
|
1454
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
1409
1455
|
const labelField = computeLabelField.value;
|
|
1410
1456
|
const hasChildField = computeHasChildField.value;
|
|
1411
|
-
const childList = node[childrenField];
|
|
1457
|
+
const childList = node[transform ? mapChildrenField : childrenField];
|
|
1412
1458
|
const isExistChild = childList && childList.length > 0;
|
|
1413
1459
|
const iconSlot = slots.icon;
|
|
1414
1460
|
const titleSlot = slots.title;
|
|
@@ -1590,7 +1636,7 @@ export default defineVxeComponent({
|
|
|
1590
1636
|
h('div', {
|
|
1591
1637
|
class: 'vxe-tree-select--header-button'
|
|
1592
1638
|
}, [
|
|
1593
|
-
showCheckedButton && showClearButton
|
|
1639
|
+
(showCheckedButton && multiple) || showClearButton
|
|
1594
1640
|
? h('div', {
|
|
1595
1641
|
class: 'vxe-tree-select--selected-btns'
|
|
1596
1642
|
}, [
|
|
@@ -1641,7 +1687,7 @@ export default defineVxeComponent({
|
|
|
1641
1687
|
})
|
|
1642
1688
|
])
|
|
1643
1689
|
]),
|
|
1644
|
-
footerSlot || showTotalButton ||
|
|
1690
|
+
footerSlot || showTotalButton || showCloseButton
|
|
1645
1691
|
? h('div', {
|
|
1646
1692
|
class: 'vxe-cascader--panel-footer'
|
|
1647
1693
|
}, footerSlot
|
|
@@ -1655,7 +1701,7 @@ export default defineVxeComponent({
|
|
|
1655
1701
|
class: 'vxe-cascader--total-btns'
|
|
1656
1702
|
}, getI18n('vxe.treeSelect.total', [selectVals.length]))
|
|
1657
1703
|
: renderEmptyElement($xeCascader),
|
|
1658
|
-
showCloseButton
|
|
1704
|
+
showCloseButton
|
|
1659
1705
|
? h('div', {
|
|
1660
1706
|
class: 'vxe-cascader--oper-btns'
|
|
1661
1707
|
}, [
|
|
@@ -1697,9 +1743,6 @@ export default defineVxeComponent({
|
|
|
1697
1743
|
});
|
|
1698
1744
|
loadData(props.options || []);
|
|
1699
1745
|
onMounted(() => {
|
|
1700
|
-
if (props.filterable) {
|
|
1701
|
-
errLog('vxe.error.notProp', ['filterable']);
|
|
1702
|
-
}
|
|
1703
1746
|
globalEvents.on($xeCascader, 'mousewheel', handleGlobalMousewheelEvent);
|
|
1704
1747
|
globalEvents.on($xeCascader, 'mousedown', handleGlobalMousedownEvent);
|
|
1705
1748
|
globalEvents.on($xeCascader, 'blur', handleGlobalBlurEvent);
|
package/es/checkbox/src/group.js
CHANGED
|
@@ -3,6 +3,9 @@ import { defineVxeComponent } from '../../ui/src/comp';
|
|
|
3
3
|
import { getConfig, createEvent, useSize } from '../../ui';
|
|
4
4
|
import XEUtils from 'xe-utils';
|
|
5
5
|
import VxeCheckboxComponent from './checkbox';
|
|
6
|
+
function createReactData() {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
6
9
|
function createInternalData() {
|
|
7
10
|
return {
|
|
8
11
|
// isLoaded: false
|
|
@@ -42,7 +45,7 @@ export default defineVxeComponent({
|
|
|
42
45
|
const $xeForm = inject('$xeForm', null);
|
|
43
46
|
const formItemInfo = inject('xeFormItemInfo', null);
|
|
44
47
|
const xID = XEUtils.uniqueId();
|
|
45
|
-
const reactData = reactive(
|
|
48
|
+
const reactData = reactive(createReactData());
|
|
46
49
|
const internalData = createInternalData();
|
|
47
50
|
const computeIsReadonly = computed(() => {
|
|
48
51
|
const { readonly } = props;
|
|
@@ -202,6 +205,7 @@ export default defineVxeComponent({
|
|
|
202
205
|
});
|
|
203
206
|
});
|
|
204
207
|
onUnmounted(() => {
|
|
208
|
+
XEUtils.assign(reactData, createReactData());
|
|
205
209
|
XEUtils.assign(internalData, createInternalData());
|
|
206
210
|
});
|
|
207
211
|
provide('$xeCheckboxGroup', $xeCheckboxGroup);
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
|
+
export function getChunkDefaultNum(selectKey) {
|
|
3
|
+
const currDate = new Date();
|
|
4
|
+
switch (selectKey) {
|
|
5
|
+
case 'y': return currDate.getFullYear();
|
|
6
|
+
case 'M': return currDate.getMonth() + 1;
|
|
7
|
+
case 'd': return currDate.getDate();
|
|
8
|
+
case 'H': return currDate.getHours();
|
|
9
|
+
case 'm': return currDate.getMinutes();
|
|
10
|
+
case 's': return currDate.getSeconds();
|
|
11
|
+
}
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
2
14
|
export function hasTimestampValueType(valueFormat) {
|
|
3
15
|
return valueFormat === 'timestamp';
|
|
4
16
|
}
|
|
@@ -19,18 +31,6 @@ export function handleValueFormat(type, valueFormat) {
|
|
|
19
31
|
}
|
|
20
32
|
return 'yyyy-MM-dd';
|
|
21
33
|
}
|
|
22
|
-
export function handleInputFormat(type, inputFormat) {
|
|
23
|
-
if (inputFormat) {
|
|
24
|
-
return inputFormat;
|
|
25
|
-
}
|
|
26
|
-
if (type === 'time') {
|
|
27
|
-
return 'HH:mm:ss';
|
|
28
|
-
}
|
|
29
|
-
if (type === 'datetime') {
|
|
30
|
-
return 'yyyy-MM-dd HH:mm:ss';
|
|
31
|
-
}
|
|
32
|
-
return 'yyyy-MM-dd';
|
|
33
|
-
}
|
|
34
34
|
export function toStringTimeDate(str) {
|
|
35
35
|
const rest = new Date(2e3, 0, 1);
|
|
36
36
|
if (str) {
|
|
@@ -74,7 +74,7 @@ export function getDateQuarter(date) {
|
|
|
74
74
|
}
|
|
75
75
|
return 4;
|
|
76
76
|
}
|
|
77
|
-
export
|
|
77
|
+
export function parseDateValue(val, type, options) {
|
|
78
78
|
const { valueFormat } = options;
|
|
79
79
|
if (val) {
|
|
80
80
|
if (type === 'time') {
|
|
@@ -89,7 +89,7 @@ export const parseDateValue = (val, type, options) => {
|
|
|
89
89
|
return XEUtils.toStringDate(val, valueFormat);
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
|
-
}
|
|
92
|
+
}
|
|
93
93
|
export const parseDateString = (val, type, options) => {
|
|
94
94
|
const dValue = parseDateValue(val, type, options);
|
|
95
95
|
return dValue ? XEUtils.toDateString(dValue, options.valueFormat) : '';
|
|
@@ -226,6 +226,17 @@ export function getRangeDateByCode(code, val, type, options) {
|
|
|
226
226
|
/**
|
|
227
227
|
* 判断周的年份是否跨年
|
|
228
228
|
*/
|
|
229
|
-
|
|
229
|
+
function checkWeekOfsetYear(W, M) {
|
|
230
230
|
return `${W}` === '1' && `${M}` === '12';
|
|
231
|
-
}
|
|
231
|
+
}
|
|
232
|
+
export function isAllSameChar(str, char) {
|
|
233
|
+
if (str.length === 0) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
for (let i = 0; i < str.length; i++) {
|
|
237
|
+
if (str[i] !== char) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return true;
|
|
242
|
+
}
|