@antv/s2-vue 2.0.0-next.8 → 2.0.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/LICENSE +21 -0
- package/README.md +7 -8
- package/dist/s2-vue.min.css +1 -0
- package/dist/s2-vue.min.js +28 -0
- package/dist/s2-vue.min.js.map +1 -0
- package/esm/common/constant/index.d.ts +1 -0
- package/esm/common/constant/index.js +2 -0
- package/esm/common/constant/index.js.map +1 -0
- package/esm/common/constant/options.d.ts +2 -0
- package/esm/common/constant/options.js +7 -0
- package/esm/common/constant/options.js.map +1 -0
- package/esm/components/drill-down/index.vue.d.ts +126 -0
- package/esm/components/drill-down/index.vue.js +206 -0
- package/esm/components/drill-down/index.vue.js.map +1 -0
- package/esm/components/index.d.ts +6 -0
- package/esm/components/index.js +8 -0
- package/esm/components/index.js.map +1 -0
- package/esm/components/pagination/index.vue.d.ts +44 -0
- package/esm/components/pagination/index.vue.js +91 -0
- package/esm/components/pagination/index.vue.js.map +1 -0
- package/esm/components/sheets/base-sheet.vue.d.ts +391 -0
- package/esm/components/sheets/base-sheet.vue.js +119 -0
- package/esm/components/sheets/base-sheet.vue.js.map +1 -0
- package/esm/components/sheets/editable-sheet.vue.d.ts +2 -0
- package/esm/components/sheets/editable-sheet.vue.js +181 -0
- package/esm/components/sheets/editable-sheet.vue.js.map +1 -0
- package/esm/components/sheets/index.vue.d.ts +251 -0
- package/esm/components/sheets/index.vue.js +77 -0
- package/esm/components/sheets/index.vue.js.map +1 -0
- package/esm/components/sheets/pivot-sheet.vue.d.ts +322 -0
- package/esm/components/sheets/pivot-sheet.vue.js +117 -0
- package/esm/components/sheets/pivot-sheet.vue.js.map +1 -0
- package/esm/components/sheets/table-sheet.vue.d.ts +250 -0
- package/esm/components/sheets/table-sheet.vue.js +61 -0
- package/esm/components/sheets/table-sheet.vue.js.map +1 -0
- package/esm/components/tooltip/components/detail.vue.d.ts +6 -0
- package/esm/components/tooltip/components/detail.vue.js +53 -0
- package/esm/components/tooltip/components/detail.vue.js.map +1 -0
- package/esm/components/tooltip/components/head-info.vue.d.ts +6 -0
- package/esm/components/tooltip/components/head-info.vue.js +61 -0
- package/esm/components/tooltip/components/head-info.vue.js.map +1 -0
- package/esm/components/tooltip/components/infos.vue.d.ts +6 -0
- package/esm/components/tooltip/components/infos.vue.js +49 -0
- package/esm/components/tooltip/components/infos.vue.js.map +1 -0
- package/esm/components/tooltip/components/operator/index.d.ts +3 -0
- package/esm/components/tooltip/components/operator/index.js +4 -0
- package/esm/components/tooltip/components/operator/index.js.map +1 -0
- package/esm/components/tooltip/components/operator/index.vue.d.ts +14 -0
- package/esm/components/tooltip/components/operator/index.vue.js +149 -0
- package/esm/components/tooltip/components/operator/index.vue.js.map +1 -0
- package/esm/components/tooltip/components/operator/menu.vue.d.ts +21 -0
- package/esm/components/tooltip/components/operator/menu.vue.js +146 -0
- package/esm/components/tooltip/components/operator/menu.vue.js.map +1 -0
- package/esm/components/tooltip/components/operator/title.vue.d.ts +10 -0
- package/esm/components/tooltip/components/operator/title.vue.js +54 -0
- package/esm/components/tooltip/components/operator/title.vue.js.map +1 -0
- package/esm/components/tooltip/components/simple-tips.vue.d.ts +6 -0
- package/esm/components/tooltip/components/simple-tips.vue.js +55 -0
- package/esm/components/tooltip/components/simple-tips.vue.js.map +1 -0
- package/esm/components/tooltip/components/summary.vue.d.ts +11 -0
- package/esm/components/tooltip/components/summary.vue.js +71 -0
- package/esm/components/tooltip/components/summary.vue.js.map +1 -0
- package/esm/components/tooltip/custom-tooltip.d.ts +6 -0
- package/esm/components/tooltip/custom-tooltip.js +36 -0
- package/esm/components/tooltip/custom-tooltip.js.map +1 -0
- package/esm/components/tooltip/index.vue.d.ts +13 -0
- package/esm/components/tooltip/index.vue.js +124 -0
- package/esm/components/tooltip/index.vue.js.map +1 -0
- package/esm/components/tooltip/interface.d.ts +8 -0
- package/esm/components/tooltip/interface.js +2 -0
- package/esm/components/tooltip/interface.js.map +1 -0
- package/esm/hooks/useEvents.d.ts +4 -0
- package/esm/hooks/useEvents.js +125 -0
- package/esm/hooks/useEvents.js.map +1 -0
- package/esm/hooks/useExpose.d.ts +5 -0
- package/esm/hooks/useExpose.js +11 -0
- package/esm/hooks/useExpose.js.map +1 -0
- package/esm/hooks/useLoading.d.ts +6 -0
- package/esm/hooks/useLoading.js +18 -0
- package/esm/hooks/useLoading.js.map +1 -0
- package/esm/hooks/usePagination.d.ts +70 -0
- package/esm/hooks/usePagination.js +68 -0
- package/esm/hooks/usePagination.js.map +1 -0
- package/esm/hooks/useResize.d.ts +7 -0
- package/esm/hooks/useResize.js +20 -0
- package/esm/hooks/useResize.js.map +1 -0
- package/esm/hooks/useSheetUpdate.d.ts +13 -0
- package/esm/hooks/useSheetUpdate.js +56 -0
- package/esm/hooks/useSheetUpdate.js.map +1 -0
- package/esm/hooks/useSpreadSheet.d.ts +75 -0
- package/esm/hooks/useSpreadSheet.js +60 -0
- package/esm/hooks/useSpreadSheet.js.map +1 -0
- package/esm/index.d.ts +4 -6068
- package/esm/index.js +5 -3363
- package/esm/index.js.map +1 -1
- package/esm/interface.d.ts +47 -0
- package/esm/interface.js +2 -0
- package/esm/interface.js.map +1 -0
- package/esm/svg/calendar-icon.svg +13 -0
- package/esm/svg/location-icon.svg +13 -0
- package/esm/svg/text-icon.svg +13 -0
- package/esm/utils/extendLocale.d.ts +1 -0
- package/esm/utils/extendLocale.js +3 -0
- package/esm/utils/extendLocale.js.map +1 -0
- package/esm/utils/initPropAndEmits.d.ts +204 -0
- package/esm/utils/initPropAndEmits.js +158 -0
- package/esm/utils/initPropAndEmits.js.map +1 -0
- package/esm/utils/options.d.ts +2 -0
- package/esm/utils/options.js +4 -0
- package/esm/utils/options.js.map +1 -0
- package/lib/common/constant/index.d.ts +1 -0
- package/lib/common/constant/index.js +5 -0
- package/lib/common/constant/index.js.map +1 -0
- package/lib/common/constant/options.d.ts +2 -0
- package/lib/common/constant/options.js +10 -0
- package/lib/common/constant/options.js.map +1 -0
- package/lib/components/drill-down/index.vue.d.ts +126 -0
- package/lib/components/drill-down/index.vue.js +209 -0
- package/lib/components/drill-down/index.vue.js.map +1 -0
- package/lib/components/index.d.ts +6 -0
- package/lib/components/index.js +20 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/pagination/index.vue.d.ts +44 -0
- package/lib/components/pagination/index.vue.js +93 -0
- package/lib/components/pagination/index.vue.js.map +1 -0
- package/lib/components/sheets/base-sheet.vue.d.ts +391 -0
- package/lib/components/sheets/base-sheet.vue.js +122 -0
- package/lib/components/sheets/base-sheet.vue.js.map +1 -0
- package/lib/components/sheets/editable-sheet.vue.d.ts +2 -0
- package/lib/components/sheets/editable-sheet.vue.js +184 -0
- package/lib/components/sheets/editable-sheet.vue.js.map +1 -0
- package/lib/components/sheets/index.vue.d.ts +251 -0
- package/lib/components/sheets/index.vue.js +80 -0
- package/lib/components/sheets/index.vue.js.map +1 -0
- package/lib/components/sheets/pivot-sheet.vue.d.ts +322 -0
- package/lib/components/sheets/pivot-sheet.vue.js +120 -0
- package/lib/components/sheets/pivot-sheet.vue.js.map +1 -0
- package/lib/components/sheets/table-sheet.vue.d.ts +250 -0
- package/lib/components/sheets/table-sheet.vue.js +64 -0
- package/lib/components/sheets/table-sheet.vue.js.map +1 -0
- package/lib/components/tooltip/components/detail.vue.d.ts +6 -0
- package/lib/components/tooltip/components/detail.vue.js +55 -0
- package/lib/components/tooltip/components/detail.vue.js.map +1 -0
- package/lib/components/tooltip/components/head-info.vue.d.ts +6 -0
- package/lib/components/tooltip/components/head-info.vue.js +63 -0
- package/lib/components/tooltip/components/head-info.vue.js.map +1 -0
- package/lib/components/tooltip/components/infos.vue.d.ts +6 -0
- package/lib/components/tooltip/components/infos.vue.js +51 -0
- package/lib/components/tooltip/components/infos.vue.js.map +1 -0
- package/lib/components/tooltip/components/operator/index.d.ts +3 -0
- package/lib/components/tooltip/components/operator/index.js +13 -0
- package/lib/components/tooltip/components/operator/index.js.map +1 -0
- package/lib/components/tooltip/components/operator/index.vue.d.ts +14 -0
- package/lib/components/tooltip/components/operator/index.vue.js +152 -0
- package/lib/components/tooltip/components/operator/index.vue.js.map +1 -0
- package/lib/components/tooltip/components/operator/menu.vue.d.ts +21 -0
- package/lib/components/tooltip/components/operator/menu.vue.js +149 -0
- package/lib/components/tooltip/components/operator/menu.vue.js.map +1 -0
- package/lib/components/tooltip/components/operator/title.vue.d.ts +10 -0
- package/lib/components/tooltip/components/operator/title.vue.js +56 -0
- package/lib/components/tooltip/components/operator/title.vue.js.map +1 -0
- package/lib/components/tooltip/components/simple-tips.vue.d.ts +6 -0
- package/lib/components/tooltip/components/simple-tips.vue.js +57 -0
- package/lib/components/tooltip/components/simple-tips.vue.js.map +1 -0
- package/lib/components/tooltip/components/summary.vue.d.ts +11 -0
- package/lib/components/tooltip/components/summary.vue.js +73 -0
- package/lib/components/tooltip/components/summary.vue.js.map +1 -0
- package/lib/components/tooltip/custom-tooltip.d.ts +6 -0
- package/lib/components/tooltip/custom-tooltip.js +41 -0
- package/lib/components/tooltip/custom-tooltip.js.map +1 -0
- package/lib/components/tooltip/index.vue.d.ts +13 -0
- package/lib/components/tooltip/index.vue.js +127 -0
- package/lib/components/tooltip/index.vue.js.map +1 -0
- package/lib/components/tooltip/interface.d.ts +8 -0
- package/lib/components/tooltip/interface.js +3 -0
- package/lib/components/tooltip/interface.js.map +1 -0
- package/lib/hooks/useEvents.d.ts +4 -0
- package/lib/hooks/useEvents.js +129 -0
- package/lib/hooks/useEvents.js.map +1 -0
- package/lib/hooks/useExpose.d.ts +5 -0
- package/lib/hooks/useExpose.js +15 -0
- package/lib/hooks/useExpose.js.map +1 -0
- package/lib/hooks/useLoading.d.ts +6 -0
- package/lib/hooks/useLoading.js +22 -0
- package/lib/hooks/useLoading.js.map +1 -0
- package/lib/hooks/usePagination.d.ts +70 -0
- package/lib/hooks/usePagination.js +72 -0
- package/lib/hooks/usePagination.js.map +1 -0
- package/lib/hooks/useResize.d.ts +7 -0
- package/lib/hooks/useResize.js +24 -0
- package/lib/hooks/useResize.js.map +1 -0
- package/lib/hooks/useSheetUpdate.d.ts +13 -0
- package/lib/hooks/useSheetUpdate.js +60 -0
- package/lib/hooks/useSheetUpdate.js.map +1 -0
- package/lib/hooks/useSpreadSheet.d.ts +75 -0
- package/lib/hooks/useSpreadSheet.js +64 -0
- package/lib/hooks/useSpreadSheet.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +8 -3362
- package/lib/index.js.map +1 -1
- package/lib/interface.d.ts +47 -0
- package/lib/interface.js +3 -0
- package/lib/interface.js.map +1 -0
- package/lib/svg/calendar-icon.svg +13 -0
- package/lib/svg/location-icon.svg +13 -0
- package/lib/svg/text-icon.svg +13 -0
- package/lib/utils/extendLocale.d.ts +1 -0
- package/lib/utils/extendLocale.js +5 -0
- package/lib/utils/extendLocale.js.map +1 -0
- package/lib/utils/initPropAndEmits.d.ts +204 -0
- package/lib/utils/initPropAndEmits.js +165 -0
- package/lib/utils/initPropAndEmits.js.map +1 -0
- package/lib/utils/options.d.ts +2 -0
- package/lib/utils/options.js +8 -0
- package/lib/utils/options.js.map +1 -0
- package/package.json +65 -57
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- package/dist/style.min.css +0 -1
- package/esm/style.css +0 -393
- package/lib/style.css +0 -393
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GetInitProps } from '../../interface';
|
|
2
|
+
import type { TooltipRenderProps } from './interface';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<GetInitProps<TooltipRenderProps<string | HTMLElement>, "options" | "onMounted" | "data" | "event" | "content" | "cellInfos">, {
|
|
4
|
+
operator: import("@antv/s2").TooltipOperatorOptions<import("@antv/s2").BaseTooltipOperatorMenuOptions> | {
|
|
5
|
+
menu: {
|
|
6
|
+
onClick: (...args: any[]) => void;
|
|
7
|
+
items: never[];
|
|
8
|
+
selectedKeys: never[];
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
onlyShowOperator: boolean;
|
|
12
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<GetInitProps<TooltipRenderProps<string | HTMLElement>, "options" | "onMounted" | "data" | "event" | "content" | "cellInfos">>>, {}, {}>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/// <reference types="../../../node_modules/.vue-global-types/vue_3.4_false.d.ts" />
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const s2_1 = require("@antv/s2");
|
|
6
|
+
const vue_1 = require("vue");
|
|
7
|
+
const detail_vue_1 = tslib_1.__importDefault(require("./components/detail.vue"));
|
|
8
|
+
const head_info_vue_1 = tslib_1.__importDefault(require("./components/head-info.vue"));
|
|
9
|
+
const infos_vue_1 = tslib_1.__importDefault(require("./components/infos.vue"));
|
|
10
|
+
const simple_tips_vue_1 = tslib_1.__importDefault(require("./components/simple-tips.vue"));
|
|
11
|
+
const summary_vue_1 = tslib_1.__importDefault(require("./components/summary.vue"));
|
|
12
|
+
const operator_1 = require("./components/operator");
|
|
13
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
14
|
+
name: 'TooltipComponent',
|
|
15
|
+
props: [
|
|
16
|
+
'data',
|
|
17
|
+
'options',
|
|
18
|
+
'cell',
|
|
19
|
+
'position',
|
|
20
|
+
'event',
|
|
21
|
+
'content',
|
|
22
|
+
],
|
|
23
|
+
setup(props) {
|
|
24
|
+
const { operator, onlyShowOperator } = (0, s2_1.getTooltipDefaultOptions)(props.options);
|
|
25
|
+
return {
|
|
26
|
+
operator,
|
|
27
|
+
onlyShowOperator,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
components: {
|
|
31
|
+
TooltipDetail: detail_vue_1.default,
|
|
32
|
+
TooltipHeadInfo: head_info_vue_1.default,
|
|
33
|
+
TooltipInfos: infos_vue_1.default,
|
|
34
|
+
TooltipSimpleTips: simple_tips_vue_1.default,
|
|
35
|
+
TooltipSummary: summary_vue_1.default,
|
|
36
|
+
TooltipOperator: operator_1.TooltipOperator,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
; /* PartiallyEnd: #3632/script.vue */
|
|
40
|
+
function __VLS_template() {
|
|
41
|
+
const __VLS_ctx = {};
|
|
42
|
+
const __VLS_localComponents = {
|
|
43
|
+
...{
|
|
44
|
+
TooltipDetail: detail_vue_1.default,
|
|
45
|
+
TooltipHeadInfo: head_info_vue_1.default,
|
|
46
|
+
TooltipInfos: infos_vue_1.default,
|
|
47
|
+
TooltipSimpleTips: simple_tips_vue_1.default,
|
|
48
|
+
TooltipSummary: summary_vue_1.default,
|
|
49
|
+
TooltipOperator: operator_1.TooltipOperator,
|
|
50
|
+
},
|
|
51
|
+
...{},
|
|
52
|
+
...{},
|
|
53
|
+
...__VLS_ctx,
|
|
54
|
+
};
|
|
55
|
+
let __VLS_components;
|
|
56
|
+
const __VLS_localDirectives = {
|
|
57
|
+
...{},
|
|
58
|
+
...__VLS_ctx,
|
|
59
|
+
};
|
|
60
|
+
let __VLS_directives;
|
|
61
|
+
let __VLS_styleScopedClasses;
|
|
62
|
+
// CSS variable injection
|
|
63
|
+
// CSS variable injection end
|
|
64
|
+
let __VLS_resolvedLocalAndGlobalComponents;
|
|
65
|
+
if (__VLS_ctx.onlyShowOperator) {
|
|
66
|
+
const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.TooltipOperator;
|
|
67
|
+
/** @type { [typeof __VLS_components.TooltipOperator, ] } */
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ menu: ((__VLS_ctx.operator?.menu)), onlyShowOperator: ((true)), cell: ((__VLS_ctx.cell)), }));
|
|
70
|
+
const __VLS_2 = __VLS_1({ menu: ((__VLS_ctx.operator?.menu)), onlyShowOperator: ((true)), cell: ((__VLS_ctx.cell)), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const __VLS_6 = __VLS_resolvedLocalAndGlobalComponents.TooltipOperator;
|
|
74
|
+
/** @type { [typeof __VLS_components.TooltipOperator, ] } */
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
const __VLS_7 = __VLS_asFunctionalComponent(__VLS_6, new __VLS_6({ menu: ((__VLS_ctx.operator?.menu)), onlyShowOperator: ((false)), cell: ((__VLS_ctx.cell)), }));
|
|
77
|
+
const __VLS_8 = __VLS_7({ menu: ((__VLS_ctx.operator?.menu)), onlyShowOperator: ((false)), cell: ((__VLS_ctx.cell)), }, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
|
78
|
+
if (__VLS_ctx.content) {
|
|
79
|
+
var __VLS_12 = {};
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const __VLS_13 = __VLS_resolvedLocalAndGlobalComponents.TooltipSimpleTips;
|
|
83
|
+
/** @type { [typeof __VLS_components.TooltipSimpleTips, ] } */
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({ name: ((__VLS_ctx.data?.name)), tips: ((__VLS_ctx.data?.tips)), }));
|
|
86
|
+
const __VLS_15 = __VLS_14({ name: ((__VLS_ctx.data?.name)), tips: ((__VLS_ctx.data?.tips)), }, ...__VLS_functionalComponentArgsRest(__VLS_14));
|
|
87
|
+
if (__VLS_ctx.data?.summaries?.length) {
|
|
88
|
+
const __VLS_19 = __VLS_resolvedLocalAndGlobalComponents.TooltipSummary;
|
|
89
|
+
/** @type { [typeof __VLS_components.TooltipSummary, ] } */
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
const __VLS_20 = __VLS_asFunctionalComponent(__VLS_19, new __VLS_19({ summaries: ((__VLS_ctx.data?.summaries)), }));
|
|
92
|
+
const __VLS_21 = __VLS_20({ summaries: ((__VLS_ctx.data?.summaries)), }, ...__VLS_functionalComponentArgsRest(__VLS_20));
|
|
93
|
+
}
|
|
94
|
+
const __VLS_25 = __VLS_resolvedLocalAndGlobalComponents.TooltipHeadInfo;
|
|
95
|
+
/** @type { [typeof __VLS_components.TooltipHeadInfo, ] } */
|
|
96
|
+
// @ts-ignore
|
|
97
|
+
const __VLS_26 = __VLS_asFunctionalComponent(__VLS_25, new __VLS_25({ rows: ((__VLS_ctx.data?.headInfo?.rows || [])), cols: ((__VLS_ctx.data?.headInfo?.cols || [])), }));
|
|
98
|
+
const __VLS_27 = __VLS_26({ rows: ((__VLS_ctx.data?.headInfo?.rows || [])), cols: ((__VLS_ctx.data?.headInfo?.cols || [])), }, ...__VLS_functionalComponentArgsRest(__VLS_26));
|
|
99
|
+
const __VLS_31 = __VLS_resolvedLocalAndGlobalComponents.TooltipDetail;
|
|
100
|
+
/** @type { [typeof __VLS_components.TooltipDetail, ] } */
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
const __VLS_32 = __VLS_asFunctionalComponent(__VLS_31, new __VLS_31({ list: ((__VLS_ctx.data?.details || [])), }));
|
|
103
|
+
const __VLS_33 = __VLS_32({ list: ((__VLS_ctx.data?.details || [])), }, ...__VLS_functionalComponentArgsRest(__VLS_32));
|
|
104
|
+
if (__VLS_ctx.data?.infos) {
|
|
105
|
+
const __VLS_37 = __VLS_resolvedLocalAndGlobalComponents.TooltipInfos;
|
|
106
|
+
/** @type { [typeof __VLS_components.TooltipInfos, ] } */
|
|
107
|
+
// @ts-ignore
|
|
108
|
+
const __VLS_38 = __VLS_asFunctionalComponent(__VLS_37, new __VLS_37({ infos: ((__VLS_ctx.data?.infos)), }));
|
|
109
|
+
const __VLS_39 = __VLS_38({ infos: ((__VLS_ctx.data?.infos)), }, ...__VLS_functionalComponentArgsRest(__VLS_38));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
var __VLS_slots;
|
|
114
|
+
var __VLS_inheritedAttrs;
|
|
115
|
+
const __VLS_refs = {};
|
|
116
|
+
var $refs;
|
|
117
|
+
var $el;
|
|
118
|
+
return {
|
|
119
|
+
attrs: {},
|
|
120
|
+
slots: __VLS_slots,
|
|
121
|
+
refs: $refs,
|
|
122
|
+
rootEl: $el,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
;
|
|
126
|
+
let __VLS_self;
|
|
127
|
+
//# sourceMappingURL=index.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue.js","sourceRoot":"","sources":["../../../src/components/tooltip/index.vue"],"names":[],"mappings":";AAiFA,oFAAoF;;;AAEpF,iCAAoD;AACpD,6BAAsC;AAEtC,iFAAoD;AACpD,uFAAyD;AACzD,+EAAkD;AAClD,2FAA6D;AAC7D,mFAAsD;AACtD,oDAAwD;AAGxD,kBAAe,IAAA,qBAAe,EAAC;IAC7B,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE;QACL,MAAM;QACN,SAAS;QACT,MAAM;QACN,UAAU;QACV,OAAO;QACP,SAAS;KACqC;IAChD,KAAK,CAAC,KAAK;QACT,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,IAAA,6BAAwB,EAC7D,KAAK,CAAC,OAAO,CACd,CAAC;QAEF,OAAO;YACL,QAAQ;YACR,gBAAgB;SACjB,CAAC;IACJ,CAAC;IACD,UAAU,EAAE;QACV,aAAa,EAAb,oBAAa;QACb,eAAe,EAAf,uBAAe;QACf,YAAY,EAAZ,mBAAY;QACZ,iBAAiB,EAAjB,yBAAiB;QACjB,cAAc,EAAd,qBAAc;QACd,eAAe,EAAf,0BAAe;KAChB;CACF,CAAC,CAAC;AACH,CAAC,CAAA,oCAAoC;AACrC,SAAS,cAAc;IACvB,MAAM,SAAS,GAAG,EAAqE,CAAC;IACxF,MAAM,qBAAqB,GAAG;QAC9B,GAAG;YACC,aAAa,EAAb,oBAAa;YACb,eAAe,EAAf,uBAA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3
|
+
readonly content?: T;
|
|
4
|
+
readonly cell: S2CellType;
|
|
5
|
+
}
|
|
6
|
+
export type TooltipInfosProps = {
|
|
7
|
+
infos: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/components/tooltip/interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useEvents = void 0;
|
|
4
|
+
/* eslint-disable max-lines-per-function */
|
|
5
|
+
const s2_1 = require("@antv/s2");
|
|
6
|
+
const vue_1 = require("vue");
|
|
7
|
+
const useCellEvent = (s2Ref, emit, eventName, emitName) => {
|
|
8
|
+
const handler = (event) => {
|
|
9
|
+
const param = (0, s2_1.getBaseCellData)(event);
|
|
10
|
+
emit(emitName, param);
|
|
11
|
+
};
|
|
12
|
+
s2Ref.value?.on(eventName, handler);
|
|
13
|
+
};
|
|
14
|
+
const useS2Event = (s2Ref, emit, eventName, emitName) => {
|
|
15
|
+
const handler = (...params) => {
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
emit(emitName, ...params);
|
|
18
|
+
};
|
|
19
|
+
s2Ref.value?.on(eventName, handler);
|
|
20
|
+
};
|
|
21
|
+
const useEvents = (s2Ref, emit) => {
|
|
22
|
+
(0, vue_1.onMounted)(() => {
|
|
23
|
+
if (!s2Ref.value) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// ============== Row Cell ====================
|
|
27
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.ROW_CELL_HOVER, 'rowCellHover');
|
|
28
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.ROW_CELL_CLICK, 'rowCellClick');
|
|
29
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.ROW_CELL_DOUBLE_CLICK, 'rowCellDoubleClick');
|
|
30
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.ROW_CELL_CONTEXT_MENU, 'rowCellContextMenu');
|
|
31
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.ROW_CELL_MOUSE_DOWN, 'rowCellMouseDown');
|
|
32
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.ROW_CELL_MOUSE_UP, 'rowCellMouseUp');
|
|
33
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.ROW_CELL_MOUSE_MOVE, 'rowCellMouseMove');
|
|
34
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.ROW_CELL_COLLAPSED, 'rowCellCollapsed');
|
|
35
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.ROW_CELL_ALL_COLLAPSED, 'rowCellAllCollapsed');
|
|
36
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.ROW_CELL_SCROLL, 'rowCellScroll');
|
|
37
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.ROW_CELL_RENDER, 'rowCellRender');
|
|
38
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.ROW_CELL_SELECTED, 'rowCellSelected');
|
|
39
|
+
// ============== Col Cell ====================
|
|
40
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.COL_CELL_HOVER, 'colCellHover');
|
|
41
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.COL_CELL_CLICK, 'colCellClick');
|
|
42
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.COL_CELL_DOUBLE_CLICK, 'colCellDoubleClick');
|
|
43
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.COL_CELL_CONTEXT_MENU, 'colCellContextMenu');
|
|
44
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.COL_CELL_MOUSE_DOWN, 'colCellMouseDown');
|
|
45
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.COL_CELL_MOUSE_UP, 'colCellMouseUp');
|
|
46
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.COL_CELL_MOUSE_MOVE, 'colCellMouseMove');
|
|
47
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.COL_CELL_EXPANDED, 'colCellExpanded');
|
|
48
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.COL_CELL_HIDDEN, 'colCellHidden');
|
|
49
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.COL_CELL_RENDER, 'colCellRender');
|
|
50
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.COL_CELL_SELECTED, 'colCellSelected');
|
|
51
|
+
// ============== Data Cell ====================
|
|
52
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.DATA_CELL_HOVER, 'dataCellHover');
|
|
53
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.DATA_CELL_CLICK, 'dataCellClick');
|
|
54
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.DATA_CELL_DOUBLE_CLICK, 'dataCellDoubleClick');
|
|
55
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.DATA_CELL_CONTEXT_MENU, 'dataCellContextMenu');
|
|
56
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.DATA_CELL_MOUSE_DOWN, 'dataCellMouseDown');
|
|
57
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.DATA_CELL_MOUSE_UP, 'dataCellMouseUp');
|
|
58
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.DATA_CELL_MOUSE_MOVE, 'dataCellMouseMove');
|
|
59
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.DATA_CELL_BRUSH_SELECTION, 'dataCellBrushSelection');
|
|
60
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.DATA_CELL_SELECT_MOVE, 'dataCellSelectMove');
|
|
61
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.DATA_CELL_RENDER, 'dataCellRender');
|
|
62
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.DATA_CELL_SELECTED, 'dataCellSelected');
|
|
63
|
+
// ============== Corner Cell ====================
|
|
64
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.CORNER_CELL_HOVER, 'cornerCellHover');
|
|
65
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.CORNER_CELL_CLICK, 'cornerCellClick');
|
|
66
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.CORNER_CELL_DOUBLE_CLICK, 'cornerCellDoubleClick');
|
|
67
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.CORNER_CELL_CONTEXT_MENU, 'cornerCellContextMenu');
|
|
68
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.CORNER_CELL_MOUSE_DOWN, 'cornerCellMouseDown');
|
|
69
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.CORNER_CELL_MOUSE_UP, 'cornerCellMouseUp');
|
|
70
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.CORNER_CELL_MOUSE_MOVE, 'cornerCellMouseMove');
|
|
71
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.CORNER_CELL_RENDER, 'cornerCellRender');
|
|
72
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.CORNER_CELL_SELECTED, 'cornerCellSelected');
|
|
73
|
+
// ============== Merged Cells ====================
|
|
74
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.MERGED_CELLS_HOVER, 'mergedCellsHover');
|
|
75
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.MERGED_CELLS_CLICK, 'mergedCellsClick');
|
|
76
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.MERGED_CELLS_DOUBLE_CLICK, 'mergedCellsDoubleClick');
|
|
77
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.MERGED_CELLS_CONTEXT_MENU, 'mergedCellsContextMenu');
|
|
78
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.MERGED_CELLS_MOUSE_DOWN, 'mergedCellsMouseDown');
|
|
79
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.MERGED_CELLS_MOUSE_UP, 'mergedCellsMouseUp');
|
|
80
|
+
useCellEvent(s2Ref, emit, s2_1.S2Event.MERGED_CELLS_MOUSE_MOVE, 'mergedCellsMouseMove');
|
|
81
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.MERGED_CELLS_RENDER, 'mergedCellsRender');
|
|
82
|
+
/** ================ SeriesNumber Cell ================ */
|
|
83
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.SERIES_NUMBER_CELL_RENDER, 'seriesNumberCellRender');
|
|
84
|
+
// ============== Sort ====================
|
|
85
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.RANGE_SORT, 'rangeSort');
|
|
86
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.RANGE_SORTED, 'rangeSorted');
|
|
87
|
+
// ============== Filter ====================
|
|
88
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.RANGE_FILTER, 'rangeFilter');
|
|
89
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.RANGE_FILTERED, 'rangeFiltered');
|
|
90
|
+
// ============== Layout ====================
|
|
91
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_AFTER_HEADER_LAYOUT, 'layoutAfterHeaderLayout');
|
|
92
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_PAGINATION, 'layoutPagination');
|
|
93
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_BEFORE_RENDER, 'beforeRender');
|
|
94
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_AFTER_RENDER, 'afterRender');
|
|
95
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_DESTROY, 'destroy');
|
|
96
|
+
// ============== Resize ====================
|
|
97
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE, 'layoutResize');
|
|
98
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE_SERIES_WIDTH, 'layoutResizeSeriesWidth');
|
|
99
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE_ROW_WIDTH, 'layoutResizeRowWidth');
|
|
100
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE_ROW_HEIGHT, 'layoutResizeRowHeight');
|
|
101
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE_COL_WIDTH, 'layoutResizeColWidth');
|
|
102
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE_COL_HEIGHT, 'layoutResizeColHeight');
|
|
103
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE_TREE_WIDTH, 'layoutResizeTreeWidth');
|
|
104
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE_MOUSE_DOWN, 'layoutResizeMouseDown');
|
|
105
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE_MOUSE_UP, 'layoutResizeMouseUp');
|
|
106
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_RESIZE_MOUSE_MOVE, 'layoutResizeMouseMove');
|
|
107
|
+
// ============== Global ====================
|
|
108
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_KEYBOARD_DOWN, 'keyBoardDown');
|
|
109
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_KEYBOARD_UP, 'keyBoardUp');
|
|
110
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_COPIED, 'copied');
|
|
111
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_ACTION_ICON_HOVER, 'actionIconHover');
|
|
112
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_ACTION_ICON_CLICK, 'actionIconClick');
|
|
113
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_CONTEXT_MENU, 'contextMenu');
|
|
114
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_HOVER, 'mouseHover');
|
|
115
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_CLICK, 'click');
|
|
116
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_DOUBLE_CLICK, 'doubleClick');
|
|
117
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_SELECTED, 'selected');
|
|
118
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_MOUSE_UP, 'mouseUp');
|
|
119
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_RESET, 'reset');
|
|
120
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_LINK_FIELD_JUMP, 'linkFieldJump');
|
|
121
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.GLOBAL_SCROLL, 'scroll');
|
|
122
|
+
// ============== Auto 自动生成的 ================
|
|
123
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDER, 'layoutAfterRealDataCellRender');
|
|
124
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.ROW_CELL_BRUSH_SELECTION, 'rowCellBrushSelection');
|
|
125
|
+
useS2Event(s2Ref, emit, s2_1.S2Event.COL_CELL_BRUSH_SELECTION, 'colCellBrushSelection');
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
exports.useEvents = useEvents;
|
|
129
|
+
//# sourceMappingURL=useEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEvents.js","sourceRoot":"","sources":["../../src/hooks/useEvents.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC3C,iCAA8E;AAC9E,6BAA0C;AAG1C,MAAM,YAAY,GAAG,CACnB,KAAmC,EACnC,IAAgC,EAChC,SAAkB,EAClB,QAAkC,EAClC,EAAE;IACF,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;QAChC,MAAM,KAAK,GAAG,IAAA,oBAAe,EAAC,KAAK,CAAC,CAAC;QAErC,IAAI,CAAC,QAAe,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC;IAE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mBAAmB,EAAE,aAAa,CAAC,CAAC;QACpE,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,YAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAC5D,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,YAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACvD,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,YAAO,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;QACpE,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,YAAO,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC7D,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,YAAO,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;QAC5D,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,YAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACvD,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,YAAO,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC;QACzE,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,YAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAEzD,6CAA6C;QAC7C,UAAU,CACR,KAAK,EACL,IAAI,EACJ,YAAO,CAAC,kCAAkC,EAC1C,+BAA+B,CAChC,CAAC;QACF,UAAU,CACR,KAAK,EACL,IAAI,EACJ,YAAO,CAAC,wBAAwB,EAChC,uBAAuB,CACxB,CAAC;QACF,UAAU,CACR,KAAK,EACL,IAAI,EACJ,YAAO,CAAC,wBAAwB,EAChC,uBAAuB,CACxB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAlTW,QAAA,SAAS,aAkTpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExpose = void 0;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
const useExpose = (expose) => {
|
|
6
|
+
const s2Ref = (0, vue_1.shallowRef)();
|
|
7
|
+
expose({
|
|
8
|
+
get instance() {
|
|
9
|
+
return s2Ref.value?.instance;
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
return s2Ref;
|
|
13
|
+
};
|
|
14
|
+
exports.useExpose = useExpose;
|
|
15
|
+
//# sourceMappingURL=useExpose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useExpose.js","sourceRoot":"","sources":["../../src/hooks/useExpose.ts"],"names":[],"mappings":";;;AACA,6BAAiC;AAM1B,MAAM,SAAS,GAAG,CAAC,MAA+C,EAAE,EAAE;IAC3E,MAAM,KAAK,GAAG,IAAA,gBAAU,GAAe,CAAC;IAExC,MAAM,CAAC;QACL,IAAI,QAAQ;YACV,OAAO,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC;QAC/B,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAVW,QAAA,SAAS,aAUpB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type SpreadSheet } from '@antv/s2';
|
|
2
|
+
import { type ShallowRef } from 'vue';
|
|
3
|
+
export declare const useLoading: (s2Ref: ShallowRef<SpreadSheet | undefined>, loadingProp?: boolean) => {
|
|
4
|
+
loading: import("vue").Ref<boolean>;
|
|
5
|
+
setLoading: (updated: boolean) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLoading = void 0;
|
|
4
|
+
const s2_1 = require("@antv/s2");
|
|
5
|
+
const vue_1 = require("vue");
|
|
6
|
+
const useLoading = (s2Ref, loadingProp = false) => {
|
|
7
|
+
const loading = (0, vue_1.ref)(loadingProp);
|
|
8
|
+
const setLoading = (updated) => {
|
|
9
|
+
loading.value = updated;
|
|
10
|
+
};
|
|
11
|
+
(0, vue_1.watch)(s2Ref, (s2) => {
|
|
12
|
+
s2?.on(s2_1.S2Event.LAYOUT_BEFORE_RENDER, () => {
|
|
13
|
+
setLoading(true);
|
|
14
|
+
});
|
|
15
|
+
s2?.on(s2_1.S2Event.LAYOUT_AFTER_RENDER, () => {
|
|
16
|
+
setLoading(false);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
return { loading, setLoading };
|
|
20
|
+
};
|
|
21
|
+
exports.useLoading = useLoading;
|
|
22
|
+
//# sourceMappingURL=useLoading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLoading.js","sourceRoot":"","sources":["../../src/hooks/useLoading.ts"],"names":[],"mappings":";;;AAAA,iCAAqD;AACrD,6BAAkD;AAE3C,MAAM,UAAU,GAAG,CACxB,KAA0C,EAC1C,WAAW,GAAG,KAAK,EACnB,EAAE;IACF,MAAM,OAAO,GAAG,IAAA,SAAG,EAAU,WAAW,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,CAAC,OAAgB,EAAE,EAAE;QACtC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC;IAC1B,CAAC,CAAC;IAEF,IAAA,WAAK,EAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;QAClB,EAAE,EAAE,EAAE,CAAC,YAAO,CAAC,oBAAoB,EAAE,GAAG,EAAE;YACxC,UAAU,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,EAAE,EAAE,EAAE,CAAC,YAAO,CAAC,mBAAmB,EAAE,GAAG,EAAE;YACvC,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACjC,CAAC,CAAC;AApBW,QAAA,UAAU,cAoBrB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type Pagination, type SpreadSheet } from '@antv/s2';
|
|
2
|
+
import { type Ref } from 'vue';
|
|
3
|
+
import type { BaseSheetProps } from '../utils/initPropAndEmits';
|
|
4
|
+
export declare const DEFAULT_PAGE_NUMBER = 1;
|
|
5
|
+
export declare const DEFAULT_PAGE_SIZE = 10;
|
|
6
|
+
export declare const usePagination: (s2Ref: Ref<SpreadSheet | undefined>, props: BaseSheetProps) => {
|
|
7
|
+
customOptions: import("lodash").Omit<Pagination & Partial<import("vue").ExtractPropTypes<{
|
|
8
|
+
total: NumberConstructor;
|
|
9
|
+
defaultCurrent: NumberConstructor;
|
|
10
|
+
disabled: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: any;
|
|
13
|
+
};
|
|
14
|
+
current: NumberConstructor;
|
|
15
|
+
defaultPageSize: NumberConstructor;
|
|
16
|
+
pageSize: NumberConstructor;
|
|
17
|
+
hideOnSinglePage: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: any;
|
|
20
|
+
};
|
|
21
|
+
showSizeChanger: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: any;
|
|
24
|
+
};
|
|
25
|
+
pageSizeOptions: import("vue").PropType<(string | number)[]>;
|
|
26
|
+
buildOptionText: import("vue").PropType<(opt: {
|
|
27
|
+
value: any;
|
|
28
|
+
}) => any>;
|
|
29
|
+
showQuickJumper: {
|
|
30
|
+
type: import("vue").PropType<boolean | {
|
|
31
|
+
goButton?: any;
|
|
32
|
+
}>;
|
|
33
|
+
default: boolean | {
|
|
34
|
+
goButton?: any;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
showTotal: import("vue").PropType<(total: number, range: [number, number]) => any>;
|
|
38
|
+
size: import("vue").PropType<"small" | "default">;
|
|
39
|
+
simple: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: any;
|
|
42
|
+
};
|
|
43
|
+
locale: ObjectConstructor;
|
|
44
|
+
prefixCls: StringConstructor;
|
|
45
|
+
selectPrefixCls: StringConstructor;
|
|
46
|
+
totalBoundaryShowSizeChanger: NumberConstructor;
|
|
47
|
+
selectComponentClass: StringConstructor;
|
|
48
|
+
itemRender: import("vue").PropType<(opt: {
|
|
49
|
+
page: number;
|
|
50
|
+
type: "page" | "prev" | "next" | "jump-prev" | "jump-next";
|
|
51
|
+
originalElement: any;
|
|
52
|
+
}) => any>;
|
|
53
|
+
role: StringConstructor;
|
|
54
|
+
responsive: BooleanConstructor;
|
|
55
|
+
showLessItems: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
default: any;
|
|
58
|
+
};
|
|
59
|
+
onChange: import("vue").PropType<(page: number, pageSize: number) => void>;
|
|
60
|
+
onShowSizeChange: import("vue").PropType<(current: number, size: number) => void>;
|
|
61
|
+
'onUpdate:current': import("vue").PropType<(current: number) => void>;
|
|
62
|
+
'onUpdate:pageSize': import("vue").PropType<(size: number) => void>;
|
|
63
|
+
}>>, "total" | "current" | "pageSize">;
|
|
64
|
+
visible: import("vue").ComputedRef<boolean>;
|
|
65
|
+
current: Ref<number>;
|
|
66
|
+
pageSize: Ref<number>;
|
|
67
|
+
total: Ref<number>;
|
|
68
|
+
change: (nextCurrent: number) => void;
|
|
69
|
+
showSizeChange: (nextPageSize: number) => void;
|
|
70
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePagination = exports.DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE_NUMBER = void 0;
|
|
4
|
+
const s2_1 = require("@antv/s2");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const vue_1 = require("vue");
|
|
7
|
+
exports.DEFAULT_PAGE_NUMBER = 1;
|
|
8
|
+
exports.DEFAULT_PAGE_SIZE = 10;
|
|
9
|
+
const usePagination = (s2Ref, props) => {
|
|
10
|
+
const { options: { pagination: paginationCfg }, showPagination, } = props;
|
|
11
|
+
const current = (0, vue_1.ref)(paginationCfg?.current ?? exports.DEFAULT_PAGE_NUMBER);
|
|
12
|
+
const pageSize = (0, vue_1.ref)(paginationCfg?.pageSize ?? exports.DEFAULT_PAGE_SIZE);
|
|
13
|
+
const total = (0, vue_1.ref)(0);
|
|
14
|
+
const change = (nextCurrent) => {
|
|
15
|
+
current.value = nextCurrent;
|
|
16
|
+
};
|
|
17
|
+
const showSizeChange = (nextPageSize) => {
|
|
18
|
+
pageSize.value = nextPageSize;
|
|
19
|
+
};
|
|
20
|
+
const visible = (0, vue_1.computed)(() => {
|
|
21
|
+
return showPagination && !(0, lodash_1.isEmpty)(paginationCfg);
|
|
22
|
+
});
|
|
23
|
+
// sync state.pagination -> s2.pagination
|
|
24
|
+
(0, vue_1.watch)([current, pageSize], async () => {
|
|
25
|
+
if (!s2Ref.value) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const nextPagination = (0, lodash_1.isEmpty)(paginationCfg)
|
|
29
|
+
? null
|
|
30
|
+
: {
|
|
31
|
+
current: current.value,
|
|
32
|
+
pageSize: pageSize.value,
|
|
33
|
+
};
|
|
34
|
+
s2Ref.value.updatePagination(nextPagination);
|
|
35
|
+
await s2Ref.value.render(false);
|
|
36
|
+
});
|
|
37
|
+
// sync props.pagination -> state.pagination
|
|
38
|
+
(0, vue_1.watch)([() => paginationCfg, s2Ref], () => {
|
|
39
|
+
current.value = paginationCfg?.current ?? exports.DEFAULT_PAGE_NUMBER;
|
|
40
|
+
pageSize.value = paginationCfg?.pageSize ?? exports.DEFAULT_PAGE_SIZE;
|
|
41
|
+
total.value = s2Ref.value?.facet?.viewCellHeights.getTotalLength() ?? 0;
|
|
42
|
+
}, {
|
|
43
|
+
immediate: true,
|
|
44
|
+
});
|
|
45
|
+
// sync layout result total -> state.total
|
|
46
|
+
(0, vue_1.watch)(s2Ref, (value, oldValue, onCleanup) => {
|
|
47
|
+
if (!s2Ref.value) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const totalUpdateCallback = (data) => {
|
|
51
|
+
if ((0, lodash_1.isEmpty)(paginationCfg)) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
total.value = data.total;
|
|
55
|
+
};
|
|
56
|
+
s2Ref.value.on(s2_1.S2Event.LAYOUT_PAGINATION, totalUpdateCallback);
|
|
57
|
+
onCleanup(() => {
|
|
58
|
+
s2Ref.value?.off(s2_1.S2Event.LAYOUT_PAGINATION, totalUpdateCallback);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
customOptions: (0, lodash_1.omit)(paginationCfg, ['current', 'pageSize', 'total']),
|
|
63
|
+
visible,
|
|
64
|
+
current,
|
|
65
|
+
pageSize,
|
|
66
|
+
total,
|
|
67
|
+
change,
|
|
68
|
+
showSizeChange,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
exports.usePagination = usePagination;
|
|
72
|
+
//# sourceMappingURL=usePagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePagination.js","sourceRoot":"","sources":["../../src/hooks/usePagination.ts"],"names":[],"mappings":";;;AAAA,iCAKkB;AAClB,mCAAuC;AACvC,6BAAqD;AAGxC,QAAA,mBAAmB,GAAG,CAAC,CAAC;AACxB,QAAA,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,aAAa,GAAG,CAC3B,KAAmC,EACnC,KAAqB,EACrB,EAAE;IACF,MAAM,EACJ,OAAO,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,EACtC,cAAc,GACf,GAAG,KAAK,CAAC;IACV,MAAM,OAAO,GAAG,IAAA,SAAG,EAAC,aAAa,EAAE,OAAO,IAAI,2BAAmB,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,IAAA,SAAG,EAAC,aAAa,EAAE,QAAQ,IAAI,yBAAiB,CAAC,CAAC;IACnE,MAAM,KAAK,GAAG,IAAA,SAAG,EAAC,CAAC,CAAC,CAAC;IAErB,MAAM,MAAM,GAAG,CAAC,WAAmB,EAAE,EAAE;QACrC,OAA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EF,0CAA0C;IAC1C,IAAA,WAAK,EAAC,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;QAC1C,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,MAAM,mBAAmB,GAA2C,CAClE,IAAI,EACJ,EAAE;YACF,IAAI,IAAA,gBAAO,EAAC,aAAa,CAAC,EAAE,CAAC;gBAC3B,OAAO;YACT,CAAC;YAED,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,CAAC,CAAC;QAEF,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,YAAO,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;QAE/D,SAAS,CAAC,GAAG,EAAE;YACb,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,YAAO,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,aAAa,EAAE,IAAA,aAAI,EAAC,aAAa,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACpE,OAAO;QACP,OAAO;QACP,QAAQ;QACR,KAAK;QACL,MAAM;QACN,cAAc;KACf,CAAC;AACJ,CAAC,CAAC;AAtFW,QAAA,aAAa,iBAsFxB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SpreadSheet } from '@antv/s2';
|
|
2
|
+
import { type Ref } from 'vue';
|
|
3
|
+
import type { BaseSheetProps } from '../utils/initPropAndEmits';
|
|
4
|
+
export declare const useResize: (s2Ref: Ref<SpreadSheet | undefined>, props: BaseSheetProps, dom: {
|
|
5
|
+
wrapperRef: Ref<HTMLDivElement | undefined>;
|
|
6
|
+
containerRef: Ref<HTMLDivElement | undefined>;
|
|
7
|
+
}) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useResize = void 0;
|
|
4
|
+
const s2_1 = require("@antv/s2");
|
|
5
|
+
const vue_1 = require("vue");
|
|
6
|
+
const useResize = (s2Ref, props, dom) => {
|
|
7
|
+
const unobserve = (0, vue_1.ref)();
|
|
8
|
+
(0, vue_1.watch)([s2Ref, () => props.adaptive], ([s2, adaptive], _, onCleanup) => {
|
|
9
|
+
if (!s2) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
unobserve.value = (0, s2_1.createResizeObserver)({
|
|
13
|
+
s2,
|
|
14
|
+
adaptive,
|
|
15
|
+
wrapper: dom.wrapperRef.value,
|
|
16
|
+
container: dom.containerRef.value,
|
|
17
|
+
});
|
|
18
|
+
onCleanup(() => {
|
|
19
|
+
unobserve.value?.();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
exports.useResize = useResize;
|
|
24
|
+
//# sourceMappingURL=useResize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResize.js","sourceRoot":"","sources":["../../src/hooks/useResize.ts"],"names":[],"mappings":";;;AACA,iCAAgD;AAChD,6BAA2C;AAGpC,MAAM,SAAS,GAAG,CACvB,KAAmC,EACnC,KAAqB,EACrB,GAGC,EACD,EAAE;IACF,MAAM,SAAS,GAAG,IAAA,SAAG,GAAc,CAAC;IAEpC,IAAA,WAAK,EAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE;QACpE,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,OAAO;QACT,CAAC;QAED,SAAS,CAAC,KAAK,GAAG,IAAA,yBAAoB,EAAC;YACrC,EAAE;YACF,QAAQ;YACR,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,KAAM;YAC9B,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,KAAM;SACnC,CAAC,CAAC;QAEH,SAAS,CAAC,GAAG,EAAE;YACb,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA1BW,QAAA,SAAS,aA0BpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SpreadSheet } from '@antv/s2';
|
|
2
|
+
import { type ShallowRef } from 'vue';
|
|
3
|
+
import type { BaseSheetProps } from '../utils/initPropAndEmits';
|
|
4
|
+
/**
|
|
5
|
+
* props 会将所有属性用 shallowReactive 包裹起来:
|
|
6
|
+
* 1. 如果是对 dataCfg 或者 options 直接替换, 那么只需要简单的通过 ()=> props.dataCfg 这种 getter 就能监听到
|
|
7
|
+
* 2. 如果 dataCfg 任然是 reactive 数据,那么就存在直接修改了其中某一个属性的情况,这个时候就需要对所有的属性遍历来关联 watch 属性
|
|
8
|
+
* ? 如果数量特别多时,遍历可能存在性能问题,先暂时观察一下
|
|
9
|
+
*/
|
|
10
|
+
export declare const useSheetUpdate: (s2Ref: ShallowRef<SpreadSheet | undefined>, props: BaseSheetProps, hooks?: {
|
|
11
|
+
before?: () => void;
|
|
12
|
+
after: () => void;
|
|
13
|
+
}) => void;
|