@wallarm-org/design-system 3.4.1-rc-fix-data-display-category.3 → 4.0.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/components/Chat/Chat.js +20 -18
- package/dist/components/Chat/ChatTrigger.js +37 -33
- package/dist/components/DateInput/internal/DateInputInternal.js +8 -4
- package/dist/components/DateRangeInput/DateRangeInputInternal.js +8 -4
- package/dist/components/DateRangeInput/DateRangeSeparator.js +15 -6
- package/dist/components/FileUpload/FileUploadItemReplaceTrigger.js +14 -11
- package/dist/components/FilterCascade/FilterCascadeLevel.js +18 -10
- package/dist/components/FilterInput/FilterInput.d.ts +2 -1
- package/dist/components/FilterInput/FilterInput.js +160 -142
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/FilterInputChip.d.ts +2 -1
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/FilterInputChip.js +157 -138
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/FilterInputRemoveButton.js +8 -4
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/PairSeparator.js +20 -11
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/Segment.js +4 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputConnectorChip/FilterInputConnectorChip.js +98 -86
- package/dist/components/FilterInput/FilterInputField/FilterInputField.js +82 -70
- package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/FilterInputFieldMenu.d.ts +2 -1
- package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/FilterInputFieldMenu.js +5 -1
- package/dist/components/FilterInput/FilterInputMenu/FilterInputOperatorMenu.d.ts +2 -1
- package/dist/components/FilterInput/FilterInputMenu/FilterInputOperatorMenu.js +20 -14
- package/dist/components/NavRail/NavRailItem.js +57 -55
- package/dist/components/Select/SelectInput/SelectInputItemRenderer.js +20 -13
- package/dist/components/Selection/SelectionItem.js +8 -4
- package/dist/components/SimpleCharts/AreaChart/AreaChartArea.js +8 -4
- package/dist/components/SimpleCharts/BarList/BarListPercent.js +16 -13
- package/dist/components/SimpleCharts/LineChart/LineChartHoverPopover.js +8 -4
- package/dist/components/SimpleCharts/LineChart/LineChartLine.js +8 -4
- package/dist/components/SimpleCharts/LineChart/LineChartZoomBrush.js +3 -0
- package/dist/components/SimpleCharts/PieChart/PieChartDonut.js +33 -30
- package/dist/components/Tree/TreeItemContent.js +18 -12
- package/dist/components/Tree/TreeItemHeader.js +49 -38
- package/dist/components/TreeView/TreeViewItem.js +46 -40
- package/dist/metadata/components.json +68 -512
- package/package.json +1 -1
- package/dist/components/TreeBase/TreeBase.d.ts +0 -31
- package/dist/components/TreeBase/TreeBase.js +0 -245
- package/dist/components/TreeBase/classes.d.ts +0 -7
- package/dist/components/TreeBase/classes.js +0 -10
- package/dist/components/TreeBase/index.d.ts +0 -1
- package/dist/components/TreeBase/index.js +0 -1
|
@@ -4,6 +4,7 @@ import { useEffect, useRef, useState } from "react";
|
|
|
4
4
|
import { CirclePlus } from "../../../../icons/CirclePlus.js";
|
|
5
5
|
import { CircleSlash } from "../../../../icons/CircleSlash.js";
|
|
6
6
|
import { cn } from "../../../../utils/cn.js";
|
|
7
|
+
import { useTestId } from "../../../../utils/testId.js";
|
|
7
8
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuFooter, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText } from "../../../DropdownMenu/index.js";
|
|
8
9
|
import { DropdownMenuTrigger } from "../../../DropdownMenu/DropdownMenuTrigger.js";
|
|
9
10
|
import { Kbd, KbdGroup } from "../../../Kbd/index.js";
|
|
@@ -13,8 +14,9 @@ import { VARIANT_LABELS } from "../../lib/constants.js";
|
|
|
13
14
|
import { chipVariants, segmentContainer } from "../FilterInputChip/classes.js";
|
|
14
15
|
import { connectorTextVariants } from "./classes.js";
|
|
15
16
|
const FilterInputConnectorChip = (t0)=>{
|
|
16
|
-
const $ = c(
|
|
17
|
+
const $ = c(44);
|
|
17
18
|
const { chipId, variant, onChange, className } = t0;
|
|
19
|
+
const testId = useTestId("connector-chip");
|
|
18
20
|
const { menuOpen, closeAutocompleteMenu } = useFilterInputContext();
|
|
19
21
|
const [open, setOpen] = useState(false);
|
|
20
22
|
const triggerRef = useRef(null);
|
|
@@ -83,16 +85,13 @@ const FilterInputConnectorChip = (t0)=>{
|
|
|
83
85
|
} else t9 = $[10];
|
|
84
86
|
let t10;
|
|
85
87
|
if ($[11] !== t6 || $[12] !== t7 || $[13] !== t9) {
|
|
86
|
-
t10 = /*#__PURE__*/ jsx(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"aria-label": t7,
|
|
94
|
-
children: t9
|
|
95
|
-
})
|
|
88
|
+
t10 = /*#__PURE__*/ jsx("button", {
|
|
89
|
+
ref: triggerRef,
|
|
90
|
+
type: "button",
|
|
91
|
+
className: t6,
|
|
92
|
+
"data-slot": "filter-input-connector-chip",
|
|
93
|
+
"aria-label": t7,
|
|
94
|
+
children: t9
|
|
96
95
|
});
|
|
97
96
|
$[11] = t6;
|
|
98
97
|
$[12] = t7;
|
|
@@ -100,78 +99,89 @@ const FilterInputConnectorChip = (t0)=>{
|
|
|
100
99
|
$[14] = t10;
|
|
101
100
|
} else t10 = $[14];
|
|
102
101
|
let t11;
|
|
103
|
-
if ($[15] !==
|
|
104
|
-
t11 = (
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
if ($[15] !== t10 || $[16] !== testId) {
|
|
103
|
+
t11 = /*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
104
|
+
asChild: true,
|
|
105
|
+
"data-testid": testId,
|
|
106
|
+
children: t10
|
|
107
|
+
});
|
|
108
|
+
$[15] = t10;
|
|
109
|
+
$[16] = testId;
|
|
107
110
|
$[17] = t11;
|
|
108
111
|
} else t11 = $[17];
|
|
109
112
|
let t12;
|
|
113
|
+
if ($[18] !== chipId || $[19] !== onChange) {
|
|
114
|
+
t12 = ()=>onChange(chipId, "and");
|
|
115
|
+
$[18] = chipId;
|
|
116
|
+
$[19] = onChange;
|
|
117
|
+
$[20] = t12;
|
|
118
|
+
} else t12 = $[20];
|
|
110
119
|
let t13;
|
|
111
|
-
|
|
112
|
-
|
|
120
|
+
let t14;
|
|
121
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
122
|
+
t13 = /*#__PURE__*/ jsx(DropdownMenuItemIcon, {
|
|
113
123
|
children: /*#__PURE__*/ jsx(CirclePlus, {})
|
|
114
124
|
});
|
|
115
|
-
|
|
125
|
+
t14 = /*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
116
126
|
children: "AND"
|
|
117
127
|
});
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
128
|
+
$[21] = t13;
|
|
129
|
+
$[22] = t14;
|
|
120
130
|
} else {
|
|
121
|
-
|
|
122
|
-
|
|
131
|
+
t13 = $[21];
|
|
132
|
+
t14 = $[22];
|
|
123
133
|
}
|
|
124
|
-
let
|
|
125
|
-
if ($[
|
|
126
|
-
|
|
134
|
+
let t15;
|
|
135
|
+
if ($[23] !== t12) {
|
|
136
|
+
t15 = /*#__PURE__*/ jsxs(DropdownMenuItem, {
|
|
127
137
|
value: "and",
|
|
128
|
-
onSelect:
|
|
138
|
+
onSelect: t12,
|
|
129
139
|
children: [
|
|
130
|
-
|
|
131
|
-
|
|
140
|
+
t13,
|
|
141
|
+
t14
|
|
132
142
|
]
|
|
133
143
|
});
|
|
134
|
-
$[
|
|
135
|
-
$[21] = t14;
|
|
136
|
-
} else t14 = $[21];
|
|
137
|
-
let t15;
|
|
138
|
-
if ($[22] !== chipId || $[23] !== onChange) {
|
|
139
|
-
t15 = ()=>onChange(chipId, "or");
|
|
140
|
-
$[22] = chipId;
|
|
141
|
-
$[23] = onChange;
|
|
144
|
+
$[23] = t12;
|
|
142
145
|
$[24] = t15;
|
|
143
146
|
} else t15 = $[24];
|
|
144
147
|
let t16;
|
|
148
|
+
if ($[25] !== chipId || $[26] !== onChange) {
|
|
149
|
+
t16 = ()=>onChange(chipId, "or");
|
|
150
|
+
$[25] = chipId;
|
|
151
|
+
$[26] = onChange;
|
|
152
|
+
$[27] = t16;
|
|
153
|
+
} else t16 = $[27];
|
|
145
154
|
let t17;
|
|
146
|
-
|
|
147
|
-
|
|
155
|
+
let t18;
|
|
156
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
157
|
+
t17 = /*#__PURE__*/ jsx(DropdownMenuItemIcon, {
|
|
148
158
|
children: /*#__PURE__*/ jsx(CircleSlash, {})
|
|
149
159
|
});
|
|
150
|
-
|
|
160
|
+
t18 = /*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
151
161
|
children: "OR"
|
|
152
162
|
});
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
163
|
+
$[28] = t17;
|
|
164
|
+
$[29] = t18;
|
|
155
165
|
} else {
|
|
156
|
-
|
|
157
|
-
|
|
166
|
+
t17 = $[28];
|
|
167
|
+
t18 = $[29];
|
|
158
168
|
}
|
|
159
|
-
let
|
|
160
|
-
if ($[
|
|
161
|
-
|
|
169
|
+
let t19;
|
|
170
|
+
if ($[30] !== t16) {
|
|
171
|
+
t19 = /*#__PURE__*/ jsxs(DropdownMenuItem, {
|
|
162
172
|
value: "or",
|
|
163
|
-
onSelect:
|
|
173
|
+
onSelect: t16,
|
|
164
174
|
children: [
|
|
165
|
-
|
|
166
|
-
|
|
175
|
+
t17,
|
|
176
|
+
t18
|
|
167
177
|
]
|
|
168
178
|
});
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
} else
|
|
172
|
-
let
|
|
173
|
-
if ($[
|
|
174
|
-
|
|
179
|
+
$[30] = t16;
|
|
180
|
+
$[31] = t19;
|
|
181
|
+
} else t19 = $[31];
|
|
182
|
+
let t20;
|
|
183
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
184
|
+
t20 = /*#__PURE__*/ jsxs("span", {
|
|
175
185
|
className: "flex items-center gap-4",
|
|
176
186
|
children: [
|
|
177
187
|
/*#__PURE__*/ jsxs(KbdGroup, {
|
|
@@ -187,14 +197,14 @@ const FilterInputConnectorChip = (t0)=>{
|
|
|
187
197
|
"to navigate"
|
|
188
198
|
]
|
|
189
199
|
});
|
|
190
|
-
$[
|
|
191
|
-
} else
|
|
192
|
-
let
|
|
193
|
-
if ($[
|
|
194
|
-
|
|
200
|
+
$[32] = t20;
|
|
201
|
+
} else t20 = $[32];
|
|
202
|
+
let t21;
|
|
203
|
+
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
204
|
+
t21 = /*#__PURE__*/ jsxs(DropdownMenuFooter, {
|
|
195
205
|
className: "justify-start",
|
|
196
206
|
children: [
|
|
197
|
-
|
|
207
|
+
t20,
|
|
198
208
|
/*#__PURE__*/ jsxs("span", {
|
|
199
209
|
className: "flex items-center gap-4",
|
|
200
210
|
children: [
|
|
@@ -208,42 +218,44 @@ const FilterInputConnectorChip = (t0)=>{
|
|
|
208
218
|
})
|
|
209
219
|
]
|
|
210
220
|
});
|
|
211
|
-
$[
|
|
212
|
-
} else
|
|
213
|
-
let
|
|
214
|
-
if ($[
|
|
215
|
-
|
|
221
|
+
$[33] = t21;
|
|
222
|
+
} else t21 = $[33];
|
|
223
|
+
let t22;
|
|
224
|
+
if ($[34] !== t15 || $[35] !== t19) {
|
|
225
|
+
t22 = /*#__PURE__*/ jsxs(DropdownMenuContent, {
|
|
216
226
|
className: "w-auto min-w-64",
|
|
217
227
|
"data-filter-input-menu": "true",
|
|
218
228
|
children: [
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
229
|
+
t15,
|
|
230
|
+
t19,
|
|
231
|
+
t21
|
|
222
232
|
]
|
|
223
233
|
});
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
} else
|
|
228
|
-
let
|
|
229
|
-
if ($[
|
|
230
|
-
|
|
234
|
+
$[34] = t15;
|
|
235
|
+
$[35] = t19;
|
|
236
|
+
$[36] = t22;
|
|
237
|
+
} else t22 = $[36];
|
|
238
|
+
let t23;
|
|
239
|
+
if ($[37] !== handleOpenChange || $[38] !== positioning || $[39] !== t11 || $[40] !== t22 || $[41] !== t5 || $[42] !== testId) {
|
|
240
|
+
t23 = /*#__PURE__*/ jsxs(DropdownMenu, {
|
|
241
|
+
"data-testid": testId,
|
|
231
242
|
positioning: positioning,
|
|
232
243
|
open: t5,
|
|
233
244
|
onOpenChange: handleOpenChange,
|
|
234
245
|
children: [
|
|
235
|
-
|
|
236
|
-
|
|
246
|
+
t11,
|
|
247
|
+
t22
|
|
237
248
|
]
|
|
238
249
|
});
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
|
|
246
|
-
|
|
250
|
+
$[37] = handleOpenChange;
|
|
251
|
+
$[38] = positioning;
|
|
252
|
+
$[39] = t11;
|
|
253
|
+
$[40] = t22;
|
|
254
|
+
$[41] = t5;
|
|
255
|
+
$[42] = testId;
|
|
256
|
+
$[43] = t23;
|
|
257
|
+
} else t23 = $[43];
|
|
258
|
+
return t23;
|
|
247
259
|
};
|
|
248
260
|
FilterInputConnectorChip.displayName = "FilterInputConnectorChip";
|
|
249
261
|
export { FilterInputConnectorChip };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { cn } from "../../../utils/cn.js";
|
|
4
|
+
import { TestIdProvider, useTestId } from "../../../utils/testId.js";
|
|
4
5
|
import { inputVariants } from "../../Input/classes.js";
|
|
5
6
|
import { ScrollArea, ScrollAreaScrollbar, ScrollAreaViewport } from "../../ScrollArea/index.js";
|
|
6
7
|
import { useFilterInputContext } from "../FilterInputContext/index.js";
|
|
@@ -14,7 +15,7 @@ import { useChipsSplitting } from "./hooks/useChipsSplitting.js";
|
|
|
14
15
|
import { useExpandCollapse } from "./hooks/useExpandCollapse.js";
|
|
15
16
|
import { useSegmentEditKeyboard } from "./hooks/useSegmentEditKeyboard.js";
|
|
16
17
|
const FilterInputField = (t0)=>{
|
|
17
|
-
const $ = c(
|
|
18
|
+
const $ = c(89);
|
|
18
19
|
let className;
|
|
19
20
|
let props;
|
|
20
21
|
if ($[0] !== t0) {
|
|
@@ -27,6 +28,7 @@ const FilterInputField = (t0)=>{
|
|
|
27
28
|
props = $[2];
|
|
28
29
|
}
|
|
29
30
|
const { chips, buildingChipData, buildingChipRef, insertIndex, insertAfterConnector, error, onAreaClick, onGapClick, onChipClick, onBuildingChipClick, onConnectorChange, onChipRemove, editingChipId, editingSegment, editingSide, segmentFilterText, onSegmentFilterChange, onCancelSegmentEdit, onCustomValueCommit, onCustomAttributeCommit, onCustomOperatorCommit, onSwitchEditSegment, onRemoveEditingChip, menuRef } = useFilterInputContext();
|
|
31
|
+
const testId = useTestId();
|
|
30
32
|
const hasContent = chips.length > 0 || null != buildingChipData;
|
|
31
33
|
const { isExpanded, isOverflowing, innerRef, toggleExpand, multiRow } = useExpandCollapse();
|
|
32
34
|
const { chipsBefore, chipsAfter, hideTrailingGap, hideLeadingGap } = useChipsSplitting(chips, insertIndex, insertAfterConnector);
|
|
@@ -200,90 +202,100 @@ const FilterInputField = (t0)=>{
|
|
|
200
202
|
$[51] = t15;
|
|
201
203
|
} else t15 = $[51];
|
|
202
204
|
let t16;
|
|
203
|
-
if ($[52] !==
|
|
204
|
-
t16 = /*#__PURE__*/
|
|
205
|
+
if ($[52] !== t12 || $[53] !== t13 || $[54] !== t14 || $[55] !== t15 || $[56] !== testId) {
|
|
206
|
+
t16 = /*#__PURE__*/ jsxs(TestIdProvider, {
|
|
207
|
+
value: testId,
|
|
208
|
+
children: [
|
|
209
|
+
t12,
|
|
210
|
+
t13,
|
|
211
|
+
t14,
|
|
212
|
+
t15
|
|
213
|
+
]
|
|
214
|
+
});
|
|
215
|
+
$[52] = t12;
|
|
216
|
+
$[53] = t13;
|
|
217
|
+
$[54] = t14;
|
|
218
|
+
$[55] = t15;
|
|
219
|
+
$[56] = testId;
|
|
220
|
+
$[57] = t16;
|
|
221
|
+
} else t16 = $[57];
|
|
222
|
+
let t17;
|
|
223
|
+
if ($[58] !== innerRef || $[59] !== t10 || $[60] !== t11 || $[61] !== t16 || $[62] !== t8) {
|
|
224
|
+
t17 = /*#__PURE__*/ jsx(ScrollAreaViewport, {
|
|
205
225
|
style: t7,
|
|
206
|
-
children: /*#__PURE__*/
|
|
226
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
207
227
|
ref: innerRef,
|
|
208
228
|
"data-filter-input-inner": "",
|
|
209
229
|
className: t8,
|
|
210
230
|
style: t10,
|
|
211
231
|
onClick: t11,
|
|
212
|
-
children:
|
|
213
|
-
t12,
|
|
214
|
-
t13,
|
|
215
|
-
t14,
|
|
216
|
-
t15
|
|
217
|
-
]
|
|
232
|
+
children: t16
|
|
218
233
|
})
|
|
219
234
|
});
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
let t17;
|
|
231
|
-
if ($[61] !== isExpanded) {
|
|
232
|
-
t17 = !isExpanded && /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
|
|
235
|
+
$[58] = innerRef;
|
|
236
|
+
$[59] = t10;
|
|
237
|
+
$[60] = t11;
|
|
238
|
+
$[61] = t16;
|
|
239
|
+
$[62] = t8;
|
|
240
|
+
$[63] = t17;
|
|
241
|
+
} else t17 = $[63];
|
|
242
|
+
let t18;
|
|
243
|
+
if ($[64] !== isExpanded) {
|
|
244
|
+
t18 = !isExpanded && /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
|
|
233
245
|
orientation: "vertical"
|
|
234
246
|
});
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
} else
|
|
238
|
-
let
|
|
239
|
-
if ($[
|
|
240
|
-
|
|
247
|
+
$[64] = isExpanded;
|
|
248
|
+
$[65] = t18;
|
|
249
|
+
} else t18 = $[65];
|
|
250
|
+
let t19;
|
|
251
|
+
if ($[66] !== t17 || $[67] !== t18 || $[68] !== t6) {
|
|
252
|
+
t19 = /*#__PURE__*/ jsxs(ScrollArea, {
|
|
241
253
|
className: "h-auto flex-1 min-w-0",
|
|
242
254
|
style: t6,
|
|
243
255
|
children: [
|
|
244
|
-
|
|
245
|
-
|
|
256
|
+
t17,
|
|
257
|
+
t18
|
|
246
258
|
]
|
|
247
259
|
});
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
} else
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
260
|
+
$[66] = t17;
|
|
261
|
+
$[67] = t18;
|
|
262
|
+
$[68] = t6;
|
|
263
|
+
$[69] = t19;
|
|
264
|
+
} else t19 = $[69];
|
|
265
|
+
let t20;
|
|
266
|
+
if ($[70] !== isExpanded || $[71] !== isOverflowing || $[72] !== toggleExpand) {
|
|
267
|
+
t20 = /*#__PURE__*/ jsx(FilterInputFieldActions, {
|
|
256
268
|
isExpanded: isExpanded,
|
|
257
269
|
isOverflowing: isOverflowing,
|
|
258
270
|
onToggleExpand: toggleExpand
|
|
259
271
|
});
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
} else
|
|
265
|
-
let
|
|
266
|
-
if ($[
|
|
267
|
-
|
|
272
|
+
$[70] = isExpanded;
|
|
273
|
+
$[71] = isOverflowing;
|
|
274
|
+
$[72] = toggleExpand;
|
|
275
|
+
$[73] = t20;
|
|
276
|
+
} else t20 = $[73];
|
|
277
|
+
let t21;
|
|
278
|
+
if ($[74] !== props || $[75] !== t19 || $[76] !== t20 || $[77] !== t3 || $[78] !== t4) {
|
|
279
|
+
t21 = /*#__PURE__*/ jsxs("div", {
|
|
268
280
|
className: t3,
|
|
269
281
|
"data-slot": "filter-input",
|
|
270
282
|
onClick: t4,
|
|
271
283
|
...props,
|
|
272
284
|
children: [
|
|
273
|
-
|
|
274
|
-
|
|
285
|
+
t19,
|
|
286
|
+
t20
|
|
275
287
|
]
|
|
276
288
|
});
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[73] = t19;
|
|
280
|
-
$[74] = t3;
|
|
281
|
-
$[75] = t4;
|
|
289
|
+
$[74] = props;
|
|
290
|
+
$[75] = t19;
|
|
282
291
|
$[76] = t20;
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
292
|
+
$[77] = t3;
|
|
293
|
+
$[78] = t4;
|
|
294
|
+
$[79] = t21;
|
|
295
|
+
} else t21 = $[79];
|
|
296
|
+
let t22;
|
|
297
|
+
if ($[80] !== editingChipId || $[81] !== editingSegment || $[82] !== editingSide || $[83] !== handleSegmentEditBlur || $[84] !== handleSegmentEditKeyDown || $[85] !== onSegmentFilterChange || $[86] !== segmentFilterText || $[87] !== t21) {
|
|
298
|
+
t22 = /*#__PURE__*/ jsx(EditingProvider, {
|
|
287
299
|
editingChipId: editingChipId,
|
|
288
300
|
editingSegment: editingSegment,
|
|
289
301
|
editingSide: editingSide,
|
|
@@ -291,19 +303,19 @@ const FilterInputField = (t0)=>{
|
|
|
291
303
|
onSegmentFilterChange: onSegmentFilterChange,
|
|
292
304
|
onSegmentEditKeyDown: handleSegmentEditKeyDown,
|
|
293
305
|
onSegmentEditBlur: handleSegmentEditBlur,
|
|
294
|
-
children:
|
|
306
|
+
children: t21
|
|
295
307
|
});
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
} else
|
|
306
|
-
return
|
|
308
|
+
$[80] = editingChipId;
|
|
309
|
+
$[81] = editingSegment;
|
|
310
|
+
$[82] = editingSide;
|
|
311
|
+
$[83] = handleSegmentEditBlur;
|
|
312
|
+
$[84] = handleSegmentEditKeyDown;
|
|
313
|
+
$[85] = onSegmentFilterChange;
|
|
314
|
+
$[86] = segmentFilterText;
|
|
315
|
+
$[87] = t21;
|
|
316
|
+
$[88] = t22;
|
|
317
|
+
} else t22 = $[88];
|
|
318
|
+
return t22;
|
|
307
319
|
};
|
|
308
320
|
FilterInputField.displayName = "FilterInputField";
|
|
309
321
|
export { FilterInputField };
|
package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/FilterInputFieldMenu.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type FC, type RefObject } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../../../utils/testId.js';
|
|
2
3
|
import type { Condition, FieldGroup, FieldMetadata } from '../../types.js';
|
|
3
|
-
export interface FilterInputFieldMenuProps {
|
|
4
|
+
export interface FilterInputFieldMenuProps extends TestableProps {
|
|
4
5
|
fields: FieldMetadata[];
|
|
5
6
|
/** Text from the input to filter displayed fields */
|
|
6
7
|
filterText?: string;
|
package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/FilterInputFieldMenu.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo, useRef } from "react";
|
|
3
3
|
import { cn } from "../../../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../../../utils/testId.js";
|
|
4
5
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuFooter } from "../../../DropdownMenu/index.js";
|
|
5
6
|
import { Kbd } from "../../../Kbd/Kbd.js";
|
|
6
7
|
import { KbdGroup } from "../../../Kbd/KbdGroup.js";
|
|
@@ -11,7 +12,8 @@ import { useMenuScrollHighlightSync } from "../hooks/useMenuScrollHighlightSync.
|
|
|
11
12
|
import { MenuEmptyState } from "../MenuEmptyState.js";
|
|
12
13
|
import { FieldMenuPopover } from "./FieldMenuPopover.js";
|
|
13
14
|
import { FieldSections, OperatorsSection, RecentSection, SuggestionsSection } from "./FieldMenuSections.js";
|
|
14
|
-
const FilterInputFieldMenu = ({ fields, filterText = '', onSelect, open = false, onOpenChange, recentConditions = [], suggestedFields = [], fieldGroups, onSelectAnd, onSelectOr, onEscape, positioning, inputRef, menuRef, className })=>{
|
|
15
|
+
const FilterInputFieldMenu = ({ fields, filterText = '', onSelect, open = false, onOpenChange, recentConditions = [], suggestedFields = [], fieldGroups, onSelectAnd, onSelectOr, onEscape, positioning, inputRef, menuRef, className, 'data-testid': testIdProp })=>{
|
|
16
|
+
const testId = useTestId('field-menu', testIdProp);
|
|
15
17
|
const limitedRecentConditions = useMemo(()=>recentConditions.slice(0, 3), [
|
|
16
18
|
recentConditions
|
|
17
19
|
]);
|
|
@@ -76,6 +78,7 @@ const FilterInputFieldMenu = ({ fields, filterText = '', onSelect, open = false,
|
|
|
76
78
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
77
79
|
children: [
|
|
78
80
|
/*#__PURE__*/ jsx(DropdownMenu, {
|
|
81
|
+
"data-testid": testId,
|
|
79
82
|
open: open && hasResults,
|
|
80
83
|
onOpenChange: onOpenChange,
|
|
81
84
|
onRequestDismiss: keepOpenOnMenuHandoff,
|
|
@@ -87,6 +90,7 @@ const FilterInputFieldMenu = ({ fields, filterText = '', onSelect, open = false,
|
|
|
87
90
|
ref: menuRef,
|
|
88
91
|
className: cn('w-[300px] max-h-[430px]', className),
|
|
89
92
|
"data-slot": "filter-input-field-menu",
|
|
93
|
+
"data-testid": testId,
|
|
90
94
|
"data-filter-input-menu": "true",
|
|
91
95
|
children: [
|
|
92
96
|
!filterText && showRecent && /*#__PURE__*/ jsx(RecentSection, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
2
|
import { type FC } from 'react';
|
|
3
|
+
import { type TestableProps } from '../../../utils/testId.js';
|
|
3
4
|
import type { FieldType, FilterOperator } from '../types.js';
|
|
4
|
-
export interface FilterInputOperatorMenuProps {
|
|
5
|
+
export interface FilterInputOperatorMenuProps extends TestableProps {
|
|
5
6
|
/**
|
|
6
7
|
* The field type to determine which operators to show
|
|
7
8
|
*/
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { Fragment } from "react";
|
|
4
4
|
import { cn } from "../../../utils/cn.js";
|
|
5
|
+
import { useTestId } from "../../../utils/testId.js";
|
|
5
6
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator } from "../../DropdownMenu/index.js";
|
|
6
7
|
import { Kbd } from "../../Kbd/Kbd.js";
|
|
7
8
|
import { KbdGroup } from "../../Kbd/KbdGroup.js";
|
|
@@ -22,10 +23,11 @@ const HIDE_SYMBOLS_FOR = new Set([
|
|
|
22
23
|
"boolean"
|
|
23
24
|
]);
|
|
24
25
|
const FilterInputOperatorMenu = (t0)=>{
|
|
25
|
-
const $ = c(
|
|
26
|
-
const { fieldType, operators, onSelect, open: t1, onOpenChange, onEscape, positioning, inputRef, filterText: t2, menuRef, className } = t0;
|
|
26
|
+
const $ = c(47);
|
|
27
|
+
const { fieldType, operators, onSelect, open: t1, onOpenChange, onEscape, positioning, inputRef, filterText: t2, menuRef, className, "data-testid": testIdProp } = t0;
|
|
27
28
|
const open = void 0 === t1 ? false : t1;
|
|
28
29
|
const filterText = void 0 === t2 ? "" : t2;
|
|
30
|
+
const testId = useTestId("operator-menu", testIdProp);
|
|
29
31
|
let t3;
|
|
30
32
|
if ($[0] !== filterText) {
|
|
31
33
|
t3 = filterText.toLowerCase();
|
|
@@ -160,11 +162,12 @@ const FilterInputOperatorMenu = (t0)=>{
|
|
|
160
162
|
$[33] = t12;
|
|
161
163
|
} else t12 = $[33];
|
|
162
164
|
let t13;
|
|
163
|
-
if ($[34] !== menuRef || $[35] !== t10 || $[36] !== t11) {
|
|
165
|
+
if ($[34] !== menuRef || $[35] !== t10 || $[36] !== t11 || $[37] !== testId) {
|
|
164
166
|
t13 = /*#__PURE__*/ jsxs(DropdownMenuContent, {
|
|
165
167
|
ref: menuRef,
|
|
166
168
|
className: t10,
|
|
167
169
|
"data-filter-input-menu": "true",
|
|
170
|
+
"data-testid": testId,
|
|
168
171
|
children: [
|
|
169
172
|
t11,
|
|
170
173
|
t12
|
|
@@ -173,11 +176,13 @@ const FilterInputOperatorMenu = (t0)=>{
|
|
|
173
176
|
$[34] = menuRef;
|
|
174
177
|
$[35] = t10;
|
|
175
178
|
$[36] = t11;
|
|
176
|
-
$[37] =
|
|
177
|
-
|
|
179
|
+
$[37] = testId;
|
|
180
|
+
$[38] = t13;
|
|
181
|
+
} else t13 = $[38];
|
|
178
182
|
let t14;
|
|
179
|
-
if ($[
|
|
183
|
+
if ($[39] !== highlightedValue || $[40] !== onHighlightChange || $[41] !== onOpenChange || $[42] !== open || $[43] !== positioning || $[44] !== t13 || $[45] !== testId) {
|
|
180
184
|
t14 = /*#__PURE__*/ jsx(DropdownMenu, {
|
|
185
|
+
"data-testid": testId,
|
|
181
186
|
open: open,
|
|
182
187
|
onOpenChange: onOpenChange,
|
|
183
188
|
onRequestDismiss: keepOpenOnMenuHandoff,
|
|
@@ -187,14 +192,15 @@ const FilterInputOperatorMenu = (t0)=>{
|
|
|
187
192
|
onHighlightChange: onHighlightChange,
|
|
188
193
|
children: t13
|
|
189
194
|
});
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
|
|
195
|
+
$[39] = highlightedValue;
|
|
196
|
+
$[40] = onHighlightChange;
|
|
197
|
+
$[41] = onOpenChange;
|
|
198
|
+
$[42] = open;
|
|
199
|
+
$[43] = positioning;
|
|
200
|
+
$[44] = t13;
|
|
201
|
+
$[45] = testId;
|
|
202
|
+
$[46] = t14;
|
|
203
|
+
} else t14 = $[46];
|
|
198
204
|
return t14;
|
|
199
205
|
};
|
|
200
206
|
FilterInputOperatorMenu.displayName = "FilterInputOperatorMenu";
|