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