stk-table-vue 0.8.13 → 0.9.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +172 -180
  2. package/lib/src/StkTable/StkTable.vue.d.ts +22 -2
  3. package/lib/src/StkTable/useScrollbar.d.ts +57 -0
  4. package/lib/src/StkTable/utils/index.d.ts +10 -0
  5. package/lib/stk-table-vue.js +563 -294
  6. package/lib/style.css +49 -2
  7. package/package.json +74 -72
  8. package/src/StkTable/StkTable.vue +1730 -1653
  9. package/src/StkTable/components/DragHandle.vue +9 -9
  10. package/src/StkTable/components/SortIcon.vue +6 -6
  11. package/src/StkTable/components/TriangleIcon.vue +3 -3
  12. package/src/StkTable/const.ts +50 -50
  13. package/src/StkTable/index.ts +4 -4
  14. package/src/StkTable/style.less +627 -580
  15. package/src/StkTable/types/highlightDimOptions.ts +26 -26
  16. package/src/StkTable/types/index.ts +297 -297
  17. package/src/StkTable/useAutoResize.ts +91 -91
  18. package/src/StkTable/useColResize.ts +216 -216
  19. package/src/StkTable/useFixedCol.ts +150 -148
  20. package/src/StkTable/useFixedStyle.ts +75 -75
  21. package/src/StkTable/useGetFixedColPosition.ts +65 -65
  22. package/src/StkTable/useHighlight.ts +257 -257
  23. package/src/StkTable/useKeyboardArrowScroll.ts +112 -112
  24. package/src/StkTable/useMaxRowSpan.ts +55 -55
  25. package/src/StkTable/useMergeCells.ts +120 -123
  26. package/src/StkTable/useRowExpand.ts +88 -88
  27. package/src/StkTable/useScrollRowByRow.ts +114 -79
  28. package/src/StkTable/useScrollbar.ts +187 -0
  29. package/src/StkTable/useThDrag.ts +102 -102
  30. package/src/StkTable/useTrDrag.ts +113 -118
  31. package/src/StkTable/useTree.ts +161 -161
  32. package/src/StkTable/useVirtualScroll.ts +494 -494
  33. package/src/StkTable/utils/constRefUtils.ts +29 -29
  34. package/src/StkTable/utils/index.ts +287 -242
  35. package/src/StkTable/utils/useTriggerRef.ts +33 -33
  36. package/src/VirtualTree.vue +622 -622
  37. package/src/VirtualTreeSelect.vue +367 -367
  38. package/src/vite-env.d.ts +10 -10
@@ -1,9 +1,9 @@
1
- <template>
2
- <span class="drag-row-handle" draggable="true">
3
- <svg viewBox="0 0 1024 1024" width="16" height="16" fill="currentColor">
4
- <path
5
- d="M640 853.3a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z m-256 0a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z m256-256a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z m-256 0a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z m256-256a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3zM384 341.3a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z"
6
- ></path>
7
- </svg>
8
- </span>
9
- </template>
1
+ <template>
2
+ <span class="drag-row-handle" draggable="true">
3
+ <svg viewBox="0 0 1024 1024" width="16" height="16" fill="currentColor">
4
+ <path
5
+ d="M640 853.3a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z m-256 0a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z m256-256a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z m-256 0a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z m256-256a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3zM384 341.3a85.3 85.3 0 1 1 85.3-85.3 85.3 85.3 0 0 1-85.3 85.3z"
6
+ ></path>
7
+ </svg>
8
+ </span>
9
+ </template>
@@ -1,6 +1,6 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 16 16">
3
- <polygon class="arrow-up" fill="#757699" points="8 2 4.8 6 11.2 6"></polygon>
4
- <polygon class="arrow-down" transform="translate(8, 12) rotate(-180) translate(-8, -12) " points="8 10 4.8 14 11.2 14"></polygon>
5
- </svg>
6
- </template>
1
+ <template>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" viewBox="0 0 16 16">
3
+ <polygon class="arrow-up" fill="#757699" points="8 2 4.8 6 11.2 6"></polygon>
4
+ <polygon class="arrow-down" transform="translate(8, 12) rotate(-180) translate(-8, -12) " points="8 10 4.8 14 11.2 14"></polygon>
5
+ </svg>
6
+ </template>
@@ -1,3 +1,3 @@
1
- <template>
2
- <div class="stk-fold-icon"></div>
3
- </template>
1
+ <template>
2
+ <div class="stk-fold-icon"></div>
3
+ </template>
@@ -1,50 +1,50 @@
1
- import { RowActiveOption, SortConfig } from './types';
2
- import { getBrowsersVersion } from './utils';
3
-
4
- export const DEFAULT_COL_WIDTH = '100';
5
-
6
- export const DEFAULT_TABLE_HEIGHT = 100;
7
- export const DEFAULT_TABLE_WIDTH = 200;
8
- export const DEFAULT_ROW_HEIGHT = 28;
9
-
10
- /** highlight background */
11
- export const HIGHLIGHT_COLOR = {
12
- light: { from: '#71a2fd', to: '#fff' },
13
- dark: { from: '#1e4c99', to: '#181c21' },
14
- };
15
- export const HIGHLIGHT_DURATION = 2000;
16
-
17
- /** highlight change frequency 1000/30 -> 30FPS */
18
- // export const HIGHLIGHT_FREQ = 1000 / 30;
19
-
20
- export const HIGHLIGHT_ROW_CLASS = 'highlight-row';
21
- export const HIGHLIGHT_CELL_CLASS = 'highlight-cell';
22
-
23
- const _chromeVersion = getBrowsersVersion('chrome');
24
- const _firefoxVersion = getBrowsersVersion('firefox');
25
-
26
- /** legacy sticky compatible mode */
27
- export const IS_LEGACY_MODE = _chromeVersion < 56 || _firefoxVersion < 59;
28
-
29
- /** default props.smoothDefault */
30
- export const DEFAULT_SMOOTH_SCROLL = _chromeVersion < 85;
31
-
32
- export const STK_ID_PREFIX = 'stk';
33
-
34
- /** expanded row key prefix */
35
- export const EXPANDED_ROW_KEY_PREFIX = 'expanded-';
36
-
37
- /** cell key split str */
38
- export const CELL_KEY_SEPARATE = '--';
39
-
40
- export const DEFAULT_SORT_CONFIG = {
41
- emptyToBottom: false,
42
- stringLocaleCompare: false,
43
- sortChildren: false,
44
- } satisfies SortConfig<any>;
45
-
46
- export const DEFAULT_ROW_ACTIVE_CONFIG: Required<RowActiveOption<any>> = {
47
- enabled: true,
48
- disabled: () => false,
49
- revokable: true,
50
- };
1
+ import { RowActiveOption, SortConfig } from './types';
2
+ import { getBrowsersVersion } from './utils';
3
+
4
+ export const DEFAULT_COL_WIDTH = '100';
5
+
6
+ export const DEFAULT_TABLE_HEIGHT = 100;
7
+ export const DEFAULT_TABLE_WIDTH = 200;
8
+ export const DEFAULT_ROW_HEIGHT = 28;
9
+
10
+ /** highlight background */
11
+ export const HIGHLIGHT_COLOR = {
12
+ light: { from: '#71a2fd', to: '#fff' },
13
+ dark: { from: '#1e4c99', to: '#181c21' },
14
+ };
15
+ export const HIGHLIGHT_DURATION = 2000;
16
+
17
+ /** highlight change frequency 1000/30 -> 30FPS */
18
+ // export const HIGHLIGHT_FREQ = 1000 / 30;
19
+
20
+ export const HIGHLIGHT_ROW_CLASS = 'highlight-row';
21
+ export const HIGHLIGHT_CELL_CLASS = 'highlight-cell';
22
+
23
+ const _chromeVersion = getBrowsersVersion('chrome');
24
+ const _firefoxVersion = getBrowsersVersion('firefox');
25
+
26
+ /** legacy sticky compatible mode */
27
+ export const IS_LEGACY_MODE = _chromeVersion < 56 || _firefoxVersion < 59;
28
+
29
+ /** default props.smoothDefault */
30
+ export const DEFAULT_SMOOTH_SCROLL = _chromeVersion < 85;
31
+
32
+ export const STK_ID_PREFIX = 'stk';
33
+
34
+ /** expanded row key prefix */
35
+ export const EXPANDED_ROW_KEY_PREFIX = 'expanded-';
36
+
37
+ /** cell key split str */
38
+ export const CELL_KEY_SEPARATE = '--';
39
+
40
+ export const DEFAULT_SORT_CONFIG = {
41
+ emptyToBottom: false,
42
+ stringLocaleCompare: false,
43
+ sortChildren: false,
44
+ } satisfies SortConfig<any>;
45
+
46
+ export const DEFAULT_ROW_ACTIVE_CONFIG: Required<RowActiveOption<any>> = {
47
+ enabled: true,
48
+ disabled: () => false,
49
+ revokable: true,
50
+ };
@@ -1,4 +1,4 @@
1
- export { default as StkTable } from './StkTable.vue';
2
- export { tableSort, insertToOrderedArray, strCompare, binarySearch } from './utils';
3
- export type { StkTableColumn } from './types/index';
4
- import './style.less';
1
+ export { default as StkTable } from './StkTable.vue';
2
+ export { tableSort, insertToOrderedArray, strCompare, binarySearch } from './utils';
3
+ export type { StkTableColumn } from './types/index';
4
+ import './style.less';