@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,24 +1,25 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Check as
|
|
4
|
-
import { today as
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as G, useRef as se, useCallback as q, useMemo as T, useEffect as Be } from "react";
|
|
3
|
+
import { Check as Oe, ChevronDown as oe, Calendar as me, Dataflow02 as pe, Variable as Ee, Table as je, Hash02 as Pe, Toggle01Left as Ae, List as _e, TypeSquare as $e, XClose as Ke } from "@untitledui/icons";
|
|
4
|
+
import { today as ze, getLocalTimeZone as De, CalendarDate as Re } from "@internationalized/date";
|
|
5
5
|
import { cx as l } from "../../utils/cn.js";
|
|
6
|
-
import { documentFieldsToTreeData as
|
|
7
|
-
import { Button as J, DialogTrigger as Y, Popover as
|
|
8
|
-
import { ControlledCalendarContextProvider as
|
|
9
|
-
import { createEllipsisContent as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
6
|
+
import { documentFieldsToTreeData as Ie, filterTreeBySearch as Ge, getExpandedIdsForTree as le, getExpandedIdsForSelectedField as He, TREE_CONFIG as Qe } from "./document-fields-to-tree.js";
|
|
7
|
+
import { Button as J, DialogTrigger as Y, Popover as ce } from "react-aria-components";
|
|
8
|
+
import { ControlledCalendarContextProvider as Ue, Calendar as Le } from "../../applications/date-picker/calendar.js";
|
|
9
|
+
import { createEllipsisContent as fe } from "../../primitives/tooltip/ellipsis-content.js";
|
|
10
|
+
import { Icon as We } from "../../primitives/icon/icon.js";
|
|
11
|
+
import Xe from "../../primitives/select/SearchInput.js";
|
|
12
|
+
import { TreeView as Ze } from "../tree-view/tree-view.js";
|
|
13
|
+
import { ButtonUtility as Je } from "../../primitives/button/button-utility.js";
|
|
14
|
+
import { Button as de } from "../../primitives/button/button.js";
|
|
15
|
+
function Ye(o) {
|
|
15
16
|
if (!o || typeof o != "string") return null;
|
|
16
17
|
const r = o.trim().match(/^(0?[1-9]|1[0-2])\/(0?[1-9]|[12]\d|3[01])\/(\d{1,4})$/);
|
|
17
18
|
if (!r) return null;
|
|
18
|
-
const [,
|
|
19
|
-
return new
|
|
19
|
+
const [, m, a, N] = r, x = parseInt(N, 10);
|
|
20
|
+
return new Re(x, parseInt(m, 10), parseInt(a, 10));
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function Me(o) {
|
|
22
23
|
return `${o.month}/${o.day}/${o.year}`;
|
|
23
24
|
}
|
|
24
25
|
const S = {
|
|
@@ -29,119 +30,119 @@ const S = {
|
|
|
29
30
|
sm: "size-4",
|
|
30
31
|
md: "size-5",
|
|
31
32
|
lg: "size-6"
|
|
32
|
-
},
|
|
33
|
+
}, ue = {
|
|
33
34
|
sm: { button: "p-2 h-8 text-xs rounded-md", item: "py-2 px-2.5 text-sm", search: "py-2 px-3 text-sm" },
|
|
34
35
|
md: { button: "py-2 px-3 h-9 text-sm rounded-md", item: "py-2.5 px-3 text-md", search: "py-2.5 px-3.5 text-md" },
|
|
35
36
|
lg: { button: "py-2.5 px-3.5 h-11 text-md rounded-lg", item: "py-3 px-4 text-lg", search: "py-3 px-4 text-lg" }
|
|
36
37
|
};
|
|
37
|
-
function
|
|
38
|
+
function he(o, r, m = []) {
|
|
38
39
|
if (r.length === 0) return null;
|
|
39
40
|
for (let a = 1; a <= r.length; a += 1) {
|
|
40
|
-
const N = r.slice(0, a).join("."),
|
|
41
|
-
if (!
|
|
41
|
+
const N = r.slice(0, a).join("."), x = o.find((f) => f.key === N);
|
|
42
|
+
if (!x) continue;
|
|
42
43
|
const d = r.slice(a);
|
|
43
|
-
if (d.length === 0) return { field:
|
|
44
|
-
if (
|
|
45
|
-
const f =
|
|
44
|
+
if (d.length === 0) return { field: x, ancestorLabels: m };
|
|
45
|
+
if (x.children) {
|
|
46
|
+
const f = he(x.children, d, [...m, x.label]);
|
|
46
47
|
if (f) return f;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
return null;
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function Ce({ type: o }) {
|
|
52
53
|
const r = (o || "").toLowerCase();
|
|
53
|
-
return r === "formula" ? /* @__PURE__ */
|
|
54
|
+
return r === "formula" ? /* @__PURE__ */ t(Ee, { className: "size-4 shrink-0 text-fg-quaternary", "aria-hidden": !0 }) : r === "document" ? /* @__PURE__ */ t(je, { className: "size-4 shrink-0 text-fg-quaternary", "aria-hidden": !0 }) : r === "date" ? /* @__PURE__ */ t(me, { className: "size-4 shrink-0 text-fg-quaternary", "aria-hidden": !0 }) : r === "number" || r === "integer" ? /* @__PURE__ */ t(Pe, { className: "size-4 shrink-0 text-fg-quaternary", "aria-hidden": !0 }) : r === "boolean" ? /* @__PURE__ */ t(Ae, { className: "size-4 shrink-0 text-fg-quaternary", "aria-hidden": !0 }) : r === "object" ? /* @__PURE__ */ t(pe, { className: "size-4 shrink-0 text-fg-quaternary", "aria-hidden": !0 }) : r === "list" ? /* @__PURE__ */ t(_e, { className: "size-4 shrink-0 text-fg-quaternary", "aria-hidden": !0 }) : /* @__PURE__ */ t($e, { className: "size-4 shrink-0 text-fg-quaternary", "aria-hidden": !0 });
|
|
54
55
|
}
|
|
55
|
-
const
|
|
56
|
+
const mt = ({
|
|
56
57
|
documentFields: o,
|
|
57
58
|
selectedFieldId: r,
|
|
58
|
-
onFieldSelect:
|
|
59
|
+
onFieldSelect: m,
|
|
59
60
|
size: a = "sm",
|
|
60
61
|
placeholder: N = "Select",
|
|
61
|
-
className:
|
|
62
|
+
className: x,
|
|
62
63
|
allowCustomValue: d = !1,
|
|
63
64
|
customValue: f = "",
|
|
64
|
-
onCustomValueChange:
|
|
65
|
+
onCustomValueChange: p,
|
|
65
66
|
valueMode: B = "static",
|
|
66
|
-
valueDataType:
|
|
67
|
+
valueDataType: xe,
|
|
67
68
|
onValueModeChange: P,
|
|
68
69
|
canSelectNode: b,
|
|
69
70
|
resolveSelectedLabel: A,
|
|
70
71
|
isInvalid: M = !1,
|
|
71
|
-
isClearable:
|
|
72
|
+
isClearable: ye = !1,
|
|
72
73
|
expandAllByDefault: C = !1,
|
|
73
74
|
openOnClear: F = !1,
|
|
74
|
-
onClear:
|
|
75
|
+
onClear: H,
|
|
75
76
|
isDisabled: i = !1
|
|
76
77
|
}) => {
|
|
77
|
-
const [
|
|
78
|
+
const [g, v] = G(!1), [O, Q] = G(""), [U, L] = G(null), [V, ee] = G(!1), _ = se(null), te = se(null), y = d && B === "field", W = d && B === "static" && xe === "date", ge = q(() => {
|
|
78
79
|
i || (v(B === "static"), P == null || P(B === "field" ? "static" : "field"));
|
|
79
80
|
}, [i, B, P, v]), X = T(() => {
|
|
80
81
|
if (!r) return null;
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
82
|
+
const e = A == null ? void 0 : A(r);
|
|
83
|
+
if (e) return e;
|
|
83
84
|
const n = o[r];
|
|
84
85
|
if (n) return n.label;
|
|
85
86
|
const s = r.split(".");
|
|
86
|
-
let
|
|
87
|
-
for (let
|
|
88
|
-
const
|
|
89
|
-
o[
|
|
87
|
+
let u = null, E = 0;
|
|
88
|
+
for (let I = 1; I <= s.length; I += 1) {
|
|
89
|
+
const ie = s.slice(0, I).join(".");
|
|
90
|
+
o[ie] && (u = ie, E = I);
|
|
90
91
|
}
|
|
91
|
-
if (!
|
|
92
|
-
const R = o[
|
|
92
|
+
if (!u) return r;
|
|
93
|
+
const R = o[u];
|
|
93
94
|
if (!R) return r;
|
|
94
95
|
if (E >= s.length) return R.label;
|
|
95
|
-
const Z =
|
|
96
|
+
const Z = he(R.fields, s.slice(E));
|
|
96
97
|
return Z ? [R.label, ...Z.ancestorLabels, Z.field.label].join(" > ") : r;
|
|
97
|
-
}, [r, o, A]), $ = T(() =>
|
|
98
|
-
(
|
|
99
|
-
if (b && !b(
|
|
100
|
-
const n =
|
|
98
|
+
}, [r, o, A]), $ = T(() => Ie(o), [o]), K = T(() => Ge($, O), [$, O]), Ne = T(() => O.trim() ? le(K) : C ? le($) : He(r ?? ""), [O, K, C, $, r]), be = q(
|
|
99
|
+
(e) => {
|
|
100
|
+
if (b && !b(e)) return;
|
|
101
|
+
const n = e.id, s = n.split(".");
|
|
101
102
|
if (s.length < 1) return;
|
|
102
|
-
const
|
|
103
|
-
|
|
103
|
+
const u = s[0], E = s.length > 1 ? s.slice(1).join(".") : "";
|
|
104
|
+
m(n, u, E), v(!1), Q("");
|
|
104
105
|
},
|
|
105
|
-
[b,
|
|
106
|
+
[b, m]
|
|
106
107
|
), k = q(
|
|
107
|
-
(
|
|
108
|
-
i || (
|
|
108
|
+
(e) => {
|
|
109
|
+
i || (e && W && L(Ye(f) ?? ze(De())), v(e), e || Q(""));
|
|
109
110
|
},
|
|
110
111
|
[i, W, f]
|
|
111
112
|
);
|
|
112
|
-
|
|
113
|
-
if (!
|
|
114
|
-
const
|
|
113
|
+
Be(() => {
|
|
114
|
+
if (!g || !r || !_.current) return;
|
|
115
|
+
const e = _.current.querySelector(
|
|
115
116
|
`[data-tree-node-id="${CSS.escape(r)}"]`
|
|
116
117
|
);
|
|
117
|
-
if (!
|
|
118
|
+
if (!e) return;
|
|
118
119
|
const n = requestAnimationFrame(() => {
|
|
119
120
|
requestAnimationFrame(() => {
|
|
120
|
-
|
|
121
|
+
e.scrollIntoView({ block: "center", behavior: "auto" });
|
|
121
122
|
});
|
|
122
123
|
});
|
|
123
124
|
return () => cancelAnimationFrame(n);
|
|
124
|
-
}, [
|
|
125
|
-
const
|
|
126
|
-
(
|
|
127
|
-
|
|
125
|
+
}, [g, r]);
|
|
126
|
+
const h = T(() => !d || y ? X || "" : f || "", [d, y, f, X]), re = !!h, we = T(() => !d || y ? !!r : !!(f != null && f.trim()), [d, y, r, f]), w = ye && we && !i, ve = q(
|
|
127
|
+
(e) => {
|
|
128
|
+
e.preventDefault(), e.stopPropagation(), H ? H() : d ? y ? m("", "", "") : p == null || p("") : m("", "", ""), F && k(!0);
|
|
128
129
|
},
|
|
129
|
-
[
|
|
130
|
-
),
|
|
131
|
-
|
|
130
|
+
[H, d, y, m, p, F, k]
|
|
131
|
+
), z = w ? /* @__PURE__ */ t(
|
|
132
|
+
Je,
|
|
132
133
|
{
|
|
133
134
|
color: "tertiary",
|
|
134
135
|
size: "3xs",
|
|
135
|
-
icon: /* @__PURE__ */
|
|
136
|
+
icon: /* @__PURE__ */ t(Ke, { "aria-hidden": !0, className: j[a] }),
|
|
136
137
|
tabIndex: -1,
|
|
137
138
|
"aria-label": "Clear selection",
|
|
138
|
-
onClick:
|
|
139
|
+
onClick: ve,
|
|
139
140
|
className: "focus-visible:outline-offset-0"
|
|
140
141
|
}
|
|
141
|
-
) : null,
|
|
142
|
-
(
|
|
143
|
-
|
|
144
|
-
l("min-w-0 w-full", !
|
|
142
|
+
) : null, ne = "absolute right-7 top-1/2 z-10 -translate-y-1/2", D = q(
|
|
143
|
+
(e, n = re) => fe(
|
|
144
|
+
e,
|
|
145
|
+
l("min-w-0 w-full", !e && "text-placeholder_subtle"),
|
|
145
146
|
!1,
|
|
146
147
|
"start",
|
|
147
148
|
void 0,
|
|
@@ -149,15 +150,22 @@ const de = ({
|
|
|
149
150
|
l(n ? "text-primary font-medium" : "text-placeholder_subtle", S[a]),
|
|
150
151
|
"z-[100001]"
|
|
151
152
|
),
|
|
152
|
-
[
|
|
153
|
-
),
|
|
154
|
-
({ node:
|
|
155
|
-
var s;
|
|
156
|
-
const n = b ? b(
|
|
153
|
+
[re, N, a]
|
|
154
|
+
), ke = q(
|
|
155
|
+
({ node: e }) => {
|
|
156
|
+
var s, u;
|
|
157
|
+
const n = b ? b(e) : !0;
|
|
157
158
|
return /* @__PURE__ */ c("span", { className: l("flex items-center gap-2 min-w-0", !n && "opacity-70"), children: [
|
|
158
|
-
(s =
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
(s = e.metadata) != null && s.icon ? /* @__PURE__ */ t(e.metadata.icon, { className: "size-4 shrink-0 text-fg-quaternary", "aria-hidden": !0 }) : (u = e.metadata) != null && u.iconName ? /* @__PURE__ */ t(
|
|
160
|
+
We,
|
|
161
|
+
{
|
|
162
|
+
name: e.metadata.iconName,
|
|
163
|
+
size: 16,
|
|
164
|
+
className: "shrink-0 text-fg-quaternary"
|
|
165
|
+
}
|
|
166
|
+
) : /* @__PURE__ */ t(Ce, { type: e.type }),
|
|
167
|
+
/* @__PURE__ */ t("span", { className: l("min-w-0 flex-1", S[a]), children: fe(
|
|
168
|
+
e.label,
|
|
161
169
|
"min-w-0 w-full",
|
|
162
170
|
!1,
|
|
163
171
|
"start",
|
|
@@ -166,129 +174,129 @@ const de = ({
|
|
|
166
174
|
n ? "text-primary" : "text-tertiary",
|
|
167
175
|
"z-[100001]"
|
|
168
176
|
) }),
|
|
169
|
-
n && r ===
|
|
177
|
+
n && r === e.id && /* @__PURE__ */ t(Oe, { className: "size-4 shrink-0 text-brand-600", "aria-hidden": !0 })
|
|
170
178
|
] });
|
|
171
179
|
},
|
|
172
180
|
[b, r, a]
|
|
173
|
-
),
|
|
181
|
+
), qe = /* @__PURE__ */ c(
|
|
174
182
|
J,
|
|
175
183
|
{
|
|
176
184
|
isDisabled: i,
|
|
177
185
|
className: l(
|
|
178
186
|
"relative flex w-full min-w-0 cursor-pointer items-center gap-1 bg-primary ring ring-secondary outline-hidden transition duration-100 ease-linear ring-inset",
|
|
179
|
-
|
|
180
|
-
|
|
187
|
+
ue[a].button,
|
|
188
|
+
g && !i && "ring-1 ring-brand",
|
|
181
189
|
M && "!ring-2 !ring-error",
|
|
182
190
|
i && "cursor-not-allowed bg-disabled_subtle text-disabled"
|
|
183
191
|
),
|
|
184
192
|
children: [
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
w ? /* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
|
|
193
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 text-left", children: D(h) }),
|
|
194
|
+
w ? /* @__PURE__ */ t("span", { className: "w-7 shrink-0", "aria-hidden": !0 }) : null,
|
|
195
|
+
/* @__PURE__ */ t(
|
|
196
|
+
oe,
|
|
189
197
|
{
|
|
190
198
|
"aria-hidden": !0,
|
|
191
199
|
className: l(
|
|
192
200
|
"shrink-0 text-fg-quaternary transition-transform",
|
|
193
201
|
j[a],
|
|
194
|
-
|
|
202
|
+
g && "rotate-180"
|
|
195
203
|
)
|
|
196
204
|
}
|
|
197
205
|
)
|
|
198
206
|
]
|
|
199
207
|
}
|
|
200
|
-
),
|
|
208
|
+
), Te = /* @__PURE__ */ c(
|
|
201
209
|
"div",
|
|
202
210
|
{
|
|
203
211
|
className: "p-2 flex flex-col gap-2 flex-1 min-h-0 w-md",
|
|
204
|
-
onKeyDownCapture: (
|
|
205
|
-
var
|
|
206
|
-
if (
|
|
207
|
-
if (
|
|
208
|
-
|
|
212
|
+
onKeyDownCapture: (e) => {
|
|
213
|
+
var u;
|
|
214
|
+
if (e.nativeEvent.isComposing || !(e.target instanceof HTMLInputElement)) return;
|
|
215
|
+
if (e.key === "Escape") {
|
|
216
|
+
e.preventDefault(), e.stopPropagation(), k(!1);
|
|
209
217
|
return;
|
|
210
218
|
}
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
const n = (
|
|
219
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
220
|
+
e.preventDefault(), e.stopPropagation();
|
|
221
|
+
const n = (u = _.current) == null ? void 0 : u.querySelectorAll('[role="treeitem"]'), s = e.key === "ArrowDown" ? n == null ? void 0 : n[0] : n == null ? void 0 : n[n.length - 1];
|
|
214
222
|
s == null || s.focus({ preventScroll: !0 }), s == null || s.scrollIntoView({ block: "nearest", behavior: "instant" });
|
|
215
223
|
},
|
|
216
224
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
|
|
225
|
+
/* @__PURE__ */ t(
|
|
226
|
+
Xe,
|
|
219
227
|
{
|
|
220
228
|
size: a,
|
|
221
229
|
placeholder: "Search objects or fields",
|
|
222
230
|
value: O,
|
|
223
|
-
onChange: (
|
|
231
|
+
onChange: (e) => Q(e),
|
|
224
232
|
className: "ring-0 outline-hidden bg-secondary rounded-lg w-full",
|
|
225
233
|
autoFocus: !0
|
|
226
234
|
}
|
|
227
235
|
),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
|
|
236
|
+
/* @__PURE__ */ t("div", { ref: _, className: "overflow-y-auto flex-1 min-h-0 py-1", children: K.length > 0 ? /* @__PURE__ */ t(
|
|
237
|
+
Ze,
|
|
230
238
|
{
|
|
231
239
|
variant: "indented",
|
|
232
240
|
data: K,
|
|
233
|
-
config:
|
|
234
|
-
CustomNode:
|
|
235
|
-
onNodeClick:
|
|
236
|
-
defaultExpandedIds:
|
|
241
|
+
config: Qe,
|
|
242
|
+
CustomNode: ke,
|
|
243
|
+
onNodeClick: be,
|
|
244
|
+
defaultExpandedIds: Ne,
|
|
237
245
|
syncWithData: !0,
|
|
238
246
|
keyboardNavigation: !0,
|
|
239
247
|
selectedNodeId: r,
|
|
240
248
|
canSelectNode: b,
|
|
241
249
|
"aria-label": "Objects and fields"
|
|
242
250
|
}
|
|
243
|
-
) : /* @__PURE__ */
|
|
251
|
+
) : /* @__PURE__ */ t("div", { className: l("px-3 py-4 text-tertiary text-center", S[a]), children: "No results found" }) })
|
|
244
252
|
]
|
|
245
253
|
}
|
|
246
|
-
),
|
|
247
|
-
|
|
254
|
+
), ae = /* @__PURE__ */ t(
|
|
255
|
+
ce,
|
|
248
256
|
{
|
|
249
257
|
placement: "bottom start",
|
|
250
258
|
offset: 4,
|
|
251
|
-
className: ({ isEntering:
|
|
259
|
+
className: ({ isEntering: e, isExiting: n }) => l(
|
|
252
260
|
"max-w-[90vw] max-h-[min(380px,60vh)] overflow-hidden flex flex-col rounded-xl bg-primary shadow-lg ring-1 ring-secondary outline-hidden will-change-transform",
|
|
253
|
-
|
|
261
|
+
e && "duration-150 ease-out animate-in fade-in slide-in-from-top-1",
|
|
254
262
|
n && "duration-100 ease-in animate-out fade-out slide-out-to-top-1"
|
|
255
263
|
),
|
|
256
|
-
children:
|
|
264
|
+
children: Te
|
|
257
265
|
}
|
|
258
|
-
),
|
|
259
|
-
|
|
266
|
+
), Se = /* @__PURE__ */ c(
|
|
267
|
+
ce,
|
|
260
268
|
{
|
|
261
269
|
placement: "bottom start",
|
|
262
270
|
offset: 4,
|
|
263
|
-
className: ({ isEntering:
|
|
271
|
+
className: ({ isEntering: e, isExiting: n }) => l(
|
|
264
272
|
"rounded-xl bg-primary shadow-lg ring-1 ring-secondary outline-hidden will-change-transform max-h-[min(80vh,420px)] overflow-auto ",
|
|
265
|
-
|
|
273
|
+
e && "duration-150 ease-out animate-in fade-in slide-in-from-top-1",
|
|
266
274
|
n && "duration-100 ease-in animate-out fade-out slide-out-to-top-1"
|
|
267
275
|
),
|
|
268
276
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
|
|
277
|
+
/* @__PURE__ */ t("div", { className: "p-2", children: /* @__PURE__ */ t(
|
|
278
|
+
Ue,
|
|
271
279
|
{
|
|
272
280
|
value: U,
|
|
273
281
|
onlyNotifyOnGridSelect: !0,
|
|
274
|
-
onChange: (
|
|
275
|
-
|
|
282
|
+
onChange: (e) => {
|
|
283
|
+
e && L(e);
|
|
276
284
|
},
|
|
277
|
-
onSelect: (
|
|
278
|
-
L(
|
|
285
|
+
onSelect: (e) => {
|
|
286
|
+
L(e);
|
|
279
287
|
},
|
|
280
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ t(Le, { size: a, highlightedDates: [] })
|
|
281
289
|
}
|
|
282
290
|
) }),
|
|
283
291
|
/* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-3 border-t border-secondary px-4 py-3", children: [
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
|
|
292
|
+
/* @__PURE__ */ t(de, { size: a, color: "secondary", onClick: () => v(!1), children: "Cancel" }),
|
|
293
|
+
/* @__PURE__ */ t(
|
|
294
|
+
de,
|
|
287
295
|
{
|
|
288
296
|
size: a,
|
|
289
297
|
color: "primary",
|
|
290
298
|
onClick: () => {
|
|
291
|
-
U && (
|
|
299
|
+
U && (p == null || p(Me(U))), v(!1);
|
|
292
300
|
},
|
|
293
301
|
children: "Apply"
|
|
294
302
|
}
|
|
@@ -297,19 +305,19 @@ const de = ({
|
|
|
297
305
|
]
|
|
298
306
|
}
|
|
299
307
|
);
|
|
300
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ t("div", { className: l("relative", x), children: d ? /* @__PURE__ */ c(
|
|
301
309
|
"div",
|
|
302
310
|
{
|
|
303
311
|
className: l(
|
|
304
312
|
"relative flex w-full items-center bg-primary ring-1 ring-secondary transition duration-100 ease-linear ring-inset",
|
|
305
|
-
|
|
313
|
+
ue[a].button,
|
|
306
314
|
"p-0!",
|
|
307
315
|
M && "!ring-2 !ring-error",
|
|
308
316
|
i && "cursor-not-allowed bg-disabled_subtle text-disabled"
|
|
309
317
|
),
|
|
310
318
|
children: [
|
|
311
|
-
|
|
312
|
-
/* @__PURE__ */ c(Y, { isOpen: i ? !1 :
|
|
319
|
+
y ? /* @__PURE__ */ c("div", { className: "relative flex min-w-0 flex-1 items-stretch", children: [
|
|
320
|
+
/* @__PURE__ */ c(Y, { isOpen: i ? !1 : g, onOpenChange: k, children: [
|
|
313
321
|
/* @__PURE__ */ c(
|
|
314
322
|
J,
|
|
315
323
|
{
|
|
@@ -320,112 +328,112 @@ const de = ({
|
|
|
320
328
|
i && "cursor-not-allowed"
|
|
321
329
|
),
|
|
322
330
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
w ? /* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
|
|
331
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 text-left", children: D(h) }),
|
|
332
|
+
w ? /* @__PURE__ */ t("span", { className: "w-7 shrink-0", "aria-hidden": !0 }) : null,
|
|
333
|
+
/* @__PURE__ */ t(
|
|
334
|
+
oe,
|
|
327
335
|
{
|
|
328
336
|
"aria-hidden": !0,
|
|
329
337
|
className: l(
|
|
330
338
|
"shrink-0 text-fg-quaternary transition-transform",
|
|
331
339
|
j[a],
|
|
332
|
-
|
|
340
|
+
g && "rotate-180"
|
|
333
341
|
)
|
|
334
342
|
}
|
|
335
343
|
)
|
|
336
344
|
]
|
|
337
345
|
}
|
|
338
346
|
),
|
|
339
|
-
|
|
347
|
+
ae
|
|
340
348
|
] }),
|
|
341
|
-
w ? /* @__PURE__ */
|
|
349
|
+
w ? /* @__PURE__ */ t("div", { className: ne, children: z }) : null
|
|
342
350
|
] }) : W ? /* @__PURE__ */ c("div", { className: "relative flex flex-1 items-center min-w-0", children: [
|
|
343
|
-
/* @__PURE__ */ c(Y, { isOpen: i ? !1 :
|
|
351
|
+
/* @__PURE__ */ c(Y, { isOpen: i ? !1 : g, onOpenChange: k, children: [
|
|
344
352
|
/* @__PURE__ */ c(
|
|
345
353
|
J,
|
|
346
354
|
{
|
|
347
355
|
isDisabled: i,
|
|
348
356
|
className: l(
|
|
349
357
|
"flex flex-1 min-w-0 items-center gap-2 rounded-l-lg p-2 text-left outline-none cursor-pointer",
|
|
350
|
-
|
|
358
|
+
h && "pr-8",
|
|
351
359
|
S[a],
|
|
352
360
|
i && "cursor-not-allowed"
|
|
353
361
|
),
|
|
354
362
|
children: [
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
|
|
363
|
+
/* @__PURE__ */ t(
|
|
364
|
+
me,
|
|
357
365
|
{
|
|
358
366
|
"aria-hidden": !0,
|
|
359
367
|
className: l(j[a], "text-fg-quaternary shrink-0")
|
|
360
368
|
}
|
|
361
369
|
),
|
|
362
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 text-left", children: D(h) })
|
|
363
371
|
]
|
|
364
372
|
}
|
|
365
373
|
),
|
|
366
|
-
|
|
374
|
+
Se
|
|
367
375
|
] }),
|
|
368
|
-
w ? /* @__PURE__ */
|
|
376
|
+
w ? /* @__PURE__ */ t("div", { className: "absolute right-2 top-1/2 z-10 -translate-y-1/2", children: z }) : null
|
|
369
377
|
] }) : /* @__PURE__ */ c("div", { className: "relative flex min-w-0 flex-1 items-center", children: [
|
|
370
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ t(
|
|
371
379
|
"input",
|
|
372
380
|
{
|
|
373
|
-
ref:
|
|
381
|
+
ref: te,
|
|
374
382
|
type: "text",
|
|
375
|
-
value:
|
|
383
|
+
value: h,
|
|
376
384
|
disabled: i,
|
|
377
|
-
onChange: (
|
|
378
|
-
onFocus: () =>
|
|
379
|
-
onBlur: () =>
|
|
385
|
+
onChange: (e) => p == null ? void 0 : p(e.target.value),
|
|
386
|
+
onFocus: () => ee(!0),
|
|
387
|
+
onBlur: () => ee(!1),
|
|
380
388
|
placeholder: N,
|
|
381
389
|
className: l(
|
|
382
390
|
"min-w-0 flex-1 rounded-l-lg bg-transparent p-2 text-primary outline-none placeholder:text-placeholder_subtle",
|
|
383
|
-
|
|
384
|
-
|
|
391
|
+
h && !V && "text-transparent caret-primary",
|
|
392
|
+
h && "pr-8",
|
|
385
393
|
S[a],
|
|
386
394
|
i && "cursor-not-allowed text-disabled"
|
|
387
395
|
)
|
|
388
396
|
}
|
|
389
397
|
),
|
|
390
|
-
|
|
398
|
+
h && !V && /* @__PURE__ */ t(
|
|
391
399
|
"div",
|
|
392
400
|
{
|
|
393
401
|
className: "absolute inset-y-0 left-0 right-8 flex min-w-0 cursor-text items-center px-2",
|
|
394
|
-
onMouseDown: (
|
|
402
|
+
onMouseDown: (e) => {
|
|
395
403
|
var n;
|
|
396
|
-
|
|
404
|
+
e.preventDefault(), (n = te.current) == null || n.focus();
|
|
397
405
|
},
|
|
398
|
-
children: /* @__PURE__ */
|
|
406
|
+
children: /* @__PURE__ */ t("div", { className: "min-w-0 w-full", children: D(h) })
|
|
399
407
|
}
|
|
400
408
|
),
|
|
401
|
-
w ? /* @__PURE__ */
|
|
409
|
+
w ? /* @__PURE__ */ t("div", { className: "absolute right-2 top-1/2 z-10 -translate-y-1/2", children: z }) : null
|
|
402
410
|
] }),
|
|
403
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ t(
|
|
404
412
|
"button",
|
|
405
413
|
{
|
|
406
414
|
type: "button",
|
|
407
415
|
disabled: i,
|
|
408
|
-
onClick:
|
|
409
|
-
"aria-label":
|
|
416
|
+
onClick: ge,
|
|
417
|
+
"aria-label": y ? "Switch to free text mode" : "Switch to tree select mode",
|
|
410
418
|
className: l(
|
|
411
419
|
"p-2 shrink-0 rounded-r-md flex items-center justify-center transition-colors enabled:cursor-pointer",
|
|
412
|
-
|
|
420
|
+
y ? "ring-2 ring-brand ring-inset text-brand-600" : "border-l border-secondary text-fg-quaternary enabled:hover:text-fg-quaternary_hover",
|
|
413
421
|
i && "cursor-not-allowed text-disabled"
|
|
414
422
|
),
|
|
415
|
-
children: /* @__PURE__ */
|
|
423
|
+
children: /* @__PURE__ */ t(pe, { "aria-hidden": !0, className: j[a] })
|
|
416
424
|
}
|
|
417
425
|
)
|
|
418
426
|
]
|
|
419
427
|
}
|
|
420
428
|
) : /* @__PURE__ */ c("div", { className: "relative flex w-full min-w-0 items-stretch", children: [
|
|
421
|
-
/* @__PURE__ */ c(Y, { isOpen: i ? !1 :
|
|
422
|
-
|
|
423
|
-
|
|
429
|
+
/* @__PURE__ */ c(Y, { isOpen: i ? !1 : g, onOpenChange: k, children: [
|
|
430
|
+
qe,
|
|
431
|
+
ae
|
|
424
432
|
] }),
|
|
425
|
-
w ? /* @__PURE__ */
|
|
433
|
+
w ? /* @__PURE__ */ t("div", { className: ne, children: z }) : null
|
|
426
434
|
] }) });
|
|
427
435
|
};
|
|
428
436
|
export {
|
|
429
|
-
|
|
430
|
-
|
|
437
|
+
mt as NestedFieldSelect,
|
|
438
|
+
mt as default
|
|
431
439
|
};
|
|
@@ -33,6 +33,8 @@ export interface DocumentFieldDefinition {
|
|
|
33
33
|
children?: DocumentFieldDefinition[];
|
|
34
34
|
/** Rules-meta `structure_type` for document fields; absent on object fields and table columns. */
|
|
35
35
|
structureType?: string;
|
|
36
|
+
/** Design-system icon name (e.g. from the field's data type); overrides the `type` icon in field pickers. */
|
|
37
|
+
iconName?: string;
|
|
36
38
|
}
|
|
37
39
|
export interface DocumentDefinition {
|
|
38
40
|
label: string;
|
|
@@ -102,4 +104,6 @@ export declare const DEFAULT_OPERATORS: FilterOperator[];
|
|
|
102
104
|
export declare const generateId: () => string;
|
|
103
105
|
export declare const createEmptyCondition: (fields: FilterField[], operators?: FilterOperator[]) => FilterCondition;
|
|
104
106
|
export declare const createEmptyGroup: (operator?: FilterLogicalOperator) => FilterGroup;
|
|
107
|
+
/** The filter field type a document field type behaves like. Unknown types pass through unchanged. */
|
|
108
|
+
export declare function getBaseFilterFieldType(fieldType: string): FilterField["type"];
|
|
105
109
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/filter-group/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUrD,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,IAAI,CAAC;AAEjD,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC7G,+CAA+C;IAC/C,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4JAA4J;IAC5J,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,C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