@selectwin/kit 0.1.245 → 0.1.247
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/SelectDetail.js +20 -18
- package/dist/SelectFlowCanvas.d.ts +16 -1
- package/dist/SelectFlowCanvas.js +11 -5
- package/dist/SelectJsonViewer.js +99 -97
- package/dist/SelectLayout.js +33 -31
- package/dist/SelectListCard.js +30 -28
- package/dist/SelectLocale.d.ts +5 -0
- package/dist/SelectLocale.js +8 -0
- package/dist/SelectModal.d.ts +45 -6
- package/dist/SelectModal.js +281 -127
- package/dist/SelectSection.js +35 -33
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/internal/dev.d.ts +1 -0
- package/dist/internal/dev.js +12 -0
- package/dist/internal/sheetBands.d.ts +11 -0
- package/dist/internal/sheetBands.js +44 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectDetail.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { useSelectReveal as e } from "./internal/useSelectReveal.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { registerSheetFrame as t } from "./internal/sheetBands.js";
|
|
4
|
+
import { createContext as n, forwardRef as r, useContext as i } from "react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
6
|
//#region src/SelectDetail.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
7
|
+
var s = n(!1), c = n(!1);
|
|
8
|
+
function l({ children: t, stacked: n = !1, compact: r = !1, loading: i = !1, as: o = "div", className: l, ...u }) {
|
|
8
9
|
let d = e({
|
|
9
10
|
selector: ".select-detail",
|
|
10
11
|
y: 8,
|
|
@@ -12,11 +13,11 @@ function c({ children: t, stacked: n = !1, compact: r = !1, loading: a = !1, as:
|
|
|
12
13
|
stagger: .05,
|
|
13
14
|
scroll: !0
|
|
14
15
|
}), f = `select-detaillist${n ? " select-detaillist--stacked" : ""}${r ? " select-detaillist--compact" : ""}${l ? " " + l : ""}`;
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
value:
|
|
17
|
-
children: /* @__PURE__ */
|
|
18
|
-
value:
|
|
19
|
-
children:
|
|
16
|
+
return /* @__PURE__ */ a(s.Provider, {
|
|
17
|
+
value: i,
|
|
18
|
+
children: /* @__PURE__ */ a(c.Provider, {
|
|
19
|
+
value: o === "dl",
|
|
20
|
+
children: a(o === "dl" ? "dl" : "div", {
|
|
20
21
|
...u,
|
|
21
22
|
className: f,
|
|
22
23
|
ref: d,
|
|
@@ -25,22 +26,23 @@ function c({ children: t, stacked: n = !1, compact: r = !1, loading: a = !1, as:
|
|
|
25
26
|
})
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
t(l);
|
|
30
|
+
var u = r(function({ label: e, children: t, action: n, align: r = "center", loading: l, className: u, ...d }, f) {
|
|
31
|
+
let p = i(s), m = l ?? p, h = i(c), g = h ? "dt" : "div", _ = h ? "dd" : "div";
|
|
32
|
+
return /* @__PURE__ */ o("div", {
|
|
31
33
|
ref: f,
|
|
32
34
|
...d,
|
|
33
|
-
className: `select-detail select-detail--${
|
|
35
|
+
className: `select-detail select-detail--${r}${u ? " " + u : ""}`,
|
|
34
36
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ a(g, {
|
|
36
38
|
className: "select-detail__label",
|
|
37
39
|
children: e
|
|
38
40
|
}),
|
|
39
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ a(_, {
|
|
40
42
|
className: "select-detail__value",
|
|
41
|
-
children: m ? /* @__PURE__ */
|
|
43
|
+
children: m ? /* @__PURE__ */ a("span", { className: "select-skeleton select-detail__skel" }) : t
|
|
42
44
|
}),
|
|
43
|
-
n && /* @__PURE__ */
|
|
45
|
+
n && /* @__PURE__ */ a(_, {
|
|
44
46
|
className: "select-detail__action",
|
|
45
47
|
children: n
|
|
46
48
|
})
|
|
@@ -48,6 +50,6 @@ var l = n(function({ label: e, children: t, action: n, align: c = "center", load
|
|
|
48
50
|
});
|
|
49
51
|
});
|
|
50
52
|
//#endregion
|
|
51
|
-
export {
|
|
53
|
+
export { l as SelectDetailList, u as SelectDetailRow };
|
|
52
54
|
|
|
53
55
|
//# sourceMappingURL=SelectDetail.js.map
|
|
@@ -107,6 +107,12 @@ export interface SelectFlowLayoutProps {
|
|
|
107
107
|
* nada muda: o painel é a coluna da direita. */
|
|
108
108
|
inspectorOpen?: boolean;
|
|
109
109
|
onInspectorClose?: () => void;
|
|
110
|
+
/**
|
|
111
|
+
* 0.1.246: a largura do painel lateral no desktop — `md` (27rem, o padrão) ou `lg` (30rem: o passo a passo e as
|
|
112
|
+
* configurações do SmartOps, que pedem mais respiro). A troca anima (a coluna do desenho cede o espaço devagar). No
|
|
113
|
+
* celular e no estreito nada muda.
|
|
114
|
+
*/
|
|
115
|
+
inspectorSize?: 'md' | 'lg';
|
|
110
116
|
}
|
|
111
117
|
/**
|
|
112
118
|
* SelectFlowLayout — a página de um editor de fluxo: barra (voltar · identidade · ferramentas · ações),
|
|
@@ -115,4 +121,13 @@ export interface SelectFlowLayoutProps {
|
|
|
115
121
|
* de rodapé para ela). Em telas estreitas o painel desce para baixo do canvas — ou, com `inspectorOpen`, vira
|
|
116
122
|
* uma folha que sobe por cima do desenho no celular, e o desenho fica com a tela inteira.
|
|
117
123
|
*/
|
|
118
|
-
export declare function SelectFlowLayout({ title, subtitle, onBack, backLabel, toolbar, actions, error, canvas, inspectorHead, inspector, inspectorLabel, inspectorOpen, onInspectorClose, }: SelectFlowLayoutProps): import("react").JSX.Element;
|
|
124
|
+
export declare function SelectFlowLayout({ title, subtitle, onBack, backLabel, toolbar, actions, error, canvas, inspectorHead, inspector, inspectorLabel, inspectorOpen, onInspectorClose, inspectorSize, }: SelectFlowLayoutProps): import("react").JSX.Element;
|
|
125
|
+
/**
|
|
126
|
+
* 0.1.247 — o RODAPÉ FIXO do painel lateral (dono, 10/11/2026): os botões de um passo ("Voltar · Continuar") ficam
|
|
127
|
+
* sempre à vista no pé do painel enquanto o conteúdo rola por trás. É `position: sticky` no fundo do painel — funciona
|
|
128
|
+
* onde quer que os botões estejam montados (dentro de um formulário embutido, inclusive), sem tirar o estado de lá.
|
|
129
|
+
* Ocupa a largura do painel, com o filete em cima e o fundo do painel. Use um por passo, no fim do conteúdo dele.
|
|
130
|
+
*/
|
|
131
|
+
export declare function SelectFlowInspectorFoot({ children }: {
|
|
132
|
+
children: ReactNode;
|
|
133
|
+
}): import("react").JSX.Element;
|
package/dist/SelectFlowCanvas.js
CHANGED
|
@@ -290,10 +290,10 @@ function h({ shape: e = "card", tone: t = "neutral", icon: n, order: r, eyebrow:
|
|
|
290
290
|
})]
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
function g({ title: n, subtitle: r, onBack: i, backLabel: s = "Voltar", toolbar: c, actions: l, error: f, canvas: p, inspectorHead: m, inspector: h, inspectorLabel: g = "Painel", inspectorOpen: _, onInspectorClose: v }) {
|
|
294
|
-
let
|
|
293
|
+
function g({ title: n, subtitle: r, onBack: i, backLabel: s = "Voltar", toolbar: c, actions: l, error: f, canvas: p, inspectorHead: m, inspector: h, inspectorLabel: g = "Painel", inspectorOpen: _, onInspectorClose: v, inspectorSize: y = "md" }) {
|
|
294
|
+
let b = _ !== void 0;
|
|
295
295
|
return /* @__PURE__ */ d("div", {
|
|
296
|
-
className: `select-flowpage${
|
|
296
|
+
className: `select-flowpage${b ? " select-flowpage--sheet" : ""}${b && _ ? " is-inspecting" : ""}${y === "lg" ? " select-flowpage--inspector-lg" : ""}`,
|
|
297
297
|
children: [
|
|
298
298
|
/* @__PURE__ */ d("header", {
|
|
299
299
|
className: "select-flowpage__bar",
|
|
@@ -340,7 +340,7 @@ function g({ title: n, subtitle: r, onBack: i, backLabel: s = "Voltar", toolbar:
|
|
|
340
340
|
className: "select-flowpage__inspector",
|
|
341
341
|
"aria-label": g,
|
|
342
342
|
children: [
|
|
343
|
-
|
|
343
|
+
b && v && /* @__PURE__ */ d("button", {
|
|
344
344
|
type: "button",
|
|
345
345
|
className: "select-flowpage__sheetclose",
|
|
346
346
|
onClick: v,
|
|
@@ -366,7 +366,13 @@ function g({ title: n, subtitle: r, onBack: i, backLabel: s = "Voltar", toolbar:
|
|
|
366
366
|
]
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
+
function _({ children: e }) {
|
|
370
|
+
return /* @__PURE__ */ u("div", {
|
|
371
|
+
className: "select-flowpage__inspectorfoot",
|
|
372
|
+
children: e
|
|
373
|
+
});
|
|
374
|
+
}
|
|
369
375
|
//#endregion
|
|
370
|
-
export { p as SelectFlowCanvas, g as SelectFlowLayout, m as SelectFlowNode };
|
|
376
|
+
export { p as SelectFlowCanvas, _ as SelectFlowInspectorFoot, g as SelectFlowLayout, m as SelectFlowNode };
|
|
371
377
|
|
|
372
378
|
//# sourceMappingURL=SelectFlowCanvas.js.map
|
package/dist/SelectJsonViewer.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { CheckIcon as e, ChevronRightIcon as t, ClipboardIcon as n, CopyIcon as r, SearchIcon as i, SelectorIcon as a, TerminalIcon as o } from "./icons.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Fragment as
|
|
2
|
+
import { registerSheetFrame as s } from "./internal/sheetBands.js";
|
|
3
|
+
import { SelectText as c } from "./SelectText.js";
|
|
4
|
+
import { useInsideFrame as l } from "./internal/frame.js";
|
|
5
|
+
import { SelectIconButton as u } from "./SelectIconButton.js";
|
|
6
|
+
import { SelectDisclosureButton as d } from "./SelectDisclosureButton.js";
|
|
7
|
+
import { allContainerPaths as f, childCount as p, childPath as m, containerSummary as h, countOccurrences as g, defaultExpandedPaths as _, entriesOf as v, isContainer as y, isCycle as b, isEmptyJson as x, jsonKind as S, normalizeJson as ee, primitiveText as C, searchJson as te, splitMatches as w, toPrettyJson as ne, tokenizeJson as T, walkJson as re } from "./jsonTree.js";
|
|
8
|
+
import { Fragment as E, forwardRef as ie, useCallback as D, useEffect as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
9
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
9
10
|
//#region src/SelectJsonViewer.tsx
|
|
10
|
-
var
|
|
11
|
+
var F = 320, I = 12e4, L = {
|
|
11
12
|
string: "str",
|
|
12
13
|
number: "num",
|
|
13
14
|
boolean: "bool",
|
|
@@ -16,104 +17,104 @@ var P = 320, F = 12e4, I = {
|
|
|
16
17
|
object: "plain",
|
|
17
18
|
array: "plain"
|
|
18
19
|
};
|
|
19
|
-
function
|
|
20
|
-
return t.trim() ? /* @__PURE__ */ M
|
|
20
|
+
function R({ text: e, term: t }) {
|
|
21
|
+
return t.trim() ? /* @__PURE__ */ N(M, { children: w(e, t).map((e, t) => e.hit ? /* @__PURE__ */ N("mark", {
|
|
21
22
|
className: "select-json__hit",
|
|
22
23
|
children: e.text
|
|
23
|
-
}, t) : /* @__PURE__ */
|
|
24
|
+
}, t) : /* @__PURE__ */ N(E, { children: e.text }, t)) }) : /* @__PURE__ */ N(M, { children: e });
|
|
24
25
|
}
|
|
25
26
|
function ae(e = 1400) {
|
|
26
|
-
let [t, n] =
|
|
27
|
-
return
|
|
27
|
+
let [t, n] = j(null), r = A(void 0);
|
|
28
|
+
return O(() => () => window.clearTimeout(r.current), []), [t, D((t, i) => {
|
|
28
29
|
var a;
|
|
29
30
|
(a = navigator.clipboard) == null || a.writeText(i), n(t), window.clearTimeout(r.current), r.current = window.setTimeout(() => n(null), e);
|
|
30
31
|
}, [e])];
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
let r =
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
className: `select-json__v select-json__v--${
|
|
33
|
+
function z({ value: e, term: t, forceFull: n }) {
|
|
34
|
+
let r = S(e), i = C(e), a = !n && i.length > F, o = a ? `${i.slice(0, F)}…` : i, s = r === "string";
|
|
35
|
+
return /* @__PURE__ */ P("span", {
|
|
36
|
+
className: `select-json__v select-json__v--${L[r]}`,
|
|
36
37
|
title: a ? i : void 0,
|
|
37
38
|
children: [
|
|
38
|
-
s && /* @__PURE__ */
|
|
39
|
+
s && /* @__PURE__ */ N("span", {
|
|
39
40
|
className: "select-json__quote",
|
|
40
41
|
children: "\""
|
|
41
42
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ N(R, {
|
|
43
44
|
text: o,
|
|
44
45
|
term: t
|
|
45
46
|
}),
|
|
46
|
-
s && /* @__PURE__ */
|
|
47
|
+
s && /* @__PURE__ */ N("span", {
|
|
47
48
|
className: "select-json__quote",
|
|
48
49
|
children: "\""
|
|
49
50
|
})
|
|
50
51
|
]
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function B({ value: n, path: i, depth: a, ancestors: o, ctx: s }) {
|
|
54
55
|
let c = s.result.active, l = Array.isArray(n);
|
|
55
|
-
return /* @__PURE__ */ M
|
|
56
|
-
let d =
|
|
56
|
+
return /* @__PURE__ */ N(M, { children: v(n).map(([n, u]) => {
|
|
57
|
+
let d = m(i, n);
|
|
57
58
|
if (c && !s.result.visible.has(d)) return null;
|
|
58
|
-
let
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
className: `select-json__row${
|
|
59
|
+
let f = b(u, o), g = y(u) && !f, _ = g && p(u) > 0, v = c ? !0 : s.expanded.has(d), x = s.result.matched.has(d), S = `row:${d}`;
|
|
60
|
+
return /* @__PURE__ */ P(E, { children: [/* @__PURE__ */ P("div", {
|
|
61
|
+
className: `select-json__row${x ? " is-match" : ""}`,
|
|
61
62
|
style: { "--json-depth": a },
|
|
62
63
|
children: [
|
|
63
|
-
_ ? /* @__PURE__ */
|
|
64
|
+
_ ? /* @__PURE__ */ N("button", {
|
|
64
65
|
type: "button",
|
|
65
66
|
className: `select-json__caret${v ? " is-open" : ""}`,
|
|
66
67
|
"aria-expanded": v,
|
|
67
68
|
"aria-label": `${v ? "Recolher" : "Expandir"} ${n}`,
|
|
68
69
|
onClick: () => s.toggle(d),
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
-
}) : /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ N(t, {})
|
|
71
|
+
}) : /* @__PURE__ */ N("span", {
|
|
71
72
|
className: "select-json__caret select-json__caret--empty",
|
|
72
73
|
"aria-hidden": "true"
|
|
73
74
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ P("span", {
|
|
75
76
|
className: "select-json__label",
|
|
76
77
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ N("span", {
|
|
78
79
|
className: l ? "select-json__idx" : "select-json__key",
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ N(R, {
|
|
80
81
|
text: n,
|
|
81
82
|
term: s.search
|
|
82
83
|
})
|
|
83
84
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ N("span", {
|
|
85
86
|
className: "select-json__sep",
|
|
86
87
|
children: ":"
|
|
87
88
|
}),
|
|
88
|
-
|
|
89
|
+
f ? /* @__PURE__ */ N("span", {
|
|
89
90
|
className: "select-json__v select-json__v--other",
|
|
90
91
|
children: "[referência circular]"
|
|
91
|
-
}) : _ ? /* @__PURE__ */
|
|
92
|
+
}) : _ ? /* @__PURE__ */ N("button", {
|
|
92
93
|
type: "button",
|
|
93
94
|
className: "select-json__summary",
|
|
94
95
|
tabIndex: -1,
|
|
95
96
|
onClick: () => s.toggle(d),
|
|
96
|
-
children:
|
|
97
|
-
}) : g ? /* @__PURE__ */
|
|
97
|
+
children: h(u)
|
|
98
|
+
}) : g ? /* @__PURE__ */ N("span", {
|
|
98
99
|
className: "select-json__summary select-json__summary--static",
|
|
99
|
-
children:
|
|
100
|
-
}) : /* @__PURE__ */
|
|
100
|
+
children: h(u)
|
|
101
|
+
}) : /* @__PURE__ */ N(z, {
|
|
101
102
|
value: u,
|
|
102
103
|
term: s.search,
|
|
103
|
-
forceFull:
|
|
104
|
+
forceFull: x
|
|
104
105
|
})
|
|
105
106
|
]
|
|
106
107
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ N("button", {
|
|
108
109
|
type: "button",
|
|
109
110
|
className: "select-json__copy",
|
|
110
111
|
"aria-label": `Copiar ${n}`,
|
|
111
|
-
title: s.copied ===
|
|
112
|
-
onClick: () => s.copy(
|
|
113
|
-
children: s.copied ===
|
|
112
|
+
title: s.copied === S ? "Copiado!" : "Copiar valor",
|
|
113
|
+
onClick: () => s.copy(S, g ? ne(u) : C(u)),
|
|
114
|
+
children: s.copied === S ? /* @__PURE__ */ N(e, {}) : /* @__PURE__ */ N(r, {})
|
|
114
115
|
})
|
|
115
116
|
]
|
|
116
|
-
}), _ && v && /* @__PURE__ */
|
|
117
|
+
}), _ && v && /* @__PURE__ */ N(B, {
|
|
117
118
|
value: u,
|
|
118
119
|
path: d,
|
|
119
120
|
depth: a + 1,
|
|
@@ -123,39 +124,39 @@ function z({ value: n, path: i, depth: a, ancestors: o, ctx: s }) {
|
|
|
123
124
|
}) });
|
|
124
125
|
}
|
|
125
126
|
function oe({ text: e, term: t }) {
|
|
126
|
-
let n =
|
|
127
|
-
return n ? /* @__PURE__ */
|
|
127
|
+
let n = k(() => e.length > I ? null : T(e), [e]);
|
|
128
|
+
return n ? /* @__PURE__ */ N("pre", {
|
|
128
129
|
className: "select-json__pre",
|
|
129
|
-
children: n.map((e, n) => /* @__PURE__ */
|
|
130
|
+
children: n.map((e, n) => /* @__PURE__ */ N("span", {
|
|
130
131
|
className: `select-json__v--${e.cls}`,
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ N(R, {
|
|
132
133
|
text: e.text,
|
|
133
134
|
term: t
|
|
134
135
|
})
|
|
135
136
|
}, n))
|
|
136
|
-
}) : /* @__PURE__ */
|
|
137
|
+
}) : /* @__PURE__ */ N("pre", {
|
|
137
138
|
className: "select-json__pre",
|
|
138
|
-
children: /* @__PURE__ */
|
|
139
|
+
children: /* @__PURE__ */ N(R, {
|
|
139
140
|
text: e,
|
|
140
141
|
term: t
|
|
141
142
|
})
|
|
142
143
|
});
|
|
143
144
|
}
|
|
144
|
-
var
|
|
145
|
-
let [w, T] =
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
var V = ie(function({ value: t, title: r = "Metadados", maxHeight: s = 360, defaultOpen: p = !1, defaultExpandDepth: m = 1, searchable: h = !0, emptyLabel: v = "Sem dados", className: b, ...S }, C) {
|
|
146
|
+
let [w, T] = j(p), [E, ie] = j("tree"), [F, I] = j(""), [L, R] = j(/* @__PURE__ */ new Set()), [V, H] = ae(), U = A(null), W = k(() => ee(t), [t]), G = x(W), K = k(() => typeof t == "string" && W === t ? t : ne(W), [t, W]), q = k(() => re(W, () => {}).truncated, [W]), J = E === "tree" && !q, Y = k(() => q ? [] : f(W), [W, q]);
|
|
147
|
+
O(() => {
|
|
148
|
+
R(q ? /* @__PURE__ */ new Set() : _(W, m)), I("");
|
|
148
149
|
}, [
|
|
149
150
|
W,
|
|
150
151
|
m,
|
|
151
152
|
q
|
|
152
153
|
]);
|
|
153
|
-
let X =
|
|
154
|
+
let X = k(() => te(W, J ? F : ""), [
|
|
154
155
|
W,
|
|
155
156
|
F,
|
|
156
157
|
J
|
|
157
|
-
]), Z = F.trim().length > 0, Q = J ? X.count :
|
|
158
|
-
|
|
158
|
+
]), Z = F.trim().length > 0, Q = J ? X.count : g(K, F);
|
|
159
|
+
O(() => {
|
|
159
160
|
var e;
|
|
160
161
|
w && Z && ((e = U.current) == null || (e = e.querySelector(".select-json__hit")) == null || e.scrollIntoView({ block: "nearest" }));
|
|
161
162
|
}, [
|
|
@@ -164,48 +165,48 @@ var B = E(function({ value: t, title: r = "Metadados", maxHeight: f = 360, defau
|
|
|
164
165
|
F,
|
|
165
166
|
E
|
|
166
167
|
]);
|
|
167
|
-
let se =
|
|
168
|
-
|
|
168
|
+
let se = D((e) => {
|
|
169
|
+
R((t) => {
|
|
169
170
|
let n = new Set(t);
|
|
170
171
|
return n.delete(e) || n.add(e), n;
|
|
171
172
|
});
|
|
172
|
-
}, []), $ = Y.length > 0 && Y.every((e) => L.has(e)), ce = () =>
|
|
173
|
+
}, []), $ = Y.length > 0 && Y.every((e) => L.has(e)), ce = () => R($ ? /* @__PURE__ */ new Set() : new Set(Y)), le = {
|
|
173
174
|
expanded: L,
|
|
174
175
|
toggle: se,
|
|
175
176
|
search: F,
|
|
176
177
|
result: X,
|
|
177
178
|
copied: V,
|
|
178
179
|
copy: H
|
|
179
|
-
}, ue = w && !G, de =
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
ref:
|
|
182
|
-
...
|
|
183
|
-
className: `select-json${de ? " select-json--nested" : ""}${
|
|
184
|
-
children: [/* @__PURE__ */
|
|
180
|
+
}, ue = w && !G, de = l();
|
|
181
|
+
return /* @__PURE__ */ P("div", {
|
|
182
|
+
ref: C,
|
|
183
|
+
...S,
|
|
184
|
+
className: `select-json${de ? " select-json--nested" : ""}${b ? " " + b : ""}`,
|
|
185
|
+
children: [/* @__PURE__ */ P("div", {
|
|
185
186
|
className: "select-json__head",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ N(c, {
|
|
187
188
|
as: "h2",
|
|
188
189
|
variant: "headingSm",
|
|
189
190
|
children: r
|
|
190
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ N(d, {
|
|
191
192
|
open: ue,
|
|
192
193
|
onToggle: () => T((e) => !e),
|
|
193
194
|
openLabel: "Ocultar",
|
|
194
195
|
disabled: G,
|
|
195
|
-
children: G ?
|
|
196
|
+
children: G ? v : "Mostrar"
|
|
196
197
|
})]
|
|
197
|
-
}), ue && /* @__PURE__ */
|
|
198
|
+
}), ue && /* @__PURE__ */ P("div", {
|
|
198
199
|
className: "select-json__body",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ P("div", {
|
|
200
201
|
className: "select-json__toolbar",
|
|
201
202
|
children: [
|
|
202
|
-
|
|
203
|
-
/* @__PURE__ */
|
|
203
|
+
h ? /* @__PURE__ */ P(M, { children: [
|
|
204
|
+
/* @__PURE__ */ N("span", {
|
|
204
205
|
className: "select-json__searchicon",
|
|
205
206
|
"aria-hidden": "true",
|
|
206
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ N(i, {})
|
|
207
208
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ N("input", {
|
|
209
210
|
className: "select-json__searchinput",
|
|
210
211
|
type: "search",
|
|
211
212
|
value: F,
|
|
@@ -213,41 +214,41 @@ var B = E(function({ value: t, title: r = "Metadados", maxHeight: f = 360, defau
|
|
|
213
214
|
placeholder: "Buscar chave ou valor…",
|
|
214
215
|
"aria-label": "Buscar no JSON"
|
|
215
216
|
}),
|
|
216
|
-
Z && /* @__PURE__ */
|
|
217
|
+
Z && /* @__PURE__ */ N("span", {
|
|
217
218
|
className: "select-json__count",
|
|
218
219
|
children: Q === 0 ? "nenhum" : Q === 1 ? "1 resultado" : `${Q} resultados`
|
|
219
220
|
})
|
|
220
|
-
] }) : /* @__PURE__ */
|
|
221
|
-
J && Y.length > 0 && !Z && /* @__PURE__ */
|
|
222
|
-
icon: /* @__PURE__ */
|
|
221
|
+
] }) : /* @__PURE__ */ N("span", { className: "select-json__spacer" }),
|
|
222
|
+
J && Y.length > 0 && !Z && /* @__PURE__ */ N(u, {
|
|
223
|
+
icon: /* @__PURE__ */ N(a, {}),
|
|
223
224
|
label: $ ? "Recolher tudo" : "Expandir tudo",
|
|
224
225
|
size: "sm",
|
|
225
226
|
active: $,
|
|
226
227
|
onClick: ce
|
|
227
228
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
icon: /* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ N(u, {
|
|
230
|
+
icon: /* @__PURE__ */ N(o, {}),
|
|
230
231
|
label: q ? "Árvore indisponível: JSON muito grande" : E === "raw" ? "Ver árvore" : "Ver JSON bruto",
|
|
231
232
|
size: "sm",
|
|
232
233
|
active: E === "raw" || q,
|
|
233
234
|
disabled: q,
|
|
234
|
-
onClick: () =>
|
|
235
|
+
onClick: () => ie((e) => e === "raw" ? "tree" : "raw")
|
|
235
236
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
icon:
|
|
237
|
+
/* @__PURE__ */ N(u, {
|
|
238
|
+
icon: N(V === "all" ? e : n, {}),
|
|
238
239
|
label: V === "all" ? "Copiado!" : "Copiar JSON",
|
|
239
240
|
size: "sm",
|
|
240
241
|
active: V === "all",
|
|
241
242
|
onClick: () => H("all", K)
|
|
242
243
|
})
|
|
243
244
|
]
|
|
244
|
-
}), /* @__PURE__ */
|
|
245
|
+
}), /* @__PURE__ */ N("div", {
|
|
245
246
|
ref: U,
|
|
246
247
|
className: "select-json__scroll",
|
|
247
|
-
style: { maxHeight:
|
|
248
|
-
children: J ? Z && X.count === 0 ? /* @__PURE__ */
|
|
248
|
+
style: { maxHeight: s },
|
|
249
|
+
children: J ? Z && X.count === 0 ? /* @__PURE__ */ N("div", {
|
|
249
250
|
className: "select-json__empty",
|
|
250
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ P(c, {
|
|
251
252
|
as: "p",
|
|
252
253
|
tone: "subdued",
|
|
253
254
|
variant: "bodySm",
|
|
@@ -257,30 +258,30 @@ var B = E(function({ value: t, title: r = "Metadados", maxHeight: f = 360, defau
|
|
|
257
258
|
"”."
|
|
258
259
|
]
|
|
259
260
|
})
|
|
260
|
-
}) : /* @__PURE__ */
|
|
261
|
+
}) : /* @__PURE__ */ N("div", {
|
|
261
262
|
className: "select-json__tree",
|
|
262
|
-
children:
|
|
263
|
+
children: y(W) ? /* @__PURE__ */ N(B, {
|
|
263
264
|
value: W,
|
|
264
265
|
path: "",
|
|
265
266
|
depth: 0,
|
|
266
267
|
ancestors: [W],
|
|
267
268
|
ctx: le
|
|
268
|
-
}) : /* @__PURE__ */
|
|
269
|
+
}) : /* @__PURE__ */ P("div", {
|
|
269
270
|
className: "select-json__row",
|
|
270
271
|
style: { "--json-depth": 0 },
|
|
271
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ N("span", {
|
|
272
273
|
className: "select-json__caret select-json__caret--empty",
|
|
273
274
|
"aria-hidden": "true"
|
|
274
|
-
}), /* @__PURE__ */
|
|
275
|
+
}), /* @__PURE__ */ N("span", {
|
|
275
276
|
className: "select-json__label",
|
|
276
|
-
children: /* @__PURE__ */
|
|
277
|
+
children: /* @__PURE__ */ N(z, {
|
|
277
278
|
value: W,
|
|
278
279
|
term: F,
|
|
279
280
|
forceFull: !0
|
|
280
281
|
})
|
|
281
282
|
})]
|
|
282
283
|
})
|
|
283
|
-
}) : /* @__PURE__ */
|
|
284
|
+
}) : /* @__PURE__ */ N(oe, {
|
|
284
285
|
text: K,
|
|
285
286
|
term: F
|
|
286
287
|
})
|
|
@@ -288,7 +289,8 @@ var B = E(function({ value: t, title: r = "Metadados", maxHeight: f = 360, defau
|
|
|
288
289
|
})]
|
|
289
290
|
});
|
|
290
291
|
});
|
|
292
|
+
s(V);
|
|
291
293
|
//#endregion
|
|
292
|
-
export {
|
|
294
|
+
export { V as SelectJsonViewer };
|
|
293
295
|
|
|
294
296
|
//# sourceMappingURL=SelectJsonViewer.js.map
|