comins-table 0.1.7 → 0.1.9

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.
@@ -1,3 +1,3 @@
1
1
  export { clearCominsCellRange, clearCominsSelection, getCominsSelectedCellRange, isCominsCellInSelectedRange, isCominsCellSelected, isCominsRowSelected, selectCell, selectCellRange, selectRow, } from "./core";
2
- export type { CominsCellAddress, CominsCellRange, CominsRowSelectionOptions, CominsSelectionState, } from "./core";
2
+ export type { CominsCellAddress, CominsCellRange, CominsCellSelectionOptions, CominsRowSelectionOptions, CominsSelectionState, } from "./core";
3
3
  //# sourceMappingURL=selection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,SAAS,GACV,MAAM,QAAQ,CAAC;AAEhB,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,SAAS,GACV,MAAM,QAAQ,CAAC;AAEhB,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,QAAQ,CAAC"}
package/dist/selection.js CHANGED
@@ -1,2 +1,2 @@
1
- import { clearCominsCellRange as e, clearCominsSelection as t, getCominsSelectedCellRange as n, isCominsCellInSelectedRange as r, isCominsCellSelected as i, isCominsRowSelected as a, selectCell as o, selectCellRange as s, selectRow as c } from "./core.js";
2
- export { e as clearCominsCellRange, t as clearCominsSelection, n as getCominsSelectedCellRange, r as isCominsCellInSelectedRange, i as isCominsCellSelected, a as isCominsRowSelected, o as selectCell, s as selectCellRange, c as selectRow };
1
+ import { D as e, E as t, L as n, R as r, T as i, b as a, i as o, r as s, z as c } from "./core-D01wEe-7.js";
2
+ export { s as clearCominsCellRange, o as clearCominsSelection, a as getCominsSelectedCellRange, i as isCominsCellInSelectedRange, t as isCominsCellSelected, e as isCominsRowSelected, n as selectCell, r as selectCellRange, c as selectRow };
@@ -0,0 +1,153 @@
1
+ import type React from "react";
2
+ import type { CominsRowId } from "./core";
3
+ export type CominsTableTransferConflictPolicy = "overwrite" | "reject";
4
+ export type CominsTableTransferDropPosition = "after" | "append" | "before";
5
+ export type CominsTableTransferRowEndpoint<TData> = {
6
+ dataIndex: number;
7
+ row: TData;
8
+ rowId: CominsRowId;
9
+ tableId: string;
10
+ };
11
+ export type CominsTableTransferGroupEndpoint<TData, TGroup> = {
12
+ group: TGroup;
13
+ groupId: CominsRowId;
14
+ groupIndex: number;
15
+ rows: readonly CominsTableTransferRowEndpoint<TData>[];
16
+ tableId: string;
17
+ };
18
+ export type CominsTableTransferConflict<TData, TGroup> = {
19
+ kind: "row";
20
+ rowId: CominsRowId;
21
+ source: CominsTableTransferRowEndpoint<TData>;
22
+ target: CominsTableTransferRowEndpoint<TData>;
23
+ } | {
24
+ groupId: CominsRowId;
25
+ kind: "group";
26
+ source: CominsTableTransferGroupEndpoint<TData, TGroup>;
27
+ target: CominsTableTransferGroupEndpoint<TData, TGroup>;
28
+ };
29
+ export type CominsTableTransferResolvedConflict<TData, TGroup> = {
30
+ conflict: CominsTableTransferConflict<TData, TGroup>;
31
+ policy: CominsTableTransferConflictPolicy;
32
+ };
33
+ export type CominsTableTransferConflictResolver<TData, TGroup> = (conflict: CominsTableTransferConflict<TData, TGroup>) => CominsTableTransferConflictPolicy | undefined;
34
+ export type CominsTableTransferIntent<TData, TGroup> = {
35
+ kind: "row";
36
+ row: TData;
37
+ sourceRowId: CominsRowId;
38
+ sourceTableId: string;
39
+ targetGroupId?: CominsRowId;
40
+ targetRowId?: CominsRowId;
41
+ targetTableId: string;
42
+ } | {
43
+ group: TGroup;
44
+ kind: "group";
45
+ rows: readonly TData[];
46
+ sourceGroupId: CominsRowId;
47
+ sourceTableId: string;
48
+ targetGroupId?: CominsRowId;
49
+ targetTableId: string;
50
+ };
51
+ export type CominsTableTransferRejection<TData, TGroup = never> = {
52
+ conflict: CominsTableTransferConflict<TData, TGroup>;
53
+ kind: "group" | "row";
54
+ reason: "duplicate-id";
55
+ sourceTableId: string;
56
+ targetTableId: string;
57
+ };
58
+ export type CominsTableTransferRejectionFeedback<TData, TGroup = never> = {
59
+ duration?: number;
60
+ renderTooltip?: (rejection: CominsTableTransferRejection<TData, TGroup>) => React.ReactNode;
61
+ };
62
+ declare const cominsTableTransferCoordinatorBrand: unique symbol;
63
+ export type CominsTableTransferCoordinator<TData, TGroup = never> = {
64
+ readonly [cominsTableTransferCoordinatorBrand]: (data: TData, group: TGroup) => [TData, TGroup];
65
+ };
66
+ export type CominsTableTransferCoordinatorOptions<TData, TGroup = never> = {
67
+ onTransfer: (result: CominsTableTransferResult<TData, TGroup>) => void;
68
+ onTransferRejected?: (rejection: CominsTableTransferRejection<TData, TGroup>) => void;
69
+ };
70
+ export type CominsTableTransferConfig<TData, TGroup = never> = {
71
+ canTransfer?: (intent: CominsTableTransferIntent<TData, TGroup>) => boolean;
72
+ coordinator: CominsTableTransferCoordinator<TData, TGroup>;
73
+ rejectionFeedback?: false | CominsTableTransferRejectionFeedback<TData, TGroup>;
74
+ resolveConflict?: CominsTableTransferConflictResolver<TData, TGroup>;
75
+ scope: string;
76
+ tableId: string;
77
+ };
78
+ export type CominsTableTransferEndpoint<TData, TGroup = never> = {
79
+ data: readonly TData[];
80
+ getGroupId?: (group: TGroup) => CominsRowId;
81
+ getRowGroupId?: (row: TData, dataIndex: number) => CominsRowId;
82
+ getRowId: (row: TData, dataIndex: number) => CominsRowId;
83
+ groups?: readonly TGroup[];
84
+ setRowGroupId?: (params: {
85
+ fromGroupId: CominsRowId;
86
+ row: TData;
87
+ rowId: CominsRowId;
88
+ toGroupId: CominsRowId;
89
+ }) => TData;
90
+ tableId: string;
91
+ };
92
+ type CominsTableTransferNextEndpoint<TData, TGroup> = {
93
+ data: TData[];
94
+ groups?: TGroup[];
95
+ tableId: string;
96
+ };
97
+ export type CominsTableRowTransferDetails<TData, TGroup> = {
98
+ conflicts: readonly CominsTableTransferResolvedConflict<TData, TGroup>[];
99
+ kind: "row";
100
+ sourceRowId: CominsRowId;
101
+ targetGroupId?: CominsRowId;
102
+ targetRowId?: CominsRowId;
103
+ };
104
+ export type CominsTableGroupTransferDetails<TData, TGroup> = {
105
+ conflicts: readonly CominsTableTransferResolvedConflict<TData, TGroup>[];
106
+ kind: "group";
107
+ position: CominsTableTransferDropPosition;
108
+ sourceGroupId: CominsRowId;
109
+ targetGroupId?: CominsRowId;
110
+ };
111
+ export type CominsTableTransferDetails<TData, TGroup> = CominsTableGroupTransferDetails<TData, TGroup> | CominsTableRowTransferDetails<TData, TGroup>;
112
+ export type CominsTableTransferResult<TData, TGroup = never> = {
113
+ details: CominsTableTransferDetails<TData, TGroup>;
114
+ kind: "group" | "row";
115
+ source: CominsTableTransferNextEndpoint<TData, TGroup>;
116
+ target: CominsTableTransferNextEndpoint<TData, TGroup>;
117
+ };
118
+ export type CominsRowBetweenTablesInput<TData, TGroup = never> = {
119
+ resolveConflict?: CominsTableTransferConflictResolver<TData, TGroup>;
120
+ source: CominsTableTransferEndpoint<TData, TGroup>;
121
+ sourceRowId: CominsRowId;
122
+ target: CominsTableTransferEndpoint<TData, TGroup>;
123
+ targetGroupId?: CominsRowId;
124
+ targetRowId?: CominsRowId;
125
+ };
126
+ export type CominsGroupBetweenTablesInput<TData, TGroup> = {
127
+ position?: CominsTableTransferDropPosition;
128
+ resolveConflict?: CominsTableTransferConflictResolver<TData, TGroup>;
129
+ source: CominsTableTransferEndpoint<TData, TGroup>;
130
+ sourceGroupId: CominsRowId;
131
+ target: CominsTableTransferEndpoint<TData, TGroup>;
132
+ targetGroupId?: CominsRowId;
133
+ };
134
+ export type CominsTableTransferRegistrationSnapshot<TData, TGroup> = {
135
+ config: CominsTableTransferConfig<TData, TGroup>;
136
+ endpoint: CominsTableTransferEndpoint<TData, TGroup>;
137
+ instanceId: string;
138
+ root: HTMLElement | null;
139
+ viewport: HTMLElement | null;
140
+ };
141
+ export type CominsTableTransferRegistration<TData, TGroup> = {
142
+ getSnapshot: () => CominsTableTransferRegistrationSnapshot<TData, TGroup> | null;
143
+ };
144
+ export declare function createCominsTableTransferCoordinator<TData, TGroup = never>(options: CominsTableTransferCoordinatorOptions<TData, TGroup>): CominsTableTransferCoordinator<TData, TGroup>;
145
+ export declare function isCominsTableTransferCoordinator<TData, TGroup>(coordinator: unknown): coordinator is CominsTableTransferCoordinator<TData, TGroup>;
146
+ export declare function registerCominsTableTransfer<TData, TGroup>(coordinator: CominsTableTransferCoordinator<TData, TGroup>, scope: string, tableId: string, registration: CominsTableTransferRegistration<TData, TGroup>): () => void;
147
+ export declare function getCominsTableTransferRegistration<TData, TGroup>(coordinator: CominsTableTransferCoordinator<TData, TGroup>, scope: string, tableId: string): CominsTableTransferRegistration<TData, TGroup> | null;
148
+ export declare function emitCominsTableTransfer<TData, TGroup>(coordinator: CominsTableTransferCoordinator<TData, TGroup>, result: CominsTableTransferResult<TData, TGroup>): boolean;
149
+ export declare function emitCominsTableTransferRejected<TData, TGroup>(coordinator: CominsTableTransferCoordinator<TData, TGroup>, rejection: CominsTableTransferRejection<TData, TGroup>): boolean;
150
+ export declare function transferCominsRowBetweenTables<TData, TGroup = never>(input: CominsRowBetweenTablesInput<TData, TGroup>): CominsTableTransferResult<TData, TGroup> | null;
151
+ export declare function transferCominsGroupBetweenTables<TData, TGroup>(input: CominsGroupBetweenTablesInput<TData, TGroup>): CominsTableTransferResult<TData, TGroup> | null;
152
+ export {};
153
+ //# sourceMappingURL=table-transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-transfer.d.ts","sourceRoot":"","sources":["../src/table-transfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C,MAAM,MAAM,iCAAiC,GAAG,WAAW,GAAG,QAAQ,CAAC;AACvE,MAAM,MAAM,+BAA+B,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5E,MAAM,MAAM,8BAA8B,CAAC,KAAK,IAAI;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,KAAK,CAAC;IACX,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gCAAgC,CAAC,KAAK,EAAE,MAAM,IAAI;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,8BAA8B,CAAC,KAAK,CAAC,EAAE,CAAC;IACvD,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,2BAA2B,CAAC,KAAK,EAAE,MAAM,IACjD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,8BAA8B,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,EAAE,8BAA8B,CAAC,KAAK,CAAC,CAAC;CAC/C,GACD;IACE,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,gCAAgC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACxD,MAAM,EAAE,gCAAgC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CACzD,CAAC;AA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C,EAC1D,MAAM,EAAE,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,WAUjD;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,EAC3D,WAAW,EAAE,8BAA8B,CAAC,KAAK,EAAE,MAAM,CAAC,EAC1D,SAAS,EAAE,4BAA4B,CAAC,KAAK,EAAE,MAAM,CAAC,WAUvD;AA4ED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAClE,KAAK,EAAE,2BAA2B,CAAC,KAAK,EAAE,MAAM,CAAC,GAChD,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CA8IjD;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,MAAM,EAC5D,KAAK,EAAE,6BAA6B,CAAC,KAAK,EAAE,MAAM,CAAC,GAClD,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAuJjD"}
@@ -0,0 +1,14 @@
1
+ import type React from "react";
2
+ export type CominsTooltipSurfaceProps = {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ icon?: React.ReactNode;
6
+ tone?: "danger" | "neutral";
7
+ };
8
+ export declare function CominsTooltipSurface({ children, className, icon, tone, }: CominsTooltipSurfaceProps): React.JSX.Element;
9
+ export type CominsPointerTooltipProps = CominsTooltipSurfaceProps & {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ export declare function CominsPointerTooltip({ children, className, icon, tone, x, y, }: CominsPointerTooltipProps): React.JSX.Element;
14
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,IAAgB,GACjB,EAAE,yBAAyB,qBAa3B;AAED,MAAM,MAAM,yBAAyB,GAAG,yBAAyB,GAAG;IAClE,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,CAAC,GACF,EAAE,yBAAyB,qBAiD3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comins-table",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -13,6 +13,7 @@
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:docs": "node scripts/check-documentation-contract.mjs",
16
17
  "check:hygiene": "node scripts/check-repository-hygiene.mjs",
17
18
  "check:licenses": "node scripts/check-licenses.mjs",
18
19
  "dev": "vite --config vite.example.config.ts",
@@ -26,9 +27,10 @@
26
27
  "test:run": "vitest run",
27
28
  "test:licenses": "node --test test/license-gates.node.mjs",
28
29
  "test:security": "node --test test/sensitive-data-gates.node.mjs test/package-artifact-gate.node.mjs test/npm-maintainer-gate.node.mjs",
29
- "verify": "npm run check:hygiene && npm run test:security && npm run test:licenses && npm run check:licenses && npm run lint && npm run test:run && npm run build",
30
+ "verify": "npm run check:hygiene && npm run check:docs && npm run test:security && npm run test:licenses && npm run check:licenses && npm run lint && npm run test:run && npm run build",
30
31
  "verify:e2e": "npm run test:e2e",
31
- "verify:full": "npm run verify && npm run verify:e2e",
32
+ "verify:local": "npm run verify && npm run verify:e2e",
33
+ "verify:full": "npm run verify:local && npm run test:perf -- --workers=1",
32
34
  "verify:npm-maintainer": "node scripts/check-npm-maintainer.mjs",
33
35
  "verify:package-artifact": "node scripts/verify-package-artifact.mjs"
34
36
  },
@@ -53,6 +55,7 @@
53
55
  },
54
56
  "files": [
55
57
  "dist",
58
+ "DESIGN.md",
56
59
  "README.md",
57
60
  "styles.css",
58
61
  "CHANGELOG.md",
package/styles.css CHANGED
@@ -50,6 +50,11 @@
50
50
  --comins-table-scrollbar-track: var(--comins-table-surface-muted);
51
51
  --comins-table-surface: #ffffff;
52
52
  --comins-table-surface-muted: #f6fcfa;
53
+ --comins-table-tooltip-danger-background: #7f1d1d;
54
+ --comins-table-tooltip-danger-border: rgba(254, 202, 202, 0.28);
55
+ --comins-table-tooltip-danger-color: #ffffff;
56
+ --comins-table-tooltip-danger-muted: #fecaca;
57
+ --comins-table-tooltip-shadow: 0 12px 30px rgba(69, 10, 10, 0.28);
53
58
  --comins-table-component-accent: var(--comins-table-accent);
54
59
  --comins-table-component-accent-foreground: var(--comins-table-accent-foreground);
55
60
  --comins-table-component-accent-strong: var(--comins-table-accent-strong);
@@ -321,6 +326,7 @@
321
326
  background: inherit;
322
327
  color: inherit;
323
328
  font-weight: 600;
329
+ overflow: visible;
324
330
  text-align: left;
325
331
  }
326
332
 
@@ -328,7 +334,10 @@
328
334
  align-items: center;
329
335
  display: flex;
330
336
  gap: 4px;
337
+ left: var(--comins-table-cell-padding-x);
331
338
  min-width: 0;
339
+ position: sticky;
340
+ width: max-content;
332
341
  }
333
342
 
334
343
  .comins-row-group-content {
@@ -389,6 +398,25 @@
389
398
  box-shadow: inset 0 -3px var(--comins-table-drop-marker);
390
399
  }
391
400
 
401
+ .comins-table__group-row[data-comins-group-drop-valid="false"] > .comins-table__group-cell {
402
+ background: var(--comins-table-drop-invalid-background);
403
+ }
404
+
405
+ .comins-table__body-viewport[data-comins-group-drop-valid="true"],
406
+ .comins-table__body-viewport[data-comins-row-drop-valid="true"] {
407
+ box-shadow: inset 0 0 0 3px var(--comins-table-drop-marker);
408
+ }
409
+
410
+ .comins-table__body-viewport[data-comins-group-drop-valid="false"],
411
+ .comins-table__body-viewport[data-comins-row-drop-valid="false"] {
412
+ box-shadow: inset 0 0 0 3px var(--comins-table-drop-invalid);
413
+ }
414
+
415
+ .comins-table[data-comins-transfer-rejected="true"] {
416
+ outline: 1px solid var(--comins-table-drop-invalid);
417
+ outline-offset: -1px;
418
+ }
419
+
392
420
  .comins-table__group-row[data-comins-row-drop-valid="true"] > .comins-table__group-cell {
393
421
  background: var(--comins-table-drop-valid-background);
394
422
  }
@@ -463,31 +491,57 @@
463
491
  }
464
492
 
465
493
  .comins-table__body-viewport[data-horizontal-overflow="true"] {
466
- overflow-x: scroll;
494
+ overflow-x: hidden;
467
495
  overflow-y: scroll;
468
496
  scrollbar-gutter: stable;
469
497
  }
470
498
 
471
- .comins-table__body-viewport::-webkit-scrollbar {
499
+ .comins-table__horizontal-scrollbar {
500
+ border-top: 1px solid var(--comins-table-row-border);
501
+ box-sizing: border-box;
502
+ flex: 0 0 12px;
503
+ max-width: 100%;
504
+ min-height: 12px;
505
+ overflow-x: scroll;
506
+ overflow-y: hidden;
507
+ scrollbar-color: var(--comins-table-scrollbar-thumb) var(--comins-table-scrollbar-track);
508
+ }
509
+
510
+ .comins-table__horizontal-scrollbar-content {
511
+ height: 1px;
512
+ pointer-events: none;
513
+ }
514
+
515
+ .comins-table__horizontal-range-spacer {
516
+ height: 0;
517
+ pointer-events: none;
518
+ }
519
+
520
+ .comins-table__body-viewport::-webkit-scrollbar,
521
+ .comins-table__horizontal-scrollbar::-webkit-scrollbar {
472
522
  height: 12px;
473
523
  width: 12px;
474
524
  }
475
525
 
476
- .comins-table__body-viewport::-webkit-scrollbar-track {
526
+ .comins-table__body-viewport::-webkit-scrollbar-track,
527
+ .comins-table__horizontal-scrollbar::-webkit-scrollbar-track {
477
528
  background: var(--comins-table-scrollbar-track);
478
529
  }
479
530
 
480
- .comins-table__body-viewport::-webkit-scrollbar-thumb {
531
+ .comins-table__body-viewport::-webkit-scrollbar-thumb,
532
+ .comins-table__horizontal-scrollbar::-webkit-scrollbar-thumb {
481
533
  background: var(--comins-table-scrollbar-thumb);
482
534
  border: 3px solid var(--comins-table-scrollbar-track);
483
535
  border-radius: 999px;
484
536
  }
485
537
 
486
- .comins-table__body-viewport::-webkit-scrollbar-thumb:hover {
538
+ .comins-table__body-viewport::-webkit-scrollbar-thumb:hover,
539
+ .comins-table__horizontal-scrollbar::-webkit-scrollbar-thumb:hover {
487
540
  background: var(--comins-table-accent-strong);
488
541
  }
489
542
 
490
- .comins-table__body-viewport::-webkit-scrollbar-corner {
543
+ .comins-table__body-viewport::-webkit-scrollbar-corner,
544
+ .comins-table__horizontal-scrollbar::-webkit-scrollbar-corner {
491
545
  background: var(--comins-table-scrollbar-corner);
492
546
  }
493
547
 
@@ -1013,6 +1067,99 @@
1013
1067
  text-overflow: ellipsis;
1014
1068
  }
1015
1069
 
1070
+ .comins-pointer-tooltip {
1071
+ max-width: min(320px, calc(100vw - 16px));
1072
+ pointer-events: none;
1073
+ position: fixed;
1074
+ z-index: 80;
1075
+ }
1076
+
1077
+ .comins-tooltip-surface {
1078
+ align-items: flex-start;
1079
+ border: 1px solid transparent;
1080
+ border-radius: 8px;
1081
+ box-shadow: var(--comins-table-tooltip-shadow);
1082
+ display: inline-flex;
1083
+ font-size: 12px;
1084
+ gap: 8px;
1085
+ line-height: 1.4;
1086
+ max-width: 100%;
1087
+ padding: 9px 11px;
1088
+ position: relative;
1089
+ }
1090
+
1091
+ .comins-tooltip-surface::before {
1092
+ background: inherit;
1093
+ border-left: inherit;
1094
+ border-top: inherit;
1095
+ content: "";
1096
+ height: 8px;
1097
+ left: 14px;
1098
+ position: absolute;
1099
+ transform: rotate(45deg);
1100
+ width: 8px;
1101
+ }
1102
+
1103
+ .comins-pointer-tooltip[data-placement="below"] .comins-tooltip-surface::before {
1104
+ top: -5px;
1105
+ }
1106
+
1107
+ .comins-pointer-tooltip[data-placement="above"] .comins-tooltip-surface::before {
1108
+ bottom: -5px;
1109
+ transform: rotate(225deg);
1110
+ }
1111
+
1112
+ .comins-tooltip-surface--neutral {
1113
+ background: var(--comins-table-foreground);
1114
+ border-color: color-mix(in srgb, var(--comins-table-foreground) 72%, #ffffff);
1115
+ color: var(--comins-table-background);
1116
+ }
1117
+
1118
+ .comins-tooltip-surface--danger {
1119
+ background: var(--comins-table-tooltip-danger-background);
1120
+ border-color: var(--comins-table-tooltip-danger-border);
1121
+ color: var(--comins-table-tooltip-danger-color);
1122
+ }
1123
+
1124
+ .comins-tooltip-surface__icon {
1125
+ align-items: center;
1126
+ color: var(--comins-table-tooltip-danger-muted);
1127
+ display: inline-flex;
1128
+ flex: 0 0 auto;
1129
+ height: 18px;
1130
+ justify-content: center;
1131
+ width: 18px;
1132
+ }
1133
+
1134
+ .comins-tooltip-surface__warning {
1135
+ align-items: center;
1136
+ border: 1.5px solid currentColor;
1137
+ border-radius: 999px;
1138
+ display: inline-flex;
1139
+ font-size: 11px;
1140
+ font-weight: 900;
1141
+ height: 15px;
1142
+ justify-content: center;
1143
+ line-height: 1;
1144
+ width: 15px;
1145
+ }
1146
+
1147
+ .comins-tooltip-surface__content {
1148
+ display: grid;
1149
+ gap: 2px;
1150
+ min-width: 0;
1151
+ }
1152
+
1153
+ .comins-tooltip-surface__content > strong {
1154
+ font-size: 13px;
1155
+ font-weight: 800;
1156
+ }
1157
+
1158
+ .comins-tooltip-surface__content > span {
1159
+ color: var(--comins-table-tooltip-danger-muted);
1160
+ overflow-wrap: anywhere;
1161
+ }
1162
+
1016
1163
  .comins-sort-meta {
1017
1164
  align-items: center;
1018
1165
  display: inline-flex;
@@ -1119,6 +1266,15 @@
1119
1266
  color: var(--comins-table-drop-invalid);
1120
1267
  }
1121
1268
 
1269
+ .comins-table__tr[data-comins-cross-row-drop-position="before"] > .comins-table__td {
1270
+ box-shadow: inset 0 3px var(--comins-table-drop-marker);
1271
+ }
1272
+
1273
+ .comins-table__tr[data-comins-cross-row-drop-position="before"][data-comins-row-drop-valid="false"] > .comins-table__td {
1274
+ background: var(--comins-table-drop-invalid-background);
1275
+ box-shadow: inset 0 3px var(--comins-table-drop-invalid);
1276
+ }
1277
+
1122
1278
  .comins-table-empty-filler td {
1123
1279
  border-bottom: 0;
1124
1280
  border-right: 1px solid var(--comins-table-cell-border);
@@ -1143,6 +1299,53 @@
1143
1299
  background: var(--comins-table-row-custom-background);
1144
1300
  }
1145
1301
 
1302
+ .comins-table__th[data-comins-pinned] {
1303
+ background: var(--comins-table-header-background);
1304
+ z-index: 5;
1305
+ }
1306
+
1307
+ .comins-table__td[data-comins-pinned] {
1308
+ background: var(--comins-table-surface);
1309
+ z-index: 2;
1310
+ }
1311
+
1312
+ .comins-table__tr[data-comins-row-parity="even"] > .comins-table__td[data-comins-pinned] {
1313
+ background: var(--comins-table-row-even-background);
1314
+ }
1315
+
1316
+ .comins-table__tr[data-comins-row-parity="odd"] > .comins-table__td[data-comins-pinned] {
1317
+ background: var(--comins-table-row-odd-background);
1318
+ }
1319
+
1320
+ .comins-table__tr[data-comins-row-custom-background="true"] > .comins-table__td[data-comins-pinned] {
1321
+ background: var(--comins-table-row-custom-background);
1322
+ }
1323
+
1324
+ .comins-table__tr.comins-row-selected > .comins-table__td[data-comins-pinned] {
1325
+ background: var(--comins-table-row-selected-background);
1326
+ }
1327
+
1328
+ .comins-table__tr[data-disabled="true"] > .comins-table__td[data-comins-pinned] {
1329
+ background: var(--comins-table-row-disabled-background);
1330
+ }
1331
+
1332
+ .comins-table__td.comins-table__skeleton-cell[data-comins-pinned] {
1333
+ background: var(--comins-table-skeleton-background);
1334
+ }
1335
+
1336
+ .comins-table__summary-cell[data-comins-pinned] {
1337
+ background: var(--comins-table-surface-muted);
1338
+ z-index: 2;
1339
+ }
1340
+
1341
+ [data-comins-pinned="left"][data-comins-pin-boundary="true"] {
1342
+ border-right: 2px solid var(--comins-table-border);
1343
+ }
1344
+
1345
+ [data-comins-pinned="right"][data-comins-pin-boundary="true"] {
1346
+ border-left: 2px solid var(--comins-table-border);
1347
+ }
1348
+
1146
1349
  .comins-table__component-layout {
1147
1350
  align-items: center;
1148
1351
  display: inline-flex;