@opentiny/vue-renderless 3.6.7 → 3.8.0
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/action-sheet/index.js +28 -1
- package/action-sheet/vue.js +10 -4
- package/alert/index.js +24 -2
- package/alert/vue.js +15 -11
- package/amount/index.js +4 -4
- package/anchor/index.js +1 -1
- package/autocomplete/vue.js +3 -3
- package/autonavi-map/index.js +1 -1
- package/badge/vue.js +6 -6
- package/baidu-map/index.js +1 -1
- package/bulletin-board/index.js +1 -1
- package/calendar/index.js +2 -2
- package/calendar-bar/index.js +268 -0
- package/calendar-bar/vue.js +87 -0
- package/card/index.js +84 -0
- package/card/vue.js +70 -0
- package/card-group/index.js +16 -0
- package/card-group/vue.js +21 -0
- package/card-template/index.js +1 -1
- package/carousel/index.js +89 -2
- package/carousel/vue.js +14 -5
- package/carousel-item/index.js +8 -0
- package/carousel-item/vue.js +7 -3
- package/cascader/index.js +6 -6
- package/cascader/vue.js +3 -3
- package/cascader-menu/vue.js +2 -2
- package/cascader-panel/index.js +4 -4
- package/cascader-panel/node.js +4 -4
- package/cascader-panel/vue.js +2 -2
- package/cascader-select/index.js +179 -0
- package/cascader-select/vue.js +74 -0
- package/cell/vue.js +16 -0
- package/chart-bar/index.js +3 -3
- package/chart-boxplot/index.js +2 -2
- package/chart-candle/index.js +3 -3
- package/chart-core/deps/utils.js +7 -7
- package/chart-core/index.js +2 -2
- package/chart-funnel/index.js +3 -3
- package/chart-gauge/index.js +3 -3
- package/chart-graph/index.js +1 -1
- package/chart-heatmap/index.js +2 -2
- package/chart-line/index.js +3 -3
- package/chart-liquidfill/index.js +2 -2
- package/chart-map/index.js +3 -3
- package/chart-pie/index.js +3 -3
- package/chart-radar/index.js +3 -3
- package/chart-sankey/index.js +3 -3
- package/chart-scatter/index.js +4 -4
- package/chart-sunburst/index.js +1 -1
- package/chart-tree/index.js +2 -2
- package/chart-waterfall/index.js +3 -3
- package/chart-wordcloud/index.js +2 -2
- package/checkbox/index.js +21 -0
- package/checkbox/vue.js +16 -3
- package/checkbox-button/vue.js +1 -1
- package/collapse-item/vue.js +1 -1
- package/column-list-group/index.js +0 -0
- package/column-list-group/vue.js +14 -0
- package/column-list-item/index.js +50 -0
- package/column-list-item/vue.js +39 -0
- package/common/array.js +3 -3
- package/common/bigInt.js +5 -2
- package/common/dataset/index.js +3 -3
- package/common/date.js +2 -2
- package/common/deps/ResizeObserver.js +1 -1
- package/common/deps/clickoutside.js +1 -1
- package/common/deps/date-util.js +4 -4
- package/common/deps/date.js +2 -2
- package/common/deps/debounce.js +1 -1
- package/common/deps/dom.js +1 -1
- package/common/deps/fullscreen/apis.js +3 -3
- package/common/deps/fullscreen/screenfull.js +1 -1
- package/common/deps/infinite-scroll.js +176 -0
- package/common/deps/letter-only.js +1 -1
- package/common/deps/number-only.js +1 -1
- package/common/deps/observe-visibility.js +106 -0
- package/common/deps/popper.js +20 -22
- package/common/deps/popup-manager.js +2 -2
- package/common/deps/repeat-click.js +1 -1
- package/common/deps/resize-event.js +1 -1
- package/common/deps/tree-model/node.js +5 -5
- package/common/deps/tree-model/tree-store.js +3 -3
- package/common/deps/upload-ajax.js +2 -2
- package/common/deps/vue-popper.js +4 -4
- package/common/deps/vue-popup.js +4 -4
- package/common/index.js +2 -2
- package/common/object.js +1 -1
- package/common/runtime.js +24 -24
- package/common/string.js +23 -4
- package/common/validate/rules/range.js +2 -2
- package/common/validate/rules/required.js +1 -1
- package/common/validate/rules/type.js +3 -3
- package/common/validate/schema.js +1 -1
- package/common/validate/util.js +1 -1
- package/common/validate/validations/array.js +1 -1
- package/common/validate/validations/date.js +1 -1
- package/common/validate/validations/enum.js +1 -1
- package/common/validate/validations/float.js +1 -1
- package/common/validate/validations/integer.js +1 -1
- package/common/validate/validations/method.js +1 -1
- package/common/validate/validations/number.js +1 -1
- package/common/validate/validations/pattern.js +1 -1
- package/common/validate/validations/string.js +1 -1
- package/common/validate/validations/type.js +1 -1
- package/container/index.js +1 -1
- package/crop/index.js +2 -2
- package/currency/index.js +2 -2
- package/date-panel/index.js +7 -7
- package/date-panel/vue.js +3 -2
- package/date-picker-mobile/index.js +250 -0
- package/date-picker-mobile/vue.js +86 -0
- package/date-range/index.js +1 -1
- package/date-range/vue.js +1 -1
- package/date-table/index.js +3 -3
- package/date-table/vue.js +1 -1
- package/dialog-box/index.js +10 -6
- package/dialog-box/vue.js +1 -1
- package/dialog-select/index.js +345 -0
- package/dialog-select/vue.js +110 -0
- package/drawer/index.js +83 -0
- package/drawer/vue.js +51 -0
- package/drop-times/index.js +1 -1
- package/dropdown/index.js +2 -2
- package/dropdown/vue.js +1 -1
- package/dropdown-item/index.js +1 -1
- package/dropdown-item/mf.js +79 -0
- package/dropdown-menu/index.js +30 -1
- package/dropdown-menu/vue.js +17 -7
- package/dynamic-scroller/index.js +117 -0
- package/dynamic-scroller/vue.js +88 -0
- package/dynamic-scroller-item/index.js +147 -0
- package/dynamic-scroller-item/vue.js +92 -0
- package/espace/index.js +1 -1
- package/espace/vue.js +1 -1
- package/exception/vue.js +3 -1
- package/fall-menu/index.js +4 -4
- package/file-upload/index.js +872 -408
- package/file-upload/vue.js +87 -36
- package/filter/index.js +131 -0
- package/filter/tag-group.js +43 -0
- package/filter/vue.js +73 -0
- package/filter-bar/index.js +9 -0
- package/filter-bar/vue.js +16 -0
- package/filter-box/index.js +17 -0
- package/filter-box/vue.js +19 -0
- package/filter-panel/index.js +42 -0
- package/filter-panel/vue.js +33 -0
- package/floatbar/index.js +1 -1
- package/flowchart/index.js +721 -0
- package/flowchart/vue.js +81 -0
- package/form/index.js +15 -1
- package/form/vue.js +10 -4
- package/form-item/index.js +46 -6
- package/form-item/vue.js +27 -3
- package/fullscreen/index.js +1 -1
- package/fullscreen/vue.js +1 -1
- package/grid/plugins/export.js +2 -2
- package/grid/plugins/exportExcel.js +2 -2
- package/grid/plugins/resize.js +1 -1
- package/grid/static/base/helperEqualCompare.js +1 -1
- package/grid/static/base/isPlainObject.js +1 -1
- package/grid/utils/common.js +3 -3
- package/grid/utils/dom.js +3 -3
- package/grid/utils/event.js +2 -2
- package/guide/index.js +168 -0
- package/guide/vue.js +36 -0
- package/hrapprover/index.js +1 -1
- package/image/index.js +8 -4
- package/image/vue.js +12 -6
- package/image-viewer/index.js +3 -3
- package/image-viewer/vue.js +16 -6
- package/input/index.js +34 -1
- package/input/vue.js +22 -6
- package/ip-address/index.js +1 -1
- package/ip-address/vue.js +1 -1
- package/link-menu/index.js +2 -2
- package/link-menu/vue.js +2 -2
- package/loading/index.js +2 -2
- package/loading/vue.js +2 -1
- package/locales/index.js +1 -1
- package/logout/index.js +1 -1
- package/milestone/index.js +5 -1
- package/modal/index.js +68 -39
- package/modal/vue.js +15 -12
- package/month-range/index.js +1 -1
- package/month-range/vue.js +1 -1
- package/month-table/index.js +5 -5
- package/month-table/vue.js +1 -1
- package/multi-select/index.js +5 -2
- package/multi-select/vue.js +4 -5
- package/nav-menu/index.js +6 -6
- package/notify/index.js +3 -3
- package/numeric/index.js +15 -5
- package/numeric/vue.js +15 -6
- package/option/index.js +1 -1
- package/package.json +2 -1
- package/pager-item/index.js +1 -1
- package/panel/index.js +1 -1
- package/picker/index.js +7 -7
- package/picker/vue.js +1 -1
- package/picker-column/index.js +1 -1
- package/popconfirm/index.js +25 -0
- package/popconfirm/vue.js +22 -0
- package/popeditor/index.js +7 -7
- package/popeditor/vue.js +2 -2
- package/popover/index.js +11 -3
- package/popover/vue.js +33 -10
- package/popup/index.js +4 -4
- package/pull-refresh/index.js +8 -11
- package/pull-refresh/vue.js +7 -7
- package/radio/index.js +17 -0
- package/radio/vue.js +18 -3
- package/radio-button/index.js +8 -0
- package/radio-button/vue.js +19 -4
- package/radio-group/index.js +1 -1
- package/radio-group/vue.js +5 -2
- package/rate/index.js +4 -2
- package/rate/vue.js +1 -1
- package/record/index.js +190 -0
- package/record/vue.js +44 -0
- package/recycle-scroller/index.js +470 -0
- package/recycle-scroller/vue.js +135 -0
- package/river/index.js +371 -0
- package/river/river.js +352 -0
- package/river/vue.js +77 -0
- package/roles/index.js +1 -1
- package/scrollbar/vue-bar.js +1 -1
- package/scrollbar/vue.js +1 -1
- package/search/index.js +3 -3
- package/select/index.js +17 -14
- package/select/vue.js +14 -8
- package/select-dropdown/vue.js +1 -1
- package/select-mobile/index.js +111 -0
- package/select-mobile/vue.js +58 -0
- package/select-view/index.js +170 -0
- package/select-view/vue.js +82 -0
- package/selected-box/index.js +216 -0
- package/selected-box/vue.js +98 -0
- package/slide-bar/index.js +1 -1
- package/slider/index.js +49 -4
- package/slider/vue.js +15 -4
- package/split/vue.js +1 -1
- package/standard-list-item/index.js +18 -0
- package/standard-list-item/vue.js +22 -0
- package/steps/index.js +30 -0
- package/steps/slide-bar.js +122 -0
- package/steps/vue.js +15 -3
- package/switch/index.js +1 -1
- package/switch/vue.js +2 -1
- package/tab-bar/index.js +2 -2
- package/tab-item/index.js +2 -2
- package/tab-item/vue.js +1 -1
- package/tab-item-mf/index.js +0 -0
- package/tab-item-mf/vue.js +16 -0
- package/tab-nav/index.js +78 -4
- package/tab-nav/vue.js +11 -3
- package/tabbar-item/index.js +1 -1
- package/tabbar-item/vue.js +1 -1
- package/tabs/index.js +8 -9
- package/tabs/vue.js +1 -1
- package/tabs-mf/index.js +109 -0
- package/tabs-mf/vue-bar.js +49 -0
- package/tabs-mf/vue-nav-item.js +22 -0
- package/tabs-mf/vue-nav.js +13 -0
- package/tabs-mf/vue.js +45 -0
- package/tabs-mf/wheel.js +71 -0
- package/tag/index.js +8 -2
- package/tag/vue.js +13 -5
- package/tag-group/index.js +24 -0
- package/tag-group/vue.js +29 -0
- package/tall-storage/index.js +1 -1
- package/tall-storage/vue.js +1 -1
- package/time/index.js +1 -1
- package/time/vue.js +2 -2
- package/time-line/index.js +28 -7
- package/time-line/vue.js +9 -4
- package/time-panel/index.js +2 -2
- package/time-panel/vue.js +1 -1
- package/time-picker-mobile/index.js +30 -0
- package/time-picker-mobile/vue.js +30 -0
- package/time-range/index.js +1 -1
- package/time-range/vue.js +1 -1
- package/time-spinner/index.js +2 -2
- package/time-spinner/vue.js +1 -1
- package/toggle-menu/index.js +2 -2
- package/toggle-menu/vue.js +1 -1
- package/tooltip/index.js +30 -3
- package/tooltip/vue.js +33 -12
- package/top-box/index.js +3 -3
- package/transfer/index.js +1 -1
- package/transfer-panel/index.js +2 -2
- package/tree/index.js +6 -6
- package/tree/vue.js +1 -1
- package/tree-node/index.js +1 -1
- package/upload/index.js +1 -2
- package/upload/vue.js +2 -2
- package/upload-dragger/index.js +5 -1
- package/upload-dragger/vue.js +9 -3
- package/upload-list/index.js +158 -8
- package/upload-list/vue.js +77 -25
- package/user/index.js +86 -70
- package/user/vue.js +15 -5
- package/user-account/vue.js +1 -1
- package/user-contact/index.js +49 -3
- package/user-contact/vue.js +17 -8
- package/user-head-group/vue.js +17 -0
- package/user-link/index.js +10 -2
- package/user-link/vue.js +11 -6
- package/wheel/index.js +1 -1
- package/wizard/index.js +3 -3
- package/year-range/index.js +125 -0
- package/year-range/vue.js +88 -0
- package/year-table/index.js +175 -11
- package/year-table/vue.js +17 -5
package/river/river.js
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { omitText } from "../common/string";
|
|
3
|
+
const isArr = Array.isArray;
|
|
4
|
+
const some = (arr, predicate) => arr.some(predicate);
|
|
5
|
+
const filter = (arr, predicate) => arr.filter(predicate);
|
|
6
|
+
const lower = (string) => string.toLowerCase();
|
|
7
|
+
const layout = (data, config, el) => {
|
|
8
|
+
const { nodes, links } = data;
|
|
9
|
+
const { iconSpacing, iconRadius, iconPadding, labelOffset, nameField, cols, rows } = config;
|
|
10
|
+
const { heightStart, heightStep, nodeAnchor, posOffsetX, posOffsetY, riverColor, riverSpacing } = config;
|
|
11
|
+
const { statusColor, statusName, endOpacity, backOpacity, nameSplit, legend, showLegend, legendPosY } = config;
|
|
12
|
+
const riverNodes = initRiverNodes(nodes);
|
|
13
|
+
calcRiverNodeWidth({ iconSpacing, riverNodes });
|
|
14
|
+
calcRiverNodeHeight({ links, riverNodes });
|
|
15
|
+
const heightMap = calcHeightMap({ riverNodes, links, heightStart, heightStep });
|
|
16
|
+
calcRiverNodePos({ cols, el, riverNodes, rows, posOffsetX, posOffsetY });
|
|
17
|
+
const nameInfo = calcRiverPath({ links, nodes, nameField, nameSplit });
|
|
18
|
+
const { dataLinkRiverLinkMap, riverLinks } = initRiverLinks(links);
|
|
19
|
+
calcRiverLinkPos({ dataLinkRiverLinkMap, links, riverNodes, heightMap, nodeAnchor, riverSpacing });
|
|
20
|
+
calcRiverLinkPath(riverLinks);
|
|
21
|
+
const riverIcons = calcRiverIcons({ iconRadius, iconSpacing, riverNodes });
|
|
22
|
+
riverNodes.forEach((riverNode) => riverNode.lp = [riverNode.x, riverNode.y - labelOffset, riverNode.width]);
|
|
23
|
+
riverIcons.forEach((riverIcon) => {
|
|
24
|
+
riverIcon.lp = [
|
|
25
|
+
riverIcon.x - iconSpacing / 2 + iconPadding,
|
|
26
|
+
riverIcon.y + labelOffset,
|
|
27
|
+
iconSpacing - iconPadding * 2
|
|
28
|
+
];
|
|
29
|
+
});
|
|
30
|
+
calcGradient({ riverNodes, riverLinks, riverColor, statusColor, endOpacity, backOpacity });
|
|
31
|
+
const leges = showLegend ? calcLegend({ statusColor, statusName, cols, rows, legend, posOffsetX, el, iconPadding, legendPosY }) : [];
|
|
32
|
+
return riverNodes.concat(riverLinks).concat(riverIcons).concat(nameInfo).concat(leges);
|
|
33
|
+
};
|
|
34
|
+
const calcHeightMap = ({ riverNodes, links, heightStart, heightStep }) => {
|
|
35
|
+
const set = /* @__PURE__ */ new Set();
|
|
36
|
+
riverNodes.forEach((riverNode) => set.add(riverNode.height));
|
|
37
|
+
links.forEach((dataLink) => set.add(dataLink.value));
|
|
38
|
+
const arr = [...set].sort();
|
|
39
|
+
const map = /* @__PURE__ */ new Map();
|
|
40
|
+
const start = heightStart;
|
|
41
|
+
const step = heightStep;
|
|
42
|
+
arr.forEach((v, i) => map.set(v, start + step * i));
|
|
43
|
+
return map;
|
|
44
|
+
};
|
|
45
|
+
const initRiverNodes = (nodes) => nodes.map((dataNode) => {
|
|
46
|
+
return { type: "node", x: 0, y: 0, width: 0, height: 0, level: 0, data: dataNode };
|
|
47
|
+
});
|
|
48
|
+
const calcRiverNodeWidth = ({ iconSpacing, riverNodes }) => riverNodes.forEach((riverNode) => {
|
|
49
|
+
const { data: dataNode } = riverNode;
|
|
50
|
+
const { nodes: icons } = dataNode;
|
|
51
|
+
riverNode.width = isArr(icons) && icons.length > 1 ? iconSpacing * icons.length : iconSpacing;
|
|
52
|
+
});
|
|
53
|
+
const calcRiverNodeHeight = ({ links, riverNodes }) => {
|
|
54
|
+
riverNodes.forEach((riverNode) => {
|
|
55
|
+
let heightRatio = 0;
|
|
56
|
+
const { data: dataNode } = riverNode;
|
|
57
|
+
const prdc = (type) => (dataLink) => dataLink[type] === dataNode.name;
|
|
58
|
+
const targetPrdc = prdc("target");
|
|
59
|
+
const sourcePrdc = prdc("source");
|
|
60
|
+
const accumulator = (dataLink) => heightRatio += dataLink.value;
|
|
61
|
+
if (some(links, targetPrdc)) {
|
|
62
|
+
filter(links, targetPrdc).forEach(accumulator);
|
|
63
|
+
} else if (some(links, sourcePrdc)) {
|
|
64
|
+
filter(links, sourcePrdc).forEach(accumulator);
|
|
65
|
+
}
|
|
66
|
+
if (heightRatio > 0) {
|
|
67
|
+
riverNode.height = heightRatio;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const calcRiverNodePos = ({ cols, el, riverNodes, rows, posOffsetX, posOffsetY }) => {
|
|
72
|
+
if (cols && rows) {
|
|
73
|
+
calcRiverNodePosUser({ cols, el, riverNodes, rows, posOffsetX, posOffsetY });
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const calcRiverPath = ({ links, nodes, nameField = "$$name", nameSplit = ";" }) => {
|
|
77
|
+
const names = [];
|
|
78
|
+
const iconNames = [];
|
|
79
|
+
nodes.forEach((dataNode) => {
|
|
80
|
+
names.push(dataNode[nameField] = lower(`n${dataNode.name}`));
|
|
81
|
+
const { nodes: icons } = dataNode;
|
|
82
|
+
icons.forEach((icon, i) => iconNames.push(icon[nameField] = `${dataNode[nameField]}/${i}`));
|
|
83
|
+
});
|
|
84
|
+
links.forEach((dataLink) => names.push(dataLink[nameField] = lower(`l${dataLink.source}t${dataLink.target}`)));
|
|
85
|
+
const nodesCopy = JSON.parse(JSON.stringify(nodes));
|
|
86
|
+
links.forEach(({ source, target }) => {
|
|
87
|
+
let sourceDataNode, targetDataNode;
|
|
88
|
+
nodesCopy.forEach((dataNode) => {
|
|
89
|
+
if (dataNode.name === source)
|
|
90
|
+
sourceDataNode = dataNode;
|
|
91
|
+
if (dataNode.name === target)
|
|
92
|
+
targetDataNode = dataNode;
|
|
93
|
+
});
|
|
94
|
+
if (sourceDataNode._children) {
|
|
95
|
+
sourceDataNode._children.push(targetDataNode);
|
|
96
|
+
} else {
|
|
97
|
+
sourceDataNode._children = [targetDataNode];
|
|
98
|
+
}
|
|
99
|
+
if (targetDataNode._parent) {
|
|
100
|
+
targetDataNode._parent.push(sourceDataNode);
|
|
101
|
+
} else {
|
|
102
|
+
targetDataNode._parent = [sourceDataNode];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
let parent = nodesCopy[0];
|
|
106
|
+
while (parent._parent)
|
|
107
|
+
parent = parent._parent;
|
|
108
|
+
const paths = [];
|
|
109
|
+
const travel = (node, str = "") => {
|
|
110
|
+
if (str)
|
|
111
|
+
str += nameSplit;
|
|
112
|
+
str += node[nameField];
|
|
113
|
+
if (node._children) {
|
|
114
|
+
node._children.forEach((child) => {
|
|
115
|
+
const dataLink = links.find(({ source, target }) => source === node.name && target === child.name);
|
|
116
|
+
travel(child, str + nameSplit + dataLink[nameField]);
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
paths.push(str);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
travel(parent);
|
|
123
|
+
return { type: "name", names, iconNames, paths, nameField, nameSplit };
|
|
124
|
+
};
|
|
125
|
+
const calcRiverNodePosUser = ({ cols, el, riverNodes, rows, posOffsetX, posOffsetY }) => {
|
|
126
|
+
const { clientWidth, clientHeight } = el;
|
|
127
|
+
const areaWidth = clientWidth / cols;
|
|
128
|
+
const areaHeight = clientHeight / rows;
|
|
129
|
+
riverNodes.forEach((riverNode) => {
|
|
130
|
+
const { data: dataNode } = riverNode;
|
|
131
|
+
const { col, row } = dataNode;
|
|
132
|
+
const areaPosX = areaWidth * col;
|
|
133
|
+
const areaPosY = areaHeight * row;
|
|
134
|
+
riverNode.x = areaPosX + posOffsetX;
|
|
135
|
+
riverNode.y = areaPosY + posOffsetY;
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
const initRiverLinks = (links) => {
|
|
139
|
+
const dataLinkRiverLinkMap = /* @__PURE__ */ new WeakMap();
|
|
140
|
+
const riverLinks = links.map((dataLink) => {
|
|
141
|
+
const value = { type: "link", lt: [0, 0], lb: [0, 0], rt: [0, 0], rb: [0, 0], data: dataLink };
|
|
142
|
+
dataLinkRiverLinkMap.set(dataLink, value);
|
|
143
|
+
return value;
|
|
144
|
+
});
|
|
145
|
+
return { dataLinkRiverLinkMap, riverLinks };
|
|
146
|
+
};
|
|
147
|
+
const calcRiverLinkPos1 = ({ links, riverNodes, heightMap, nodeAnchor }) => {
|
|
148
|
+
riverNodes.forEach((riverNode) => {
|
|
149
|
+
const { data: dataNode } = riverNode;
|
|
150
|
+
const prdc = (type) => (dataLink) => dataLink[type] === dataNode.name;
|
|
151
|
+
const targetPrdc = prdc("target");
|
|
152
|
+
const sourcePrdc = prdc("source");
|
|
153
|
+
let offset1 = 0;
|
|
154
|
+
let offset2 = 0;
|
|
155
|
+
if (some(links, targetPrdc)) {
|
|
156
|
+
filter(links, targetPrdc).forEach((dataLink) => {
|
|
157
|
+
offset1 += heightMap.get(dataLink.value);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (some(links, sourcePrdc)) {
|
|
161
|
+
filter(links, sourcePrdc).forEach((dataLink) => {
|
|
162
|
+
offset2 += heightMap.get(dataLink.value);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
riverNode.height = offset1 > offset2 ? offset1 : offset2;
|
|
166
|
+
if (nodeAnchor === "left-middle") {
|
|
167
|
+
riverNode.y = riverNode.y - riverNode.height / 2;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
const adjustRiverPos = ({ riverNodes, nodeAnchor, riverSpacing }) => {
|
|
172
|
+
if (riverSpacing > 0) {
|
|
173
|
+
let posx = /* @__PURE__ */ new Set();
|
|
174
|
+
riverNodes.forEach((riverNode) => posx.add(riverNode.x));
|
|
175
|
+
posx = [...posx].sort();
|
|
176
|
+
posx.forEach((x) => {
|
|
177
|
+
const group = riverNodes.filter((riverNode) => riverNode.x === x);
|
|
178
|
+
if (group.length > 1) {
|
|
179
|
+
group.sort((riverNode1, riverNode2) => riverNode1.y - riverNode2.y);
|
|
180
|
+
for (let i = 0; i < group.length - 1; i++) {
|
|
181
|
+
const riverNode0 = group[i];
|
|
182
|
+
const riverNode1 = group[i + 1];
|
|
183
|
+
const nodePart = nodeAnchor === "left-top" ? riverNode0.height : (riverNode0.height + riverNode1.height) / 2;
|
|
184
|
+
riverNode1.y = riverNode0.y + nodePart + (riverNode1.data.row - riverNode0.data.row) * riverSpacing;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
const calcRiverLinkPos2 = ({ dataLinkRiverLinkMap, links, riverNodes, heightMap }) => {
|
|
191
|
+
riverNodes.forEach((riverNode) => {
|
|
192
|
+
const { data: dataNode, x, width } = riverNode;
|
|
193
|
+
const prdc = (type) => (dataLink) => dataLink[type] === dataNode.name;
|
|
194
|
+
const targetPrdc = prdc("target");
|
|
195
|
+
const sourcePrdc = prdc("source");
|
|
196
|
+
const { y } = riverNode;
|
|
197
|
+
let offset1 = 0;
|
|
198
|
+
let offset2 = 0;
|
|
199
|
+
if (some(links, targetPrdc)) {
|
|
200
|
+
filter(links, targetPrdc).forEach((dataLink) => {
|
|
201
|
+
const riverLink = dataLinkRiverLinkMap.get(dataLink);
|
|
202
|
+
riverLink.rt[0] = x;
|
|
203
|
+
riverLink.rt[1] = y + offset1;
|
|
204
|
+
offset1 += heightMap.get(dataLink.value);
|
|
205
|
+
riverLink.rb[0] = x;
|
|
206
|
+
riverLink.rb[1] = y + offset1;
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (some(links, sourcePrdc)) {
|
|
210
|
+
filter(links, sourcePrdc).forEach((dataLink) => {
|
|
211
|
+
const riverLink = dataLinkRiverLinkMap.get(dataLink);
|
|
212
|
+
riverLink.lt[0] = x + width;
|
|
213
|
+
riverLink.lt[1] = y + offset2;
|
|
214
|
+
offset2 += heightMap.get(dataLink.value);
|
|
215
|
+
riverLink.lb[0] = x + width;
|
|
216
|
+
riverLink.lb[1] = y + offset2;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
const calcRiverLinkPos = ({ dataLinkRiverLinkMap, links, riverNodes, heightMap, nodeAnchor, riverSpacing }) => {
|
|
222
|
+
calcRiverLinkPos1({ links, riverNodes, heightMap, nodeAnchor });
|
|
223
|
+
adjustRiverPos({ riverNodes, nodeAnchor, riverSpacing });
|
|
224
|
+
calcRiverLinkPos2({ dataLinkRiverLinkMap, links, riverNodes, heightMap });
|
|
225
|
+
};
|
|
226
|
+
const calcRiverLinkPath = (riverLinks) => {
|
|
227
|
+
riverLinks.forEach((riverLink) => {
|
|
228
|
+
riverLink.p = [];
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
const parse = (hexStr) => parseInt(hexStr, 16);
|
|
232
|
+
const hexToRgba = (hexStr, opcity = 1) => {
|
|
233
|
+
const twice = (str) => str + str;
|
|
234
|
+
if (hexStr.length === 7) {
|
|
235
|
+
return `rgba(${parse(hexStr.slice(1, 3))},${parse(hexStr.slice(3, 5))},${parse(hexStr.slice(5, 7))},${opcity})`;
|
|
236
|
+
} else if (hexStr.length === 4) {
|
|
237
|
+
const r = parse(twice(hexStr.slice(1, 2)));
|
|
238
|
+
const g = parse(twice(hexStr.slice(2, 3)));
|
|
239
|
+
const b = parse(twice(hexStr.slice(3, 4)));
|
|
240
|
+
return `rgba(${r},${g},${b},${opcity})`;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
const calcGradient = ({ riverNodes, riverLinks, riverColor, statusColor, endOpacity, backOpacity }) => {
|
|
244
|
+
riverNodes.forEach((riverNode) => {
|
|
245
|
+
const { data: dataNode } = riverNode;
|
|
246
|
+
const { nodes: icons } = dataNode;
|
|
247
|
+
const g = [];
|
|
248
|
+
if (!icons || !icons.length) {
|
|
249
|
+
const endColor = hexToRgba(riverColor, endOpacity);
|
|
250
|
+
g.push([0, 1]);
|
|
251
|
+
g.push([endColor, endColor]);
|
|
252
|
+
} else {
|
|
253
|
+
const seg = 1 / (icons.length + 1);
|
|
254
|
+
const segs = [];
|
|
255
|
+
const colors = [];
|
|
256
|
+
icons.forEach((icon, i) => {
|
|
257
|
+
const { skip } = icon;
|
|
258
|
+
const color = statusColor[String(icon.status)];
|
|
259
|
+
if (i === 0) {
|
|
260
|
+
segs.push(0);
|
|
261
|
+
colors.push(hexToRgba(color, endOpacity));
|
|
262
|
+
}
|
|
263
|
+
!skip && segs.push(seg * (i + 1));
|
|
264
|
+
!skip && colors.push(hexToRgba(color, backOpacity));
|
|
265
|
+
if (i === icons.length - 1) {
|
|
266
|
+
segs.push(1);
|
|
267
|
+
colors.push(hexToRgba(color, endOpacity));
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
g.push(segs);
|
|
271
|
+
g.push(colors);
|
|
272
|
+
}
|
|
273
|
+
riverNode.g = g;
|
|
274
|
+
});
|
|
275
|
+
riverLinks.forEach((riverLink) => {
|
|
276
|
+
const { data: dataLink } = riverLink;
|
|
277
|
+
const { source, target } = dataLink;
|
|
278
|
+
const sourceRiverNode = riverNodes.find((riverNode) => riverNode.data.name === source);
|
|
279
|
+
const targetRiverNode = riverNodes.find((riverNode) => riverNode.data.name === target);
|
|
280
|
+
const last = (arr) => arr[arr.length - 1];
|
|
281
|
+
const first = (arr) => arr[0];
|
|
282
|
+
riverLink.g = [
|
|
283
|
+
[0, 1],
|
|
284
|
+
[last(sourceRiverNode.g[1]), first(targetRiverNode.g[1])]
|
|
285
|
+
];
|
|
286
|
+
});
|
|
287
|
+
};
|
|
288
|
+
const calcLegend = ({ statusColor, statusName, cols, rows, legend = {}, posOffsetX, el, iconPadding, legendPosY }) => {
|
|
289
|
+
const { dotRadius = 8, itemWidth = 80, itemHeight = 30, col = 0, row = rows - 1, offsetY = 100 } = legend;
|
|
290
|
+
const { clientWidth, clientHeight } = el;
|
|
291
|
+
const areaWidth = clientWidth / cols;
|
|
292
|
+
const areaHeight = clientHeight / rows;
|
|
293
|
+
const posx = col * areaWidth + posOffsetX;
|
|
294
|
+
const posy = typeof legendPosY === "number" ? legendPosY : (row + 0.5) * areaHeight - itemHeight / 2 + offsetY;
|
|
295
|
+
const legends = [];
|
|
296
|
+
Object.keys(statusColor).forEach((statusKey, i) => {
|
|
297
|
+
const cx = posx + itemWidth * i + dotRadius;
|
|
298
|
+
const cy = posy;
|
|
299
|
+
const color = statusColor[statusKey];
|
|
300
|
+
const x = cx + dotRadius + iconPadding;
|
|
301
|
+
const y = posy;
|
|
302
|
+
const t = statusName[statusKey];
|
|
303
|
+
const tw = itemWidth - 2 * (dotRadius + iconPadding);
|
|
304
|
+
legends.push({ type: "lege", cx, cy, radius: dotRadius, color, x, y, t, tw });
|
|
305
|
+
});
|
|
306
|
+
return legends;
|
|
307
|
+
};
|
|
308
|
+
const calcRiverIcons = ({ iconRadius, iconSpacing, riverNodes }) => {
|
|
309
|
+
const riverIcons = [];
|
|
310
|
+
riverNodes.forEach((riverNode) => {
|
|
311
|
+
const { x, y, height, data: dataNode } = riverNode;
|
|
312
|
+
const { nodes: icons } = dataNode;
|
|
313
|
+
const iconPosY = y + height / 2;
|
|
314
|
+
icons.forEach((icon, i) => {
|
|
315
|
+
const iconPosX = (i + 0.5) * iconSpacing + x;
|
|
316
|
+
riverIcons.push({ type: "icon", x: iconPosX, y: iconPosY, radius: iconRadius, data: icon });
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
return riverIcons;
|
|
320
|
+
};
|
|
321
|
+
const bpath = ({ lt, lb, rt, rb }) => {
|
|
322
|
+
const w = (rt[0] - lt[0]) * 0.42;
|
|
323
|
+
const tune = 0.1;
|
|
324
|
+
const [offsetX, offsetY] = lb;
|
|
325
|
+
const _lb = [0 - tune, 0];
|
|
326
|
+
const _lt = [lt[0] - offsetX - tune, lt[1] - offsetY];
|
|
327
|
+
const _rt = [rt[0] - offsetX + tune, rt[1] - offsetY];
|
|
328
|
+
const _rb = [rb[0] - offsetX + tune, rb[1] - offsetY];
|
|
329
|
+
let path = `M${_lb[0]},${_lb[1]} `;
|
|
330
|
+
path += `C${_lb[0] + w},${_lb[1]} ${_rb[0] - w},${_rb[1]} ${_rb[0]},${_rb[1]} `;
|
|
331
|
+
path += `L${_rt[0]},${_rt[1]} `;
|
|
332
|
+
path += `C${_rt[0] - w},${_rt[1]} ${_lt[0] + w},${_lt[1]} ${_lt[0]},${_lt[1]} `;
|
|
333
|
+
path += `L${_lb[0]},${_lb[1]} z`;
|
|
334
|
+
return path;
|
|
335
|
+
};
|
|
336
|
+
const bc = (p0, p1, p2, p3) => (t) => {
|
|
337
|
+
const ip = (t2, p12, p22) => [(1 - t2) * p12[0] + t2 * p22[0], (1 - t2) * p12[1] + t2 * p22[1]];
|
|
338
|
+
const tmp0 = ip(t, p0, p1);
|
|
339
|
+
const tmp1 = ip(t, p1, p2);
|
|
340
|
+
const tmp2 = ip(t, p2, p3);
|
|
341
|
+
const tmp3 = ip(t, tmp0, tmp1);
|
|
342
|
+
const tmp4 = ip(t, tmp1, tmp2);
|
|
343
|
+
return ip(t, tmp3, tmp4);
|
|
344
|
+
};
|
|
345
|
+
const txt = omitText;
|
|
346
|
+
export {
|
|
347
|
+
bc,
|
|
348
|
+
bpath,
|
|
349
|
+
hexToRgba,
|
|
350
|
+
layout,
|
|
351
|
+
txt
|
|
352
|
+
};
|
package/river/vue.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import {
|
|
3
|
+
buildOption,
|
|
4
|
+
getRenderNode,
|
|
5
|
+
getRenderLink,
|
|
6
|
+
getRenderIcon,
|
|
7
|
+
getRenderLege,
|
|
8
|
+
getTooltip,
|
|
9
|
+
getMarkLine,
|
|
10
|
+
setChartOption,
|
|
11
|
+
setListeners,
|
|
12
|
+
setRiverRgbaOpacity,
|
|
13
|
+
lightUp,
|
|
14
|
+
setRiverIconStyle,
|
|
15
|
+
style,
|
|
16
|
+
computeCanvasStyle,
|
|
17
|
+
getContainerWidth,
|
|
18
|
+
resizeListener
|
|
19
|
+
} from "./index";
|
|
20
|
+
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
21
|
+
const api = ["state", "lightUp", "style"];
|
|
22
|
+
const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive }, { vm, emit, parent }, { echarts }) => {
|
|
23
|
+
const state = reactive({
|
|
24
|
+
myChart: null,
|
|
25
|
+
markLineShow: false,
|
|
26
|
+
lighting: [],
|
|
27
|
+
nameInfo: null,
|
|
28
|
+
styling: [],
|
|
29
|
+
option: null,
|
|
30
|
+
canvasStyle: computed(() => api2.computeCanvasStyle()),
|
|
31
|
+
canvasWidth: null,
|
|
32
|
+
canvasTransformOrigin: "left top",
|
|
33
|
+
canvasTransform: null
|
|
34
|
+
});
|
|
35
|
+
const api2 = {
|
|
36
|
+
state,
|
|
37
|
+
getRenderLege: getRenderLege(),
|
|
38
|
+
getTooltip: getTooltip(),
|
|
39
|
+
getMarkLine: getMarkLine(),
|
|
40
|
+
setChartOption: setChartOption(state),
|
|
41
|
+
setRiverRgbaOpacity: setRiverRgbaOpacity({ props, state }),
|
|
42
|
+
setRiverIconStyle: setRiverIconStyle(state),
|
|
43
|
+
computeCanvasStyle: computeCanvasStyle({ props, state }),
|
|
44
|
+
getContainerWidth: getContainerWidth(state),
|
|
45
|
+
resizeListener: resizeListener({ props, state })
|
|
46
|
+
};
|
|
47
|
+
Object.assign(api2, {
|
|
48
|
+
buildOption: buildOption({ api: api2, emit, props, state, vm }),
|
|
49
|
+
getRenderNode: getRenderNode({ api: api2, echarts }),
|
|
50
|
+
getRenderLink: getRenderLink({ api: api2, echarts }),
|
|
51
|
+
getRenderIcon: getRenderIcon({ api: api2 }),
|
|
52
|
+
setListeners: setListeners({ api: api2, emit, state }),
|
|
53
|
+
lightUp: lightUp({ api: api2, state }),
|
|
54
|
+
style: style({ api: api2, state })
|
|
55
|
+
});
|
|
56
|
+
onMounted(() => {
|
|
57
|
+
state.myChart = echarts.init(vm.$el);
|
|
58
|
+
state.containerEl = parent.$parent.$el;
|
|
59
|
+
const option = state.option = api2.buildOption();
|
|
60
|
+
api2.setChartOption(option);
|
|
61
|
+
api2.setListeners(option);
|
|
62
|
+
state.containerEl && addResizeListener(state.containerEl, api2.resizeListener);
|
|
63
|
+
});
|
|
64
|
+
onBeforeUnmount(() => {
|
|
65
|
+
state.myChart.off("mousemove");
|
|
66
|
+
state.myChart.getZr().off("mousemove");
|
|
67
|
+
state.myChart.off("click");
|
|
68
|
+
state.myChart = null;
|
|
69
|
+
state.containerEl && removeResizeListener(state.containerEl, api2.resizeListener);
|
|
70
|
+
state.containerEl = null;
|
|
71
|
+
});
|
|
72
|
+
return api2;
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
api,
|
|
76
|
+
renderless
|
|
77
|
+
};
|
package/roles/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { xss } from "
|
|
2
|
+
import { xss } from "../common";
|
|
3
3
|
const showList = (state) => () => state.showPopover = true;
|
|
4
4
|
const show = (state) => () => state.showIcon = false;
|
|
5
5
|
const hide = (state) => () => state.showIcon = true;
|
package/scrollbar/vue-bar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { BAR_MAP, renderThumbStyle, clickThumbHandler, clickTrackHandler, startDrag, mouseMoveDocumentHandler, mouseUpDocumentHandler } from "./index";
|
|
3
|
-
import { on, off } from "
|
|
3
|
+
import { on, off } from "../common/deps/dom";
|
|
4
4
|
const api = ["state", "startDrag", "renderThumbStyle", "clickTrackHandler", "clickThumbHandler", "mouseUpDocumentHandler", "mouseMoveDocumentHandler"];
|
|
5
5
|
const renderless = (props, { computed, onUnmounted, reactive }, { refs, parent }) => {
|
|
6
6
|
const state = reactive({
|
package/scrollbar/vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { handleScroll, update } from "./index";
|
|
3
|
-
import { addResizeListener, removeResizeListener } from "
|
|
3
|
+
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
4
4
|
const api = ["state", "update", "handleScroll"];
|
|
5
5
|
const renderless = (props, { onBeforeUnmount, onMounted, reactive }, { refs, nextTick, emit }) => {
|
|
6
6
|
const state = reactive({
|
package/search/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { on, off } from "
|
|
3
|
-
import PopupManager from "
|
|
4
|
-
import { isObject, typeOf } from "
|
|
2
|
+
import { on, off } from "../common/deps/dom";
|
|
3
|
+
import PopupManager from "../common/deps/popup-manager";
|
|
4
|
+
import { isObject, typeOf } from "../common/type";
|
|
5
5
|
const handleChange = ({ emit, state }) => (event) => {
|
|
6
6
|
const value = event.target.value;
|
|
7
7
|
emit("change", state.searchValue, value);
|
package/select/index.js
CHANGED
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
__spreadProps,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-PKUHTIDK.js";
|
|
5
|
-
import { find } from "
|
|
6
|
-
import { getObj, isEqual } from "
|
|
7
|
-
import { isKorean } from "
|
|
8
|
-
import scrollIntoView from "
|
|
9
|
-
import PopupManager from "
|
|
10
|
-
import debounce from "
|
|
11
|
-
import { getDataset } from "
|
|
12
|
-
import Memorize from "
|
|
13
|
-
import { isEmptyObject } from "
|
|
14
|
-
import { addResizeListener, removeResizeListener } from "
|
|
15
|
-
import { extend } from "
|
|
5
|
+
import { find } from "../common/array";
|
|
6
|
+
import { getObj, isEqual } from "../common/object";
|
|
7
|
+
import { isKorean } from "../common/string";
|
|
8
|
+
import scrollIntoView from "../common/deps/scroll-into-view";
|
|
9
|
+
import PopupManager from "../common/deps/popup-manager";
|
|
10
|
+
import debounce from "../common/deps/debounce";
|
|
11
|
+
import { getDataset } from "../common/dataset";
|
|
12
|
+
import Memorize from "../common/deps/memorize";
|
|
13
|
+
import { isEmptyObject } from "../common/type";
|
|
14
|
+
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
15
|
+
import { extend } from "../common/object";
|
|
16
16
|
const handleComposition = ({ api, nextTick, state }) => (event) => {
|
|
17
17
|
const text = event.target.value;
|
|
18
18
|
if (event.type === "compositionend") {
|
|
@@ -418,7 +418,8 @@ const resetInputHeight = ({ constants, nextTick, props, refs, state }) => () =>
|
|
|
418
418
|
}
|
|
419
419
|
const sizeInMap = state.initialInputHeight || 30;
|
|
420
420
|
const noSelected = state.selected.length === 0;
|
|
421
|
-
|
|
421
|
+
const borderHeight = 2;
|
|
422
|
+
input.style.height = noSelected ? sizeInMap + "px" : Math.max(tags ? tags.clientHeight + (tags.clientHeight > sizeInMap ? borderHeight : 0) : 0, sizeInMap) + "px";
|
|
422
423
|
if (state.visible && state.emptyText !== false) {
|
|
423
424
|
state.selectEmitter.emit(constants.EVENT_NAME.updatePopper, true);
|
|
424
425
|
}
|
|
@@ -754,7 +755,7 @@ const optmzApis = {
|
|
|
754
755
|
return sliced;
|
|
755
756
|
},
|
|
756
757
|
queryWrap: (refs) => refs.scrollbar.$el.querySelector(".tiny-scrollbar__wrap.virtual"),
|
|
757
|
-
queryItems: (refs) => refs.scrollbar.$el.querySelectorAll(".tiny-
|
|
758
|
+
queryItems: (refs) => refs.scrollbar.$el.querySelectorAll(".tiny-option.virtual"),
|
|
758
759
|
createMacro: (cb) => setTimeout(cb),
|
|
759
760
|
setScrollTop: ({ refs, state }) => {
|
|
760
761
|
const { optimizeOpts, optimizeStore } = state;
|
|
@@ -983,7 +984,9 @@ const selectChange = ({ emit, props, state }) => ({ $table, selection, checked,
|
|
|
983
984
|
if (row) {
|
|
984
985
|
checked ? state.selected.push(__spreadProps(__spreadValues({}, row), { value: row[valueField], currentLabel: row[textField] })) : remoteItem(row);
|
|
985
986
|
} else {
|
|
986
|
-
checked ? state.selected = state.selected.concat(
|
|
987
|
+
checked ? state.selected = state.selected.concat(
|
|
988
|
+
selection.filter((row2) => !~props.modelValue.indexOf(row2[valueField]))
|
|
989
|
+
) : $table.tableData.forEach((row2) => remoteItem(row2));
|
|
987
990
|
}
|
|
988
991
|
const keys = state.selected.map((item) => item[valueField]);
|
|
989
992
|
emit("update:modelValue", keys);
|
package/select/vue.js
CHANGED
|
@@ -76,10 +76,10 @@ import {
|
|
|
76
76
|
computeMultipleLimit,
|
|
77
77
|
resetFilter
|
|
78
78
|
} from "./index";
|
|
79
|
-
import { BROWSER_NAME } from "
|
|
80
|
-
import browserInfo from "
|
|
81
|
-
import debounce from "
|
|
82
|
-
import { isNumber, isNull } from "
|
|
79
|
+
import { BROWSER_NAME } from "../common";
|
|
80
|
+
import browserInfo from "../common/browser";
|
|
81
|
+
import debounce from "../common/deps/debounce";
|
|
82
|
+
import { isNumber, isNull } from "../common/type";
|
|
83
83
|
const api = [
|
|
84
84
|
"state",
|
|
85
85
|
"nodeCollapse",
|
|
@@ -174,7 +174,9 @@ const initStateAdd = ({ computed, props, api: api2, parent, emitter }) => ({
|
|
|
174
174
|
formItemSize: computed(() => (parent.formItem || {}).formItemSize),
|
|
175
175
|
selectDisabled: computed(() => props.disabled || (parent.form || {}).disabled),
|
|
176
176
|
gridCheckedData: computed(() => api2.getcheckedData()),
|
|
177
|
-
isExpandAll: computed(
|
|
177
|
+
isExpandAll: computed(
|
|
178
|
+
() => props.treeOp && props.treeOp.defaultExpandAll !== void 0 ? props.treeOp.defaultExpandAll : true
|
|
179
|
+
),
|
|
178
180
|
searchSingleCopy: computed(() => props.allowCopy && !props.multiple && props.filterable),
|
|
179
181
|
filterOrSearch: computed(() => props.filterable || props.searchable)
|
|
180
182
|
});
|
|
@@ -200,8 +202,10 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
|
|
|
200
202
|
showClose: computed(
|
|
201
203
|
() => props.clearable && !state.selectDisabled && state.inputHovering && (props.multiple ? Array.isArray(props.modelValue) && props.modelValue.length > 0 : !isNull(props.modelValue) && props.modelValue !== "")
|
|
202
204
|
),
|
|
203
|
-
optionsAllDisabled: computed(
|
|
204
|
-
|
|
205
|
+
optionsAllDisabled: computed(
|
|
206
|
+
() => state.options.filter((option) => option.visible).every((option) => option.disabled)
|
|
207
|
+
),
|
|
208
|
+
collapseTagSize: computed(() => state.selectSize),
|
|
205
209
|
showNewOption: computed(
|
|
206
210
|
() => props.filterable && props.allowCreate && state.query !== "" && !state.options.filter((option) => !option.created).some((option) => option.state.currentLabel === state.query)
|
|
207
211
|
),
|
|
@@ -209,7 +213,9 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
|
|
|
209
213
|
optimizeOpts: computed(() => api2.computeOptimizeOpts()),
|
|
210
214
|
optimizeStore: { flag: false, valueIndex: 0, startIndex: 0, viewStyle: "", datas: [] },
|
|
211
215
|
collapseTags: computed(() => api2.computeCollapseTags()),
|
|
212
|
-
multipleLimit: computed(() => api2.computeMultipleLimit())
|
|
216
|
+
multipleLimit: computed(() => api2.computeMultipleLimit()),
|
|
217
|
+
isSelectAll: computed(() => state.selectCls === "checked-sur"),
|
|
218
|
+
isHalfSelect: computed(() => state.selectCls === "halfselect")
|
|
213
219
|
}));
|
|
214
220
|
return state;
|
|
215
221
|
};
|
package/select-dropdown/vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { mounted } from "./index";
|
|
3
|
-
import userPopper from "
|
|
3
|
+
import userPopper from "../common/deps/vue-popper";
|
|
4
4
|
const api = ["state", "doDestroy"];
|
|
5
5
|
const initState = ({ reactive, computed, popper, selectVm }) => {
|
|
6
6
|
const { showPopper, currentPlacement, popperElm, referenceElm } = popper;
|