@pibit.ai/cure-design-system 0.6.53 → 0.6.54
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/patterns/condition-builder/add-action-button.d.ts +2 -0
- package/dist/patterns/condition-builder/add-action-button.d.ts.map +1 -1
- package/dist/patterns/condition-builder/add-action-button.js +22 -18
- package/dist/patterns/condition-builder/condition-builder.d.ts +1 -1
- package/dist/patterns/condition-builder/condition-builder.d.ts.map +1 -1
- package/dist/patterns/condition-builder/condition-builder.js +58 -57
- package/dist/patterns/condition-builder/condition-group.d.ts +1 -1
- package/dist/patterns/condition-builder/condition-group.d.ts.map +1 -1
- package/dist/patterns/condition-builder/condition-group.js +238 -233
- package/dist/patterns/condition-builder/types.d.ts +10 -0
- package/dist/patterns/condition-builder/types.d.ts.map +1 -1
- package/dist/patterns/confirm-dialog/confirm-dialog.d.ts +8 -1
- package/dist/patterns/confirm-dialog/confirm-dialog.d.ts.map +1 -1
- package/dist/patterns/confirm-dialog/confirm-dialog.js +76 -71
- package/dist/patterns/filter-group/document-fields-to-tree.d.ts +1 -0
- package/dist/patterns/filter-group/document-fields-to-tree.d.ts.map +1 -1
- package/dist/patterns/filter-group/document-fields-to-tree.js +14 -13
- package/dist/patterns/filter-group/filter-condition-row.js +30 -30
- package/dist/patterns/filter-group/nested-field-select.d.ts.map +1 -1
- package/dist/patterns/filter-group/nested-field-select.js +175 -167
- package/dist/patterns/filter-group/types.d.ts +4 -0
- package/dist/patterns/filter-group/types.d.ts.map +1 -1
- package/dist/patterns/filter-group/types.js +27 -12
- package/dist/rich-text/token-input/token-suggestion.d.ts +5 -0
- package/dist/rich-text/token-input/token-suggestion.d.ts.map +1 -1
- package/dist/rich-text/token-input/token-suggestion.js +14 -6
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import { jsxs as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { Plus as
|
|
4
|
-
import { pathToString as
|
|
5
|
-
import { cx as
|
|
6
|
-
import { ConditionRow as
|
|
7
|
-
import { ConditionReorderHandle as
|
|
8
|
-
import { AddActionButton as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { useDragControls as
|
|
11
|
-
import { Select as
|
|
12
|
-
import { ButtonUtility as
|
|
13
|
-
import { ReorderGroup as
|
|
14
|
-
import { ReorderItem as
|
|
15
|
-
function
|
|
16
|
-
const c =
|
|
2
|
+
import { useContext as Be, createContext as We, useState as X, useMemo as je, useRef as O, useEffect as Ae } from "react";
|
|
3
|
+
import { Plus as ge, Trash02 as ve } from "@untitledui/icons";
|
|
4
|
+
import { pathToString as ye } from "./utils.js";
|
|
5
|
+
import { cx as m } from "../../utils/cn.js";
|
|
6
|
+
import { ConditionRow as Ge } from "./condition-row.js";
|
|
7
|
+
import { ConditionReorderHandle as Ne, WORKFLOW_REORDER_HANDLE_CLASS as ze } from "./condition-reorder-handle.js";
|
|
8
|
+
import { AddActionButton as xe } from "./add-action-button.js";
|
|
9
|
+
import { Button as Me } from "../../primitives/button/button.js";
|
|
10
|
+
import { useDragControls as ke } from "../../node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js";
|
|
11
|
+
import { Select as z } from "../../primitives/select/select.js";
|
|
12
|
+
import { ButtonUtility as be } from "../../primitives/button/button-utility.js";
|
|
13
|
+
import { ReorderGroup as we } from "../../node_modules/framer-motion/dist/es/components/Reorder/Group.js";
|
|
14
|
+
import { ReorderItem as Pe } from "../../node_modules/framer-motion/dist/es/components/Reorder/Item.js";
|
|
15
|
+
function Ve(h) {
|
|
16
|
+
const c = O(/* @__PURE__ */ new WeakMap()), a = O(/* @__PURE__ */ new Map()), d = O(0), o = O([]);
|
|
17
17
|
return (b, v) => {
|
|
18
|
-
const
|
|
19
|
-
if (c.current.has(
|
|
20
|
-
const
|
|
21
|
-
return
|
|
18
|
+
const i = b;
|
|
19
|
+
if (c.current.has(i)) {
|
|
20
|
+
const L = c.current.get(i);
|
|
21
|
+
return o.current[v] = L, L;
|
|
22
22
|
}
|
|
23
|
-
const f =
|
|
24
|
-
if (f != null &&
|
|
25
|
-
return c.current.set(
|
|
26
|
-
const l = `cond-${
|
|
27
|
-
return c.current.set(
|
|
23
|
+
const f = o.current[v], w = f != null ? a.current.get(f) : void 0;
|
|
24
|
+
if (f != null && w !== void 0 && !h.includes(w))
|
|
25
|
+
return c.current.set(i, f), a.current.set(f, i), o.current[v] = f, f;
|
|
26
|
+
const l = `cond-${d.current++}`;
|
|
27
|
+
return c.current.set(i, l), a.current.set(l, i), o.current[v] = l, l;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const Se = [
|
|
31
31
|
{ id: "AND", label: "And" },
|
|
32
32
|
{ id: "OR", label: "Or" }
|
|
33
|
-
],
|
|
33
|
+
], _ = {
|
|
34
34
|
sm: "text-xs",
|
|
35
35
|
md: "text-sm",
|
|
36
36
|
lg: "text-md"
|
|
37
|
-
},
|
|
37
|
+
}, Ie = {
|
|
38
38
|
sm: "size-4",
|
|
39
39
|
md: "size-5",
|
|
40
40
|
lg: "size-6"
|
|
41
|
-
},
|
|
42
|
-
function
|
|
43
|
-
condition:
|
|
41
|
+
}, Re = "min-w-0 flex-1 truncate text-xs font-semibold leading-4.5 text-secondary", qe = "w-[68px] shrink-0 [&_button>*]:h-7 [&_button>*]:py-1", Le = We(null), $e = (h) => h % 2 === 0 ? "bg-primary" : "bg-secondary_subtle", Je = (h) => h === 0 ? "bg-secondary_subtle" : "bg-primary border border-[#E3EAFC]";
|
|
42
|
+
function Y({
|
|
43
|
+
condition: h,
|
|
44
44
|
onDragStartSession: c,
|
|
45
45
|
children: a
|
|
46
46
|
}) {
|
|
47
|
-
const
|
|
47
|
+
const d = ke();
|
|
48
48
|
return /* @__PURE__ */ t(
|
|
49
|
-
|
|
49
|
+
Pe,
|
|
50
50
|
{
|
|
51
|
-
value:
|
|
51
|
+
value: h,
|
|
52
52
|
as: "div",
|
|
53
53
|
dragListener: !1,
|
|
54
|
-
dragControls:
|
|
54
|
+
dragControls: d,
|
|
55
55
|
style: { position: "relative" },
|
|
56
56
|
whileDrag: {
|
|
57
57
|
opacity: 0.85,
|
|
@@ -61,33 +61,34 @@ function X({
|
|
|
61
61
|
},
|
|
62
62
|
transition: { type: "spring", stiffness: 300, damping: 25 },
|
|
63
63
|
children: a((b) => {
|
|
64
|
-
c == null || c(),
|
|
64
|
+
c == null || c(), d.start(b);
|
|
65
65
|
})
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
condition:
|
|
69
|
+
function Qe({
|
|
70
|
+
condition: h,
|
|
71
71
|
renderCustomNode: c,
|
|
72
72
|
customCtx: a,
|
|
73
|
-
onDragStartSession:
|
|
74
|
-
renderOperatorColumn:
|
|
73
|
+
onDragStartSession: d,
|
|
74
|
+
renderOperatorColumn: o,
|
|
75
75
|
hideOperatorColumn: b,
|
|
76
|
-
|
|
76
|
+
operatorColumnClassName: v,
|
|
77
|
+
renderDefault: i
|
|
77
78
|
}) {
|
|
78
|
-
const
|
|
79
|
+
const f = ke(), S = c(h, {
|
|
79
80
|
...a,
|
|
80
|
-
onDragHandlePointerDown: (
|
|
81
|
-
|
|
81
|
+
onDragHandlePointerDown: (l) => {
|
|
82
|
+
d == null || d(), f.start(l);
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
|
-
return
|
|
85
|
-
|
|
85
|
+
return S == null ? i() : /* @__PURE__ */ t(
|
|
86
|
+
Pe,
|
|
86
87
|
{
|
|
87
|
-
value:
|
|
88
|
+
value: h,
|
|
88
89
|
as: "div",
|
|
89
90
|
dragListener: !1,
|
|
90
|
-
dragControls:
|
|
91
|
+
dragControls: f,
|
|
91
92
|
style: { position: "relative" },
|
|
92
93
|
whileDrag: {
|
|
93
94
|
opacity: 0.85,
|
|
@@ -97,135 +98,137 @@ function $e({
|
|
|
97
98
|
},
|
|
98
99
|
transition: { type: "spring", stiffness: 300, damping: 25 },
|
|
99
100
|
children: /* @__PURE__ */ g("div", { className: "flex items-start gap-2 py-2 min-w-0", children: [
|
|
100
|
-
!b && /* @__PURE__ */ t("div", { className: "
|
|
101
|
-
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children:
|
|
101
|
+
!b && /* @__PURE__ */ t("div", { className: m(v, "shrink-0 pt-2"), children: o(a.index) }),
|
|
102
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: S })
|
|
102
103
|
] })
|
|
103
104
|
}
|
|
104
105
|
);
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
-
group:
|
|
107
|
+
function Ue({
|
|
108
|
+
group: h,
|
|
108
109
|
nodePath: c,
|
|
109
110
|
level: a,
|
|
110
|
-
maxDepth:
|
|
111
|
-
config:
|
|
111
|
+
maxDepth: d,
|
|
112
|
+
config: o,
|
|
112
113
|
onAddCondition: b,
|
|
113
114
|
onUpdateCondition: v,
|
|
114
|
-
onDeleteCondition:
|
|
115
|
+
onDeleteCondition: i,
|
|
115
116
|
onAddGroup: f,
|
|
116
|
-
onUpdateGroupOperator:
|
|
117
|
-
onDeleteGroup:
|
|
117
|
+
onUpdateGroupOperator: w,
|
|
118
|
+
onDeleteGroup: S,
|
|
118
119
|
onDuplicateCondition: l,
|
|
119
|
-
onReorder:
|
|
120
|
-
renderLeafRow:
|
|
121
|
-
hideOperatorColumn:
|
|
122
|
-
invalidPaths:
|
|
120
|
+
onReorder: L,
|
|
121
|
+
renderLeafRow: M,
|
|
122
|
+
hideOperatorColumn: p = !1,
|
|
123
|
+
invalidPaths: Z,
|
|
123
124
|
getErrorMessage: K,
|
|
124
125
|
size: u,
|
|
125
|
-
addFilterLabel:
|
|
126
|
-
addFilterGroupLabel:
|
|
127
|
-
addActionClassName:
|
|
128
|
-
nestedAddActionClassName:
|
|
129
|
-
hideAddActions:
|
|
130
|
-
getOperatorOptions:
|
|
131
|
-
reorderGroupClassName:
|
|
126
|
+
addFilterLabel: D,
|
|
127
|
+
addFilterGroupLabel: ee,
|
|
128
|
+
addActionClassName: V,
|
|
129
|
+
nestedAddActionClassName: re,
|
|
130
|
+
hideAddActions: te = !1,
|
|
131
|
+
getOperatorOptions: _e,
|
|
132
|
+
reorderGroupClassName: q,
|
|
132
133
|
extraAddActions: T,
|
|
133
|
-
renderCustomNode:
|
|
134
|
-
isDeleteDisabled:
|
|
135
|
-
showRootClearGroup:
|
|
136
|
-
onRootClearGroup:
|
|
134
|
+
renderCustomNode: $,
|
|
135
|
+
isDeleteDisabled: I,
|
|
136
|
+
showRootClearGroup: Oe = !1,
|
|
137
|
+
onRootClearGroup: ne,
|
|
138
|
+
whereLabel: se = "Where",
|
|
139
|
+
operatorColumnClassName: B = "w-[75px]"
|
|
137
140
|
}) {
|
|
138
|
-
const
|
|
139
|
-
() =>
|
|
140
|
-
[
|
|
141
|
-
),
|
|
142
|
-
r.stopPropagation(),
|
|
143
|
-
} : void 0,
|
|
144
|
-
const e = [...
|
|
145
|
-
|
|
141
|
+
const ce = a < d, ae = a === 0 ? V : re ?? V, H = o.getGroupOperator(h), N = o.getGroupConditions(h), J = Be(Le), [le, He] = X(null), E = je(
|
|
142
|
+
() => J ?? { hoveredPath: le, setHoveredPath: He },
|
|
143
|
+
[J, le]
|
|
144
|
+
), oe = (e) => p ? (r) => {
|
|
145
|
+
r.stopPropagation(), E.setHoveredPath(e);
|
|
146
|
+
} : void 0, ie = p ? () => E.setHoveredPath(null) : void 0, [ue, me] = X(!1), [Ee, he] = X([]), W = O(null), C = O(null), j = () => {
|
|
147
|
+
const e = [...N];
|
|
148
|
+
me(!0), he(e), W.current = e;
|
|
146
149
|
const r = () => {
|
|
147
|
-
const s =
|
|
148
|
-
s && (s.length !== n.length || s.some((
|
|
150
|
+
const s = W.current, n = N;
|
|
151
|
+
s && (s.length !== n.length || s.some((x, k) => x !== n[k])) && L(c, s), W.current = null, document.removeEventListener("pointerup", r), C.current = null, requestAnimationFrame(() => me(!1));
|
|
149
152
|
};
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
if (
|
|
153
|
-
|
|
153
|
+
C.current = r, document.addEventListener("pointerup", r);
|
|
154
|
+
}, fe = (e) => {
|
|
155
|
+
if (ue) {
|
|
156
|
+
W.current = e, he(e);
|
|
154
157
|
return;
|
|
155
158
|
}
|
|
156
|
-
e !==
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
e !== N && (e.length === N.length && e.every((r, s) => N[s] === r) || L(c, e));
|
|
160
|
+
}, R = ue ? Ee : N, A = Ve(R);
|
|
161
|
+
Ae(() => () => {
|
|
162
|
+
C.current && (document.removeEventListener("pointerup", C.current), C.current = null);
|
|
160
163
|
}, []);
|
|
161
|
-
const
|
|
164
|
+
const Q = (e) => {
|
|
162
165
|
if (e === 0)
|
|
163
|
-
return /* @__PURE__ */ t("span", { className:
|
|
164
|
-
const r = e === 1, s =
|
|
166
|
+
return /* @__PURE__ */ t("span", { className: m("font-medium text-secondary pl-1", _[u]), children: a === 0 ? se : "Where" });
|
|
167
|
+
const r = e === 1, s = H === "OR" ? "Or" : "And";
|
|
165
168
|
return r ? /* @__PURE__ */ t(
|
|
166
|
-
|
|
169
|
+
z,
|
|
167
170
|
{
|
|
168
171
|
size: u,
|
|
169
172
|
className: "w-full",
|
|
170
|
-
selectedKey:
|
|
171
|
-
onSelectionChange: (n) =>
|
|
172
|
-
items:
|
|
173
|
+
selectedKey: H,
|
|
174
|
+
onSelectionChange: (n) => w(c, n),
|
|
175
|
+
items: Se,
|
|
173
176
|
"aria-label": "Logical operator for this group",
|
|
174
|
-
children: (n) => /* @__PURE__ */ t(
|
|
177
|
+
children: (n) => /* @__PURE__ */ t(z.Item, { id: n.id, children: n.label })
|
|
175
178
|
}
|
|
176
|
-
) : /* @__PURE__ */ t("span", { className:
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
+
) : /* @__PURE__ */ t("span", { className: m("font-medium text-secondary pl-3", _[u]), children: s });
|
|
180
|
+
}, Ce = (e) => e === 0 ? /* @__PURE__ */ t("span", { className: Re, children: a === 0 ? se : "Where" }) : e === 1 ? /* @__PURE__ */ t(
|
|
181
|
+
z,
|
|
179
182
|
{
|
|
180
183
|
size: "sm",
|
|
181
|
-
className:
|
|
184
|
+
className: qe,
|
|
182
185
|
textStyles: "font-semibold text-secondary",
|
|
183
|
-
selectedKey:
|
|
184
|
-
onSelectionChange: (r) =>
|
|
185
|
-
items:
|
|
186
|
+
selectedKey: H,
|
|
187
|
+
onSelectionChange: (r) => w(c, r),
|
|
188
|
+
items: Se,
|
|
186
189
|
"aria-label": "Logical operator for this group",
|
|
187
|
-
children: (r) => /* @__PURE__ */ t(
|
|
190
|
+
children: (r) => /* @__PURE__ */ t(z.Item, { id: r.id, children: r.label })
|
|
188
191
|
}
|
|
189
|
-
) : /* @__PURE__ */ t("span", { className:
|
|
190
|
-
const n = [...c, r], y =
|
|
192
|
+
) : /* @__PURE__ */ t("span", { className: Re, children: H === "OR" ? "Or" : "And" }), Fe = (e, r, s) => {
|
|
193
|
+
const n = [...c, r], y = ye(n), x = r === 0, k = Z.has(y), G = K == null ? void 0 : K(y);
|
|
191
194
|
return /* @__PURE__ */ t(
|
|
192
|
-
|
|
195
|
+
Y,
|
|
193
196
|
{
|
|
194
197
|
condition: e,
|
|
195
|
-
onDragStartSession:
|
|
198
|
+
onDragStartSession: j,
|
|
196
199
|
children: (F) => /* @__PURE__ */ g(
|
|
197
200
|
"div",
|
|
198
201
|
{
|
|
199
|
-
className:
|
|
200
|
-
onMouseOver:
|
|
202
|
+
className: m("flex min-w-0 items-center gap-2", p ? "py-0" : "py-1"),
|
|
203
|
+
onMouseOver: oe(y),
|
|
201
204
|
children: [
|
|
202
|
-
!
|
|
203
|
-
/* @__PURE__ */ t("div", { className:
|
|
205
|
+
!p && /* @__PURE__ */ t("div", { className: m(B, "shrink-0"), children: Q(r) }),
|
|
206
|
+
/* @__PURE__ */ t("div", { className: p ? "min-w-0 flex-1" : "min-w-[80px] flex-1", children: M ? M({
|
|
204
207
|
condition: e,
|
|
205
208
|
nodePath: n,
|
|
206
|
-
isFirst:
|
|
207
|
-
onUpdate: (
|
|
208
|
-
onDelete: () =>
|
|
209
|
+
isFirst: x,
|
|
210
|
+
onUpdate: (P) => v(n, P),
|
|
211
|
+
onDelete: () => i(n),
|
|
209
212
|
onDuplicate: l ? () => l(n) : void 0,
|
|
210
|
-
isInvalid:
|
|
211
|
-
errorMessage:
|
|
213
|
+
isInvalid: k,
|
|
214
|
+
errorMessage: G,
|
|
212
215
|
size: u,
|
|
213
216
|
onDragHandlePointerDown: F,
|
|
214
217
|
isDeleteDisabled: s,
|
|
215
|
-
isDragHandleVisible:
|
|
218
|
+
isDragHandleVisible: p ? E.hoveredPath === y : void 0
|
|
216
219
|
}) : /* @__PURE__ */ t(
|
|
217
|
-
|
|
220
|
+
Ge,
|
|
218
221
|
{
|
|
219
222
|
condition: e,
|
|
220
223
|
nodePath: n,
|
|
221
|
-
isFirst:
|
|
222
|
-
onUpdate: (
|
|
223
|
-
onDelete: () =>
|
|
224
|
+
isFirst: x,
|
|
225
|
+
onUpdate: (P) => v(n, P),
|
|
226
|
+
onDelete: () => i(n),
|
|
224
227
|
onDuplicate: l ? () => l(n) : void 0,
|
|
225
|
-
isInvalid:
|
|
226
|
-
errorMessage:
|
|
228
|
+
isInvalid: k,
|
|
229
|
+
errorMessage: G,
|
|
227
230
|
size: u,
|
|
228
|
-
getOperatorOptions:
|
|
231
|
+
getOperatorOptions: _e,
|
|
229
232
|
onDragHandlePointerDown: F,
|
|
230
233
|
isDeleteDisabled: s
|
|
231
234
|
}
|
|
@@ -234,198 +237,200 @@ function Je({
|
|
|
234
237
|
}
|
|
235
238
|
)
|
|
236
239
|
},
|
|
237
|
-
|
|
240
|
+
A(e, r)
|
|
238
241
|
);
|
|
239
|
-
},
|
|
240
|
-
const n = [...c, r], y = r === 0,
|
|
241
|
-
|
|
242
|
+
}, Ke = (e, r, s) => {
|
|
243
|
+
const n = [...c, r], y = r === 0, x = $e(a + 1), k = Je(a), G = o.getGroupOperator(e), F = ye(n), P = /* @__PURE__ */ t(
|
|
244
|
+
Ue,
|
|
242
245
|
{
|
|
243
246
|
group: e,
|
|
244
247
|
nodePath: n,
|
|
245
248
|
level: a + 1,
|
|
246
|
-
maxDepth:
|
|
249
|
+
maxDepth: d,
|
|
247
250
|
isFirst: y,
|
|
248
|
-
parentOperator:
|
|
249
|
-
config:
|
|
251
|
+
parentOperator: H,
|
|
252
|
+
config: o,
|
|
250
253
|
onAddCondition: b,
|
|
251
254
|
onUpdateCondition: v,
|
|
252
|
-
onDeleteCondition:
|
|
255
|
+
onDeleteCondition: i,
|
|
253
256
|
onAddGroup: f,
|
|
254
|
-
onUpdateGroupOperator:
|
|
255
|
-
onDeleteGroup:
|
|
257
|
+
onUpdateGroupOperator: w,
|
|
258
|
+
onDeleteGroup: S,
|
|
256
259
|
onDuplicateCondition: l,
|
|
257
|
-
onReorder:
|
|
258
|
-
renderLeafRow:
|
|
259
|
-
hideOperatorColumn:
|
|
260
|
-
invalidPaths:
|
|
260
|
+
onReorder: L,
|
|
261
|
+
renderLeafRow: M,
|
|
262
|
+
hideOperatorColumn: p,
|
|
263
|
+
invalidPaths: Z,
|
|
261
264
|
getErrorMessage: K,
|
|
262
265
|
size: u,
|
|
263
|
-
addFilterLabel:
|
|
264
|
-
addFilterGroupLabel:
|
|
265
|
-
addActionClassName:
|
|
266
|
-
nestedAddActionClassName:
|
|
267
|
-
hideAddActions:
|
|
268
|
-
reorderGroupClassName:
|
|
266
|
+
addFilterLabel: D,
|
|
267
|
+
addFilterGroupLabel: ee,
|
|
268
|
+
addActionClassName: V,
|
|
269
|
+
nestedAddActionClassName: re,
|
|
270
|
+
hideAddActions: te,
|
|
271
|
+
reorderGroupClassName: q,
|
|
269
272
|
extraAddActions: T,
|
|
270
|
-
renderCustomNode:
|
|
271
|
-
isDeleteDisabled:
|
|
273
|
+
renderCustomNode: $,
|
|
274
|
+
isDeleteDisabled: I,
|
|
275
|
+
operatorColumnClassName: B
|
|
272
276
|
}
|
|
273
277
|
);
|
|
274
|
-
if (
|
|
275
|
-
const
|
|
278
|
+
if (p) {
|
|
279
|
+
const U = E.hoveredPath === F;
|
|
276
280
|
return /* @__PURE__ */ t(
|
|
277
|
-
|
|
281
|
+
Y,
|
|
278
282
|
{
|
|
279
283
|
condition: e,
|
|
280
|
-
onDragStartSession:
|
|
281
|
-
children: (
|
|
284
|
+
onDragStartSession: j,
|
|
285
|
+
children: (Te) => /* @__PURE__ */ g(
|
|
282
286
|
"div",
|
|
283
287
|
{
|
|
284
288
|
className: "relative flex min-w-0 flex-col gap-1.5",
|
|
285
|
-
onMouseOver:
|
|
289
|
+
onMouseOver: oe(F),
|
|
286
290
|
children: [
|
|
287
291
|
/* @__PURE__ */ t(
|
|
288
|
-
|
|
292
|
+
Ne,
|
|
289
293
|
{
|
|
290
|
-
className:
|
|
291
|
-
|
|
294
|
+
className: m(
|
|
295
|
+
ze,
|
|
292
296
|
"absolute right-0 top-0 z-10 translate-x-1/2",
|
|
293
|
-
|
|
297
|
+
U ? "opacity-100" : "pointer-events-none opacity-0"
|
|
294
298
|
),
|
|
295
299
|
size: u,
|
|
296
|
-
onDragHandlePointerDown:
|
|
300
|
+
onDragHandlePointerDown: Te,
|
|
297
301
|
onDuplicate: l ? () => l(n) : void 0
|
|
298
302
|
}
|
|
299
303
|
),
|
|
300
304
|
/* @__PURE__ */ g(
|
|
301
305
|
"div",
|
|
302
306
|
{
|
|
303
|
-
className:
|
|
307
|
+
className: m(
|
|
304
308
|
"flex min-w-0 items-center justify-between gap-0.5",
|
|
305
309
|
r === 1 ? "h-7 pr-1" : "h-[18px] px-1"
|
|
306
310
|
),
|
|
307
311
|
children: [
|
|
308
|
-
|
|
312
|
+
Ce(r),
|
|
309
313
|
!s && /* @__PURE__ */ t(
|
|
310
|
-
|
|
314
|
+
be,
|
|
311
315
|
{
|
|
312
316
|
color: "tertiary",
|
|
313
317
|
size: "4xs",
|
|
314
|
-
icon:
|
|
318
|
+
icon: ve,
|
|
315
319
|
"aria-label": "Remove group",
|
|
316
|
-
onClick: () =>
|
|
320
|
+
onClick: () => S(n),
|
|
317
321
|
className: "shrink-0 hover:bg-secondary_hover hover:text-fg-secondary"
|
|
318
322
|
}
|
|
319
323
|
)
|
|
320
324
|
]
|
|
321
325
|
}
|
|
322
326
|
),
|
|
323
|
-
/* @__PURE__ */ t("div", { className:
|
|
327
|
+
/* @__PURE__ */ t("div", { className: m("min-w-0 rounded-[10px] p-1.5", k), children: P })
|
|
324
328
|
]
|
|
325
329
|
}
|
|
326
330
|
)
|
|
327
331
|
},
|
|
328
|
-
|
|
332
|
+
A(e, r)
|
|
329
333
|
);
|
|
330
334
|
}
|
|
331
335
|
return /* @__PURE__ */ t(
|
|
332
|
-
|
|
336
|
+
Y,
|
|
333
337
|
{
|
|
334
338
|
condition: e,
|
|
335
|
-
onDragStartSession:
|
|
336
|
-
children: (
|
|
337
|
-
/* @__PURE__ */ t("div", { className: "
|
|
338
|
-
/* @__PURE__ */ g("div", { className:
|
|
339
|
+
onDragStartSession: j,
|
|
340
|
+
children: (U) => /* @__PURE__ */ g("div", { className: "flex min-w-0 items-start gap-2 py-2", children: [
|
|
341
|
+
/* @__PURE__ */ t("div", { className: m(B, "shrink-0 pt-2"), children: Q(r) }),
|
|
342
|
+
/* @__PURE__ */ g("div", { className: m("relative min-w-0 flex-1 overflow-hidden rounded-lg p-3", x), children: [
|
|
339
343
|
/* @__PURE__ */ g("div", { className: "mb-2 flex min-w-0 items-center gap-0.5", children: [
|
|
340
|
-
/* @__PURE__ */ t("span", { className:
|
|
344
|
+
/* @__PURE__ */ t("span", { className: m("min-w-0 flex-1 text-tertiary", _[u]), children: G === "OR" ? "Any of the following are true..." : "All of the following are true..." }),
|
|
341
345
|
!s && /* @__PURE__ */ t(
|
|
342
|
-
|
|
346
|
+
be,
|
|
343
347
|
{
|
|
344
348
|
"aria-label": "Remove group",
|
|
345
|
-
icon:
|
|
349
|
+
icon: ve,
|
|
346
350
|
color: "tertiary",
|
|
347
351
|
size: "3xs",
|
|
348
|
-
onClick: () =>
|
|
352
|
+
onClick: () => S(n)
|
|
349
353
|
}
|
|
350
354
|
)
|
|
351
355
|
] }),
|
|
352
|
-
|
|
356
|
+
P
|
|
353
357
|
] }),
|
|
354
|
-
!
|
|
355
|
-
|
|
358
|
+
!p && /* @__PURE__ */ t(
|
|
359
|
+
Ne,
|
|
356
360
|
{
|
|
357
361
|
className: "mt-2 w-9 shrink-0",
|
|
358
362
|
size: u,
|
|
359
|
-
onDragHandlePointerDown:
|
|
363
|
+
onDragHandlePointerDown: U,
|
|
360
364
|
onDuplicate: l ? () => l(n) : void 0
|
|
361
365
|
}
|
|
362
366
|
)
|
|
363
367
|
] })
|
|
364
368
|
},
|
|
365
|
-
|
|
369
|
+
A(e, r)
|
|
366
370
|
);
|
|
367
|
-
},
|
|
368
|
-
const s = [...c, r], n =
|
|
369
|
-
return
|
|
370
|
-
|
|
371
|
+
}, de = (e, r) => {
|
|
372
|
+
const s = [...c, r], n = N.length, y = !!(I != null && I({ nodePath: s, siblingCount: n })), x = () => o.isLeafCondition(e) ? Fe(e, r, y) : o.isGroupCondition(e) ? Ke(e, r, y) : null;
|
|
373
|
+
return $ ? /* @__PURE__ */ t(
|
|
374
|
+
Qe,
|
|
371
375
|
{
|
|
372
376
|
condition: e,
|
|
373
|
-
renderCustomNode:
|
|
377
|
+
renderCustomNode: $,
|
|
374
378
|
customCtx: {
|
|
375
379
|
nodePath: s,
|
|
376
380
|
index: r,
|
|
377
381
|
isFirst: r === 0,
|
|
378
382
|
onDuplicate: l ? () => l(s) : void 0,
|
|
379
|
-
onDelete: () =>
|
|
383
|
+
onDelete: () => i(s)
|
|
380
384
|
},
|
|
381
|
-
onDragStartSession:
|
|
382
|
-
renderOperatorColumn:
|
|
383
|
-
|
|
384
|
-
|
|
385
|
+
onDragStartSession: j,
|
|
386
|
+
renderOperatorColumn: Q,
|
|
387
|
+
operatorColumnClassName: B,
|
|
388
|
+
hideOperatorColumn: p,
|
|
389
|
+
renderDefault: x
|
|
385
390
|
},
|
|
386
|
-
|
|
387
|
-
) :
|
|
388
|
-
},
|
|
391
|
+
A(e, r)
|
|
392
|
+
) : x();
|
|
393
|
+
}, pe = (e = !1) => te ? null : /* @__PURE__ */ g("div", { className: "flex flex-1 items-center justify-between pt-3", children: [
|
|
389
394
|
/* @__PURE__ */ g("div", { className: "flex items-center gap-3", children: [
|
|
390
395
|
/* @__PURE__ */ t(
|
|
391
|
-
|
|
396
|
+
xe,
|
|
392
397
|
{
|
|
393
|
-
icon:
|
|
394
|
-
fontSize:
|
|
395
|
-
iconSize:
|
|
396
|
-
className:
|
|
398
|
+
icon: ge,
|
|
399
|
+
fontSize: _[u],
|
|
400
|
+
iconSize: Ie[u],
|
|
401
|
+
className: ae,
|
|
397
402
|
onClick: () => b(c),
|
|
398
|
-
children:
|
|
403
|
+
children: D
|
|
399
404
|
}
|
|
400
405
|
),
|
|
401
|
-
|
|
402
|
-
|
|
406
|
+
ce && /* @__PURE__ */ t(
|
|
407
|
+
xe,
|
|
403
408
|
{
|
|
404
|
-
icon:
|
|
405
|
-
fontSize:
|
|
406
|
-
iconSize:
|
|
407
|
-
className:
|
|
409
|
+
icon: ge,
|
|
410
|
+
fontSize: _[u],
|
|
411
|
+
iconSize: Ie[u],
|
|
412
|
+
className: ae,
|
|
408
413
|
onClick: () => f(c),
|
|
409
|
-
children:
|
|
414
|
+
children: ee
|
|
410
415
|
}
|
|
411
416
|
),
|
|
412
|
-
T == null ? void 0 : T({ nodePath: c, level: a, canAddNestedGroup:
|
|
417
|
+
T == null ? void 0 : T({ nodePath: c, level: a, canAddNestedGroup: ce })
|
|
413
418
|
] }),
|
|
414
|
-
e &&
|
|
415
|
-
|
|
419
|
+
e && N.length > 0 && /* @__PURE__ */ t(
|
|
420
|
+
Me,
|
|
416
421
|
{
|
|
417
422
|
type: "button",
|
|
418
423
|
color: "link-gray",
|
|
419
424
|
size: "sm",
|
|
420
|
-
className:
|
|
425
|
+
className: m("font-medium text-secondary hover:text-primary", _[u]),
|
|
421
426
|
onClick: () => {
|
|
422
|
-
if (a === 0 &&
|
|
423
|
-
|
|
427
|
+
if (a === 0 && ne) {
|
|
428
|
+
ne();
|
|
424
429
|
return;
|
|
425
430
|
}
|
|
426
|
-
for (let r =
|
|
431
|
+
for (let r = N.length - 1; r >= 0; r--) {
|
|
427
432
|
const s = [...c, r], n = r + 1;
|
|
428
|
-
|
|
433
|
+
I != null && I({ nodePath: s, siblingCount: n }) || i(s);
|
|
429
434
|
}
|
|
430
435
|
},
|
|
431
436
|
children: "Clear Group"
|
|
@@ -437,40 +442,40 @@ function Je({
|
|
|
437
442
|
"div",
|
|
438
443
|
{
|
|
439
444
|
className: "space-y-0 min-w-0 max-w-full",
|
|
440
|
-
onMouseOver:
|
|
441
|
-
onMouseLeave:
|
|
445
|
+
onMouseOver: ie,
|
|
446
|
+
onMouseLeave: ie,
|
|
442
447
|
children: [
|
|
443
|
-
|
|
444
|
-
|
|
448
|
+
R.length > 0 && /* @__PURE__ */ t(
|
|
449
|
+
we,
|
|
445
450
|
{
|
|
446
451
|
axis: "y",
|
|
447
|
-
values:
|
|
448
|
-
onReorder:
|
|
449
|
-
className:
|
|
450
|
-
children:
|
|
452
|
+
values: R,
|
|
453
|
+
onReorder: fe,
|
|
454
|
+
className: m("space-y-0", q),
|
|
455
|
+
children: R.map((r, s) => de(r, s))
|
|
451
456
|
}
|
|
452
457
|
),
|
|
453
|
-
|
|
458
|
+
pe(Oe)
|
|
454
459
|
]
|
|
455
460
|
}
|
|
456
461
|
);
|
|
457
|
-
return
|
|
462
|
+
return J ? e : /* @__PURE__ */ t(Le.Provider, { value: E, children: e });
|
|
458
463
|
}
|
|
459
464
|
return /* @__PURE__ */ g("div", { className: "space-y-0 min-w-0", children: [
|
|
460
|
-
|
|
461
|
-
|
|
465
|
+
R.length > 0 && /* @__PURE__ */ t(
|
|
466
|
+
we,
|
|
462
467
|
{
|
|
463
468
|
axis: "y",
|
|
464
|
-
values:
|
|
465
|
-
onReorder:
|
|
466
|
-
className:
|
|
467
|
-
children:
|
|
469
|
+
values: R,
|
|
470
|
+
onReorder: fe,
|
|
471
|
+
className: m("space-y-0", q),
|
|
472
|
+
children: R.map((e, r) => de(e, r))
|
|
468
473
|
}
|
|
469
474
|
),
|
|
470
|
-
|
|
475
|
+
pe(!p)
|
|
471
476
|
] });
|
|
472
477
|
}
|
|
473
478
|
export {
|
|
474
|
-
|
|
475
|
-
|
|
479
|
+
Ue as ConditionGroup,
|
|
480
|
+
Ue as default
|
|
476
481
|
};
|