@guozhi5658/srp-table 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-table/__tests__/fillRemainingWidth.test.d.ts +1 -1
- package/dist/base-table/calculations.d.ts +3 -3
- package/dist/base-table/colgroup.d.ts +4 -5
- package/dist/base-table/empty.d.ts +9 -9
- package/dist/base-table/header.d.ts +4 -5
- package/dist/base-table/helpers/SpanManager.d.ts +9 -9
- package/dist/base-table/helpers/TableDOMUtils.d.ts +16 -16
- package/dist/base-table/helpers/getMaximumColSpan.d.ts +9 -9
- package/dist/base-table/helpers/getRichVisibleRectsStream.d.ts +23 -23
- package/dist/base-table/helpers/rowHeightManager.d.ts +7 -7
- package/dist/base-table/html-table.d.ts +14 -15
- package/dist/base-table/index.d.ts +3 -3
- package/dist/base-table/interfaces.d.ts +54 -54
- package/dist/base-table/loading.d.ts +13 -13
- package/dist/base-table/styles.d.ts +86 -83
- package/dist/base-table/table.d.ts +185 -185
- package/dist/base-table/utils.d.ts +22 -22
- package/dist/chunks/{srp-table-pipeline-0b26f8d2.esm.js → srp-table-pipeline-414f4fea.esm.js} +2061 -2061
- package/dist/chunks/{srp-table-pipeline-8dff19ec.js → srp-table-pipeline-7f69aca0.js} +2075 -2075
- package/dist/common-views.d.ts +26 -23
- package/dist/fillRemainingWidth.d.ts +9 -9
- package/dist/interfaces.d.ts +65 -65
- package/dist/internals.d.ts +14 -15
- package/dist/pipeline/features/autoRowSpan.d.ts +2 -2
- package/dist/pipeline/features/buildTree.d.ts +2 -2
- package/dist/pipeline/features/columnHover.d.ts +12 -12
- package/dist/pipeline/features/columnRangeHover.d.ts +15 -15
- package/dist/pipeline/features/columnResize.d.ts +24 -24
- package/dist/pipeline/features/fillRemainingWidth.d.ts +2 -2
- package/dist/pipeline/features/index.d.ts +15 -15
- package/dist/pipeline/features/multiSelect.d.ts +27 -27
- package/dist/pipeline/features/rowDetail.d.ts +29 -29
- package/dist/pipeline/features/rowGrouping.d.ts +14 -14
- package/dist/pipeline/features/rowPopover.d.ts +13 -13
- package/dist/pipeline/features/singleSelect.d.ts +23 -23
- package/dist/pipeline/features/sort.d.ts +42 -42
- package/dist/pipeline/features/tips.d.ts +2 -2
- package/dist/pipeline/features/treeMode.d.ts +29 -29
- package/dist/pipeline/features/treeSelect.d.ts +38 -38
- package/dist/pipeline/index.d.ts +3 -3
- package/dist/pipeline/pipeline.d.ts +79 -79
- package/dist/pivot/cross-table/buildCrossTable.d.ts +17 -17
- package/dist/pivot/cross-table/constants.d.ts +1 -1
- package/dist/pivot/cross-table/cross-table.d.ts +18 -18
- package/dist/pivot/cross-table/index.d.ts +4 -4
- package/dist/pivot/cross-table/interfaces.d.ts +29 -29
- package/dist/pivot/cross-table/internals.d.ts +13 -13
- package/dist/pivot/cross-tree-table/buildCrossTreeTable.d.ts +14 -14
- package/dist/pivot/cross-tree-table/cross-tree-table.d.ts +38 -38
- package/dist/pivot/cross-tree-table/index.d.ts +2 -2
- package/dist/pivot/pivot-utils/buildDrillTree.d.ts +16 -16
- package/dist/pivot/pivot-utils/builders.d.ts +26 -26
- package/dist/pivot/pivot-utils/convert-utils.d.ts +31 -31
- package/dist/pivot/pivot-utils/index.d.ts +5 -5
- package/dist/pivot/pivot-utils/interfaces.d.ts +12 -12
- package/dist/pivot/pivot-utils/simpleEncode.d.ts +1 -1
- package/dist/srp-table-pivot.d.ts +3 -3
- package/dist/srp-table-pivot.esm.js +647 -646
- package/dist/srp-table-pivot.js +647 -646
- package/dist/srp-table.d.ts +6 -6
- package/dist/srp-table.esm.js +2334 -2331
- package/dist/srp-table.js +2347 -2344
- package/dist/transforms/autoRowSpan.d.ts +3 -3
- package/dist/transforms/autoWidth.d.ts +25 -25
- package/dist/transforms/buildTree.d.ts +3 -3
- package/dist/transforms/columnHover.d.ts +14 -14
- package/dist/transforms/columnRangeHover.d.ts +14 -14
- package/dist/transforms/columnResize.d.ts +24 -24
- package/dist/transforms/flatten.d.ts +3 -3
- package/dist/transforms/index.d.ts +12 -12
- package/dist/transforms/orderField.d.ts +3 -3
- package/dist/transforms/sort.d.ts +40 -40
- package/dist/transforms/tips.d.ts +8 -8
- package/dist/transforms/treeMode.d.ts +27 -27
- package/dist/transforms/visible.d.ts +2 -2
- package/dist/transforms/warnTransformsDeprecated.d.ts +1 -1
- package/dist/utils/applyTransforms.d.ts +6 -6
- package/dist/utils/buildTree.d.ts +36 -36
- package/dist/utils/collectNodes.d.ts +8 -8
- package/dist/utils/exportTableAsExcel.d.ts +4 -4
- package/dist/utils/getTreeDepth.d.ts +3 -3
- package/dist/utils/groupBy.d.ts +1 -1
- package/dist/utils/groupBy2.d.ts +1 -1
- package/dist/utils/index.d.ts +14 -14
- package/dist/utils/isLeafNode.d.ts +2 -2
- package/dist/utils/layeredSort.d.ts +5 -5
- package/dist/utils/makeRecursiveMapper.d.ts +9 -9
- package/dist/utils/mergeCellProps.d.ts +9 -9
- package/dist/utils/others.d.ts +11 -10
- package/dist/utils/proto.d.ts +21 -21
- package/dist/utils/smartCompare.d.ts +9 -9
- package/dist/utils/traverseColumn.d.ts +11 -11
- package/dist/utils/tree-data-helpers/StrictTreeDataHelper.d.ts +22 -22
- package/dist/utils/tree-data-helpers/TreeDataHelper.d.ts +26 -26
- package/dist/utils/tree-data-helpers/__tests__/helpers.test.d.ts +1 -1
- package/package.json +4 -3
package/dist/utils/others.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export declare function flatMap<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U[]): U[];
|
|
2
|
-
export declare function fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
|
|
3
|
-
[x: string]: T;
|
|
4
|
-
[x: number]: T;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export declare function flatMap<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U[]): U[];
|
|
2
|
+
export declare function fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): {
|
|
3
|
+
[x: string]: T;
|
|
4
|
+
[x: number]: T;
|
|
5
|
+
[x: symbol]: T;
|
|
6
|
+
};
|
|
7
|
+
export declare const arrayUtils: {
|
|
8
|
+
readonly diff: (arr1: string[], arr2: Iterable<string>) => string[];
|
|
9
|
+
readonly merge: (arr1: string[], arr2: string[]) => string[];
|
|
10
|
+
};
|
|
11
|
+
export declare function always<T>(value: T): (...args: any[]) => T;
|
package/dist/utils/proto.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
[key in keyof T]?: any;
|
|
3
|
-
} : T;
|
|
4
|
-
interface ObjectProto<T> {
|
|
5
|
-
(v: SameKeysWith<T>): T;
|
|
6
|
-
extends(ext: SameKeysWith<T>): ObjectProto<T>;
|
|
7
|
-
}
|
|
8
|
-
interface ArrayProto<T> {
|
|
9
|
-
(items: SameKeysWith<T>[]): T[];
|
|
10
|
-
extends(extRecord: SameKeysWith<T>): ArrayProto<T>;
|
|
11
|
-
}
|
|
12
|
-
export interface ProtoStatic {
|
|
13
|
-
string(v: string): string;
|
|
14
|
-
number(v: number): number;
|
|
15
|
-
notNull<T = any>(v: any): T;
|
|
16
|
-
object<O extends object = any>(base: SameKeysWith<O>): ObjectProto<O>;
|
|
17
|
-
array<T extends object = any>(base: SameKeysWith<T>): ArrayProto<T>;
|
|
18
|
-
readonly empty: unique symbol;
|
|
19
|
-
}
|
|
20
|
-
declare const _default: ProtoStatic;
|
|
21
|
-
export default _default;
|
|
1
|
+
type SameKeysWith<T> = T extends object ? {
|
|
2
|
+
[key in keyof T]?: any;
|
|
3
|
+
} : T;
|
|
4
|
+
interface ObjectProto<T> {
|
|
5
|
+
(v: SameKeysWith<T>): T;
|
|
6
|
+
extends(ext: SameKeysWith<T>): ObjectProto<T>;
|
|
7
|
+
}
|
|
8
|
+
interface ArrayProto<T> {
|
|
9
|
+
(items: SameKeysWith<T>[]): T[];
|
|
10
|
+
extends(extRecord: SameKeysWith<T>): ArrayProto<T>;
|
|
11
|
+
}
|
|
12
|
+
export interface ProtoStatic {
|
|
13
|
+
string(v: string): string;
|
|
14
|
+
number(v: number): number;
|
|
15
|
+
notNull<T = any>(v: any): T;
|
|
16
|
+
object<O extends object = any>(base: SameKeysWith<O>): ObjectProto<O>;
|
|
17
|
+
array<T extends object = any>(base: SameKeysWith<T>): ArrayProto<T>;
|
|
18
|
+
readonly empty: unique symbol;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: ProtoStatic;
|
|
21
|
+
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** 比较函数,支持字符串、数字、数组和 null。
|
|
2
|
-
* * 对于字符串将比较两者的字典序;
|
|
3
|
-
* * 对数字将比较两者大小;
|
|
4
|
-
* * null 值在比较时总是小于另一个值;
|
|
5
|
-
* * 对于数组来说,将逐个比较数组中的元素,第一个不相等的比较结果将作为整个数组的比较结果
|
|
6
|
-
*
|
|
7
|
-
* 数组的比较可参考 python 中的元祖比较:
|
|
8
|
-
* https://stackoverflow.com/questions/5292303/how-does-tuple-comparison-work-in-python */
|
|
9
|
-
export default function smartCompare(x: any, y: any): number;
|
|
1
|
+
/** 比较函数,支持字符串、数字、数组和 null。
|
|
2
|
+
* * 对于字符串将比较两者的字典序;
|
|
3
|
+
* * 对数字将比较两者大小;
|
|
4
|
+
* * null 值在比较时总是小于另一个值;
|
|
5
|
+
* * 对于数组来说,将逐个比较数组中的元素,第一个不相等的比较结果将作为整个数组的比较结果
|
|
6
|
+
*
|
|
7
|
+
* 数组的比较可参考 python 中的元祖比较:
|
|
8
|
+
* https://stackoverflow.com/questions/5292303/how-does-tuple-comparison-work-in-python */
|
|
9
|
+
export default function smartCompare(x: any, y: any): number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ArtColumn, TableTransform } from '../interfaces';
|
|
2
|
-
|
|
3
|
-
/** @deprecated 该 API 已经过时,请使用 makeRecursiveMapper */
|
|
4
|
-
export default function traverseColumn(fn: (column: ArtColumn, ctx: {
|
|
5
|
-
range: {
|
|
6
|
-
start: number;
|
|
7
|
-
end: number;
|
|
8
|
-
};
|
|
9
|
-
dataSource: any[];
|
|
10
|
-
}) => NormalizeAsArrayInput<ArtColumn>): TableTransform;
|
|
11
|
-
export {};
|
|
1
|
+
import { ArtColumn, TableTransform } from '../interfaces';
|
|
2
|
+
type NormalizeAsArrayInput<T> = null | T | T[];
|
|
3
|
+
/** @deprecated 该 API 已经过时,请使用 makeRecursiveMapper */
|
|
4
|
+
export default function traverseColumn(fn: (column: ArtColumn, ctx: {
|
|
5
|
+
range: {
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
};
|
|
9
|
+
dataSource: any[];
|
|
10
|
+
}) => NormalizeAsArrayInput<ArtColumn>): TableTransform;
|
|
11
|
+
export {};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { AbstractTreeNode } from '../../interfaces';
|
|
2
|
-
export interface StrictTreeDataHelperOptions<N extends AbstractTreeNode> {
|
|
3
|
-
tree: N[];
|
|
4
|
-
getNodeValue(node: N): string;
|
|
5
|
-
value: string[];
|
|
6
|
-
}
|
|
7
|
-
export default class StrictTreeDataHelper<N extends AbstractTreeNode> {
|
|
8
|
-
private readonly opts;
|
|
9
|
-
private readonly valueSet;
|
|
10
|
-
private wrapperMap;
|
|
11
|
-
private rootWrapper;
|
|
12
|
-
constructor(opts: StrictTreeDataHelperOptions<N>);
|
|
13
|
-
private initWrapperTree;
|
|
14
|
-
private get value();
|
|
15
|
-
isIndeterminate(nodeValue: string): boolean;
|
|
16
|
-
isChecked(nodeValue: string): boolean;
|
|
17
|
-
getValueAfterCheck(nodeValue: string): string[];
|
|
18
|
-
getValueAfterUncheck(nodeValue: string): string[];
|
|
19
|
-
getValueAfterToggle(nodeValue: string): string[];
|
|
20
|
-
getNode(nodeValue: string): N;
|
|
21
|
-
getCleanValue(): string[];
|
|
22
|
-
}
|
|
1
|
+
import { AbstractTreeNode } from '../../interfaces';
|
|
2
|
+
export interface StrictTreeDataHelperOptions<N extends AbstractTreeNode> {
|
|
3
|
+
tree: N[];
|
|
4
|
+
getNodeValue(node: N): string;
|
|
5
|
+
value: string[];
|
|
6
|
+
}
|
|
7
|
+
export default class StrictTreeDataHelper<N extends AbstractTreeNode> {
|
|
8
|
+
private readonly opts;
|
|
9
|
+
private readonly valueSet;
|
|
10
|
+
private wrapperMap;
|
|
11
|
+
private rootWrapper;
|
|
12
|
+
constructor(opts: StrictTreeDataHelperOptions<N>);
|
|
13
|
+
private initWrapperTree;
|
|
14
|
+
private get value();
|
|
15
|
+
isIndeterminate(nodeValue: string): boolean;
|
|
16
|
+
isChecked(nodeValue: string): boolean;
|
|
17
|
+
getValueAfterCheck(nodeValue: string): string[];
|
|
18
|
+
getValueAfterUncheck(nodeValue: string): string[];
|
|
19
|
+
getValueAfterToggle(nodeValue: string): string[];
|
|
20
|
+
getNode(nodeValue: string): N;
|
|
21
|
+
getCleanValue(): string[];
|
|
22
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { AbstractTreeNode } from '../../interfaces';
|
|
2
|
-
export
|
|
3
|
-
export interface TreeDataHelperOptions<N extends AbstractTreeNode> {
|
|
4
|
-
tree: N[];
|
|
5
|
-
getNodeValue(node: N): string;
|
|
6
|
-
value: string[];
|
|
7
|
-
checkedStrategy: CheckedStrategy;
|
|
8
|
-
isDetached?(node: N): boolean;
|
|
9
|
-
}
|
|
10
|
-
export default class TreeDataHelper<N extends AbstractTreeNode> {
|
|
11
|
-
private readonly opts;
|
|
12
|
-
private readonly valueSet;
|
|
13
|
-
private wrapperMap;
|
|
14
|
-
private rootWrapper;
|
|
15
|
-
constructor(opts: TreeDataHelperOptions<N>);
|
|
16
|
-
private get value();
|
|
17
|
-
private isDetached;
|
|
18
|
-
private initWrapperTree;
|
|
19
|
-
isIndeterminate(nodeValue: string): boolean;
|
|
20
|
-
isChecked(nodeValue: string): boolean;
|
|
21
|
-
getValueAfterCheck(nodeValue: string): string[];
|
|
22
|
-
getValueAfterUncheck(nodeValue: string): string[];
|
|
23
|
-
getValueAfterToggle(nodeValue: string): string[];
|
|
24
|
-
getNode(nodeValue: string): N;
|
|
25
|
-
getCleanValue(): string[];
|
|
26
|
-
}
|
|
1
|
+
import { AbstractTreeNode } from '../../interfaces';
|
|
2
|
+
export type CheckedStrategy = 'all' | 'parent' | 'child';
|
|
3
|
+
export interface TreeDataHelperOptions<N extends AbstractTreeNode> {
|
|
4
|
+
tree: N[];
|
|
5
|
+
getNodeValue(node: N): string;
|
|
6
|
+
value: string[];
|
|
7
|
+
checkedStrategy: CheckedStrategy;
|
|
8
|
+
isDetached?(node: N): boolean;
|
|
9
|
+
}
|
|
10
|
+
export default class TreeDataHelper<N extends AbstractTreeNode> {
|
|
11
|
+
private readonly opts;
|
|
12
|
+
private readonly valueSet;
|
|
13
|
+
private wrapperMap;
|
|
14
|
+
private rootWrapper;
|
|
15
|
+
constructor(opts: TreeDataHelperOptions<N>);
|
|
16
|
+
private get value();
|
|
17
|
+
private isDetached;
|
|
18
|
+
private initWrapperTree;
|
|
19
|
+
isIndeterminate(nodeValue: string): boolean;
|
|
20
|
+
isChecked(nodeValue: string): boolean;
|
|
21
|
+
getValueAfterCheck(nodeValue: string): string[];
|
|
22
|
+
getValueAfterUncheck(nodeValue: string): string[];
|
|
23
|
+
getValueAfterToggle(nodeValue: string): string[];
|
|
24
|
+
getNode(nodeValue: string): N;
|
|
25
|
+
getCleanValue(): string[];
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guozhi5658/srp-table",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "High-performance React table component library",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "dist/srp-table.esm.js",
|
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
"@babel/preset-env": "^7.12.1",
|
|
49
49
|
"@babel/preset-typescript": "^7.12.1",
|
|
50
50
|
"@rollup/plugin-node-resolve": "^11.2.0",
|
|
51
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
51
52
|
"@types/jest": "^26.0.15",
|
|
53
|
+
"@types/node": "^16.11.24",
|
|
52
54
|
"@types/react": "18.0.17",
|
|
53
55
|
"@types/react-dom": "18.0.11",
|
|
54
56
|
"@types/styled-components": "^5.1.9",
|
|
@@ -59,9 +61,8 @@
|
|
|
59
61
|
"react-is": "^16.13.0",
|
|
60
62
|
"rimraf": "^3.0.2",
|
|
61
63
|
"rollup": "^2.3.1",
|
|
62
|
-
"rollup-plugin-typescript2": "^0.36.0",
|
|
63
64
|
"tslib": "^2.8.1",
|
|
64
|
-
"typescript": "
|
|
65
|
+
"typescript": "^5.6.3",
|
|
65
66
|
"vite": "^4.5.14",
|
|
66
67
|
"xlsx": "^0.16.0"
|
|
67
68
|
},
|