@antv/s2-vue 1.1.0 → 1.2.1
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 +2 -2
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/style.min.css +1 -1
- package/esm/index.d.ts +103 -57
- package/esm/index.js +185 -152
- package/esm/index.js.map +1 -1
- package/esm/style.css +6 -0
- package/lib/index.js +184 -151
- package/lib/index.js.map +1 -1
- package/lib/style.css +6 -0
- package/package.json +1 -1
package/esm/index.js
CHANGED
|
@@ -17,9 +17,89 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { customMerge, DEFAULT_OPTIONS, S2Event,
|
|
20
|
+
import { customMerge, DEFAULT_OPTIONS, S2Event, extendLocale, i18n, S2_PREFIX_CLS, TOOLTIP_PREFIX_CLS, getIcon, getTooltipDefaultOptions, BaseTooltip, getBaseCellData, TableSheet as TableSheet$1, PivotSheet as PivotSheet$1 } from "@antv/s2";
|
|
21
21
|
import { shallowRef, ref, computed, watch, defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, createElementVNode, toDisplayString, Fragment, renderList, createCommentVNode, createTextVNode, createBlock, withCtx, renderSlot, render as render$3, onMounted, reactive, isProxy, onBeforeUnmount, toRaw, toRefs, mergeProps, resolveDynamicComponent } from "vue";
|
|
22
22
|
import { Pagination, Menu, Dropdown, Spin, Button, Input, Empty, MenuItem } from "ant-design-vue";
|
|
23
|
+
const EN_US = {
|
|
24
|
+
\u9009\u62E9\u5206\u6790\u4FE1\u606F: "Select Analysis Information",
|
|
25
|
+
\u5207\u6362\u6307\u6807: "Switch indicator",
|
|
26
|
+
\u786E\u5B9A: "Ok",
|
|
27
|
+
\u53D6\u6D88: "Cancel",
|
|
28
|
+
\u91CD\u7F6E: "Reset",
|
|
29
|
+
\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22: "Please enter a keyword search",
|
|
30
|
+
\u641C\u7D22: "Search",
|
|
31
|
+
\u6062\u590D: "Recover",
|
|
32
|
+
"\u5DF2\u9009 {} \u9879": "selected {} item",
|
|
33
|
+
\u6240\u9009\u9879: "selected items",
|
|
34
|
+
\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6: "Select drill down dimension",
|
|
35
|
+
\u6062\u590D\u9ED8\u8BA4: "Restore default",
|
|
36
|
+
\u641C\u7D22\u5B57\u6BB5: "Search field",
|
|
37
|
+
\u884C\u5217\u5207\u6362: "Switch Dimensions",
|
|
38
|
+
\u884C\u5934: "Rows",
|
|
39
|
+
\u5217\u5934: "Cols",
|
|
40
|
+
\u503C: "Values",
|
|
41
|
+
\u5C55\u5F00\u5B50\u9879: "Expand Children",
|
|
42
|
+
\u9996\u5B57\u6BCD: "Alphabetical order",
|
|
43
|
+
\u624B\u52A8\u6392\u5E8F: "Custom order",
|
|
44
|
+
\u5176\u4ED6\u5B57\u6BB5: "Other field",
|
|
45
|
+
\u9AD8\u7EA7\u6392\u5E8F: "Advanced order",
|
|
46
|
+
\u8BBE\u7F6E\u987A\u5E8F: "SetManual",
|
|
47
|
+
\u53EF\u9009\u5B57\u6BB5: "Fields",
|
|
48
|
+
"\u6309\u4EE5\u4E0B\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\uFF08\u4F18\u5148\u7EA7\u7531\u4F4E\u5230\u9AD8\uFF09": "Order according to the following rules (from low to high priority)",
|
|
49
|
+
\u6309: "By",
|
|
50
|
+
\u8BF4\u660E: "Description",
|
|
51
|
+
\u590D\u5236\u539F\u59CB\u6570\u636E: "Copy raw data",
|
|
52
|
+
\u590D\u5236\u683C\u5F0F\u5316\u6570\u636E: "Copy formatted data",
|
|
53
|
+
\u4E0B\u8F7D\u539F\u59CB\u6570\u636E: "Download raw data",
|
|
54
|
+
\u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E: "Download formatted data",
|
|
55
|
+
\u64CD\u4F5C\u6210\u529F: "Operation successful",
|
|
56
|
+
\u64CD\u4F5C\u5931\u8D25: "Operation failed",
|
|
57
|
+
\u65F6\u95F4: "Date",
|
|
58
|
+
\u6307\u6807: "Measure",
|
|
59
|
+
\u76EE\u6807\u503C: "Target Value"
|
|
60
|
+
};
|
|
61
|
+
const ZH_CN = {
|
|
62
|
+
\u9009\u62E9\u5206\u6790\u4FE1\u606F: "\u9009\u62E9\u5206\u6790\u4FE1\u606F",
|
|
63
|
+
\u5207\u6362\u6307\u6807: "\u5207\u6362\u6307\u6807",
|
|
64
|
+
\u786E\u5B9A: "\u786E\u5B9A",
|
|
65
|
+
\u53D6\u6D88: "\u53D6\u6D88",
|
|
66
|
+
\u91CD\u7F6E: "\u91CD\u7F6E",
|
|
67
|
+
\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22",
|
|
68
|
+
\u641C\u7D22: "\u641C\u7D22",
|
|
69
|
+
\u6062\u590D: "\u6062\u590D",
|
|
70
|
+
"\u5DF2\u9009 {} \u9879": "\u5DF2\u9009 {} \u9879",
|
|
71
|
+
\u6240\u9009\u9879: "\u6240\u9009\u9879",
|
|
72
|
+
\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6: "\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6",
|
|
73
|
+
\u6062\u590D\u9ED8\u8BA4: "\u6062\u590D\u9ED8\u8BA4",
|
|
74
|
+
\u641C\u7D22\u5B57\u6BB5: "\u641C\u7D22\u5B57\u6BB5",
|
|
75
|
+
\u884C\u5217\u5207\u6362: "\u884C\u5217\u5207\u6362",
|
|
76
|
+
\u884C\u5934: "\u884C\u5934",
|
|
77
|
+
\u5217\u5934: "\u5217\u5934",
|
|
78
|
+
\u503C: "\u503C",
|
|
79
|
+
\u5C55\u5F00\u5B50\u9879: "\u5C55\u5F00\u5B50\u9879",
|
|
80
|
+
\u9996\u5B57\u6BCD: "\u9996\u5B57\u6BCD",
|
|
81
|
+
\u624B\u52A8\u6392\u5E8F: "\u624B\u52A8\u6392\u5E8F",
|
|
82
|
+
\u5176\u4ED6\u5B57\u6BB5: "\u5176\u4ED6\u5B57\u6BB5",
|
|
83
|
+
\u9AD8\u7EA7\u6392\u5E8F: "\u9AD8\u7EA7\u6392\u5E8F",
|
|
84
|
+
\u8BBE\u7F6E\u987A\u5E8F: "\u8BBE\u7F6E\u987A\u5E8F",
|
|
85
|
+
\u53EF\u9009\u5B57\u6BB5: "\u53EF\u9009\u5B57\u6BB5",
|
|
86
|
+
"\u6309\u4EE5\u4E0B\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\uFF08\u4F18\u5148\u7EA7\u7531\u4F4E\u5230\u9AD8\uFF09": "\u6309\u4EE5\u4E0B\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\uFF08\u4F18\u5148\u7EA7\u7531\u4F4E\u5230\u9AD8\uFF09",
|
|
87
|
+
\u6309: "\u6309",
|
|
88
|
+
\u8BF4\u660E: "\u8BF4\u660E",
|
|
89
|
+
\u590D\u5236\u539F\u59CB\u6570\u636E: "\u590D\u5236\u539F\u59CB\u6570\u636E",
|
|
90
|
+
\u590D\u5236\u683C\u5F0F\u5316\u6570\u636E: "\u590D\u5236\u683C\u5F0F\u5316\u6570\u636E",
|
|
91
|
+
\u4E0B\u8F7D\u539F\u59CB\u6570\u636E: "\u4E0B\u8F7D\u539F\u59CB\u6570\u636E",
|
|
92
|
+
\u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E: "\u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E",
|
|
93
|
+
\u64CD\u4F5C\u6210\u529F: "\u64CD\u4F5C\u6210\u529F",
|
|
94
|
+
\u64CD\u4F5C\u5931\u8D25: "\u64CD\u4F5C\u5931\u8D25",
|
|
95
|
+
\u65F6\u95F4: "\u65F6\u95F4",
|
|
96
|
+
\u6307\u6807: "\u6307\u6807",
|
|
97
|
+
\u76EE\u6807\u503C: "\u76EE\u6807\u503C"
|
|
98
|
+
};
|
|
99
|
+
const Locale = {
|
|
100
|
+
zh_CN: ZH_CN,
|
|
101
|
+
en_US: EN_US
|
|
102
|
+
};
|
|
23
103
|
const SHEET_COMPONENT_DEFAULT_OPTIONS = {
|
|
24
104
|
tooltip: {
|
|
25
105
|
showTooltip: true,
|
|
@@ -32,6 +112,8 @@ const SHEET_COMPONENT_DEFAULT_OPTIONS = {
|
|
|
32
112
|
},
|
|
33
113
|
showDefaultHeaderActionIcon: true
|
|
34
114
|
};
|
|
115
|
+
const RESIZE_RENDER_DELAY = 200;
|
|
116
|
+
const DRILL_DOWN_PRE_CLASS = "s2-drill-down";
|
|
35
117
|
const getBaseSheetComponentOptions = (...options) => customMerge(DEFAULT_OPTIONS, SHEET_COMPONENT_DEFAULT_OPTIONS, ...options);
|
|
36
118
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
37
119
|
var freeGlobal$1 = freeGlobal;
|
|
@@ -1537,18 +1619,20 @@ function size(collection) {
|
|
|
1537
1619
|
}
|
|
1538
1620
|
return baseKeys(collection).length;
|
|
1539
1621
|
}
|
|
1540
|
-
const
|
|
1541
|
-
const analyzeAdaptive = (paramsContainer, adaptive) => {
|
|
1622
|
+
const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
1542
1623
|
var _a, _b, _c;
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1624
|
+
if (isBoolean(adaptive)) {
|
|
1625
|
+
return {
|
|
1626
|
+
container: defaultContainer,
|
|
1627
|
+
adaptiveWidth: true,
|
|
1628
|
+
adaptiveHeight: false
|
|
1629
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
return {
|
|
1632
|
+
container: ((_a = adaptive == null ? void 0 : adaptive.getContainer) == null ? void 0 : _a.call(adaptive)) || defaultContainer,
|
|
1633
|
+
adaptiveWidth: (_b = adaptive == null ? void 0 : adaptive.width) != null ? _b : true,
|
|
1634
|
+
adaptiveHeight: (_c = adaptive == null ? void 0 : adaptive.height) != null ? _c : true
|
|
1635
|
+
};
|
|
1552
1636
|
};
|
|
1553
1637
|
const createResizeObserver = (params) => {
|
|
1554
1638
|
let isFirstRender = true;
|
|
@@ -1622,9 +1706,13 @@ const handleActionIconClick = (params) => {
|
|
|
1622
1706
|
event
|
|
1623
1707
|
});
|
|
1624
1708
|
};
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
|
|
1709
|
+
const defaultPartDrillDownDisplayCondition = (meta) => {
|
|
1710
|
+
var _a;
|
|
1711
|
+
const s2 = meta.spreadsheet;
|
|
1712
|
+
const { fields } = s2.dataCfg;
|
|
1713
|
+
const iconLevel = ((_a = fields.rows) == null ? void 0 : _a.length) - 1;
|
|
1714
|
+
const isValueInCols = !isEmpty(fields.values) ? s2.isValueInCols() : true;
|
|
1715
|
+
return iconLevel <= meta.level && s2.isHierarchyTreeType() && isValueInCols && !meta.isGrandTotals;
|
|
1628
1716
|
};
|
|
1629
1717
|
const buildDrillDownOptions = (options, partDrillDown, callback) => {
|
|
1630
1718
|
var _a;
|
|
@@ -1634,7 +1722,7 @@ const buildDrillDownOptions = (options, partDrillDown, callback) => {
|
|
|
1634
1722
|
belongsCell: "rowCell",
|
|
1635
1723
|
iconNames: ["DrillDownIcon"],
|
|
1636
1724
|
defaultHide: true,
|
|
1637
|
-
displayCondition: partDrillDown.displayCondition ||
|
|
1725
|
+
displayCondition: partDrillDown.displayCondition || defaultPartDrillDownDisplayCondition,
|
|
1638
1726
|
action: (actionIconProps) => {
|
|
1639
1727
|
const { iconName, meta, event } = actionIconProps;
|
|
1640
1728
|
if (iconName === "DrillDownIcon") {
|
|
@@ -1654,10 +1742,8 @@ const buildDrillDownOptions = (options, partDrillDown, callback) => {
|
|
|
1654
1742
|
});
|
|
1655
1743
|
};
|
|
1656
1744
|
const handleDrillDown = (params) => {
|
|
1657
|
-
const { fetchData, spreadsheet, drillFields, drillItemsNum } = params;
|
|
1658
|
-
|
|
1659
|
-
spreadsheet.store.set("drillItemsNum", drillItemsNum);
|
|
1660
|
-
}
|
|
1745
|
+
const { fetchData, spreadsheet, drillFields, drillItemsNum = -1 } = params;
|
|
1746
|
+
spreadsheet.store.set("drillItemsNum", drillItemsNum);
|
|
1661
1747
|
const meta = spreadsheet.store.get("drillDownNode");
|
|
1662
1748
|
const { drillDownDataCache, drillDownCurrentCache } = getDrillDownCache(spreadsheet, meta);
|
|
1663
1749
|
let newDrillDownDataCache = clone(drillDownDataCache);
|
|
@@ -1685,87 +1771,6 @@ const handleDrillDown = (params) => {
|
|
|
1685
1771
|
spreadsheet.render(false);
|
|
1686
1772
|
});
|
|
1687
1773
|
};
|
|
1688
|
-
const EN_US = {
|
|
1689
|
-
\u9009\u62E9\u5206\u6790\u4FE1\u606F: "Select Analysis Information",
|
|
1690
|
-
\u5207\u6362\u6307\u6807: "Switch indicator",
|
|
1691
|
-
\u786E\u5B9A: "Ok",
|
|
1692
|
-
\u53D6\u6D88: "Cancel",
|
|
1693
|
-
\u91CD\u7F6E: "Reset",
|
|
1694
|
-
\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22: "Please enter a keyword search",
|
|
1695
|
-
\u641C\u7D22: "Search",
|
|
1696
|
-
\u6062\u590D: "Recover",
|
|
1697
|
-
"\u5DF2\u9009 {} \u9879": "selected {} item",
|
|
1698
|
-
\u6240\u9009\u9879: "selected items",
|
|
1699
|
-
\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6: "Select drill down dimension",
|
|
1700
|
-
\u6062\u590D\u9ED8\u8BA4: "Restore default",
|
|
1701
|
-
\u641C\u7D22\u5B57\u6BB5: "Search field",
|
|
1702
|
-
\u884C\u5217\u5207\u6362: "Switch Dimensions",
|
|
1703
|
-
\u884C\u5934: "Rows",
|
|
1704
|
-
\u5217\u5934: "Cols",
|
|
1705
|
-
\u503C: "Values",
|
|
1706
|
-
\u5C55\u5F00\u5B50\u9879: "Expand Children",
|
|
1707
|
-
\u9996\u5B57\u6BCD: "Alphabetical order",
|
|
1708
|
-
\u624B\u52A8\u6392\u5E8F: "Custom order",
|
|
1709
|
-
\u5176\u4ED6\u5B57\u6BB5: "Other field",
|
|
1710
|
-
\u9AD8\u7EA7\u6392\u5E8F: "Advanced order",
|
|
1711
|
-
\u8BBE\u7F6E\u987A\u5E8F: "SetManual",
|
|
1712
|
-
\u53EF\u9009\u5B57\u6BB5: "Fields",
|
|
1713
|
-
"\u6309\u4EE5\u4E0B\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\uFF08\u4F18\u5148\u7EA7\u7531\u4F4E\u5230\u9AD8\uFF09": "Order according to the following rules (from low to high priority)",
|
|
1714
|
-
\u6309: "By",
|
|
1715
|
-
\u8BF4\u660E: "Description",
|
|
1716
|
-
\u590D\u5236\u539F\u59CB\u6570\u636E: "Copy raw data",
|
|
1717
|
-
\u590D\u5236\u683C\u5F0F\u5316\u6570\u636E: "Copy formatted data",
|
|
1718
|
-
\u4E0B\u8F7D\u539F\u59CB\u6570\u636E: "Download raw data",
|
|
1719
|
-
\u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E: "Download formatted data",
|
|
1720
|
-
\u64CD\u4F5C\u6210\u529F: "Operation successful",
|
|
1721
|
-
\u64CD\u4F5C\u5931\u8D25: "Operation failed",
|
|
1722
|
-
\u65F6\u95F4: "Date",
|
|
1723
|
-
\u6307\u6807: "Measure",
|
|
1724
|
-
\u76EE\u6807\u503C: "Target Value"
|
|
1725
|
-
};
|
|
1726
|
-
const ZH_CN = {
|
|
1727
|
-
\u9009\u62E9\u5206\u6790\u4FE1\u606F: "\u9009\u62E9\u5206\u6790\u4FE1\u606F",
|
|
1728
|
-
\u5207\u6362\u6307\u6807: "\u5207\u6362\u6307\u6807",
|
|
1729
|
-
\u786E\u5B9A: "\u786E\u5B9A",
|
|
1730
|
-
\u53D6\u6D88: "\u53D6\u6D88",
|
|
1731
|
-
\u91CD\u7F6E: "\u91CD\u7F6E",
|
|
1732
|
-
\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22",
|
|
1733
|
-
\u641C\u7D22: "\u641C\u7D22",
|
|
1734
|
-
\u6062\u590D: "\u6062\u590D",
|
|
1735
|
-
"\u5DF2\u9009 {} \u9879": "\u5DF2\u9009 {} \u9879",
|
|
1736
|
-
\u6240\u9009\u9879: "\u6240\u9009\u9879",
|
|
1737
|
-
\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6: "\u9009\u62E9\u4E0B\u94BB\u7EF4\u5EA6",
|
|
1738
|
-
\u6062\u590D\u9ED8\u8BA4: "\u6062\u590D\u9ED8\u8BA4",
|
|
1739
|
-
\u641C\u7D22\u5B57\u6BB5: "\u641C\u7D22\u5B57\u6BB5",
|
|
1740
|
-
\u884C\u5217\u5207\u6362: "\u884C\u5217\u5207\u6362",
|
|
1741
|
-
\u884C\u5934: "\u884C\u5934",
|
|
1742
|
-
\u5217\u5934: "\u5217\u5934",
|
|
1743
|
-
\u503C: "\u503C",
|
|
1744
|
-
\u5C55\u5F00\u5B50\u9879: "\u5C55\u5F00\u5B50\u9879",
|
|
1745
|
-
\u9996\u5B57\u6BCD: "\u9996\u5B57\u6BCD",
|
|
1746
|
-
\u624B\u52A8\u6392\u5E8F: "\u624B\u52A8\u6392\u5E8F",
|
|
1747
|
-
\u5176\u4ED6\u5B57\u6BB5: "\u5176\u4ED6\u5B57\u6BB5",
|
|
1748
|
-
\u9AD8\u7EA7\u6392\u5E8F: "\u9AD8\u7EA7\u6392\u5E8F",
|
|
1749
|
-
\u8BBE\u7F6E\u987A\u5E8F: "\u8BBE\u7F6E\u987A\u5E8F",
|
|
1750
|
-
\u53EF\u9009\u5B57\u6BB5: "\u53EF\u9009\u5B57\u6BB5",
|
|
1751
|
-
"\u6309\u4EE5\u4E0B\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\uFF08\u4F18\u5148\u7EA7\u7531\u4F4E\u5230\u9AD8\uFF09": "\u6309\u4EE5\u4E0B\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\uFF08\u4F18\u5148\u7EA7\u7531\u4F4E\u5230\u9AD8\uFF09",
|
|
1752
|
-
\u6309: "\u6309",
|
|
1753
|
-
\u8BF4\u660E: "\u8BF4\u660E",
|
|
1754
|
-
\u590D\u5236\u539F\u59CB\u6570\u636E: "\u590D\u5236\u539F\u59CB\u6570\u636E",
|
|
1755
|
-
\u590D\u5236\u683C\u5F0F\u5316\u6570\u636E: "\u590D\u5236\u683C\u5F0F\u5316\u6570\u636E",
|
|
1756
|
-
\u4E0B\u8F7D\u539F\u59CB\u6570\u636E: "\u4E0B\u8F7D\u539F\u59CB\u6570\u636E",
|
|
1757
|
-
\u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E: "\u4E0B\u8F7D\u683C\u5F0F\u5316\u6570\u636E",
|
|
1758
|
-
\u64CD\u4F5C\u6210\u529F: "\u64CD\u4F5C\u6210\u529F",
|
|
1759
|
-
\u64CD\u4F5C\u5931\u8D25: "\u64CD\u4F5C\u5931\u8D25",
|
|
1760
|
-
\u65F6\u95F4: "\u65F6\u95F4",
|
|
1761
|
-
\u6307\u6807: "\u6307\u6807",
|
|
1762
|
-
\u76EE\u6807\u503C: "\u76EE\u6807\u503C"
|
|
1763
|
-
};
|
|
1764
|
-
const Locale = {
|
|
1765
|
-
zh_CN: ZH_CN,
|
|
1766
|
-
en_US: EN_US
|
|
1767
|
-
};
|
|
1768
|
-
const DRILL_DOWN_PRE_CLASS = "s2-drill-down";
|
|
1769
1774
|
extendLocale(Locale);
|
|
1770
1775
|
const useExpose = (expose) => {
|
|
1771
1776
|
const s2Ref = shallowRef();
|
|
@@ -2007,9 +2012,15 @@ const _sfc_main$9 = defineComponent({
|
|
|
2007
2012
|
name: "TooltipSummary",
|
|
2008
2013
|
props: ["summaries"],
|
|
2009
2014
|
setup(props) {
|
|
2010
|
-
const
|
|
2015
|
+
const summaryInfo = computed(() => reduce(props.summaries, (pre, next) => {
|
|
2016
|
+
pre.count += size(next == null ? void 0 : next.selectedData);
|
|
2017
|
+
if (next.value || next.name) {
|
|
2018
|
+
pre.summaries.push(next);
|
|
2019
|
+
}
|
|
2020
|
+
return pre;
|
|
2021
|
+
}, { count: 0, summaries: [] }));
|
|
2011
2022
|
return {
|
|
2012
|
-
|
|
2023
|
+
summaryInfo,
|
|
2013
2024
|
i18n,
|
|
2014
2025
|
TOOLTIP_PREFIX_CLS
|
|
2015
2026
|
};
|
|
@@ -2025,10 +2036,10 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2025
2036
|
}, [
|
|
2026
2037
|
createElementVNode("span", {
|
|
2027
2038
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-selected`)
|
|
2028
|
-
}, toDisplayString(_ctx.count) + " " + toDisplayString(_ctx.i18n("\u9879")), 3),
|
|
2039
|
+
}, toDisplayString(_ctx.summaryInfo.count) + " " + toDisplayString(_ctx.i18n("\u9879")), 3),
|
|
2029
2040
|
createTextVNode(" " + toDisplayString(_ctx.i18n("\u5DF2\u9009\u62E9")), 1)
|
|
2030
2041
|
], 2),
|
|
2031
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.summaries, (summary) => {
|
|
2042
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.summaryInfo.summaries, (summary) => {
|
|
2032
2043
|
return openBlock(), createElementBlock("div", {
|
|
2033
2044
|
key: `${summary.name}-${summary.value}`,
|
|
2034
2045
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary-item`)
|
|
@@ -2079,6 +2090,7 @@ const _sfc_main$7 = defineComponent({
|
|
|
2079
2090
|
};
|
|
2080
2091
|
return {
|
|
2081
2092
|
onMenuTitleClick,
|
|
2093
|
+
isEmpty,
|
|
2082
2094
|
TOOLTIP_PREFIX_CLS
|
|
2083
2095
|
};
|
|
2084
2096
|
},
|
|
@@ -2093,44 +2105,58 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2093
2105
|
const _component_TooltipOperatorMenu = resolveComponent("TooltipOperatorMenu");
|
|
2094
2106
|
const _component_MenuItem = resolveComponent("MenuItem");
|
|
2095
2107
|
const _component_SubMenu = resolveComponent("SubMenu");
|
|
2096
|
-
return openBlock(),
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
}, [
|
|
2113
|
-
((_a = subMenu == null ? void 0 : subMenu.children) == null ? void 0 : _a.length) ? (openBlock(), createBlock(_component_TooltipOperatorMenu, {
|
|
2114
|
-
key: 0,
|
|
2115
|
-
menu: subMenu,
|
|
2116
|
-
cell: _ctx.cell
|
|
2117
|
-
}, null, 8, ["menu", "cell"])) : (openBlock(), createBlock(_component_MenuItem, {
|
|
2118
|
-
title: subMenu.text,
|
|
2108
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
2109
|
+
!_ctx.isEmpty(_ctx.menu.children) ? (openBlock(), createBlock(_component_SubMenu, {
|
|
2110
|
+
key: _ctx.menu.key,
|
|
2111
|
+
popupClassName: `${_ctx.TOOLTIP_PREFIX_CLS}-operator-submenu-popup`,
|
|
2112
|
+
onTitleClick: _ctx.onMenuTitleClick
|
|
2113
|
+
}, {
|
|
2114
|
+
title: withCtx(() => [
|
|
2115
|
+
createVNode(_component_TooltipOperatorTitle, {
|
|
2116
|
+
menu: _ctx.menu,
|
|
2117
|
+
onClick: _ctx.onMenuTitleClick
|
|
2118
|
+
}, null, 8, ["menu", "onClick"])
|
|
2119
|
+
]),
|
|
2120
|
+
default: withCtx(() => [
|
|
2121
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menu.children, (subMenu) => {
|
|
2122
|
+
var _a;
|
|
2123
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
2119
2124
|
key: subMenu.key
|
|
2120
|
-
},
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2125
|
+
}, [
|
|
2126
|
+
((_a = subMenu == null ? void 0 : subMenu.children) == null ? void 0 : _a.length) ? (openBlock(), createBlock(_component_TooltipOperatorMenu, {
|
|
2127
|
+
key: 0,
|
|
2128
|
+
menu: subMenu,
|
|
2129
|
+
cell: _ctx.cell
|
|
2130
|
+
}, null, 8, ["menu", "cell"])) : (openBlock(), createBlock(_component_MenuItem, {
|
|
2131
|
+
title: subMenu.text,
|
|
2132
|
+
key: subMenu.key
|
|
2133
|
+
}, {
|
|
2134
|
+
default: withCtx(() => [
|
|
2135
|
+
createVNode(_component_TooltipOperatorTitle, {
|
|
2136
|
+
menu: subMenu,
|
|
2137
|
+
onClick: _ctx.onMenuTitleClick
|
|
2138
|
+
}, null, 8, ["menu", "onClick"])
|
|
2139
|
+
]),
|
|
2140
|
+
_: 2
|
|
2141
|
+
}, 1032, ["title"]))
|
|
2142
|
+
], 64);
|
|
2143
|
+
}), 128))
|
|
2144
|
+
]),
|
|
2145
|
+
_: 1
|
|
2146
|
+
}, 8, ["popupClassName", "onTitleClick"])) : createCommentVNode("", true),
|
|
2147
|
+
_ctx.isEmpty(_ctx.menu.children) ? (openBlock(), createBlock(_component_MenuItem, {
|
|
2148
|
+
title: _ctx.menu.text,
|
|
2149
|
+
key: _ctx.menu.key
|
|
2150
|
+
}, {
|
|
2151
|
+
default: withCtx(() => [
|
|
2152
|
+
createVNode(_component_TooltipOperatorTitle, {
|
|
2153
|
+
menu: _ctx.menu,
|
|
2154
|
+
onClick: _ctx.onMenuTitleClick
|
|
2155
|
+
}, null, 8, ["menu", "onClick"])
|
|
2156
|
+
]),
|
|
2157
|
+
_: 1
|
|
2158
|
+
}, 8, ["title"])) : createCommentVNode("", true)
|
|
2159
|
+
], 64);
|
|
2134
2160
|
}
|
|
2135
2161
|
var TooltipOperatorMenu = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]);
|
|
2136
2162
|
var index_vue_vue_type_style_index_0_lang$1 = "";
|
|
@@ -2142,9 +2168,13 @@ const _sfc_main$6 = defineComponent({
|
|
|
2142
2168
|
"onClick",
|
|
2143
2169
|
"cell"
|
|
2144
2170
|
],
|
|
2145
|
-
setup() {
|
|
2171
|
+
setup(props, { emit }) {
|
|
2172
|
+
const onMenuClick = (...args) => {
|
|
2173
|
+
emit("click", ...args);
|
|
2174
|
+
};
|
|
2146
2175
|
return {
|
|
2147
|
-
TOOLTIP_PREFIX_CLS
|
|
2176
|
+
TOOLTIP_PREFIX_CLS,
|
|
2177
|
+
onMenuClick
|
|
2148
2178
|
};
|
|
2149
2179
|
},
|
|
2150
2180
|
components: {
|
|
@@ -2165,7 +2195,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2165
2195
|
_ctx.onlyMenu ? (openBlock(), createBlock(_component_Menu, {
|
|
2166
2196
|
key: 0,
|
|
2167
2197
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-menus`),
|
|
2168
|
-
onClick:
|
|
2198
|
+
onClick: _ctx.onMenuClick
|
|
2169
2199
|
}, {
|
|
2170
2200
|
default: withCtx(() => [
|
|
2171
2201
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menus, (menu) => {
|
|
@@ -2177,7 +2207,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2177
2207
|
}), 128))
|
|
2178
2208
|
]),
|
|
2179
2209
|
_: 1
|
|
2180
|
-
}, 8, ["class"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.menus, (menu) => {
|
|
2210
|
+
}, 8, ["class", "onClick"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.menus, (menu) => {
|
|
2181
2211
|
return openBlock(), createBlock(_component_Dropdown, {
|
|
2182
2212
|
key: menu.key,
|
|
2183
2213
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-dropdown`)
|
|
@@ -2188,7 +2218,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2188
2218
|
((_a = menu == null ? void 0 : menu.children) == null ? void 0 : _a.length) ? (openBlock(), createBlock(_component_Menu, {
|
|
2189
2219
|
key: 0,
|
|
2190
2220
|
class: normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-operator-menus`),
|
|
2191
|
-
onClick:
|
|
2221
|
+
onClick: _ctx.onMenuClick
|
|
2192
2222
|
}, {
|
|
2193
2223
|
default: withCtx(() => [
|
|
2194
2224
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menus, (menu2) => {
|
|
@@ -2200,7 +2230,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2200
2230
|
}), 128))
|
|
2201
2231
|
]),
|
|
2202
2232
|
_: 2
|
|
2203
|
-
}, 1032, ["class"])) : createCommentVNode("", true)
|
|
2233
|
+
}, 1032, ["class", "onClick"])) : createCommentVNode("", true)
|
|
2204
2234
|
];
|
|
2205
2235
|
}),
|
|
2206
2236
|
default: withCtx(() => [
|
|
@@ -2558,7 +2588,7 @@ const initBaseSheetProps = () => ({
|
|
|
2558
2588
|
dataCfg: Object,
|
|
2559
2589
|
themeCfg: Object,
|
|
2560
2590
|
showPagination: {
|
|
2561
|
-
type: Object,
|
|
2591
|
+
type: [Object, Boolean],
|
|
2562
2592
|
default: false
|
|
2563
2593
|
},
|
|
2564
2594
|
loading: Boolean,
|
|
@@ -2569,7 +2599,7 @@ const initBaseSheetProps = () => ({
|
|
|
2569
2599
|
default: {}
|
|
2570
2600
|
},
|
|
2571
2601
|
adaptive: {
|
|
2572
|
-
type: Object,
|
|
2602
|
+
type: [Object, Boolean],
|
|
2573
2603
|
default: false
|
|
2574
2604
|
},
|
|
2575
2605
|
onSpreadsheet: Function,
|
|
@@ -2675,7 +2705,10 @@ const initBaseSheetEmits = () => {
|
|
|
2675
2705
|
"mouseUp",
|
|
2676
2706
|
"selected",
|
|
2677
2707
|
"reset",
|
|
2678
|
-
"linkFieldJump"
|
|
2708
|
+
"linkFieldJump",
|
|
2709
|
+
"click",
|
|
2710
|
+
"doubleClick",
|
|
2711
|
+
"scroll"
|
|
2679
2712
|
];
|
|
2680
2713
|
return keys2;
|
|
2681
2714
|
};
|
|
@@ -2947,7 +2980,7 @@ var DrillDown = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render
|
|
|
2947
2980
|
const _sfc_main$2 = defineComponent({
|
|
2948
2981
|
name: "PivotSheet",
|
|
2949
2982
|
props: initBaseSheetProps(),
|
|
2950
|
-
emits:
|
|
2983
|
+
emits: [],
|
|
2951
2984
|
setup(props, ctx) {
|
|
2952
2985
|
const s2Ref = useExpose(ctx.expose);
|
|
2953
2986
|
const { options: pivotOptions } = toRefs(props);
|