@antv/s2-vue 2.0.0-next.14 → 2.0.0-next.15
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/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 +184 -155
- package/esm/index.js +245 -160
- package/esm/index.js.map +1 -1
- package/esm/style.css +1 -1
- package/lib/index.js +243 -158
- package/lib/index.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +36 -36
package/lib/index.js
CHANGED
|
@@ -18,10 +18,31 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
return a;
|
|
19
19
|
};
|
|
20
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __async = (__this, __arguments, generator) => {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
var fulfilled = (value) => {
|
|
24
|
+
try {
|
|
25
|
+
step(generator.next(value));
|
|
26
|
+
} catch (e) {
|
|
27
|
+
reject(e);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var rejected = (value) => {
|
|
31
|
+
try {
|
|
32
|
+
step(generator.throw(value));
|
|
33
|
+
} catch (e) {
|
|
34
|
+
reject(e);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
38
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
21
41
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
22
42
|
const s2 = require("@antv/s2");
|
|
23
43
|
const vue = require("vue");
|
|
24
44
|
const antDesignVue = require("ant-design-vue");
|
|
45
|
+
const DRILL_DOWN_PRE_CLASS = `${s2.S2_PREFIX_CLS}-drill-down`;
|
|
25
46
|
const EN_US = {
|
|
26
47
|
选择分析信息: "Select Analysis Information",
|
|
27
48
|
切换指标: "Switch indicator",
|
|
@@ -62,7 +83,39 @@ const EN_US = {
|
|
|
62
83
|
// strategy
|
|
63
84
|
时间: "Date",
|
|
64
85
|
指标: "Measure",
|
|
65
|
-
目标值: "Target Value"
|
|
86
|
+
目标值: "Target Value",
|
|
87
|
+
// components
|
|
88
|
+
自定义颜色: "Custom color",
|
|
89
|
+
平铺: "Grid",
|
|
90
|
+
树状: "Tree",
|
|
91
|
+
默认: "Default",
|
|
92
|
+
多彩风: "Colorful",
|
|
93
|
+
简约风: "Normal",
|
|
94
|
+
极简风: "Basic",
|
|
95
|
+
斑马纹风: "Zebra",
|
|
96
|
+
主题风格: "Thematic style",
|
|
97
|
+
类型: "Theme type",
|
|
98
|
+
主题: "Theme color",
|
|
99
|
+
主色系: "Primary color",
|
|
100
|
+
深色主题: "Dark theme",
|
|
101
|
+
浅色主题: "Light theme",
|
|
102
|
+
灰色: "Gray",
|
|
103
|
+
自定义: "Custom",
|
|
104
|
+
文字对齐: "Text align",
|
|
105
|
+
左对齐: "Align left",
|
|
106
|
+
居中: "Align center",
|
|
107
|
+
右对齐: "Align right",
|
|
108
|
+
表头: "Header",
|
|
109
|
+
"表身 (维度)": "Body(dimension)",
|
|
110
|
+
"表身 (指标)": "Body(measure)",
|
|
111
|
+
冻结行列头: "Frozen header",
|
|
112
|
+
行: "Row",
|
|
113
|
+
列: "Column",
|
|
114
|
+
冻结行: "Frozen row",
|
|
115
|
+
冻结列: "Frozen column",
|
|
116
|
+
冻结: "Frozen",
|
|
117
|
+
冻结前: "Freeze the first",
|
|
118
|
+
冻结后: "Freeze the last"
|
|
66
119
|
};
|
|
67
120
|
const ZH_CN = {
|
|
68
121
|
选择分析信息: "选择分析信息",
|
|
@@ -104,7 +157,39 @@ const ZH_CN = {
|
|
|
104
157
|
// strategy
|
|
105
158
|
时间: "时间",
|
|
106
159
|
指标: "指标",
|
|
107
|
-
目标值: "目标值"
|
|
160
|
+
目标值: "目标值",
|
|
161
|
+
// components
|
|
162
|
+
自定义颜色: "自定义颜色",
|
|
163
|
+
平铺: "平铺",
|
|
164
|
+
树状: "树状",
|
|
165
|
+
默认: "默认",
|
|
166
|
+
多彩风: "多彩风",
|
|
167
|
+
简约风: "简约风",
|
|
168
|
+
极简风: "极简风",
|
|
169
|
+
斑马纹风: "斑马纹风",
|
|
170
|
+
主题风格: "主题风格",
|
|
171
|
+
类型: "类型",
|
|
172
|
+
主题: "主题",
|
|
173
|
+
主色系: "主色系",
|
|
174
|
+
深色主题: "深色主题",
|
|
175
|
+
浅色主题: "浅色主题",
|
|
176
|
+
灰色: "灰色",
|
|
177
|
+
自定义: "自定义",
|
|
178
|
+
文字对齐: "文字对齐",
|
|
179
|
+
左对齐: "左对齐",
|
|
180
|
+
居中: "居中",
|
|
181
|
+
右对齐: "右对齐",
|
|
182
|
+
表头: "表头",
|
|
183
|
+
"表身 (维度)": "表身 (维度)",
|
|
184
|
+
"表身 (指标)": "表身 (指标)",
|
|
185
|
+
冻结行列头: "冻结行列头",
|
|
186
|
+
行: "行",
|
|
187
|
+
列: "列",
|
|
188
|
+
冻结行: "冻结行",
|
|
189
|
+
冻结列: "冻结列",
|
|
190
|
+
冻结: "冻结",
|
|
191
|
+
冻结前: "冻结前",
|
|
192
|
+
冻结后: "冻结后"
|
|
108
193
|
};
|
|
109
194
|
const Locale = {
|
|
110
195
|
zh_CN: ZH_CN,
|
|
@@ -122,12 +207,6 @@ const SHEET_COMPONENT_DEFAULT_OPTIONS = {
|
|
|
122
207
|
showDefaultHeaderActionIcon: true
|
|
123
208
|
};
|
|
124
209
|
const RESIZE_RENDER_DELAY = 200;
|
|
125
|
-
const DRILL_DOWN_PRE_CLASS = `${s2.S2_PREFIX_CLS}-drill-down`;
|
|
126
|
-
const getBaseSheetComponentOptions = (...options) => s2.customMerge(
|
|
127
|
-
s2.DEFAULT_OPTIONS,
|
|
128
|
-
SHEET_COMPONENT_DEFAULT_OPTIONS,
|
|
129
|
-
...options
|
|
130
|
-
);
|
|
131
210
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
132
211
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
133
212
|
var root = freeGlobal || freeSelf || Function("return this")();
|
|
@@ -367,8 +446,7 @@ var baseSetToString = !defineProperty ? identity : function(func, string) {
|
|
|
367
446
|
"writable": true
|
|
368
447
|
});
|
|
369
448
|
};
|
|
370
|
-
|
|
371
|
-
var setToString = shortOut(baseSetToString$1);
|
|
449
|
+
var setToString = shortOut(baseSetToString);
|
|
372
450
|
function arrayEach(array, iteratee) {
|
|
373
451
|
var index2 = -1, length = array == null ? 0 : array.length;
|
|
374
452
|
while (++index2 < length) {
|
|
@@ -414,7 +492,7 @@ function copyObject(source, props, object, customizer) {
|
|
|
414
492
|
var index2 = -1, length = props.length;
|
|
415
493
|
while (++index2 < length) {
|
|
416
494
|
var key = props[index2];
|
|
417
|
-
var newValue =
|
|
495
|
+
var newValue = void 0;
|
|
418
496
|
if (newValue === void 0) {
|
|
419
497
|
newValue = source[key];
|
|
420
498
|
}
|
|
@@ -474,7 +552,6 @@ var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
|
474
552
|
}()) ? baseIsArguments : function(value) {
|
|
475
553
|
return isObjectLike(value) && hasOwnProperty$a.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
476
554
|
};
|
|
477
|
-
const isArguments$1 = isArguments;
|
|
478
555
|
function stubFalse() {
|
|
479
556
|
return false;
|
|
480
557
|
}
|
|
@@ -484,7 +561,6 @@ var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
|
484
561
|
var Buffer$1 = moduleExports$2 ? root.Buffer : void 0;
|
|
485
562
|
var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
|
|
486
563
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
487
|
-
const isBuffer$1 = isBuffer;
|
|
488
564
|
var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$4 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$7 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$7 = "[object Set]", stringTag$4 = "[object String]", weakMapTag$2 = "[object WeakMap]";
|
|
489
565
|
var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
|
|
490
566
|
var typedArrayTags = {};
|
|
@@ -514,11 +590,10 @@ var nodeUtil = function() {
|
|
|
514
590
|
}();
|
|
515
591
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
516
592
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
517
|
-
const isTypedArray$1 = isTypedArray;
|
|
518
593
|
var objectProto$a = Object.prototype;
|
|
519
594
|
var hasOwnProperty$9 = objectProto$a.hasOwnProperty;
|
|
520
595
|
function arrayLikeKeys(value, inherited) {
|
|
521
|
-
var isArr = isArray(value), isArg = !isArr && isArguments
|
|
596
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
522
597
|
for (var key in value) {
|
|
523
598
|
if ((inherited || hasOwnProperty$9.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
524
599
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
@@ -822,7 +897,7 @@ function arrayPush(array, values) {
|
|
|
822
897
|
}
|
|
823
898
|
var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : void 0;
|
|
824
899
|
function isFlattenable(value) {
|
|
825
|
-
return isArray(value) || isArguments
|
|
900
|
+
return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
826
901
|
}
|
|
827
902
|
function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
828
903
|
var index2 = -1, length = array.length;
|
|
@@ -830,13 +905,11 @@ function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
|
830
905
|
result || (result = []);
|
|
831
906
|
while (++index2 < length) {
|
|
832
907
|
var value = array[index2];
|
|
833
|
-
if (
|
|
834
|
-
|
|
835
|
-
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
|
836
|
-
} else {
|
|
908
|
+
if (predicate(value)) {
|
|
909
|
+
{
|
|
837
910
|
arrayPush(result, value);
|
|
838
911
|
}
|
|
839
|
-
} else
|
|
912
|
+
} else {
|
|
840
913
|
result[result.length] = value;
|
|
841
914
|
}
|
|
842
915
|
}
|
|
@@ -844,7 +917,7 @@ function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
|
844
917
|
}
|
|
845
918
|
function flatten(array) {
|
|
846
919
|
var length = array == null ? 0 : array.length;
|
|
847
|
-
return length ? baseFlatten(array
|
|
920
|
+
return length ? baseFlatten(array) : [];
|
|
848
921
|
}
|
|
849
922
|
function flatRest(func) {
|
|
850
923
|
return setToString(overRest(func, void 0, flatten), func + "");
|
|
@@ -994,9 +1067,8 @@ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
|
|
|
994
1067
|
}
|
|
995
1068
|
return result;
|
|
996
1069
|
};
|
|
997
|
-
const getSymbolsIn$1 = getSymbolsIn;
|
|
998
1070
|
function copySymbolsIn(source, object) {
|
|
999
|
-
return copyObject(source, getSymbolsIn
|
|
1071
|
+
return copyObject(source, getSymbolsIn(source), object);
|
|
1000
1072
|
}
|
|
1001
1073
|
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
1002
1074
|
var result = keysFunc(object);
|
|
@@ -1006,7 +1078,7 @@ function getAllKeys(object) {
|
|
|
1006
1078
|
return baseGetAllKeys(object, keys, getSymbols);
|
|
1007
1079
|
}
|
|
1008
1080
|
function getAllKeysIn(object) {
|
|
1009
|
-
return baseGetAllKeys(object, keysIn, getSymbolsIn
|
|
1081
|
+
return baseGetAllKeys(object, keysIn, getSymbolsIn);
|
|
1010
1082
|
}
|
|
1011
1083
|
var DataView = getNative(root, "DataView");
|
|
1012
1084
|
var Promise$1 = getNative(root, "Promise");
|
|
@@ -1035,7 +1107,6 @@ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$3 || Map
|
|
|
1035
1107
|
return result;
|
|
1036
1108
|
};
|
|
1037
1109
|
}
|
|
1038
|
-
const getTag$1 = getTag;
|
|
1039
1110
|
var objectProto$3 = Object.prototype;
|
|
1040
1111
|
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
1041
1112
|
function initCloneArray(array) {
|
|
@@ -1047,10 +1118,9 @@ function initCloneArray(array) {
|
|
|
1047
1118
|
return result;
|
|
1048
1119
|
}
|
|
1049
1120
|
var Uint8Array2 = root.Uint8Array;
|
|
1050
|
-
const Uint8Array$1 = Uint8Array2;
|
|
1051
1121
|
function cloneArrayBuffer(arrayBuffer) {
|
|
1052
1122
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
1053
|
-
new
|
|
1123
|
+
new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
|
|
1054
1124
|
return result;
|
|
1055
1125
|
}
|
|
1056
1126
|
function cloneDataView(dataView, isDeep) {
|
|
@@ -1111,13 +1181,13 @@ function initCloneObject(object) {
|
|
|
1111
1181
|
}
|
|
1112
1182
|
var mapTag$4 = "[object Map]";
|
|
1113
1183
|
function baseIsMap(value) {
|
|
1114
|
-
return isObjectLike(value) && getTag
|
|
1184
|
+
return isObjectLike(value) && getTag(value) == mapTag$4;
|
|
1115
1185
|
}
|
|
1116
1186
|
var nodeIsMap = nodeUtil && nodeUtil.isMap;
|
|
1117
1187
|
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
|
|
1118
1188
|
var setTag$4 = "[object Set]";
|
|
1119
1189
|
function baseIsSet(value) {
|
|
1120
|
-
return isObjectLike(value) && getTag
|
|
1190
|
+
return isObjectLike(value) && getTag(value) == setTag$4;
|
|
1121
1191
|
}
|
|
1122
1192
|
var nodeIsSet = nodeUtil && nodeUtil.isSet;
|
|
1123
1193
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
@@ -1145,8 +1215,8 @@ function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
|
1145
1215
|
return copyArray(value, result);
|
|
1146
1216
|
}
|
|
1147
1217
|
} else {
|
|
1148
|
-
var tag = getTag
|
|
1149
|
-
if (isBuffer
|
|
1218
|
+
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
1219
|
+
if (isBuffer(value)) {
|
|
1150
1220
|
return cloneBuffer(value, isDeep);
|
|
1151
1221
|
}
|
|
1152
1222
|
if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
|
|
@@ -1291,7 +1361,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
|
1291
1361
|
object = object.buffer;
|
|
1292
1362
|
other = other.buffer;
|
|
1293
1363
|
case arrayBufferTag:
|
|
1294
|
-
if (object.byteLength != other.byteLength || !equalFunc(new
|
|
1364
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
|
|
1295
1365
|
return false;
|
|
1296
1366
|
}
|
|
1297
1367
|
return true;
|
|
@@ -1379,12 +1449,12 @@ var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[o
|
|
|
1379
1449
|
var objectProto$1 = Object.prototype;
|
|
1380
1450
|
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
1381
1451
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1382
|
-
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag
|
|
1452
|
+
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
1383
1453
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
1384
1454
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
1385
1455
|
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
1386
|
-
if (isSameTag && isBuffer
|
|
1387
|
-
if (!isBuffer
|
|
1456
|
+
if (isSameTag && isBuffer(object)) {
|
|
1457
|
+
if (!isBuffer(other)) {
|
|
1388
1458
|
return false;
|
|
1389
1459
|
}
|
|
1390
1460
|
objIsArr = true;
|
|
@@ -1392,7 +1462,7 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
|
1392
1462
|
}
|
|
1393
1463
|
if (isSameTag && !objIsObj) {
|
|
1394
1464
|
stack || (stack = new Stack());
|
|
1395
|
-
return objIsArr || isTypedArray
|
|
1465
|
+
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
1396
1466
|
}
|
|
1397
1467
|
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
|
|
1398
1468
|
var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$1.call(other, "__wrapped__");
|
|
@@ -1419,29 +1489,27 @@ function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
|
1419
1489
|
}
|
|
1420
1490
|
var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
|
|
1421
1491
|
function baseIsMatch(object, source, matchData, customizer) {
|
|
1422
|
-
var index2 = matchData.length, length = index2
|
|
1492
|
+
var index2 = matchData.length, length = index2;
|
|
1423
1493
|
if (object == null) {
|
|
1424
1494
|
return !length;
|
|
1425
1495
|
}
|
|
1426
1496
|
object = Object(object);
|
|
1427
1497
|
while (index2--) {
|
|
1428
1498
|
var data = matchData[index2];
|
|
1429
|
-
if (
|
|
1499
|
+
if (data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
|
|
1430
1500
|
return false;
|
|
1431
1501
|
}
|
|
1432
1502
|
}
|
|
1433
1503
|
while (++index2 < length) {
|
|
1434
1504
|
data = matchData[index2];
|
|
1435
1505
|
var key = data[0], objValue = object[key], srcValue = data[1];
|
|
1436
|
-
if (
|
|
1506
|
+
if (data[2]) {
|
|
1437
1507
|
if (objValue === void 0 && !(key in object)) {
|
|
1438
1508
|
return false;
|
|
1439
1509
|
}
|
|
1440
1510
|
} else {
|
|
1441
1511
|
var stack = new Stack();
|
|
1442
|
-
|
|
1443
|
-
var result = customizer(objValue, srcValue, key, object, source, stack);
|
|
1444
|
-
}
|
|
1512
|
+
var result;
|
|
1445
1513
|
if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
|
|
1446
1514
|
return false;
|
|
1447
1515
|
}
|
|
@@ -1494,7 +1562,7 @@ function hasPath(object, path, hasFunc) {
|
|
|
1494
1562
|
return result;
|
|
1495
1563
|
}
|
|
1496
1564
|
length = object == null ? 0 : object.length;
|
|
1497
|
-
return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments
|
|
1565
|
+
return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
|
|
1498
1566
|
}
|
|
1499
1567
|
function hasIn(object, path) {
|
|
1500
1568
|
return object != null && hasPath(object, path, baseHasIn);
|
|
@@ -1538,7 +1606,7 @@ function createBaseFor(fromRight) {
|
|
|
1538
1606
|
return function(object, iteratee, keysFunc) {
|
|
1539
1607
|
var index2 = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
|
|
1540
1608
|
while (length--) {
|
|
1541
|
-
var key = props[
|
|
1609
|
+
var key = props[++index2];
|
|
1542
1610
|
if (iteratee(iterable[key], key, iterable) === false) {
|
|
1543
1611
|
break;
|
|
1544
1612
|
}
|
|
@@ -1547,9 +1615,8 @@ function createBaseFor(fromRight) {
|
|
|
1547
1615
|
};
|
|
1548
1616
|
}
|
|
1549
1617
|
var baseFor = createBaseFor();
|
|
1550
|
-
const baseFor$1 = baseFor;
|
|
1551
1618
|
function baseForOwn(object, iteratee) {
|
|
1552
|
-
return object && baseFor
|
|
1619
|
+
return object && baseFor(object, iteratee, keys);
|
|
1553
1620
|
}
|
|
1554
1621
|
function createBaseEach(eachFunc, fromRight) {
|
|
1555
1622
|
return function(collection, iteratee) {
|
|
@@ -1559,8 +1626,8 @@ function createBaseEach(eachFunc, fromRight) {
|
|
|
1559
1626
|
if (!isArrayLike(collection)) {
|
|
1560
1627
|
return eachFunc(collection, iteratee);
|
|
1561
1628
|
}
|
|
1562
|
-
var length = collection.length, index2 =
|
|
1563
|
-
while (
|
|
1629
|
+
var length = collection.length, index2 = -1, iterable = Object(collection);
|
|
1630
|
+
while (++index2 < length) {
|
|
1564
1631
|
if (iteratee(iterable[index2], index2, iterable) === false) {
|
|
1565
1632
|
break;
|
|
1566
1633
|
}
|
|
@@ -1569,7 +1636,6 @@ function createBaseEach(eachFunc, fromRight) {
|
|
|
1569
1636
|
};
|
|
1570
1637
|
}
|
|
1571
1638
|
var baseEach = createBaseEach(baseForOwn);
|
|
1572
|
-
const baseEach$1 = baseEach;
|
|
1573
1639
|
var now = function() {
|
|
1574
1640
|
return root.Date.now();
|
|
1575
1641
|
};
|
|
@@ -1662,7 +1728,7 @@ function last(array) {
|
|
|
1662
1728
|
}
|
|
1663
1729
|
function baseFilter(collection, predicate) {
|
|
1664
1730
|
var result = [];
|
|
1665
|
-
baseEach
|
|
1731
|
+
baseEach(collection, function(value, index2, collection2) {
|
|
1666
1732
|
if (predicate(value, index2, collection2)) {
|
|
1667
1733
|
result.push(value);
|
|
1668
1734
|
}
|
|
@@ -1691,10 +1757,10 @@ function isEmpty(value) {
|
|
|
1691
1757
|
if (value == null) {
|
|
1692
1758
|
return true;
|
|
1693
1759
|
}
|
|
1694
|
-
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer
|
|
1760
|
+
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
|
1695
1761
|
return !value.length;
|
|
1696
1762
|
}
|
|
1697
|
-
var tag = getTag
|
|
1763
|
+
var tag = getTag(value);
|
|
1698
1764
|
if (tag == mapTag$1 || tag == setTag$1) {
|
|
1699
1765
|
return !value.size;
|
|
1700
1766
|
}
|
|
@@ -1761,7 +1827,7 @@ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
|
|
|
1761
1827
|
}
|
|
1762
1828
|
function reduce(collection, iteratee, accumulator) {
|
|
1763
1829
|
var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
|
|
1764
|
-
return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach
|
|
1830
|
+
return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach);
|
|
1765
1831
|
}
|
|
1766
1832
|
var mapTag = "[object Map]", setTag = "[object Set]";
|
|
1767
1833
|
function size(collection) {
|
|
@@ -1771,71 +1837,12 @@ function size(collection) {
|
|
|
1771
1837
|
if (isArrayLike(collection)) {
|
|
1772
1838
|
return isString(collection) ? stringSize(collection) : collection.length;
|
|
1773
1839
|
}
|
|
1774
|
-
var tag = getTag
|
|
1840
|
+
var tag = getTag(collection);
|
|
1775
1841
|
if (tag == mapTag || tag == setTag) {
|
|
1776
1842
|
return collection.size;
|
|
1777
1843
|
}
|
|
1778
1844
|
return baseKeys(collection).length;
|
|
1779
1845
|
}
|
|
1780
|
-
const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
1781
|
-
var _a, _b, _c;
|
|
1782
|
-
if (isBoolean(adaptive)) {
|
|
1783
|
-
return {
|
|
1784
|
-
container: defaultContainer,
|
|
1785
|
-
adaptiveWidth: true,
|
|
1786
|
-
adaptiveHeight: false
|
|
1787
|
-
};
|
|
1788
|
-
}
|
|
1789
|
-
return {
|
|
1790
|
-
container: ((_a = adaptive == null ? void 0 : adaptive.getContainer) == null ? void 0 : _a.call(adaptive)) || defaultContainer,
|
|
1791
|
-
adaptiveWidth: (_b = adaptive == null ? void 0 : adaptive.width) != null ? _b : true,
|
|
1792
|
-
adaptiveHeight: (_c = adaptive == null ? void 0 : adaptive.height) != null ? _c : true
|
|
1793
|
-
};
|
|
1794
|
-
};
|
|
1795
|
-
const createResizeObserver = (params) => {
|
|
1796
|
-
let isFirstRender = true;
|
|
1797
|
-
const { s2: s2$1, adaptive, container, wrapper } = params;
|
|
1798
|
-
const {
|
|
1799
|
-
container: actualWrapper,
|
|
1800
|
-
adaptiveWidth,
|
|
1801
|
-
adaptiveHeight
|
|
1802
|
-
} = analyzeAdaptive(wrapper, adaptive);
|
|
1803
|
-
if (!actualWrapper || !container || !adaptive || !s2$1) {
|
|
1804
|
-
return;
|
|
1805
|
-
}
|
|
1806
|
-
const render2 = (width, height) => {
|
|
1807
|
-
s2$1 == null ? void 0 : s2$1.changeSheetSize(width, height);
|
|
1808
|
-
s2$1 == null ? void 0 : s2$1.render(false);
|
|
1809
|
-
};
|
|
1810
|
-
const debounceRender = debounce(render2, RESIZE_RENDER_DELAY);
|
|
1811
|
-
const onResize = () => {
|
|
1812
|
-
const { clientWidth: containerWidth, clientHeight: containerHeight } = container;
|
|
1813
|
-
const width = adaptiveWidth ? s2.floor(containerWidth != null ? containerWidth : s2$1.options.width) : s2$1.options.width;
|
|
1814
|
-
const height = adaptiveHeight ? s2.floor(containerHeight != null ? containerHeight : s2$1.options.height) : s2$1.options.height;
|
|
1815
|
-
if (!adaptiveWidth && !adaptiveHeight) {
|
|
1816
|
-
return;
|
|
1817
|
-
}
|
|
1818
|
-
if (isFirstRender) {
|
|
1819
|
-
render2(width, height);
|
|
1820
|
-
isFirstRender = false;
|
|
1821
|
-
return;
|
|
1822
|
-
}
|
|
1823
|
-
debounceRender(width, height);
|
|
1824
|
-
};
|
|
1825
|
-
const resizeObserver = new ResizeObserver(
|
|
1826
|
-
([entry] = []) => {
|
|
1827
|
-
if (entry) {
|
|
1828
|
-
onResize();
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
);
|
|
1832
|
-
resizeObserver.observe(actualWrapper, {
|
|
1833
|
-
box: "border-box"
|
|
1834
|
-
});
|
|
1835
|
-
return () => {
|
|
1836
|
-
resizeObserver.unobserve(actualWrapper);
|
|
1837
|
-
};
|
|
1838
|
-
};
|
|
1839
1846
|
const getDrillDownCache = (spreadsheet, meta) => {
|
|
1840
1847
|
const drillDownDataCache = spreadsheet.store.get(
|
|
1841
1848
|
"drillDownDataCache",
|
|
@@ -1926,7 +1933,7 @@ const handleDrillDown = (params) => {
|
|
|
1926
1933
|
if (!fetchData) {
|
|
1927
1934
|
return;
|
|
1928
1935
|
}
|
|
1929
|
-
fetchData(meta, drillFields).then((info) => {
|
|
1936
|
+
fetchData(meta, drillFields).then((info) => __async(exports, null, function* () {
|
|
1930
1937
|
const { drillData, drillField } = info;
|
|
1931
1938
|
spreadsheet.dataSet.transformDrillDownData(
|
|
1932
1939
|
drillField,
|
|
@@ -1945,20 +1952,74 @@ const handleDrillDown = (params) => {
|
|
|
1945
1952
|
spreadsheet.store.set("drillDownDataCache", newDrillDownDataCache);
|
|
1946
1953
|
}
|
|
1947
1954
|
spreadsheet.interaction.reset();
|
|
1948
|
-
spreadsheet.render(false);
|
|
1949
|
-
});
|
|
1955
|
+
yield spreadsheet.render(false);
|
|
1956
|
+
}));
|
|
1950
1957
|
};
|
|
1951
|
-
s2.
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
+
const getBaseSheetComponentOptions = (...options) => s2.customMerge(
|
|
1959
|
+
s2.DEFAULT_OPTIONS,
|
|
1960
|
+
SHEET_COMPONENT_DEFAULT_OPTIONS,
|
|
1961
|
+
...options
|
|
1962
|
+
);
|
|
1963
|
+
const analyzeAdaptive = (defaultContainer, adaptive) => {
|
|
1964
|
+
var _a, _b, _c;
|
|
1965
|
+
if (isBoolean(adaptive)) {
|
|
1966
|
+
return {
|
|
1967
|
+
container: defaultContainer,
|
|
1968
|
+
adaptiveWidth: true,
|
|
1969
|
+
adaptiveHeight: false
|
|
1970
|
+
};
|
|
1971
|
+
}
|
|
1972
|
+
return {
|
|
1973
|
+
container: ((_a = adaptive == null ? void 0 : adaptive.getContainer) == null ? void 0 : _a.call(adaptive)) || defaultContainer,
|
|
1974
|
+
adaptiveWidth: (_b = adaptive == null ? void 0 : adaptive.width) != null ? _b : true,
|
|
1975
|
+
adaptiveHeight: (_c = adaptive == null ? void 0 : adaptive.height) != null ? _c : true
|
|
1976
|
+
};
|
|
1977
|
+
};
|
|
1978
|
+
const createResizeObserver = (params) => {
|
|
1979
|
+
let isFirstRender = true;
|
|
1980
|
+
const { s2: s2$1, adaptive, container, wrapper } = params;
|
|
1981
|
+
const {
|
|
1982
|
+
container: actualWrapper,
|
|
1983
|
+
adaptiveWidth,
|
|
1984
|
+
adaptiveHeight
|
|
1985
|
+
} = analyzeAdaptive(wrapper, adaptive);
|
|
1986
|
+
if (!actualWrapper || !container || !adaptive || !s2$1) {
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
const render2 = (width, height) => __async(exports, null, function* () {
|
|
1990
|
+
s2$1 == null ? void 0 : s2$1.changeSheetSize(width, height);
|
|
1991
|
+
yield s2$1 == null ? void 0 : s2$1.render(false);
|
|
1992
|
+
});
|
|
1993
|
+
const debounceRender = debounce(render2, RESIZE_RENDER_DELAY);
|
|
1994
|
+
const onResize = () => __async(exports, null, function* () {
|
|
1995
|
+
const { clientWidth: containerWidth, clientHeight: containerHeight } = container;
|
|
1996
|
+
const width = adaptiveWidth ? s2.floor(containerWidth != null ? containerWidth : s2$1.options.width) : s2$1.options.width;
|
|
1997
|
+
const height = adaptiveHeight ? s2.floor(containerHeight != null ? containerHeight : s2$1.options.height) : s2$1.options.height;
|
|
1998
|
+
if (!adaptiveWidth && !adaptiveHeight) {
|
|
1999
|
+
return;
|
|
2000
|
+
}
|
|
2001
|
+
if (isFirstRender) {
|
|
2002
|
+
yield render2(width, height);
|
|
2003
|
+
isFirstRender = false;
|
|
2004
|
+
return;
|
|
1958
2005
|
}
|
|
2006
|
+
debounceRender(width, height);
|
|
1959
2007
|
});
|
|
1960
|
-
|
|
2008
|
+
const resizeObserver = new ResizeObserver(
|
|
2009
|
+
([entry] = []) => {
|
|
2010
|
+
if (entry) {
|
|
2011
|
+
onResize();
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
);
|
|
2015
|
+
resizeObserver.observe(actualWrapper, {
|
|
2016
|
+
box: "border-box"
|
|
2017
|
+
});
|
|
2018
|
+
return () => {
|
|
2019
|
+
resizeObserver.unobserve(actualWrapper);
|
|
2020
|
+
};
|
|
1961
2021
|
};
|
|
2022
|
+
s2.extendLocale(Locale);
|
|
1962
2023
|
const _sfc_main$e = vue.defineComponent({
|
|
1963
2024
|
name: "TooltipDetail",
|
|
1964
2025
|
props: ["list"],
|
|
@@ -2438,7 +2499,7 @@ const usePagination = (s2Ref, props) => {
|
|
|
2438
2499
|
const visible = vue.computed(() => {
|
|
2439
2500
|
return showPagination && !isEmpty(paginationCfg);
|
|
2440
2501
|
});
|
|
2441
|
-
vue.watch([current, pageSize], () => {
|
|
2502
|
+
vue.watch([current, pageSize], () => __async(exports, null, function* () {
|
|
2442
2503
|
if (!s2Ref.value) {
|
|
2443
2504
|
return;
|
|
2444
2505
|
}
|
|
@@ -2447,8 +2508,8 @@ const usePagination = (s2Ref, props) => {
|
|
|
2447
2508
|
pageSize: pageSize.value
|
|
2448
2509
|
};
|
|
2449
2510
|
s2Ref.value.updatePagination(nextPagination);
|
|
2450
|
-
s2Ref.value.render(false);
|
|
2451
|
-
});
|
|
2511
|
+
yield s2Ref.value.render(false);
|
|
2512
|
+
}));
|
|
2452
2513
|
vue.watch(
|
|
2453
2514
|
[() => paginationCfg, s2Ref],
|
|
2454
2515
|
() => {
|
|
@@ -2842,7 +2903,25 @@ const useLoading = (s2Ref, loadingProp = false) => {
|
|
|
2842
2903
|
});
|
|
2843
2904
|
return { loading, setLoading };
|
|
2844
2905
|
};
|
|
2845
|
-
const
|
|
2906
|
+
const useResize = (s2Ref, props, dom) => {
|
|
2907
|
+
const unobserve = vue.ref();
|
|
2908
|
+
vue.watch([s2Ref, () => props.adaptive], ([s22, adaptive], _, onCleanup) => {
|
|
2909
|
+
if (!s22) {
|
|
2910
|
+
return;
|
|
2911
|
+
}
|
|
2912
|
+
unobserve.value = createResizeObserver({
|
|
2913
|
+
s2: s22,
|
|
2914
|
+
adaptive,
|
|
2915
|
+
wrapper: dom.wrapperRef.value,
|
|
2916
|
+
container: dom.containerRef.value
|
|
2917
|
+
});
|
|
2918
|
+
onCleanup(() => {
|
|
2919
|
+
var _a;
|
|
2920
|
+
(_a = unobserve.value) == null ? void 0 : _a.call(unobserve);
|
|
2921
|
+
});
|
|
2922
|
+
});
|
|
2923
|
+
};
|
|
2924
|
+
const useSheetUpdate = (s2Ref, props, hooks) => {
|
|
2846
2925
|
const updateFlag = vue.reactive({
|
|
2847
2926
|
rerender: false,
|
|
2848
2927
|
reloadData: false,
|
|
@@ -2886,37 +2965,23 @@ const useSheetUpdate = (s2Ref, props) => {
|
|
|
2886
2965
|
deep: vue.isProxy(props.themeCfg)
|
|
2887
2966
|
}
|
|
2888
2967
|
);
|
|
2889
|
-
vue.watch(updateFlag, (flag) => {
|
|
2890
|
-
var _a;
|
|
2968
|
+
vue.watch(updateFlag, (flag) => __async(exports, null, function* () {
|
|
2969
|
+
var _a, _b, _c, _d, _e;
|
|
2891
2970
|
if (!flag.rerender) {
|
|
2892
2971
|
return;
|
|
2893
2972
|
}
|
|
2894
|
-
(_a =
|
|
2973
|
+
(_a = hooks == null ? void 0 : hooks.before) == null ? void 0 : _a.call(hooks);
|
|
2974
|
+
const renderOptions = (_b = props == null ? void 0 : props.onUpdate) == null ? void 0 : _b.call(props, {
|
|
2895
2975
|
reloadData: flag.reloadData,
|
|
2896
|
-
|
|
2976
|
+
rebuildDataSet: flag.rebuildDataset
|
|
2897
2977
|
});
|
|
2978
|
+
yield (_c = s2Ref.value) == null ? void 0 : _c.render(renderOptions);
|
|
2979
|
+
(_d = props == null ? void 0 : props.onUpdateAfterRender) == null ? void 0 : _d.call(props, renderOptions);
|
|
2980
|
+
(_e = hooks == null ? void 0 : hooks.after) == null ? void 0 : _e.call(hooks);
|
|
2898
2981
|
flag.rerender = false;
|
|
2899
2982
|
flag.reloadData = false;
|
|
2900
2983
|
flag.rebuildDataset = false;
|
|
2901
|
-
});
|
|
2902
|
-
};
|
|
2903
|
-
const useResize = (s2Ref, props, dom) => {
|
|
2904
|
-
const unobserve = vue.ref();
|
|
2905
|
-
vue.watch([s2Ref, () => props.adaptive], ([s22, adaptive], _, onCleanup) => {
|
|
2906
|
-
if (!s22) {
|
|
2907
|
-
return;
|
|
2908
|
-
}
|
|
2909
|
-
unobserve.value = createResizeObserver({
|
|
2910
|
-
s2: s22,
|
|
2911
|
-
adaptive,
|
|
2912
|
-
wrapper: dom.wrapperRef.value,
|
|
2913
|
-
container: dom.containerRef.value
|
|
2914
|
-
});
|
|
2915
|
-
onCleanup(() => {
|
|
2916
|
-
var _a;
|
|
2917
|
-
(_a = unobserve.value) == null ? void 0 : _a.call(unobserve);
|
|
2918
|
-
});
|
|
2919
|
-
});
|
|
2984
|
+
}));
|
|
2920
2985
|
};
|
|
2921
2986
|
function useSpreadSheet(props, emit) {
|
|
2922
2987
|
const {
|
|
@@ -2945,20 +3010,28 @@ function useSpreadSheet(props, emit) {
|
|
|
2945
3010
|
}
|
|
2946
3011
|
return new s2.PivotSheet(container, rawDataCfg, s2Options);
|
|
2947
3012
|
};
|
|
2948
|
-
const buildSpreadSheet = () => {
|
|
3013
|
+
const buildSpreadSheet = () => __async(this, null, function* () {
|
|
2949
3014
|
setLoading(true);
|
|
2950
3015
|
s2Ref.value = renderSpreadSheet(containerRef.value);
|
|
2951
3016
|
s2Ref.value.setThemeCfg(vue.toRaw(themeCfg));
|
|
2952
|
-
s2Ref.value.render();
|
|
3017
|
+
yield s2Ref.value.render();
|
|
2953
3018
|
setLoading(false);
|
|
2954
3019
|
onS2Mounted == null ? void 0 : onS2Mounted(s2Ref.value);
|
|
2955
|
-
};
|
|
3020
|
+
});
|
|
2956
3021
|
vue.onMounted(buildSpreadSheet);
|
|
2957
3022
|
useEvents(s2Ref, emit);
|
|
2958
|
-
useSheetUpdate(s2Ref, props
|
|
3023
|
+
useSheetUpdate(s2Ref, props, {
|
|
3024
|
+
before() {
|
|
3025
|
+
setLoading(true);
|
|
3026
|
+
},
|
|
3027
|
+
after() {
|
|
3028
|
+
setLoading(false);
|
|
3029
|
+
}
|
|
3030
|
+
});
|
|
2959
3031
|
useResize(s2Ref, props, { wrapperRef, containerRef });
|
|
2960
3032
|
vue.onBeforeUnmount(() => {
|
|
2961
3033
|
var _a;
|
|
3034
|
+
setLoading(false);
|
|
2962
3035
|
(_a = s2Ref.value) == null ? void 0 : _a.destroy();
|
|
2963
3036
|
});
|
|
2964
3037
|
return {
|
|
@@ -2991,7 +3064,9 @@ const initBaseSheetProps = () => {
|
|
|
2991
3064
|
default: false
|
|
2992
3065
|
},
|
|
2993
3066
|
spreadsheet: Function,
|
|
2994
|
-
onMounted: Function
|
|
3067
|
+
onMounted: Function,
|
|
3068
|
+
onUpdate: Function,
|
|
3069
|
+
onUpdateAfterRender: Function
|
|
2995
3070
|
};
|
|
2996
3071
|
};
|
|
2997
3072
|
const initDrillDownProps = () => {
|
|
@@ -3195,6 +3270,16 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3195
3270
|
}, 8, ["wrapperClassName", "spinning"]);
|
|
3196
3271
|
}
|
|
3197
3272
|
const BaseSheet = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
|
|
3273
|
+
const useExpose = (expose) => {
|
|
3274
|
+
const s2Ref = vue.shallowRef();
|
|
3275
|
+
expose({
|
|
3276
|
+
get instance() {
|
|
3277
|
+
var _a;
|
|
3278
|
+
return (_a = s2Ref.value) == null ? void 0 : _a.instance;
|
|
3279
|
+
}
|
|
3280
|
+
});
|
|
3281
|
+
return s2Ref;
|
|
3282
|
+
};
|
|
3198
3283
|
const _hoisted_1$2 = {
|
|
3199
3284
|
class: "antv-s2-icon",
|
|
3200
3285
|
viewBox: "0 0 1024 1024",
|
|
@@ -3501,7 +3586,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3501
3586
|
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.sheetType), { ref: "s2Ref" }, null, 512);
|
|
3502
3587
|
}
|
|
3503
3588
|
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
3504
|
-
const version = "@antv/s2-vue-v2.0.0-next.
|
|
3589
|
+
const version = "@antv/s2-vue-v2.0.0-next.15";
|
|
3505
3590
|
exports.BaseSheet = BaseSheet;
|
|
3506
3591
|
exports.CustomTooltip = CustomTooltip;
|
|
3507
3592
|
exports.PivotSheet = PivotSheet;
|