@selectwin/kit 0.1.244 → 0.1.246
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 +7 -1
- package/dist/SelectFlowCanvas.js +138 -91
- 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/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/SelectSection.js
CHANGED
|
@@ -1,94 +1,96 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { ChevronDownIcon as e } from "./icons.js";
|
|
3
3
|
import { SelectInfoTip as t } from "./SelectInfoTip.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { registerSheetFrame as n } from "./internal/sheetBands.js";
|
|
5
|
+
import { FrameBody as r, useInsideFrame as i } from "./internal/frame.js";
|
|
6
|
+
import { inertProps as a } from "./internal/inert.js";
|
|
7
|
+
import { forwardRef as o, useId as s, useState as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
9
|
//#region src/SelectSection.tsx
|
|
9
|
-
var
|
|
10
|
-
let [w, T] =
|
|
10
|
+
var d = o(function({ title: n, help: o, description: d, action: f, collapsible: p = !1, defaultOpen: m = !0, open: h, onOpenChange: g, footer: _, flush: v = !1, list: y = !1, children: b, className: x, ...S }, C) {
|
|
11
|
+
let [w, T] = c(m), E = h ?? w, D = s(), O = () => {
|
|
11
12
|
h === void 0 && T(!E), g == null || g(!E);
|
|
12
|
-
}, k = (
|
|
13
|
-
return p ? /* @__PURE__ */
|
|
13
|
+
}, k = (i() ? " select-section--nested" : "") + (v ? " select-section--flush" : "") + (y ? " select-section--list" : ""), A = y ? "list" : "body";
|
|
14
|
+
return p ? /* @__PURE__ */ u("div", {
|
|
14
15
|
ref: C,
|
|
15
16
|
...S,
|
|
16
17
|
className: `select-section select-section--collapsible${k}${E ? " is-open" : ""}${x ? " " + x : ""}`,
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
+
children: [/* @__PURE__ */ u("button", {
|
|
18
19
|
type: "button",
|
|
19
20
|
className: "select-section__head select-section__head--toggle",
|
|
20
21
|
"aria-expanded": E,
|
|
21
22
|
"aria-controls": D,
|
|
22
23
|
onClick: O,
|
|
23
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ u("span", {
|
|
24
25
|
className: "select-section__heading",
|
|
25
|
-
children: [
|
|
26
|
+
children: [n && /* @__PURE__ */ l("span", {
|
|
26
27
|
className: "select-section__title",
|
|
27
|
-
children:
|
|
28
|
-
}), d && /* @__PURE__ */
|
|
28
|
+
children: n
|
|
29
|
+
}), d && /* @__PURE__ */ l("span", {
|
|
29
30
|
className: "select-section__desc",
|
|
30
31
|
children: d
|
|
31
32
|
})]
|
|
32
|
-
}), /* @__PURE__ */
|
|
33
|
+
}), /* @__PURE__ */ l("span", {
|
|
33
34
|
className: "select-section__chevron",
|
|
34
35
|
"aria-hidden": "true",
|
|
35
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ l(e, {})
|
|
36
37
|
})]
|
|
37
|
-
}), /* @__PURE__ */
|
|
38
|
+
}), /* @__PURE__ */ l("div", {
|
|
38
39
|
id: D,
|
|
39
40
|
className: "select-section__collapse",
|
|
40
41
|
"data-open": E,
|
|
41
|
-
...
|
|
42
|
-
children: /* @__PURE__ */
|
|
42
|
+
...a(!E),
|
|
43
|
+
children: /* @__PURE__ */ u("div", {
|
|
43
44
|
className: "select-section__collapsewrap",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ l("div", {
|
|
45
46
|
className: "select-section__body",
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ l(r, {
|
|
47
48
|
kind: A,
|
|
48
49
|
children: b
|
|
49
50
|
})
|
|
50
|
-
}), _ != null && _ !== "" && /* @__PURE__ */
|
|
51
|
+
}), _ != null && _ !== "" && /* @__PURE__ */ l("div", {
|
|
51
52
|
className: "select-section__foot",
|
|
52
53
|
children: _
|
|
53
54
|
})]
|
|
54
55
|
})
|
|
55
56
|
})]
|
|
56
|
-
}) : /* @__PURE__ */
|
|
57
|
+
}) : /* @__PURE__ */ u("div", {
|
|
57
58
|
ref: C,
|
|
58
59
|
...S,
|
|
59
60
|
className: `select-section${k}${x ? " " + x : ""}`,
|
|
60
61
|
children: [
|
|
61
|
-
(
|
|
62
|
+
(n || d || f) && /* @__PURE__ */ u("div", {
|
|
62
63
|
className: "select-section__head",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
+
children: [/* @__PURE__ */ u("div", {
|
|
64
65
|
className: "select-section__heading",
|
|
65
|
-
children: [
|
|
66
|
-
className: `select-section__title${
|
|
67
|
-
children: [
|
|
68
|
-
}), d && /* @__PURE__ */
|
|
66
|
+
children: [n && /* @__PURE__ */ u("h2", {
|
|
67
|
+
className: `select-section__title${o == null ? "" : " select-section__title--help"}`,
|
|
68
|
+
children: [n, o != null && /* @__PURE__ */ l(t, { content: o })]
|
|
69
|
+
}), d && /* @__PURE__ */ l("p", {
|
|
69
70
|
className: "select-section__desc",
|
|
70
71
|
children: d
|
|
71
72
|
})]
|
|
72
|
-
}), f ? /* @__PURE__ */
|
|
73
|
+
}), f ? /* @__PURE__ */ l("div", {
|
|
73
74
|
className: "select-section__action",
|
|
74
75
|
children: f
|
|
75
76
|
}) : null]
|
|
76
77
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ l("div", {
|
|
78
79
|
className: "select-section__body",
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ l(r, {
|
|
80
81
|
kind: A,
|
|
81
82
|
children: b
|
|
82
83
|
})
|
|
83
84
|
}),
|
|
84
|
-
_ != null && _ !== "" && /* @__PURE__ */
|
|
85
|
+
_ != null && _ !== "" && /* @__PURE__ */ l("div", {
|
|
85
86
|
className: "select-section__foot",
|
|
86
87
|
children: _
|
|
87
88
|
})
|
|
88
89
|
]
|
|
89
90
|
});
|
|
90
91
|
});
|
|
92
|
+
n(d);
|
|
91
93
|
//#endregion
|
|
92
|
-
export {
|
|
94
|
+
export { d as SelectSection };
|
|
93
95
|
|
|
94
96
|
//# sourceMappingURL=SelectSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isDevBuild(): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** Uma moldura que, no corpo da folha, é uma faixa por si (a seção, a lista, os fatos, o JSON). */
|
|
3
|
+
export declare function registerSheetFrame(type: object): void;
|
|
4
|
+
/** Um agrupador que, no corpo da folha, se desfaz quando junta molduras (o `SelectStack`). */
|
|
5
|
+
export declare function registerSheetGroup(type: object): void;
|
|
6
|
+
export interface SheetBand {
|
|
7
|
+
key: string;
|
|
8
|
+
node: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** As faixas do corpo da folha: um filho, uma faixa; o agrupador de molduras dá uma faixa para cada filho dele. */
|
|
11
|
+
export declare function sheetBands(children: ReactNode): SheetBand[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Children as e, Fragment as t, isValidElement as n } from "react";
|
|
2
|
+
//#region src/internal/sheetBands.ts
|
|
3
|
+
var r = /* @__PURE__ */ new WeakSet(), i = /* @__PURE__ */ new WeakSet();
|
|
4
|
+
function a(e) {
|
|
5
|
+
r.add(e);
|
|
6
|
+
}
|
|
7
|
+
function o(e) {
|
|
8
|
+
i.add(e);
|
|
9
|
+
}
|
|
10
|
+
function s(e) {
|
|
11
|
+
return n(e) && (typeof e.type == "function" || typeof e.type == "object") ? e.type : null;
|
|
12
|
+
}
|
|
13
|
+
function c(r, i) {
|
|
14
|
+
let a = [];
|
|
15
|
+
return e.toArray(r).forEach((e, r) => {
|
|
16
|
+
let o = `${i}${n(e) && e.key != null ? e.key : r}`;
|
|
17
|
+
n(e) && e.type === t ? a.push(...c(e.props.children, `${o}/`)) : a.push({
|
|
18
|
+
key: o,
|
|
19
|
+
node: e
|
|
20
|
+
});
|
|
21
|
+
}), a;
|
|
22
|
+
}
|
|
23
|
+
function l(e) {
|
|
24
|
+
let t = [];
|
|
25
|
+
for (let n of c(e, "")) {
|
|
26
|
+
let e = s(n.node);
|
|
27
|
+
if (e && i.has(e)) {
|
|
28
|
+
let e = c(n.node.props.children, `${n.key}/`);
|
|
29
|
+
if (e.some((e) => {
|
|
30
|
+
let t = s(e.node);
|
|
31
|
+
return t != null && r.has(t);
|
|
32
|
+
})) {
|
|
33
|
+
t.push(...e);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
t.push(n);
|
|
38
|
+
}
|
|
39
|
+
return t;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { a as registerSheetFrame, o as registerSheetGroup, l as sheetBands };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=sheetBands.js.map
|