@nongt/visql 0.4.2 → 0.5.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/README.md +219 -718
- package/dist/MuiTimePicker-BjywwrRm.js +112 -0
- package/dist/{PipelineEditor-BoFPDUmi.js → PipelineEditor-Cx_c0xZL.js} +1426 -1422
- package/dist/{core-api-BRJV9MUQ.js → core-api-DzslKd1R.js} +437 -426
- package/dist/core.js +1 -1
- package/dist/index.js +3 -3
- package/dist/mui-date-pickers-host.js +20 -0
- package/dist/mui-date-pickers.js +14 -113
- package/dist/mui.js +161 -155
- package/dist/types/adapters/mui/MuiDatePicker.d.ts +2 -3
- package/dist/types/adapters/mui/QueryBuilder.d.ts +2 -2
- package/dist/types/adapters/mui/components.d.ts +2 -2
- package/dist/types/adapters/mui/hostPickers.d.ts +8 -0
- package/dist/types/adapters/mui/muiPickers.d.ts +6 -5
- package/dist/types/core/ui/index.d.ts +2 -2
- package/dist/types/core/ui/types.d.ts +5 -4
- package/dist/types/features/queryEditor/PipelineEditor.d.ts +1 -4
- package/dist/types/mui-date-pickers-host.d.ts +12 -0
- package/dist/types/mui-date-pickers.d.ts +12 -3
- package/package.json +33 -10
package/dist/mui.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as n, jsxs as P } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { P as
|
|
4
|
-
import
|
|
5
|
-
import { CacheProvider as
|
|
6
|
-
import { TextField as R, Menu as
|
|
7
|
-
import { createTheme as
|
|
8
|
-
import
|
|
9
|
-
import { Plus as
|
|
2
|
+
import { forwardRef as C, useMemo as _, useState as w, useRef as G, useLayoutEffect as K } from "react";
|
|
3
|
+
import { P as Q } from "./PipelineEditor-Cx_c0xZL.js";
|
|
4
|
+
import U from "@emotion/cache";
|
|
5
|
+
import { CacheProvider as J } from "@emotion/react";
|
|
6
|
+
import { TextField as R, Menu as X, ListSubheader as $, MenuItem as D, Box as y, createFilterOptions as Y, Autocomplete as j, Select as Z, InputBase as ee, Button as te, IconButton as oe, Tooltip as re, Chip as ne } from "@mui/material";
|
|
7
|
+
import { createTheme as ie, alpha as E, ThemeProvider as le } from "@mui/material/styles";
|
|
8
|
+
import ue from "clsx";
|
|
9
|
+
import { Plus as se } from "iconoir-react";
|
|
10
10
|
import { t as L } from "./tokens-BTaVMSOx.js";
|
|
11
|
-
import { i as
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
import { i as ce, f as ae } from "./calendarDate-CYlr9TvX.js";
|
|
12
|
+
function de(e, t) {
|
|
13
|
+
return ie({
|
|
14
14
|
palette: {
|
|
15
15
|
primary: { main: e.accent },
|
|
16
16
|
secondary: { main: e.secondary },
|
|
@@ -68,7 +68,7 @@ function ae(e, t) {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const q = {
|
|
72
72
|
"& .MuiOutlinedInput-root": {
|
|
73
73
|
borderTopLeftRadius: 0,
|
|
74
74
|
borderBottomLeftRadius: 0,
|
|
@@ -76,47 +76,51 @@ const j = {
|
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
let W;
|
|
79
|
-
function
|
|
79
|
+
function pe() {
|
|
80
80
|
if (!W) {
|
|
81
|
-
const e =
|
|
82
|
-
e.insert = (
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
const e = U({ key: "qb" }), t = e.insert.bind(e);
|
|
82
|
+
e.insert = (o, i, s, c) => t(
|
|
83
|
+
o,
|
|
84
|
+
i.styles.startsWith("@layer") ? i : { ...i, styles: `@layer qb-mui {${i.styles}}` },
|
|
85
85
|
s,
|
|
86
86
|
c
|
|
87
87
|
), W = e;
|
|
88
88
|
}
|
|
89
89
|
return W;
|
|
90
90
|
}
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
return /* @__PURE__ */ n(
|
|
94
|
-
}, me = ({ children: e, ...t }) => /* @__PURE__ */ n(
|
|
91
|
+
const fe = ({ tokens: e, fontFamily: t, children: o }) => {
|
|
92
|
+
const i = _(() => de(e, t), [e, t]);
|
|
93
|
+
return /* @__PURE__ */ n(J, { value: pe(), children: /* @__PURE__ */ n(le, { theme: i, children: o }) });
|
|
94
|
+
}, me = ({ children: e, ...t }) => /* @__PURE__ */ n(re, { disableInteractive: !0, ...t, children: e }), he = C(
|
|
95
|
+
({ children: e, ...t }, o) => /* @__PURE__ */ n(oe, { ref: o, ...t, children: e })
|
|
96
|
+
), xe = C(
|
|
97
|
+
({ children: e, ...t }, o) => /* @__PURE__ */ n(te, { ref: o, ...t, children: e })
|
|
98
|
+
), be = ({
|
|
95
99
|
value: e,
|
|
96
100
|
onChange: t,
|
|
97
|
-
onBlur:
|
|
98
|
-
type:
|
|
101
|
+
onBlur: o,
|
|
102
|
+
type: i,
|
|
99
103
|
placeholder: s,
|
|
100
104
|
className: c,
|
|
101
|
-
inputClassName:
|
|
102
|
-
grouped:
|
|
105
|
+
inputClassName: u,
|
|
106
|
+
grouped: f,
|
|
103
107
|
disabled: d,
|
|
104
108
|
readOnly: b,
|
|
105
109
|
inline: I,
|
|
106
|
-
maxLength:
|
|
110
|
+
maxLength: m
|
|
107
111
|
}) => I ? (
|
|
108
112
|
// No box: the editor's classes are all there is to it.
|
|
109
113
|
/* @__PURE__ */ n(
|
|
110
|
-
|
|
114
|
+
ee,
|
|
111
115
|
{
|
|
112
116
|
disabled: d,
|
|
113
117
|
className: c,
|
|
114
118
|
value: e,
|
|
115
119
|
onChange: t && ((h) => t(h.currentTarget.value)),
|
|
116
|
-
onBlur:
|
|
120
|
+
onBlur: o,
|
|
117
121
|
placeholder: s,
|
|
118
122
|
sx: { font: "inherit", color: "inherit" },
|
|
119
|
-
slotProps: { input: { className:
|
|
123
|
+
slotProps: { input: { className: u, readOnly: b, maxLength: m } }
|
|
120
124
|
}
|
|
121
125
|
)
|
|
122
126
|
) : /* @__PURE__ */ n(
|
|
@@ -124,75 +128,75 @@ const pe = ({ tokens: e, fontFamily: t, children: r }) => {
|
|
|
124
128
|
{
|
|
125
129
|
disabled: d,
|
|
126
130
|
className: c,
|
|
127
|
-
sx:
|
|
131
|
+
sx: f ? q : void 0,
|
|
128
132
|
value: e,
|
|
129
133
|
onChange: t && ((h) => t(h.currentTarget.value)),
|
|
130
|
-
onBlur:
|
|
131
|
-
type:
|
|
134
|
+
onBlur: o,
|
|
135
|
+
type: i,
|
|
132
136
|
placeholder: s,
|
|
133
137
|
slotProps: {
|
|
134
138
|
htmlInput: {
|
|
135
|
-
className:
|
|
139
|
+
className: u,
|
|
136
140
|
readOnly: b,
|
|
137
|
-
maxLength:
|
|
138
|
-
...
|
|
141
|
+
maxLength: m,
|
|
142
|
+
...i === "number" ? { inputMode: "numeric" } : {}
|
|
139
143
|
}
|
|
140
144
|
}
|
|
141
145
|
}
|
|
142
|
-
),
|
|
146
|
+
), Ie = ({
|
|
143
147
|
value: e,
|
|
144
148
|
options: t,
|
|
145
|
-
onChange:
|
|
146
|
-
density:
|
|
149
|
+
onChange: o,
|
|
150
|
+
density: i = "normal",
|
|
147
151
|
className: s,
|
|
148
152
|
grouped: c,
|
|
149
|
-
disabled:
|
|
153
|
+
disabled: u
|
|
150
154
|
}) => {
|
|
151
|
-
const
|
|
155
|
+
const f = i === "compact";
|
|
152
156
|
return /* @__PURE__ */ n(
|
|
153
|
-
|
|
157
|
+
Z,
|
|
154
158
|
{
|
|
155
159
|
className: s,
|
|
156
|
-
disabled:
|
|
160
|
+
disabled: u,
|
|
157
161
|
value: e,
|
|
158
|
-
size:
|
|
159
|
-
onChange: (d) =>
|
|
162
|
+
size: f ? "small" : void 0,
|
|
163
|
+
onChange: (d) => o(d.target.value),
|
|
160
164
|
sx: {
|
|
161
165
|
...c ? { borderTopLeftRadius: 0, borderBottomLeftRadius: 0, height: 38 } : {},
|
|
162
|
-
...
|
|
166
|
+
...f ? { fontSize: "0.75rem", height: 26, ".MuiSelect-select": { py: 0.25 } } : {}
|
|
163
167
|
},
|
|
164
168
|
children: t.map((d) => /* @__PURE__ */ n(
|
|
165
|
-
|
|
169
|
+
D,
|
|
166
170
|
{
|
|
167
171
|
value: d.value,
|
|
168
|
-
dense:
|
|
169
|
-
sx:
|
|
172
|
+
dense: f,
|
|
173
|
+
sx: f ? { fontSize: "0.75rem" } : void 0,
|
|
170
174
|
children: d.label
|
|
171
175
|
},
|
|
172
176
|
d.value
|
|
173
177
|
))
|
|
174
178
|
}
|
|
175
179
|
);
|
|
176
|
-
},
|
|
180
|
+
}, Me = ({
|
|
177
181
|
value: e,
|
|
178
182
|
onChange: t,
|
|
179
|
-
className:
|
|
180
|
-
grouped:
|
|
183
|
+
className: o,
|
|
184
|
+
grouped: i,
|
|
181
185
|
disabled: s
|
|
182
186
|
}) => /* @__PURE__ */ n(
|
|
183
187
|
R,
|
|
184
188
|
{
|
|
185
189
|
type: "date",
|
|
186
190
|
disabled: s,
|
|
187
|
-
className:
|
|
188
|
-
sx:
|
|
189
|
-
value: e ?
|
|
190
|
-
onChange: (c) => t == null ? void 0 : t(
|
|
191
|
+
className: o,
|
|
192
|
+
sx: i ? q : void 0,
|
|
193
|
+
value: e ? ce(e) : "",
|
|
194
|
+
onChange: (c) => t == null ? void 0 : t(ae(c.currentTarget.value))
|
|
191
195
|
}
|
|
192
|
-
),
|
|
196
|
+
), ge = { input: "input", clear: "clear" }, ye = {
|
|
193
197
|
paper: { className: "w-fit" },
|
|
194
198
|
popper: { sx: { minWidth: "max-content" } }
|
|
195
|
-
},
|
|
199
|
+
}, V = {
|
|
196
200
|
fontWeight: 700,
|
|
197
201
|
lineHeight: "32px",
|
|
198
202
|
borderTop: 1,
|
|
@@ -204,7 +208,7 @@ const pe = ({ tokens: e, fontFamily: t, children: r }) => {
|
|
|
204
208
|
const t = E(e.text.primary, 0.04);
|
|
205
209
|
return `linear-gradient(${t}, ${t})`;
|
|
206
210
|
}
|
|
207
|
-
},
|
|
211
|
+
}, Se = { ...V, top: -8, whiteSpace: "nowrap" }, ve = {
|
|
208
212
|
borderTop: 1,
|
|
209
213
|
borderColor: "divider",
|
|
210
214
|
color: "primary.main",
|
|
@@ -212,19 +216,19 @@ const pe = ({ tokens: e, fontFamily: t, children: r }) => {
|
|
|
212
216
|
gap: 1,
|
|
213
217
|
whiteSpace: "nowrap"
|
|
214
218
|
};
|
|
215
|
-
function
|
|
219
|
+
function Oe({
|
|
216
220
|
options: e,
|
|
217
221
|
value: t,
|
|
218
|
-
onChange:
|
|
219
|
-
inputValue:
|
|
222
|
+
onChange: o,
|
|
223
|
+
inputValue: i,
|
|
220
224
|
onInputChange: s,
|
|
221
225
|
getOptionLabel: c,
|
|
222
|
-
getOptionKey:
|
|
223
|
-
searchText:
|
|
226
|
+
getOptionKey: u,
|
|
227
|
+
searchText: f,
|
|
224
228
|
groupBy: d,
|
|
225
229
|
groupTone: b,
|
|
226
230
|
freeSolo: I,
|
|
227
|
-
isAction:
|
|
231
|
+
isAction: m,
|
|
228
232
|
label: h,
|
|
229
233
|
placeholder: S,
|
|
230
234
|
noOptionsText: v,
|
|
@@ -232,74 +236,74 @@ function ve({
|
|
|
232
236
|
className: k,
|
|
233
237
|
inputClassName: O,
|
|
234
238
|
grouped: B,
|
|
235
|
-
appearance:
|
|
236
|
-
disabled:
|
|
239
|
+
appearance: N = "light",
|
|
240
|
+
disabled: l,
|
|
237
241
|
autoFocus: a
|
|
238
242
|
}) {
|
|
239
|
-
const p = (
|
|
243
|
+
const p = (r) => typeof r == "string" || !c ? String(r) : c(r), F = (r) => typeof r == "string" || !u ? p(r) : u(r), H = N === "dark", A = Y(f ? { stringify: f } : {});
|
|
240
244
|
return /* @__PURE__ */ n(
|
|
241
|
-
|
|
245
|
+
j,
|
|
242
246
|
{
|
|
243
|
-
filterOptions: (
|
|
244
|
-
const M =
|
|
245
|
-
return
|
|
247
|
+
filterOptions: (r, x) => {
|
|
248
|
+
const M = r.some((T) => p(T).toLowerCase() === x.inputValue.toLowerCase()) ? r : A(r, x);
|
|
249
|
+
return m ? r.filter((T) => m(T) || M.includes(T)) : M;
|
|
246
250
|
},
|
|
247
251
|
className: k,
|
|
248
|
-
disabled:
|
|
252
|
+
disabled: l,
|
|
249
253
|
openOnFocus: a,
|
|
250
254
|
freeSolo: I,
|
|
251
255
|
...v === void 0 ? {} : { noOptionsText: v },
|
|
252
256
|
forcePopupIcon: I && e.length > 0 ? !0 : "auto",
|
|
253
257
|
options: e,
|
|
254
258
|
value: t,
|
|
255
|
-
onChange:
|
|
256
|
-
inputValue:
|
|
257
|
-
onInputChange: s && ((
|
|
259
|
+
onChange: o && ((r, x) => o(x)),
|
|
260
|
+
inputValue: i,
|
|
261
|
+
onInputChange: s && ((r, x, M) => s(x, ge[M] ?? "reset")),
|
|
258
262
|
getOptionLabel: p,
|
|
259
263
|
getOptionKey: F,
|
|
260
264
|
groupBy: d,
|
|
261
|
-
renderGroup: (
|
|
262
|
-
|
|
263
|
-
|
|
265
|
+
renderGroup: (r) => /* @__PURE__ */ P("li", { children: [
|
|
266
|
+
r.group !== "" && /* @__PURE__ */ n(
|
|
267
|
+
$,
|
|
264
268
|
{
|
|
265
269
|
component: "div",
|
|
266
270
|
sx: {
|
|
267
|
-
...
|
|
268
|
-
...(b == null ? void 0 : b(
|
|
271
|
+
...Se,
|
|
272
|
+
...(b == null ? void 0 : b(r.group)) === "accent" ? { color: "primary.main" } : {}
|
|
269
273
|
},
|
|
270
|
-
children:
|
|
274
|
+
children: r.group
|
|
271
275
|
}
|
|
272
276
|
),
|
|
273
|
-
/* @__PURE__ */ n(y, { component: "ul", sx: { p: 0 }, children:
|
|
274
|
-
] },
|
|
275
|
-
renderOption: ({ key:
|
|
276
|
-
/* @__PURE__ */ n(
|
|
277
|
+
/* @__PURE__ */ n(y, { component: "ul", sx: { p: 0 }, children: r.children })
|
|
278
|
+
] }, r.key),
|
|
279
|
+
renderOption: ({ key: r, ...x }, M) => m != null && m(M) ? /* @__PURE__ */ P(y, { component: "li", ...x, sx: ve, children: [
|
|
280
|
+
/* @__PURE__ */ n(se, { width: 14, height: 14, strokeWidth: 2.2 }),
|
|
277
281
|
p(M)
|
|
278
|
-
] },
|
|
279
|
-
slotProps:
|
|
282
|
+
] }, r) : /* @__PURE__ */ n("li", { ...x, className: ue(x.className, "text-nowrap"), children: p(M) }, r),
|
|
283
|
+
slotProps: ye,
|
|
280
284
|
sx: {
|
|
281
285
|
...B ? {
|
|
282
286
|
"& .MuiOutlinedInput-root": { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }
|
|
283
287
|
} : {},
|
|
284
|
-
...
|
|
288
|
+
...H ? {
|
|
285
289
|
"& .MuiAutocomplete-popupIndicator": { color: L("nodeInputIcon") },
|
|
286
290
|
"& .MuiAutocomplete-clearIndicator": { color: L("nodeInputIcon") }
|
|
287
291
|
} : {}
|
|
288
292
|
},
|
|
289
|
-
renderInput: (
|
|
293
|
+
renderInput: (r) => /* @__PURE__ */ n(
|
|
290
294
|
R,
|
|
291
295
|
{
|
|
292
|
-
...
|
|
296
|
+
...r,
|
|
293
297
|
label: h,
|
|
294
298
|
placeholder: S,
|
|
295
299
|
autoFocus: a,
|
|
296
300
|
slotProps: {
|
|
297
|
-
input:
|
|
301
|
+
input: r.InputProps,
|
|
298
302
|
// A given inputClassName replaces MUI's own input class (callers
|
|
299
303
|
// that size the input themselves also set its padding); without
|
|
300
304
|
// one, MUI's styling stays as is.
|
|
301
305
|
htmlInput: {
|
|
302
|
-
...
|
|
306
|
+
...r.inputProps,
|
|
303
307
|
...O ? { className: O } : {},
|
|
304
308
|
maxLength: g
|
|
305
309
|
}
|
|
@@ -312,7 +316,7 @@ function ve({
|
|
|
312
316
|
transform: "translate(15px, -6px) scale(0.75)"
|
|
313
317
|
}
|
|
314
318
|
} : {},
|
|
315
|
-
...
|
|
319
|
+
...H ? {
|
|
316
320
|
"& .MuiInputBase-root": {
|
|
317
321
|
bgcolor: "transparent",
|
|
318
322
|
color: L("nodeInputText")
|
|
@@ -325,77 +329,77 @@ function ve({
|
|
|
325
329
|
}
|
|
326
330
|
);
|
|
327
331
|
}
|
|
328
|
-
const
|
|
332
|
+
const Pe = { danger: "error.main", warning: "warning.main" }, Be = { ...V, top: 0 }, Te = ({
|
|
329
333
|
anchorEl: e,
|
|
330
334
|
open: t,
|
|
331
|
-
onClose:
|
|
332
|
-
sections:
|
|
333
|
-
}) => /* @__PURE__ */ n(
|
|
334
|
-
...s.title ? [/* @__PURE__ */ n(
|
|
335
|
-
...s.items.map((
|
|
336
|
-
|
|
335
|
+
onClose: o,
|
|
336
|
+
sections: i
|
|
337
|
+
}) => /* @__PURE__ */ n(X, { anchorEl: e, open: t, onClose: o, children: i.flatMap((s, c) => [
|
|
338
|
+
...s.title ? [/* @__PURE__ */ n($, { sx: Be, children: s.title }, `section-${c}`)] : [],
|
|
339
|
+
...s.items.map((u) => /* @__PURE__ */ P(
|
|
340
|
+
D,
|
|
337
341
|
{
|
|
338
342
|
dense: !0,
|
|
339
|
-
selected:
|
|
340
|
-
disabled:
|
|
341
|
-
onClick:
|
|
343
|
+
selected: u.selected,
|
|
344
|
+
disabled: u.disabled,
|
|
345
|
+
onClick: u.onClick,
|
|
342
346
|
sx: { pl: 2, gap: 1, alignItems: "flex-start" },
|
|
343
347
|
children: [
|
|
344
|
-
|
|
348
|
+
u.icon && /* @__PURE__ */ n(
|
|
345
349
|
y,
|
|
346
350
|
{
|
|
347
351
|
component: "span",
|
|
348
352
|
sx: {
|
|
349
353
|
display: "flex",
|
|
350
354
|
pt: "2px",
|
|
351
|
-
color:
|
|
355
|
+
color: u.tone && Pe[u.tone]
|
|
352
356
|
},
|
|
353
|
-
children:
|
|
357
|
+
children: u.icon
|
|
354
358
|
}
|
|
355
359
|
),
|
|
356
360
|
/* @__PURE__ */ P(y, { component: "span", sx: { display: "flex", flexDirection: "column" }, children: [
|
|
357
|
-
|
|
358
|
-
|
|
361
|
+
u.label,
|
|
362
|
+
u.detail && /* @__PURE__ */ n(y, { component: "span", sx: { fontSize: "0.7rem", color: "text.secondary" }, children: u.detail })
|
|
359
363
|
] })
|
|
360
364
|
]
|
|
361
365
|
},
|
|
362
|
-
|
|
366
|
+
u.key
|
|
363
367
|
))
|
|
364
368
|
]) }), z = 38;
|
|
365
|
-
function
|
|
369
|
+
function we({
|
|
366
370
|
items: e,
|
|
367
371
|
options: t,
|
|
368
|
-
onChange:
|
|
369
|
-
canAdd:
|
|
372
|
+
onChange: o,
|
|
373
|
+
canAdd: i,
|
|
370
374
|
placeholder: s,
|
|
371
375
|
maxLength: c,
|
|
372
|
-
className:
|
|
373
|
-
grouped:
|
|
376
|
+
className: u,
|
|
377
|
+
grouped: f,
|
|
374
378
|
disabled: d
|
|
375
379
|
}) {
|
|
376
|
-
const [b, I] = w(""), [
|
|
377
|
-
|
|
380
|
+
const [b, I] = w(""), [m, h] = w(!1), [S, v] = w(!1), [g, k] = w(0), O = G(null);
|
|
381
|
+
K(() => {
|
|
378
382
|
var p;
|
|
379
|
-
const
|
|
380
|
-
k(S ? 0 :
|
|
383
|
+
const l = [...O.current.querySelectorAll(".MuiAutocomplete-tag")], a = ((p = l[0]) == null ? void 0 : p.offsetTop) ?? 0;
|
|
384
|
+
k(S ? 0 : l.filter((F) => F.offsetTop > a + 4).length);
|
|
381
385
|
}, [e, S, g]);
|
|
382
|
-
const B = (
|
|
386
|
+
const B = (l) => i && !i(l) ? !1 : (I(""), o == null || o([...e, l]), !0);
|
|
383
387
|
return /* @__PURE__ */ P(
|
|
384
388
|
y,
|
|
385
389
|
{
|
|
386
390
|
ref: O,
|
|
387
|
-
className:
|
|
391
|
+
className: u,
|
|
388
392
|
sx: { position: "relative", display: "inline-flex" },
|
|
389
393
|
onFocus: () => v(!0),
|
|
390
|
-
onBlur: (
|
|
391
|
-
if (
|
|
394
|
+
onBlur: (l) => {
|
|
395
|
+
if (l.currentTarget.contains(l.relatedTarget)) return;
|
|
392
396
|
v(!1);
|
|
393
397
|
const a = b.trim();
|
|
394
398
|
a !== "" && !B(a) && I(""), h(!1);
|
|
395
399
|
},
|
|
396
400
|
children: [
|
|
397
401
|
/* @__PURE__ */ n(
|
|
398
|
-
|
|
402
|
+
j,
|
|
399
403
|
{
|
|
400
404
|
multiple: !0,
|
|
401
405
|
freeSolo: !t,
|
|
@@ -405,19 +409,19 @@ function Te({
|
|
|
405
409
|
options: t ?? [],
|
|
406
410
|
value: e,
|
|
407
411
|
inputValue: b,
|
|
408
|
-
onInputChange: (
|
|
412
|
+
onInputChange: (l, a, p) => {
|
|
409
413
|
p === "input" && (h(!1), I(a));
|
|
410
414
|
},
|
|
411
|
-
onChange: (
|
|
415
|
+
onChange: (l, a, p) => {
|
|
412
416
|
if (p === "createOption") {
|
|
413
417
|
h(!B(String(a[a.length - 1]).trim()));
|
|
414
418
|
return;
|
|
415
419
|
}
|
|
416
|
-
I(""),
|
|
420
|
+
I(""), o == null || o(a);
|
|
417
421
|
},
|
|
418
|
-
getOptionLabel: (
|
|
419
|
-
getOptionKey: (
|
|
420
|
-
isOptionEqualToValue: (
|
|
422
|
+
getOptionLabel: (l) => l.label,
|
|
423
|
+
getOptionKey: (l) => l.key,
|
|
424
|
+
isOptionEqualToValue: (l, a) => l.key === a.key,
|
|
421
425
|
filterSelectedOptions: !0,
|
|
422
426
|
slotProps: {
|
|
423
427
|
paper: { className: "w-fit" },
|
|
@@ -432,7 +436,7 @@ function Te({
|
|
|
432
436
|
minHeight: z,
|
|
433
437
|
// A row of chips (24px, 2px margins) fills the 38px exactly.
|
|
434
438
|
py: "5px",
|
|
435
|
-
...
|
|
439
|
+
...f ? { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } : {},
|
|
436
440
|
// Collapsed: one row, room on the right for the `+N`. Clipped,
|
|
437
441
|
// not hidden: an overflow-hidden box can still be scrolled, and
|
|
438
442
|
// focusing the input (rows down) scrolls it — left that way once
|
|
@@ -451,22 +455,22 @@ function Te({
|
|
|
451
455
|
}
|
|
452
456
|
}
|
|
453
457
|
},
|
|
454
|
-
renderInput: (
|
|
458
|
+
renderInput: (l) => /* @__PURE__ */ n(
|
|
455
459
|
R,
|
|
456
460
|
{
|
|
457
|
-
...
|
|
458
|
-
error:
|
|
461
|
+
...l,
|
|
462
|
+
error: m,
|
|
459
463
|
placeholder: e.length ? void 0 : s,
|
|
460
464
|
slotProps: {
|
|
461
|
-
input:
|
|
462
|
-
htmlInput: { ...
|
|
465
|
+
input: l.InputProps,
|
|
466
|
+
htmlInput: { ...l.inputProps, maxLength: c }
|
|
463
467
|
}
|
|
464
468
|
}
|
|
465
469
|
)
|
|
466
470
|
}
|
|
467
471
|
),
|
|
468
472
|
g > 0 && /* @__PURE__ */ n(
|
|
469
|
-
|
|
473
|
+
ne,
|
|
470
474
|
{
|
|
471
475
|
"data-testid": "list-more",
|
|
472
476
|
size: "small",
|
|
@@ -483,28 +487,30 @@ function Te({
|
|
|
483
487
|
}
|
|
484
488
|
);
|
|
485
489
|
}
|
|
486
|
-
const
|
|
487
|
-
Provider:
|
|
490
|
+
const Le = {
|
|
491
|
+
Provider: fe,
|
|
488
492
|
Tooltip: me,
|
|
489
|
-
IconButton:
|
|
490
|
-
Button:
|
|
491
|
-
TextField:
|
|
492
|
-
Select:
|
|
493
|
-
Combobox:
|
|
494
|
-
Menu:
|
|
493
|
+
IconButton: he,
|
|
494
|
+
Button: xe,
|
|
495
|
+
TextField: be,
|
|
496
|
+
Select: Ie,
|
|
497
|
+
Combobox: Oe,
|
|
498
|
+
Menu: Te,
|
|
495
499
|
// A light native-date field; the MUI X picker is an opt-in (MuiDatePicker,
|
|
496
500
|
// `@nongt/visql/mui-date-pickers`) so this kit doesn't need MUI X/date-fns.
|
|
497
|
-
DatePicker:
|
|
501
|
+
DatePicker: Me,
|
|
498
502
|
// IN's values: an Autocomplete of chips (plain @mui/material).
|
|
499
|
-
ListInput:
|
|
500
|
-
},
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
};
|
|
503
|
+
ListInput: we
|
|
504
|
+
}, De = C(
|
|
505
|
+
({ components: e, ...t }, o) => {
|
|
506
|
+
const i = _(
|
|
507
|
+
() => ({ ...Le, ...e }),
|
|
508
|
+
[e]
|
|
509
|
+
);
|
|
510
|
+
return /* @__PURE__ */ n(Q, { ...t, ref: o, components: i });
|
|
511
|
+
}
|
|
512
|
+
);
|
|
507
513
|
export {
|
|
508
|
-
|
|
509
|
-
|
|
514
|
+
De as QueryBuilder,
|
|
515
|
+
Le as muiComponents
|
|
510
516
|
};
|
|
@@ -5,8 +5,7 @@ import type { DatePickerProps } from '../../core/ui/types.js';
|
|
|
5
5
|
*
|
|
6
6
|
* <QueryBuilder components={{ DatePicker: MuiDatePicker }} />
|
|
7
7
|
*
|
|
8
|
-
* Needs
|
|
9
|
-
*
|
|
10
|
-
* one. */
|
|
8
|
+
* Needs a LocalizationProvider above it: the entries wrap it in one (see
|
|
9
|
+
* muiPickers.tsx, hostPickers.tsx). */
|
|
11
10
|
declare const MuiDatePicker: ({ className, grouped, value, onChange, disabled, }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export default MuiDatePicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UIComponents } from '../../core/ui/types.js';
|
|
2
|
-
import { type PipelineEditorProps } from '../../features/queryEditor/PipelineEditor.js';
|
|
2
|
+
import { type PipelineEditorHandle, type PipelineEditorProps } from '../../features/queryEditor/PipelineEditor.js';
|
|
3
3
|
export interface MuiQueryBuilderProps extends Omit<PipelineEditorProps, 'components'> {
|
|
4
4
|
/** Override single UI primitives; everything else is the MUI kit. */
|
|
5
5
|
components?: Partial<UIComponents>;
|
|
@@ -8,5 +8,5 @@ export interface MuiQueryBuilderProps extends Omit<PipelineEditorProps, 'compone
|
|
|
8
8
|
* want. Needs @mui/material, @emotion/react, @emotion/styled and
|
|
9
9
|
* @emotion/cache installed (plus @mui/x-date-pickers and date-fns only when
|
|
10
10
|
* plugging in MuiDatePicker from `@nongt/visql/mui-date-pickers`). */
|
|
11
|
-
declare const QueryBuilder: (
|
|
11
|
+
declare const QueryBuilder: import("react").ForwardRefExoticComponent<MuiQueryBuilderProps & import("react").RefAttributes<PipelineEditorHandle>>;
|
|
12
12
|
export default QueryBuilder;
|
|
@@ -3,8 +3,8 @@ import type { ButtonProps, ComboboxProps, DatePickerProps, IconButtonProps, Menu
|
|
|
3
3
|
* up: the editor's emotion cache and theme (built from the color tokens). */
|
|
4
4
|
export declare const MuiProvider: ({ tokens, fontFamily, children }: UIProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare const MuiTooltip: ({ children, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare const MuiIconButton: (
|
|
7
|
-
export declare const MuiButton: (
|
|
6
|
+
export declare const MuiIconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare const MuiButton: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
export declare const MuiTextField: ({ value, onChange, onBlur, type, placeholder, className, inputClassName, grouped, disabled, readOnly, inline, maxLength, }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare const MuiSelect: ({ value, options, onChange, density, className, grouped, disabled, }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
/** The kit's default date input: a plain MUI text field of type "date"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
|
+
/** `Picker`, which needs the app's LocalizationProvider above the editor:
|
|
3
|
+
* without one it throws, saying so. Its adapter must work with `Date`
|
|
4
|
+
* values (a date-fns one, any version). */
|
|
5
|
+
export default function withHostPickers<P extends object>(Picker: ComponentType<P>): {
|
|
6
|
+
(props: P): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
/** `
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
|
+
/** `Picker` with a date-fns adapter — or the host's LocalizationProvider
|
|
3
3
|
* (its locale and adapter) when there is one. */
|
|
4
|
-
export default function
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export default function withDateFns<P extends object>(Picker: ComponentType<P>): {
|
|
5
|
+
(props: P): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ButtonProps, ComboboxProps, DatePickerProps, DateTimePickerProps, TimePickerProps, IconButtonProps, ListInputProps, MenuProps, SelectProps, TextFieldProps, TooltipProps } from './types.js';
|
|
2
2
|
export declare const Tooltip: (props: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare const IconButton: (
|
|
4
|
-
export declare const Button: (
|
|
3
|
+
export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
export declare const TextField: (props: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const Select: (props: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function Combobox<T>(props: ComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
|