@pibit.ai/cure-design-system 0.6.38 → 0.6.40
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +739 -735
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/namespace.js +6 -0
- package/dist/patterns/filter-group/filter-condition-row.js +139 -139
- package/dist/patterns/filter-group/index.d.ts +1 -0
- package/dist/patterns/filter-group/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as ie, useMemo as
|
|
1
|
+
import { jsxs as I, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as ie, useMemo as d, useCallback as G, useEffect as oe, useRef as $e } from "react";
|
|
3
3
|
import { Trash02 as me } from "@untitledui/icons";
|
|
4
4
|
import { DatePicker as H } from "../../applications/date-picker/date-picker.js";
|
|
5
5
|
import { useListData as Me } from "../../node_modules/react-stately/dist/private/data/useListData.js";
|
|
@@ -13,24 +13,24 @@ import { Select as C } from "../../primitives/select/select.js";
|
|
|
13
13
|
import { ButtonUtility as fe } from "../../primitives/button/button-utility.js";
|
|
14
14
|
import { EllipsisContentWithTooltip as he } from "../../primitives/tooltip/ellipsis-content.js";
|
|
15
15
|
import { motion as ke } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
16
|
-
import { Input as
|
|
17
|
-
import { MultiSelect as
|
|
16
|
+
import { Input as E } from "../../primitives/input/input.js";
|
|
17
|
+
import { MultiSelect as ve } from "../../primitives/select/multi-select.js";
|
|
18
18
|
import { SearchableSelect as qe } from "../../primitives/select/searchable-select.js";
|
|
19
19
|
import { SelectItem as Re } from "../../primitives/select/select-item.js";
|
|
20
20
|
import { ReorderItem as je } from "../../node_modules/framer-motion/dist/es/components/Reorder/Item.js";
|
|
21
|
-
const
|
|
21
|
+
const Ee = ({
|
|
22
22
|
searchable: r = !1,
|
|
23
23
|
size: x = "sm",
|
|
24
24
|
className: S,
|
|
25
|
-
placeholder:
|
|
26
|
-
selectedKey:
|
|
27
|
-
onSelectionChange:
|
|
25
|
+
placeholder: K,
|
|
26
|
+
selectedKey: L,
|
|
27
|
+
onSelectionChange: B,
|
|
28
28
|
items: n,
|
|
29
|
-
isInvalid:
|
|
29
|
+
isInvalid: k,
|
|
30
30
|
isDisabled: T,
|
|
31
|
-
isLoading:
|
|
32
|
-
selectedDisplayValue:
|
|
33
|
-
searchPlaceholder:
|
|
31
|
+
isLoading: q,
|
|
32
|
+
selectedDisplayValue: g,
|
|
33
|
+
searchPlaceholder: A = "Search..."
|
|
34
34
|
}) => {
|
|
35
35
|
const y = (s) => /* @__PURE__ */ l(Re, { id: s.id, label: s.label, children: s.label }, s.id);
|
|
36
36
|
return r ? /* @__PURE__ */ l(
|
|
@@ -38,15 +38,15 @@ const Ae = ({
|
|
|
38
38
|
{
|
|
39
39
|
size: x,
|
|
40
40
|
className: S,
|
|
41
|
-
placeholder:
|
|
42
|
-
selectedKey:
|
|
43
|
-
onSelectionChange: (s) =>
|
|
41
|
+
placeholder: K,
|
|
42
|
+
selectedKey: L || null,
|
|
43
|
+
onSelectionChange: (s) => B(s ?? ""),
|
|
44
44
|
items: n,
|
|
45
|
-
isInvalid:
|
|
45
|
+
isInvalid: k,
|
|
46
46
|
isDisabled: T,
|
|
47
|
-
isLoading:
|
|
48
|
-
selectedDisplayValue:
|
|
49
|
-
searchPlaceholder:
|
|
47
|
+
isLoading: q,
|
|
48
|
+
selectedDisplayValue: g,
|
|
49
|
+
searchPlaceholder: A,
|
|
50
50
|
renderItem: y
|
|
51
51
|
}
|
|
52
52
|
) : /* @__PURE__ */ l(
|
|
@@ -54,98 +54,98 @@ const Ae = ({
|
|
|
54
54
|
{
|
|
55
55
|
size: x,
|
|
56
56
|
className: S,
|
|
57
|
-
placeholder:
|
|
58
|
-
selectedKey:
|
|
59
|
-
onSelectionChange: (s) =>
|
|
57
|
+
placeholder: K,
|
|
58
|
+
selectedKey: L,
|
|
59
|
+
onSelectionChange: (s) => B(s),
|
|
60
60
|
items: n,
|
|
61
|
-
isInvalid:
|
|
61
|
+
isInvalid: k,
|
|
62
62
|
isDisabled: T,
|
|
63
63
|
children: (s) => /* @__PURE__ */ l(C.Item, { id: s.id, children: s.label })
|
|
64
64
|
}
|
|
65
65
|
);
|
|
66
|
-
},
|
|
66
|
+
}, Le = [
|
|
67
67
|
{ id: "and", label: "And" },
|
|
68
68
|
{ id: "or", label: "Or" }
|
|
69
69
|
], b = "flex-1 w-[154px] h-8 [&>button]:h-8 [&>div]:h-full", sr = ({
|
|
70
70
|
condition: r,
|
|
71
71
|
fields: x,
|
|
72
72
|
operators: S = _e,
|
|
73
|
-
logicalOperator:
|
|
74
|
-
isFirst:
|
|
75
|
-
showLogicalOperator:
|
|
73
|
+
logicalOperator: K,
|
|
74
|
+
isFirst: L,
|
|
75
|
+
showLogicalOperator: B,
|
|
76
76
|
onUpdate: n,
|
|
77
|
-
onDelete:
|
|
77
|
+
onDelete: k,
|
|
78
78
|
useFixedPositioning: T = !1,
|
|
79
|
-
onLogicalOperatorChange:
|
|
80
|
-
size:
|
|
81
|
-
dragEnabled:
|
|
79
|
+
onLogicalOperatorChange: q,
|
|
80
|
+
size: g = "sm",
|
|
81
|
+
dragEnabled: A = !0,
|
|
82
82
|
documentFields: y,
|
|
83
83
|
isInvalid: s = !1,
|
|
84
|
-
allowFlexCol:
|
|
85
|
-
forceTextInput:
|
|
86
|
-
hideLabels:
|
|
84
|
+
allowFlexCol: v = !1,
|
|
85
|
+
forceTextInput: P = !1,
|
|
86
|
+
hideLabels: pe = !1,
|
|
87
87
|
multiselectOptions: z,
|
|
88
88
|
searchable: U = !1,
|
|
89
|
-
testIdPrefix:
|
|
90
|
-
rowIndex:
|
|
91
|
-
dateAdapter:
|
|
89
|
+
testIdPrefix: W,
|
|
90
|
+
rowIndex: ge,
|
|
91
|
+
dateAdapter: $ = Ie
|
|
92
92
|
}) => {
|
|
93
|
-
const Q = Ke(), V = (e) =>
|
|
93
|
+
const Q = Ke(), V = (e) => W ? `${W}-${e}` : void 0, [F, _] = ie(null), [ee, X] = ie(null), re = d(() => F ?? (r.value && typeof r.value == "string" && r.value.trim() ? $.parseDate(r.value) : null), [F, r.value, $]), de = d(() => ee ?? (r.value2 && typeof r.value2 == "string" && r.value2.trim() ? $.parseDate(r.value2) : null), [ee, r.value2, $]), Y = G(
|
|
94
94
|
(e, a, i = []) => {
|
|
95
95
|
if (a.length === 0) return null;
|
|
96
|
-
const [o, ...f] = a,
|
|
97
|
-
if (!
|
|
96
|
+
const [o, ...f] = a, p = e.find((N) => N.key === o);
|
|
97
|
+
if (!p) return null;
|
|
98
98
|
if (f.length === 0)
|
|
99
|
-
return { field:
|
|
100
|
-
if (
|
|
101
|
-
const N = Y(
|
|
99
|
+
return { field: p, ancestorLabels: i };
|
|
100
|
+
if (p.children) {
|
|
101
|
+
const N = Y(p.children, f, [...i, p.label]);
|
|
102
102
|
if (N) return N;
|
|
103
103
|
}
|
|
104
104
|
return null;
|
|
105
105
|
},
|
|
106
106
|
[]
|
|
107
|
-
), t =
|
|
107
|
+
), t = d(() => {
|
|
108
108
|
const e = x.find((a) => a.id === r.fieldId);
|
|
109
109
|
if (e) return e;
|
|
110
110
|
if (y && r.fieldId) {
|
|
111
111
|
const a = r.fieldId.split("."), i = a[0], o = y[i];
|
|
112
112
|
if (o) {
|
|
113
|
-
const f = a.slice(1),
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
113
|
+
const f = a.slice(1), p = Y(o.fields, f);
|
|
114
|
+
if (p && p.field.type) {
|
|
115
|
+
const M = [o.label, ...p.ancestorLabels, p.field.label].join(" > ");
|
|
116
116
|
return {
|
|
117
117
|
id: r.fieldId,
|
|
118
|
-
label:
|
|
119
|
-
type:
|
|
120
|
-
options:
|
|
118
|
+
label: M,
|
|
119
|
+
type: p.field.type,
|
|
120
|
+
options: p.field.options
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
}, [x, r.fieldId, y]), te =
|
|
125
|
+
}, [x, r.fieldId, y]), te = d(() => t ? S.filter((e) => e.applicableTo.includes(t.type)) : S, [S, t]), c = d(
|
|
126
126
|
() => S.find((e) => e.id === r.operatorId),
|
|
127
127
|
[S, r.operatorId]
|
|
128
|
-
), ye =
|
|
128
|
+
), ye = d(() => x.map((e) => ({ id: e.id, label: e.label })), [x]), be = d(() => te.map((e) => ({ id: e.id, label: e.label })), [te]), R = d(() => (t == null ? void 0 : t.type) === "select" && t.options ? t.options.map((e) => ({
|
|
129
129
|
id: e.id,
|
|
130
130
|
label: e.label
|
|
131
|
-
})) : [], [t]), Se =
|
|
131
|
+
})) : [], [t]), Se = d(() => {
|
|
132
132
|
var e;
|
|
133
133
|
if (r.value)
|
|
134
|
-
return (e =
|
|
135
|
-
}, [r.value,
|
|
136
|
-
() => z ??
|
|
137
|
-
[z,
|
|
138
|
-
), w =
|
|
134
|
+
return (e = R.find((a) => a.id === r.value)) == null ? void 0 : e.label;
|
|
135
|
+
}, [r.value, R]), j = d(() => !r.value || typeof r.value != "string" ? [] : r.value.split(",").map((e) => e.trim()).filter(Boolean), [r.value]), le = d(
|
|
136
|
+
() => z ?? R,
|
|
137
|
+
[z, R]
|
|
138
|
+
), w = d(() => le.map((e) => ({ id: e.id, label: e.label })), [le]), Ne = d(
|
|
139
139
|
() => `ms-${r.fieldId}-${r.operatorId}-${w.length}-${r.value}`,
|
|
140
140
|
[r.fieldId, r.operatorId, w.length, r.value]
|
|
141
141
|
), D = Me({
|
|
142
|
-
initialItems:
|
|
142
|
+
initialItems: j.map((e) => w.find((a) => a.id === e)).filter((e) => e !== void 0),
|
|
143
143
|
getKey: (e) => e.id
|
|
144
144
|
});
|
|
145
145
|
oe(() => {
|
|
146
146
|
if (w.length === 0) return;
|
|
147
147
|
const e = new Set(D.items.map((a) => a.id));
|
|
148
|
-
for (const a of
|
|
148
|
+
for (const a of j)
|
|
149
149
|
if (!e.has(a)) {
|
|
150
150
|
const i = w.find((o) => o.id === a);
|
|
151
151
|
i && D.append(i);
|
|
@@ -155,15 +155,15 @@ const Ae = ({
|
|
|
155
155
|
oe(() => {
|
|
156
156
|
if (ae.current === r.value) return;
|
|
157
157
|
ae.current = r.value;
|
|
158
|
-
const e = new Set(D.items.map((i) => i.id)), a = new Set(
|
|
158
|
+
const e = new Set(D.items.map((i) => i.id)), a = new Set(j);
|
|
159
159
|
for (const i of D.items)
|
|
160
160
|
a.has(i.id) || D.remove(i.id);
|
|
161
|
-
for (const i of
|
|
161
|
+
for (const i of j)
|
|
162
162
|
if (!e.has(i)) {
|
|
163
163
|
const o = w.find((f) => f.id === i);
|
|
164
164
|
o && D.append(o);
|
|
165
165
|
}
|
|
166
|
-
}, [r.value,
|
|
166
|
+
}, [r.value, j, w, D]);
|
|
167
167
|
const we = G(
|
|
168
168
|
(e) => {
|
|
169
169
|
const a = String(e), i = r.value ? r.value.split(",").map((o) => o.trim()).filter(Boolean) : [];
|
|
@@ -196,10 +196,10 @@ const Ae = ({
|
|
|
196
196
|
const u = e.split(".").slice(1), h = Y(o.fields, u);
|
|
197
197
|
h && h.field.type && (f = h.field.type);
|
|
198
198
|
}
|
|
199
|
-
const
|
|
199
|
+
const p = S.filter((M) => M.applicableTo.includes(f));
|
|
200
200
|
n({
|
|
201
201
|
fieldId: e,
|
|
202
|
-
operatorId: ((N =
|
|
202
|
+
operatorId: ((N = p[0]) == null ? void 0 : N.id) || "",
|
|
203
203
|
value: "",
|
|
204
204
|
value2: void 0
|
|
205
205
|
});
|
|
@@ -211,17 +211,17 @@ const Ae = ({
|
|
|
211
211
|
n(i !== o ? { operatorId: e, value: "", value2: void 0 } : { operatorId: e });
|
|
212
212
|
},
|
|
213
213
|
[S, c, n]
|
|
214
|
-
), Z =
|
|
215
|
-
() => Z ?
|
|
216
|
-
[Z, r.value]
|
|
214
|
+
), Z = d(() => (t == null ? void 0 : t.dataType) === "TIMESTAMP", [t]), Te = d(
|
|
215
|
+
() => Z ? $.parseTimestamp(r.value) : null,
|
|
216
|
+
[Z, r.value, $]
|
|
217
217
|
), ue = () => {
|
|
218
|
-
var i, o, f,
|
|
218
|
+
var i, o, f, p, N, M;
|
|
219
219
|
if (!(c != null && c.requiresValue))
|
|
220
220
|
return /* @__PURE__ */ l(
|
|
221
|
-
|
|
221
|
+
E,
|
|
222
222
|
{
|
|
223
|
-
size:
|
|
224
|
-
wrapperClassName: m(
|
|
223
|
+
size: g,
|
|
224
|
+
wrapperClassName: m(v && "w-full"),
|
|
225
225
|
className: b,
|
|
226
226
|
placeholder: "No value needed",
|
|
227
227
|
value: "",
|
|
@@ -241,13 +241,13 @@ const Ae = ({
|
|
|
241
241
|
// Prevent tags from wrapping to new lines - keep single row with horizontal scroll
|
|
242
242
|
"h-full [&_[role='group']>div]:flex-nowrap [&_[role='group']>div]:overflow-x-auto [&_[role='group']>div]:scrollbar-hide",
|
|
243
243
|
s && "[&>div]:ring-1 [&>div]:ring-error",
|
|
244
|
-
|
|
244
|
+
v && "w-full"
|
|
245
245
|
),
|
|
246
246
|
children: /* @__PURE__ */ l(
|
|
247
|
-
|
|
247
|
+
ve,
|
|
248
248
|
{
|
|
249
249
|
placeholder: u ? "Loading options..." : "Select values",
|
|
250
|
-
size:
|
|
250
|
+
size: g,
|
|
251
251
|
selectedItems: D,
|
|
252
252
|
items: u ? [] : w,
|
|
253
253
|
onItemInserted: we,
|
|
@@ -256,7 +256,7 @@ const Ae = ({
|
|
|
256
256
|
isDisabled: u,
|
|
257
257
|
searchable: U,
|
|
258
258
|
searchPlaceholder: "Search values...",
|
|
259
|
-
children: (h) => /* @__PURE__ */ l(
|
|
259
|
+
children: (h) => /* @__PURE__ */ l(ve.Item, { id: h.id, children: h.label })
|
|
260
260
|
},
|
|
261
261
|
Ne
|
|
262
262
|
)
|
|
@@ -264,13 +264,13 @@ const Ae = ({
|
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
266
|
return /* @__PURE__ */ l(
|
|
267
|
-
|
|
267
|
+
E,
|
|
268
268
|
{
|
|
269
269
|
mode: "tag",
|
|
270
|
-
size:
|
|
270
|
+
size: g,
|
|
271
271
|
wrapperClassName: m(
|
|
272
272
|
s && "!ring-error_subtle !ring-2 !ring-error",
|
|
273
|
-
|
|
273
|
+
v && "w-full"
|
|
274
274
|
),
|
|
275
275
|
className: b,
|
|
276
276
|
placeholder: "Type and press Enter",
|
|
@@ -280,27 +280,27 @@ const Ae = ({
|
|
|
280
280
|
}
|
|
281
281
|
);
|
|
282
282
|
}
|
|
283
|
-
if (Z && !
|
|
283
|
+
if (Z && !P)
|
|
284
284
|
return /* @__PURE__ */ l(
|
|
285
285
|
H,
|
|
286
286
|
{
|
|
287
287
|
granularity: "minute",
|
|
288
288
|
value: Te,
|
|
289
|
-
onChange: (u) => n({ value:
|
|
289
|
+
onChange: (u) => n({ value: $.formatTimestamp(u) }),
|
|
290
290
|
showFooter: !1,
|
|
291
|
-
className: m("w-auto",
|
|
291
|
+
className: m("w-auto", v && "w-full"),
|
|
292
292
|
"aria-label": (t == null ? void 0 : t.label) || "Date and time"
|
|
293
293
|
}
|
|
294
294
|
);
|
|
295
295
|
if (y)
|
|
296
|
-
return c != null && c.requiresTwoValues ? /* @__PURE__ */
|
|
296
|
+
return c != null && c.requiresTwoValues ? /* @__PURE__ */ I("div", { className: m("flex items-center gap-2 flex-1 min-w-[200px]", v && "w-full"), children: [
|
|
297
297
|
/* @__PURE__ */ l(
|
|
298
298
|
J,
|
|
299
299
|
{
|
|
300
300
|
documentFields: y,
|
|
301
301
|
selectedFieldId: (i = r.value) != null && i.includes(".") ? r.value : "",
|
|
302
302
|
onFieldSelect: se,
|
|
303
|
-
size:
|
|
303
|
+
size: g,
|
|
304
304
|
placeholder: "Min",
|
|
305
305
|
className: m(
|
|
306
306
|
b,
|
|
@@ -319,14 +319,14 @@ const Ae = ({
|
|
|
319
319
|
documentFields: y,
|
|
320
320
|
selectedFieldId: (f = r.value2) != null && f.includes(".") ? r.value2 : "",
|
|
321
321
|
onFieldSelect: (u) => n({ value2: u }),
|
|
322
|
-
size:
|
|
322
|
+
size: g,
|
|
323
323
|
placeholder: "Max",
|
|
324
324
|
className: m(
|
|
325
325
|
b,
|
|
326
326
|
s && "[&>div]:ring-2 [&>div]:ring-error [&>button]:ring-2 [&>button]:ring-error"
|
|
327
327
|
),
|
|
328
328
|
allowCustomValue: !0,
|
|
329
|
-
customValue: (
|
|
329
|
+
customValue: (p = r.value2) != null && p.includes(".") ? "" : r.value2 || "",
|
|
330
330
|
onCustomValueChange: (u) => n({ value2: u }),
|
|
331
331
|
useFixedPositioning: T
|
|
332
332
|
}
|
|
@@ -337,15 +337,15 @@ const Ae = ({
|
|
|
337
337
|
documentFields: y,
|
|
338
338
|
selectedFieldId: (N = r.value) != null && N.includes(".") ? r.value : "",
|
|
339
339
|
onFieldSelect: se,
|
|
340
|
-
size:
|
|
340
|
+
size: g,
|
|
341
341
|
placeholder: "Enter value",
|
|
342
342
|
className: m(
|
|
343
343
|
b,
|
|
344
344
|
s && "[&>div]:ring-2 [&>div]:ring-error [&>button]:ring-2 [&>button]:ring-error",
|
|
345
|
-
|
|
345
|
+
v && "w-full"
|
|
346
346
|
),
|
|
347
347
|
allowCustomValue: !0,
|
|
348
|
-
customValue: (
|
|
348
|
+
customValue: (M = r.value) != null && M.includes(".") ? "" : r.value,
|
|
349
349
|
onCustomValueChange: (u) => n({ value: u }),
|
|
350
350
|
useFixedPositioning: T
|
|
351
351
|
}
|
|
@@ -353,19 +353,19 @@ const Ae = ({
|
|
|
353
353
|
if ((t == null ? void 0 : t.type) === "select") {
|
|
354
354
|
const u = !!t.isLoading;
|
|
355
355
|
return /* @__PURE__ */ l(
|
|
356
|
-
|
|
356
|
+
Ee,
|
|
357
357
|
{
|
|
358
358
|
searchable: U,
|
|
359
|
-
size:
|
|
359
|
+
size: g,
|
|
360
360
|
className: m(
|
|
361
361
|
b,
|
|
362
362
|
s && "[&>button]:ring-2 [&>button]:ring-error",
|
|
363
|
-
|
|
363
|
+
v && "w-full"
|
|
364
364
|
),
|
|
365
365
|
placeholder: u ? "Loading options..." : "Select",
|
|
366
366
|
selectedKey: r.value,
|
|
367
367
|
onSelectionChange: (h) => n({ value: h }),
|
|
368
|
-
items: u ? [] :
|
|
368
|
+
items: u ? [] : R,
|
|
369
369
|
isInvalid: s,
|
|
370
370
|
isDisabled: u,
|
|
371
371
|
isLoading: u,
|
|
@@ -376,19 +376,19 @@ const Ae = ({
|
|
|
376
376
|
}
|
|
377
377
|
if (c != null && c.requiresTwoValues) {
|
|
378
378
|
if ((t == null ? void 0 : t.type) === "date")
|
|
379
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ I("div", { className: m("flex items-center gap-2 flex-1 min-w-[200px] ", v && "w-full"), children: [
|
|
380
380
|
/* @__PURE__ */ l("div", { className: m("flex-1", s && "ring-2 ring-error rounded-lg"), children: /* @__PURE__ */ l(
|
|
381
381
|
H,
|
|
382
382
|
{
|
|
383
383
|
value: re,
|
|
384
|
-
onChange:
|
|
384
|
+
onChange: _,
|
|
385
385
|
onApply: (h) => {
|
|
386
386
|
n(h ? {
|
|
387
387
|
value: `${h.month}/${h.day}/${h.year}`
|
|
388
|
-
} : { value: "" }),
|
|
388
|
+
} : { value: "" }), _(null);
|
|
389
389
|
},
|
|
390
390
|
onCancel: () => {
|
|
391
|
-
|
|
391
|
+
_(null);
|
|
392
392
|
},
|
|
393
393
|
showFooter: !0,
|
|
394
394
|
className: "w-full"
|
|
@@ -398,7 +398,7 @@ const Ae = ({
|
|
|
398
398
|
/* @__PURE__ */ l("div", { className: m("flex-1", s && "ring-2 ring-error rounded-lg"), children: /* @__PURE__ */ l(
|
|
399
399
|
H,
|
|
400
400
|
{
|
|
401
|
-
value:
|
|
401
|
+
value: de,
|
|
402
402
|
onChange: X,
|
|
403
403
|
onApply: (h) => {
|
|
404
404
|
n(h ? {
|
|
@@ -413,12 +413,12 @@ const Ae = ({
|
|
|
413
413
|
}
|
|
414
414
|
) })
|
|
415
415
|
] });
|
|
416
|
-
const u = () => (t == null ? void 0 : t.type) === "number" ? "number" : (t == null ? void 0 : t.type) === "date" &&
|
|
417
|
-
return /* @__PURE__ */
|
|
416
|
+
const u = () => (t == null ? void 0 : t.type) === "number" ? "number" : (t == null ? void 0 : t.type) === "date" && P ? "date" : "text";
|
|
417
|
+
return /* @__PURE__ */ I("div", { className: "flex items-center gap-2 flex-1 min-w-[200px]", children: [
|
|
418
418
|
/* @__PURE__ */ l(
|
|
419
|
-
|
|
419
|
+
E,
|
|
420
420
|
{
|
|
421
|
-
size:
|
|
421
|
+
size: g,
|
|
422
422
|
wrapperClassName: m(s && "!ring-error_subtle !ring-2 !ring-error"),
|
|
423
423
|
className: b,
|
|
424
424
|
placeholder: "Min",
|
|
@@ -430,9 +430,9 @@ const Ae = ({
|
|
|
430
430
|
),
|
|
431
431
|
/* @__PURE__ */ l("span", { className: "text-sm text-tertiary", children: "and" }),
|
|
432
432
|
/* @__PURE__ */ l(
|
|
433
|
-
|
|
433
|
+
E,
|
|
434
434
|
{
|
|
435
|
-
size:
|
|
435
|
+
size: g,
|
|
436
436
|
wrapperClassName: m(s && "!ring-error_subtle !ring-2 !ring-error"),
|
|
437
437
|
className: b,
|
|
438
438
|
placeholder: "Max",
|
|
@@ -444,27 +444,27 @@ const Ae = ({
|
|
|
444
444
|
)
|
|
445
445
|
] });
|
|
446
446
|
}
|
|
447
|
-
if ((t == null ? void 0 : t.type) === "date" && !
|
|
447
|
+
if ((t == null ? void 0 : t.type) === "date" && !P)
|
|
448
448
|
return /* @__PURE__ */ l(
|
|
449
449
|
"div",
|
|
450
450
|
{
|
|
451
451
|
className: m(
|
|
452
452
|
"min-w-[140px] flex-1",
|
|
453
453
|
s && "ring-2 ring-error rounded-lg",
|
|
454
|
-
|
|
454
|
+
v && "w-full"
|
|
455
455
|
),
|
|
456
456
|
children: /* @__PURE__ */ l(
|
|
457
457
|
H,
|
|
458
458
|
{
|
|
459
459
|
value: re,
|
|
460
|
-
onChange:
|
|
460
|
+
onChange: _,
|
|
461
461
|
onApply: (u) => {
|
|
462
462
|
n(u ? {
|
|
463
463
|
value: `${u.month}/${u.day}/${u.year}`
|
|
464
|
-
} : { value: "" }),
|
|
464
|
+
} : { value: "" }), _(null);
|
|
465
465
|
},
|
|
466
466
|
onCancel: () => {
|
|
467
|
-
|
|
467
|
+
_(null);
|
|
468
468
|
},
|
|
469
469
|
showFooter: !0,
|
|
470
470
|
className: "w-full"
|
|
@@ -472,12 +472,12 @@ const Ae = ({
|
|
|
472
472
|
)
|
|
473
473
|
}
|
|
474
474
|
);
|
|
475
|
-
const a = () => (t == null ? void 0 : t.type) === "number" ? "number" : (t == null ? void 0 : t.type) === "date" &&
|
|
475
|
+
const a = () => (t == null ? void 0 : t.type) === "number" ? "number" : (t == null ? void 0 : t.type) === "date" && P ? "date" : "text";
|
|
476
476
|
return /* @__PURE__ */ l(
|
|
477
|
-
|
|
477
|
+
E,
|
|
478
478
|
{
|
|
479
|
-
size:
|
|
480
|
-
wrapperClassName: m(s && "!ring-error_subtle !ring-2 !ring-error",
|
|
479
|
+
size: g,
|
|
480
|
+
wrapperClassName: m(s && "!ring-error_subtle !ring-2 !ring-error", v && "w-full"),
|
|
481
481
|
className: b,
|
|
482
482
|
placeholder: (t == null ? void 0 : t.type) === "date" ? "Select date" : "Enter value",
|
|
483
483
|
inputType: a(),
|
|
@@ -486,14 +486,14 @@ const Ae = ({
|
|
|
486
486
|
isInvalid: s
|
|
487
487
|
}
|
|
488
488
|
);
|
|
489
|
-
}, O = !!(c != null && c.requiresMultipleValues), ne = (e) =>
|
|
490
|
-
return /* @__PURE__ */
|
|
489
|
+
}, O = !!(c != null && c.requiresMultipleValues), ne = (e) => W ? /* @__PURE__ */ l("div", { className: "contents", "data-testid": V("value-input"), children: e }) : e;
|
|
490
|
+
return /* @__PURE__ */ I(
|
|
491
491
|
je,
|
|
492
492
|
{
|
|
493
493
|
value: r,
|
|
494
494
|
id: r.id,
|
|
495
495
|
"data-testid": V("row"),
|
|
496
|
-
"data-row-index":
|
|
496
|
+
"data-row-index": W ? ge : void 0,
|
|
497
497
|
dragListener: !1,
|
|
498
498
|
dragControls: Q,
|
|
499
499
|
layout: O ? "position" : !0,
|
|
@@ -502,52 +502,52 @@ const Ae = ({
|
|
|
502
502
|
},
|
|
503
503
|
className: m(
|
|
504
504
|
"flex items-center gap-2 py-2 group select-none",
|
|
505
|
-
|
|
505
|
+
v && "flex-col items-start",
|
|
506
506
|
O && "items-start"
|
|
507
507
|
),
|
|
508
508
|
initial: !1,
|
|
509
509
|
animate: !1,
|
|
510
510
|
style: { position: "relative" },
|
|
511
511
|
children: [
|
|
512
|
-
!
|
|
513
|
-
|
|
512
|
+
!pe && /* @__PURE__ */ I("div", { className: m("w-[72px] shrink-0", v && "w-full flex justify-between items-center"), children: [
|
|
513
|
+
L ? /* @__PURE__ */ l("span", { className: "text-sm font-medium text-secondary pl-1", children: "Where" }) : B ? /* @__PURE__ */ l(
|
|
514
514
|
C,
|
|
515
515
|
{
|
|
516
|
-
size:
|
|
517
|
-
className: m("h-8 w-full [&>button]:h-8 [&>div]:h-full",
|
|
516
|
+
size: g,
|
|
517
|
+
className: m("h-8 w-full [&>button]:h-8 [&>div]:h-full", v && "w-auto"),
|
|
518
518
|
popoverClassName: "w-auto min-w-max",
|
|
519
|
-
selectedKey:
|
|
520
|
-
onSelectionChange: (e) =>
|
|
521
|
-
items:
|
|
519
|
+
selectedKey: K,
|
|
520
|
+
onSelectionChange: (e) => q == null ? void 0 : q(e),
|
|
521
|
+
items: Le,
|
|
522
522
|
children: (e) => /* @__PURE__ */ l(C.Item, { id: e.id, children: e.label })
|
|
523
523
|
}
|
|
524
|
-
) : /* @__PURE__ */ l("span", { className: "text-sm font-medium text-secondary pl-3", children:
|
|
525
|
-
|
|
524
|
+
) : /* @__PURE__ */ l("span", { className: "text-sm font-medium text-secondary pl-3", children: K === "or" ? "Or" : "And" }),
|
|
525
|
+
v && /* @__PURE__ */ l(
|
|
526
526
|
fe,
|
|
527
527
|
{
|
|
528
528
|
color: "tertiary",
|
|
529
529
|
size: "xs",
|
|
530
530
|
icon: /* @__PURE__ */ l(me, { size: 18 }),
|
|
531
531
|
"aria-label": "Remove condition",
|
|
532
|
-
onClick:
|
|
532
|
+
onClick: k,
|
|
533
533
|
"data-testid": V("remove-button"),
|
|
534
534
|
className: "text-quaternary hover:bg-secondary_hover hover:text-secondary"
|
|
535
535
|
}
|
|
536
536
|
)
|
|
537
537
|
] }),
|
|
538
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ I("div", { className: m("flex relative", v ? "w-full" : "shrink-0"), children: [
|
|
539
539
|
y ? /* @__PURE__ */ l(
|
|
540
540
|
J,
|
|
541
541
|
{
|
|
542
542
|
documentFields: y,
|
|
543
543
|
selectedFieldId: r.fieldId,
|
|
544
544
|
onFieldSelect: De,
|
|
545
|
-
size:
|
|
545
|
+
size: g,
|
|
546
546
|
placeholder: "Select field",
|
|
547
547
|
className: m(
|
|
548
548
|
b,
|
|
549
549
|
s && "[&>button]:ring-2 [&>button]:ring-error",
|
|
550
|
-
|
|
550
|
+
v && "w-full max-w-none!"
|
|
551
551
|
),
|
|
552
552
|
useFixedPositioning: T
|
|
553
553
|
}
|
|
@@ -555,11 +555,11 @@ const Ae = ({
|
|
|
555
555
|
C,
|
|
556
556
|
{
|
|
557
557
|
"data-testid": V("field-select"),
|
|
558
|
-
size:
|
|
558
|
+
size: g,
|
|
559
559
|
className: m(
|
|
560
560
|
b,
|
|
561
561
|
s && "[&>button]:ring-2 [&>button]:ring-error",
|
|
562
|
-
|
|
562
|
+
v && "w-full flex-1 max-w-none!"
|
|
563
563
|
),
|
|
564
564
|
placeholder: "Select field",
|
|
565
565
|
selectedKey: r.fieldId,
|
|
@@ -576,7 +576,7 @@ const Ae = ({
|
|
|
576
576
|
) })
|
|
577
577
|
}
|
|
578
578
|
),
|
|
579
|
-
|
|
579
|
+
A && v && /* @__PURE__ */ l(
|
|
580
580
|
"div",
|
|
581
581
|
{
|
|
582
582
|
className: "flex opacity-0 group-hover:opacity-100 hover:visible absolute right-[-23px] bottom-1 items-center justify-center cursor-grab active:cursor-grabbing p-1.5 rounded-md transition-colors text-quaternary hover:text-secondary touch-none",
|
|
@@ -591,11 +591,11 @@ const Ae = ({
|
|
|
591
591
|
C,
|
|
592
592
|
{
|
|
593
593
|
"data-testid": V("operator-select"),
|
|
594
|
-
size:
|
|
594
|
+
size: g,
|
|
595
595
|
className: m(
|
|
596
596
|
b,
|
|
597
597
|
s && "[&>button]:ring-2 [&>button]:ring-error",
|
|
598
|
-
|
|
598
|
+
v && "w-full",
|
|
599
599
|
!(c != null && c.requiresValue) && "flex-1"
|
|
600
600
|
),
|
|
601
601
|
placeholder: "Select operator",
|
|
@@ -607,8 +607,8 @@ const Ae = ({
|
|
|
607
607
|
},
|
|
608
608
|
`operator-${r.fieldId}-${t == null ? void 0 : t.type}`
|
|
609
609
|
),
|
|
610
|
-
O ? /* @__PURE__ */ l(ke.div, { layoutRoot: !0, className: m("min-w-0 flex-1",
|
|
611
|
-
!
|
|
610
|
+
O ? /* @__PURE__ */ l(ke.div, { layoutRoot: !0, className: m("min-w-0 flex-1", v && "w-full"), children: ne(ue()) }) : ne(ue()),
|
|
611
|
+
!v && /* @__PURE__ */ I("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
612
612
|
/* @__PURE__ */ l(
|
|
613
613
|
fe,
|
|
614
614
|
{
|
|
@@ -616,12 +616,12 @@ const Ae = ({
|
|
|
616
616
|
size: "3xs",
|
|
617
617
|
icon: /* @__PURE__ */ l(me, { size: 16 }),
|
|
618
618
|
"aria-label": "Remove condition",
|
|
619
|
-
onClick:
|
|
619
|
+
onClick: k,
|
|
620
620
|
"data-testid": V("remove-button"),
|
|
621
621
|
className: "text-quaternary hover:bg-secondary_hover hover:text-secondary"
|
|
622
622
|
}
|
|
623
623
|
),
|
|
624
|
-
|
|
624
|
+
A && /* @__PURE__ */ l(
|
|
625
625
|
"div",
|
|
626
626
|
{
|
|
627
627
|
className: "flex items-center justify-center cursor-grab active:cursor-grabbing p-1 hover:bg-secondary_hover rounded-md transition-colors text-quaternary hover:text-secondary touch-none",
|
|
@@ -8,4 +8,5 @@ export type { FilterGroupBuilderProps, FilterGroup, FilterCondition, FilterNode,
|
|
|
8
8
|
export { DEFAULT_OPERATORS, generateId, createEmptyCondition, createEmptyGroup } from './types';
|
|
9
9
|
export { validateFilterGroup, isFilterGroupValid } from './validation';
|
|
10
10
|
export { defaultFilterDateAdapter, parseFilterDate, parseFilterTimestamp, formatFilterTimestamp, type FilterDateAdapter, } from './date-adapter';
|
|
11
|
+
export { Reorder, useDragControls } from 'framer-motion';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|