@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.
Files changed (125) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/index.js +4 -0
  3. package/dist/_virtual/index2.js +4 -0
  4. package/dist/_virtual/react-contenteditable.js +7 -0
  5. package/dist/_virtual/react-contenteditable2.js +4 -0
  6. package/dist/_virtual/react-dom-server-legacy.browser.development.js +4 -0
  7. package/dist/_virtual/react-dom-server-legacy.browser.production.js +4 -0
  8. package/dist/_virtual/react-dom-server.browser.development.js +4 -0
  9. package/dist/_virtual/react-dom-server.browser.production.js +4 -0
  10. package/dist/_virtual/react-is.development.js +4 -0
  11. package/dist/_virtual/react-is.production.min.js +4 -0
  12. package/dist/_virtual/server.browser.js +5 -0
  13. package/dist/_virtual/server.browser2.js +4 -0
  14. package/dist/assets/components/d-resizable/DResizable.style.css +1 -1
  15. package/dist/assets/components/form/Input.style.css +1 -1
  16. package/dist/components/breadcrumb/Breadcrumb.js +12 -12
  17. package/dist/components/button-group/ButtonGroup.js +12 -12
  18. package/dist/components/d-flow/DFlow.edges.hook.js +57 -54
  19. package/dist/components/d-flow/DFlow.js +304 -268
  20. package/dist/components/d-flow/DFlow.nodes.hook.js +60 -59
  21. package/dist/components/d-flow/DFlow.service.d.ts +3 -2
  22. package/dist/components/d-flow/DFlow.service.js +62 -47
  23. package/dist/components/d-flow/DFlow.util.d.ts +4 -0
  24. package/dist/components/d-flow/DFlow.util.js +63 -0
  25. package/dist/components/d-flow/DFlowEdge.js +34 -34
  26. package/dist/components/d-flow-data-type/DFlowDataType.service.js +17 -14
  27. package/dist/components/d-flow-data-type/DFlowDataType.view.d.ts +7 -4
  28. package/dist/components/d-flow-data-type/DFlowDataType.view.js +11 -6
  29. package/dist/components/d-flow-file/DFlowTabDefault.d.ts +0 -3
  30. package/dist/components/d-flow-file/DFlowTabDefault.js +77 -112
  31. package/dist/components/d-flow-file/DFlowTabTrigger.js +38 -49
  32. package/dist/components/d-flow-file/DFlowTabs.js +26 -27
  33. package/dist/components/d-flow-folder/DFlowFolder.js +170 -143
  34. package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +18 -11
  35. package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +1 -0
  36. package/dist/components/d-flow-function/DFlowFunction.input.hook.js +4 -5
  37. package/dist/components/d-flow-function/DFlowFunction.return.hook.js +1 -1
  38. package/dist/components/d-flow-function/DFlowFunction.view.d.ts +14 -11
  39. package/dist/components/d-flow-function/DFlowFunction.view.js +19 -12
  40. package/dist/components/d-flow-function/DFlowFunctionDefaultCard.js +72 -75
  41. package/dist/components/d-flow-function/DFlowFunctionSuggestionCard.js +27 -32
  42. package/dist/components/d-flow-function/DFlowFunctionTriggerCard.js +17 -10
  43. package/dist/components/d-flow-input/DFlowInputDataType.js +38 -33
  44. package/dist/components/d-flow-input/DFlowInputDefault.d.ts +10 -0
  45. package/dist/components/d-flow-input/DFlowInputDefault.js +128 -0
  46. package/dist/components/d-flow-input/DFlowInputLiteralBadge.d.ts +7 -0
  47. package/dist/components/d-flow-input/DFlowInputLiteralBadge.js +24 -0
  48. package/dist/components/d-flow-input/DFlowInputNodeBadge.d.ts +11 -0
  49. package/dist/components/d-flow-input/DFlowInputNodeBadge.js +44 -0
  50. package/dist/components/d-flow-input/DFlowInputReferenceBadge.d.ts +11 -0
  51. package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +33 -0
  52. package/dist/components/d-flow-panel/DFlowExport.js +1 -1
  53. package/dist/components/d-flow-panel/DFlowMiniMap.js +1 -1
  54. package/dist/components/d-flow-panel/DFlowPanelControl.js +34 -32
  55. package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.d.ts +3 -0
  56. package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.js +34 -0
  57. package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.d.ts +3 -0
  58. package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +50 -0
  59. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.d.ts +3 -0
  60. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +133 -0
  61. package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.d.ts +3 -18
  62. package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +19 -156
  63. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +47 -58
  64. package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.util.js +5 -4
  65. package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +6 -6
  66. package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.d.ts +3 -0
  67. package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +44 -0
  68. package/dist/components/d-flow-type/DFlowType.view.d.ts +5 -5
  69. package/dist/components/d-flow-type/DFlowType.view.js +22 -12
  70. package/dist/components/d-flow-validation/DFlowValidation.hook.js +1 -1
  71. package/dist/components/d-flow-validation/DNodeValidation.hook.js +39 -43
  72. package/dist/components/d-resizable/DResizable.d.ts +4 -4
  73. package/dist/components/d-resizable/DResizable.js +22 -21
  74. package/dist/components/d-user/DUserInput.js +23 -21
  75. package/dist/components/file-tabs/FileTabs.service.d.ts +0 -1
  76. package/dist/components/file-tabs/FileTabs.service.js +49 -53
  77. package/dist/components/form/EmailInput.js +9 -9
  78. package/dist/components/form/Input.d.ts +2 -1
  79. package/dist/components/form/Input.js +294 -397
  80. package/dist/components/form/Input.syntax.hook.d.ts +1 -18
  81. package/dist/components/form/Input.syntax.hook.js +7 -73
  82. package/dist/components/form/Input.utils.d.ts +1 -2
  83. package/dist/components/form/Input.utils.js +26 -21
  84. package/dist/components/form/InputContentEditable.hook.d.ts +40 -0
  85. package/dist/components/form/InputContentEditable.hook.js +471 -0
  86. package/dist/components/form/InputSuggestion.d.ts +2 -2
  87. package/dist/components/form/InputSuggestion.js +169 -107
  88. package/dist/components/form/PasswordInput.js +8 -8
  89. package/dist/components/form/TextInput.js +11 -11
  90. package/dist/components/form/useForm.d.ts +1 -0
  91. package/dist/components/form/useForm.js +45 -60
  92. package/dist/components/menu/Menu.js +4 -4
  93. package/dist/index.js +155 -154
  94. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +30 -30
  95. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +8 -8
  96. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +8 -8
  97. package/dist/node_modules/fast-deep-equal/index.js +31 -0
  98. package/dist/node_modules/object-assign/index.js +49 -0
  99. package/dist/node_modules/prop-types/checkPropTypes.js +54 -0
  100. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
  101. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
  102. package/dist/node_modules/prop-types/index.js +17 -0
  103. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
  104. package/dist/node_modules/prop-types/lib/has.js +7 -0
  105. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +87 -0
  106. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +70 -0
  107. package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
  108. package/dist/node_modules/react-contenteditable/lib/react-contenteditable.js +132 -0
  109. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +6235 -0
  110. package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +4096 -0
  111. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +6753 -0
  112. package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.js +4645 -0
  113. package/dist/node_modules/react-dom/server.browser.js +15 -0
  114. package/dist/utils/generics.d.ts +2 -0
  115. package/dist/utils/generics.js +93 -80
  116. package/dist/utils/index.js +22 -21
  117. package/dist/utils/inspection.d.ts +4 -2
  118. package/dist/utils/inspection.js +27 -2
  119. package/package.json +10 -8
  120. package/dist/components/form/Input.selection.hook.d.ts +0 -17
  121. package/dist/components/form/Input.selection.hook.js +0 -78
  122. package/dist/components/form/InputSyntax.d.ts +0 -19
  123. package/dist/components/form/InputSyntax.js +0 -52
  124. package/dist/components/form/inputSyntaxMapping.d.ts +0 -3
  125. package/dist/components/form/inputSyntaxMapping.js +0 -42
@@ -1,156 +1,218 @@
1
- import { jsx as d, jsxs as C } from "react/jsx-runtime";
2
- import { c as R } from "../../_virtual/compiler-runtime.js";
3
- import { MenuContent as D, MenuLabel as E, MenuItem as G } from "../menu/Menu.js";
4
- import u from "react";
5
- import { ScrollArea as L, ScrollAreaViewport as P, ScrollAreaScrollbar as F, ScrollAreaThumb as O } from "../scroll-area/ScrollArea.js";
6
- import { IconChevronDown as T, IconChevronUp as V } from "@tabler/icons-react";
7
- const K = u.forwardRef((l, S) => {
8
- const t = R.c(12);
9
- let i, h, m;
10
- t[0] !== l ? ({
11
- children: i,
12
- inputRef: h,
13
- ...m
14
- } = l, t[0] = l, t[1] = i, t[2] = h, t[3] = m) : (i = t[1], h = t[2], m = t[3]);
15
- const v = u.useRef(null);
16
- let c, s;
17
- t[4] !== h ? (c = (a) => {
18
- a.preventDefault(), h?.current?.focus({
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
- }, s = () => h?.current?.focus({
57
+ }, f = () => p?.current?.focus({
22
58
  preventScroll: !0
23
- }), t[4] = h, t[5] = c, t[6] = s) : (c = t[5], s = t[6]);
24
- let o;
25
- return t[7] !== i || t[8] !== m || t[9] !== c || t[10] !== s ? (o = /* @__PURE__ */ d(D, { ref: v, onContextMenuCapture: j, onInteractOutside: k, onCloseAutoFocus: z, onOpenAutoFocus: c, onFocusCapture: s, align: "start", sideOffset: 8, ...m, children: i }), t[7] = i, t[8] = m, t[9] = c, t[10] = s, t[11] = o) : o = t[11], o;
26
- }), Q = u.forwardRef((l, S) => {
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: t,
29
- onSuggestionSelect: i = () => {
66
+ suggestions: n,
67
+ onSuggestionSelect: l = () => {
30
68
  },
31
- inputRef: h,
32
- ...m
33
- } = l, v = u.useRef([]), [c, s] = u.useState({}), [o, a] = u.useState(null);
34
- u.useEffect(() => {
35
- if (!t) {
36
- s({});
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
- s((e) => {
85
+ m((t) => {
40
86
  const r = {};
41
- return t.forEach((f) => {
42
- f.groupBy && (e.hasOwnProperty(f.groupBy) ? r[f.groupBy] = e[f.groupBy] : r[f.groupBy] = !1);
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
- }, [t]);
91
+ }, [n]);
46
92
  const {
47
- groupLabelCount: B,
48
- visibleSuggestionCount: M,
49
- visibleSuggestions: n
50
- } = u.useMemo(() => {
51
- if (!t) return {
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 e = 0, r = 0;
57
- const f = [];
58
- return t.forEach((g, y, I) => {
59
- const p = y > 0 ? I[y - 1]?.groupBy : void 0;
60
- g.groupBy && g.groupBy !== p && (e += 1), (g.groupBy ? c[g.groupBy] : !1) || (r += 1, f.push(g));
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: e,
108
+ groupLabelCount: t,
63
109
  visibleSuggestionCount: r,
64
- visibleSuggestions: f
110
+ visibleSuggestions: s
65
111
  };
66
- }, [c, t]);
67
- u.useEffect(() => {
68
- a((e) => e === null ? e : e > n.length - 1 ? n.length ? n.length - 1 : null : e);
69
- }, [n]), u.useEffect(() => {
70
- o !== null && v.current[o]?.scrollIntoView({
71
- block: "nearest"
72
- });
73
- }, [o]), u.useImperativeHandle(S, () => ({
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 (n.length)
76
- return a(0), n[0];
128
+ if (o.length)
129
+ return a(0, {
130
+ scrollIntoView: !0
131
+ }), o[0];
77
132
  },
78
133
  focusLastItem: () => {
79
- if (!n.length) return;
80
- const e = n.length - 1;
81
- return a(e), n[e];
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 (!n.length) return;
85
- a((r) => r === null ? 0 : Math.min(r + 1, n.length - 1));
86
- const e = o === null ? 0 : Math.min(o + 1, n.length - 1);
87
- return n[e];
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 (!n.length) return;
91
- a((r) => r === null ? n.length - 1 : Math.max(r - 1, 0));
92
- const e = o === null ? n.length - 1 : Math.max(o - 1, 0);
93
- return n[e];
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
- if (o === null || !n[o]) return;
97
- const e = n[o];
98
- return setTimeout(() => i(e), 0), e;
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
- }), [o, i, n]);
102
- const w = (e) => {
103
- s((r) => ({
161
+ }), [l, a, o]);
162
+ const b = (t) => {
163
+ m((r) => ({
104
164
  ...r,
105
- [e]: !r[e]
165
+ [t]: !r[t]
106
166
  }));
107
- };
108
- v.current = [];
109
- let A = -1;
110
- return /* @__PURE__ */ C(L, { h: `${Math.max(M + B, 1) * 27}px`, mah: "calc(var(--radix-popper-available-height) - 3rem - 69px)", ...m, children: [
111
- /* @__PURE__ */ d(P, { children: t?.map((e, r, f) => {
112
- const g = r > 0 ? f[r - 1]?.groupBy : void 0, y = e.groupBy && e.groupBy !== g, I = e.groupBy ? c[e.groupBy] : !1, p = I ? null : ++A, b = p !== null && o === p;
113
- return /* @__PURE__ */ C(u.Fragment, { children: [
114
- y && e.groupBy && /* @__PURE__ */ C(E, { onPointerDown: (x) => x.preventDefault(), onClick: () => w(e.groupBy), style: {
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__ */ d("span", { children: e.groupBy }),
121
- I ? /* @__PURE__ */ d(T, { size: 16 }) : /* @__PURE__ */ d(V, { size: 16 })
184
+ /* @__PURE__ */ I("span", { children: t.groupBy }),
185
+ R ? /* @__PURE__ */ I($, { size: 16 }) : /* @__PURE__ */ I(z, { size: 16 })
122
186
  ] }),
123
- !I && /* @__PURE__ */ d(
124
- G,
187
+ !R && /* @__PURE__ */ I(
188
+ D,
125
189
  {
126
- textValue: "",
127
- onPointerDown: (x) => {
128
- x.preventDefault(), h?.current?.focus({
129
- preventScroll: !0
130
- }), p !== null && a(p);
131
- },
132
- onPointerMove: () => p !== null && a(p),
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__ */ d(F, { orientation: "vertical", children: /* @__PURE__ */ d(O, {}) })
201
+ /* @__PURE__ */ I(T, { orientation: "vertical", children: /* @__PURE__ */ I(j, {}) })
142
202
  ] });
143
203
  });
144
- function j(l) {
145
- return l.stopPropagation();
204
+ V.displayName = "InputSuggestionMenuContentItems";
205
+ const _ = i.memo(V);
206
+ function H(u) {
207
+ return u.stopPropagation();
146
208
  }
147
- function k(l) {
148
- return l.target instanceof HTMLInputElement && l.preventDefault();
209
+ function U(u) {
210
+ return u.target instanceof HTMLInputElement && u.preventDefault();
149
211
  }
150
- function z(l) {
151
- return l.preventDefault();
212
+ function q(u) {
213
+ return u.preventDefault();
152
214
  }
153
215
  export {
154
- K as InputSuggestionMenuContent,
155
- Q as InputSuggestionMenuContentItems
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 h } from "./Input.js";
4
- import { IconEye as d, IconX as y } from "@tabler/icons-react";
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 { setElementKey as f } from "./Input.utils.js";
7
- const C = n.forwardRef((s, t) => {
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: a = !0,
11
- visible: p = !0,
10
+ clearable: s = !0,
11
+ visible: a = !0,
12
12
  right: c,
13
13
  ...u
14
- } = s, l = (r) => (t.current && f(t.current, "value", "", "change"), r.stopPropagation(), r.preventDefault(), !1), m = (r) => (t.current && t.current.type == "password" ? t.current.type = "text" : t.current && t.current.type == "text" && (t.current.type = "password"), r.stopPropagation(), r.preventDefault(), !1), o = [c];
15
- return p && o.push(/* @__PURE__ */ e(i, { variant: "none", onClick: (r) => m(r), children: /* @__PURE__ */ e(d, { size: 13 }) })), a && o.push(/* @__PURE__ */ e(i, { variant: "none", onClick: (r) => l(r), children: /* @__PURE__ */ e(y, { size: 13 }) })), /* @__PURE__ */ e(h, { right: o, rightType: "action", type: "password", ref: t, ...u });
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 o } from "react/jsx-runtime";
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 s } from "../button/Button.js";
6
- import { setElementKey as p } from "./Input.utils.js";
7
- const R = i.forwardRef((e, t) => {
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: a = !1,
11
- right: l,
12
- ...c
13
- } = e, m = (r) => {
14
- t.current && p(t.current, "value", "", "change"), e.onClear && e.onClear(r);
15
- }, n = [l];
16
- return a && n.push(/* @__PURE__ */ o(s, { variant: "none", onClick: (r) => m(r), children: /* @__PURE__ */ o(f, { size: 13 }) })), /* @__PURE__ */ o(u, { right: n, type: "text", ref: t, ...c });
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 { c as j } from "../../_virtual/compiler-runtime.js";
2
- import { useState as w, useEffect as E } from "react";
3
- function h(i, t, e) {
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 x(i) {
7
- var t = N(i, "string");
5
+ function w(r) {
6
+ var t = S(r, "string");
8
7
  return typeof t == "symbol" ? t : t + "";
9
8
  }
10
- function N(i, t) {
11
- if (typeof i != "object" || !i) return i;
12
- var e = i[Symbol.toPrimitive];
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 r = e.call(i, t);
15
- if (typeof r != "object") return r;
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)(i);
17
+ return (t === "string" ? String : Number)(r);
19
18
  }
20
- class _ {
21
- constructor(t, e, r, s) {
22
- h(this, "changeValue", void 0), h(this, "initialRender", void 0), h(this, "currentValues", void 0), h(this, "currentValidations", void 0), this.changeValue = t, this.currentValues = e, this.currentValidations = r, this.initialRender = s;
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], r = e ?? null, s = t, l = this.currentValidations && this.currentValidations[t] ? this.currentValidations[t] : (n) => null, a = this.initialRender ? null : l(e, this.currentValues);
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: r,
38
- initialValue: r,
36
+ defaultValue: n,
37
+ initialValue: n,
39
38
  formValidation: {
40
- setValue: (n) => {
41
- this.changeValue(s, n);
39
+ setValue: (i) => {
40
+ this.changeValue(u, i);
42
41
  },
43
- ...this.initialRender ? {
44
- valid: !0
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 I = (i) => {
57
- const t = j.c(17), {
58
- initialValues: e,
59
- validate: r,
60
- onSubmit: s
61
- } = i;
62
- let l;
63
- t[0] !== r ? (l = r === void 0 ? {} : r, t[0] = r, t[1] = l) : l = t[1];
64
- const a = l, [n, b] = w(e), [R, y] = w(!1);
65
- let u, o;
66
- t[2] !== e ? (u = () => {
67
- b(e), y(!1);
68
- }, o = [e], t[2] = e, t[3] = u, t[4] = o) : (u = t[3], o = t[4]), E(u, o);
69
- let c;
70
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (c = (g, S) => {
71
- b((F) => ({
72
- ...F,
73
- [g]: S
74
- }));
75
- }, t[5] = c) : c = t[5];
76
- const P = c, m = !R;
77
- let d;
78
- t[6] !== m || t[7] !== a || t[8] !== n ? (d = new _(P, n, a, m), t[6] = m, t[7] = a, t[8] = n, t[9] = d) : d = t[9];
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
- I as useForm
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 { DropdownMenuContent as m, DropdownMenuLabel as f, DropdownMenuItem 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";
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(m, { align: n, ...i }), e[3] = o.align, e[4] = i, e[5] = s) : s = e[5], s;
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(f, { ...u }), e[2] = u, e[3] = t) : t = e[3], t;
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(_, { ...u }), e[2] = u, e[3] = t) : t = e[3], t;
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;