@code0-tech/pictor 0.0.0-mvp.29 → 0.0.0-mvp.30
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/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/react-contenteditable.js +7 -0
- package/dist/_virtual/react-contenteditable2.js +4 -0
- package/dist/_virtual/react-dom-server-legacy.browser.development.js +4 -0
- package/dist/_virtual/react-dom-server-legacy.browser.production.js +4 -0
- package/dist/_virtual/react-dom-server.browser.development.js +4 -0
- package/dist/_virtual/react-dom-server.browser.production.js +4 -0
- package/dist/_virtual/react-is.development.js +4 -0
- package/dist/_virtual/react-is.production.min.js +4 -0
- package/dist/_virtual/server.browser.js +5 -0
- package/dist/_virtual/server.browser2.js +4 -0
- package/dist/assets/components/d-resizable/DResizable.style.css +1 -1
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +12 -12
- package/dist/components/button-group/ButtonGroup.js +12 -12
- package/dist/components/d-flow/DFlow.edges.hook.js +57 -54
- package/dist/components/d-flow/DFlow.js +304 -268
- package/dist/components/d-flow/DFlow.nodes.hook.js +60 -59
- package/dist/components/d-flow/DFlow.service.d.ts +3 -2
- package/dist/components/d-flow/DFlow.service.js +62 -47
- package/dist/components/d-flow/DFlow.util.d.ts +4 -0
- package/dist/components/d-flow/DFlow.util.js +63 -0
- package/dist/components/d-flow/DFlowEdge.js +34 -34
- package/dist/components/d-flow-data-type/DFlowDataType.service.js +17 -14
- package/dist/components/d-flow-data-type/DFlowDataType.view.d.ts +7 -4
- package/dist/components/d-flow-data-type/DFlowDataType.view.js +11 -6
- package/dist/components/d-flow-file/DFlowTabDefault.d.ts +0 -3
- package/dist/components/d-flow-file/DFlowTabDefault.js +77 -112
- package/dist/components/d-flow-file/DFlowTabTrigger.js +38 -49
- package/dist/components/d-flow-file/DFlowTabs.js +26 -27
- package/dist/components/d-flow-folder/DFlowFolder.js +170 -143
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +18 -11
- package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +1 -0
- package/dist/components/d-flow-function/DFlowFunction.input.hook.js +4 -5
- package/dist/components/d-flow-function/DFlowFunction.return.hook.js +1 -1
- package/dist/components/d-flow-function/DFlowFunction.view.d.ts +14 -11
- package/dist/components/d-flow-function/DFlowFunction.view.js +19 -12
- package/dist/components/d-flow-function/DFlowFunctionDefaultCard.js +72 -75
- package/dist/components/d-flow-function/DFlowFunctionSuggestionCard.js +27 -32
- package/dist/components/d-flow-function/DFlowFunctionTriggerCard.js +17 -10
- package/dist/components/d-flow-input/DFlowInputDataType.js +38 -33
- package/dist/components/d-flow-input/DFlowInputDefault.d.ts +10 -0
- package/dist/components/d-flow-input/DFlowInputDefault.js +128 -0
- package/dist/components/d-flow-input/DFlowInputLiteralBadge.d.ts +7 -0
- package/dist/components/d-flow-input/DFlowInputLiteralBadge.js +24 -0
- package/dist/components/d-flow-input/DFlowInputNodeBadge.d.ts +11 -0
- package/dist/components/d-flow-input/DFlowInputNodeBadge.js +44 -0
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.d.ts +11 -0
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +33 -0
- package/dist/components/d-flow-panel/DFlowExport.js +1 -1
- package/dist/components/d-flow-panel/DFlowMiniMap.js +1 -1
- package/dist/components/d-flow-panel/DFlowPanelControl.js +34 -32
- package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.js +34 -0
- package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +50 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +133 -0
- package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.d.ts +3 -18
- package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +19 -156
- package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +47 -58
- package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.util.js +5 -4
- package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +6 -6
- package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +44 -0
- package/dist/components/d-flow-type/DFlowType.view.d.ts +5 -5
- package/dist/components/d-flow-type/DFlowType.view.js +22 -12
- package/dist/components/d-flow-validation/DFlowValidation.hook.js +1 -1
- package/dist/components/d-flow-validation/DNodeValidation.hook.js +39 -43
- package/dist/components/d-resizable/DResizable.d.ts +4 -4
- package/dist/components/d-resizable/DResizable.js +22 -21
- package/dist/components/d-user/DUserInput.js +23 -21
- package/dist/components/file-tabs/FileTabs.service.d.ts +0 -1
- package/dist/components/file-tabs/FileTabs.service.js +49 -53
- package/dist/components/form/EmailInput.js +9 -9
- package/dist/components/form/Input.d.ts +2 -1
- package/dist/components/form/Input.js +294 -397
- package/dist/components/form/Input.syntax.hook.d.ts +1 -18
- package/dist/components/form/Input.syntax.hook.js +7 -73
- package/dist/components/form/Input.utils.d.ts +1 -2
- package/dist/components/form/Input.utils.js +26 -21
- package/dist/components/form/InputContentEditable.hook.d.ts +40 -0
- package/dist/components/form/InputContentEditable.hook.js +471 -0
- package/dist/components/form/InputSuggestion.d.ts +2 -2
- package/dist/components/form/InputSuggestion.js +169 -107
- package/dist/components/form/PasswordInput.js +8 -8
- package/dist/components/form/TextInput.js +11 -11
- package/dist/components/form/useForm.d.ts +1 -0
- package/dist/components/form/useForm.js +45 -60
- package/dist/components/menu/Menu.js +4 -4
- package/dist/index.js +155 -154
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +30 -30
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +8 -8
- package/dist/node_modules/fast-deep-equal/index.js +31 -0
- package/dist/node_modules/object-assign/index.js +49 -0
- package/dist/node_modules/prop-types/checkPropTypes.js +54 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
- package/dist/node_modules/prop-types/index.js +17 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
- package/dist/node_modules/prop-types/lib/has.js +7 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +87 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +70 -0
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
- package/dist/node_modules/react-contenteditable/lib/react-contenteditable.js +132 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +6235 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +4096 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +6753 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.js +4645 -0
- package/dist/node_modules/react-dom/server.browser.js +15 -0
- package/dist/utils/generics.d.ts +2 -0
- package/dist/utils/generics.js +93 -80
- package/dist/utils/index.js +22 -21
- package/dist/utils/inspection.d.ts +4 -2
- package/dist/utils/inspection.js +27 -2
- package/package.json +10 -8
- package/dist/components/form/Input.selection.hook.d.ts +0 -17
- package/dist/components/form/Input.selection.hook.js +0 -78
- package/dist/components/form/InputSyntax.d.ts +0 -19
- package/dist/components/form/InputSyntax.js +0 -52
- package/dist/components/form/inputSyntaxMapping.d.ts +0 -3
- package/dist/components/form/inputSyntaxMapping.js +0 -42
|
@@ -1,156 +1,218 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { ScrollArea as
|
|
6
|
-
import { IconChevronDown as
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
inputRef:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsx as I, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import { c as x } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { MenuItem as L, MenuContent as F, MenuLabel as k } from "../menu/Menu.js";
|
|
4
|
+
import i from "react";
|
|
5
|
+
import { ScrollArea as N, ScrollAreaViewport as O, ScrollAreaScrollbar as T, ScrollAreaThumb as j } from "../scroll-area/ScrollArea.js";
|
|
6
|
+
import { IconChevronDown as $, IconChevronUp as z } from "@tabler/icons-react";
|
|
7
|
+
const D = i.memo((u) => {
|
|
8
|
+
const e = x.c(17), {
|
|
9
|
+
suggestion: n,
|
|
10
|
+
visibleIndex: l,
|
|
11
|
+
isActive: p,
|
|
12
|
+
inputRef: d,
|
|
13
|
+
onSelect: v,
|
|
14
|
+
onActivate: c,
|
|
15
|
+
itemRef: f
|
|
16
|
+
} = u;
|
|
17
|
+
if (l === null)
|
|
18
|
+
return null;
|
|
19
|
+
let m;
|
|
20
|
+
if (e[0] !== d || e[1] !== c || e[2] !== l) {
|
|
21
|
+
const b = () => {
|
|
22
|
+
c(l), d?.current?.focus({
|
|
23
|
+
preventScroll: !0
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
m = (M) => {
|
|
27
|
+
M.preventDefault(), b();
|
|
28
|
+
}, e[0] = d, e[1] = c, e[2] = l, e[3] = m;
|
|
29
|
+
} else
|
|
30
|
+
m = e[3];
|
|
31
|
+
const g = m;
|
|
32
|
+
let a;
|
|
33
|
+
e[4] !== c || e[5] !== l ? (a = (b) => {
|
|
34
|
+
b.preventDefault(), b.stopPropagation(), c(l);
|
|
35
|
+
}, e[4] = c, e[5] = l, e[6] = a) : a = e[6];
|
|
36
|
+
const y = a;
|
|
37
|
+
let C;
|
|
38
|
+
e[7] !== v || e[8] !== n ? (C = () => setTimeout(() => v(n), 0), e[7] = v, e[8] = n, e[9] = C) : C = e[9];
|
|
39
|
+
let o;
|
|
40
|
+
return e[10] !== g || e[11] !== y || e[12] !== p || e[13] !== f || e[14] !== n.children || e[15] !== C ? (o = /* @__PURE__ */ I(L, { textValue: "", onPointerDown: g, onPointerMove: y, onSelect: C, "data-focus": p, ref: f, children: n.children }), e[10] = g, e[11] = y, e[12] = p, e[13] = f, e[14] = n.children, e[15] = C, e[16] = o) : o = e[16], o;
|
|
41
|
+
}, (u, e) => u.suggestion === e.suggestion && u.visibleIndex === e.visibleIndex && u.isActive === e.isActive && u.inputRef === e.inputRef && u.onSelect === e.onSelect && u.onActivate === e.onActivate && u.itemRef === e.itemRef);
|
|
42
|
+
D.displayName = "SuggestionMenuItem";
|
|
43
|
+
const P = i.forwardRef((u, e) => {
|
|
44
|
+
const n = x.c(12);
|
|
45
|
+
let l, p, d;
|
|
46
|
+
n[0] !== u ? ({
|
|
47
|
+
children: l,
|
|
48
|
+
inputRef: p,
|
|
49
|
+
...d
|
|
50
|
+
} = u, n[0] = u, n[1] = l, n[2] = p, n[3] = d) : (l = n[1], p = n[2], d = n[3]);
|
|
51
|
+
const v = i.useRef(null);
|
|
52
|
+
let c, f;
|
|
53
|
+
n[4] !== p ? (c = (g) => {
|
|
54
|
+
g.preventDefault(), p?.current?.focus({
|
|
19
55
|
preventScroll: !0
|
|
20
56
|
});
|
|
21
|
-
},
|
|
57
|
+
}, f = () => p?.current?.focus({
|
|
22
58
|
preventScroll: !0
|
|
23
|
-
}),
|
|
24
|
-
let
|
|
25
|
-
return
|
|
26
|
-
})
|
|
59
|
+
}), n[4] = p, n[5] = c, n[6] = f) : (c = n[5], f = n[6]);
|
|
60
|
+
let m;
|
|
61
|
+
return n[7] !== l || n[8] !== d || n[9] !== c || n[10] !== f ? (m = /* @__PURE__ */ I(F, { ref: v, forceMount: !0, onContextMenuCapture: H, onInteractOutside: U, onCloseAutoFocus: q, onOpenAutoFocus: c, onFocusCapture: f, align: "start", sideOffset: 8, ...d, children: l }), n[7] = l, n[8] = d, n[9] = c, n[10] = f, n[11] = m) : m = n[11], m;
|
|
62
|
+
});
|
|
63
|
+
P.displayName = "InputSuggestionMenuContent";
|
|
64
|
+
const Z = i.memo(P), V = i.forwardRef((u, e) => {
|
|
27
65
|
const {
|
|
28
|
-
suggestions:
|
|
29
|
-
onSuggestionSelect:
|
|
66
|
+
suggestions: n,
|
|
67
|
+
onSuggestionSelect: l = () => {
|
|
30
68
|
},
|
|
31
|
-
inputRef:
|
|
32
|
-
...
|
|
33
|
-
} =
|
|
34
|
-
|
|
35
|
-
if (!t) {
|
|
36
|
-
|
|
69
|
+
inputRef: p,
|
|
70
|
+
...d
|
|
71
|
+
} = u, v = i.useRef([]), c = i.useRef(/* @__PURE__ */ new Map()), [f, m] = i.useState({}), g = i.useRef(null), a = i.useCallback((t, r) => {
|
|
72
|
+
const s = g.current;
|
|
73
|
+
if (!(!r?.force && s === t) && (s !== null && v.current[s]?.removeAttribute("data-focus"), g.current = t, t !== null)) {
|
|
74
|
+
const h = v.current[t];
|
|
75
|
+
h && (h.setAttribute("data-focus", "true"), r?.scrollIntoView && h.scrollIntoView({
|
|
76
|
+
block: "nearest"
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
}, []);
|
|
80
|
+
i.useEffect(() => {
|
|
81
|
+
if (!n) {
|
|
82
|
+
m({});
|
|
37
83
|
return;
|
|
38
84
|
}
|
|
39
|
-
|
|
85
|
+
m((t) => {
|
|
40
86
|
const r = {};
|
|
41
|
-
return
|
|
42
|
-
|
|
87
|
+
return n.forEach((s) => {
|
|
88
|
+
s.groupBy && (t.hasOwnProperty(s.groupBy) ? r[s.groupBy] = t[s.groupBy] : r[s.groupBy] = !1);
|
|
43
89
|
}), r;
|
|
44
90
|
});
|
|
45
|
-
}, [
|
|
91
|
+
}, [n]);
|
|
46
92
|
const {
|
|
47
|
-
groupLabelCount:
|
|
48
|
-
visibleSuggestionCount:
|
|
49
|
-
visibleSuggestions:
|
|
50
|
-
} =
|
|
51
|
-
if (!
|
|
93
|
+
groupLabelCount: y,
|
|
94
|
+
visibleSuggestionCount: C,
|
|
95
|
+
visibleSuggestions: o
|
|
96
|
+
} = i.useMemo(() => {
|
|
97
|
+
if (!n) return {
|
|
52
98
|
groupLabelCount: 0,
|
|
53
99
|
visibleSuggestionCount: 0,
|
|
54
100
|
visibleSuggestions: []
|
|
55
101
|
};
|
|
56
|
-
let
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
const
|
|
60
|
-
|
|
102
|
+
let t = 0, r = 0;
|
|
103
|
+
const s = [];
|
|
104
|
+
return n.forEach((h, A, R) => {
|
|
105
|
+
const S = A > 0 ? R[A - 1]?.groupBy : void 0;
|
|
106
|
+
h.groupBy && h.groupBy !== S && (t += 1), (h.groupBy ? f[h.groupBy] : !1) || (r += 1, s.push(h));
|
|
61
107
|
}), {
|
|
62
|
-
groupLabelCount:
|
|
108
|
+
groupLabelCount: t,
|
|
63
109
|
visibleSuggestionCount: r,
|
|
64
|
-
visibleSuggestions:
|
|
110
|
+
visibleSuggestions: s
|
|
65
111
|
};
|
|
66
|
-
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
112
|
+
}, [f, n]);
|
|
113
|
+
i.useEffect(() => {
|
|
114
|
+
const t = g.current;
|
|
115
|
+
if (t !== null) {
|
|
116
|
+
if (t > o.length - 1) {
|
|
117
|
+
a(o.length ? o.length - 1 : null, {
|
|
118
|
+
force: !0
|
|
119
|
+
});
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
a(t, {
|
|
123
|
+
force: !0
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}, [a, o]), i.useImperativeHandle(e, () => ({
|
|
74
127
|
focusFirstItem: () => {
|
|
75
|
-
if (
|
|
76
|
-
return a(0
|
|
128
|
+
if (o.length)
|
|
129
|
+
return a(0, {
|
|
130
|
+
scrollIntoView: !0
|
|
131
|
+
}), o[0];
|
|
77
132
|
},
|
|
78
133
|
focusLastItem: () => {
|
|
79
|
-
if (!
|
|
80
|
-
const
|
|
81
|
-
return a(
|
|
134
|
+
if (!o.length) return;
|
|
135
|
+
const t = o.length - 1;
|
|
136
|
+
return a(t, {
|
|
137
|
+
scrollIntoView: !0
|
|
138
|
+
}), o[t];
|
|
82
139
|
},
|
|
83
140
|
highlightNextItem: () => {
|
|
84
|
-
if (!
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
141
|
+
if (!o.length) return;
|
|
142
|
+
const t = g.current, r = t === null ? 0 : Math.min(t + 1, o.length - 1);
|
|
143
|
+
return a(r, {
|
|
144
|
+
scrollIntoView: !0
|
|
145
|
+
}), o[r];
|
|
88
146
|
},
|
|
89
147
|
highlightPreviousItem: () => {
|
|
90
|
-
if (!
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
148
|
+
if (!o.length) return;
|
|
149
|
+
const t = g.current, r = t === null ? o.length - 1 : Math.max(t - 1, 0);
|
|
150
|
+
return a(r, {
|
|
151
|
+
scrollIntoView: !0
|
|
152
|
+
}), o[r];
|
|
94
153
|
},
|
|
95
154
|
selectActiveItem: () => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
155
|
+
const t = g.current;
|
|
156
|
+
if (t === null || !o[t]) return;
|
|
157
|
+
const r = o[t];
|
|
158
|
+
return setTimeout(() => l(r), 0), r;
|
|
99
159
|
},
|
|
100
160
|
clearActiveItem: () => a(null)
|
|
101
|
-
}), [
|
|
102
|
-
const
|
|
103
|
-
|
|
161
|
+
}), [l, a, o]);
|
|
162
|
+
const b = (t) => {
|
|
163
|
+
m((r) => ({
|
|
104
164
|
...r,
|
|
105
|
-
[
|
|
165
|
+
[t]: !r[t]
|
|
106
166
|
}));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
167
|
+
}, M = i.useCallback((t) => {
|
|
168
|
+
let r = c.current.get(t);
|
|
169
|
+
return r || (r = (s) => {
|
|
170
|
+
v.current[t] = s;
|
|
171
|
+
}, c.current.set(t, r)), r;
|
|
172
|
+
}, []);
|
|
173
|
+
let E = -1;
|
|
174
|
+
return /* @__PURE__ */ B(N, { h: `${Math.max(C + y, 1) * 27}px`, mah: "calc(var(--radix-popper-available-height) - 3rem - 69px)", ...d, children: [
|
|
175
|
+
/* @__PURE__ */ I(O, { children: n?.map((t, r, s) => {
|
|
176
|
+
const h = r > 0 ? s[r - 1]?.groupBy : void 0, A = t.groupBy && t.groupBy !== h, R = t.groupBy ? f[t.groupBy] : !1, S = R ? null : ++E, w = S !== null && g.current === S;
|
|
177
|
+
return /* @__PURE__ */ B(i.Fragment, { children: [
|
|
178
|
+
A && t.groupBy && /* @__PURE__ */ B(k, { onPointerDown: (G) => G.preventDefault(), onClick: () => b(t.groupBy), style: {
|
|
115
179
|
display: "flex",
|
|
116
180
|
alignItems: "center",
|
|
117
181
|
justifyContent: "space-between",
|
|
118
182
|
cursor: "pointer"
|
|
119
183
|
}, children: [
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
|
|
184
|
+
/* @__PURE__ */ I("span", { children: t.groupBy }),
|
|
185
|
+
R ? /* @__PURE__ */ I($, { size: 16 }) : /* @__PURE__ */ I(z, { size: 16 })
|
|
122
186
|
] }),
|
|
123
|
-
!
|
|
124
|
-
|
|
187
|
+
!R && /* @__PURE__ */ I(
|
|
188
|
+
D,
|
|
125
189
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
onSelect: () => setTimeout(() => i(e), 0),
|
|
134
|
-
"data-focus": b,
|
|
135
|
-
ref: (x) => p !== null && (v.current[p] = x),
|
|
136
|
-
children: e.children
|
|
190
|
+
suggestion: t,
|
|
191
|
+
visibleIndex: S,
|
|
192
|
+
isActive: w,
|
|
193
|
+
inputRef: p,
|
|
194
|
+
onSelect: l,
|
|
195
|
+
onActivate: a,
|
|
196
|
+
itemRef: S !== null ? M(S) : void 0
|
|
137
197
|
}
|
|
138
198
|
)
|
|
139
199
|
] }, r);
|
|
140
200
|
}) }),
|
|
141
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ I(T, { orientation: "vertical", children: /* @__PURE__ */ I(j, {}) })
|
|
142
202
|
] });
|
|
143
203
|
});
|
|
144
|
-
|
|
145
|
-
|
|
204
|
+
V.displayName = "InputSuggestionMenuContentItems";
|
|
205
|
+
const _ = i.memo(V);
|
|
206
|
+
function H(u) {
|
|
207
|
+
return u.stopPropagation();
|
|
146
208
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
209
|
+
function U(u) {
|
|
210
|
+
return u.target instanceof HTMLInputElement && u.preventDefault();
|
|
149
211
|
}
|
|
150
|
-
function
|
|
151
|
-
return
|
|
212
|
+
function q(u) {
|
|
213
|
+
return u.preventDefault();
|
|
152
214
|
}
|
|
153
215
|
export {
|
|
154
|
-
|
|
155
|
-
|
|
216
|
+
Z as InputSuggestionMenuContent,
|
|
217
|
+
_ as InputSuggestionMenuContentItems
|
|
156
218
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import n from "react";
|
|
3
|
-
import { Input as
|
|
4
|
-
import { IconEye as d, IconX as
|
|
3
|
+
import { Input as f } from "./Input.js";
|
|
4
|
+
import { IconEye as d, IconX as h } from "@tabler/icons-react";
|
|
5
5
|
import { Button as i } from "../button/Button.js";
|
|
6
|
-
import {
|
|
7
|
-
const C = n.forwardRef((
|
|
6
|
+
import { clearInputElement as y } from "./Input.utils.js";
|
|
7
|
+
const C = n.forwardRef((p, t) => {
|
|
8
8
|
t = t || n.useRef(null);
|
|
9
9
|
const {
|
|
10
|
-
clearable:
|
|
11
|
-
visible:
|
|
10
|
+
clearable: s = !0,
|
|
11
|
+
visible: a = !0,
|
|
12
12
|
right: c,
|
|
13
13
|
...u
|
|
14
|
-
} =
|
|
15
|
-
return
|
|
14
|
+
} = p, l = (r) => (y(t.current), r.stopPropagation(), r.preventDefault(), !1), m = (r) => (t.current instanceof HTMLInputElement && (t.current.type === "password" ? t.current.type = "text" : t.current.type === "text" && (t.current.type = "password")), r.stopPropagation(), r.preventDefault(), !1), o = [c];
|
|
15
|
+
return a && o.push(/* @__PURE__ */ e(i, { variant: "none", onClick: (r) => m(r), children: /* @__PURE__ */ e(d, { size: 13 }) })), s && o.push(/* @__PURE__ */ e(i, { variant: "none", onClick: (r) => l(r), children: /* @__PURE__ */ e(h, { size: 13 }) })), /* @__PURE__ */ e(f, { right: o, rightType: "action", type: "password", ref: t, ...u });
|
|
16
16
|
});
|
|
17
17
|
export {
|
|
18
18
|
C as PasswordInput
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import i from "react";
|
|
3
3
|
import { Input as u } from "./Input.js";
|
|
4
4
|
import { IconX as f } from "@tabler/icons-react";
|
|
5
|
-
import { Button as
|
|
6
|
-
import {
|
|
7
|
-
const R = i.forwardRef((
|
|
5
|
+
import { Button as p } from "../button/Button.js";
|
|
6
|
+
import { clearInputElement as s } from "./Input.utils.js";
|
|
7
|
+
const R = i.forwardRef((r, t) => {
|
|
8
8
|
t = t || i.useRef(null);
|
|
9
9
|
const {
|
|
10
|
-
clearable:
|
|
11
|
-
right:
|
|
12
|
-
...
|
|
13
|
-
} =
|
|
14
|
-
|
|
15
|
-
}, n = [
|
|
16
|
-
return
|
|
10
|
+
clearable: l = !1,
|
|
11
|
+
right: a,
|
|
12
|
+
...m
|
|
13
|
+
} = r, c = (o) => {
|
|
14
|
+
s(t.current), r.onClear && r.onClear(o);
|
|
15
|
+
}, n = [a];
|
|
16
|
+
return l && n.push(/* @__PURE__ */ e(p, { variant: "none", onClick: (o) => c(o), children: /* @__PURE__ */ e(f, { size: 13 }) })), /* @__PURE__ */ e(u, { right: n, type: "text", ref: t, ...m });
|
|
17
17
|
});
|
|
18
18
|
export {
|
|
19
19
|
R as TextInput
|
|
@@ -4,6 +4,7 @@ export type Validations<Values> = Partial<{
|
|
|
4
4
|
export interface FormValidationProps<Values> {
|
|
5
5
|
initialValues: Values;
|
|
6
6
|
validate?: Validations<Values>;
|
|
7
|
+
truthyValidationBeforeSubmit?: boolean;
|
|
7
8
|
onSubmit?: (values: Values) => void;
|
|
8
9
|
}
|
|
9
10
|
export interface ValidationProps<Value> {
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return (t = x(t)) in i ? Object.defineProperty(i, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = e, i;
|
|
1
|
+
import { useState as b, useRef as p, useEffect as y, useCallback as d, useMemo as P } from "react";
|
|
2
|
+
function c(r, t, e) {
|
|
3
|
+
return (t = w(t)) in r ? Object.defineProperty(r, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : r[t] = e, r;
|
|
5
4
|
}
|
|
6
|
-
function
|
|
7
|
-
var t =
|
|
5
|
+
function w(r) {
|
|
6
|
+
var t = S(r, "string");
|
|
8
7
|
return typeof t == "symbol" ? t : t + "";
|
|
9
8
|
}
|
|
10
|
-
function
|
|
11
|
-
if (typeof
|
|
12
|
-
var e =
|
|
9
|
+
function S(r, t) {
|
|
10
|
+
if (typeof r != "object" || !r) return r;
|
|
11
|
+
var e = r[Symbol.toPrimitive];
|
|
13
12
|
if (e !== void 0) {
|
|
14
|
-
var
|
|
15
|
-
if (typeof
|
|
13
|
+
var n = e.call(r, t);
|
|
14
|
+
if (typeof n != "object") return n;
|
|
16
15
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
17
16
|
}
|
|
18
|
-
return (t === "string" ? String : Number)(
|
|
17
|
+
return (t === "string" ? String : Number)(r);
|
|
19
18
|
}
|
|
20
|
-
class
|
|
21
|
-
constructor(t, e,
|
|
22
|
-
|
|
19
|
+
class f {
|
|
20
|
+
constructor(t, e, n) {
|
|
21
|
+
c(this, "changeValue", void 0), c(this, "currentValues", void 0), c(this, "currentValidations", void 0), this.changeValue = t, this.currentValues = e, this.currentValidations = n;
|
|
23
22
|
}
|
|
24
23
|
isValid() {
|
|
25
24
|
if (!this.currentValidations) return !0;
|
|
@@ -31,21 +30,17 @@ class _ {
|
|
|
31
30
|
return !0;
|
|
32
31
|
}
|
|
33
32
|
getInputProps(t) {
|
|
34
|
-
const e = this.currentValues[t],
|
|
33
|
+
const e = this.currentValues[t], n = e ?? null, u = t, a = (this.currentValidations && this.currentValidations[t] ? this.currentValidations[t] : (i) => null)(e, this.currentValues);
|
|
35
34
|
return {
|
|
36
35
|
// @ts-ignore – z.B. wenn dein Input `defaultValue` kennt
|
|
37
|
-
defaultValue:
|
|
38
|
-
initialValue:
|
|
36
|
+
defaultValue: n,
|
|
37
|
+
initialValue: n,
|
|
39
38
|
formValidation: {
|
|
40
|
-
setValue: (
|
|
41
|
-
this.changeValue(
|
|
39
|
+
setValue: (i) => {
|
|
40
|
+
this.changeValue(u, i);
|
|
42
41
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} : {
|
|
46
|
-
notValidMessage: a,
|
|
47
|
-
valid: a === null
|
|
48
|
-
}
|
|
42
|
+
notValidMessage: a,
|
|
43
|
+
valid: a === null
|
|
49
44
|
},
|
|
50
45
|
...this.currentValidations && this.currentValidations[t] ? {
|
|
51
46
|
required: !0
|
|
@@ -53,40 +48,30 @@ class _ {
|
|
|
53
48
|
};
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
initialValues:
|
|
59
|
-
validate:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const v = d;
|
|
80
|
-
let V;
|
|
81
|
-
t[10] !== s || t[11] !== a || t[12] !== n ? (V = () => {
|
|
82
|
-
y(!0);
|
|
83
|
-
const g = new _(P, n, a, !1);
|
|
84
|
-
s && g.isValid() && s(n);
|
|
85
|
-
}, t[10] = s, t[11] = a, t[12] = n, t[13] = V) : V = t[13];
|
|
86
|
-
const p = V;
|
|
87
|
-
let f;
|
|
88
|
-
return t[14] !== p || t[15] !== v ? (f = [v, p], t[14] = p, t[15] = v, t[16] = f) : f = t[16], f;
|
|
51
|
+
const _ = (r) => {
|
|
52
|
+
const {
|
|
53
|
+
initialValues: t,
|
|
54
|
+
validate: e = {},
|
|
55
|
+
truthyValidationBeforeSubmit: n = !0,
|
|
56
|
+
onSubmit: u
|
|
57
|
+
} = r, [o, a] = b(t), i = p(t);
|
|
58
|
+
y(() => {
|
|
59
|
+
a(t), i.current = t;
|
|
60
|
+
}, [t]);
|
|
61
|
+
const s = d((l, m) => {
|
|
62
|
+
a((g) => {
|
|
63
|
+
const V = {
|
|
64
|
+
...g,
|
|
65
|
+
[l]: m
|
|
66
|
+
};
|
|
67
|
+
return i.current = V, V;
|
|
68
|
+
});
|
|
69
|
+
}, []), h = P(() => new f(s, o, e), [s, o, e]), v = d(() => {
|
|
70
|
+
const l = new f(s, i.current, e);
|
|
71
|
+
u && (!n || l.isValid()) && u(i.current);
|
|
72
|
+
}, [s, e, u, n]);
|
|
73
|
+
return [h, v];
|
|
89
74
|
};
|
|
90
75
|
export {
|
|
91
|
-
|
|
76
|
+
_ as useForm
|
|
92
77
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import '../../assets/components/menu/Menu.style.css';/* empty css */
|
|
4
4
|
import { mergeCode0Props as r } from "../../utils/utils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { DropdownMenuItem as m, DropdownMenuContent as f, DropdownMenuLabel as _, DropdownMenu as M, DropdownMenuTrigger as a, DropdownMenuPortal as g, DropdownMenuGroup as w, DropdownMenuSub as $, DropdownMenuSubTrigger as b, DropdownMenuSubContent as d, DropdownMenuSeparator as D, DropdownMenuArrow as S } from "@radix-ui/react-dropdown-menu";
|
|
6
6
|
const A = (o) => {
|
|
7
7
|
const e = c.c(4);
|
|
8
8
|
let n;
|
|
@@ -30,21 +30,21 @@ const A = (o) => {
|
|
|
30
30
|
e[0] !== o || e[1] !== u ? (t = r(u, o), e[0] = o, e[1] = u, e[2] = t) : t = e[2];
|
|
31
31
|
const i = t;
|
|
32
32
|
let s;
|
|
33
|
-
return e[3] !== o.align || e[4] !== i ? (s = /* @__PURE__ */ l(
|
|
33
|
+
return e[3] !== o.align || e[4] !== i ? (s = /* @__PURE__ */ l(f, { align: n, ...i }), e[3] = o.align, e[4] = i, e[5] = s) : s = e[5], s;
|
|
34
34
|
}, j = (o) => {
|
|
35
35
|
const e = c.c(4);
|
|
36
36
|
let n;
|
|
37
37
|
e[0] !== o ? (n = r("menu__label", o), e[0] = o, e[1] = n) : n = e[1];
|
|
38
38
|
const u = n;
|
|
39
39
|
let t;
|
|
40
|
-
return e[2] !== u ? (t = /* @__PURE__ */ l(
|
|
40
|
+
return e[2] !== u ? (t = /* @__PURE__ */ l(_, { ...u }), e[2] = u, e[3] = t) : t = e[3], t;
|
|
41
41
|
}, E = (o) => {
|
|
42
42
|
const e = c.c(4);
|
|
43
43
|
let n;
|
|
44
44
|
e[0] !== o ? (n = r("menu__item", o), e[0] = o, e[1] = n) : n = e[1];
|
|
45
45
|
const u = n;
|
|
46
46
|
let t;
|
|
47
|
-
return e[2] !== u ? (t = /* @__PURE__ */ l(
|
|
47
|
+
return e[2] !== u ? (t = /* @__PURE__ */ l(m, { ...u }), e[2] = u, e[3] = t) : t = e[3], t;
|
|
48
48
|
}, R = (o) => {
|
|
49
49
|
const e = c.c(4);
|
|
50
50
|
let n;
|