@nongt/visql 0.6.1 → 0.7.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 +11 -1
- package/dist/{PipelineEditor-X83xfPeC.js → PipelineEditor-9-9xOJcB.js} +4046 -3906
- package/dist/{core-api-D4QbGLG-.js → core-api-BsEMnDQ1.js} +21 -21
- package/dist/core.js +3 -3
- package/dist/index.js +5 -5
- package/dist/{issueLocation-BcILIZqd.js → issueLocation-732-e0B8.js} +39 -36
- package/dist/mui.js +225 -207
- package/dist/{schema-z95dxLxu.js → schema-DFC26AhZ.js} +142 -126
- package/dist/sql-import.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/adapters/mui/components.d.ts +8 -1
- package/dist/types/core/i18n/defaultMessages.d.ts +2 -0
- package/dist/types/core/i18n/messages.d.ts +1 -0
- package/dist/types/core/schema.d.ts +19 -0
- package/dist/types/core/tablePickerOptions.d.ts +75 -0
- package/dist/types/core/ui/index.d.ts +6 -0
- package/dist/types/core/ui/types.d.ts +16 -0
- package/dist/types/core-api.d.ts +1 -1
- package/dist/types/features/queryEditor/PipelineEditor.d.ts +15 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/mui.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { P as
|
|
4
|
-
import
|
|
5
|
-
import { CacheProvider as
|
|
6
|
-
import { TextField as
|
|
7
|
-
import { createTheme as
|
|
8
|
-
import
|
|
9
|
-
import { Plus as
|
|
10
|
-
import { t as
|
|
11
|
-
import { i as
|
|
12
|
-
function
|
|
13
|
-
return
|
|
1
|
+
import { jsx as n, Fragment as ee, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as _, useContext as te, createContext as oe, useMemo as z, useState as L, useRef as re, useLayoutEffect as ne } from "react";
|
|
3
|
+
import { P as ie } from "./PipelineEditor-9-9xOJcB.js";
|
|
4
|
+
import le from "@emotion/cache";
|
|
5
|
+
import { CacheProvider as D, __unsafe_useEmotionCache as ue } from "@emotion/react";
|
|
6
|
+
import { TextField as C, Menu as se, ListSubheader as A, MenuItem as G, Box as g, createFilterOptions as ce, Autocomplete as K, Select as ae, InputBase as de, Button as pe, IconButton as me, Tooltip as fe, Chip as he } from "@mui/material";
|
|
7
|
+
import { createTheme as xe, alpha as H, ThemeProvider as Q, useTheme as be } from "@mui/material/styles";
|
|
8
|
+
import Me from "clsx";
|
|
9
|
+
import { Plus as Ie } from "iconoir-react";
|
|
10
|
+
import { t as R } from "./tokens-BTaVMSOx.js";
|
|
11
|
+
import { i as ye, f as ge } from "./calendarDate-CYlr9TvX.js";
|
|
12
|
+
function ve(e, t) {
|
|
13
|
+
return xe({
|
|
14
14
|
palette: {
|
|
15
15
|
primary: { main: e.accent },
|
|
16
16
|
secondary: { main: e.secondary },
|
|
@@ -60,7 +60,7 @@ function de(e, t) {
|
|
|
60
60
|
// Preserve the button's own color at 25% when disabled,
|
|
61
61
|
// instead of MUI's default flat gray.
|
|
62
62
|
"&.MuiIconButton-colorSecondary.Mui-disabled": {
|
|
63
|
-
color:
|
|
63
|
+
color: H(e.secondary, 0.25)
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -68,7 +68,7 @@ function de(e, t) {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const U = {
|
|
72
72
|
"& .MuiOutlinedInput-root": {
|
|
73
73
|
borderTopLeftRadius: 0,
|
|
74
74
|
borderBottomLeftRadius: 0,
|
|
@@ -76,139 +76,149 @@ const q = {
|
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
let W;
|
|
79
|
-
function
|
|
79
|
+
function Se() {
|
|
80
80
|
if (!W) {
|
|
81
|
-
const e =
|
|
82
|
-
e.insert = (o,
|
|
81
|
+
const e = le({ key: "qb" }), t = e.insert.bind(e);
|
|
82
|
+
e.insert = (o, u, s, c) => t(
|
|
83
83
|
o,
|
|
84
|
-
|
|
84
|
+
u.styles.startsWith("@layer") ? u : { ...u, styles: `@layer qb-mui {${u.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(J, { value:
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
),
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
const J = oe(void 0), Pe = ({ tokens: e, fontFamily: t, children: o }) => {
|
|
92
|
+
const u = z(() => ve(e, t), [e, t]), s = ue(), c = be(), i = z(() => ({ cache: s, theme: c }), [s, c]);
|
|
93
|
+
return /* @__PURE__ */ n(J.Provider, { value: i, children: /* @__PURE__ */ n(D, { value: Se(), children: /* @__PURE__ */ n(Q, { theme: u, children: o }) }) });
|
|
94
|
+
}, Te = ({ children: e }) => {
|
|
95
|
+
const t = te(J);
|
|
96
|
+
if (!t) return /* @__PURE__ */ n(ee, { children: e });
|
|
97
|
+
const o = /* @__PURE__ */ n(Q, { theme: t.theme, children: e });
|
|
98
|
+
return t.cache ? /* @__PURE__ */ n(D, { value: t.cache, children: o }) : o;
|
|
99
|
+
}, Be = ({ children: e, ...t }) => /* @__PURE__ */ n(fe, { disableInteractive: !0, ...t, children: e }), we = _(
|
|
100
|
+
({ children: e, ...t }, o) => /* @__PURE__ */ n(me, { ref: o, ...t, children: e })
|
|
101
|
+
), Oe = _(
|
|
102
|
+
({ children: e, ...t }, o) => /* @__PURE__ */ n(pe, { ref: o, ...t, children: e })
|
|
103
|
+
), Le = ({
|
|
99
104
|
value: e,
|
|
100
105
|
onChange: t,
|
|
101
106
|
onBlur: o,
|
|
102
|
-
type:
|
|
107
|
+
type: u,
|
|
103
108
|
placeholder: s,
|
|
104
109
|
className: c,
|
|
105
|
-
inputClassName:
|
|
106
|
-
grouped:
|
|
107
|
-
disabled:
|
|
110
|
+
inputClassName: i,
|
|
111
|
+
grouped: p,
|
|
112
|
+
disabled: a,
|
|
108
113
|
readOnly: b,
|
|
109
|
-
inline:
|
|
110
|
-
maxLength:
|
|
111
|
-
}) =>
|
|
114
|
+
inline: x,
|
|
115
|
+
maxLength: v
|
|
116
|
+
}) => x ? (
|
|
112
117
|
// No box: the editor's classes are all there is to it.
|
|
113
118
|
/* @__PURE__ */ n(
|
|
114
|
-
|
|
119
|
+
de,
|
|
115
120
|
{
|
|
116
|
-
disabled:
|
|
121
|
+
disabled: a,
|
|
117
122
|
className: c,
|
|
118
123
|
value: e,
|
|
119
|
-
onChange: t && ((
|
|
124
|
+
onChange: t && ((f) => t(f.currentTarget.value)),
|
|
120
125
|
onBlur: o,
|
|
121
126
|
placeholder: s,
|
|
122
127
|
sx: { font: "inherit", color: "inherit" },
|
|
123
|
-
slotProps: { input: { className:
|
|
128
|
+
slotProps: { input: { className: i, readOnly: b, maxLength: v } }
|
|
124
129
|
}
|
|
125
130
|
)
|
|
126
131
|
) : /* @__PURE__ */ n(
|
|
127
|
-
|
|
132
|
+
C,
|
|
128
133
|
{
|
|
129
|
-
disabled:
|
|
134
|
+
disabled: a,
|
|
130
135
|
className: c,
|
|
131
|
-
sx:
|
|
136
|
+
sx: p ? U : void 0,
|
|
132
137
|
value: e,
|
|
133
|
-
onChange: t && ((
|
|
138
|
+
onChange: t && ((f) => t(f.currentTarget.value)),
|
|
134
139
|
onBlur: o,
|
|
135
|
-
type:
|
|
140
|
+
type: u,
|
|
136
141
|
placeholder: s,
|
|
137
142
|
slotProps: {
|
|
138
143
|
htmlInput: {
|
|
139
|
-
className:
|
|
144
|
+
className: i,
|
|
140
145
|
readOnly: b,
|
|
141
|
-
maxLength:
|
|
142
|
-
...
|
|
146
|
+
maxLength: v,
|
|
147
|
+
...u === "number" ? { inputMode: "numeric" } : {}
|
|
143
148
|
}
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
|
-
),
|
|
151
|
+
), Re = ({
|
|
147
152
|
value: e,
|
|
148
153
|
options: t,
|
|
149
154
|
onChange: o,
|
|
150
|
-
density:
|
|
155
|
+
density: u = "normal",
|
|
151
156
|
className: s,
|
|
152
157
|
grouped: c,
|
|
153
|
-
disabled:
|
|
158
|
+
disabled: i
|
|
154
159
|
}) => {
|
|
155
|
-
const
|
|
160
|
+
const p = u === "compact";
|
|
156
161
|
return /* @__PURE__ */ n(
|
|
157
|
-
|
|
162
|
+
ae,
|
|
158
163
|
{
|
|
159
164
|
className: s,
|
|
160
|
-
disabled:
|
|
165
|
+
disabled: i,
|
|
161
166
|
value: e,
|
|
162
|
-
size:
|
|
163
|
-
onChange: (
|
|
167
|
+
size: p ? "small" : void 0,
|
|
168
|
+
onChange: (a) => o(a.target.value),
|
|
164
169
|
sx: {
|
|
165
170
|
...c ? { borderTopLeftRadius: 0, borderBottomLeftRadius: 0, height: 38 } : {},
|
|
166
|
-
...
|
|
171
|
+
...p ? { fontSize: "0.75rem", height: 26, ".MuiSelect-select": { py: 0.25 } } : {}
|
|
167
172
|
},
|
|
168
|
-
children: t.map((
|
|
169
|
-
|
|
173
|
+
children: t.map((a) => /* @__PURE__ */ n(
|
|
174
|
+
G,
|
|
170
175
|
{
|
|
171
|
-
value:
|
|
172
|
-
dense:
|
|
173
|
-
sx:
|
|
174
|
-
children:
|
|
176
|
+
value: a.value,
|
|
177
|
+
dense: p,
|
|
178
|
+
sx: p ? { fontSize: "0.75rem" } : void 0,
|
|
179
|
+
children: a.label
|
|
175
180
|
},
|
|
176
|
-
|
|
181
|
+
a.value
|
|
177
182
|
))
|
|
178
183
|
}
|
|
179
184
|
);
|
|
180
|
-
},
|
|
185
|
+
}, Ce = ({
|
|
181
186
|
value: e,
|
|
182
187
|
onChange: t,
|
|
183
188
|
className: o,
|
|
184
|
-
grouped:
|
|
189
|
+
grouped: u,
|
|
185
190
|
disabled: s
|
|
186
191
|
}) => /* @__PURE__ */ n(
|
|
187
|
-
|
|
192
|
+
C,
|
|
188
193
|
{
|
|
189
194
|
type: "date",
|
|
190
195
|
disabled: s,
|
|
191
196
|
className: o,
|
|
192
|
-
sx:
|
|
193
|
-
value: e ?
|
|
194
|
-
onChange: (c) => t == null ? void 0 : t(
|
|
197
|
+
sx: u ? U : void 0,
|
|
198
|
+
value: e ? ye(e) : "",
|
|
199
|
+
onChange: (c) => t == null ? void 0 : t(ge(c.currentTarget.value))
|
|
195
200
|
}
|
|
196
|
-
),
|
|
201
|
+
), Ee = { input: "input", clear: "clear" }, Fe = {
|
|
197
202
|
paper: { className: "w-fit" },
|
|
198
203
|
popper: { sx: { minWidth: "max-content" } }
|
|
199
|
-
},
|
|
204
|
+
}, X = {
|
|
200
205
|
fontWeight: 700,
|
|
201
206
|
lineHeight: "32px",
|
|
202
207
|
borderTop: 1,
|
|
203
208
|
borderBottom: 1,
|
|
204
|
-
borderColor: ({ palette: e }) =>
|
|
209
|
+
borderColor: ({ palette: e }) => H(e.text.primary, 0.07),
|
|
205
210
|
boxShadow: "0 3px 4px -3px rgba(0, 0, 0, 0.18)",
|
|
206
211
|
bgcolor: "background.paper",
|
|
207
212
|
backgroundImage: ({ palette: e }) => {
|
|
208
|
-
const t =
|
|
213
|
+
const t = H(e.text.primary, 0.04);
|
|
209
214
|
return `linear-gradient(${t}, ${t})`;
|
|
210
215
|
}
|
|
211
|
-
},
|
|
216
|
+
}, We = { ...X, top: -8, whiteSpace: "nowrap" }, ke = {
|
|
217
|
+
fontSize: "0.7rem",
|
|
218
|
+
color: "text.secondary",
|
|
219
|
+
whiteSpace: "normal",
|
|
220
|
+
maxWidth: 320
|
|
221
|
+
}, ze = {
|
|
212
222
|
borderTop: 1,
|
|
213
223
|
borderColor: "divider",
|
|
214
224
|
color: "primary.main",
|
|
@@ -216,87 +226,93 @@ const fe = ({ tokens: e, fontFamily: t, children: o }) => {
|
|
|
216
226
|
gap: 1,
|
|
217
227
|
whiteSpace: "nowrap"
|
|
218
228
|
};
|
|
219
|
-
function
|
|
229
|
+
function He({
|
|
220
230
|
options: e,
|
|
221
231
|
value: t,
|
|
222
232
|
onChange: o,
|
|
223
|
-
inputValue:
|
|
233
|
+
inputValue: u,
|
|
224
234
|
onInputChange: s,
|
|
225
235
|
getOptionLabel: c,
|
|
226
|
-
getOptionKey:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
getOptionKey: i,
|
|
237
|
+
getOptionDetail: p,
|
|
238
|
+
renderOption: a,
|
|
239
|
+
matches: b,
|
|
240
|
+
searchText: x,
|
|
241
|
+
groupBy: v,
|
|
242
|
+
groupTone: f,
|
|
243
|
+
freeSolo: S,
|
|
244
|
+
isAction: M,
|
|
245
|
+
label: I,
|
|
246
|
+
placeholder: E,
|
|
247
|
+
noOptionsText: w,
|
|
248
|
+
maxLength: O,
|
|
249
|
+
className: N,
|
|
250
|
+
inputClassName: l,
|
|
251
|
+
grouped: d,
|
|
252
|
+
appearance: y = "light",
|
|
253
|
+
disabled: F,
|
|
254
|
+
autoFocus: V
|
|
242
255
|
}) {
|
|
243
|
-
const
|
|
256
|
+
const P = (r) => typeof r == "string" || !c ? String(r) : c(r), Y = (r) => typeof r == "string" || !i ? P(r) : i(r), $ = (r) => p == null ? void 0 : p(r), j = y === "dark", Z = ce(x ? { stringify: x } : {});
|
|
244
257
|
return /* @__PURE__ */ n(
|
|
245
|
-
|
|
258
|
+
K,
|
|
246
259
|
{
|
|
247
|
-
filterOptions: (r,
|
|
248
|
-
const
|
|
249
|
-
return
|
|
260
|
+
filterOptions: (r, m) => {
|
|
261
|
+
const h = b && m.inputValue ? r.filter((T) => b(T, m.inputValue)) : Z(r, m), q = r.some((T) => P(T).toLowerCase() === m.inputValue.toLowerCase()) ? r : h;
|
|
262
|
+
return M ? r.filter((T) => M(T) || q.includes(T)) : q;
|
|
250
263
|
},
|
|
251
|
-
className:
|
|
252
|
-
disabled:
|
|
253
|
-
openOnFocus:
|
|
254
|
-
freeSolo:
|
|
255
|
-
...
|
|
256
|
-
forcePopupIcon:
|
|
264
|
+
className: N,
|
|
265
|
+
disabled: F,
|
|
266
|
+
openOnFocus: V,
|
|
267
|
+
freeSolo: S,
|
|
268
|
+
...w === void 0 ? {} : { noOptionsText: w },
|
|
269
|
+
forcePopupIcon: S && e.length > 0 ? !0 : "auto",
|
|
257
270
|
options: e,
|
|
258
271
|
value: t,
|
|
259
|
-
onChange: o && ((r,
|
|
260
|
-
inputValue:
|
|
261
|
-
onInputChange: s && ((r,
|
|
262
|
-
getOptionLabel:
|
|
263
|
-
getOptionKey:
|
|
264
|
-
groupBy:
|
|
265
|
-
renderGroup: (r) => /* @__PURE__ */
|
|
272
|
+
onChange: o && ((r, m) => o(m)),
|
|
273
|
+
inputValue: u,
|
|
274
|
+
onInputChange: s && ((r, m, h) => s(m, Ee[h] ?? "reset")),
|
|
275
|
+
getOptionLabel: P,
|
|
276
|
+
getOptionKey: Y,
|
|
277
|
+
groupBy: v,
|
|
278
|
+
renderGroup: (r) => /* @__PURE__ */ B("li", { children: [
|
|
266
279
|
r.group !== "" && /* @__PURE__ */ n(
|
|
267
|
-
|
|
280
|
+
A,
|
|
268
281
|
{
|
|
269
282
|
component: "div",
|
|
270
283
|
sx: {
|
|
271
|
-
...
|
|
272
|
-
...(
|
|
284
|
+
...We,
|
|
285
|
+
...(f == null ? void 0 : f(r.group)) === "accent" ? { color: "primary.main" } : {}
|
|
273
286
|
},
|
|
274
287
|
children: r.group
|
|
275
288
|
}
|
|
276
289
|
),
|
|
277
|
-
/* @__PURE__ */ n(
|
|
290
|
+
/* @__PURE__ */ n(g, { component: "ul", sx: { p: 0 }, children: r.children })
|
|
278
291
|
] }, r.key),
|
|
279
|
-
renderOption: ({ key: r, ...
|
|
280
|
-
/* @__PURE__ */ n(
|
|
281
|
-
|
|
282
|
-
] }, r) : /* @__PURE__ */ n("li", { ...
|
|
283
|
-
|
|
292
|
+
renderOption: ({ key: r, ...m }, h) => M != null && M(h) ? /* @__PURE__ */ B(g, { component: "li", ...m, sx: ze, children: [
|
|
293
|
+
/* @__PURE__ */ n(Ie, { width: 14, height: 14, strokeWidth: 2.2 }),
|
|
294
|
+
P(h)
|
|
295
|
+
] }, r) : /* @__PURE__ */ n("li", { ...m, className: Me(m.className, "text-nowrap"), children: (a == null ? void 0 : a(h)) ?? ($(h) ? /* @__PURE__ */ B(g, { component: "span", sx: { display: "flex", flexDirection: "column" }, children: [
|
|
296
|
+
P(h),
|
|
297
|
+
/* @__PURE__ */ n(g, { component: "span", sx: ke, children: $(h) })
|
|
298
|
+
] }) : P(h)) }, r),
|
|
299
|
+
slotProps: Fe,
|
|
284
300
|
sx: {
|
|
285
|
-
...
|
|
301
|
+
...d ? {
|
|
286
302
|
"& .MuiOutlinedInput-root": { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }
|
|
287
303
|
} : {},
|
|
288
|
-
...
|
|
289
|
-
"& .MuiAutocomplete-popupIndicator": { color:
|
|
290
|
-
"& .MuiAutocomplete-clearIndicator": { color:
|
|
304
|
+
...j ? {
|
|
305
|
+
"& .MuiAutocomplete-popupIndicator": { color: R("nodeInputIcon") },
|
|
306
|
+
"& .MuiAutocomplete-clearIndicator": { color: R("nodeInputIcon") }
|
|
291
307
|
} : {}
|
|
292
308
|
},
|
|
293
309
|
renderInput: (r) => /* @__PURE__ */ n(
|
|
294
|
-
|
|
310
|
+
C,
|
|
295
311
|
{
|
|
296
312
|
...r,
|
|
297
|
-
label:
|
|
298
|
-
placeholder:
|
|
299
|
-
autoFocus:
|
|
313
|
+
label: I,
|
|
314
|
+
placeholder: E,
|
|
315
|
+
autoFocus: V,
|
|
300
316
|
slotProps: {
|
|
301
317
|
input: r.InputProps,
|
|
302
318
|
// A given inputClassName replaces MUI's own input class (callers
|
|
@@ -304,24 +320,24 @@ function Oe({
|
|
|
304
320
|
// one, MUI's styling stays as is.
|
|
305
321
|
htmlInput: {
|
|
306
322
|
...r.inputProps,
|
|
307
|
-
...
|
|
308
|
-
maxLength:
|
|
323
|
+
...l ? { className: l } : {},
|
|
324
|
+
maxLength: O
|
|
309
325
|
}
|
|
310
326
|
},
|
|
311
327
|
sx: {
|
|
312
328
|
// A floating label only explains an empty field — once focused,
|
|
313
329
|
// tuck it up into the outline instead of hovering over the text.
|
|
314
|
-
...
|
|
330
|
+
...I ? {
|
|
315
331
|
"& .MuiInputLabel-root.Mui-focused": {
|
|
316
332
|
transform: "translate(15px, -6px) scale(0.75)"
|
|
317
333
|
}
|
|
318
334
|
} : {},
|
|
319
|
-
...
|
|
335
|
+
...j ? {
|
|
320
336
|
"& .MuiInputBase-root": {
|
|
321
337
|
bgcolor: "transparent",
|
|
322
|
-
color:
|
|
338
|
+
color: R("nodeInputText")
|
|
323
339
|
},
|
|
324
|
-
"& .MuiOutlinedInput-notchedOutline": { borderColor:
|
|
340
|
+
"& .MuiOutlinedInput-notchedOutline": { borderColor: R("nodeInputBorder") }
|
|
325
341
|
} : {}
|
|
326
342
|
}
|
|
327
343
|
}
|
|
@@ -329,99 +345,99 @@ function Oe({
|
|
|
329
345
|
}
|
|
330
346
|
);
|
|
331
347
|
}
|
|
332
|
-
const
|
|
348
|
+
const _e = { danger: "error.main", warning: "warning.main" }, Ne = { ...X, top: 0 }, Ve = ({
|
|
333
349
|
anchorEl: e,
|
|
334
350
|
open: t,
|
|
335
351
|
onClose: o,
|
|
336
|
-
sections:
|
|
337
|
-
}) => /* @__PURE__ */ n(
|
|
338
|
-
...s.title ? [/* @__PURE__ */ n(
|
|
339
|
-
...s.items.map((
|
|
340
|
-
|
|
352
|
+
sections: u
|
|
353
|
+
}) => /* @__PURE__ */ n(se, { anchorEl: e, open: t, onClose: o, children: u.flatMap((s, c) => [
|
|
354
|
+
...s.title ? [/* @__PURE__ */ n(A, { sx: Ne, children: s.title }, `section-${c}`)] : [],
|
|
355
|
+
...s.items.map((i) => /* @__PURE__ */ B(
|
|
356
|
+
G,
|
|
341
357
|
{
|
|
342
358
|
dense: !0,
|
|
343
|
-
selected:
|
|
344
|
-
disabled:
|
|
345
|
-
onClick:
|
|
359
|
+
selected: i.selected,
|
|
360
|
+
disabled: i.disabled,
|
|
361
|
+
onClick: i.onClick,
|
|
346
362
|
sx: { pl: 2, gap: 1, alignItems: "flex-start" },
|
|
347
363
|
children: [
|
|
348
|
-
|
|
349
|
-
|
|
364
|
+
i.icon && /* @__PURE__ */ n(
|
|
365
|
+
g,
|
|
350
366
|
{
|
|
351
367
|
component: "span",
|
|
352
368
|
sx: {
|
|
353
369
|
display: "flex",
|
|
354
370
|
pt: "2px",
|
|
355
|
-
color:
|
|
371
|
+
color: i.tone && _e[i.tone]
|
|
356
372
|
},
|
|
357
|
-
children:
|
|
373
|
+
children: i.icon
|
|
358
374
|
}
|
|
359
375
|
),
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
|
|
362
|
-
|
|
376
|
+
/* @__PURE__ */ B(g, { component: "span", sx: { display: "flex", flexDirection: "column" }, children: [
|
|
377
|
+
i.label,
|
|
378
|
+
i.detail && /* @__PURE__ */ n(g, { component: "span", sx: { fontSize: "0.7rem", color: "text.secondary" }, children: i.detail })
|
|
363
379
|
] })
|
|
364
380
|
]
|
|
365
381
|
},
|
|
366
|
-
|
|
382
|
+
i.key
|
|
367
383
|
))
|
|
368
|
-
]) }),
|
|
369
|
-
function
|
|
384
|
+
]) }), k = 38;
|
|
385
|
+
function $e({
|
|
370
386
|
items: e,
|
|
371
387
|
options: t,
|
|
372
388
|
onChange: o,
|
|
373
|
-
canAdd:
|
|
389
|
+
canAdd: u,
|
|
374
390
|
placeholder: s,
|
|
375
391
|
maxLength: c,
|
|
376
|
-
className:
|
|
377
|
-
grouped:
|
|
378
|
-
disabled:
|
|
392
|
+
className: i,
|
|
393
|
+
grouped: p,
|
|
394
|
+
disabled: a
|
|
379
395
|
}) {
|
|
380
|
-
const [b,
|
|
381
|
-
|
|
382
|
-
var
|
|
383
|
-
const l = [...
|
|
384
|
-
|
|
385
|
-
}, [e, S,
|
|
386
|
-
const
|
|
387
|
-
return /* @__PURE__ */
|
|
388
|
-
|
|
396
|
+
const [b, x] = L(""), [v, f] = L(!1), [S, M] = L(!1), [I, E] = L(0), w = re(null);
|
|
397
|
+
ne(() => {
|
|
398
|
+
var y;
|
|
399
|
+
const l = [...w.current.querySelectorAll(".MuiAutocomplete-tag")], d = ((y = l[0]) == null ? void 0 : y.offsetTop) ?? 0;
|
|
400
|
+
E(S ? 0 : l.filter((F) => F.offsetTop > d + 4).length);
|
|
401
|
+
}, [e, S, I]);
|
|
402
|
+
const O = (l) => u && !u(l) ? !1 : (x(""), o == null || o([...e, l]), !0);
|
|
403
|
+
return /* @__PURE__ */ B(
|
|
404
|
+
g,
|
|
389
405
|
{
|
|
390
|
-
ref:
|
|
391
|
-
className:
|
|
406
|
+
ref: w,
|
|
407
|
+
className: i,
|
|
392
408
|
sx: { position: "relative", display: "inline-flex" },
|
|
393
|
-
onFocus: () =>
|
|
409
|
+
onFocus: () => M(!0),
|
|
394
410
|
onBlur: (l) => {
|
|
395
411
|
if (l.currentTarget.contains(l.relatedTarget)) return;
|
|
396
|
-
|
|
397
|
-
const
|
|
398
|
-
|
|
412
|
+
M(!1);
|
|
413
|
+
const d = b.trim();
|
|
414
|
+
d !== "" && !O(d) && x(""), f(!1);
|
|
399
415
|
},
|
|
400
416
|
children: [
|
|
401
417
|
/* @__PURE__ */ n(
|
|
402
|
-
|
|
418
|
+
K,
|
|
403
419
|
{
|
|
404
420
|
multiple: !0,
|
|
405
421
|
freeSolo: !t,
|
|
406
422
|
disableClearable: !0,
|
|
407
|
-
disabled:
|
|
423
|
+
disabled: a,
|
|
408
424
|
size: "small",
|
|
409
425
|
options: t ?? [],
|
|
410
426
|
value: e,
|
|
411
427
|
inputValue: b,
|
|
412
|
-
onInputChange: (l,
|
|
413
|
-
|
|
428
|
+
onInputChange: (l, d, y) => {
|
|
429
|
+
y === "input" && (f(!1), x(d));
|
|
414
430
|
},
|
|
415
|
-
onChange: (l,
|
|
416
|
-
if (
|
|
417
|
-
|
|
431
|
+
onChange: (l, d, y) => {
|
|
432
|
+
if (y === "createOption") {
|
|
433
|
+
f(!O(String(d[d.length - 1]).trim()));
|
|
418
434
|
return;
|
|
419
435
|
}
|
|
420
|
-
|
|
436
|
+
x(""), o == null || o(d);
|
|
421
437
|
},
|
|
422
438
|
getOptionLabel: (l) => l.label,
|
|
423
439
|
getOptionKey: (l) => l.key,
|
|
424
|
-
isOptionEqualToValue: (l,
|
|
440
|
+
isOptionEqualToValue: (l, d) => l.key === d.key,
|
|
425
441
|
filterSelectedOptions: !0,
|
|
426
442
|
slotProps: {
|
|
427
443
|
paper: { className: "w-fit" },
|
|
@@ -433,22 +449,22 @@ function we({
|
|
|
433
449
|
maxWidth: 360,
|
|
434
450
|
// (As specific as MUI's own small-field padding, to replace it.)
|
|
435
451
|
"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall": {
|
|
436
|
-
minHeight:
|
|
452
|
+
minHeight: k,
|
|
437
453
|
// A row of chips (24px, 2px margins) fills the 38px exactly.
|
|
438
454
|
py: "5px",
|
|
439
|
-
...
|
|
455
|
+
...p ? { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } : {},
|
|
440
456
|
// Collapsed: one row, room on the right for the `+N`. Clipped,
|
|
441
457
|
// not hidden: an overflow-hidden box can still be scrolled, and
|
|
442
458
|
// focusing the input (rows down) scrolls it — left that way once
|
|
443
459
|
// collapsed again.
|
|
444
460
|
...S ? {} : {
|
|
445
|
-
maxHeight:
|
|
461
|
+
maxHeight: k,
|
|
446
462
|
overflow: "clip",
|
|
447
|
-
...
|
|
463
|
+
...I > 0 ? {
|
|
448
464
|
pr: "44px",
|
|
449
465
|
// The chips past the first row (its first children): the
|
|
450
466
|
// top of the next row would show in the padding below.
|
|
451
|
-
[`& > .MuiAutocomplete-tag:nth-child(n+${e.length -
|
|
467
|
+
[`& > .MuiAutocomplete-tag:nth-child(n+${e.length - I + 1})`]: {
|
|
452
468
|
visibility: "hidden"
|
|
453
469
|
}
|
|
454
470
|
} : {}
|
|
@@ -456,10 +472,10 @@ function we({
|
|
|
456
472
|
}
|
|
457
473
|
},
|
|
458
474
|
renderInput: (l) => /* @__PURE__ */ n(
|
|
459
|
-
|
|
475
|
+
C,
|
|
460
476
|
{
|
|
461
477
|
...l,
|
|
462
|
-
error:
|
|
478
|
+
error: v,
|
|
463
479
|
placeholder: e.length ? void 0 : s,
|
|
464
480
|
slotProps: {
|
|
465
481
|
input: l.InputProps,
|
|
@@ -469,16 +485,16 @@ function we({
|
|
|
469
485
|
)
|
|
470
486
|
}
|
|
471
487
|
),
|
|
472
|
-
|
|
473
|
-
|
|
488
|
+
I > 0 && /* @__PURE__ */ n(
|
|
489
|
+
he,
|
|
474
490
|
{
|
|
475
491
|
"data-testid": "list-more",
|
|
476
492
|
size: "small",
|
|
477
|
-
label: `+${
|
|
493
|
+
label: `+${I}`,
|
|
478
494
|
sx: {
|
|
479
495
|
position: "absolute",
|
|
480
496
|
right: 8,
|
|
481
|
-
top: (
|
|
497
|
+
top: (k - 24) / 2,
|
|
482
498
|
pointerEvents: "none"
|
|
483
499
|
}
|
|
484
500
|
}
|
|
@@ -487,30 +503,32 @@ function we({
|
|
|
487
503
|
}
|
|
488
504
|
);
|
|
489
505
|
}
|
|
490
|
-
const
|
|
491
|
-
Provider:
|
|
492
|
-
Tooltip:
|
|
493
|
-
IconButton:
|
|
494
|
-
Button:
|
|
495
|
-
TextField:
|
|
496
|
-
Select:
|
|
497
|
-
Combobox:
|
|
498
|
-
Menu:
|
|
506
|
+
const je = {
|
|
507
|
+
Provider: Pe,
|
|
508
|
+
Tooltip: Be,
|
|
509
|
+
IconButton: we,
|
|
510
|
+
Button: Oe,
|
|
511
|
+
TextField: Le,
|
|
512
|
+
Select: Re,
|
|
513
|
+
Combobox: He,
|
|
514
|
+
Menu: Ve,
|
|
499
515
|
// A light native-date field; the MUI X picker is an opt-in (MuiDatePicker,
|
|
500
516
|
// `@nongt/visql/mui-date-pickers`) so this kit doesn't need MUI X/date-fns.
|
|
501
|
-
DatePicker:
|
|
517
|
+
DatePicker: Ce,
|
|
502
518
|
// IN's values: an Autocomplete of chips (plain @mui/material).
|
|
503
|
-
ListInput:
|
|
504
|
-
|
|
519
|
+
ListInput: $e,
|
|
520
|
+
// The host's own UI inside the editor, in the host's cache and theme.
|
|
521
|
+
HostContent: Te
|
|
522
|
+
}, et = _(
|
|
505
523
|
({ components: e, ...t }, o) => {
|
|
506
|
-
const
|
|
507
|
-
() => ({ ...
|
|
524
|
+
const u = z(
|
|
525
|
+
() => ({ ...je, ...e }),
|
|
508
526
|
[e]
|
|
509
527
|
);
|
|
510
|
-
return /* @__PURE__ */ n(
|
|
528
|
+
return /* @__PURE__ */ n(ie, { ...t, ref: o, components: u });
|
|
511
529
|
}
|
|
512
530
|
);
|
|
513
531
|
export {
|
|
514
|
-
|
|
515
|
-
|
|
532
|
+
et as QueryBuilder,
|
|
533
|
+
je as muiComponents
|
|
516
534
|
};
|