eidos-ui 1.0.2 → 1.1.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.
- package/dist/Combobox.types-B7ozlnA9.d.cts +35 -0
- package/dist/Combobox.types-DkigkEh2.d.ts +35 -0
- package/dist/SegmentedControl.types-CK8EiShd.d.ts +35 -0
- package/dist/SegmentedControl.types-Dm4SnwCK.d.cts +35 -0
- package/dist/Select.types-B4kDpkGB.d.ts +42 -0
- package/dist/Select.types-CAkT2ACt.d.cts +42 -0
- package/dist/{chunk-CBLWP43O.cjs → chunk-A5JVDHML.cjs} +197 -74
- package/dist/chunk-A5JVDHML.cjs.map +1 -0
- package/dist/{chunk-S2EICHZK.js → chunk-A5LHCAQY.js} +197 -74
- package/dist/chunk-A5LHCAQY.js.map +1 -0
- package/dist/{chunk-W3X3V72Q.js → chunk-DW2YDWGN.js} +3 -3
- package/dist/chunk-DW2YDWGN.js.map +1 -0
- package/dist/{chunk-YRK56AOP.cjs → chunk-HNUTV3HR.cjs} +3 -3
- package/dist/chunk-HNUTV3HR.cjs.map +1 -0
- package/dist/combobox/index.cjs +2 -2
- package/dist/combobox/index.d.cts +4 -33
- package/dist/combobox/index.d.ts +4 -33
- package/dist/combobox/index.js +1 -1
- package/dist/data-grid/index.cjs +4 -2
- package/dist/data-grid/index.cjs.map +1 -1
- package/dist/data-grid/index.d.cts +91 -3
- package/dist/data-grid/index.d.ts +91 -3
- package/dist/data-grid/index.js +3 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +20 -4
- package/dist/index.d.cts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +7 -7
- package/dist/segmented-control/index.d.cts +5 -34
- package/dist/segmented-control/index.d.ts +5 -34
- package/dist/select/index.d.cts +5 -41
- package/dist/select/index.d.ts +5 -41
- package/package.json +4 -7
- package/dist/chunk-CBLWP43O.cjs.map +0 -1
- package/dist/chunk-S2EICHZK.js.map +0 -1
- package/dist/chunk-W3X3V72Q.js.map +0 -1
- package/dist/chunk-YRK56AOP.cjs.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { C as ComponentSizeProps } from './sizes-DM6Rrrgq.cjs';
|
|
3
|
+
|
|
4
|
+
interface ComboboxOption {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
group?: string;
|
|
11
|
+
}
|
|
12
|
+
interface ComboboxProps {
|
|
13
|
+
options?: ComboboxOption[];
|
|
14
|
+
value?: string;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
onChange?: (value: string) => void;
|
|
17
|
+
onSearch?: (query: string) => void;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
loadingText?: string;
|
|
21
|
+
emptyText?: string;
|
|
22
|
+
allowFreeText?: boolean;
|
|
23
|
+
clearable?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
size?: ComponentSizeProps;
|
|
26
|
+
label?: string;
|
|
27
|
+
error?: string;
|
|
28
|
+
hint?: string;
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
maxHeight?: number | string;
|
|
32
|
+
renderOption?: (option: ComboboxOption) => React__default.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type { ComboboxOption as C, ComboboxProps as a };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { C as ComponentSizeProps } from './sizes-DM6Rrrgq.js';
|
|
3
|
+
|
|
4
|
+
interface ComboboxOption {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
group?: string;
|
|
11
|
+
}
|
|
12
|
+
interface ComboboxProps {
|
|
13
|
+
options?: ComboboxOption[];
|
|
14
|
+
value?: string;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
onChange?: (value: string) => void;
|
|
17
|
+
onSearch?: (query: string) => void;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
loadingText?: string;
|
|
21
|
+
emptyText?: string;
|
|
22
|
+
allowFreeText?: boolean;
|
|
23
|
+
clearable?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
size?: ComponentSizeProps;
|
|
26
|
+
label?: string;
|
|
27
|
+
error?: string;
|
|
28
|
+
hint?: string;
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
maxHeight?: number | string;
|
|
32
|
+
renderOption?: (option: ComboboxOption) => React__default.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type { ComboboxOption as C, ComboboxProps as a };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { I as IconType } from './renderIcon-C2lEMMzb.js';
|
|
2
|
+
import { C as ComponentSizeProps } from './sizes-DM6Rrrgq.js';
|
|
3
|
+
|
|
4
|
+
type SegmentedControlColorProps = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
5
|
+
interface SegmentedOption {
|
|
6
|
+
/** Unique value for this segment. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Text label (optional if `icon` is provided). */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Icon to show before the label. */
|
|
11
|
+
icon?: IconType;
|
|
12
|
+
/** Disable this individual segment. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Tooltip shown on hover. */
|
|
15
|
+
tooltip?: string;
|
|
16
|
+
}
|
|
17
|
+
interface SegmentedControlProps {
|
|
18
|
+
/** Segment definitions. */
|
|
19
|
+
options: SegmentedOption[];
|
|
20
|
+
/** Controlled selected value. */
|
|
21
|
+
value?: string;
|
|
22
|
+
/** Initial value when uncontrolled. Defaults to the first option's value. */
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
/** Called with the newly selected value whenever the selection changes. */
|
|
25
|
+
onChange?: (value: string) => void;
|
|
26
|
+
size?: ComponentSizeProps;
|
|
27
|
+
color?: SegmentedControlColorProps;
|
|
28
|
+
/** Disable all segments. */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** Stretch to fill the parent's width. */
|
|
31
|
+
fullWidth?: boolean;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type { SegmentedControlColorProps as S, SegmentedControlProps as a, SegmentedOption as b };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { I as IconType } from './renderIcon-C2lEMMzb.cjs';
|
|
2
|
+
import { C as ComponentSizeProps } from './sizes-DM6Rrrgq.cjs';
|
|
3
|
+
|
|
4
|
+
type SegmentedControlColorProps = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
5
|
+
interface SegmentedOption {
|
|
6
|
+
/** Unique value for this segment. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Text label (optional if `icon` is provided). */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Icon to show before the label. */
|
|
11
|
+
icon?: IconType;
|
|
12
|
+
/** Disable this individual segment. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Tooltip shown on hover. */
|
|
15
|
+
tooltip?: string;
|
|
16
|
+
}
|
|
17
|
+
interface SegmentedControlProps {
|
|
18
|
+
/** Segment definitions. */
|
|
19
|
+
options: SegmentedOption[];
|
|
20
|
+
/** Controlled selected value. */
|
|
21
|
+
value?: string;
|
|
22
|
+
/** Initial value when uncontrolled. Defaults to the first option's value. */
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
/** Called with the newly selected value whenever the selection changes. */
|
|
25
|
+
onChange?: (value: string) => void;
|
|
26
|
+
size?: ComponentSizeProps;
|
|
27
|
+
color?: SegmentedControlColorProps;
|
|
28
|
+
/** Disable all segments. */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** Stretch to fill the parent's width. */
|
|
31
|
+
fullWidth?: boolean;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type { SegmentedControlColorProps as S, SegmentedControlProps as a, SegmentedOption as b };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { a as InputProps } from './Input.types-XrJTI0JC.js';
|
|
2
|
+
import { I as IconType } from './renderIcon-C2lEMMzb.js';
|
|
3
|
+
|
|
4
|
+
interface SelectOption {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
icon?: IconType;
|
|
10
|
+
}
|
|
11
|
+
interface SelectProps {
|
|
12
|
+
options: SelectOption[];
|
|
13
|
+
/** Controlled selected value(s). */
|
|
14
|
+
value?: string | string[];
|
|
15
|
+
/** Initial selected value(s) for uncontrolled usage. Ignored when `value` is provided. */
|
|
16
|
+
defaultValue?: string | string[];
|
|
17
|
+
onChange?: (value: string | string[]) => void;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
inputProps?: Partial<InputProps>;
|
|
23
|
+
name?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
fullWidth?: boolean;
|
|
27
|
+
minWidth?: number | string;
|
|
28
|
+
maxWidth?: number | string;
|
|
29
|
+
minHeight?: number | string;
|
|
30
|
+
maxHeight?: number | string;
|
|
31
|
+
autoWidth?: boolean;
|
|
32
|
+
clearable?: boolean;
|
|
33
|
+
/** Open the dropdown immediately on mount - useful for inline cell editors. */
|
|
34
|
+
autoOpen?: boolean;
|
|
35
|
+
dropdownProps?: {
|
|
36
|
+
dropdownLevel?: number;
|
|
37
|
+
dropdownGroup?: string;
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type { SelectOption as S, SelectProps as a };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { a as InputProps } from './Input.types-DFZNyJGF.cjs';
|
|
2
|
+
import { I as IconType } from './renderIcon-C2lEMMzb.cjs';
|
|
3
|
+
|
|
4
|
+
interface SelectOption {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
icon?: IconType;
|
|
10
|
+
}
|
|
11
|
+
interface SelectProps {
|
|
12
|
+
options: SelectOption[];
|
|
13
|
+
/** Controlled selected value(s). */
|
|
14
|
+
value?: string | string[];
|
|
15
|
+
/** Initial selected value(s) for uncontrolled usage. Ignored when `value` is provided. */
|
|
16
|
+
defaultValue?: string | string[];
|
|
17
|
+
onChange?: (value: string | string[]) => void;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
inputProps?: Partial<InputProps>;
|
|
23
|
+
name?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
fullWidth?: boolean;
|
|
27
|
+
minWidth?: number | string;
|
|
28
|
+
maxWidth?: number | string;
|
|
29
|
+
minHeight?: number | string;
|
|
30
|
+
maxHeight?: number | string;
|
|
31
|
+
autoWidth?: boolean;
|
|
32
|
+
clearable?: boolean;
|
|
33
|
+
/** Open the dropdown immediately on mount - useful for inline cell editors. */
|
|
34
|
+
autoOpen?: boolean;
|
|
35
|
+
dropdownProps?: {
|
|
36
|
+
dropdownLevel?: number;
|
|
37
|
+
dropdownGroup?: string;
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type { SelectOption as S, SelectProps as a };
|
|
@@ -23,6 +23,9 @@ var _chunkEQEV7GPTcjs = require('./chunk-EQEV7GPT.cjs');
|
|
|
23
23
|
var _chunkISABZ2VXcjs = require('./chunk-ISABZ2VX.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
var _chunkDKZTDYH5cjs = require('./chunk-DKZTDYH5.cjs');
|
|
27
|
+
|
|
28
|
+
|
|
26
29
|
var _chunkHLNKIAE5cjs = require('./chunk-HLNKIAE5.cjs');
|
|
27
30
|
|
|
28
31
|
|
|
@@ -32,6 +35,9 @@ var _chunkKV3V2CPHcjs = require('./chunk-KV3V2CPH.cjs');
|
|
|
32
35
|
var _chunkIJ4DXG7Dcjs = require('./chunk-IJ4DXG7D.cjs');
|
|
33
36
|
|
|
34
37
|
|
|
38
|
+
var _chunkHNUTV3HRcjs = require('./chunk-HNUTV3HR.cjs');
|
|
39
|
+
|
|
40
|
+
|
|
35
41
|
var _chunkG5IGADJIcjs = require('./chunk-G5IGADJI.cjs');
|
|
36
42
|
|
|
37
43
|
|
|
@@ -65,6 +71,13 @@ var _reactdom = require('react-dom');
|
|
|
65
71
|
var _lucidereact = require('lucide-react');
|
|
66
72
|
var _jsxruntime = require('react/jsx-runtime');
|
|
67
73
|
var MIN_COLUMN_WIDTH_PX = 100;
|
|
74
|
+
var QUICK_FILTER_RESET_VALUE = "";
|
|
75
|
+
var hasFilterValue = (value) => {
|
|
76
|
+
if (value === void 0 || value === null || value === "") return false;
|
|
77
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
78
|
+
if (typeof value === "object" && "start" in value) return !!(value.start || value.end);
|
|
79
|
+
return true;
|
|
80
|
+
};
|
|
68
81
|
function SortableTableRow({
|
|
69
82
|
id,
|
|
70
83
|
disabled,
|
|
@@ -176,6 +189,8 @@ function DataGridInner({
|
|
|
176
189
|
filterConfig = [],
|
|
177
190
|
filters,
|
|
178
191
|
onFiltersChange,
|
|
192
|
+
// ── Quick filters ──────────────────────────────────────────────────────────
|
|
193
|
+
quickFilters = [],
|
|
179
194
|
// ── Pagination ─────────────────────────────────────────────────────────────
|
|
180
195
|
showPagination = false,
|
|
181
196
|
pageSize = 10,
|
|
@@ -238,7 +253,13 @@ function DataGridInner({
|
|
|
238
253
|
);
|
|
239
254
|
const effectiveDensity = showDensity ? internalDensity : density;
|
|
240
255
|
const [internalSort, setInternalSort] = _react.useState.call(void 0, null);
|
|
241
|
-
const [internalFilters, setInternalFilters] = _react.useState.call(void 0, {
|
|
256
|
+
const [internalFilters, setInternalFilters] = _react.useState.call(void 0, () => {
|
|
257
|
+
const seeded = {};
|
|
258
|
+
quickFilters.forEach(({ key, defaultValue }) => {
|
|
259
|
+
if (hasFilterValue(defaultValue)) seeded[key] = defaultValue;
|
|
260
|
+
});
|
|
261
|
+
return seeded;
|
|
262
|
+
});
|
|
242
263
|
const [currentPage, setCurrentPage] = _react.useState.call(void 0, 1);
|
|
243
264
|
const [currentPageSize, setCurrentPageSize] = _react.useState.call(void 0, pageSize);
|
|
244
265
|
const isControlledSelection = controlledSelectedRows !== void 0;
|
|
@@ -319,8 +340,9 @@ function DataGridInner({
|
|
|
319
340
|
() => new Set(isControlledExpansion ? _nullishCoalesce(controlledExpandedRows, () => ( [])) : [...internalExpandedKeys]),
|
|
320
341
|
[isControlledExpansion, controlledExpandedRows, internalExpandedKeys]
|
|
321
342
|
);
|
|
343
|
+
const quickFilterKeys = _react.useMemo.call(void 0, () => new Set(quickFilters.map((f) => f.key)), [quickFilters]);
|
|
322
344
|
const filterDropdownColumns = _react.useMemo.call(void 0, () => {
|
|
323
|
-
return filterConfig.map(
|
|
345
|
+
return filterConfig.filter((field) => !quickFilterKeys.has(field.key)).map(
|
|
324
346
|
(field) => ({
|
|
325
347
|
key: field.key,
|
|
326
348
|
label: field.label,
|
|
@@ -330,7 +352,17 @@ function DataGridInner({
|
|
|
330
352
|
dateFilterMode: field.dateFilterMode
|
|
331
353
|
})
|
|
332
354
|
);
|
|
333
|
-
}, [filterConfig]);
|
|
355
|
+
}, [filterConfig, quickFilterKeys]);
|
|
356
|
+
const dropdownFilterKeys = _react.useMemo.call(void 0,
|
|
357
|
+
() => new Set(filterDropdownColumns.map((col) => String(col.key))),
|
|
358
|
+
[filterDropdownColumns]
|
|
359
|
+
);
|
|
360
|
+
const dropdownFilters = _react.useMemo.call(void 0,
|
|
361
|
+
() => Object.fromEntries(
|
|
362
|
+
Object.entries(activeFilters).filter(([key]) => dropdownFilterKeys.has(key))
|
|
363
|
+
),
|
|
364
|
+
[activeFilters, dropdownFilterKeys]
|
|
365
|
+
);
|
|
334
366
|
const filteredData = _react.useMemo.call(void 0, () => {
|
|
335
367
|
if (onFiltersChange) return localData;
|
|
336
368
|
const filterEntries = Object.entries(activeFilters).filter(([, val]) => {
|
|
@@ -667,7 +699,7 @@ function DataGridInner({
|
|
|
667
699
|
},
|
|
668
700
|
[onSortChange, currentSort]
|
|
669
701
|
);
|
|
670
|
-
const
|
|
702
|
+
const commitFilters = _react.useCallback.call(void 0,
|
|
671
703
|
(newFilters) => {
|
|
672
704
|
setCurrentPage(1);
|
|
673
705
|
if (onFiltersChange) {
|
|
@@ -678,6 +710,28 @@ function DataGridInner({
|
|
|
678
710
|
},
|
|
679
711
|
[onFiltersChange]
|
|
680
712
|
);
|
|
713
|
+
const handleFiltersChange = _react.useCallback.call(void 0,
|
|
714
|
+
(newFilters) => {
|
|
715
|
+
const preserved = Object.entries(activeFilters).filter(
|
|
716
|
+
([key]) => !dropdownFilterKeys.has(key)
|
|
717
|
+
);
|
|
718
|
+
commitFilters({ ...Object.fromEntries(preserved), ...newFilters });
|
|
719
|
+
},
|
|
720
|
+
[activeFilters, dropdownFilterKeys, commitFilters]
|
|
721
|
+
);
|
|
722
|
+
const handleQuickFilterChange = _react.useCallback.call(void 0,
|
|
723
|
+
(key, value) => {
|
|
724
|
+
const next = { ...activeFilters };
|
|
725
|
+
if (hasFilterValue(value)) {
|
|
726
|
+
next[key] = value;
|
|
727
|
+
} else {
|
|
728
|
+
delete next[key];
|
|
729
|
+
}
|
|
730
|
+
commitFilters(next);
|
|
731
|
+
},
|
|
732
|
+
[activeFilters, commitFilters]
|
|
733
|
+
);
|
|
734
|
+
const clearAllFilters = _react.useCallback.call(void 0, () => commitFilters({}), [commitFilters]);
|
|
681
735
|
const handlePageChange = _react.useCallback.call(void 0,
|
|
682
736
|
(page) => {
|
|
683
737
|
setCurrentPage(page);
|
|
@@ -899,7 +953,82 @@ function DataGridInner({
|
|
|
899
953
|
if (stickyHeader && maxHeight) {
|
|
900
954
|
containerStyle.maxHeight = typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight;
|
|
901
955
|
}
|
|
902
|
-
const showToolbar = !!showFilters || !!showDensity || !!selectable || !!onRowAdd;
|
|
956
|
+
const showToolbar = !!showFilters || quickFilters.length > 0 || !!showDensity || !!selectable || !!onRowAdd;
|
|
957
|
+
const showQuickFilters = quickFilters.length > 0 && !(selectable && hasSelection);
|
|
958
|
+
const renderQuickFilter = (quickFilter) => {
|
|
959
|
+
const { key, label, disabled, width } = quickFilter;
|
|
960
|
+
const value = activeFilters[key];
|
|
961
|
+
const style = width === void 0 ? void 0 : {
|
|
962
|
+
"--eidos-datagrid-quick-filter-width": typeof width === "number" ? `${width}px` : width
|
|
963
|
+
};
|
|
964
|
+
const control = (() => {
|
|
965
|
+
switch (quickFilter.type) {
|
|
966
|
+
case "segmented":
|
|
967
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
968
|
+
_chunkDKZTDYH5cjs.SegmentedControl,
|
|
969
|
+
{
|
|
970
|
+
size: "sm",
|
|
971
|
+
color: quickFilter.color,
|
|
972
|
+
disabled,
|
|
973
|
+
options: [
|
|
974
|
+
{ value: QUICK_FILTER_RESET_VALUE, label: _nullishCoalesce(quickFilter.allLabel, () => ( "All")) },
|
|
975
|
+
...quickFilter.options
|
|
976
|
+
],
|
|
977
|
+
value: typeof value === "string" ? value : QUICK_FILTER_RESET_VALUE,
|
|
978
|
+
onChange: (next) => handleQuickFilterChange(key, next)
|
|
979
|
+
}
|
|
980
|
+
);
|
|
981
|
+
case "combobox":
|
|
982
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
983
|
+
_chunkHNUTV3HRcjs.Combobox,
|
|
984
|
+
{
|
|
985
|
+
size: "sm",
|
|
986
|
+
fullWidth: true,
|
|
987
|
+
disabled,
|
|
988
|
+
placeholder: _nullishCoalesce(quickFilter.placeholder, () => ( label)),
|
|
989
|
+
clearable: _nullishCoalesce(quickFilter.clearable, () => ( true)),
|
|
990
|
+
emptyText: quickFilter.emptyText,
|
|
991
|
+
loading: quickFilter.loading,
|
|
992
|
+
loadingText: quickFilter.loadingText,
|
|
993
|
+
onSearch: quickFilter.onSearch,
|
|
994
|
+
options: (_nullishCoalesce(quickFilter.options, () => ( []))).map((option) => ({
|
|
995
|
+
...option,
|
|
996
|
+
id: option.value
|
|
997
|
+
})),
|
|
998
|
+
value: typeof value === "string" ? value : "",
|
|
999
|
+
onChange: (next) => handleQuickFilterChange(key, next)
|
|
1000
|
+
}
|
|
1001
|
+
);
|
|
1002
|
+
case "select":
|
|
1003
|
+
default:
|
|
1004
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1005
|
+
_chunkHLNKIAE5cjs.Select,
|
|
1006
|
+
{
|
|
1007
|
+
fullWidth: true,
|
|
1008
|
+
inputProps: { size: "sm" },
|
|
1009
|
+
disabled,
|
|
1010
|
+
placeholder: _nullishCoalesce(quickFilter.placeholder, () => ( label)),
|
|
1011
|
+
clearable: _nullishCoalesce(quickFilter.clearable, () => ( true)),
|
|
1012
|
+
multiple: quickFilter.multiple,
|
|
1013
|
+
options: quickFilter.options.map((option) => ({ ...option, id: option.value })),
|
|
1014
|
+
value: quickFilter.multiple ? Array.isArray(value) ? value : [] : typeof value === "string" ? value : "",
|
|
1015
|
+
onChange: (next) => handleQuickFilterChange(key, next)
|
|
1016
|
+
}
|
|
1017
|
+
);
|
|
1018
|
+
}
|
|
1019
|
+
})();
|
|
1020
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1021
|
+
"div",
|
|
1022
|
+
{
|
|
1023
|
+
className: `eidos-datagrid-quick-filter eidos-datagrid-quick-filter--${quickFilter.type}`,
|
|
1024
|
+
style,
|
|
1025
|
+
role: "group",
|
|
1026
|
+
"aria-label": label,
|
|
1027
|
+
children: control
|
|
1028
|
+
},
|
|
1029
|
+
key
|
|
1030
|
+
);
|
|
1031
|
+
};
|
|
903
1032
|
const densityClass = effectiveDensity !== "comfortable" ? `eidos-datagrid--${effectiveDensity}` : "";
|
|
904
1033
|
const effectivePageSizeOptions = _react.useMemo.call(void 0, () => {
|
|
905
1034
|
const opts = _nullishCoalesce(pageSizeOptions, () => ( [10, 25, 50, 100]));
|
|
@@ -939,72 +1068,75 @@ function DataGridInner({
|
|
|
939
1068
|
style: containerStyle,
|
|
940
1069
|
children: [
|
|
941
1070
|
showToolbar && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "eidos-datagrid-toolbar", children: [
|
|
942
|
-
/* @__PURE__ */ _jsxruntime.
|
|
943
|
-
/* @__PURE__ */ _jsxruntime.
|
|
944
|
-
|
|
945
|
-
"
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1071
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "eidos-datagrid-toolbar-left", children: [
|
|
1072
|
+
showQuickFilters && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "eidos-datagrid-quick-filters", children: quickFilters.map(renderQuickFilter) }),
|
|
1073
|
+
selectable && hasSelection && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1074
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "eidos-datagrid-selection-count", children: [
|
|
1075
|
+
selectedSet.size,
|
|
1076
|
+
" selected"
|
|
1077
|
+
] }),
|
|
1078
|
+
bulkActions && bulkActions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "eidos-datagrid-bulk-actions", children: bulkActions.map((action) => {
|
|
1079
|
+
const isDisabled = typeof action.disabled === "function" ? action.disabled(selectedItems) : _nullishCoalesce(action.disabled, () => ( false));
|
|
1080
|
+
if (action.type === "split-button") {
|
|
1081
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1082
|
+
_chunkEQEV7GPTcjs.SplitButton,
|
|
1083
|
+
{
|
|
1084
|
+
size: "sm",
|
|
1085
|
+
variant: _nullishCoalesce(action.variant, () => ( "outlined")),
|
|
1086
|
+
color: _nullishCoalesce(action.color, () => ( "secondary")),
|
|
1087
|
+
preIcon: action.icon,
|
|
1088
|
+
disabled: isDisabled,
|
|
1089
|
+
label: action.label,
|
|
1090
|
+
onClick: () => action.onClick(selectedItems),
|
|
1091
|
+
options: action.options.map((option) => ({
|
|
1092
|
+
id: option.id,
|
|
1093
|
+
label: option.label,
|
|
1094
|
+
icon: option.icon,
|
|
1095
|
+
disabled: option.disabled,
|
|
1096
|
+
onClick: () => option.onClick(selectedItems)
|
|
1097
|
+
}))
|
|
1098
|
+
},
|
|
1099
|
+
action.id
|
|
1100
|
+
);
|
|
1101
|
+
}
|
|
1102
|
+
return action.label ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1103
|
+
_chunkA7Z2QAFZcjs.Button,
|
|
952
1104
|
{
|
|
953
1105
|
size: "sm",
|
|
954
1106
|
variant: _nullishCoalesce(action.variant, () => ( "outlined")),
|
|
955
1107
|
color: _nullishCoalesce(action.color, () => ( "secondary")),
|
|
956
1108
|
preIcon: action.icon,
|
|
1109
|
+
posIcon: action.posIcon,
|
|
957
1110
|
disabled: isDisabled,
|
|
958
|
-
label: action.label,
|
|
959
1111
|
onClick: () => action.onClick(selectedItems),
|
|
960
|
-
|
|
961
|
-
id: option.id,
|
|
962
|
-
label: option.label,
|
|
963
|
-
icon: option.icon,
|
|
964
|
-
disabled: option.disabled,
|
|
965
|
-
onClick: () => option.onClick(selectedItems)
|
|
966
|
-
}))
|
|
1112
|
+
children: action.label
|
|
967
1113
|
},
|
|
968
1114
|
action.id
|
|
969
|
-
)
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
) : action.icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
985
|
-
_chunkA7Z2QAFZcjs.Button,
|
|
1115
|
+
) : action.icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1116
|
+
_chunkA7Z2QAFZcjs.Button,
|
|
1117
|
+
{
|
|
1118
|
+
size: "sm",
|
|
1119
|
+
variant: _nullishCoalesce(action.variant, () => ( "outlined")),
|
|
1120
|
+
color: _nullishCoalesce(action.color, () => ( "secondary")),
|
|
1121
|
+
icon: action.icon,
|
|
1122
|
+
disabled: isDisabled,
|
|
1123
|
+
onClick: () => action.onClick(selectedItems)
|
|
1124
|
+
},
|
|
1125
|
+
action.id
|
|
1126
|
+
) : null;
|
|
1127
|
+
}) }),
|
|
1128
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1129
|
+
"button",
|
|
986
1130
|
{
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
}) }),
|
|
997
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
998
|
-
"button",
|
|
999
|
-
{
|
|
1000
|
-
type: "button",
|
|
1001
|
-
className: "eidos-datagrid-clear-selection",
|
|
1002
|
-
onClick: clearSelection,
|
|
1003
|
-
"aria-label": "Clear selection",
|
|
1004
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.X, { size: 14 })
|
|
1005
|
-
}
|
|
1006
|
-
)
|
|
1007
|
-
] }) }),
|
|
1131
|
+
type: "button",
|
|
1132
|
+
className: "eidos-datagrid-clear-selection",
|
|
1133
|
+
onClick: clearSelection,
|
|
1134
|
+
"aria-label": "Clear selection",
|
|
1135
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.X, { size: 14 })
|
|
1136
|
+
}
|
|
1137
|
+
)
|
|
1138
|
+
] })
|
|
1139
|
+
] }),
|
|
1008
1140
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "eidos-datagrid-toolbar-right", children: [
|
|
1009
1141
|
showDensity && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1010
1142
|
_chunkFRUOA2QUcjs.Dropdown,
|
|
@@ -1038,7 +1170,7 @@ function DataGridInner({
|
|
|
1038
1170
|
_chunkPA4IT2XQcjs.TableFiltersDropdown,
|
|
1039
1171
|
{
|
|
1040
1172
|
columns: filterDropdownColumns,
|
|
1041
|
-
filters:
|
|
1173
|
+
filters: dropdownFilters,
|
|
1042
1174
|
onFiltersChange: handleFiltersChange
|
|
1043
1175
|
}
|
|
1044
1176
|
),
|
|
@@ -1129,16 +1261,7 @@ function DataGridInner({
|
|
|
1129
1261
|
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SearchX, {}),
|
|
1130
1262
|
title: "No results found",
|
|
1131
1263
|
description: "Try adjusting your filters or search terms.",
|
|
1132
|
-
action: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1133
|
-
_chunkA7Z2QAFZcjs.Button,
|
|
1134
|
-
{
|
|
1135
|
-
size: "sm",
|
|
1136
|
-
variant: "outlined",
|
|
1137
|
-
color: "primary",
|
|
1138
|
-
onClick: () => handleFiltersChange({}),
|
|
1139
|
-
children: "Clear filters"
|
|
1140
|
-
}
|
|
1141
|
-
),
|
|
1264
|
+
action: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkA7Z2QAFZcjs.Button, { size: "sm", variant: "outlined", color: "primary", onClick: clearAllFilters, children: "Clear filters" }),
|
|
1142
1265
|
size: "sm"
|
|
1143
1266
|
}
|
|
1144
1267
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1431,7 +1554,7 @@ function DataGridInner({
|
|
|
1431
1554
|
size: "sm",
|
|
1432
1555
|
variant: "outlined",
|
|
1433
1556
|
color: "primary",
|
|
1434
|
-
onClick:
|
|
1557
|
+
onClick: clearAllFilters,
|
|
1435
1558
|
children: "Clear filters"
|
|
1436
1559
|
}
|
|
1437
1560
|
),
|
|
@@ -1483,4 +1606,4 @@ var DataGrid = Object.assign(DataGridInner, { displayName: "DataGrid" });
|
|
|
1483
1606
|
|
|
1484
1607
|
|
|
1485
1608
|
exports.DataGrid = DataGrid;
|
|
1486
|
-
//# sourceMappingURL=chunk-
|
|
1609
|
+
//# sourceMappingURL=chunk-A5JVDHML.cjs.map
|