comins-table 0.1.1 → 0.1.2
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/CHANGELOG.md +8 -0
- package/README.md +12 -7
- package/dist/core.d.ts +46 -46
- package/dist/core.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +638 -565
- package/dist/index.js.map +1 -1
- package/dist/summary.d.ts +17 -1
- package/dist/summary.d.ts.map +1 -1
- package/dist/tree.d.ts +5 -2
- package/dist/tree.d.ts.map +1 -1
- package/package.json +12 -8
package/dist/summary.d.ts
CHANGED
|
@@ -6,9 +6,25 @@ export type CominsSummaryAggregator<TData> = (input: {
|
|
|
6
6
|
rows: readonly TData[];
|
|
7
7
|
values: readonly unknown[];
|
|
8
8
|
}) => React.ReactNode;
|
|
9
|
+
export type CominsSummaryFormatPayload<TData> = {
|
|
10
|
+
column: CominsTableRuntimeColumn<TData>;
|
|
11
|
+
rows: readonly TData[];
|
|
12
|
+
value: React.ReactNode;
|
|
13
|
+
values: readonly unknown[];
|
|
14
|
+
};
|
|
15
|
+
export type CominsSummaryColumnConfig<TData> = {
|
|
16
|
+
aggregate: CominsSummaryBuiltin | CominsSummaryAggregator<TData>;
|
|
17
|
+
className?: string;
|
|
18
|
+
colSpan?: number;
|
|
19
|
+
format?: (payload: CominsSummaryFormatPayload<TData>) => React.ReactNode;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
};
|
|
22
|
+
export type CominsSummaryColumn<TData> = CominsSummaryBuiltin | CominsSummaryAggregator<TData> | CominsSummaryColumnConfig<TData>;
|
|
9
23
|
export type CominsTableSummaryConfig<TData> = {
|
|
10
|
-
|
|
24
|
+
className?: string;
|
|
25
|
+
columns: Partial<Record<string, CominsSummaryColumn<TData>>>;
|
|
11
26
|
label?: React.ReactNode;
|
|
27
|
+
style?: React.CSSProperties;
|
|
12
28
|
};
|
|
13
29
|
export declare function getCominsSummaryValues<TData>(rows: readonly TData[], columns: readonly CominsTableRuntimeColumn<TData>[], summary: CominsTableSummaryConfig<TData>): Record<string, React.ReactNode>;
|
|
14
30
|
//# sourceMappingURL=summary.d.ts.map
|
package/dist/summary.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3E,MAAM,MAAM,uBAAuB,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE;IACnD,MAAM,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,EAAE,SAAS,KAAK,EAAE,CAAC;IACvB,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;CAC5B,KAAK,KAAK,CAAC,SAAS,CAAC;AAEtB,MAAM,MAAM,wBAAwB,CAAC,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3E,MAAM,MAAM,uBAAuB,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE;IACnD,MAAM,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,EAAE,SAAS,KAAK,EAAE,CAAC;IACvB,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;CAC5B,KAAK,KAAK,CAAC,SAAS,CA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BjC"}
|
package/dist/tree.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ export type CominsTreeNode<TItem> = {
|
|
|
4
4
|
expand?: boolean;
|
|
5
5
|
item: TItem;
|
|
6
6
|
};
|
|
7
|
+
export type CominsTreeExpansionOptions = {
|
|
8
|
+
defaultExpandAll?: boolean;
|
|
9
|
+
};
|
|
7
10
|
export type CominsVisibleTreeRow<TItem> = {
|
|
8
11
|
depth: number;
|
|
9
12
|
expanded: boolean;
|
|
@@ -12,9 +15,9 @@ export type CominsVisibleTreeRow<TItem> = {
|
|
|
12
15
|
path: readonly number[];
|
|
13
16
|
rowId: CominsRowId;
|
|
14
17
|
};
|
|
15
|
-
export declare function flattenCominsTree<TItem>(nodes: readonly CominsTreeNode<TItem>[], getRowId: (item: TItem, index: number) => CominsRowId): CominsVisibleTreeRow<TItem>[];
|
|
18
|
+
export declare function flattenCominsTree<TItem>(nodes: readonly CominsTreeNode<TItem>[], getRowId: (item: TItem, index: number) => CominsRowId, options?: CominsTreeExpansionOptions): CominsVisibleTreeRow<TItem>[];
|
|
16
19
|
export declare function getCominsTreeLeafItems<TItem>(nodes: readonly CominsTreeNode<TItem>[]): TItem[];
|
|
17
|
-
export declare function toggleCominsTreeNode<TItem>(nodes: readonly CominsTreeNode<TItem>[], rowId: CominsRowId, getRowId: (item: TItem, index: number) => CominsRowId): CominsTreeNode<TItem>[];
|
|
20
|
+
export declare function toggleCominsTreeNode<TItem>(nodes: readonly CominsTreeNode<TItem>[], rowId: CominsRowId, getRowId: (item: TItem, index: number) => CominsRowId, options?: CominsTreeExpansionOptions): CominsTreeNode<TItem>[];
|
|
18
21
|
export declare function updateCominsTreeItem<TItem>(nodes: readonly CominsTreeNode<TItem>[], rowId: CominsRowId, getRowId: (item: TItem, index: number) => CominsRowId, update: (item: TItem) => TItem): CominsTreeNode<TItem>[];
|
|
19
22
|
export declare function sortCominsTreeSiblings<TItem>(nodes: readonly CominsTreeNode<TItem>[], compare: (left: TItem, right: TItem) => number): CominsTreeNode<TItem>[];
|
|
20
23
|
//# sourceMappingURL=tree.d.ts.map
|
package/dist/tree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI;IAClC,QAAQ,CAAC,EAAE,SAAS,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,KAAK,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,KAAK,IAAI;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AA0EF,wBAAgB,iBAAiB,CAAC,KAAK,EACrC,KAAK,EAAE,SAAS,cAAc,CAAC,KAAK,CAAC,EAAE,EACvC,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI;IAClC,QAAQ,CAAC,EAAE,SAAS,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,KAAK,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,gBAAgB,CAAC,EAAE,OAAO,CAAC;C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,CAAC,KAAK,CAAC,EAAE,EACvC,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,KAAK,MAAM,GAC7C,cAAc,CAAC,KAAK,CAAC,EAAE,CAOzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comins-table",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -13,16 +13,20 @@
|
|
|
13
13
|
"homepage": "https://github.com/kim1124/comins-table#readme",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "vite build && tsc -p tsconfig.build.json",
|
|
16
|
+
"check:hygiene": "node scripts/check-repository-hygiene.mjs",
|
|
16
17
|
"dev": "vite --config vite.example.config.ts",
|
|
17
18
|
"lint": "tsc --noEmit",
|
|
19
|
+
"setup:hooks": "git config core.hooksPath .githooks",
|
|
18
20
|
"test": "vitest",
|
|
19
21
|
"test:consumer": "node scripts/consumer-smoke.mjs",
|
|
20
22
|
"test:e2e": "env -u NO_COLOR playwright test --config=playwright.config.ts --grep-invert @perf",
|
|
21
23
|
"test:perf": "env -u NO_COLOR playwright test --config=playwright.config.ts --grep @perf",
|
|
22
24
|
"test:run": "vitest run",
|
|
23
|
-
"
|
|
25
|
+
"test:security": "node --test test/sensitive-data-gates.node.mjs test/package-artifact-gate.node.mjs",
|
|
26
|
+
"verify": "npm run check:hygiene && npm run test:security && npm run lint && npm run test:run && npm run build",
|
|
24
27
|
"verify:e2e": "npm run test:e2e",
|
|
25
|
-
"verify:full": "npm run verify && npm run verify:e2e"
|
|
28
|
+
"verify:full": "npm run verify && npm run verify:e2e",
|
|
29
|
+
"verify:package-artifact": "node scripts/verify-package-artifact.mjs"
|
|
26
30
|
},
|
|
27
31
|
"exports": {
|
|
28
32
|
".": {
|
|
@@ -58,18 +62,18 @@
|
|
|
58
62
|
},
|
|
59
63
|
"devDependencies": {
|
|
60
64
|
"@playwright/test": "^1.61.1",
|
|
61
|
-
"@tailwindcss/postcss": "^4.3.
|
|
65
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
62
66
|
"@types/react": "^19.2.17",
|
|
63
67
|
"@types/react-dom": "^19.2.3",
|
|
64
68
|
"@vitejs/plugin-react": "^6.0.3",
|
|
65
69
|
"jsdom": "^29.1.1",
|
|
66
70
|
"prism-react-renderer": "^2.4.1",
|
|
67
|
-
"react-router": "^
|
|
68
|
-
"typescript": "^
|
|
69
|
-
"vite": "^8.1.
|
|
71
|
+
"react-router": "^8.2.0",
|
|
72
|
+
"typescript": "^7.0.2",
|
|
73
|
+
"vite": "^8.1.5",
|
|
70
74
|
"vitest": "^4.1.10"
|
|
71
75
|
},
|
|
72
76
|
"dependencies": {
|
|
73
|
-
"lucide-react": "^1.
|
|
77
|
+
"lucide-react": "^1.25.0"
|
|
74
78
|
}
|
|
75
79
|
}
|