@dbcdk/react-components 0.0.20 → 0.0.22
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/components/button/Button.module.css +13 -6
- package/dist/components/chip/Chip.d.ts +3 -2
- package/dist/components/chip/Chip.js +2 -1
- package/dist/components/chip/Chip.module.css +107 -67
- package/dist/components/filter-field/FilterField.d.ts +2 -1
- package/dist/components/filter-field/FilterField.js +4 -9
- package/dist/components/filter-field/FilterField.module.css +203 -152
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.d.ts +2 -3
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +3 -5
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +13 -13
- package/dist/components/forms/input/Input.d.ts +1 -1
- package/dist/components/forms/input/Input.js +3 -9
- package/dist/components/forms/input/Input.module.css +106 -17
- package/dist/components/hyperlink/Hyperlink.module.css +14 -3
- package/dist/components/interval-select/IntervalSelect.js +2 -2
- package/dist/components/popover/Popover.module.css +4 -1
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +4 -2
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +17 -19
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +128 -20
- package/dist/components/sidebar/Sidebar.d.ts +2 -1
- package/dist/components/sidebar/Sidebar.js +2 -2
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +2 -3
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +2 -4
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +9 -1
- package/dist/components/table/Table.d.ts +2 -7
- package/dist/components/table/Table.js +90 -47
- package/dist/components/table/Table.module.css +301 -72
- package/dist/components/table/TanstackTable.js +3 -27
- package/dist/components/table/table.utils.d.ts +1 -1
- package/dist/components/table/table.utils.js +2 -1
- package/dist/components/table/tanstackTable.utils.d.ts +9 -10
- package/dist/components/table/tanstackTable.utils.js +50 -30
- package/dist/hooks/useViewportFill.d.ts +6 -5
- package/dist/hooks/useViewportFill.js +43 -41
- package/dist/src/styles/styles.css +5 -2
- package/dist/styles/styles.css +5 -2
- package/dist/styles/themes/dbc/base.css +0 -3
- package/dist/styles/themes/dbc/dark.css +44 -12
- package/dist/styles/themes/dbc/light.css +33 -7
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
gap: var(--
|
|
5
|
+
gap: var(--spacing-xxs);
|
|
6
6
|
|
|
7
7
|
font-family: var(--font-family);
|
|
8
8
|
font-size: var(--font-size-sm);
|
|
@@ -151,14 +151,21 @@
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
.default {
|
|
154
|
-
background-color: var(--color-bg-
|
|
154
|
+
background-color: var(--color-bg-toolbar);
|
|
155
155
|
color: var(--color-fg-default);
|
|
156
|
-
border-color:
|
|
156
|
+
border-color: transparent;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
.default:hover {
|
|
160
|
-
background-color: var(--color-bg-hover
|
|
161
|
-
border-color:
|
|
160
|
+
background-color: var(--color-bg-toolbar-hover);
|
|
161
|
+
border-color: transparent;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.default:focus-visible {
|
|
165
|
+
outline: none;
|
|
166
|
+
box-shadow:
|
|
167
|
+
inset 0 0 0 1px var(--color-border-selected),
|
|
168
|
+
var(--focus-ring);
|
|
162
169
|
}
|
|
163
170
|
|
|
164
171
|
.outlined {
|
|
@@ -213,7 +220,7 @@
|
|
|
213
220
|
}
|
|
214
221
|
|
|
215
222
|
.button.inline:hover {
|
|
216
|
-
background-color: var(--
|
|
223
|
+
background-color: var(--opac-bg-light);
|
|
217
224
|
}
|
|
218
225
|
|
|
219
226
|
.active {
|
|
@@ -9,7 +9,8 @@ interface ChipProps {
|
|
|
9
9
|
fullWidth?: boolean;
|
|
10
10
|
onClose?: () => void;
|
|
11
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
|
-
type?: 'default' | 'rounded' | 'outlined';
|
|
12
|
+
type?: 'default' | 'rounded' | 'outlined' | 'subtle';
|
|
13
|
+
selected?: boolean;
|
|
13
14
|
}
|
|
14
|
-
export declare function Chip({ children, severity, loading, disableIcon, fullWidth, size, customIcon, type, onClose, }: ChipProps): JSX.Element;
|
|
15
|
+
export declare function Chip({ children, severity, loading, disableIcon, fullWidth, size, customIcon, type, selected, onClose, }: ChipProps): JSX.Element;
|
|
15
16
|
export {};
|
|
@@ -5,7 +5,7 @@ import { useState, useRef, useEffect } from 'react';
|
|
|
5
5
|
import styles from './Chip.module.css';
|
|
6
6
|
import { Icon } from '../icon/Icon';
|
|
7
7
|
import { SkeletonLoaderItem } from '../skeleton-loader/skeleton-loader-item/SkeletonLoaderItem';
|
|
8
|
-
export function Chip({ children, severity = 'neutral', loading, disableIcon = true, fullWidth = false, size = 'md', customIcon, type = 'rounded', onClose, }) {
|
|
8
|
+
export function Chip({ children, severity = 'neutral', loading, disableIcon = true, fullWidth = false, size = 'md', customIcon, type = 'rounded', selected = false, onClose, }) {
|
|
9
9
|
const [chipWidth, setChipWidth] = useState(undefined);
|
|
10
10
|
const chipRef = useRef(null);
|
|
11
11
|
useEffect(() => {
|
|
@@ -26,5 +26,6 @@ export function Chip({ children, severity = 'neutral', loading, disableIcon = tr
|
|
|
26
26
|
styles[type],
|
|
27
27
|
hasLeading ? styles.hasLeading : '',
|
|
28
28
|
hasClose ? styles.hasClose : '',
|
|
29
|
+
selected ? styles.selected : '',
|
|
29
30
|
].join(' '), children: [hasLeading ? (_jsxs("span", { className: styles.leading, children: [severity && !disableIcon && _jsx(Icon, { severity: severity }), customIcon] })) : null, _jsx("span", { className: styles.label, children: children }), hasClose && (_jsx("button", { type: "button", onClick: onClose, className: styles.close, "aria-label": "Luk", children: _jsx(X, {}) }))] }));
|
|
30
31
|
}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
.container {
|
|
2
|
-
/* local layout tokens */
|
|
3
|
-
--chip-gap: var(--spacing-xxs);
|
|
4
|
-
--chip-pad-y: var(--spacing-xxs);
|
|
5
|
-
--chip-pad-x: var(--spacing-md);
|
|
6
|
-
|
|
7
|
-
/* when no icon, compensate by half the gap on each side */
|
|
8
|
-
--chip-pad-x-noicon: calc(var(--chip-pad-x) + (var(--chip-gap) / 2));
|
|
9
|
-
|
|
10
2
|
display: inline-flex;
|
|
11
3
|
align-items: center;
|
|
12
|
-
gap: var(--
|
|
4
|
+
gap: var(--spacing-xs);
|
|
13
5
|
white-space: nowrap;
|
|
14
6
|
|
|
15
7
|
color: var(--chip-fg-default, var(--color-fg-default));
|
|
16
|
-
|
|
17
|
-
border
|
|
8
|
+
background: transparent;
|
|
9
|
+
border: 1px solid transparent;
|
|
10
|
+
border-radius: var(--border-radius-rounded);
|
|
18
11
|
|
|
19
|
-
padding-
|
|
20
|
-
padding-
|
|
12
|
+
padding-inline: var(--spacing-sm);
|
|
13
|
+
padding-block: var(--spacing-2xs);
|
|
21
14
|
|
|
22
15
|
font-family: var(--font-family);
|
|
23
16
|
font-size: var(--font-size-sm);
|
|
@@ -27,32 +20,69 @@
|
|
|
27
20
|
background-color var(--transition-fast) var(--ease-standard),
|
|
28
21
|
color var(--transition-fast) var(--ease-standard),
|
|
29
22
|
border-color var(--transition-fast) var(--ease-standard),
|
|
30
|
-
box-shadow var(--transition-fast) var(--ease-standard)
|
|
23
|
+
box-shadow var(--transition-fast) var(--ease-standard),
|
|
24
|
+
transform var(--transition-fast) var(--ease-standard);
|
|
31
25
|
}
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
border-radius: var(--border-radius-rounded);
|
|
27
|
+
.container:focus-visible {
|
|
28
|
+
outline: none;
|
|
36
29
|
}
|
|
37
30
|
|
|
38
|
-
.
|
|
31
|
+
.rounded {
|
|
39
32
|
border-radius: var(--border-radius-rounded);
|
|
40
|
-
border: var(--border-width-thin) solid var(--color-border-default);
|
|
41
|
-
background-color: transparent;
|
|
42
33
|
}
|
|
43
34
|
|
|
44
35
|
.default {
|
|
45
36
|
border-radius: var(--border-radius-default);
|
|
46
37
|
}
|
|
47
38
|
|
|
48
|
-
/*
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
/* Types */
|
|
40
|
+
|
|
41
|
+
.outlined {
|
|
42
|
+
background-color: var(--color-bg-surface);
|
|
43
|
+
border: 1px solid var(--color-border-subtle);
|
|
44
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
|
|
45
|
+
color: var(--color-fg-muted);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.outlined:hover {
|
|
49
|
+
background-color: var(--color-bg-surface);
|
|
50
|
+
border-color: var(--color-border-default);
|
|
51
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
52
|
+
color: var(--color-fg-default);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
.outlined:focus-visible {
|
|
56
|
+
outline: none;
|
|
57
|
+
border-color: var(--color-border-selected);
|
|
58
|
+
box-shadow:
|
|
59
|
+
0 1px 2px rgba(0, 0, 0, 0.03),
|
|
60
|
+
inset 0 0 0 1px var(--color-border-selected);
|
|
61
|
+
color: var(--color-fg-default);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.subtle {
|
|
65
|
+
background-color: var(--color-bg-toolbar);
|
|
66
|
+
border: 1px solid transparent;
|
|
67
|
+
box-shadow: inset 0 0 0 1px transparent;
|
|
68
|
+
color: var(--color-fg-muted);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.subtle:hover {
|
|
72
|
+
background-color: var(--color-bg-toolbar-hover);
|
|
73
|
+
border-color: transparent;
|
|
74
|
+
color: var(--color-fg-default);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.subtle:focus-visible {
|
|
78
|
+
outline: none;
|
|
79
|
+
border-color: var(--color-border-selected);
|
|
80
|
+
box-shadow: inset 0 0 0 1px var(--color-border-selected);
|
|
81
|
+
color: var(--color-fg-default);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Content */
|
|
85
|
+
|
|
56
86
|
.leading {
|
|
57
87
|
display: inline-flex;
|
|
58
88
|
align-items: center;
|
|
@@ -66,7 +96,6 @@
|
|
|
66
96
|
min-width: 0;
|
|
67
97
|
}
|
|
68
98
|
|
|
69
|
-
/* ---- Icon sizing ---- */
|
|
70
99
|
.leading svg,
|
|
71
100
|
.close svg {
|
|
72
101
|
inline-size: var(--icon-size-sm);
|
|
@@ -74,38 +103,11 @@
|
|
|
74
103
|
color: currentColor;
|
|
75
104
|
}
|
|
76
105
|
|
|
77
|
-
|
|
78
|
-
.sm .close svg {
|
|
79
|
-
inline-size: 14px;
|
|
80
|
-
block-size: 14px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.lg .leading svg,
|
|
84
|
-
.lg .close svg {
|
|
85
|
-
inline-size: var(--icon-size-md);
|
|
86
|
-
block-size: var(--icon-size-md);
|
|
87
|
-
}
|
|
106
|
+
/* Sizes */
|
|
88
107
|
|
|
89
|
-
/* ---- Sizes ---- */
|
|
90
108
|
.sm {
|
|
91
|
-
--chip-pad-y: var(--spacing-2xs);
|
|
92
|
-
--chip-pad-x: var(--spacing-xs);
|
|
93
|
-
/* keep same gap unless you explicitly want tighter; if you do, change only here */
|
|
94
|
-
/* --chip-gap: var(--spacing-2xs); */
|
|
95
|
-
|
|
96
109
|
height: var(--component-size-xs);
|
|
97
110
|
font-size: var(--font-size-xs);
|
|
98
|
-
|
|
99
|
-
/* recompute derived value */
|
|
100
|
-
--chip-pad-x-noicon: calc(var(--chip-pad-x) + (var(--chip-gap) / 2));
|
|
101
|
-
|
|
102
|
-
padding-block: var(--chip-pad-y);
|
|
103
|
-
padding-inline: var(--chip-pad-x-noicon);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.sm.hasLeading {
|
|
107
|
-
padding-left: var(--spacing-xxs);
|
|
108
|
-
padding-right: var(--spacing-xxs);
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
.md {
|
|
@@ -113,55 +115,87 @@
|
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
.lg {
|
|
116
|
-
--chip-pad-y: var(--spacing-xs);
|
|
117
|
-
|
|
118
118
|
height: var(--component-size-md);
|
|
119
|
-
padding-block: var(--
|
|
119
|
+
padding-block: var(--spacing-xs);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
/*
|
|
122
|
+
/* Status variants */
|
|
123
|
+
|
|
123
124
|
.neutral {
|
|
124
|
-
background-color: var(--color-bg-
|
|
125
|
+
background-color: var(--color-bg-toolbar);
|
|
126
|
+
color: var(--color-fg-default);
|
|
125
127
|
border-color: transparent;
|
|
128
|
+
box-shadow: inset 0 0 0 1px var(--color-border-subtle);
|
|
126
129
|
}
|
|
127
130
|
|
|
128
131
|
.success {
|
|
129
132
|
background-color: var(--color-status-success-bg);
|
|
130
133
|
color: var(--color-status-success-fg);
|
|
131
|
-
border-color:
|
|
134
|
+
border-color: transparent;
|
|
135
|
+
box-shadow: inset 0 0 0 1px var(--color-status-success-border);
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
.warning {
|
|
135
139
|
background-color: var(--color-status-warning-bg);
|
|
136
140
|
color: var(--color-status-warning-fg);
|
|
137
|
-
border-color:
|
|
141
|
+
border-color: transparent;
|
|
142
|
+
box-shadow: inset 0 0 0 1px var(--color-status-warning-border);
|
|
138
143
|
}
|
|
139
144
|
|
|
140
145
|
.error {
|
|
141
146
|
background-color: var(--color-status-error-bg);
|
|
142
147
|
color: var(--color-status-error-fg);
|
|
143
|
-
border-color:
|
|
148
|
+
border-color: transparent;
|
|
149
|
+
box-shadow: inset 0 0 0 1px var(--color-status-error-border);
|
|
144
150
|
}
|
|
145
151
|
|
|
146
152
|
.info {
|
|
147
153
|
background-color: var(--color-status-info-bg);
|
|
148
154
|
color: var(--color-status-info-fg);
|
|
149
|
-
border-color:
|
|
155
|
+
border-color: transparent;
|
|
156
|
+
box-shadow: inset 0 0 0 1px var(--color-status-info-border);
|
|
150
157
|
}
|
|
151
158
|
|
|
152
159
|
.brand {
|
|
153
160
|
background-color: var(--color-brand);
|
|
154
161
|
color: var(--color-fg-on-brand);
|
|
155
162
|
border-color: transparent;
|
|
163
|
+
box-shadow: inset 0 0 0 1px transparent;
|
|
156
164
|
}
|
|
157
165
|
|
|
158
|
-
/*
|
|
166
|
+
/* Selected */
|
|
167
|
+
|
|
168
|
+
.selected {
|
|
169
|
+
background: var(--color-bg-selected);
|
|
170
|
+
color: var(--color-brand);
|
|
171
|
+
border-color: var(--color-border-selected);
|
|
172
|
+
box-shadow: inset 0 0 0 1px var(--color-border-selected);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.selected:hover {
|
|
176
|
+
background-color: var(--color-bg-selected);
|
|
177
|
+
border-color: var(--color-border-selected);
|
|
178
|
+
box-shadow: inset 0 0 0 1px var(--color-border-selected);
|
|
179
|
+
color: var(--color-brand);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.selected:focus-visible {
|
|
183
|
+
outline: none;
|
|
184
|
+
background-color: var(--color-bg-selected);
|
|
185
|
+
border-color: var(--color-border-selected);
|
|
186
|
+
box-shadow: inset 0 0 0 1px var(--color-border-selected);
|
|
187
|
+
color: var(--color-brand);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Layout */
|
|
191
|
+
|
|
159
192
|
.fullWidth {
|
|
160
193
|
inline-size: 100%;
|
|
161
194
|
justify-content: center;
|
|
162
195
|
}
|
|
163
196
|
|
|
164
197
|
/* Close button */
|
|
198
|
+
|
|
165
199
|
.close {
|
|
166
200
|
all: unset;
|
|
167
201
|
display: inline-flex;
|
|
@@ -173,8 +207,13 @@
|
|
|
173
207
|
inline-size: var(--icon-size-md);
|
|
174
208
|
block-size: var(--icon-size-md);
|
|
175
209
|
border-radius: var(--border-radius-round);
|
|
210
|
+
border: 1px solid transparent;
|
|
211
|
+
box-sizing: border-box;
|
|
176
212
|
|
|
177
|
-
transition:
|
|
213
|
+
transition:
|
|
214
|
+
background-color var(--transition-fast) var(--ease-standard),
|
|
215
|
+
border-color var(--transition-fast) var(--ease-standard),
|
|
216
|
+
box-shadow var(--transition-fast) var(--ease-standard);
|
|
178
217
|
}
|
|
179
218
|
|
|
180
219
|
.close:hover {
|
|
@@ -182,6 +221,7 @@
|
|
|
182
221
|
}
|
|
183
222
|
|
|
184
223
|
.close:focus-visible {
|
|
185
|
-
box-shadow: var(--focus-ring);
|
|
186
224
|
outline: none;
|
|
225
|
+
border-color: var(--color-border-selected);
|
|
226
|
+
box-shadow: inset 0 0 0 1px var(--color-border-selected);
|
|
187
227
|
}
|
|
@@ -20,13 +20,14 @@ export interface FilterFieldProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
20
20
|
options?: MultiselectOption[];
|
|
21
21
|
single?: boolean;
|
|
22
22
|
size?: 'sm' | 'md' | 'lg';
|
|
23
|
+
variant?: 'surface' | 'outlined' | 'subtle';
|
|
23
24
|
label?: string;
|
|
24
25
|
placeholder?: string;
|
|
25
26
|
disabled?: boolean;
|
|
26
27
|
width?: string;
|
|
27
28
|
}
|
|
28
29
|
export declare const NUMBER_OPERATORS: Operator[];
|
|
29
|
-
export declare function FilterField({ field, control, operator, value, onChange, operators, options, single, size, label, placeholder, disabled, 'data-cy': dataCy, width, ...inputProps }: FilterFieldProps & {
|
|
30
|
+
export declare function FilterField({ field, control, operator, value, onChange, operators, options, single, size, variant, label, placeholder, disabled, 'data-cy': dataCy, width, ...inputProps }: FilterFieldProps & {
|
|
30
31
|
'data-cy'?: string;
|
|
31
32
|
}): React.ReactElement;
|
|
32
33
|
export {};
|
|
@@ -69,20 +69,16 @@ function isFilterActive(value) {
|
|
|
69
69
|
return value != null;
|
|
70
70
|
}
|
|
71
71
|
const VALUELESS_OPERATORS = ['isEmpty', 'isNotEmpty'];
|
|
72
|
-
export function FilterField({ field, control, operator, value, onChange, operators, options = [], single = true, size = 'md', label, placeholder = 'Type value…', disabled, 'data-cy': dataCy, width, ...inputProps }) {
|
|
72
|
+
export function FilterField({ field, control, operator, value, onChange, operators, options = [], single = true, size = 'md', variant = 'surface', label, placeholder = 'Type value…', disabled, 'data-cy': dataCy, width, ...inputProps }) {
|
|
73
73
|
var _a, _b;
|
|
74
74
|
const ops = useMemo(() => operators !== null && operators !== void 0 ? operators : DEFAULT_TEXT_OPERATORS, [operators]);
|
|
75
|
-
// internal operator state (source of truth for UI)
|
|
76
75
|
const [selectedOperator, setSelectedOperator] = useState(operator);
|
|
77
|
-
// "active" based on value only (as requested)
|
|
78
76
|
const active = isFilterActive(value);
|
|
79
|
-
// Overwrite internal operator if parent sends a new one
|
|
80
77
|
useEffect(() => {
|
|
81
78
|
if (ops.includes(operator)) {
|
|
82
79
|
setSelectedOperator(operator);
|
|
83
80
|
}
|
|
84
81
|
}, [operator, ops]);
|
|
85
|
-
// Local state ONLY for input control (to avoid URL->props lag)
|
|
86
82
|
const [localValue, setLocalValue] = useState((_a = value) !== null && _a !== void 0 ? _a : '');
|
|
87
83
|
const debounceRef = useRef(null);
|
|
88
84
|
const isTypingRef = useRef(false);
|
|
@@ -90,7 +86,6 @@ export function FilterField({ field, control, operator, value, onChange, operato
|
|
|
90
86
|
var _a, _b;
|
|
91
87
|
const nextOperator = (_a = next.operator) !== null && _a !== void 0 ? _a : selectedOperator;
|
|
92
88
|
const nextValue = (_b = next.value) !== null && _b !== void 0 ? _b : value;
|
|
93
|
-
// Always keep internal operator in sync when user picks one
|
|
94
89
|
if (next.operator)
|
|
95
90
|
setSelectedOperator(nextOperator);
|
|
96
91
|
onChange({
|
|
@@ -117,7 +112,6 @@ export function FilterField({ field, control, operator, value, onChange, operato
|
|
|
117
112
|
emit({ value: nextVal });
|
|
118
113
|
}, 250);
|
|
119
114
|
};
|
|
120
|
-
// Sync internal value when parent value changes (e.g. URL updates)
|
|
121
115
|
useEffect(() => {
|
|
122
116
|
var _a;
|
|
123
117
|
if (control !== 'input')
|
|
@@ -130,14 +124,15 @@ export function FilterField({ field, control, operator, value, onChange, operato
|
|
|
130
124
|
isTypingRef.current = false;
|
|
131
125
|
}
|
|
132
126
|
}, [value, control, localValue]);
|
|
133
|
-
// Cleanup debounce on unmount
|
|
134
127
|
useEffect(() => {
|
|
135
128
|
return () => {
|
|
136
129
|
if (debounceRef.current)
|
|
137
130
|
clearTimeout(debounceRef.current);
|
|
138
131
|
};
|
|
139
132
|
}, []);
|
|
140
|
-
return (_jsxs("div", { ...(dataCy ? { 'data-cy': dataCy } : {}), className:
|
|
133
|
+
return (_jsxs("div", { ...(dataCy ? { 'data-cy': dataCy } : {}), className: [styles.filterField, styles[size], styles[variant], active ? styles.active : '']
|
|
134
|
+
.filter(Boolean)
|
|
135
|
+
.join(' '), children: [label ? _jsx("span", { className: `${styles.label} ${styles[size]}`, children: label }) : null, _jsx(OperatorDropdown, { value: selectedOperator, onChange: handleOperatorChange, operators: ops, size: size, disabled: disabled }), _jsx("div", { className: `${control === 'input' ? 'dbc-flex dbc-flex-grow' : styles.valueWrapper}`, style: { width }, children: control === 'input' ? (_jsx(Input, { variant: "embedded", ...inputProps, value: localValue, onChange: e => {
|
|
141
136
|
const next = e.currentTarget.value;
|
|
142
137
|
isTypingRef.current = true;
|
|
143
138
|
setLocalValue(next);
|