mantine-datatable 7.1.0-alpha.1 β†’ 7.1.0-alpha.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/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  [![Language][language-image]][repo-url]
11
11
  [![Sponsor the author][sponsor-image]][sponsor-url]
12
12
 
13
- The lightweight, dependency-free, "dark-theme aware" [**table component**](https://icflorescu.github.io/mantine-datatable/) for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row context menu, row expansion, nesting, and more.
13
+ The lightweight, dependency-free, **dark-theme aware** table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row expansion, nesting, context menus, and [much more](https://icflorescu.github.io/mantine-datatable/).
14
14
 
15
15
  [![Mantine DataTable](https://user-images.githubusercontent.com/581999/189911698-369ba48e-65f0-4772-aad3-cb5e6d4cb59d.png)](https://icflorescu.github.io/mantine-datatable/)
16
16
 
@@ -20,7 +20,7 @@ The lightweight, dependency-free, "dark-theme aware" [**table component**](https
20
20
  ## Features
21
21
 
22
22
  - **Lightweight** - no external dependencies, [no bloat](https://bundlephobia.com/package/mantine-datatable)
23
- - **Dark theme aware** - works out of the box with [Mantine's dark theme](https://mantine.dev/guides/dark-theme/)
23
+ - **Dark-theme aware** - automatically adapts to the current [Mantine color scheme](https://mantine.dev/theming/color-schemes/)
24
24
  - **[Fully customizable](https://icflorescu.github.io/mantine-datatable/examples/overriding-the-default-styles)** - you can customize the look and feel of the table and its components
25
25
  - **[Asynchronous data loading](https://icflorescu.github.io/mantine-datatable/examples/asynchronous-data-loading)** - load data from a remote API endpoint and show a loading indicator while waiting for the response
26
26
  - **[Pagination](https://icflorescu.github.io/mantine-datatable/examples/pagination)** - split large data sets into pages
@@ -52,11 +52,9 @@ Visit [icflorescu.github.io/mantine-datatable](https://icflorescu.github.io/mant
52
52
 
53
53
  ## Quickstart
54
54
 
55
- Create a new [application with Mantine](https://mantine.dev/getting-started/), then install Mantine DataTable and its `clsx` peer dependency:
55
+ Create a new [application with Mantine](https://mantine.dev/getting-started/), make sure to have the `clsx` peer dependency installed,
56
+ then install the package with `npm i mantine-datatable` or `yarn add mantine-datatable`.
56
57
 
57
- ```sh
58
- npm i mantine-datatable clsx
59
- ```
60
58
  Import the necessary CSS files:
61
59
 
62
60
  ```ts
@@ -64,9 +62,12 @@ import '@mantine/core/styles.layer.css';
64
62
  import 'mantine-datatable/styles.layer.css';
65
63
  import './layout.css';
66
64
  ```
67
- Apply the styles in the correct order:
65
+
66
+ Make sure to [apply the styles in the correct order](https://mantine.dev/styles/mantine-styles/):
68
67
 
69
68
  ```css
69
+ /* layout.css */
70
+ /* πŸ‘‡ Apply Mantine core styles first, DataTable styles second */
70
71
  @layer mantine, mantine-datatable;
71
72
  ```
72
73
 
@@ -87,24 +88,24 @@ export function GettingStartedExample() {
87
88
  withColumnBorders
88
89
  striped
89
90
  highlightOnHover
90
- // provide data
91
+ // πŸ‘‡ provide data
91
92
  records={[
92
93
  { id: 1, name: 'Joe Biden', bornIn: 1942, party: 'Democratic' },
93
94
  // more records...
94
95
  ]}
95
- // define columns
96
+ // πŸ‘‡ define columns
96
97
  columns={[
97
98
  {
98
99
  accessor: 'id',
99
- // this column has a custom title
100
+ // πŸ‘‡ this column has a custom title
100
101
  title: '#',
101
- // right-align column
102
+ // πŸ‘‡ right-align column
102
103
  textAlign: 'right',
103
104
  },
104
105
  { accessor: 'name' },
105
106
  {
106
107
  accessor: 'party',
107
- // this column has custom cell data rendering
108
+ // πŸ‘‡ this column has custom cell data rendering
108
109
  render: ({ party }) => (
109
110
  <Box fw={700} c={party === 'Democratic' ? 'blue' : 'red'}>
110
111
  {party.slice(0, 3).toUpperCase()}
@@ -113,7 +114,7 @@ export function GettingStartedExample() {
113
114
  },
114
115
  { accessor: 'bornIn' },
115
116
  ]}
116
- // execute this callback when a row is clicked
117
+ // πŸ‘‡ execute this callback when a row is clicked
117
118
  onRowClick={({ record: { name, party, bornIn } }) =>
118
119
  showNotification({
119
120
  title: `Clicked on ${name}`,
@@ -172,6 +173,7 @@ Mentioning β€œMantine DataTable” in your text would help me prioritize your me
172
173
  ## Acknowledgements
173
174
 
174
175
  πŸ™ Special thanks to [Ani Ravi](https://github.com/aniravi24) for being the first person to sponsor my work on this project!
176
+ πŸ’• Additional thanks to [all sponsors](https://github.com/sponsors/icflorescu)!
175
177
 
176
178
  ## License
177
179
 
@@ -177,26 +177,6 @@
177
177
  background: var(--mantine-datatable-background-color);
178
178
  }
179
179
 
180
- /* πŸ˜‘ make background inheritable down to the table element */
181
-
182
- /* πŸ‘‡ scroll area */
183
-
184
- .mantine-datatable > div {
185
- background: inherit;
186
- }
187
-
188
- /* πŸ‘‡ scroll area viewport */
189
-
190
- .mantine-datatable > div > div:not(.mantine-datatable-scroll-area-scrollbar):not(.mantine-datatable-scroll-area-corner) {
191
- background: inherit;
192
- }
193
-
194
- /* πŸ‘‡ table wrapper */
195
-
196
- .mantine-datatable > div > div:not(.mantine-datatable-scroll-area-scrollbar):not(.mantine-datatable-scroll-area-corner) > div {
197
- background: inherit;
198
- }
199
-
200
180
  .mantine-datatable-with-border {
201
181
  border: calc(0.0625rem * var(--mantine-scale)) solid var(--mantine-datatable-border-color);
202
182
  }
@@ -205,7 +185,7 @@
205
185
  border-collapse: separate;
206
186
  border-spacing: 0;
207
187
  color: inherit;
208
- background: inherit;
188
+ background: var(--mantine-datatable-background-color);
209
189
  }
210
190
 
211
191
  .mantine-datatable-table th,
@@ -216,16 +196,13 @@
216
196
  .mantine-datatable-table thead,
217
197
  .mantine-datatable-table tbody,
218
198
  .mantine-datatable-table tfoot,
199
+ .mantine-datatable-table thead tr,
200
+ .mantine-datatable-table tfoot tr,
219
201
  .mantine-datatable-table th,
220
202
  .mantine-datatable-table td {
221
203
  background: inherit;
222
204
  }
223
205
 
224
- .mantine-datatable-table thead tr,
225
- .mantine-datatable-table tfoot tr {
226
- background: inherit;
227
- }
228
-
229
206
  .mantine-datatable-table[data-striped] tbody tr:nth-of-type(odd) {
230
207
  background: var(--mantine-datatable-striped-color);
231
208
  }
@@ -564,36 +541,32 @@ th:hover .mantine-datatable-header-cell-sortable-unsorted-icon {
564
541
 
565
542
  .mantine-datatable-row {
566
543
  --mantine-datatable-row-color: var(
567
- --mantine-datatable-row-color-light,
568
- inherit
544
+ --mantine-datatable-row-color-light
569
545
  );
570
546
  }
571
547
 
572
548
  [data-mantine-color-scheme='dark'] .mantine-datatable-row {
573
549
  --mantine-datatable-row-color: var(
574
- --mantine-datatable-row-color-dark,
575
- inherit
550
+ --mantine-datatable-row-color-dark
576
551
  );
577
552
  }
578
553
 
579
554
  .mantine-datatable-row {
580
555
  --mantine-datatable-row-background-color: var(
581
- --mantine-datatable-row-background-color-light,
582
- inherit
556
+ --mantine-datatable-row-background-color-light
583
557
  );
584
558
  }
585
559
 
586
560
  [data-mantine-color-scheme='dark'] .mantine-datatable-row {
587
561
  --mantine-datatable-row-background-color: var(
588
- --mantine-datatable-row-background-color-dark,
589
- inherit
562
+ --mantine-datatable-row-background-color-dark
590
563
  );
591
564
  }
592
565
 
593
566
  .mantine-datatable-row {
594
567
 
595
- color: var(--mantine-datatable-row-color);
596
- background: var(--mantine-datatable-row-background-color);
568
+ color: var(--mantine-datatable-row-color, inherit);
569
+ background: var(--mantine-datatable-row-background-color, inherit);
597
570
  }
598
571
 
599
572
  .mantine-datatable-row[data-with-row-border]:not(:last-of-type) td {
@@ -162,20 +162,6 @@
162
162
  background: var(--mantine-datatable-background-color);
163
163
  }
164
164
 
165
- /* πŸ˜‘ make background inheritable down to the table element */
166
- /* πŸ‘‡ scroll area */
167
- .mantine-datatable > div {
168
- background: inherit;
169
- }
170
- /* πŸ‘‡ scroll area viewport */
171
- .mantine-datatable > div > div:not(.mantine-datatable-scroll-area-scrollbar):not(.mantine-datatable-scroll-area-corner) {
172
- background: inherit;
173
- }
174
- /* πŸ‘‡ table wrapper */
175
- .mantine-datatable > div > div:not(.mantine-datatable-scroll-area-scrollbar):not(.mantine-datatable-scroll-area-corner) > div {
176
- background: inherit;
177
- }
178
-
179
165
  .mantine-datatable-with-border {
180
166
  border: calc(0.0625rem * var(--mantine-scale)) solid var(--mantine-datatable-border-color);
181
167
  }
@@ -184,7 +170,7 @@
184
170
  border-collapse: separate;
185
171
  border-spacing: 0;
186
172
  color: inherit;
187
- background: inherit;
173
+ background: var(--mantine-datatable-background-color);
188
174
  }
189
175
 
190
176
  .mantine-datatable-table th,
@@ -195,16 +181,13 @@
195
181
  .mantine-datatable-table thead,
196
182
  .mantine-datatable-table tbody,
197
183
  .mantine-datatable-table tfoot,
184
+ .mantine-datatable-table thead tr,
185
+ .mantine-datatable-table tfoot tr,
198
186
  .mantine-datatable-table th,
199
187
  .mantine-datatable-table td {
200
188
  background: inherit;
201
189
  }
202
190
 
203
- .mantine-datatable-table thead tr,
204
- .mantine-datatable-table tfoot tr {
205
- background: inherit;
206
- }
207
-
208
191
  .mantine-datatable-table[data-striped] tbody tr:nth-of-type(odd) {
209
192
  background: var(--mantine-datatable-striped-color);
210
193
  }
@@ -545,32 +528,28 @@
545
528
  @layer mantine-datatable {
546
529
  .mantine-datatable-row {
547
530
  --mantine-datatable-row-color: var(
548
- --mantine-datatable-row-color-light,
549
- inherit
531
+ --mantine-datatable-row-color-light
550
532
  );
551
533
  }
552
534
  [data-mantine-color-scheme='dark'] .mantine-datatable-row {
553
535
  --mantine-datatable-row-color: var(
554
- --mantine-datatable-row-color-dark,
555
- inherit
536
+ --mantine-datatable-row-color-dark
556
537
  );
557
538
  }
558
539
  .mantine-datatable-row {
559
540
  --mantine-datatable-row-background-color: var(
560
- --mantine-datatable-row-background-color-light,
561
- inherit
541
+ --mantine-datatable-row-background-color-light
562
542
  );
563
543
  }
564
544
  [data-mantine-color-scheme='dark'] .mantine-datatable-row {
565
545
  --mantine-datatable-row-background-color: var(
566
- --mantine-datatable-row-background-color-dark,
567
- inherit
546
+ --mantine-datatable-row-background-color-dark
568
547
  );
569
548
  }
570
549
  .mantine-datatable-row {
571
550
 
572
- color: var(--mantine-datatable-row-color);
573
- background: var(--mantine-datatable-row-background-color);
551
+ color: var(--mantine-datatable-row-color, inherit);
552
+ background: var(--mantine-datatable-row-background-color, inherit);
574
553
  }
575
554
 
576
555
  .mantine-datatable-row[data-with-row-border]:not(:last-of-type) td {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mantine-datatable",
3
- "version": "7.1.0-alpha.1",
4
- "description": "The dependency-free datatable component for Mantine UI, featuring asynchronous data loading support, pagination, multple rows selection, column sorting, custom cell data rendering, row context menu, row expansion and more",
3
+ "version": "7.1.0-alpha.2",
4
+ "description": "The lightweight, dependency-free, dark-theme aware table component for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row expansion, nesting, context menus, and much more",
5
5
  "keywords": [
6
6
  "mantine",
7
7
  "data",
@@ -18,6 +18,7 @@
18
18
  "context menu",
19
19
  "react",
20
20
  "component",
21
+ "react server components",
21
22
  "typescript",
22
23
  "ui",
23
24
  "user interface",
@@ -83,19 +84,19 @@
83
84
  "@tabler/icons-react": "^2.40.0",
84
85
  "@tanstack/react-query": "^5.4.3",
85
86
  "@types/lodash": "^4.14.200",
86
- "@types/node": "^20.8.9",
87
+ "@types/node": "^20.8.10",
87
88
  "@types/react": "^18.2.33",
88
89
  "@types/react-dom": "^18.2.14",
89
- "@typescript-eslint/eslint-plugin": "^6.9.0",
90
- "@typescript-eslint/parser": "^6.9.0",
90
+ "@typescript-eslint/eslint-plugin": "^6.9.1",
91
+ "@typescript-eslint/parser": "^6.9.1",
91
92
  "clsx": "^2.0.0",
92
93
  "dayjs": "^1.11.10",
93
94
  "eslint": "^8.52.0",
94
- "eslint-config-next": "^14.0.0",
95
+ "eslint-config-next": "^14.0.1",
95
96
  "eslint-config-prettier": "^9.0.0",
96
97
  "lodash": "^4.17.21",
97
- "mantine-contextmenu": "^7.1.3",
98
- "next": "14.0.0",
98
+ "mantine-contextmenu": "^7.1.5",
99
+ "next": "14.0.1",
99
100
  "postcss": "^8.4.31",
100
101
  "postcss-cli": "^10.1.0",
101
102
  "postcss-import": "^15.1.0",