@xcelsior/ui-spreadsheets 1.1.18 → 1.2.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @xcelsior/ui-spreadsheets@1.1.4 build /Users/tuannguyen/Work/xcelsior-packages/packages/ui/ui-spreadsheets
2
+ > @xcelsior/ui-spreadsheets@1.1.18 build /Users/tuannguyen/Work/xcelsior-packages/packages/ui/ui-spreadsheets
3
3
  > tsup && tsc --noEmit
4
4
 
5
5
  CLI Building entry: src/index.ts, src/styles/globals.css
@@ -11,18 +11,18 @@
11
11
  CJS Build start
12
12
  ESM Build start
13
13
  DTS Build start
14
- CJS dist/styles/globals.css 33.16 KB
15
- CJS dist/index.js 173.50 KB
16
- CJS dist/styles/globals.css.map 55.29 KB
17
- CJS dist/index.js.map 4.65 MB
18
- CJS ⚡️ Build success in 397ms
19
- ESM dist/styles/globals.css 33.16 KB
20
- ESM dist/index.mjs 162.16 KB
21
- ESM dist/styles/globals.css.map 55.29 KB
22
- ESM dist/index.mjs.map 4.65 MB
23
- ESM ⚡️ Build success in 396ms
24
- DTS ⚡️ Build success in 2168ms
14
+ ESM dist/styles/globals.css 34.51 KB
15
+ ESM dist/index.mjs 180.51 KB
16
+ ESM dist/styles/globals.css.map 57.51 KB
17
+ ESM dist/index.mjs.map 4.69 MB
18
+ ESM ⚡️ Build success in 344ms
19
+ CJS dist/styles/globals.css 34.51 KB
20
+ CJS dist/index.js 192.38 KB
21
+ CJS dist/styles/globals.css.map 57.51 KB
22
+ CJS dist/index.js.map 4.69 MB
23
+ CJS ⚡️ Build success in 345ms
24
+ DTS ⚡️ Build success in 2201ms
25
25
  DTS dist/styles/globals.d.ts 13.00 B
26
- DTS dist/index.d.ts 26.27 KB
26
+ DTS dist/index.d.ts 27.85 KB
27
27
  DTS dist/styles/globals.d.mts 13.00 B
28
- DTS dist/index.d.mts 26.27 KB
28
+ DTS dist/index.d.mts 27.85 KB
@@ -1,185 +1 @@
1
-
2
- > @xcelsior/ui-spreadsheets@1.1.4 lint /Users/tuannguyen/Work/xcelsior-packages/packages/ui/ui-spreadsheets
3
- > biome check . && tsc --noEmit
4
-
5
-  at src/components/CommentModals.tsx:57:21 ]8;;https://biomejs.dev/linter/rules/no-autofocus\lint/a11y/noAutofocus]8;;\  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6
-
7
-  ⚠ Avoid the autoFocus attribute.
8
-  
9
-   55 │                     placeholder="Enter your comment..."
10
-   56 │                     className="w-full h-24 p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 resize-none"
11
-  > 57 │                     autoFocus
12
-     │                     ^^^^^^^^^
13
-   58 │                 />
14
-   59 │                 <div className="flex justify-end gap-2 mt-4">
15
-  
16
-  ℹ Unsafe fix: Remove the autoFocus attribute.
17
-  
18
-    55  55 │                       placeholder="Enter your comment..."
19
-    56  56 │                       className="w-full h-24 p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 resize-none"
20
-    57     │ - ····················autoFocus
21
-    58  57 │                   />
22
-    59  58 │                   <div className="flex justify-end gap-2 mt-4">
23
-  
24
- 
25
-  at src/components/Spreadsheet.tsx:845:45 ]8;;https://biomejs.dev/linter/rules/use-key-with-click-events\lint/a11y/useKeyWithClickEvents]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26
-
27
-  ⚠ Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
28
-  
29
-   843 │                                         >
30
-   844 │                                             {/* Row Index Column */}
31
-  > 845 │                                             <td
32
-      │                                             ^^^
33
-  > 846 │                                                 onClick={(e) => handleRowSelect(rowId, e)}
34
-      ...
35
-  > 874 │                                                 }}
36
-  > 875 │                                             >
37
-      │                                             ^
38
-   876 │                                                 <div className="relative flex items-center justify-center w-full h-full">
39
-   877 │                                                     {/* Row number - centered */}
40
-  
41
-  ℹ Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
42
-  
43
- 
44
-  at src/components/Spreadsheet.tsx:29:15 ]8;;https://biomejs.dev/linter/rules/no-unused-imports\lint/correctness/noUnusedImports]8;;\  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
45
-
46
-  ⚠ Several of these imports are unused.
47
-  
48
-   27 │ import { useSpreadsheetKeyboardShortcuts } from '../hooks/useSpreadsheetKeyboardShortcuts';
49
-   28 │ import { useSpreadsheetSelection } from '../hooks/useSpreadsheetSelection';
50
-  > 29 │ import type { CellEdit, SpreadsheetProps } from '../types';
51
-     │               ^^^^^^^^
52
-   30 │ 
53
-   31 │ type SingleCellEdit = {
54
-  
55
-  ℹ Unused imports might be the result of an incomplete refactoring.
56
-  
57
-  ℹ Unsafe fix: Remove the unused imports.
58
-  
59
-   29 │ import·type·{·CellEdit,·SpreadsheetProps·}·from·'../types';
60
-   │               ----------                                   
61
- 
62
-  at src/components/SpreadsheetCell.tsx:54:5 ]8;;https://biomejs.dev/linter/rules/no-unused-function-parameters\lint/correctness/noUnusedFunctionParameters]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
63
-
64
-  ⚠ This parameter is unused.
65
-  
66
-   52 │     onMouseDown,
67
-   53 │     onMouseEnter,
68
-  > 54 │     onChange,
69
-     │     ^^^^^^^^
70
-   55 │     onConfirm,
71
-   56 │     onCancel,
72
-  
73
-  ℹ Unused parameters might be the result of an incomplete refactoring.
74
-  
75
- 
76
-  at src/components/SpreadsheetFilterDropdown.tsx:188:9 ]8;;https://biomejs.dev/linter/rules/no-static-element-interactions\lint/a11y/noStaticElementInteractions]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
77
-
78
-  ⚠ Static Elements should not be interactive.
79
-  
80
-   187 │     return (
81
-  > 188 │         <div
82
-      │         ^^^^
83
-  > 189 │             ref={dropdownRef}
84
-      ...
85
-  > 194 │             onClick={(e) => e.stopPropagation()}
86
-  > 195 │         >
87
-      │         ^
88
-   196 │             <div className="px-3 py-2 border-b border-gray-200 bg-gray-50">
89
-   197 │                 <span className="text-xs font-medium text-gray-700">Filter: {column.label}</span>
90
-  
91
-  ℹ To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.
92
-  
93
- 
94
-  at src/components/SpreadsheetFilterDropdown.tsx:188:9 ]8;;https://biomejs.dev/linter/rules/use-key-with-click-events\lint/a11y/useKeyWithClickEvents]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95
-
96
-  ⚠ Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
97
-  
98
-   187 │     return (
99
-  > 188 │         <div
100
-      │         ^^^^
101
-  > 189 │             ref={dropdownRef}
102
-      ...
103
-  > 194 │             onClick={(e) => e.stopPropagation()}
104
-  > 195 │         >
105
-      │         ^
106
-   196 │             <div className="px-3 py-2 border-b border-gray-200 bg-gray-50">
107
-   197 │                 <span className="text-xs font-medium text-gray-700">Filter: {column.label}</span>
108
-  
109
-  ℹ Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
110
-  
111
- 
112
-  at src/hooks/useSpreadsheetSelection.ts:602:37 ]8;;https://biomejs.dev/linter/rules/no-global-is-nan\lint/suspicious/noGlobalIsNan]8;;\  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
113
-
114
-  ⚠ isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead.
115
-  
116
-   600 │                     if (column.type === 'number' && typeof cellValue === 'string') {
117
-   601 │                         const parsed = parseFloat(cellValue);
118
-  > 602 │                         cellValue = isNaN(parsed) ? cellValue : parsed;
119
-      │                                     ^^^^^
120
-   603 │                     }
121
-   604 │ 
122
-  
123
-  ℹ See ]8;;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description\the MDN documentation]8;;\ for more details.
124
-  
125
-  ℹ Unsafe fix: Use Number.isNaN instead.
126
-  
127
-   600 600 │                       if (column.type === 'number' && typeof cellValue === 'string') {
128
-   601 601 │                           const parsed = parseFloat(cellValue);
129
-   602     │ - ························cellValue·=·isNaN(parsed)·?·cellValue·:·parsed;
130
-       602 │ + ························cellValue·=·Number.isNaN(parsed)·?·cellValue·:·parsed;
131
-   603 603 │                       }
132
-   604 604 │   
133
-  
134
- 
135
-  at src/components/Spreadsheet.stories.tsx format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
136
-
137
-  ✖ Formatter would have printed the following content:
138
-  
139
-    489  489 │                   icon: <HiEye className="h-4 w-4" />,
140
-    490  490 │                   onClick: (row) => {
141
-    491      │ - ····················alert(`Viewing·user:·${row.name}\nEmail:·${row.email}\nDepartment:·${row.department}`);
142
-         491 │ + ····················alert(
143
-         492 │ + ························`Viewing·user:·${row.name}\nEmail:·${row.email}\nDepartment:·${row.department}`
144
-         493 │ + ····················);
145
-    492  494 │                   },
146
-    493  495 │               },
147
-   ········· │
148
-    533  535 │                   <div className="mb-4 text-sm text-gray-600">
149
-    534  536 │                       <p className="font-medium mb-2">Row Context Menu Example</p>
150
-    535      │ - ····················<p>Hover·over·a·row·and·click·the·3-dot·icon·(⋮)·to·see·the·context·menu·with·actions.</p>
151
-    536      │ - ····················<p·className="text-xs·mt-1·text-gray-500">Note:·Delete·is·only·visible·for·non-Active·users.</p>
152
-         537 │ + ····················<p>
153
-         538 │ + ························Hover·over·a·row·and·click·the·3-dot·icon·(⋮)·to·see·the·context·menu·with
154
-         539 │ + ························actions.
155
-         540 │ + ····················</p>
156
-         541 │ + ····················<p·className="text-xs·mt-1·text-gray-500">
157
-         542 │ + ························Note:·Delete·is·only·visible·for·non-Active·users.
158
-         543 │ + ····················</p>
159
-    537  544 │                   </div>
160
-    538  545 │                   <Spreadsheet
161
-  
162
- 
163
-  at src/components/Spreadsheet.tsx format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
164
-
165
-  ✖ Formatter would have printed the following content:
166
-  
167
-    887  887 │                                                                       rowId={rowId}
168
-    888  888 │                                                                       items={rowContextMenuItems}
169
-    889      │ - ····································································compactMode={effectiveCompactMode}
170
-         889 │ + ····································································compactMode={
171
-         890 │ + ········································································effectiveCompactMode
172
-         891 │ + ····································································}
173
-    890  892 │                                                                   />
174
-    891  893 │                                                               )}
175
-  
176
- 
177
- Checked 31 files in 25ms. No fixes applied.
178
- Found 2 errors.
179
- Found 7 warnings.
180
- check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
181
-
182
-  ✖ Some errors were emitted while running checks.
183
-  
184
- 
185
-  ELIFECYCLE  Command failed with exit code 1.
1
+
package/dist/index.js CHANGED
@@ -1685,11 +1685,33 @@ function RowIndexColumnHeader({
1685
1685
  isPinned = false,
1686
1686
  onHighlightClick,
1687
1687
  onPinClick,
1688
- hasColumnGroups = false,
1688
+ isSecondRow = false,
1689
1689
  compactMode = false,
1690
1690
  className
1691
1691
  }) {
1692
1692
  const cellPadding = compactMode ? cellPaddingCompact3 : cellPaddingNormal3;
1693
+ if (isSecondRow) {
1694
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1695
+ "th",
1696
+ {
1697
+ className: cn(
1698
+ "border border-gray-200 text-center font-bold text-gray-700",
1699
+ compactMode ? "text-[10px]" : "text-xs",
1700
+ cellPadding,
1701
+ isPinned ? "z-30" : "z-20",
1702
+ className
1703
+ ),
1704
+ style: {
1705
+ minWidth: `${ROW_INDEX_COLUMN_WIDTH}px`,
1706
+ width: `${ROW_INDEX_COLUMN_WIDTH}px`,
1707
+ position: "sticky",
1708
+ top: 0,
1709
+ left: isPinned ? 0 : void 0,
1710
+ backgroundColor: highlightColor || "rgb(243 244 246)"
1711
+ }
1712
+ }
1713
+ );
1714
+ }
1693
1715
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1694
1716
  "th",
1695
1717
  {
@@ -1700,7 +1722,6 @@ function RowIndexColumnHeader({
1700
1722
  isPinned ? "z-30" : "z-20",
1701
1723
  className
1702
1724
  ),
1703
- rowSpan: hasColumnGroups ? 2 : void 0,
1704
1725
  style: {
1705
1726
  minWidth: `${ROW_INDEX_COLUMN_WIDTH}px`,
1706
1727
  width: `${ROW_INDEX_COLUMN_WIDTH}px`,
@@ -4310,7 +4331,6 @@ function Spreadsheet({
4310
4331
  isPinned: isRowIndexPinned,
4311
4332
  onHighlightClick: handleRowIndexHighlightClick,
4312
4333
  onPinClick: () => handleTogglePin(ROW_INDEX_COLUMN_ID),
4313
- hasColumnGroups: true,
4314
4334
  compactMode: effectiveCompactMode
4315
4335
  }
4316
4336
  ),
@@ -4363,7 +4383,15 @@ function Spreadsheet({
4363
4383
  })
4364
4384
  ] }),
4365
4385
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("tr", { children: [
4366
- !columnGroups && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4386
+ columnGroups ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4387
+ RowIndexColumnHeader,
4388
+ {
4389
+ highlightColor: rowIndexHighlightColor,
4390
+ isPinned: isRowIndexPinned,
4391
+ isSecondRow: true,
4392
+ compactMode: effectiveCompactMode
4393
+ }
4394
+ ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4367
4395
  RowIndexColumnHeader,
4368
4396
  {
4369
4397
  enableHighlighting,
@@ -4371,7 +4399,6 @@ function Spreadsheet({
4371
4399
  isPinned: isRowIndexPinned,
4372
4400
  onHighlightClick: handleRowIndexHighlightClick,
4373
4401
  onPinClick: () => handleTogglePin(ROW_INDEX_COLUMN_ID),
4374
- hasColumnGroups: false,
4375
4402
  compactMode: effectiveCompactMode
4376
4403
  }
4377
4404
  ),