@antv/s2-vue 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/esm/index.d.ts +97 -1236
- package/esm/index.js +155 -151
- package/esm/index.js.map +1 -1
- package/lib/index.js +152 -147
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1784,72 +1784,6 @@ const useExpose = (expose) => {
|
|
|
1784
1784
|
});
|
|
1785
1785
|
return s2Ref;
|
|
1786
1786
|
};
|
|
1787
|
-
const DEFAULT_PAGE_NUMBER = 1;
|
|
1788
|
-
const DEFAULT_PAGE_SIZE = 10;
|
|
1789
|
-
const usePagination = (s2Ref, props) => {
|
|
1790
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1791
|
-
const current = vue.ref((_c = (_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) != null ? _c : DEFAULT_PAGE_NUMBER);
|
|
1792
|
-
const pageSize = vue.ref((_f = (_e = (_d = props.options) == null ? void 0 : _d.pagination) == null ? void 0 : _e.pageSize) != null ? _f : DEFAULT_PAGE_SIZE);
|
|
1793
|
-
const total = vue.ref(0);
|
|
1794
|
-
const change = (nextCurrent) => {
|
|
1795
|
-
current.value = nextCurrent;
|
|
1796
|
-
};
|
|
1797
|
-
const showSizeChange = (nextPageSize) => {
|
|
1798
|
-
pageSize.value = nextPageSize;
|
|
1799
|
-
};
|
|
1800
|
-
const visible = vue.computed(() => {
|
|
1801
|
-
var _a2;
|
|
1802
|
-
return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
|
|
1803
|
-
});
|
|
1804
|
-
vue.watch([current, pageSize], () => {
|
|
1805
|
-
var _a2;
|
|
1806
|
-
if (!s2Ref.value) {
|
|
1807
|
-
return;
|
|
1808
|
-
}
|
|
1809
|
-
const nextPagination = isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination) ? null : {
|
|
1810
|
-
current: current.value,
|
|
1811
|
-
pageSize: pageSize.value
|
|
1812
|
-
};
|
|
1813
|
-
s2Ref.value.updatePagination(nextPagination);
|
|
1814
|
-
s2Ref.value.render(false);
|
|
1815
|
-
});
|
|
1816
|
-
vue.watch([() => {
|
|
1817
|
-
var _a2;
|
|
1818
|
-
return (_a2 = props.options) == null ? void 0 : _a2.pagination;
|
|
1819
|
-
}, s2Ref], () => {
|
|
1820
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i;
|
|
1821
|
-
current.value = (_c2 = (_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) != null ? _c2 : DEFAULT_PAGE_NUMBER;
|
|
1822
|
-
pageSize.value = (_f2 = (_e2 = (_d2 = props.options) == null ? void 0 : _d2.pagination) == null ? void 0 : _e2.pageSize) != null ? _f2 : DEFAULT_PAGE_SIZE;
|
|
1823
|
-
total.value = (_i = (_h = (_g = s2Ref.value) == null ? void 0 : _g.facet) == null ? void 0 : _h.viewCellHeights.getTotalLength()) != null ? _i : 0;
|
|
1824
|
-
}, {
|
|
1825
|
-
immediate: true
|
|
1826
|
-
});
|
|
1827
|
-
vue.watch(s2Ref, (value, oldValue, onCleanup) => {
|
|
1828
|
-
if (!s2Ref.value) {
|
|
1829
|
-
return;
|
|
1830
|
-
}
|
|
1831
|
-
const totalUpdateCallback = (data) => {
|
|
1832
|
-
var _a2;
|
|
1833
|
-
if (isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination)) {
|
|
1834
|
-
return;
|
|
1835
|
-
}
|
|
1836
|
-
total.value = data.total;
|
|
1837
|
-
};
|
|
1838
|
-
s2Ref.value.on(s2.S2Event.LAYOUT_PAGINATION, totalUpdateCallback);
|
|
1839
|
-
onCleanup(() => {
|
|
1840
|
-
var _a2;
|
|
1841
|
-
(_a2 = s2Ref.value) == null ? void 0 : _a2.off(s2.S2Event.LAYOUT_PAGINATION, totalUpdateCallback);
|
|
1842
|
-
});
|
|
1843
|
-
});
|
|
1844
|
-
return {
|
|
1845
|
-
visible,
|
|
1846
|
-
current,
|
|
1847
|
-
pageSize,
|
|
1848
|
-
total,
|
|
1849
|
-
change,
|
|
1850
|
-
showSizeChange
|
|
1851
|
-
};
|
|
1852
|
-
};
|
|
1853
1787
|
var _export_sfc = (sfc, props) => {
|
|
1854
1788
|
const target = sfc.__vccOpts || sfc;
|
|
1855
1789
|
for (const [key, val] of props) {
|
|
@@ -1857,61 +1791,7 @@ var _export_sfc = (sfc, props) => {
|
|
|
1857
1791
|
}
|
|
1858
1792
|
return target;
|
|
1859
1793
|
};
|
|
1860
|
-
const PRE_CLASS = `${s2.S2_PREFIX_CLS}-pagination`;
|
|
1861
1794
|
const _sfc_main$e = vue.defineComponent({
|
|
1862
|
-
name: "s2-pagination",
|
|
1863
|
-
props: {
|
|
1864
|
-
current: {
|
|
1865
|
-
type: Number,
|
|
1866
|
-
default: DEFAULT_PAGE_NUMBER
|
|
1867
|
-
},
|
|
1868
|
-
total: {
|
|
1869
|
-
type: Number,
|
|
1870
|
-
default: 0
|
|
1871
|
-
},
|
|
1872
|
-
pageSize: {
|
|
1873
|
-
type: Number,
|
|
1874
|
-
default: DEFAULT_PAGE_SIZE
|
|
1875
|
-
}
|
|
1876
|
-
},
|
|
1877
|
-
emits: ["change", "showSizeChange"],
|
|
1878
|
-
setup: (props) => {
|
|
1879
|
-
const showQuickJumper = vue.computed(() => {
|
|
1880
|
-
return props.total / props.pageSize > 5;
|
|
1881
|
-
});
|
|
1882
|
-
return {
|
|
1883
|
-
showQuickJumper,
|
|
1884
|
-
PRE_CLASS,
|
|
1885
|
-
i18n: s2.i18n
|
|
1886
|
-
};
|
|
1887
|
-
},
|
|
1888
|
-
components: {
|
|
1889
|
-
AntDPagination: antDesignVue.Pagination
|
|
1890
|
-
}
|
|
1891
|
-
});
|
|
1892
|
-
function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1893
|
-
const _component_AntDPagination = vue.resolveComponent("AntDPagination");
|
|
1894
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1895
|
-
class: vue.normalizeClass(_ctx.PRE_CLASS)
|
|
1896
|
-
}, [
|
|
1897
|
-
vue.createVNode(_component_AntDPagination, {
|
|
1898
|
-
"default-current": 1,
|
|
1899
|
-
current: _ctx.current,
|
|
1900
|
-
total: _ctx.total,
|
|
1901
|
-
pageSize: _ctx.pageSize,
|
|
1902
|
-
showSizeChanger: true,
|
|
1903
|
-
onShowSizeChange: _cache[0] || (_cache[0] = (_, size2) => _ctx.$emit("showSizeChange", size2)),
|
|
1904
|
-
size: "small",
|
|
1905
|
-
showQuickJumper: _ctx.showQuickJumper,
|
|
1906
|
-
onChange: _cache[1] || (_cache[1] = (current) => _ctx.$emit("change", current))
|
|
1907
|
-
}, null, 8, ["current", "total", "pageSize", "showQuickJumper"]),
|
|
1908
|
-
vue.createElementVNode("span", {
|
|
1909
|
-
class: vue.normalizeClass(`${_ctx.PRE_CLASS}-count`)
|
|
1910
|
-
}, vue.toDisplayString(_ctx.i18n("\u5171\u8BA1")) + " " + vue.toDisplayString(_ctx.total || " - ") + " " + vue.toDisplayString(_ctx.i18n("\u6761")), 3)
|
|
1911
|
-
], 2);
|
|
1912
|
-
}
|
|
1913
|
-
var S2Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e]]);
|
|
1914
|
-
const _sfc_main$d = vue.defineComponent({
|
|
1915
1795
|
name: "TooltipDetail",
|
|
1916
1796
|
props: ["list"],
|
|
1917
1797
|
setup() {
|
|
@@ -1920,7 +1800,7 @@ const _sfc_main$d = vue.defineComponent({
|
|
|
1920
1800
|
};
|
|
1921
1801
|
}
|
|
1922
1802
|
});
|
|
1923
|
-
function _sfc_render$
|
|
1803
|
+
function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1924
1804
|
return vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.list, (item, index2) => {
|
|
1925
1805
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1926
1806
|
key: `${item.value}-${index2}`,
|
|
@@ -1939,8 +1819,8 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1939
1819
|
], 2);
|
|
1940
1820
|
}), 128);
|
|
1941
1821
|
}
|
|
1942
|
-
var TooltipDetail = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1943
|
-
const _sfc_main$
|
|
1822
|
+
var TooltipDetail = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e]]);
|
|
1823
|
+
const _sfc_main$d = vue.defineComponent({
|
|
1944
1824
|
name: "TooltipHeadInfo",
|
|
1945
1825
|
props: ["rows", "cols"],
|
|
1946
1826
|
setup() {
|
|
@@ -1951,7 +1831,7 @@ const _sfc_main$c = vue.defineComponent({
|
|
|
1951
1831
|
components: {}
|
|
1952
1832
|
});
|
|
1953
1833
|
const _hoisted_1$4 = { key: 0 };
|
|
1954
|
-
function _sfc_render$
|
|
1834
|
+
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1955
1835
|
var _a, _b, _c, _d;
|
|
1956
1836
|
return ((_a = _ctx.cols) == null ? void 0 : _a.length) || ((_b = _ctx.rows) == null ? void 0 : _b.length) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1957
1837
|
key: 0,
|
|
@@ -1970,8 +1850,8 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1970
1850
|
}), 128))
|
|
1971
1851
|
], 2)) : vue.createCommentVNode("", true);
|
|
1972
1852
|
}
|
|
1973
|
-
var TooltipHeadInfo = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1974
|
-
const _sfc_main$
|
|
1853
|
+
var TooltipHeadInfo = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d]]);
|
|
1854
|
+
const _sfc_main$c = vue.defineComponent({
|
|
1975
1855
|
name: "TooltipInfos",
|
|
1976
1856
|
props: ["infos"],
|
|
1977
1857
|
setup() {
|
|
@@ -1981,13 +1861,13 @@ const _sfc_main$b = vue.defineComponent({
|
|
|
1981
1861
|
},
|
|
1982
1862
|
components: {}
|
|
1983
1863
|
});
|
|
1984
|
-
function _sfc_render$
|
|
1864
|
+
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1985
1865
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1986
1866
|
class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-infos`)
|
|
1987
1867
|
}, vue.toDisplayString(_ctx.infos), 3);
|
|
1988
1868
|
}
|
|
1989
|
-
var TooltipInfos = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1990
|
-
const _sfc_main$
|
|
1869
|
+
var TooltipInfos = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c]]);
|
|
1870
|
+
const _sfc_main$b = vue.defineComponent({
|
|
1991
1871
|
name: "TooltipSimpleTips",
|
|
1992
1872
|
props: ["name", "tips"],
|
|
1993
1873
|
setup() {
|
|
@@ -1997,7 +1877,7 @@ const _sfc_main$a = vue.defineComponent({
|
|
|
1997
1877
|
},
|
|
1998
1878
|
components: {}
|
|
1999
1879
|
});
|
|
2000
|
-
function _sfc_render$
|
|
1880
|
+
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2001
1881
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
2002
1882
|
_ctx.name ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2003
1883
|
key: 0,
|
|
@@ -2009,8 +1889,8 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2009
1889
|
}, vue.toDisplayString(_ctx.tips), 3)) : vue.createCommentVNode("", true)
|
|
2010
1890
|
], 64);
|
|
2011
1891
|
}
|
|
2012
|
-
var TooltipSimpleTips = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2013
|
-
const _sfc_main$
|
|
1892
|
+
var TooltipSimpleTips = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b]]);
|
|
1893
|
+
const _sfc_main$a = vue.defineComponent({
|
|
2014
1894
|
name: "TooltipSummary",
|
|
2015
1895
|
props: ["summaries"],
|
|
2016
1896
|
setup(props) {
|
|
@@ -2029,7 +1909,7 @@ const _sfc_main$9 = vue.defineComponent({
|
|
|
2029
1909
|
},
|
|
2030
1910
|
components: {}
|
|
2031
1911
|
});
|
|
2032
|
-
function _sfc_render$
|
|
1912
|
+
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2033
1913
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2034
1914
|
class: vue.normalizeClass(`${_ctx.TOOLTIP_PREFIX_CLS}-summary`)
|
|
2035
1915
|
}, [
|
|
@@ -2056,8 +1936,8 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2056
1936
|
}), 128))
|
|
2057
1937
|
], 2);
|
|
2058
1938
|
}
|
|
2059
|
-
var TooltipSummary = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2060
|
-
const _sfc_main$
|
|
1939
|
+
var TooltipSummary = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a]]);
|
|
1940
|
+
const _sfc_main$9 = vue.defineComponent({
|
|
2061
1941
|
name: "TooltipOperatorTitle",
|
|
2062
1942
|
props: ["menu"],
|
|
2063
1943
|
setup(props) {
|
|
@@ -2069,7 +1949,7 @@ const _sfc_main$8 = vue.defineComponent({
|
|
|
2069
1949
|
}
|
|
2070
1950
|
});
|
|
2071
1951
|
const _hoisted_1$3 = ["innerHTML"];
|
|
2072
|
-
function _sfc_render$
|
|
1952
|
+
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2073
1953
|
return vue.openBlock(), vue.createElementBlock("span", null, [
|
|
2074
1954
|
_ctx.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
2075
1955
|
key: 0,
|
|
@@ -2081,8 +1961,8 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2081
1961
|
}, vue.toDisplayString(_ctx.menu.text), 3)
|
|
2082
1962
|
]);
|
|
2083
1963
|
}
|
|
2084
|
-
var TooltipOperatorTitle = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2085
|
-
const _sfc_main$
|
|
1964
|
+
var TooltipOperatorTitle = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9]]);
|
|
1965
|
+
const _sfc_main$8 = vue.defineComponent({
|
|
2086
1966
|
name: "TooltipOperatorMenu",
|
|
2087
1967
|
props: ["menu", "cell"],
|
|
2088
1968
|
setup(props) {
|
|
@@ -2102,7 +1982,7 @@ const _sfc_main$7 = vue.defineComponent({
|
|
|
2102
1982
|
TooltipOperatorTitle
|
|
2103
1983
|
}
|
|
2104
1984
|
});
|
|
2105
|
-
function _sfc_render$
|
|
1985
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2106
1986
|
const _component_TooltipOperatorTitle = vue.resolveComponent("TooltipOperatorTitle");
|
|
2107
1987
|
const _component_TooltipOperatorMenu = vue.resolveComponent("TooltipOperatorMenu");
|
|
2108
1988
|
const _component_MenuItem = vue.resolveComponent("MenuItem");
|
|
@@ -2160,9 +2040,9 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2160
2040
|
}, 8, ["title"])) : vue.createCommentVNode("", true)
|
|
2161
2041
|
], 64);
|
|
2162
2042
|
}
|
|
2163
|
-
var TooltipOperatorMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2043
|
+
var TooltipOperatorMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8]]);
|
|
2164
2044
|
var index_vue_vue_type_style_index_0_lang$1 = "";
|
|
2165
|
-
const _sfc_main$
|
|
2045
|
+
const _sfc_main$7 = vue.defineComponent({
|
|
2166
2046
|
name: "TooltipOperator",
|
|
2167
2047
|
props: [
|
|
2168
2048
|
"menus",
|
|
@@ -2186,7 +2066,7 @@ const _sfc_main$6 = vue.defineComponent({
|
|
|
2186
2066
|
TooltipOperatorMenu
|
|
2187
2067
|
}
|
|
2188
2068
|
});
|
|
2189
|
-
function _sfc_render$
|
|
2069
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2190
2070
|
const _component_TooltipOperatorMenu = vue.resolveComponent("TooltipOperatorMenu");
|
|
2191
2071
|
const _component_Menu = vue.resolveComponent("Menu");
|
|
2192
2072
|
const _component_TooltipOperatorTitle = vue.resolveComponent("TooltipOperatorTitle");
|
|
@@ -2249,9 +2129,9 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2249
2129
|
}), 128))
|
|
2250
2130
|
], 2);
|
|
2251
2131
|
}
|
|
2252
|
-
var TooltipOperator = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2132
|
+
var TooltipOperator = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]);
|
|
2253
2133
|
var index_vue_vue_type_style_index_0_lang = "";
|
|
2254
|
-
const _sfc_main$
|
|
2134
|
+
const _sfc_main$6 = vue.defineComponent({
|
|
2255
2135
|
name: "TooltipComponent",
|
|
2256
2136
|
props: [
|
|
2257
2137
|
"data",
|
|
@@ -2277,7 +2157,7 @@ const _sfc_main$5 = vue.defineComponent({
|
|
|
2277
2157
|
TooltipOperator
|
|
2278
2158
|
}
|
|
2279
2159
|
});
|
|
2280
|
-
function _sfc_render$
|
|
2160
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2281
2161
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
2282
2162
|
const _component_TooltipOperator = vue.resolveComponent("TooltipOperator");
|
|
2283
2163
|
const _component_TooltipSimpleTips = vue.resolveComponent("TooltipSimpleTips");
|
|
@@ -2321,7 +2201,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2321
2201
|
], 64))
|
|
2322
2202
|
], 64));
|
|
2323
2203
|
}
|
|
2324
|
-
var TooltipComponent = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2204
|
+
var TooltipComponent = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]);
|
|
2325
2205
|
class CustomTooltip extends s2.BaseTooltip {
|
|
2326
2206
|
constructor(spreadsheet) {
|
|
2327
2207
|
super(spreadsheet);
|
|
@@ -2349,6 +2229,126 @@ class CustomTooltip extends s2.BaseTooltip {
|
|
|
2349
2229
|
}
|
|
2350
2230
|
}
|
|
2351
2231
|
}
|
|
2232
|
+
const DEFAULT_PAGE_NUMBER = 1;
|
|
2233
|
+
const DEFAULT_PAGE_SIZE = 10;
|
|
2234
|
+
const usePagination = (s2Ref, props) => {
|
|
2235
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2236
|
+
const current = vue.ref((_c = (_b = (_a = props.options) == null ? void 0 : _a.pagination) == null ? void 0 : _b.current) != null ? _c : DEFAULT_PAGE_NUMBER);
|
|
2237
|
+
const pageSize = vue.ref((_f = (_e = (_d = props.options) == null ? void 0 : _d.pagination) == null ? void 0 : _e.pageSize) != null ? _f : DEFAULT_PAGE_SIZE);
|
|
2238
|
+
const total = vue.ref(0);
|
|
2239
|
+
const change = (nextCurrent) => {
|
|
2240
|
+
current.value = nextCurrent;
|
|
2241
|
+
};
|
|
2242
|
+
const showSizeChange = (nextPageSize) => {
|
|
2243
|
+
pageSize.value = nextPageSize;
|
|
2244
|
+
};
|
|
2245
|
+
const visible = vue.computed(() => {
|
|
2246
|
+
var _a2;
|
|
2247
|
+
return props.showPagination && !isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination);
|
|
2248
|
+
});
|
|
2249
|
+
vue.watch([current, pageSize], () => {
|
|
2250
|
+
var _a2;
|
|
2251
|
+
if (!s2Ref.value) {
|
|
2252
|
+
return;
|
|
2253
|
+
}
|
|
2254
|
+
const nextPagination = isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination) ? null : {
|
|
2255
|
+
current: current.value,
|
|
2256
|
+
pageSize: pageSize.value
|
|
2257
|
+
};
|
|
2258
|
+
s2Ref.value.updatePagination(nextPagination);
|
|
2259
|
+
s2Ref.value.render(false);
|
|
2260
|
+
});
|
|
2261
|
+
vue.watch([() => {
|
|
2262
|
+
var _a2;
|
|
2263
|
+
return (_a2 = props.options) == null ? void 0 : _a2.pagination;
|
|
2264
|
+
}, s2Ref], () => {
|
|
2265
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i;
|
|
2266
|
+
current.value = (_c2 = (_b2 = (_a2 = props.options) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.current) != null ? _c2 : DEFAULT_PAGE_NUMBER;
|
|
2267
|
+
pageSize.value = (_f2 = (_e2 = (_d2 = props.options) == null ? void 0 : _d2.pagination) == null ? void 0 : _e2.pageSize) != null ? _f2 : DEFAULT_PAGE_SIZE;
|
|
2268
|
+
total.value = (_i = (_h = (_g = s2Ref.value) == null ? void 0 : _g.facet) == null ? void 0 : _h.viewCellHeights.getTotalLength()) != null ? _i : 0;
|
|
2269
|
+
}, {
|
|
2270
|
+
immediate: true
|
|
2271
|
+
});
|
|
2272
|
+
vue.watch(s2Ref, (value, oldValue, onCleanup) => {
|
|
2273
|
+
if (!s2Ref.value) {
|
|
2274
|
+
return;
|
|
2275
|
+
}
|
|
2276
|
+
const totalUpdateCallback = (data) => {
|
|
2277
|
+
var _a2;
|
|
2278
|
+
if (isEmpty((_a2 = props.options) == null ? void 0 : _a2.pagination)) {
|
|
2279
|
+
return;
|
|
2280
|
+
}
|
|
2281
|
+
total.value = data.total;
|
|
2282
|
+
};
|
|
2283
|
+
s2Ref.value.on(s2.S2Event.LAYOUT_PAGINATION, totalUpdateCallback);
|
|
2284
|
+
onCleanup(() => {
|
|
2285
|
+
var _a2;
|
|
2286
|
+
(_a2 = s2Ref.value) == null ? void 0 : _a2.off(s2.S2Event.LAYOUT_PAGINATION, totalUpdateCallback);
|
|
2287
|
+
});
|
|
2288
|
+
});
|
|
2289
|
+
return {
|
|
2290
|
+
visible,
|
|
2291
|
+
current,
|
|
2292
|
+
pageSize,
|
|
2293
|
+
total,
|
|
2294
|
+
change,
|
|
2295
|
+
showSizeChange
|
|
2296
|
+
};
|
|
2297
|
+
};
|
|
2298
|
+
const PRE_CLASS = `${s2.S2_PREFIX_CLS}-pagination`;
|
|
2299
|
+
const _sfc_main$5 = vue.defineComponent({
|
|
2300
|
+
name: "s2-pagination",
|
|
2301
|
+
props: {
|
|
2302
|
+
current: {
|
|
2303
|
+
type: Number,
|
|
2304
|
+
default: DEFAULT_PAGE_NUMBER
|
|
2305
|
+
},
|
|
2306
|
+
total: {
|
|
2307
|
+
type: Number,
|
|
2308
|
+
default: 0
|
|
2309
|
+
},
|
|
2310
|
+
pageSize: {
|
|
2311
|
+
type: Number,
|
|
2312
|
+
default: DEFAULT_PAGE_SIZE
|
|
2313
|
+
}
|
|
2314
|
+
},
|
|
2315
|
+
emits: ["change", "showSizeChange"],
|
|
2316
|
+
setup: (props) => {
|
|
2317
|
+
const showQuickJumper = vue.computed(() => {
|
|
2318
|
+
return props.total / props.pageSize > 5;
|
|
2319
|
+
});
|
|
2320
|
+
return {
|
|
2321
|
+
showQuickJumper,
|
|
2322
|
+
PRE_CLASS,
|
|
2323
|
+
i18n: s2.i18n
|
|
2324
|
+
};
|
|
2325
|
+
},
|
|
2326
|
+
components: {
|
|
2327
|
+
AntDPagination: antDesignVue.Pagination
|
|
2328
|
+
}
|
|
2329
|
+
});
|
|
2330
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2331
|
+
const _component_AntDPagination = vue.resolveComponent("AntDPagination");
|
|
2332
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2333
|
+
class: vue.normalizeClass(_ctx.PRE_CLASS)
|
|
2334
|
+
}, [
|
|
2335
|
+
vue.createVNode(_component_AntDPagination, {
|
|
2336
|
+
"default-current": 1,
|
|
2337
|
+
current: _ctx.current,
|
|
2338
|
+
total: _ctx.total,
|
|
2339
|
+
pageSize: _ctx.pageSize,
|
|
2340
|
+
showSizeChanger: true,
|
|
2341
|
+
onShowSizeChange: _cache[0] || (_cache[0] = (_, size2) => _ctx.$emit("showSizeChange", size2)),
|
|
2342
|
+
size: "small",
|
|
2343
|
+
showQuickJumper: _ctx.showQuickJumper,
|
|
2344
|
+
onChange: _cache[1] || (_cache[1] = (current) => _ctx.$emit("change", current))
|
|
2345
|
+
}, null, 8, ["current", "total", "pageSize", "showQuickJumper"]),
|
|
2346
|
+
vue.createElementVNode("span", {
|
|
2347
|
+
class: vue.normalizeClass(`${_ctx.PRE_CLASS}-count`)
|
|
2348
|
+
}, vue.toDisplayString(_ctx.i18n("\u5171\u8BA1")) + " " + vue.toDisplayString(_ctx.total || " - ") + " " + vue.toDisplayString(_ctx.i18n("\u6761")), 3)
|
|
2349
|
+
], 2);
|
|
2350
|
+
}
|
|
2351
|
+
var S2Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
|
|
2352
2352
|
const RENDER_TOOLTIP_OPTION = {
|
|
2353
2353
|
tooltip: {
|
|
2354
2354
|
renderTooltip: (spreadsheet) => new CustomTooltip(spreadsheet)
|
|
@@ -2453,6 +2453,8 @@ const useEvents = (s2Ref, emit) => {
|
|
|
2453
2453
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_RESET, "reset");
|
|
2454
2454
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_LINK_FIELD_JUMP, "linkFieldJump");
|
|
2455
2455
|
useS2Event(s2Ref, emit, s2.S2Event.GLOBAL_SCROLL, "scroll");
|
|
2456
|
+
useS2Event(s2Ref, emit, s2.S2Event.ROW_CELL_BRUSH_SELECTION, "rowCellBrushSelection");
|
|
2457
|
+
useS2Event(s2Ref, emit, s2.S2Event.COL_CELL_BRUSH_SELECTION, "colCellBrushSelection");
|
|
2456
2458
|
});
|
|
2457
2459
|
};
|
|
2458
2460
|
const useLoading = (s2Ref, loadingProp = false) => {
|
|
@@ -2720,7 +2722,9 @@ const initBaseSheetEmits = () => {
|
|
|
2720
2722
|
"click",
|
|
2721
2723
|
"doubleClick",
|
|
2722
2724
|
"scroll",
|
|
2723
|
-
"hover"
|
|
2725
|
+
"hover",
|
|
2726
|
+
"rowCellBrushSelection",
|
|
2727
|
+
"colCellBrushSelection"
|
|
2724
2728
|
];
|
|
2725
2729
|
return keys2;
|
|
2726
2730
|
};
|
|
@@ -3100,6 +3104,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3100
3104
|
}
|
|
3101
3105
|
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
3102
3106
|
exports.BaseSheet = BaseSheet;
|
|
3107
|
+
exports.CustomTooltip = CustomTooltip;
|
|
3103
3108
|
exports.PivotSheet = PivotSheet;
|
|
3104
3109
|
exports.SheetComponent = index;
|
|
3105
3110
|
exports.TableSheet = TableSheet;
|