@antv/s2-vue 1.6.0 → 1.6.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 +1 -0
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/esm/index.d.ts +29 -20
- package/esm/index.js +387 -146
- package/esm/index.js.map +1 -1
- package/lib/index.js +384 -143
- package/lib/index.js.map +1 -1
- package/package.json +22 -19
package/lib/index.js
CHANGED
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
22
3
|
var s2 = require("@antv/s2");
|
|
23
4
|
var vue = require("vue");
|
|
@@ -267,7 +248,9 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
|
267
248
|
var funcProto = Function.prototype, objectProto$d = Object.prototype;
|
|
268
249
|
var funcToString = funcProto.toString;
|
|
269
250
|
var hasOwnProperty$b = objectProto$d.hasOwnProperty;
|
|
270
|
-
var reIsNative = RegExp(
|
|
251
|
+
var reIsNative = RegExp(
|
|
252
|
+
"^" + funcToString.call(hasOwnProperty$b).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
253
|
+
);
|
|
271
254
|
function baseIsNative(value) {
|
|
272
255
|
if (!isObject(value) || isMasked(value)) {
|
|
273
256
|
return false;
|
|
@@ -1666,11 +1649,13 @@ const createResizeObserver = (params) => {
|
|
|
1666
1649
|
}
|
|
1667
1650
|
debounceRender(width, height);
|
|
1668
1651
|
};
|
|
1669
|
-
const resizeObserver = new ResizeObserver(
|
|
1670
|
-
|
|
1671
|
-
|
|
1652
|
+
const resizeObserver = new ResizeObserver(
|
|
1653
|
+
([entry] = []) => {
|
|
1654
|
+
if (entry) {
|
|
1655
|
+
onResize();
|
|
1656
|
+
}
|
|
1672
1657
|
}
|
|
1673
|
-
|
|
1658
|
+
);
|
|
1674
1659
|
resizeObserver.observe(actualWrapper, {
|
|
1675
1660
|
box: "border-box"
|
|
1676
1661
|
});
|
|
@@ -1679,7 +1664,10 @@ const createResizeObserver = (params) => {
|
|
|
1679
1664
|
};
|
|
1680
1665
|
};
|
|
1681
1666
|
const getDrillDownCache = (spreadsheet, meta) => {
|
|
1682
|
-
const drillDownDataCache = spreadsheet.store.get(
|
|
1667
|
+
const drillDownDataCache = spreadsheet.store.get(
|
|
1668
|
+
"drillDownDataCache",
|
|
1669
|
+
[]
|
|
1670
|
+
);
|
|
1683
1671
|
const cache = drillDownDataCache.find((dc) => dc.rowId === meta.id);
|
|
1684
1672
|
return {
|
|
1685
1673
|
drillDownDataCache,
|
|
@@ -1690,7 +1678,10 @@ const handleActionIconClick = (params) => {
|
|
|
1690
1678
|
const { meta, event, callback } = params;
|
|
1691
1679
|
const { spreadsheet } = meta;
|
|
1692
1680
|
spreadsheet.store.set("drillDownNode", meta);
|
|
1693
|
-
const { drillDownDataCache, drillDownCurrentCache } = getDrillDownCache(
|
|
1681
|
+
const { drillDownDataCache, drillDownCurrentCache } = getDrillDownCache(
|
|
1682
|
+
spreadsheet,
|
|
1683
|
+
meta
|
|
1684
|
+
);
|
|
1694
1685
|
const cache = (drillDownCurrentCache == null ? void 0 : drillDownCurrentCache.drillField) ? [drillDownCurrentCache == null ? void 0 : drillDownCurrentCache.drillField] : [];
|
|
1695
1686
|
const disabled = [];
|
|
1696
1687
|
drillDownDataCache.forEach((val) => {
|
|
@@ -1739,25 +1730,36 @@ const buildDrillDownOptions = (options, partDrillDown, callback) => {
|
|
|
1739
1730
|
};
|
|
1740
1731
|
nextHeaderIcons.push(drillDownActionIcon);
|
|
1741
1732
|
}
|
|
1742
|
-
return
|
|
1733
|
+
return {
|
|
1734
|
+
...options,
|
|
1743
1735
|
headerActionIcons: nextHeaderIcons
|
|
1744
|
-
}
|
|
1736
|
+
};
|
|
1745
1737
|
};
|
|
1746
1738
|
const handleDrillDown = (params) => {
|
|
1747
1739
|
const { fetchData, spreadsheet, drillFields, drillItemsNum = -1 } = params;
|
|
1748
1740
|
spreadsheet.store.set("drillItemsNum", drillItemsNum);
|
|
1749
1741
|
const meta = spreadsheet.store.get("drillDownNode");
|
|
1750
|
-
const { drillDownDataCache, drillDownCurrentCache } = getDrillDownCache(
|
|
1742
|
+
const { drillDownDataCache, drillDownCurrentCache } = getDrillDownCache(
|
|
1743
|
+
spreadsheet,
|
|
1744
|
+
meta
|
|
1745
|
+
);
|
|
1751
1746
|
let newDrillDownDataCache = clone(drillDownDataCache);
|
|
1752
1747
|
if (drillDownCurrentCache) {
|
|
1753
|
-
newDrillDownDataCache = filter(
|
|
1748
|
+
newDrillDownDataCache = filter(
|
|
1749
|
+
drillDownDataCache,
|
|
1750
|
+
(cache) => cache.rowId !== meta.id
|
|
1751
|
+
);
|
|
1754
1752
|
}
|
|
1755
1753
|
if (!fetchData) {
|
|
1756
1754
|
return;
|
|
1757
1755
|
}
|
|
1758
1756
|
fetchData(meta, drillFields).then((info) => {
|
|
1759
1757
|
const { drillData, drillField } = info;
|
|
1760
|
-
spreadsheet.dataSet.transformDrillDownData(
|
|
1758
|
+
spreadsheet.dataSet.transformDrillDownData(
|
|
1759
|
+
drillField,
|
|
1760
|
+
drillData,
|
|
1761
|
+
meta
|
|
1762
|
+
);
|
|
1761
1763
|
if (!isEmpty(drillData)) {
|
|
1762
1764
|
const drillLevel = meta.level + 1;
|
|
1763
1765
|
const newDrillDownData = {
|
|
@@ -1894,13 +1896,19 @@ const _sfc_main$a = vue.defineComponent({
|
|
|
1894
1896
|
name: "TooltipSummary",
|
|
1895
1897
|
props: ["summaries"],
|
|
1896
1898
|
setup(props) {
|
|
1897
|
-
const summaryInfo = vue.computed(
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
pre
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1899
|
+
const summaryInfo = vue.computed(
|
|
1900
|
+
() => reduce(
|
|
1901
|
+
props.summaries,
|
|
1902
|
+
(pre, next) => {
|
|
1903
|
+
pre.count += size(next == null ? void 0 : next.selectedData);
|
|
1904
|
+
if (next.value || next.name) {
|
|
1905
|
+
pre.summaries.push(next);
|
|
1906
|
+
}
|
|
1907
|
+
return pre;
|
|
1908
|
+
},
|
|
1909
|
+
{ count: 0, summaries: [] }
|
|
1910
|
+
)
|
|
1911
|
+
);
|
|
1904
1912
|
return {
|
|
1905
1913
|
summaryInfo,
|
|
1906
1914
|
i18n: s2.i18n,
|
|
@@ -2210,15 +2218,22 @@ class CustomTooltip extends s2.BaseTooltip {
|
|
|
2210
2218
|
var _a, _b;
|
|
2211
2219
|
const { tooltip } = this.spreadsheet.options;
|
|
2212
2220
|
const showOptions = this.options;
|
|
2213
|
-
const cell = this.spreadsheet.getCell(
|
|
2221
|
+
const cell = this.spreadsheet.getCell(
|
|
2222
|
+
(_a = showOptions.event) == null ? void 0 : _a.target
|
|
2223
|
+
);
|
|
2214
2224
|
const content = (_b = showOptions.content) != null ? _b : tooltip == null ? void 0 : tooltip.content;
|
|
2215
|
-
const tooltipProps =
|
|
2225
|
+
const tooltipProps = {
|
|
2226
|
+
...showOptions,
|
|
2216
2227
|
cell,
|
|
2217
2228
|
content
|
|
2218
|
-
}
|
|
2219
|
-
const tooltipVNode = vue.createVNode(
|
|
2220
|
-
|
|
2221
|
-
|
|
2229
|
+
};
|
|
2230
|
+
const tooltipVNode = vue.createVNode(
|
|
2231
|
+
TooltipComponent,
|
|
2232
|
+
tooltipProps,
|
|
2233
|
+
{
|
|
2234
|
+
content: () => content
|
|
2235
|
+
}
|
|
2236
|
+
);
|
|
2222
2237
|
vue.render(null, this.container);
|
|
2223
2238
|
vue.render(tooltipVNode, this.container);
|
|
2224
2239
|
}
|
|
@@ -2233,8 +2248,12 @@ const DEFAULT_PAGE_NUMBER = 1;
|
|
|
2233
2248
|
const DEFAULT_PAGE_SIZE = 10;
|
|
2234
2249
|
const usePagination = (s2Ref, props) => {
|
|
2235
2250
|
var _a, _b, _c, _d, _e, _f;
|
|
2236
|
-
const current = vue.ref(
|
|
2237
|
-
|
|
2251
|
+
const current = vue.ref(
|
|
2252
|
+
(_c = (_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) != null ? _c : DEFAULT_PAGE_NUMBER
|
|
2253
|
+
);
|
|
2254
|
+
const pageSize = vue.ref(
|
|
2255
|
+
(_f = (_e = (_d = props.options) == null ? void 0 : _d.pagination) == null ? void 0 : _e.pageSize) != null ? _f : DEFAULT_PAGE_SIZE
|
|
2256
|
+
);
|
|
2238
2257
|
const total = vue.ref(0);
|
|
2239
2258
|
const change = (nextCurrent) => {
|
|
2240
2259
|
current.value = nextCurrent;
|
|
@@ -2258,17 +2277,21 @@ const usePagination = (s2Ref, props) => {
|
|
|
2258
2277
|
s2Ref.value.updatePagination(nextPagination);
|
|
2259
2278
|
s2Ref.value.render(false);
|
|
2260
2279
|
});
|
|
2261
|
-
vue.watch(
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2280
|
+
vue.watch(
|
|
2281
|
+
[() => {
|
|
2282
|
+
var _a2;
|
|
2283
|
+
return (_a2 = props.options) == null ? void 0 : _a2.pagination;
|
|
2284
|
+
}, s2Ref],
|
|
2285
|
+
() => {
|
|
2286
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i;
|
|
2287
|
+
current.value = (_c2 = (_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) != null ? _c2 : DEFAULT_PAGE_NUMBER;
|
|
2288
|
+
pageSize.value = (_f2 = (_e2 = (_d2 = props.options) == null ? void 0 : _d2.pagination) == null ? void 0 : _e2.pageSize) != null ? _f2 : DEFAULT_PAGE_SIZE;
|
|
2289
|
+
total.value = (_i = (_h = (_g = s2Ref.value) == null ? void 0 : _g.facet) == null ? void 0 : _h.viewCellHeights.getTotalLength()) != null ? _i : 0;
|
|
2290
|
+
},
|
|
2291
|
+
{
|
|
2292
|
+
immediate: true
|
|
2293
|
+
}
|
|
2294
|
+
);
|
|
2272
2295
|
vue.watch(s2Ref, (value, oldValue, onCleanup) => {
|
|
2273
2296
|
if (!s2Ref.value) {
|
|
2274
2297
|
return;
|
|
@@ -2377,73 +2400,253 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2377
2400
|
}
|
|
2378
2401
|
useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_HOVER, "rowCellHover");
|
|
2379
2402
|
useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_CLICK, "rowCellClick");
|
|
2380
|
-
useCellEvent(
|
|
2381
|
-
|
|
2403
|
+
useCellEvent(
|
|
2404
|
+
s2Ref,
|
|
2405
|
+
emit,
|
|
2406
|
+
s2.S2Event.ROW_CELL_DOUBLE_CLICK,
|
|
2407
|
+
"rowCellDoubleClick"
|
|
2408
|
+
);
|
|
2409
|
+
useCellEvent(
|
|
2410
|
+
s2Ref,
|
|
2411
|
+
emit,
|
|
2412
|
+
s2.S2Event.ROW_CELL_CONTEXT_MENU,
|
|
2413
|
+
"rowCellContextMenu"
|
|
2414
|
+
);
|
|
2382
2415
|
useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_MOUSE_DOWN, "rowCellMouseDown");
|
|
2383
2416
|
useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_MOUSE_UP, "rowCellMouseUp");
|
|
2384
2417
|
useCellEvent(s2Ref, emit, s2.S2Event.ROW_CELL_MOUSE_MOVE, "rowCellMouseMove");
|
|
2385
|
-
useS2Event(
|
|
2418
|
+
useS2Event(
|
|
2419
|
+
s2Ref,
|
|
2420
|
+
emit,
|
|
2421
|
+
s2.S2Event.ROW_CELL_COLLAPSE_TREE_ROWS,
|
|
2422
|
+
"rowCellCollapseTreeRows"
|
|
2423
|
+
);
|
|
2386
2424
|
useS2Event(s2Ref, emit, s2.S2Event.ROW_CELL_SCROLL, "rowCellScroll");
|
|
2387
2425
|
useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_HOVER, "colCellHover");
|
|
2388
2426
|
useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_CLICK, "colCellClick");
|
|
2389
|
-
useCellEvent(
|
|
2390
|
-
|
|
2427
|
+
useCellEvent(
|
|
2428
|
+
s2Ref,
|
|
2429
|
+
emit,
|
|
2430
|
+
s2.S2Event.COL_CELL_DOUBLE_CLICK,
|
|
2431
|
+
"colCellDoubleClick"
|
|
2432
|
+
);
|
|
2433
|
+
useCellEvent(
|
|
2434
|
+
s2Ref,
|
|
2435
|
+
emit,
|
|
2436
|
+
s2.S2Event.COL_CELL_CONTEXT_MENU,
|
|
2437
|
+
"colCellContextMenu"
|
|
2438
|
+
);
|
|
2391
2439
|
useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_MOUSE_DOWN, "colCellMouseDown");
|
|
2392
2440
|
useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_MOUSE_UP, "colCellMouseUp");
|
|
2393
2441
|
useCellEvent(s2Ref, emit, s2.S2Event.COL_CELL_MOUSE_MOVE, "colCellMouseMove");
|
|
2394
2442
|
useCellEvent(s2Ref, emit, s2.S2Event.DATA_CELL_HOVER, "dataCellHover");
|
|
2395
2443
|
useCellEvent(s2Ref, emit, s2.S2Event.DATA_CELL_CLICK, "dataCellClick");
|
|
2396
|
-
useCellEvent(
|
|
2397
|
-
|
|
2398
|
-
|
|
2444
|
+
useCellEvent(
|
|
2445
|
+
s2Ref,
|
|
2446
|
+
emit,
|
|
2447
|
+
s2.S2Event.DATA_CELL_DOUBLE_CLICK,
|
|
2448
|
+
"dataCellDoubleClick"
|
|
2449
|
+
);
|
|
2450
|
+
useCellEvent(
|
|
2451
|
+
s2Ref,
|
|
2452
|
+
emit,
|
|
2453
|
+
s2.S2Event.DATA_CELL_CONTEXT_MENU,
|
|
2454
|
+
"dataCellContextMenu"
|
|
2455
|
+
);
|
|
2456
|
+
useCellEvent(
|
|
2457
|
+
s2Ref,
|
|
2458
|
+
emit,
|
|
2459
|
+
s2.S2Event.DATA_CELL_MOUSE_DOWN,
|
|
2460
|
+
"dataCellMouseDown"
|
|
2461
|
+
);
|
|
2399
2462
|
useCellEvent(s2Ref, emit, s2.S2Event.DATA_CELL_MOUSE_UP, "dataCellMouseUp");
|
|
2400
|
-
useCellEvent(
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2463
|
+
useCellEvent(
|
|
2464
|
+
s2Ref,
|
|
2465
|
+
emit,
|
|
2466
|
+
s2.S2Event.DATA_CELL_MOUSE_MOVE,
|
|
2467
|
+
"dataCellMouseMove"
|
|
2468
|
+
);
|
|
2469
|
+
useS2Event(
|
|
2470
|
+
s2Ref,
|
|
2471
|
+
emit,
|
|
2472
|
+
s2.S2Event.DATA_CELL_TREND_ICON_CLICK,
|
|
2473
|
+
"dataCellTrendIconClick"
|
|
2474
|
+
);
|
|
2475
|
+
useS2Event(
|
|
2476
|
+
s2Ref,
|
|
2477
|
+
emit,
|
|
2478
|
+
s2.S2Event.DATA_CELL_BRUSH_SELECTION,
|
|
2479
|
+
"dataCellBrushSelection"
|
|
2480
|
+
);
|
|
2481
|
+
useS2Event(
|
|
2482
|
+
s2Ref,
|
|
2483
|
+
emit,
|
|
2484
|
+
s2.S2Event.DATA_CELL_SELECT_MOVE,
|
|
2485
|
+
"dataCellSelectMove"
|
|
2486
|
+
);
|
|
2404
2487
|
useCellEvent(s2Ref, emit, s2.S2Event.CORNER_CELL_HOVER, "cornerCellHover");
|
|
2405
2488
|
useCellEvent(s2Ref, emit, s2.S2Event.CORNER_CELL_CLICK, "cornerCellClick");
|
|
2406
|
-
useCellEvent(
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2489
|
+
useCellEvent(
|
|
2490
|
+
s2Ref,
|
|
2491
|
+
emit,
|
|
2492
|
+
s2.S2Event.CORNER_CELL_DOUBLE_CLICK,
|
|
2493
|
+
"cornerCellDoubleClick"
|
|
2494
|
+
);
|
|
2495
|
+
useCellEvent(
|
|
2496
|
+
s2Ref,
|
|
2497
|
+
emit,
|
|
2498
|
+
s2.S2Event.CORNER_CELL_CONTEXT_MENU,
|
|
2499
|
+
"cornerCellContextMenu"
|
|
2500
|
+
);
|
|
2501
|
+
useCellEvent(
|
|
2502
|
+
s2Ref,
|
|
2503
|
+
emit,
|
|
2504
|
+
s2.S2Event.CORNER_CELL_MOUSE_DOWN,
|
|
2505
|
+
"cornerCellMouseDown"
|
|
2506
|
+
);
|
|
2507
|
+
useCellEvent(
|
|
2508
|
+
s2Ref,
|
|
2509
|
+
emit,
|
|
2510
|
+
s2.S2Event.CORNER_CELL_MOUSE_UP,
|
|
2511
|
+
"cornerCellMouseUp"
|
|
2512
|
+
);
|
|
2513
|
+
useCellEvent(
|
|
2514
|
+
s2Ref,
|
|
2515
|
+
emit,
|
|
2516
|
+
s2.S2Event.CORNER_CELL_MOUSE_MOVE,
|
|
2517
|
+
"cornerCellMouseMove"
|
|
2518
|
+
);
|
|
2411
2519
|
useCellEvent(s2Ref, emit, s2.S2Event.MERGED_CELLS_HOVER, "mergedCellsHover");
|
|
2412
2520
|
useCellEvent(s2Ref, emit, s2.S2Event.MERGED_CELLS_CLICK, "mergedCellsClick");
|
|
2413
|
-
useCellEvent(
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2521
|
+
useCellEvent(
|
|
2522
|
+
s2Ref,
|
|
2523
|
+
emit,
|
|
2524
|
+
s2.S2Event.MERGED_CELLS_DOUBLE_CLICK,
|
|
2525
|
+
"mergedCellsDoubleClick"
|
|
2526
|
+
);
|
|
2527
|
+
useCellEvent(
|
|
2528
|
+
s2Ref,
|
|
2529
|
+
emit,
|
|
2530
|
+
s2.S2Event.MERGED_CELLS_CONTEXT_MENU,
|
|
2531
|
+
"mergedCellsContextMenu"
|
|
2532
|
+
);
|
|
2533
|
+
useCellEvent(
|
|
2534
|
+
s2Ref,
|
|
2535
|
+
emit,
|
|
2536
|
+
s2.S2Event.MERGED_CELLS_MOUSE_DOWN,
|
|
2537
|
+
"mergedCellsMouseDown"
|
|
2538
|
+
);
|
|
2539
|
+
useCellEvent(
|
|
2540
|
+
s2Ref,
|
|
2541
|
+
emit,
|
|
2542
|
+
s2.S2Event.MERGED_CELLS_MOUSE_UP,
|
|
2543
|
+
"mergedCellsMouseUp"
|
|
2544
|
+
);
|
|
2545
|
+
useCellEvent(
|
|
2546
|
+
s2Ref,
|
|
2547
|
+
emit,
|
|
2548
|
+
s2.S2Event.MERGED_CELLS_MOUSE_MOVE,
|
|
2549
|
+
"mergedCellsMouseMove"
|
|
2550
|
+
);
|
|
2418
2551
|
useS2Event(s2Ref, emit, s2.S2Event.RANGE_SORT, "rangeSort");
|
|
2419
2552
|
useS2Event(s2Ref, emit, s2.S2Event.RANGE_SORTED, "rangeSorted");
|
|
2420
2553
|
useS2Event(s2Ref, emit, s2.S2Event.RANGE_FILTER, "rangeFilter");
|
|
2421
2554
|
useS2Event(s2Ref, emit, s2.S2Event.RANGE_FILTERED, "rangeFiltered");
|
|
2422
|
-
useS2Event(
|
|
2555
|
+
useS2Event(
|
|
2556
|
+
s2Ref,
|
|
2557
|
+
emit,
|
|
2558
|
+
s2.S2Event.LAYOUT_AFTER_HEADER_LAYOUT,
|
|
2559
|
+
"layoutAfterHeaderLayout"
|
|
2560
|
+
);
|
|
2423
2561
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_PAGINATION, "layoutPagination");
|
|
2424
2562
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_CELL_SCROLL, "layoutCellScroll");
|
|
2425
|
-
useS2Event(
|
|
2426
|
-
|
|
2563
|
+
useS2Event(
|
|
2564
|
+
s2Ref,
|
|
2565
|
+
emit,
|
|
2566
|
+
s2.S2Event.LAYOUT_AFTER_COLLAPSE_ROWS,
|
|
2567
|
+
"layoutAfterCollapseRows"
|
|
2568
|
+
);
|
|
2569
|
+
useS2Event(
|
|
2570
|
+
s2Ref,
|
|
2571
|
+
emit,
|
|
2572
|
+
s2.S2Event.LAYOUT_TREE_ROWS_COLLAPSE_ALL,
|
|
2573
|
+
"collapseRowsAll"
|
|
2574
|
+
);
|
|
2427
2575
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_COLS_EXPANDED, "layoutColsExpanded");
|
|
2428
2576
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_COLS_HIDDEN, "layoutColsHidden");
|
|
2429
2577
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_BEFORE_RENDER, "beforeRender");
|
|
2430
2578
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_AFTER_RENDER, "afterRender");
|
|
2431
2579
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_DESTROY, "destroy");
|
|
2432
2580
|
useS2Event(s2Ref, emit, s2.S2Event.LAYOUT_RESIZE, "layoutResize");
|
|
2433
|
-
useS2Event(
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
useS2Event(
|
|
2440
|
-
|
|
2441
|
-
|
|
2581
|
+
useS2Event(
|
|
2582
|
+
s2Ref,
|
|
2583
|
+
emit,
|
|
2584
|
+
s2.S2Event.LAYOUT_RESIZE_SERIES_WIDTH,
|
|
2585
|
+
"layoutResizeSeriesWidth"
|
|
2586
|
+
);
|
|
2587
|
+
useS2Event(
|
|
2588
|
+
s2Ref,
|
|
2589
|
+
emit,
|
|
2590
|
+
s2.S2Event.LAYOUT_RESIZE_ROW_WIDTH,
|
|
2591
|
+
"layoutResizeRowWidth"
|
|
2592
|
+
);
|
|
2593
|
+
useS2Event(
|
|
2594
|
+
s2Ref,
|
|
2595
|
+
emit,
|
|
2596
|
+
s2.S2Event.LAYOUT_RESIZE_ROW_HEIGHT,
|
|
2597
|
+
"layoutResizeRowHeight"
|
|
2598
|
+
);
|
|
2599
|
+
useS2Event(
|
|
2600
|
+
s2Ref,
|
|
2601
|
+
emit,
|
|
2602
|
+
s2.S2Event.LAYOUT_RESIZE_COL_WIDTH,
|
|
2603
|
+
"layoutResizeColWidth"
|
|
2604
|
+
);
|
|
2605
|
+
useS2Event(
|
|
2606
|
+
s2Ref,
|
|
2607
|
+
emit,
|
|
2608
|
+
s2.S2Event.LAYOUT_RESIZE_COL_HEIGHT,
|
|
2609
|
+
"layoutResizeColHeight"
|
|
2610
|
+
);
|
|
2611
|
+
useS2Event(
|
|
2612
|
+
s2Ref,
|
|
2613
|
+
emit,
|
|
2614
|
+
s2.S2Event.LAYOUT_RESIZE_TREE_WIDTH,
|
|
2615
|
+
"layoutResizeTreeWidth"
|
|
2616
|
+
);
|
|
2617
|
+
useS2Event(
|
|
2618
|
+
s2Ref,
|
|
2619
|
+
emit,
|
|
2620
|
+
s2.S2Event.LAYOUT_RESIZE_MOUSE_DOWN,
|
|
2621
|
+
"layoutResizeMouseDown"
|
|
2622
|
+
);
|
|
2623
|
+
useS2Event(
|
|
2624
|
+
s2Ref,
|
|
2625
|
+
emit,
|
|
2626
|
+
s2.S2Event.LAYOUT_RESIZE_MOUSE_UP,
|
|
2627
|
+
"layoutResizeMouseUp"
|
|
2628
|
+
);
|
|
2629
|
+
useS2Event(
|
|
2630
|
+
s2Ref,
|
|
2631
|
+
emit,
|
|
2632
|
+
s2.S2Event.LAYOUT_RESIZE_MOUSE_MOVE,
|
|
2633
|
+
"layoutResizeMouseMove"
|
|
2634
|
+
);
|
|
2442
2635
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_KEYBOARD_DOWN, "keyBoardDown");
|
|
2443
2636
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_KEYBOARD_UP, "keyBoardUp");
|
|
2444
2637
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_COPIED, "copied");
|
|
2445
|
-
useS2Event(
|
|
2446
|
-
|
|
2638
|
+
useS2Event(
|
|
2639
|
+
s2Ref,
|
|
2640
|
+
emit,
|
|
2641
|
+
s2.S2Event.GLOBAL_ACTION_ICON_HOVER,
|
|
2642
|
+
"actionIconHover"
|
|
2643
|
+
);
|
|
2644
|
+
useS2Event(
|
|
2645
|
+
s2Ref,
|
|
2646
|
+
emit,
|
|
2647
|
+
s2.S2Event.GLOBAL_ACTION_ICON_CLICK,
|
|
2648
|
+
"actionIconClick"
|
|
2649
|
+
);
|
|
2447
2650
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_CONTEXT_MENU, "contextMenu");
|
|
2448
2651
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_HOVER, "mouseHover");
|
|
2449
2652
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_CLICK, "click");
|
|
@@ -2453,9 +2656,24 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2453
2656
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_RESET, "reset");
|
|
2454
2657
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_LINK_FIELD_JUMP, "linkFieldJump");
|
|
2455
2658
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_SCROLL, "scroll");
|
|
2456
|
-
useS2Event(
|
|
2457
|
-
|
|
2458
|
-
|
|
2659
|
+
useS2Event(
|
|
2660
|
+
s2Ref,
|
|
2661
|
+
emit,
|
|
2662
|
+
s2.S2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDER,
|
|
2663
|
+
"layoutAfterRealDataCellRender"
|
|
2664
|
+
);
|
|
2665
|
+
useS2Event(
|
|
2666
|
+
s2Ref,
|
|
2667
|
+
emit,
|
|
2668
|
+
s2.S2Event.ROW_CELL_BRUSH_SELECTION,
|
|
2669
|
+
"rowCellBrushSelection"
|
|
2670
|
+
);
|
|
2671
|
+
useS2Event(
|
|
2672
|
+
s2Ref,
|
|
2673
|
+
emit,
|
|
2674
|
+
s2.S2Event.COL_CELL_BRUSH_SELECTION,
|
|
2675
|
+
"colCellBrushSelection"
|
|
2676
|
+
);
|
|
2459
2677
|
});
|
|
2460
2678
|
};
|
|
2461
2679
|
const useLoading = (s2Ref, loadingProp = false) => {
|
|
@@ -2479,32 +2697,44 @@ const useSheetUpdate = (s2Ref, props) => {
|
|
|
2479
2697
|
reloadData: false,
|
|
2480
2698
|
rebuildDataset: false
|
|
2481
2699
|
});
|
|
2482
|
-
vue.watch(
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2700
|
+
vue.watch(
|
|
2701
|
+
() => props.options,
|
|
2702
|
+
(options, prevOptions) => {
|
|
2703
|
+
var _a, _b;
|
|
2704
|
+
updateFlag.rerender = true;
|
|
2705
|
+
if (!Object.is(prevOptions == null ? void 0 : prevOptions.hierarchyType, options == null ? void 0 : options.hierarchyType)) {
|
|
2706
|
+
updateFlag.reloadData = true;
|
|
2707
|
+
updateFlag.rebuildDataset = true;
|
|
2708
|
+
}
|
|
2709
|
+
(_a = s2Ref.value) == null ? void 0 : _a.setOptions(options);
|
|
2710
|
+
(_b = s2Ref.value) == null ? void 0 : _b.changeSheetSize(options == null ? void 0 : options.width, options == null ? void 0 : options.height);
|
|
2711
|
+
},
|
|
2712
|
+
{ deep: vue.isProxy(props.options) }
|
|
2713
|
+
);
|
|
2714
|
+
vue.watch(
|
|
2715
|
+
() => props.dataCfg,
|
|
2716
|
+
(dataCfg, prevDataCfg) => {
|
|
2717
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2718
|
+
if (((_b = (_a = prevDataCfg == null ? void 0 : prevDataCfg.fields) == null ? void 0 : _a.columns) == null ? void 0 : _b.length) !== ((_d = (_c = dataCfg == null ? void 0 : dataCfg.fields) == null ? void 0 : _c.columns) == null ? void 0 : _d.length)) {
|
|
2719
|
+
(_e = s2Ref.value) == null ? void 0 : _e.clearInitColumnLeafNodes();
|
|
2720
|
+
}
|
|
2721
|
+
updateFlag.rerender = true;
|
|
2486
2722
|
updateFlag.reloadData = true;
|
|
2487
|
-
|
|
2488
|
-
}
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
var _a;
|
|
2503
|
-
updateFlag.rerender = true;
|
|
2504
|
-
(_a = s2Ref.value) == null ? void 0 : _a.setThemeCfg(themeCfg);
|
|
2505
|
-
}, {
|
|
2506
|
-
deep: vue.isProxy(props.themeCfg)
|
|
2507
|
-
});
|
|
2723
|
+
(_f = s2Ref.value) == null ? void 0 : _f.setDataCfg(dataCfg);
|
|
2724
|
+
},
|
|
2725
|
+
{ deep: vue.isProxy(props.dataCfg) }
|
|
2726
|
+
);
|
|
2727
|
+
vue.watch(
|
|
2728
|
+
() => props.themeCfg,
|
|
2729
|
+
(themeCfg) => {
|
|
2730
|
+
var _a;
|
|
2731
|
+
updateFlag.rerender = true;
|
|
2732
|
+
(_a = s2Ref.value) == null ? void 0 : _a.setThemeCfg(themeCfg);
|
|
2733
|
+
},
|
|
2734
|
+
{
|
|
2735
|
+
deep: vue.isProxy(props.themeCfg)
|
|
2736
|
+
}
|
|
2737
|
+
);
|
|
2508
2738
|
vue.watch(updateFlag, (flag) => {
|
|
2509
2739
|
var _a;
|
|
2510
2740
|
if (!flag.rerender) {
|
|
@@ -2520,21 +2750,25 @@ const useSheetUpdate = (s2Ref, props) => {
|
|
|
2520
2750
|
};
|
|
2521
2751
|
const useResize = (s2Ref, props, dom) => {
|
|
2522
2752
|
const unobserve = vue.ref();
|
|
2523
|
-
vue.watch(
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
(
|
|
2536
|
-
|
|
2537
|
-
|
|
2753
|
+
vue.watch(
|
|
2754
|
+
[s2Ref, () => props.adaptive],
|
|
2755
|
+
([s22, adaptive], _, onCleanup) => {
|
|
2756
|
+
if (!s22) {
|
|
2757
|
+
return;
|
|
2758
|
+
}
|
|
2759
|
+
unobserve.value = createResizeObserver({
|
|
2760
|
+
s2: s22,
|
|
2761
|
+
adaptive,
|
|
2762
|
+
wrapper: dom.wrapperRef.value,
|
|
2763
|
+
container: dom.containerRef.value
|
|
2764
|
+
});
|
|
2765
|
+
onCleanup(() => {
|
|
2766
|
+
var _a;
|
|
2767
|
+
(_a = unobserve.value) == null ? void 0 : _a.call(unobserve);
|
|
2768
|
+
});
|
|
2769
|
+
},
|
|
2770
|
+
{ deep: true }
|
|
2771
|
+
);
|
|
2538
2772
|
};
|
|
2539
2773
|
function useSpreadSheet(props, emit) {
|
|
2540
2774
|
const {
|
|
@@ -2821,7 +3055,7 @@ const _hoisted_3$2 = [
|
|
|
2821
3055
|
_hoisted_2$2
|
|
2822
3056
|
];
|
|
2823
3057
|
function render$2(_ctx, _cache) {
|
|
2824
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2, _hoisted_3$2);
|
|
3058
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2, [..._hoisted_3$2]);
|
|
2825
3059
|
}
|
|
2826
3060
|
var LocationIcon = { render: render$2 };
|
|
2827
3061
|
const _hoisted_1$1 = {
|
|
@@ -2839,7 +3073,7 @@ const _hoisted_3$1 = [
|
|
|
2839
3073
|
_hoisted_2$1
|
|
2840
3074
|
];
|
|
2841
3075
|
function render$1(_ctx, _cache) {
|
|
2842
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$1, _hoisted_3$1);
|
|
3076
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$1, [..._hoisted_3$1]);
|
|
2843
3077
|
}
|
|
2844
3078
|
var TextIcon = { render: render$1 };
|
|
2845
3079
|
const _hoisted_1 = {
|
|
@@ -2857,7 +3091,7 @@ const _hoisted_3 = [
|
|
|
2857
3091
|
_hoisted_2
|
|
2858
3092
|
];
|
|
2859
3093
|
function render(_ctx, _cache) {
|
|
2860
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1, _hoisted_3);
|
|
3094
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1, [..._hoisted_3]);
|
|
2861
3095
|
}
|
|
2862
3096
|
var CalendarIcon = { render };
|
|
2863
3097
|
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
@@ -3033,11 +3267,12 @@ const _sfc_main$2 = vue.defineComponent({
|
|
|
3033
3267
|
const { event, disabledFields } = params;
|
|
3034
3268
|
if (event) {
|
|
3035
3269
|
const instance = (_a = s2Ref == null ? void 0 : s2Ref.value) == null ? void 0 : _a.instance;
|
|
3036
|
-
const drillDownNode = vue.createVNode(DrillDown,
|
|
3270
|
+
const drillDownNode = vue.createVNode(DrillDown, {
|
|
3271
|
+
...(_b = partDrillDown.value) == null ? void 0 : _b.drillConfig,
|
|
3037
3272
|
setDrillFields,
|
|
3038
3273
|
drillFields: drillFields.value,
|
|
3039
3274
|
disabledFields
|
|
3040
|
-
})
|
|
3275
|
+
});
|
|
3041
3276
|
instance == null ? void 0 : instance.showTooltip({
|
|
3042
3277
|
position: {
|
|
3043
3278
|
x: event.clientX,
|
|
@@ -3048,7 +3283,13 @@ const _sfc_main$2 = vue.defineComponent({
|
|
|
3048
3283
|
});
|
|
3049
3284
|
}
|
|
3050
3285
|
};
|
|
3051
|
-
const options = vue.computed(
|
|
3286
|
+
const options = vue.computed(
|
|
3287
|
+
() => buildDrillDownOptions(
|
|
3288
|
+
pivotOptions.value,
|
|
3289
|
+
partDrillDown.value,
|
|
3290
|
+
(params) => onDrillDownIconClick(params)
|
|
3291
|
+
)
|
|
3292
|
+
);
|
|
3052
3293
|
return {
|
|
3053
3294
|
s2Ref,
|
|
3054
3295
|
options
|
|
@@ -3109,7 +3350,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3109
3350
|
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.sheetType), { ref: "s2Ref" }, null, 512);
|
|
3110
3351
|
}
|
|
3111
3352
|
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
3112
|
-
const version = "@antv/s2-vue-v1.6.
|
|
3353
|
+
const version = "@antv/s2-vue-v1.6.1";
|
|
3113
3354
|
exports.BaseSheet = BaseSheet;
|
|
3114
3355
|
exports.CustomTooltip = CustomTooltip;
|
|
3115
3356
|
exports.PivotSheet = PivotSheet;
|