@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.
Files changed (221) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -8
  3. package/dist/s2-vue.min.css +1 -0
  4. package/dist/s2-vue.min.js +28 -0
  5. package/dist/s2-vue.min.js.map +1 -0
  6. package/esm/common/constant/index.d.ts +1 -0
  7. package/esm/common/constant/index.js +2 -0
  8. package/esm/common/constant/index.js.map +1 -0
  9. package/esm/common/constant/options.d.ts +2 -0
  10. package/esm/common/constant/options.js +7 -0
  11. package/esm/common/constant/options.js.map +1 -0
  12. package/esm/components/drill-down/index.vue.d.ts +126 -0
  13. package/esm/components/drill-down/index.vue.js +206 -0
  14. package/esm/components/drill-down/index.vue.js.map +1 -0
  15. package/esm/components/index.d.ts +6 -0
  16. package/esm/components/index.js +8 -0
  17. package/esm/components/index.js.map +1 -0
  18. package/esm/components/pagination/index.vue.d.ts +44 -0
  19. package/esm/components/pagination/index.vue.js +91 -0
  20. package/esm/components/pagination/index.vue.js.map +1 -0
  21. package/esm/components/sheets/base-sheet.vue.d.ts +391 -0
  22. package/esm/components/sheets/base-sheet.vue.js +119 -0
  23. package/esm/components/sheets/base-sheet.vue.js.map +1 -0
  24. package/esm/components/sheets/editable-sheet.vue.d.ts +2 -0
  25. package/esm/components/sheets/editable-sheet.vue.js +181 -0
  26. package/esm/components/sheets/editable-sheet.vue.js.map +1 -0
  27. package/esm/components/sheets/index.vue.d.ts +251 -0
  28. package/esm/components/sheets/index.vue.js +77 -0
  29. package/esm/components/sheets/index.vue.js.map +1 -0
  30. package/esm/components/sheets/pivot-sheet.vue.d.ts +322 -0
  31. package/esm/components/sheets/pivot-sheet.vue.js +117 -0
  32. package/esm/components/sheets/pivot-sheet.vue.js.map +1 -0
  33. package/esm/components/sheets/table-sheet.vue.d.ts +250 -0
  34. package/esm/components/sheets/table-sheet.vue.js +61 -0
  35. package/esm/components/sheets/table-sheet.vue.js.map +1 -0
  36. package/esm/components/tooltip/components/detail.vue.d.ts +6 -0
  37. package/esm/components/tooltip/components/detail.vue.js +53 -0
  38. package/esm/components/tooltip/components/detail.vue.js.map +1 -0
  39. package/esm/components/tooltip/components/head-info.vue.d.ts +6 -0
  40. package/esm/components/tooltip/components/head-info.vue.js +61 -0
  41. package/esm/components/tooltip/components/head-info.vue.js.map +1 -0
  42. package/esm/components/tooltip/components/infos.vue.d.ts +6 -0
  43. package/esm/components/tooltip/components/infos.vue.js +49 -0
  44. package/esm/components/tooltip/components/infos.vue.js.map +1 -0
  45. package/esm/components/tooltip/components/operator/index.d.ts +3 -0
  46. package/esm/components/tooltip/components/operator/index.js +4 -0
  47. package/esm/components/tooltip/components/operator/index.js.map +1 -0
  48. package/esm/components/tooltip/components/operator/index.vue.d.ts +14 -0
  49. package/esm/components/tooltip/components/operator/index.vue.js +149 -0
  50. package/esm/components/tooltip/components/operator/index.vue.js.map +1 -0
  51. package/esm/components/tooltip/components/operator/menu.vue.d.ts +21 -0
  52. package/esm/components/tooltip/components/operator/menu.vue.js +146 -0
  53. package/esm/components/tooltip/components/operator/menu.vue.js.map +1 -0
  54. package/esm/components/tooltip/components/operator/title.vue.d.ts +10 -0
  55. package/esm/components/tooltip/components/operator/title.vue.js +54 -0
  56. package/esm/components/tooltip/components/operator/title.vue.js.map +1 -0
  57. package/esm/components/tooltip/components/simple-tips.vue.d.ts +6 -0
  58. package/esm/components/tooltip/components/simple-tips.vue.js +55 -0
  59. package/esm/components/tooltip/components/simple-tips.vue.js.map +1 -0
  60. package/esm/components/tooltip/components/summary.vue.d.ts +11 -0
  61. package/esm/components/tooltip/components/summary.vue.js +71 -0
  62. package/esm/components/tooltip/components/summary.vue.js.map +1 -0
  63. package/esm/components/tooltip/custom-tooltip.d.ts +6 -0
  64. package/esm/components/tooltip/custom-tooltip.js +36 -0
  65. package/esm/components/tooltip/custom-tooltip.js.map +1 -0
  66. package/esm/components/tooltip/index.vue.d.ts +13 -0
  67. package/esm/components/tooltip/index.vue.js +124 -0
  68. package/esm/components/tooltip/index.vue.js.map +1 -0
  69. package/esm/components/tooltip/interface.d.ts +8 -0
  70. package/esm/components/tooltip/interface.js +2 -0
  71. package/esm/components/tooltip/interface.js.map +1 -0
  72. package/esm/hooks/useEvents.d.ts +4 -0
  73. package/esm/hooks/useEvents.js +125 -0
  74. package/esm/hooks/useEvents.js.map +1 -0
  75. package/esm/hooks/useExpose.d.ts +5 -0
  76. package/esm/hooks/useExpose.js +11 -0
  77. package/esm/hooks/useExpose.js.map +1 -0
  78. package/esm/hooks/useLoading.d.ts +6 -0
  79. package/esm/hooks/useLoading.js +18 -0
  80. package/esm/hooks/useLoading.js.map +1 -0
  81. package/esm/hooks/usePagination.d.ts +70 -0
  82. package/esm/hooks/usePagination.js +68 -0
  83. package/esm/hooks/usePagination.js.map +1 -0
  84. package/esm/hooks/useResize.d.ts +7 -0
  85. package/esm/hooks/useResize.js +20 -0
  86. package/esm/hooks/useResize.js.map +1 -0
  87. package/esm/hooks/useSheetUpdate.d.ts +13 -0
  88. package/esm/hooks/useSheetUpdate.js +56 -0
  89. package/esm/hooks/useSheetUpdate.js.map +1 -0
  90. package/esm/hooks/useSpreadSheet.d.ts +75 -0
  91. package/esm/hooks/useSpreadSheet.js +60 -0
  92. package/esm/hooks/useSpreadSheet.js.map +1 -0
  93. package/esm/index.d.ts +4 -6068
  94. package/esm/index.js +5 -3363
  95. package/esm/index.js.map +1 -1
  96. package/esm/interface.d.ts +47 -0
  97. package/esm/interface.js +2 -0
  98. package/esm/interface.js.map +1 -0
  99. package/esm/svg/calendar-icon.svg +13 -0
  100. package/esm/svg/location-icon.svg +13 -0
  101. package/esm/svg/text-icon.svg +13 -0
  102. package/esm/utils/extendLocale.d.ts +1 -0
  103. package/esm/utils/extendLocale.js +3 -0
  104. package/esm/utils/extendLocale.js.map +1 -0
  105. package/esm/utils/initPropAndEmits.d.ts +204 -0
  106. package/esm/utils/initPropAndEmits.js +158 -0
  107. package/esm/utils/initPropAndEmits.js.map +1 -0
  108. package/esm/utils/options.d.ts +2 -0
  109. package/esm/utils/options.js +4 -0
  110. package/esm/utils/options.js.map +1 -0
  111. package/lib/common/constant/index.d.ts +1 -0
  112. package/lib/common/constant/index.js +5 -0
  113. package/lib/common/constant/index.js.map +1 -0
  114. package/lib/common/constant/options.d.ts +2 -0
  115. package/lib/common/constant/options.js +10 -0
  116. package/lib/common/constant/options.js.map +1 -0
  117. package/lib/components/drill-down/index.vue.d.ts +126 -0
  118. package/lib/components/drill-down/index.vue.js +209 -0
  119. package/lib/components/drill-down/index.vue.js.map +1 -0
  120. package/lib/components/index.d.ts +6 -0
  121. package/lib/components/index.js +20 -0
  122. package/lib/components/index.js.map +1 -0
  123. package/lib/components/pagination/index.vue.d.ts +44 -0
  124. package/lib/components/pagination/index.vue.js +93 -0
  125. package/lib/components/pagination/index.vue.js.map +1 -0
  126. package/lib/components/sheets/base-sheet.vue.d.ts +391 -0
  127. package/lib/components/sheets/base-sheet.vue.js +122 -0
  128. package/lib/components/sheets/base-sheet.vue.js.map +1 -0
  129. package/lib/components/sheets/editable-sheet.vue.d.ts +2 -0
  130. package/lib/components/sheets/editable-sheet.vue.js +184 -0
  131. package/lib/components/sheets/editable-sheet.vue.js.map +1 -0
  132. package/lib/components/sheets/index.vue.d.ts +251 -0
  133. package/lib/components/sheets/index.vue.js +80 -0
  134. package/lib/components/sheets/index.vue.js.map +1 -0
  135. package/lib/components/sheets/pivot-sheet.vue.d.ts +322 -0
  136. package/lib/components/sheets/pivot-sheet.vue.js +120 -0
  137. package/lib/components/sheets/pivot-sheet.vue.js.map +1 -0
  138. package/lib/components/sheets/table-sheet.vue.d.ts +250 -0
  139. package/lib/components/sheets/table-sheet.vue.js +64 -0
  140. package/lib/components/sheets/table-sheet.vue.js.map +1 -0
  141. package/lib/components/tooltip/components/detail.vue.d.ts +6 -0
  142. package/lib/components/tooltip/components/detail.vue.js +55 -0
  143. package/lib/components/tooltip/components/detail.vue.js.map +1 -0
  144. package/lib/components/tooltip/components/head-info.vue.d.ts +6 -0
  145. package/lib/components/tooltip/components/head-info.vue.js +63 -0
  146. package/lib/components/tooltip/components/head-info.vue.js.map +1 -0
  147. package/lib/components/tooltip/components/infos.vue.d.ts +6 -0
  148. package/lib/components/tooltip/components/infos.vue.js +51 -0
  149. package/lib/components/tooltip/components/infos.vue.js.map +1 -0
  150. package/lib/components/tooltip/components/operator/index.d.ts +3 -0
  151. package/lib/components/tooltip/components/operator/index.js +13 -0
  152. package/lib/components/tooltip/components/operator/index.js.map +1 -0
  153. package/lib/components/tooltip/components/operator/index.vue.d.ts +14 -0
  154. package/lib/components/tooltip/components/operator/index.vue.js +152 -0
  155. package/lib/components/tooltip/components/operator/index.vue.js.map +1 -0
  156. package/lib/components/tooltip/components/operator/menu.vue.d.ts +21 -0
  157. package/lib/components/tooltip/components/operator/menu.vue.js +149 -0
  158. package/lib/components/tooltip/components/operator/menu.vue.js.map +1 -0
  159. package/lib/components/tooltip/components/operator/title.vue.d.ts +10 -0
  160. package/lib/components/tooltip/components/operator/title.vue.js +56 -0
  161. package/lib/components/tooltip/components/operator/title.vue.js.map +1 -0
  162. package/lib/components/tooltip/components/simple-tips.vue.d.ts +6 -0
  163. package/lib/components/tooltip/components/simple-tips.vue.js +57 -0
  164. package/lib/components/tooltip/components/simple-tips.vue.js.map +1 -0
  165. package/lib/components/tooltip/components/summary.vue.d.ts +11 -0
  166. package/lib/components/tooltip/components/summary.vue.js +73 -0
  167. package/lib/components/tooltip/components/summary.vue.js.map +1 -0
  168. package/lib/components/tooltip/custom-tooltip.d.ts +6 -0
  169. package/lib/components/tooltip/custom-tooltip.js +41 -0
  170. package/lib/components/tooltip/custom-tooltip.js.map +1 -0
  171. package/lib/components/tooltip/index.vue.d.ts +13 -0
  172. package/lib/components/tooltip/index.vue.js +127 -0
  173. package/lib/components/tooltip/index.vue.js.map +1 -0
  174. package/lib/components/tooltip/interface.d.ts +8 -0
  175. package/lib/components/tooltip/interface.js +3 -0
  176. package/lib/components/tooltip/interface.js.map +1 -0
  177. package/lib/hooks/useEvents.d.ts +4 -0
  178. package/lib/hooks/useEvents.js +129 -0
  179. package/lib/hooks/useEvents.js.map +1 -0
  180. package/lib/hooks/useExpose.d.ts +5 -0
  181. package/lib/hooks/useExpose.js +15 -0
  182. package/lib/hooks/useExpose.js.map +1 -0
  183. package/lib/hooks/useLoading.d.ts +6 -0
  184. package/lib/hooks/useLoading.js +22 -0
  185. package/lib/hooks/useLoading.js.map +1 -0
  186. package/lib/hooks/usePagination.d.ts +70 -0
  187. package/lib/hooks/usePagination.js +72 -0
  188. package/lib/hooks/usePagination.js.map +1 -0
  189. package/lib/hooks/useResize.d.ts +7 -0
  190. package/lib/hooks/useResize.js +24 -0
  191. package/lib/hooks/useResize.js.map +1 -0
  192. package/lib/hooks/useSheetUpdate.d.ts +13 -0
  193. package/lib/hooks/useSheetUpdate.js +60 -0
  194. package/lib/hooks/useSheetUpdate.js.map +1 -0
  195. package/lib/hooks/useSpreadSheet.d.ts +75 -0
  196. package/lib/hooks/useSpreadSheet.js +64 -0
  197. package/lib/hooks/useSpreadSheet.js.map +1 -0
  198. package/lib/index.d.ts +4 -0
  199. package/lib/index.js +8 -3362
  200. package/lib/index.js.map +1 -1
  201. package/lib/interface.d.ts +47 -0
  202. package/lib/interface.js +3 -0
  203. package/lib/interface.js.map +1 -0
  204. package/lib/svg/calendar-icon.svg +13 -0
  205. package/lib/svg/location-icon.svg +13 -0
  206. package/lib/svg/text-icon.svg +13 -0
  207. package/lib/utils/extendLocale.d.ts +1 -0
  208. package/lib/utils/extendLocale.js +5 -0
  209. package/lib/utils/extendLocale.js.map +1 -0
  210. package/lib/utils/initPropAndEmits.d.ts +204 -0
  211. package/lib/utils/initPropAndEmits.js +165 -0
  212. package/lib/utils/initPropAndEmits.js.map +1 -0
  213. package/lib/utils/options.d.ts +2 -0
  214. package/lib/utils/options.js +8 -0
  215. package/lib/utils/options.js.map +1 -0
  216. package/package.json +65 -57
  217. package/dist/index.min.js +0 -2
  218. package/dist/index.min.js.map +0 -1
  219. package/dist/style.min.css +0 -1
  220. package/esm/style.css +0 -393
  221. package/lib/style.css +0 -393
@@ -0,0 +1,124 @@
1
+ /// <reference types="../../../node_modules/.vue-global-types/vue_3.4_false.d.ts" />
2
+ import { getTooltipDefaultOptions } from '@antv/s2';
3
+ import { defineComponent } from 'vue';
4
+ import TooltipDetail from './components/detail.vue';
5
+ import TooltipHeadInfo from './components/head-info.vue';
6
+ import TooltipInfos from './components/infos.vue';
7
+ import TooltipSimpleTips from './components/simple-tips.vue';
8
+ import TooltipSummary from './components/summary.vue';
9
+ import { TooltipOperator } from './components/operator';
10
+ export default defineComponent({
11
+ name: 'TooltipComponent',
12
+ props: [
13
+ 'data',
14
+ 'options',
15
+ 'cell',
16
+ 'position',
17
+ 'event',
18
+ 'content',
19
+ ],
20
+ setup(props) {
21
+ const { operator, onlyShowOperator } = getTooltipDefaultOptions(props.options);
22
+ return {
23
+ operator,
24
+ onlyShowOperator,
25
+ };
26
+ },
27
+ components: {
28
+ TooltipDetail,
29
+ TooltipHeadInfo,
30
+ TooltipInfos,
31
+ TooltipSimpleTips,
32
+ TooltipSummary,
33
+ TooltipOperator,
34
+ },
35
+ });
36
+ ; /* PartiallyEnd: #3632/script.vue */
37
+ function __VLS_template() {
38
+ const __VLS_ctx = {};
39
+ const __VLS_localComponents = {
40
+ ...{
41
+ TooltipDetail,
42
+ TooltipHeadInfo,
43
+ TooltipInfos,
44
+ TooltipSimpleTips,
45
+ TooltipSummary,
46
+ TooltipOperator,
47
+ },
48
+ ...{},
49
+ ...{},
50
+ ...__VLS_ctx,
51
+ };
52
+ let __VLS_components;
53
+ const __VLS_localDirectives = {
54
+ ...{},
55
+ ...__VLS_ctx,
56
+ };
57
+ let __VLS_directives;
58
+ let __VLS_styleScopedClasses;
59
+ // CSS variable injection
60
+ // CSS variable injection end
61
+ let __VLS_resolvedLocalAndGlobalComponents;
62
+ if (__VLS_ctx.onlyShowOperator) {
63
+ const __VLS_0 = __VLS_resolvedLocalAndGlobalComponents.TooltipOperator;
64
+ /** @type { [typeof __VLS_components.TooltipOperator, ] } */
65
+ // @ts-ignore
66
+ const __VLS_1 = __VLS_asFunctionalComponent(__VLS_0, new __VLS_0({ menu: ((__VLS_ctx.operator?.menu)), onlyShowOperator: ((true)), cell: ((__VLS_ctx.cell)), }));
67
+ const __VLS_2 = __VLS_1({ menu: ((__VLS_ctx.operator?.menu)), onlyShowOperator: ((true)), cell: ((__VLS_ctx.cell)), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
68
+ }
69
+ else {
70
+ const __VLS_6 = __VLS_resolvedLocalAndGlobalComponents.TooltipOperator;
71
+ /** @type { [typeof __VLS_components.TooltipOperator, ] } */
72
+ // @ts-ignore
73
+ const __VLS_7 = __VLS_asFunctionalComponent(__VLS_6, new __VLS_6({ menu: ((__VLS_ctx.operator?.menu)), onlyShowOperator: ((false)), cell: ((__VLS_ctx.cell)), }));
74
+ const __VLS_8 = __VLS_7({ menu: ((__VLS_ctx.operator?.menu)), onlyShowOperator: ((false)), cell: ((__VLS_ctx.cell)), }, ...__VLS_functionalComponentArgsRest(__VLS_7));
75
+ if (__VLS_ctx.content) {
76
+ var __VLS_12 = {};
77
+ }
78
+ else {
79
+ const __VLS_13 = __VLS_resolvedLocalAndGlobalComponents.TooltipSimpleTips;
80
+ /** @type { [typeof __VLS_components.TooltipSimpleTips, ] } */
81
+ // @ts-ignore
82
+ const __VLS_14 = __VLS_asFunctionalComponent(__VLS_13, new __VLS_13({ name: ((__VLS_ctx.data?.name)), tips: ((__VLS_ctx.data?.tips)), }));
83
+ const __VLS_15 = __VLS_14({ name: ((__VLS_ctx.data?.name)), tips: ((__VLS_ctx.data?.tips)), }, ...__VLS_functionalComponentArgsRest(__VLS_14));
84
+ if (__VLS_ctx.data?.summaries?.length) {
85
+ const __VLS_19 = __VLS_resolvedLocalAndGlobalComponents.TooltipSummary;
86
+ /** @type { [typeof __VLS_components.TooltipSummary, ] } */
87
+ // @ts-ignore
88
+ const __VLS_20 = __VLS_asFunctionalComponent(__VLS_19, new __VLS_19({ summaries: ((__VLS_ctx.data?.summaries)), }));
89
+ const __VLS_21 = __VLS_20({ summaries: ((__VLS_ctx.data?.summaries)), }, ...__VLS_functionalComponentArgsRest(__VLS_20));
90
+ }
91
+ const __VLS_25 = __VLS_resolvedLocalAndGlobalComponents.TooltipHeadInfo;
92
+ /** @type { [typeof __VLS_components.TooltipHeadInfo, ] } */
93
+ // @ts-ignore
94
+ const __VLS_26 = __VLS_asFunctionalComponent(__VLS_25, new __VLS_25({ rows: ((__VLS_ctx.data?.headInfo?.rows || [])), cols: ((__VLS_ctx.data?.headInfo?.cols || [])), }));
95
+ const __VLS_27 = __VLS_26({ rows: ((__VLS_ctx.data?.headInfo?.rows || [])), cols: ((__VLS_ctx.data?.headInfo?.cols || [])), }, ...__VLS_functionalComponentArgsRest(__VLS_26));
96
+ const __VLS_31 = __VLS_resolvedLocalAndGlobalComponents.TooltipDetail;
97
+ /** @type { [typeof __VLS_components.TooltipDetail, ] } */
98
+ // @ts-ignore
99
+ const __VLS_32 = __VLS_asFunctionalComponent(__VLS_31, new __VLS_31({ list: ((__VLS_ctx.data?.details || [])), }));
100
+ const __VLS_33 = __VLS_32({ list: ((__VLS_ctx.data?.details || [])), }, ...__VLS_functionalComponentArgsRest(__VLS_32));
101
+ if (__VLS_ctx.data?.infos) {
102
+ const __VLS_37 = __VLS_resolvedLocalAndGlobalComponents.TooltipInfos;
103
+ /** @type { [typeof __VLS_components.TooltipInfos, ] } */
104
+ // @ts-ignore
105
+ const __VLS_38 = __VLS_asFunctionalComponent(__VLS_37, new __VLS_37({ infos: ((__VLS_ctx.data?.infos)), }));
106
+ const __VLS_39 = __VLS_38({ infos: ((__VLS_ctx.data?.infos)), }, ...__VLS_functionalComponentArgsRest(__VLS_38));
107
+ }
108
+ }
109
+ }
110
+ var __VLS_slots;
111
+ var __VLS_inheritedAttrs;
112
+ const __VLS_refs = {};
113
+ var $refs;
114
+ var $el;
115
+ return {
116
+ attrs: {},
117
+ slots: __VLS_slots,
118
+ refs: $refs,
119
+ rootEl: $el,
120
+ };
121
+ }
122
+ ;
123
+ let __VLS_self;
124
+ //# 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,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAEtC,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,eAAe,eAAe,CAAC;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,wBAAwB,CAC7D,KAAK,CAAC,OAAO,CACd,CAAC;QAEF,OAAO;YACL,QAAQ;YACR,gBAAgB;SACjB,CAAC;IACJ,CAAC;IACD,UAAU,EAAE;QACV,aAAa;QACb,eAAe;QACf,YAAY;QACZ,iBAAiB;QACjB,cAAc;QACd,eAAe;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;YACb,eAAe;YACf,YAAY;Y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,CAAC,GAAG,CAAC,CAAC,CAAC;YAClH,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAC,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,iCAAiC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACvH,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;gBAC5B,MAAM,QAAQ,GAAG,sCAAsC,CAAC,YAAY,CAAC;gBACrE,yDAAyD;gBACzD,aAAa;gBACb,MAAM,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,EAAE,IAAI,QAAQ,CAAC,EAAC,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC3G,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAC,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,iCAAiC,CAAC,QAAQ,CAAC,CAAC,CAAC;YAChH,CAAC;QACD,CAAC;IACD,CAAC;IAED,IAAI,WAEH,CAAC;IACF,IAAI,oBAAyB,CAAC;IAC9B,MAAM,UAAU,GAAG,EAClB,CAAC;IACF,IAAI,KAAyB,CAAC;IAC9B,IAAI,GAAS,CAAC;IACd,OAAO;QACN,KAAK,EAAE,EAA0C;QACjD,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,GAAG;KACX,CAAC;AACF,CAAC;AAAA,CAAC;AACF,IAAI,UAAiD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { S2CellType, TooltipShowOptions } from '@antv/s2';
2
+ export interface TooltipRenderProps<T = HTMLElement | string> extends TooltipShowOptions<T> {
3
+ readonly content?: T;
4
+ readonly cell: S2CellType;
5
+ }
6
+ export type TooltipInfosProps = {
7
+ infos: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/components/tooltip/interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { type SpreadSheet } from '@antv/s2';
2
+ import { type Ref } from 'vue';
3
+ import type { BaseSheetInitEmits, EmitFn } from './../interface';
4
+ export declare const useEvents: (s2Ref: Ref<SpreadSheet | undefined>, emit: EmitFn<BaseSheetInitEmits>) => void;
@@ -0,0 +1,125 @@
1
+ /* eslint-disable max-lines-per-function */
2
+ import { S2Event, getBaseCellData } from '@antv/s2';
3
+ import { onMounted } from 'vue';
4
+ const useCellEvent = (s2Ref, emit, eventName, emitName) => {
5
+ const handler = (event) => {
6
+ const param = getBaseCellData(event);
7
+ emit(emitName, param);
8
+ };
9
+ s2Ref.value?.on(eventName, handler);
10
+ };
11
+ const useS2Event = (s2Ref, emit, eventName, emitName) => {
12
+ const handler = (...params) => {
13
+ // @ts-ignore
14
+ emit(emitName, ...params);
15
+ };
16
+ s2Ref.value?.on(eventName, handler);
17
+ };
18
+ export const useEvents = (s2Ref, emit) => {
19
+ onMounted(() => {
20
+ if (!s2Ref.value) {
21
+ return;
22
+ }
23
+ // ============== Row Cell ====================
24
+ useCellEvent(s2Ref, emit, S2Event.ROW_CELL_HOVER, 'rowCellHover');
25
+ useCellEvent(s2Ref, emit, S2Event.ROW_CELL_CLICK, 'rowCellClick');
26
+ useCellEvent(s2Ref, emit, S2Event.ROW_CELL_DOUBLE_CLICK, 'rowCellDoubleClick');
27
+ useCellEvent(s2Ref, emit, S2Event.ROW_CELL_CONTEXT_MENU, 'rowCellContextMenu');
28
+ useCellEvent(s2Ref, emit, S2Event.ROW_CELL_MOUSE_DOWN, 'rowCellMouseDown');
29
+ useCellEvent(s2Ref, emit, S2Event.ROW_CELL_MOUSE_UP, 'rowCellMouseUp');
30
+ useCellEvent(s2Ref, emit, S2Event.ROW_CELL_MOUSE_MOVE, 'rowCellMouseMove');
31
+ useS2Event(s2Ref, emit, S2Event.ROW_CELL_COLLAPSED, 'rowCellCollapsed');
32
+ useS2Event(s2Ref, emit, S2Event.ROW_CELL_ALL_COLLAPSED, 'rowCellAllCollapsed');
33
+ useS2Event(s2Ref, emit, S2Event.ROW_CELL_SCROLL, 'rowCellScroll');
34
+ useS2Event(s2Ref, emit, S2Event.ROW_CELL_RENDER, 'rowCellRender');
35
+ useS2Event(s2Ref, emit, S2Event.ROW_CELL_SELECTED, 'rowCellSelected');
36
+ // ============== Col Cell ====================
37
+ useCellEvent(s2Ref, emit, S2Event.COL_CELL_HOVER, 'colCellHover');
38
+ useCellEvent(s2Ref, emit, S2Event.COL_CELL_CLICK, 'colCellClick');
39
+ useCellEvent(s2Ref, emit, S2Event.COL_CELL_DOUBLE_CLICK, 'colCellDoubleClick');
40
+ useCellEvent(s2Ref, emit, S2Event.COL_CELL_CONTEXT_MENU, 'colCellContextMenu');
41
+ useCellEvent(s2Ref, emit, S2Event.COL_CELL_MOUSE_DOWN, 'colCellMouseDown');
42
+ useCellEvent(s2Ref, emit, S2Event.COL_CELL_MOUSE_UP, 'colCellMouseUp');
43
+ useCellEvent(s2Ref, emit, S2Event.COL_CELL_MOUSE_MOVE, 'colCellMouseMove');
44
+ useS2Event(s2Ref, emit, S2Event.COL_CELL_EXPANDED, 'colCellExpanded');
45
+ useS2Event(s2Ref, emit, S2Event.COL_CELL_HIDDEN, 'colCellHidden');
46
+ useS2Event(s2Ref, emit, S2Event.COL_CELL_RENDER, 'colCellRender');
47
+ useS2Event(s2Ref, emit, S2Event.COL_CELL_SELECTED, 'colCellSelected');
48
+ // ============== Data Cell ====================
49
+ useCellEvent(s2Ref, emit, S2Event.DATA_CELL_HOVER, 'dataCellHover');
50
+ useCellEvent(s2Ref, emit, S2Event.DATA_CELL_CLICK, 'dataCellClick');
51
+ useCellEvent(s2Ref, emit, S2Event.DATA_CELL_DOUBLE_CLICK, 'dataCellDoubleClick');
52
+ useCellEvent(s2Ref, emit, S2Event.DATA_CELL_CONTEXT_MENU, 'dataCellContextMenu');
53
+ useCellEvent(s2Ref, emit, S2Event.DATA_CELL_MOUSE_DOWN, 'dataCellMouseDown');
54
+ useCellEvent(s2Ref, emit, S2Event.DATA_CELL_MOUSE_UP, 'dataCellMouseUp');
55
+ useCellEvent(s2Ref, emit, S2Event.DATA_CELL_MOUSE_MOVE, 'dataCellMouseMove');
56
+ useS2Event(s2Ref, emit, S2Event.DATA_CELL_BRUSH_SELECTION, 'dataCellBrushSelection');
57
+ useS2Event(s2Ref, emit, S2Event.DATA_CELL_SELECT_MOVE, 'dataCellSelectMove');
58
+ useS2Event(s2Ref, emit, S2Event.DATA_CELL_RENDER, 'dataCellRender');
59
+ useS2Event(s2Ref, emit, S2Event.DATA_CELL_SELECTED, 'dataCellSelected');
60
+ // ============== Corner Cell ====================
61
+ useCellEvent(s2Ref, emit, S2Event.CORNER_CELL_HOVER, 'cornerCellHover');
62
+ useCellEvent(s2Ref, emit, S2Event.CORNER_CELL_CLICK, 'cornerCellClick');
63
+ useCellEvent(s2Ref, emit, S2Event.CORNER_CELL_DOUBLE_CLICK, 'cornerCellDoubleClick');
64
+ useCellEvent(s2Ref, emit, S2Event.CORNER_CELL_CONTEXT_MENU, 'cornerCellContextMenu');
65
+ useCellEvent(s2Ref, emit, S2Event.CORNER_CELL_MOUSE_DOWN, 'cornerCellMouseDown');
66
+ useCellEvent(s2Ref, emit, S2Event.CORNER_CELL_MOUSE_UP, 'cornerCellMouseUp');
67
+ useCellEvent(s2Ref, emit, S2Event.CORNER_CELL_MOUSE_MOVE, 'cornerCellMouseMove');
68
+ useS2Event(s2Ref, emit, S2Event.CORNER_CELL_RENDER, 'cornerCellRender');
69
+ useS2Event(s2Ref, emit, S2Event.CORNER_CELL_SELECTED, 'cornerCellSelected');
70
+ // ============== Merged Cells ====================
71
+ useCellEvent(s2Ref, emit, S2Event.MERGED_CELLS_HOVER, 'mergedCellsHover');
72
+ useCellEvent(s2Ref, emit, S2Event.MERGED_CELLS_CLICK, 'mergedCellsClick');
73
+ useCellEvent(s2Ref, emit, S2Event.MERGED_CELLS_DOUBLE_CLICK, 'mergedCellsDoubleClick');
74
+ useCellEvent(s2Ref, emit, S2Event.MERGED_CELLS_CONTEXT_MENU, 'mergedCellsContextMenu');
75
+ useCellEvent(s2Ref, emit, S2Event.MERGED_CELLS_MOUSE_DOWN, 'mergedCellsMouseDown');
76
+ useCellEvent(s2Ref, emit, S2Event.MERGED_CELLS_MOUSE_UP, 'mergedCellsMouseUp');
77
+ useCellEvent(s2Ref, emit, S2Event.MERGED_CELLS_MOUSE_MOVE, 'mergedCellsMouseMove');
78
+ useS2Event(s2Ref, emit, S2Event.MERGED_CELLS_RENDER, 'mergedCellsRender');
79
+ /** ================ SeriesNumber Cell ================ */
80
+ useS2Event(s2Ref, emit, S2Event.SERIES_NUMBER_CELL_RENDER, 'seriesNumberCellRender');
81
+ // ============== Sort ====================
82
+ useS2Event(s2Ref, emit, S2Event.RANGE_SORT, 'rangeSort');
83
+ useS2Event(s2Ref, emit, S2Event.RANGE_SORTED, 'rangeSorted');
84
+ // ============== Filter ====================
85
+ useS2Event(s2Ref, emit, S2Event.RANGE_FILTER, 'rangeFilter');
86
+ useS2Event(s2Ref, emit, S2Event.RANGE_FILTERED, 'rangeFiltered');
87
+ // ============== Layout ====================
88
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_AFTER_HEADER_LAYOUT, 'layoutAfterHeaderLayout');
89
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_PAGINATION, 'layoutPagination');
90
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_BEFORE_RENDER, 'beforeRender');
91
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_AFTER_RENDER, 'afterRender');
92
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_DESTROY, 'destroy');
93
+ // ============== Resize ====================
94
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE, 'layoutResize');
95
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE_SERIES_WIDTH, 'layoutResizeSeriesWidth');
96
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE_ROW_WIDTH, 'layoutResizeRowWidth');
97
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE_ROW_HEIGHT, 'layoutResizeRowHeight');
98
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE_COL_WIDTH, 'layoutResizeColWidth');
99
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE_COL_HEIGHT, 'layoutResizeColHeight');
100
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE_TREE_WIDTH, 'layoutResizeTreeWidth');
101
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE_MOUSE_DOWN, 'layoutResizeMouseDown');
102
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE_MOUSE_UP, 'layoutResizeMouseUp');
103
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_RESIZE_MOUSE_MOVE, 'layoutResizeMouseMove');
104
+ // ============== Global ====================
105
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_KEYBOARD_DOWN, 'keyBoardDown');
106
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_KEYBOARD_UP, 'keyBoardUp');
107
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_COPIED, 'copied');
108
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_ACTION_ICON_HOVER, 'actionIconHover');
109
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_ACTION_ICON_CLICK, 'actionIconClick');
110
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_CONTEXT_MENU, 'contextMenu');
111
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_HOVER, 'mouseHover');
112
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_CLICK, 'click');
113
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_DOUBLE_CLICK, 'doubleClick');
114
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_SELECTED, 'selected');
115
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_MOUSE_UP, 'mouseUp');
116
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_RESET, 'reset');
117
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_LINK_FIELD_JUMP, 'linkFieldJump');
118
+ useS2Event(s2Ref, emit, S2Event.GLOBAL_SCROLL, 'scroll');
119
+ // ============== Auto 自动生成的 ================
120
+ useS2Event(s2Ref, emit, S2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDER, 'layoutAfterRealDataCellRender');
121
+ useS2Event(s2Ref, emit, S2Event.ROW_CELL_BRUSH_SELECTION, 'rowCellBrushSelection');
122
+ useS2Event(s2Ref, emit, S2Event.COL_CELL_BRUSH_SELECTION, 'colCellBrushSelection');
123
+ });
124
+ };
125
+ //# sourceMappingURL=useEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEvents.js","sourceRoot":"","sources":["../../src/hooks/useEvents.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EAAU,OAAO,EAAE,eAAe,EAAoB,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAY,MAAM,KAAK,CAAC;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,eAAe,CAAC,KAAK,CAAC,CAAC;QAErC,IAAI,CAAC,QAAe,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CACjB,KAAmC,EACnC,IAAgC,EAChC,SAAkB,EAClB,QAAkC,EAClC,EAAE;IACF,MAAM,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AE,OAAO,CAAC,CAAC;QACvD,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;QACpE,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC7D,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;QAC5D,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACvD,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC;QACzE,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAEzD,6CAA6C;QAC7C,UAAU,CACR,KAAK,EACL,IAAI,EACJ,OAAO,CAAC,kCAAkC,EAC1C,+BAA+B,CAChC,CAAC;QACF,UAAU,CACR,KAAK,EACL,IAAI,EACJ,OAAO,CAAC,wBAAwB,EAChC,uBAAuB,CACxB,CAAC;QACF,UAAU,CACR,KAAK,EACL,IAAI,EACJ,OAAO,CAAC,wBAAwB,EAChC,uBAAuB,CACxB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { SpreadSheet } from '@antv/s2';
2
+ export interface SheetExpose {
3
+ instance: SpreadSheet | undefined;
4
+ }
5
+ export declare const useExpose: (expose: (exposed?: Record<string, any>) => void) => import("vue").ShallowRef<SheetExpose>;
@@ -0,0 +1,11 @@
1
+ import { shallowRef } from 'vue';
2
+ export const useExpose = (expose) => {
3
+ const s2Ref = shallowRef();
4
+ expose({
5
+ get instance() {
6
+ return s2Ref.value?.instance;
7
+ },
8
+ });
9
+ return s2Ref;
10
+ };
11
+ //# sourceMappingURL=useExpose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useExpose.js","sourceRoot":"","sources":["../../src/hooks/useExpose.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMjC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAA+C,EAAE,EAAE;IAC3E,MAAM,KAAK,GAAG,UAAU,EAAe,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"}
@@ -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,18 @@
1
+ import { S2Event } from '@antv/s2';
2
+ import { ref, watch } from 'vue';
3
+ export const useLoading = (s2Ref, loadingProp = false) => {
4
+ const loading = ref(loadingProp);
5
+ const setLoading = (updated) => {
6
+ loading.value = updated;
7
+ };
8
+ watch(s2Ref, (s2) => {
9
+ s2?.on(S2Event.LAYOUT_BEFORE_RENDER, () => {
10
+ setLoading(true);
11
+ });
12
+ s2?.on(S2Event.LAYOUT_AFTER_RENDER, () => {
13
+ setLoading(false);
14
+ });
15
+ });
16
+ return { loading, setLoading };
17
+ };
18
+ //# sourceMappingURL=useLoading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLoading.js","sourceRoot":"","sources":["../../src/hooks/useLoading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoB,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAmB,MAAM,KAAK,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,KAA0C,EAC1C,WAAW,GAAG,KAAK,EACnB,EAAE;IACF,MAAM,OAAO,GAAG,GAAG,CAAU,WAAW,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,CAAC,OAAgB,EAAE,EAAE;QACtC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC;IAC1B,CAAC,CAAC;IAEF,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;QAClB,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,oBAAoB,EAAE,GAAG,EAAE;YACxC,UAAU,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,EAAE,EAAE,EAAE,CAAC,OAAO,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"}
@@ -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,68 @@
1
+ import { S2Event, } from '@antv/s2';
2
+ import { isEmpty, omit } from 'lodash';
3
+ import { computed, ref, watch } from 'vue';
4
+ export const DEFAULT_PAGE_NUMBER = 1;
5
+ export const DEFAULT_PAGE_SIZE = 10;
6
+ export const usePagination = (s2Ref, props) => {
7
+ const { options: { pagination: paginationCfg }, showPagination, } = props;
8
+ const current = ref(paginationCfg?.current ?? DEFAULT_PAGE_NUMBER);
9
+ const pageSize = ref(paginationCfg?.pageSize ?? DEFAULT_PAGE_SIZE);
10
+ const total = ref(0);
11
+ const change = (nextCurrent) => {
12
+ current.value = nextCurrent;
13
+ };
14
+ const showSizeChange = (nextPageSize) => {
15
+ pageSize.value = nextPageSize;
16
+ };
17
+ const visible = computed(() => {
18
+ return showPagination && !isEmpty(paginationCfg);
19
+ });
20
+ // sync state.pagination -> s2.pagination
21
+ watch([current, pageSize], async () => {
22
+ if (!s2Ref.value) {
23
+ return;
24
+ }
25
+ const nextPagination = isEmpty(paginationCfg)
26
+ ? null
27
+ : {
28
+ current: current.value,
29
+ pageSize: pageSize.value,
30
+ };
31
+ s2Ref.value.updatePagination(nextPagination);
32
+ await s2Ref.value.render(false);
33
+ });
34
+ // sync props.pagination -> state.pagination
35
+ watch([() => paginationCfg, s2Ref], () => {
36
+ current.value = paginationCfg?.current ?? DEFAULT_PAGE_NUMBER;
37
+ pageSize.value = paginationCfg?.pageSize ?? DEFAULT_PAGE_SIZE;
38
+ total.value = s2Ref.value?.facet?.viewCellHeights.getTotalLength() ?? 0;
39
+ }, {
40
+ immediate: true,
41
+ });
42
+ // sync layout result total -> state.total
43
+ watch(s2Ref, (value, oldValue, onCleanup) => {
44
+ if (!s2Ref.value) {
45
+ return;
46
+ }
47
+ const totalUpdateCallback = (data) => {
48
+ if (isEmpty(paginationCfg)) {
49
+ return;
50
+ }
51
+ total.value = data.total;
52
+ };
53
+ s2Ref.value.on(S2Event.LAYOUT_PAGINATION, totalUpdateCallback);
54
+ onCleanup(() => {
55
+ s2Ref.value?.off(S2Event.LAYOUT_PAGINATION, totalUpdateCallback);
56
+ });
57
+ });
58
+ return {
59
+ customOptions: omit(paginationCfg, ['current', 'pageSize', 'total']),
60
+ visible,
61
+ current,
62
+ pageSize,
63
+ total,
64
+ change,
65
+ showSizeChange,
66
+ };
67
+ };
68
+ //# sourceMappingURL=usePagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePagination.js","sourceRoot":"","sources":["../../src/hooks/usePagination.ts"],"names":[],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CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,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"}
@@ -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,20 @@
1
+ import { createResizeObserver } from '@antv/s2';
2
+ import { ref, watch } from 'vue';
3
+ export const useResize = (s2Ref, props, dom) => {
4
+ const unobserve = ref();
5
+ watch([s2Ref, () => props.adaptive], ([s2, adaptive], _, onCleanup) => {
6
+ if (!s2) {
7
+ return;
8
+ }
9
+ unobserve.value = createResizeObserver({
10
+ s2,
11
+ adaptive,
12
+ wrapper: dom.wrapperRef.value,
13
+ container: dom.containerRef.value,
14
+ });
15
+ onCleanup(() => {
16
+ unobserve.value?.();
17
+ });
18
+ });
19
+ };
20
+ //# sourceMappingURL=useResize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResize.js","sourceRoot":"","sources":["../../src/hooks/useResize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAY,MAAM,KAAK,CAAC;AAG3C,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,KAAmC,EACnC,KAAqB,EACrB,GAGC,EACD,EAAE;IACF,MAAM,SAAS,GAAG,GAAG,EAAc,CAAC;IAEpC,KAAK,CAAC,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,oBAAoB,CAAC;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"}
@@ -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;
@@ -0,0 +1,56 @@
1
+ import { isProxy, reactive, watch } from 'vue';
2
+ /**
3
+ * props 会将所有属性用 shallowReactive 包裹起来:
4
+ * 1. 如果是对 dataCfg 或者 options 直接替换, 那么只需要简单的通过 ()=> props.dataCfg 这种 getter 就能监听到
5
+ * 2. 如果 dataCfg 任然是 reactive 数据,那么就存在直接修改了其中某一个属性的情况,这个时候就需要对所有的属性遍历来关联 watch 属性
6
+ * ? 如果数量特别多时,遍历可能存在性能问题,先暂时观察一下
7
+ */
8
+ export const useSheetUpdate = (s2Ref, props, hooks) => {
9
+ const updateFlag = reactive({
10
+ rerender: false,
11
+ reloadData: false,
12
+ rebuildDataset: false,
13
+ });
14
+ watch(() => props.options, (options, prevOptions) => {
15
+ updateFlag.rerender = true;
16
+ if (!Object.is(prevOptions?.hierarchyType, options?.hierarchyType)) {
17
+ updateFlag.reloadData = true;
18
+ updateFlag.rebuildDataset = true;
19
+ }
20
+ s2Ref.value?.setOptions(options);
21
+ s2Ref.value?.changeSheetSize(options?.width, options?.height);
22
+ }, { deep: isProxy(props.options) });
23
+ watch(() => props.dataCfg, (dataCfg, prevDataCfg) => {
24
+ if (prevDataCfg?.fields?.columns?.length !==
25
+ dataCfg?.fields?.columns?.length) {
26
+ s2Ref.value?.facet?.clearInitColLeafNodes();
27
+ }
28
+ updateFlag.rerender = true;
29
+ updateFlag.reloadData = true;
30
+ s2Ref.value?.setDataCfg(dataCfg);
31
+ }, { deep: isProxy(props.dataCfg) });
32
+ watch(() => props.themeCfg, (themeCfg) => {
33
+ updateFlag.rerender = true;
34
+ s2Ref.value?.setThemeCfg(themeCfg);
35
+ }, {
36
+ deep: isProxy(props.themeCfg),
37
+ });
38
+ watch(updateFlag, async (flag) => {
39
+ if (!flag.rerender) {
40
+ return;
41
+ }
42
+ hooks?.before?.();
43
+ const defaultRenderOptions = {
44
+ reloadData: flag.reloadData,
45
+ rebuildDataSet: flag.rebuildDataset,
46
+ };
47
+ const renderOptions = props?.onUpdate?.(defaultRenderOptions) || defaultRenderOptions;
48
+ await s2Ref.value?.render(renderOptions);
49
+ props?.onUpdateAfterRender?.(renderOptions);
50
+ hooks?.after?.();
51
+ flag.rerender = false;
52
+ flag.reloadData = false;
53
+ flag.rebuildDataset = false;
54
+ });
55
+ };
56
+ //# sourceM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