@cdx-ui/data-grid 0.3.10 → 0.3.12
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 +3 -1
- package/coverage.svg +1 -1
- package/lib/commonjs/DataGrid.js +232 -62
- package/lib/commonjs/DataGrid.js.map +1 -1
- package/lib/commonjs/DataGridFilterPanel.js +420 -0
- package/lib/commonjs/DataGridFilterPanel.js.map +1 -0
- package/lib/commonjs/adapter/columnTypes.js +256 -0
- package/lib/commonjs/adapter/columnTypes.js.map +1 -0
- package/lib/commonjs/adapter/columns.js +132 -4
- package/lib/commonjs/adapter/columns.js.map +1 -1
- package/lib/commonjs/adapter/filterOperators.js +422 -0
- package/lib/commonjs/adapter/filterOperators.js.map +1 -0
- package/lib/commonjs/adapter/pinning.js +101 -0
- package/lib/commonjs/adapter/pinning.js.map +1 -0
- package/lib/commonjs/index.js +26 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/numberCells.js +280 -0
- package/lib/commonjs/numberCells.js.map +1 -0
- package/lib/commonjs/styles.js +61 -1
- package/lib/commonjs/styles.js.map +1 -1
- package/lib/commonjs/types.js +29 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useDataGridTable.js +98 -13
- package/lib/commonjs/useDataGridTable.js.map +1 -1
- package/lib/module/DataGrid.js +237 -67
- package/lib/module/DataGrid.js.map +1 -1
- package/lib/module/DataGridFilterPanel.js +414 -0
- package/lib/module/DataGridFilterPanel.js.map +1 -0
- package/lib/module/adapter/columnTypes.js +240 -0
- package/lib/module/adapter/columnTypes.js.map +1 -0
- package/lib/module/adapter/columns.js +129 -4
- package/lib/module/adapter/columns.js.map +1 -1
- package/lib/module/adapter/filterOperators.js +406 -0
- package/lib/module/adapter/filterOperators.js.map +1 -0
- package/lib/module/adapter/pinning.js +90 -0
- package/lib/module/adapter/pinning.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/numberCells.js +275 -0
- package/lib/module/numberCells.js.map +1 -0
- package/lib/module/styles.js +60 -0
- package/lib/module/styles.js.map +1 -1
- package/lib/module/types.js +28 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/useDataGridTable.js +99 -14
- package/lib/module/useDataGridTable.js.map +1 -1
- package/lib/typescript/DataGrid.d.ts.map +1 -1
- package/lib/typescript/DataGridFilterPanel.d.ts +17 -0
- package/lib/typescript/DataGridFilterPanel.d.ts.map +1 -0
- package/lib/typescript/adapter/columnTypes.d.ts +32 -0
- package/lib/typescript/adapter/columnTypes.d.ts.map +1 -0
- package/lib/typescript/adapter/columns.d.ts +14 -5
- package/lib/typescript/adapter/columns.d.ts.map +1 -1
- package/lib/typescript/adapter/filterOperators.d.ts +43 -0
- package/lib/typescript/adapter/filterOperators.d.ts.map +1 -0
- package/lib/typescript/adapter/pinning.d.ts +25 -0
- package/lib/typescript/adapter/pinning.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +4 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/numberCells.d.ts +46 -0
- package/lib/typescript/numberCells.d.ts.map +1 -0
- package/lib/typescript/styles.d.ts +21 -0
- package/lib/typescript/styles.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +86 -7
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/useDataGridTable.d.ts +18 -4
- package/lib/typescript/useDataGridTable.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/DataGrid.tsx +377 -67
- package/src/DataGridFilterPanel.tsx +477 -0
- package/src/adapter/columnTypes.ts +327 -0
- package/src/adapter/columns.test.ts +75 -1
- package/src/adapter/columns.ts +178 -3
- package/src/adapter/filterOperators.test.ts +292 -0
- package/src/adapter/filterOperators.ts +524 -0
- package/src/adapter/pinning.ts +125 -0
- package/src/index.ts +15 -0
- package/src/numberCells.tsx +379 -0
- package/src/styles.ts +75 -0
- package/src/types.ts +114 -7
- package/src/useDataGridTable.test.ts +69 -0
- package/src/useDataGridTable.ts +127 -8
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.gridDeltaNumberColDef = gridDeltaNumberColDef;
|
|
7
|
+
exports.gridPolarityNumberColDef = gridPolarityNumberColDef;
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _components = require("@cdx-ui/components");
|
|
10
|
+
var _icons = require("@cdx-ui/icons");
|
|
11
|
+
var _utils = require("@cdx-ui/utils");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/** Unicode minus (U+2212). The spec requires this character, not a hyphen. */
|
|
14
|
+
const MINUS = '\u2212';
|
|
15
|
+
const defaultNumberFormat = new Intl.NumberFormat(undefined, {
|
|
16
|
+
maximumFractionDigits: 20
|
|
17
|
+
});
|
|
18
|
+
const TONE_CLASS = {
|
|
19
|
+
success: 'text-content-success',
|
|
20
|
+
danger: 'text-content-danger',
|
|
21
|
+
neutral: 'text-content-primary'
|
|
22
|
+
};
|
|
23
|
+
const ARROW_SLOT = {
|
|
24
|
+
default: 'h-5 w-3.5 items-center justify-center overflow-hidden',
|
|
25
|
+
compact: 'h-4 w-3 items-center justify-center overflow-hidden'
|
|
26
|
+
};
|
|
27
|
+
const ARROW_SIZE = {
|
|
28
|
+
default: 20,
|
|
29
|
+
compact: 16
|
|
30
|
+
};
|
|
31
|
+
const TREND_SIZE = {
|
|
32
|
+
default: 14,
|
|
33
|
+
compact: 12
|
|
34
|
+
};
|
|
35
|
+
function toFiniteNumber(value) {
|
|
36
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : null;
|
|
37
|
+
}
|
|
38
|
+
function columnValueFormatter(format) {
|
|
39
|
+
if (!format) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
return value => {
|
|
43
|
+
const numeric = toFiniteNumber(value);
|
|
44
|
+
return numeric == null ? '' : format(numeric);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function formatRaw(value, row, col) {
|
|
48
|
+
const formatted = col.valueFormatter?.(value, row, col);
|
|
49
|
+
if (typeof formatted === 'string' && formatted.length > 0) {
|
|
50
|
+
return formatted;
|
|
51
|
+
}
|
|
52
|
+
return defaultNumberFormat.format(value);
|
|
53
|
+
}
|
|
54
|
+
function unsigned(formatted) {
|
|
55
|
+
const withoutSign = formatted.replace(/^[-−+]\s*/, '');
|
|
56
|
+
if (withoutSign.startsWith('(') && withoutSign.endsWith(')')) {
|
|
57
|
+
return withoutSign.slice(1, -1);
|
|
58
|
+
}
|
|
59
|
+
return withoutSign;
|
|
60
|
+
}
|
|
61
|
+
function polarityOf(value) {
|
|
62
|
+
if (value > 0) {
|
|
63
|
+
return 'positive';
|
|
64
|
+
}
|
|
65
|
+
if (value < 0) {
|
|
66
|
+
return 'negative';
|
|
67
|
+
}
|
|
68
|
+
return 'neutral';
|
|
69
|
+
}
|
|
70
|
+
function directionOf(value) {
|
|
71
|
+
if (value > 0) {
|
|
72
|
+
return 'increase';
|
|
73
|
+
}
|
|
74
|
+
if (value < 0) {
|
|
75
|
+
return 'decrease';
|
|
76
|
+
}
|
|
77
|
+
return 'flat';
|
|
78
|
+
}
|
|
79
|
+
function polarityTone(polarity) {
|
|
80
|
+
if (polarity === 'positive') {
|
|
81
|
+
return 'success';
|
|
82
|
+
}
|
|
83
|
+
if (polarity === 'negative') {
|
|
84
|
+
return 'danger';
|
|
85
|
+
}
|
|
86
|
+
return 'neutral';
|
|
87
|
+
}
|
|
88
|
+
function deltaTone(direction, increaseIsGood) {
|
|
89
|
+
if (direction === 'flat') {
|
|
90
|
+
return 'neutral';
|
|
91
|
+
}
|
|
92
|
+
const favorable = direction === 'increase' ? increaseIsGood : !increaseIsGood;
|
|
93
|
+
return favorable ? 'success' : 'danger';
|
|
94
|
+
}
|
|
95
|
+
function polarityLabel(polarity) {
|
|
96
|
+
if (polarity === 'positive') {
|
|
97
|
+
return 'Positive';
|
|
98
|
+
}
|
|
99
|
+
if (polarity === 'negative') {
|
|
100
|
+
return 'Negative';
|
|
101
|
+
}
|
|
102
|
+
return 'Neutral';
|
|
103
|
+
}
|
|
104
|
+
function directionLabel(direction) {
|
|
105
|
+
if (direction === 'increase') {
|
|
106
|
+
return 'Increase';
|
|
107
|
+
}
|
|
108
|
+
if (direction === 'decrease') {
|
|
109
|
+
return 'Decrease';
|
|
110
|
+
}
|
|
111
|
+
return 'No change';
|
|
112
|
+
}
|
|
113
|
+
function NumberReadout({
|
|
114
|
+
label,
|
|
115
|
+
display,
|
|
116
|
+
tone,
|
|
117
|
+
density,
|
|
118
|
+
children
|
|
119
|
+
}) {
|
|
120
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
121
|
+
className: "relative flex-row items-center gap-0.5",
|
|
122
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Text, {
|
|
123
|
+
className: "absolute h-px w-px overflow-hidden opacity-0",
|
|
124
|
+
children: label
|
|
125
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
126
|
+
"aria-hidden": true,
|
|
127
|
+
accessibilityElementsHidden: true,
|
|
128
|
+
importantForAccessibility: "no-hide-descendants",
|
|
129
|
+
className: "flex-row items-center gap-0.5",
|
|
130
|
+
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Text, {
|
|
131
|
+
color: tone === 'neutral' ? 'primary' : tone,
|
|
132
|
+
size: density === 'compact' ? 'sm' : 'md',
|
|
133
|
+
children: display
|
|
134
|
+
})]
|
|
135
|
+
})]
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function ToneIcon({
|
|
139
|
+
icon: Icon,
|
|
140
|
+
tone,
|
|
141
|
+
size,
|
|
142
|
+
slotClassName
|
|
143
|
+
}) {
|
|
144
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
145
|
+
className: (0, _utils.cn)(TONE_CLASS[tone], slotClassName),
|
|
146
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
147
|
+
size: size
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function PolarityNumberCell({
|
|
152
|
+
value,
|
|
153
|
+
row,
|
|
154
|
+
col,
|
|
155
|
+
density
|
|
156
|
+
}) {
|
|
157
|
+
const numeric = toFiniteNumber(value);
|
|
158
|
+
if (numeric == null) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
const polarity = polarityOf(numeric);
|
|
162
|
+
const magnitude = unsigned(formatRaw(numeric, row, col));
|
|
163
|
+
const display = polarity === 'negative' ? `${MINUS}${magnitude}` : magnitude;
|
|
164
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(NumberReadout, {
|
|
165
|
+
label: `${polarityLabel(polarity)} ${magnitude}`,
|
|
166
|
+
display: display,
|
|
167
|
+
tone: polarityTone(polarity),
|
|
168
|
+
density: density
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function DeltaSymbol({
|
|
172
|
+
direction,
|
|
173
|
+
tone,
|
|
174
|
+
density,
|
|
175
|
+
symbol
|
|
176
|
+
}) {
|
|
177
|
+
if (symbol === 'sign') {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
if (symbol === 'arrow') {
|
|
181
|
+
if (direction === 'flat') {
|
|
182
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
183
|
+
className: ARROW_SLOT[density]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToneIcon, {
|
|
187
|
+
icon: direction === 'increase' ? _icons.ArrowDropUp : _icons.ArrowDropDown,
|
|
188
|
+
tone: tone,
|
|
189
|
+
size: ARROW_SIZE[density],
|
|
190
|
+
slotClassName: ARROW_SLOT[density]
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
const icon = direction === 'increase' ? _icons.TrendingUp : direction === 'decrease' ? _icons.TrendingDown : _icons.TrendingFlat;
|
|
194
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToneIcon, {
|
|
195
|
+
icon: icon,
|
|
196
|
+
tone: tone,
|
|
197
|
+
size: TREND_SIZE[density]
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function DeltaNumberCell({
|
|
201
|
+
value,
|
|
202
|
+
row,
|
|
203
|
+
col,
|
|
204
|
+
density,
|
|
205
|
+
increaseIsGood,
|
|
206
|
+
symbol
|
|
207
|
+
}) {
|
|
208
|
+
const numeric = toFiniteNumber(value);
|
|
209
|
+
if (numeric == null) {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
const direction = directionOf(numeric);
|
|
213
|
+
const tone = deltaTone(direction, increaseIsGood);
|
|
214
|
+
const magnitude = unsigned(formatRaw(numeric, row, col));
|
|
215
|
+
let display = magnitude;
|
|
216
|
+
if (symbol === 'sign' && direction === 'increase') {
|
|
217
|
+
display = `+${magnitude}`;
|
|
218
|
+
} else if (symbol === 'sign' && direction === 'decrease') {
|
|
219
|
+
display = `${MINUS}${magnitude}`;
|
|
220
|
+
}
|
|
221
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(NumberReadout, {
|
|
222
|
+
label: `${directionLabel(direction)} ${magnitude}`,
|
|
223
|
+
display: display,
|
|
224
|
+
tone: tone,
|
|
225
|
+
density: density,
|
|
226
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DeltaSymbol, {
|
|
227
|
+
direction: direction,
|
|
228
|
+
tone: tone,
|
|
229
|
+
density: density,
|
|
230
|
+
symbol: symbol
|
|
231
|
+
})
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function gridPolarityNumberColDef(options = {}) {
|
|
235
|
+
const density = options.density ?? 'default';
|
|
236
|
+
return {
|
|
237
|
+
type: 'number',
|
|
238
|
+
align: 'end',
|
|
239
|
+
headerAlign: 'end',
|
|
240
|
+
...(options.valueFormatter ? {
|
|
241
|
+
valueFormatter: columnValueFormatter(options.valueFormatter)
|
|
242
|
+
} : {}),
|
|
243
|
+
renderCell: ({
|
|
244
|
+
value,
|
|
245
|
+
row,
|
|
246
|
+
col
|
|
247
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(PolarityNumberCell, {
|
|
248
|
+
value: value,
|
|
249
|
+
row: row,
|
|
250
|
+
col: col,
|
|
251
|
+
density: density
|
|
252
|
+
})
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function gridDeltaNumberColDef(options = {}) {
|
|
256
|
+
const density = options.density ?? 'default';
|
|
257
|
+
const increaseIsGood = options.increaseIsGood ?? true;
|
|
258
|
+
const symbol = options.symbol ?? 'arrow';
|
|
259
|
+
return {
|
|
260
|
+
type: 'number',
|
|
261
|
+
align: 'end',
|
|
262
|
+
headerAlign: 'end',
|
|
263
|
+
...(options.valueFormatter ? {
|
|
264
|
+
valueFormatter: columnValueFormatter(options.valueFormatter)
|
|
265
|
+
} : {}),
|
|
266
|
+
renderCell: ({
|
|
267
|
+
value,
|
|
268
|
+
row,
|
|
269
|
+
col
|
|
270
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(DeltaNumberCell, {
|
|
271
|
+
value: value,
|
|
272
|
+
row: row,
|
|
273
|
+
col: col,
|
|
274
|
+
density: density,
|
|
275
|
+
increaseIsGood: increaseIsGood,
|
|
276
|
+
symbol: symbol
|
|
277
|
+
})
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=numberCells.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_components","_icons","_utils","_jsxRuntime","MINUS","defaultNumberFormat","Intl","NumberFormat","undefined","maximumFractionDigits","TONE_CLASS","success","danger","neutral","ARROW_SLOT","default","compact","ARROW_SIZE","TREND_SIZE","toFiniteNumber","value","Number","isFinite","columnValueFormatter","format","numeric","formatRaw","row","col","formatted","valueFormatter","length","unsigned","withoutSign","replace","startsWith","endsWith","slice","polarityOf","directionOf","polarityTone","polarity","deltaTone","direction","increaseIsGood","favorable","polarityLabel","directionLabel","NumberReadout","label","display","tone","density","children","jsxs","View","className","jsx","Text","accessibilityElementsHidden","importantForAccessibility","color","size","ToneIcon","icon","Icon","slotClassName","cn","PolarityNumberCell","magnitude","DeltaSymbol","symbol","ArrowDropUp","ArrowDropDown","TrendingUp","TrendingDown","TrendingFlat","DeltaNumberCell","gridPolarityNumberColDef","options","type","align","headerAlign","renderCell","gridDeltaNumberColDef"],"sourceRoot":"../../src","sources":["numberCells.tsx"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAQA,IAAAG,MAAA,GAAAH,OAAA;AAAmC,IAAAI,WAAA,GAAAJ,OAAA;AAGnC;AACA,MAAMK,KAAK,GAAG,QAAQ;AAEtB,MAAMC,mBAAmB,GAAG,IAAIC,IAAI,CAACC,YAAY,CAACC,SAAS,EAAE;EAAEC,qBAAqB,EAAE;AAAG,CAAC,CAAC;AAmD3F,MAAMC,UAAsC,GAAG;EAC7CC,OAAO,EAAE,sBAAsB;EAC/BC,MAAM,EAAE,qBAAqB;EAC7BC,OAAO,EAAE;AACX,CAAC;AAED,MAAMC,UAAiD,GAAG;EACxDC,OAAO,EAAE,uDAAuD;EAChEC,OAAO,EAAE;AACX,CAAC;AAED,MAAMC,UAAiD,GAAG;EACxDF,OAAO,EAAE,EAAE;EACXC,OAAO,EAAE;AACX,CAAC;AAED,MAAME,UAAiD,GAAG;EACxDH,OAAO,EAAE,EAAE;EACXC,OAAO,EAAE;AACX,CAAC;AAED,SAASG,cAAcA,CAACC,KAAc,EAAiB;EACrD,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,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
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.dataGridToolbarVariants = exports.dataGridToolbarSearchVariants = exports.dataGridToolbarActionsVariants = exports.dataGridTableVariants = exports.dataGridSortButtonVariants = exports.dataGridSelectHeadVariants = exports.dataGridSelectCellVariants = exports.dataGridRootVariants = exports.dataGridPaginationVariants = exports.dataGridPaginationRangeVariants = exports.dataGridOverlayVariants = exports.dataGridMainVariants = exports.dataGridHeaderVariants = exports.dataGridHeaderLabelVariants = exports.dataGridHeaderCellInnerVariants = exports.dataGridHeadVariants = exports.dataGridFooterVariants = exports.dataGridFilterInputVariants = exports.dataGridEmptyOverlayVariants = exports.dataGridCellVariants = exports.dataGridBodyVariants = void 0;
|
|
6
|
+
exports.dataGridToolbarVariants = exports.dataGridToolbarSearchVariants = exports.dataGridToolbarActionsVariants = exports.dataGridTableVariants = exports.dataGridSortButtonVariants = exports.dataGridSelectHeadVariants = exports.dataGridSelectCellVariants = exports.dataGridRootVariants = exports.dataGridPinnedSurfaceVariants = exports.dataGridPinnedEdgeVariants = exports.dataGridPaginationVariants = exports.dataGridPaginationRangeVariants = exports.dataGridOverlayVariants = exports.dataGridMainVariants = exports.dataGridHeaderVariants = exports.dataGridHeaderLabelVariants = exports.dataGridHeaderCellInnerVariants = exports.dataGridHeadVariants = exports.dataGridFooterVariants = exports.dataGridFilterPanelVariants = exports.dataGridFilterPanelValueVariants = exports.dataGridFilterPanelRowVariants = exports.dataGridFilterPanelOperatorVariants = exports.dataGridFilterPanelLogicVariants = exports.dataGridFilterPanelFooterVariants = exports.dataGridFilterPanelFieldVariants = exports.dataGridFilterPanelColumnVariants = exports.dataGridFilterInputVariants = exports.dataGridEmptyOverlayVariants = exports.dataGridCellVariants = exports.dataGridBodyVariants = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _utils = require("@cdx-ui/utils");
|
|
9
9
|
const dataGridRootVariants = exports.dataGridRootVariants = (0, _utils.cva)('w-full min-w-0 max-w-full flex-col overflow-hidden rounded-2xl border border-stroke-secondary bg-surface-primary', {
|
|
@@ -39,6 +39,47 @@ const dataGridMainVariants = exports.dataGridMainVariants = (0, _utils.cva)('rel
|
|
|
39
39
|
overlay: false
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Opaque sticky fill so pinned cells cover scrolled content.
|
|
45
|
+
* Body hover matches the row's 50% secondary tint, mixed over the primary surface
|
|
46
|
+
* so the cell stays opaque while content scrolls underneath.
|
|
47
|
+
*/
|
|
48
|
+
const dataGridPinnedSurfaceVariants = exports.dataGridPinnedSurfaceVariants = (0, _utils.cva)(_reactNative.Platform.select({
|
|
49
|
+
web: 'bg-surface-primary',
|
|
50
|
+
default: ''
|
|
51
|
+
}), {
|
|
52
|
+
variants: {
|
|
53
|
+
header: {
|
|
54
|
+
true: 'bg-neutral-50',
|
|
55
|
+
false: _reactNative.Platform.select({
|
|
56
|
+
web: 'web:[tr:hover_&]:bg-[color-mix(in_srgb,var(--color-surface-secondary)_50%,var(--color-surface-primary))]',
|
|
57
|
+
default: ''
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: {
|
|
62
|
+
header: false
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const dataGridPinnedEdgeVariants = exports.dataGridPinnedEdgeVariants = (0, _utils.cva)('', {
|
|
66
|
+
variants: {
|
|
67
|
+
edge: {
|
|
68
|
+
start: _reactNative.Platform.select({
|
|
69
|
+
web: 'border-e border-stroke-secondary',
|
|
70
|
+
default: ''
|
|
71
|
+
}),
|
|
72
|
+
end: _reactNative.Platform.select({
|
|
73
|
+
web: 'border-s border-stroke-secondary',
|
|
74
|
+
default: ''
|
|
75
|
+
}),
|
|
76
|
+
none: ''
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
defaultVariants: {
|
|
80
|
+
edge: 'none'
|
|
81
|
+
}
|
|
82
|
+
});
|
|
42
83
|
const dataGridToolbarVariants = exports.dataGridToolbarVariants = (0, _utils.cva)('shrink-0 flex-row items-center gap-3 border-b border-stroke-secondary px-4 py-4');
|
|
43
84
|
const dataGridToolbarSearchVariants = exports.dataGridToolbarSearchVariants = (0, _utils.cva)('max-w-80 min-w-0 flex-1');
|
|
44
85
|
const dataGridToolbarActionsVariants = exports.dataGridToolbarActionsVariants = (0, _utils.cva)('ms-auto flex-row items-center gap-3');
|
|
@@ -110,6 +151,25 @@ const dataGridBodyVariants = exports.dataGridBodyVariants = (0, _utils.cva)(_rea
|
|
|
110
151
|
default: ''
|
|
111
152
|
}));
|
|
112
153
|
const dataGridFilterInputVariants = exports.dataGridFilterInputVariants = (0, _utils.cva)('min-w-24');
|
|
154
|
+
const dataGridFilterPanelVariants = exports.dataGridFilterPanelVariants = (0, _utils.cva)('absolute start-4 top-16 z-30 w-max max-w-[calc(100%-2rem)] gap-3 rounded-lg border border-stroke-secondary bg-surface-primary px-3 pb-2 pt-3 shadow-lg');
|
|
155
|
+
|
|
156
|
+
// The panel is as wide as one unwrapped row, capped at the grid's width. Below that, fields wrap
|
|
157
|
+
// onto new lines and grow to fill them, so the layout follows the grid's width, not the viewport.
|
|
158
|
+
const dataGridFilterPanelRowVariants = exports.dataGridFilterPanelRowVariants = (0, _utils.cva)('flex-row flex-wrap items-end gap-2');
|
|
159
|
+
const dataGridFilterPanelLogicVariants = exports.dataGridFilterPanelLogicVariants = (0, _utils.cva)('min-h-8 w-24 shrink-0 justify-center');
|
|
160
|
+
const dataGridFilterPanelFieldVariants = exports.dataGridFilterPanelFieldVariants = (0, _utils.cva)('min-w-0 shrink grow gap-1', {
|
|
161
|
+
variants: {
|
|
162
|
+
size: {
|
|
163
|
+
column: 'w-40',
|
|
164
|
+
operator: 'w-40',
|
|
165
|
+
value: 'w-56'
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
const dataGridFilterPanelColumnVariants = exports.dataGridFilterPanelColumnVariants = (0, _utils.cva)('w-full');
|
|
170
|
+
const dataGridFilterPanelOperatorVariants = exports.dataGridFilterPanelOperatorVariants = (0, _utils.cva)('w-full');
|
|
171
|
+
const dataGridFilterPanelValueVariants = exports.dataGridFilterPanelValueVariants = (0, _utils.cva)('w-full');
|
|
172
|
+
const dataGridFilterPanelFooterVariants = exports.dataGridFilterPanelFooterVariants = (0, _utils.cva)('flex-row items-center justify-between gap-2 border-t border-stroke-secondary pt-2');
|
|
113
173
|
const dataGridHeadVariants = exports.dataGridHeadVariants = (0, _utils.cva)(['h-12 bg-neutral-50 px-4', _reactNative.Platform.select({
|
|
114
174
|
web: 'border-b border-stroke-secondary',
|
|
115
175
|
default: ''
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_utils","dataGridRootVariants","exports","cva","variants","autoHeight","true","false","defaultVariants","dataGridMainVariants","overlay","compoundVariants","className","dataGridToolbarVariants","dataGridToolbarSearchVariants","dataGridToolbarActionsVariants","dataGridFooterVariants","dataGridOverlayVariants","headerFilters","dataGridEmptyOverlayVariants","dataGridHeaderCellInnerVariants","align","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_utils","dataGridRootVariants","exports","cva","variants","autoHeight","true","false","defaultVariants","dataGridMainVariants","overlay","compoundVariants","className","dataGridPinnedSurfaceVariants","Platform","select","web","default","header","dataGridPinnedEdgeVariants","edge","start","end","none","dataGridToolbarVariants","dataGridToolbarSearchVariants","dataGridToolbarActionsVariants","dataGridFooterVariants","dataGridOverlayVariants","headerFilters","dataGridEmptyOverlayVariants","dataGridHeaderCellInnerVariants","align","center","fitToColumn","dataGridHeaderLabelVariants","dataGridSortButtonVariants","position","leading","trailing","sorted","dataGridTableVariants","dataGridHeaderVariants","dataGridBodyVariants","dataGridFilterInputVariants","dataGridFilterPanelVariants","dataGridFilterPanelRowVariants","dataGridFilterPanelLogicVariants","dataGridFilterPanelFieldVariants","size","column","operator","value","dataGridFilterPanelColumnVariants","dataGridFilterPanelOperatorVariants","dataGridFilterPanelValueVariants","dataGridFilterPanelFooterVariants","dataGridHeadVariants","dataGridSelectHeadVariants","dataGridCellVariants","dataGridSelectCellVariants","dataGridPaginationVariants","dataGridPaginationRangeVariants"],"sourceRoot":"../../src","sources":["styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,UAAG,EACrC,kHAAkH,EAClH;EACEC,QAAQ,EAAE;IACRC,UAAU,EAAE;MACVC,IAAI,EAAE,EAAE;MACRC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,UAAU,EAAE;EACd;AACF,CACF,CAAC;AAEM,MAAMI,oBAAoB,GAAAP,OAAA,CAAAO,oBAAA,GAAG,IAAAN,UAAG,EACrC,0DAA0D,EAC1D;EACEC,QAAQ,EAAE;IACRC,UAAU,EAAE;MACVC,IAAI,EAAE,WAAW;MACjBC,KAAK,EAAE;IACT,CAAC;IACD;IACAG,OAAO,EAAE;MACPJ,IAAI,EAAE,EAAE;MACRC,KAAK,EAAE;IACT;EACF,CAAC;EACDI,gBAAgB,EAAE,CAAC;IAAEN,UAAU,EAAE,IAAI;IAAEK,OAAO,EAAE,IAAI;IAAEE,SAAS,EAAE;EAAW,CAAC,CAAC;EAC9EJ,eAAe,EAAE;IACfH,UAAU,EAAE,KAAK;IACjBK,OAAO,EAAE;EACX;AACF,CACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACO,MAAMG,6BAA6B,GAAAX,OAAA,CAAAW,6BAAA,GAAG,IAAAV,UAAG,EAC9CW,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,oBAAoB;EACzBC,OAAO,EAAE;AACX,CAAC,CAAC,EACF;EACEb,QAAQ,EAAE;IACRc,MAAM,EAAE;MACNZ,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IAAArD,UAAG,EAClD,mFACF,CAAC;AAEM,MAAMsD,oBAAoB,GAAAvD,OAAA,CAAAuD,oBAAA,GAAG,IAAAtD,UAAG,EAAC,CACtC,yBAAyB,EACzBW,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,kCAAkC;EACvCC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,CAAC;AAEK,MAAMyC,0BAA0B,GAAAxD,OAAA,CAAAwD,0BAAA,GAAG,IAAAvD,UAAG,EAAC,CAC5C,yBAAyB,EACzBW,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,kCAAkC;EACvCC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,CAAC;AAEK,MAAM0C,oBAAoB,GAAAzD,OAAA,CAAAyD,oBAAA,GAAG,IAAAxD,UAAG,EAAC,CACtC,WAAW,EACXW,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,kCAAkC;EACvCC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,CAAC;AAEK,MAAM2C,0BAA0B,GAAA1D,OAAA,CAAA0D,0BAAA,GAAG,IAAAzD,UAAG,EAAC,CAC5C,WAAW,EACXW,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,kCAAkC;EACvCC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,CAAC;AAEK,MAAM4C,0BAA0B,GAAA3D,OAAA,CAAA2D,0BAAA,GAAG,IAAA1D,UAAG,EAAC,mDAAmD,CAAC;AAE3F,MAAM2D,+BAA+B,GAAA5D,OAAA,CAAA4D,+BAAA,GAAG,IAAA3D,UAAG,EAAC,eAAe,CAAC","ignoreList":[]}
|
package/lib/commonjs/types.js
CHANGED
|
@@ -3,8 +3,36 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SELECT_COLUMN_ID = exports.EMPTY_SELECTION = exports.DEFAULT_PAGINATION_MODEL = exports.DEFAULT_PAGE_SIZE_OPTIONS = void 0;
|
|
6
|
+
exports.SELECT_COLUMN_ID = exports.MUI_CHECKBOX_FIELD = exports.EMPTY_SELECTION = exports.DEFAULT_PAGINATION_MODEL = exports.DEFAULT_PAGE_SIZE_OPTIONS = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Filter operators. Names match MUI Data Grid Community so server handlers written for
|
|
9
|
+
* MUI keep working. Which operators a column accepts depends on its `type`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Columns pinned to the logical start and end edges while the grid scrolls
|
|
14
|
+
* horizontally.
|
|
15
|
+
*
|
|
16
|
+
* `left` and `right` are deprecated compatibility aliases for `start` and `end`
|
|
17
|
+
* (same mapping as `GridColDef.align`).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** How `filterModel` items combine: every item must match (`'and'`) or any one item (`'or'`). */
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Built-in column types. Names and defaults match MUI Data Grid Community.
|
|
24
|
+
* Omit `type` to keep untyped display, alignment, and sort.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A `singleSelect` choice: a primitive (value and label are the same) or an
|
|
29
|
+
* explicit `{ value, label }` pair.
|
|
30
|
+
*/
|
|
31
|
+
|
|
7
32
|
const SELECT_COLUMN_ID = exports.SELECT_COLUMN_ID = '__select__';
|
|
33
|
+
|
|
34
|
+
/** MUI X Data Grid checkbox-column field; accepted as an alias for {@link SELECT_COLUMN_ID}. */
|
|
35
|
+
const MUI_CHECKBOX_FIELD = exports.MUI_CHECKBOX_FIELD = '__check__';
|
|
8
36
|
const DEFAULT_PAGE_SIZE_OPTIONS = exports.DEFAULT_PAGE_SIZE_OPTIONS = [25, 50, 100];
|
|
9
37
|
const DEFAULT_PAGINATION_MODEL = exports.DEFAULT_PAGINATION_MODEL = {
|
|
10
38
|
page: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SELECT_COLUMN_ID","exports","DEFAULT_PAGE_SIZE_OPTIONS","DEFAULT_PAGINATION_MODEL","page","pageSize","EMPTY_SELECTION","type","ids","Set"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["SELECT_COLUMN_ID","exports","MUI_CHECKBOX_FIELD","DEFAULT_PAGE_SIZE_OPTIONS","DEFAULT_PAGINATION_MODEL","page","pageSize","EMPTY_SELECTION","type","ids","Set"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;;;;;AA8BA;AACA;AACA;AACA;;AAsCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;;AAYA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AA+HO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,YAAY;;AAE5C;AACO,MAAME,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,WAAW;AAEtC,MAAMC,yBAAyB,GAAAF,OAAA,CAAAE,yBAAA,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAU;AAExD,MAAMC,wBAA6C,GAAAH,OAAA,CAAAG,wBAAA,GAAG;EAC3DC,IAAI,EAAE,CAAC;EACPC,QAAQ,EAAE;AACZ,CAAC;AAEM,MAAMC,eAAsC,GAAAN,OAAA,CAAAM,eAAA,GAAG;EACpDC,IAAI,EAAE,SAAS;EACfC,GAAG,EAAE,IAAIC,GAAG,CAAC;AACf,CAAC","ignoreList":[]}
|
|
@@ -17,9 +17,22 @@ var _react = require("react");
|
|
|
17
17
|
var _reactTable = require("@tanstack/react-table");
|
|
18
18
|
var _selectColumn = require("./adapter/selectColumn");
|
|
19
19
|
var _columns = require("./adapter/columns");
|
|
20
|
+
var _columnTypes = require("./adapter/columnTypes");
|
|
21
|
+
var _filterOperators = require("./adapter/filterOperators");
|
|
20
22
|
var _types = require("./types");
|
|
23
|
+
function gridGlobalFilterFn(row, columnId, filterValue) {
|
|
24
|
+
if (columnId === _types.SELECT_COLUMN_ID) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
const meta = row.getAllCells().find(cell => cell.column.id === columnId)?.column.columnDef.meta;
|
|
28
|
+
if ((0, _columnTypes.metaUsesDisplayFilter)(meta)) {
|
|
29
|
+
return (0, _columnTypes.filterFn_displayText)(row, columnId, filterValue);
|
|
30
|
+
}
|
|
31
|
+
return (0, _columnTypes.untypedCellIncludesQuery)(row.getValue(columnId), (0, _columnTypes.normalizeFilterQuery)(filterValue));
|
|
32
|
+
}
|
|
21
33
|
const features = (0, _reactTable.tableFeatures)({
|
|
22
34
|
columnFilteringFeature: _reactTable.columnFilteringFeature,
|
|
35
|
+
columnPinningFeature: _reactTable.columnPinningFeature,
|
|
23
36
|
globalFilteringFeature: _reactTable.globalFilteringFeature,
|
|
24
37
|
rowSortingFeature: _reactTable.rowSortingFeature,
|
|
25
38
|
rowPaginationFeature: _reactTable.rowPaginationFeature,
|
|
@@ -32,7 +45,11 @@ const features = (0, _reactTable.tableFeatures)({
|
|
|
32
45
|
},
|
|
33
46
|
sortFns: {
|
|
34
47
|
alphanumeric: _reactTable.sortFn_alphanumeric,
|
|
35
|
-
text: _reactTable.sortFn_text
|
|
48
|
+
text: _reactTable.sortFn_text,
|
|
49
|
+
number: _columnTypes.sortFn_number,
|
|
50
|
+
datetime: _columnTypes.sortFn_datetime,
|
|
51
|
+
boolean: _columnTypes.sortFn_boolean,
|
|
52
|
+
selectLabel: _columnTypes.sortFn_selectLabel
|
|
36
53
|
}
|
|
37
54
|
});
|
|
38
55
|
function sortModelToSortingState(model) {
|
|
@@ -71,17 +88,60 @@ function columnFilterValueToString(value) {
|
|
|
71
88
|
}
|
|
72
89
|
return '';
|
|
73
90
|
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Items without an `operator` keep today's text filter. Items with one carry the operator and
|
|
94
|
+
* typed operand into the column filter. An item whose operator needs a value but has none is
|
|
95
|
+
* dropped, so `isEmpty` / `isNotEmpty` survive a blank `value` and nothing else does.
|
|
96
|
+
*/
|
|
74
97
|
function filterModelToColumnFilters(model) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
98
|
+
const valuesByField = new Map();
|
|
99
|
+
for (const item of model) {
|
|
100
|
+
let value;
|
|
101
|
+
if (item.operator !== undefined) {
|
|
102
|
+
if ((0, _filterOperators.filterOperatorNeedsValue)(item.operator) && (0, _filterOperators.isBlankFilterValue)(item.value)) {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
value = {
|
|
106
|
+
operator: item.operator,
|
|
107
|
+
value: item.value
|
|
108
|
+
};
|
|
109
|
+
} else {
|
|
110
|
+
const text = columnFilterValueToString(item.value);
|
|
111
|
+
if (text.trim().length === 0) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
value = text;
|
|
115
|
+
}
|
|
116
|
+
const values = valuesByField.get(item.field);
|
|
117
|
+
if (values) {
|
|
118
|
+
values.push(value);
|
|
119
|
+
} else {
|
|
120
|
+
valuesByField.set(item.field, [value]);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return [...valuesByField].map(([id, values]) => ({
|
|
124
|
+
id,
|
|
125
|
+
value: values.length === 1 ? values[0] : {
|
|
126
|
+
items: values
|
|
127
|
+
}
|
|
78
128
|
}));
|
|
79
129
|
}
|
|
130
|
+
function columnFilterValueToItem(field, value) {
|
|
131
|
+
if ((0, _filterOperators.isOperatorFilterValue)(value)) {
|
|
132
|
+
return {
|
|
133
|
+
field,
|
|
134
|
+
operator: value.operator,
|
|
135
|
+
value: value.value
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
field,
|
|
140
|
+
value: columnFilterValueToString(value)
|
|
141
|
+
};
|
|
142
|
+
}
|
|
80
143
|
function columnFiltersToFilterModel(state) {
|
|
81
|
-
return state.filter(item => item.id !== _types.SELECT_COLUMN_ID).
|
|
82
|
-
field: item.id,
|
|
83
|
-
value: columnFilterValueToString(item.value)
|
|
84
|
-
}));
|
|
144
|
+
return state.filter(item => item.id !== _types.SELECT_COLUMN_ID).flatMap(item => (0, _filterOperators.isFilterValueGroup)(item.value) ? item.value.items.map(value => columnFilterValueToItem(item.id, value)) : [columnFilterValueToItem(item.id, item.value)]);
|
|
85
145
|
}
|
|
86
146
|
function selectionIdKey(id) {
|
|
87
147
|
return `${typeof id}:${String(id)}`;
|
|
@@ -162,12 +222,30 @@ function useDataGridTable({
|
|
|
162
222
|
onPaginationModelChange,
|
|
163
223
|
filterModel,
|
|
164
224
|
onFilterModelChange,
|
|
225
|
+
filterLogicOperator,
|
|
165
226
|
quickFilter,
|
|
166
227
|
onQuickFilterChange,
|
|
167
228
|
rowSelectionModel,
|
|
168
|
-
onRowSelectionModelChange
|
|
229
|
+
onRowSelectionModelChange,
|
|
230
|
+
columnPinning
|
|
169
231
|
}) {
|
|
170
|
-
const
|
|
232
|
+
const orFilterItems = (0, _react.useMemo)(() => {
|
|
233
|
+
if (filterLogicOperator !== 'or' || filterMode === 'server') {
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
const active = filterModel.filter(_filterOperators.isActiveFilterItem);
|
|
237
|
+
return active.length > 1 ? active : undefined;
|
|
238
|
+
}, [filterLogicOperator, filterMode, filterModel]);
|
|
239
|
+
const data = (0, _react.useMemo)(() => {
|
|
240
|
+
if (!orFilterItems) {
|
|
241
|
+
return [...rows];
|
|
242
|
+
}
|
|
243
|
+
const filterableColumns = new Map(columns.filter(col => col.filterable !== false).map(col => [col.field, col]));
|
|
244
|
+
return rows.filter(row => orFilterItems.some(item => {
|
|
245
|
+
const col = filterableColumns.get(item.field);
|
|
246
|
+
return col !== undefined && (0, _filterOperators.rowMatchesFilterItem)(col, row, item);
|
|
247
|
+
}));
|
|
248
|
+
}, [columns, orFilterItems, rows]);
|
|
171
249
|
const allIds = (0, _react.useMemo)(() => data.map(row => resolveRowId(row, getRowId)), [data, getRowId]);
|
|
172
250
|
const columnDefs = (0, _react.useMemo)(() => {
|
|
173
251
|
const mapped = columns.map(col => {
|
|
@@ -181,7 +259,7 @@ function useDataGridTable({
|
|
|
181
259
|
}, [checkboxSelection, columns, disableColumnSorting]);
|
|
182
260
|
const sortingState = (0, _react.useMemo)(() => sortModelToSortingState(sortModel), [sortModel]);
|
|
183
261
|
const paginationState = (0, _react.useMemo)(() => paginationModelToState(paginationModel), [paginationModel]);
|
|
184
|
-
const columnFilterState = (0, _react.useMemo)(() => filterModelToColumnFilters(filterModel), [filterModel]);
|
|
262
|
+
const columnFilterState = (0, _react.useMemo)(() => orFilterItems ? [] : filterModelToColumnFilters(filterModel), [filterModel, orFilterItems]);
|
|
185
263
|
const rowSelectionState = (0, _react.useMemo)(() => selectionModelToRowSelection(rowSelectionModel, allIds), [rowSelectionModel, allIds]);
|
|
186
264
|
const resetPaginationPage = () => {
|
|
187
265
|
if (paginationModel.page !== 0) {
|
|
@@ -213,6 +291,7 @@ function useDataGridTable({
|
|
|
213
291
|
getRowId: row => selectionIdKey(resolveRowId(row, getRowId)),
|
|
214
292
|
enableMultiSort: false,
|
|
215
293
|
enableMultiRowSelection: true,
|
|
294
|
+
globalFilterFn: gridGlobalFilterFn,
|
|
216
295
|
manualPagination: paginationMode === 'server',
|
|
217
296
|
manualSorting: sortingMode === 'server',
|
|
218
297
|
manualFiltering: filterMode === 'server',
|
|
@@ -223,7 +302,8 @@ function useDataGridTable({
|
|
|
223
302
|
pagination: paginationState,
|
|
224
303
|
columnFilters: columnFilterState,
|
|
225
304
|
globalFilter: quickFilter,
|
|
226
|
-
rowSelection: rowSelectionState
|
|
305
|
+
rowSelection: rowSelectionState,
|
|
306
|
+
columnPinning
|
|
227
307
|
},
|
|
228
308
|
onSortingChange: updater => {
|
|
229
309
|
const next = (0, _columns.applyUpdater)(updater, sortingState);
|
|
@@ -248,10 +328,15 @@ function useDataGridTable({
|
|
|
248
328
|
onRowSelectionModelChange(rowSelectionToModel(next, rowSelectionModel, allIds));
|
|
249
329
|
}
|
|
250
330
|
});
|
|
331
|
+
const setFilterModel = model => {
|
|
332
|
+
onFilterModelChange(model);
|
|
333
|
+
resetPaginationPage();
|
|
334
|
+
};
|
|
251
335
|
return {
|
|
252
336
|
table,
|
|
253
337
|
setQuickFilter,
|
|
254
|
-
setColumnFilter
|
|
338
|
+
setColumnFilter,
|
|
339
|
+
setFilterModel
|
|
255
340
|
};
|
|
256
341
|
}
|
|
257
342
|
//# sourceMappingURL=useDataGridTable.js.map
|