@code0-tech/pictor 0.0.0-mvp.20 → 0.0.0-mvp.21
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.
|
@@ -3,21 +3,21 @@ import f from "react";
|
|
|
3
3
|
import { Card as u } from "../card/Card.js";
|
|
4
4
|
import { useService as S, useStore as l } from "../../utils/contextStore.js";
|
|
5
5
|
import "merge-props";
|
|
6
|
-
import { DNamespaceProjectReactiveService as
|
|
6
|
+
import { DNamespaceProjectReactiveService as i } from "./DNamespaceProject.service.js";
|
|
7
7
|
import v from "../card/CardSection.js";
|
|
8
8
|
import { DNamespaceProjectContent as j } from "./DNamespaceProjectContent.js";
|
|
9
|
-
const b = (
|
|
9
|
+
const b = (c) => {
|
|
10
10
|
const {
|
|
11
|
-
namespaceId:
|
|
11
|
+
namespaceId: t,
|
|
12
12
|
filter: m = () => !0,
|
|
13
13
|
onSetting: s,
|
|
14
|
-
onSelect:
|
|
14
|
+
onSelect: o,
|
|
15
15
|
...n
|
|
16
|
-
} =
|
|
17
|
-
namespaceId:
|
|
18
|
-
}), [a]);
|
|
16
|
+
} = c, p = S(i), a = l(i), d = f.useMemo(() => p.values({
|
|
17
|
+
namespaceId: t
|
|
18
|
+
}), [a, t]);
|
|
19
19
|
return /* @__PURE__ */ r(u, { ...n, children: d.filter(m).map((e) => e.id && /* @__PURE__ */ r(v, { border: !0, hover: !0, onClick: () => {
|
|
20
|
-
|
|
20
|
+
o && o(e.id);
|
|
21
21
|
}, children: /* @__PURE__ */ r(j, { onSetting: s, projectId: e?.id }) }, e.id)) });
|
|
22
22
|
};
|
|
23
23
|
export {
|
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
|
4
5
|
}
|
|
5
|
-
function
|
|
6
|
-
var t =
|
|
6
|
+
function x(i) {
|
|
7
|
+
var t = N(i, "string");
|
|
7
8
|
return typeof t == "symbol" ? t : t + "";
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
-
if (typeof
|
|
11
|
-
var
|
|
12
|
-
if (
|
|
13
|
-
var r =
|
|
10
|
+
function N(i, t) {
|
|
11
|
+
if (typeof i != "object" || !i) return i;
|
|
12
|
+
var e = i[Symbol.toPrimitive];
|
|
13
|
+
if (e !== void 0) {
|
|
14
|
+
var r = e.call(i, t);
|
|
14
15
|
if (typeof r != "object") return r;
|
|
15
16
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16
17
|
}
|
|
17
|
-
return (t === "string" ? String : Number)(
|
|
18
|
+
return (t === "string" ? String : Number)(i);
|
|
18
19
|
}
|
|
19
|
-
class
|
|
20
|
-
constructor(t,
|
|
21
|
-
|
|
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;
|
|
22
23
|
}
|
|
23
24
|
isValid() {
|
|
24
25
|
if (!this.currentValidations) return !0;
|
|
25
26
|
for (const t in this.currentValidations) {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
27
|
+
const e = this.currentValidations[t];
|
|
28
|
+
if (e && e(this.currentValues[t], this.currentValues) !== null)
|
|
28
29
|
return !1;
|
|
29
30
|
}
|
|
30
31
|
return !0;
|
|
31
32
|
}
|
|
32
33
|
getInputProps(t) {
|
|
33
|
-
const
|
|
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);
|
|
34
35
|
return {
|
|
35
|
-
|
|
36
|
+
// @ts-ignore – z.B. wenn dein Input `defaultValue` kennt
|
|
37
|
+
defaultValue: r,
|
|
36
38
|
formValidation: {
|
|
37
|
-
setValue: (
|
|
38
|
-
this.changeValue(
|
|
39
|
+
setValue: (n) => {
|
|
40
|
+
this.changeValue(s, n);
|
|
39
41
|
},
|
|
40
42
|
...this.initialRender ? {
|
|
41
43
|
valid: !0
|
|
42
44
|
} : {
|
|
43
|
-
notValidMessage:
|
|
44
|
-
valid:
|
|
45
|
+
notValidMessage: a,
|
|
46
|
+
valid: a === null
|
|
45
47
|
}
|
|
46
48
|
},
|
|
47
49
|
...this.currentValidations && this.currentValidations[t] ? {
|
|
@@ -50,17 +52,40 @@ class d {
|
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
|
-
const
|
|
54
|
-
const {
|
|
55
|
-
initialValues:
|
|
56
|
-
validate:
|
|
57
|
-
onSubmit:
|
|
58
|
-
} =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
const I = (i) => {
|
|
56
|
+
const t = j.c(17), {
|
|
57
|
+
initialValues: e,
|
|
58
|
+
validate: r,
|
|
59
|
+
onSubmit: s
|
|
60
|
+
} = i;
|
|
61
|
+
let l;
|
|
62
|
+
t[0] !== r ? (l = r === void 0 ? {} : r, t[0] = r, t[1] = l) : l = t[1];
|
|
63
|
+
const a = l, [n, b] = w(e), [R, y] = w(!1);
|
|
64
|
+
let u, o;
|
|
65
|
+
t[2] !== e ? (u = () => {
|
|
66
|
+
b(e), y(!1);
|
|
67
|
+
}, o = [e], t[2] = e, t[3] = u, t[4] = o) : (u = t[3], o = t[4]), E(u, o);
|
|
68
|
+
let c;
|
|
69
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (c = (g, S) => {
|
|
70
|
+
b((F) => ({
|
|
71
|
+
...F,
|
|
72
|
+
[g]: S
|
|
73
|
+
}));
|
|
74
|
+
}, t[5] = c) : c = t[5];
|
|
75
|
+
const P = c, m = !R;
|
|
76
|
+
let d;
|
|
77
|
+
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];
|
|
78
|
+
const v = d;
|
|
79
|
+
let f;
|
|
80
|
+
t[10] !== s || t[11] !== a || t[12] !== n ? (f = () => {
|
|
81
|
+
y(!0);
|
|
82
|
+
const g = new _(P, n, a, !1);
|
|
83
|
+
s && g.isValid() && s(n);
|
|
84
|
+
}, t[10] = s, t[11] = a, t[12] = n, t[13] = f) : f = t[13];
|
|
85
|
+
const p = f;
|
|
86
|
+
let V;
|
|
87
|
+
return t[14] !== p || t[15] !== v ? (V = [v, p], t[14] = p, t[15] = v, t[16] = V) : V = t[16], V;
|
|
63
88
|
};
|
|
64
89
|
export {
|
|
65
|
-
|
|
90
|
+
I as useForm
|
|
66
91
|
};
|