@code0-tech/pictor 0.0.0-mvp.40 → 0.0.0-mvp.42
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/assets/components/data-table/DataTable.style.css +1 -0
- package/dist/assets/components/menu/Menu.style.css +1 -1
- package/dist/components/d-flow/DFlow.service.js +80 -100
- package/dist/components/d-flow-data-type/DFlowDataType.service.js +6 -7
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.d.ts +1 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js +15 -15
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.d.ts +1 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js +17 -17
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.d.ts +1 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.js +1 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.d.ts +2 -1
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js +87 -85
- package/dist/components/d-flow-data-type/rules/DFlowDataTypeRule.d.ts +2 -1
- package/dist/components/d-flow-function/DFlowFunction.input.hook.d.ts +2 -1
- package/dist/components/d-flow-function/DFlowFunction.input.hook.js +5 -5
- package/dist/components/d-flow-function/DFlowFunction.return.hook.d.ts +2 -1
- package/dist/components/d-flow-function/DFlowFunction.return.hook.js +5 -5
- package/dist/components/d-flow-input/DFlowInputDataTypeEditDialog.js +1 -1
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +17 -17
- package/dist/components/d-flow-node/DFlowNode.return.hook.d.ts +5 -0
- package/dist/components/d-flow-node/DFlowNode.return.hook.js +27 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +90 -91
- package/dist/components/d-flow-validation/DDataTypeValidation.hook.js +1 -1
- package/dist/components/d-flow-validation/DNodeValidation.hook.js +33 -33
- package/dist/components/d-flow-validation/DValueValidation.hook.d.ts +2 -1
- package/dist/components/d-flow-validation/DValueValidation.hook.js +5 -5
- package/dist/components/d-project/DNamespaceProject.service.d.ts +2 -1
- package/dist/components/data-table/DataTable.d.ts +23 -0
- package/dist/components/data-table/DataTable.js +41 -0
- package/dist/components/data-table/DataTableColumn.d.ts +6 -0
- package/dist/components/data-table/DataTableColumn.js +22 -0
- package/dist/components/data-table/DataTableFilterInput.d.ts +18 -0
- package/dist/components/data-table/DataTableFilterInput.js +210 -0
- package/dist/components/data-table/DataTableFilterSuggestionMenu.d.ts +7 -0
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +53 -0
- package/dist/components/data-table/index.d.ts +4 -0
- package/dist/components/data-table/index.js +11 -0
- package/dist/components/editor/Editor.d.ts +9 -3
- package/dist/components/editor/Editor.js +249 -174
- package/dist/components/menu/Menu.d.ts +5 -1
- package/dist/components/menu/Menu.js +73 -57
- package/dist/index.d.ts +1 -0
- package/dist/index.js +182 -171
- package/dist/node_modules/@lezer/highlight/dist/index.js +132 -169
- package/dist/utils/generics.d.ts +2 -1
- package/dist/utils/generics.js +84 -80
- package/package.json +32 -21
- package/dist/node_modules/@codemirror/language/dist/index.js +0 -429
- package/dist/node_modules/@codemirror/lint/dist/index.js +0 -515
- package/dist/node_modules/@codemirror/state/dist/index.js +0 -2614
- package/dist/node_modules/@codemirror/view/dist/index.js +0 -6227
- package/dist/node_modules/@lezer/common/dist/index.js +0 -1357
- package/dist/node_modules/@marijn/find-cluster-break/src/index.js +0 -69
- package/dist/node_modules/crelt/index.js +0 -27
- package/dist/node_modules/style-mod/src/style-mod.js +0 -109
- package/dist/node_modules/w3c-keyname/index.js +0 -88
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useService as
|
|
1
|
+
import g from "react";
|
|
2
|
+
import { useService as I, useStore as N } from "../../utils/contextStore.js";
|
|
3
3
|
import "merge-props";
|
|
4
|
-
import { DFlowDataTypeReactiveService as
|
|
4
|
+
import { DFlowDataTypeReactiveService as x } from "../d-flow-data-type/DFlowDataType.service.js";
|
|
5
5
|
import "js-md5";
|
|
6
|
-
import { DFlowSuggestionType as
|
|
7
|
-
import { replaceGenericsAndSortType as
|
|
8
|
-
import { DFlowFunctionReactiveService as
|
|
6
|
+
import { DFlowSuggestionType as A } from "./DFlowSuggestion.view.js";
|
|
7
|
+
import { replaceGenericsAndSortType as C, resolveType as P, isMatchingType as V, resolveGenericKeys as Y, targetForGenericKey as k, replaceGenericKeysInType as J } from "../../utils/generics.js";
|
|
8
|
+
import { DFlowFunctionReactiveService as O } from "../d-flow-function/DFlowFunction.service.js";
|
|
9
9
|
import "../d-flow/DFlow.js";
|
|
10
|
-
import { DFlowReactiveService as
|
|
11
|
-
import {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
if (!
|
|
10
|
+
import { DFlowReactiveService as R } from "../d-flow/DFlow.service.js";
|
|
11
|
+
import { useReturnTypes as j } from "../d-flow-node/DFlowNode.return.hook.js";
|
|
12
|
+
const re = (n, t, o, u = []) => {
|
|
13
|
+
const f = I(x), r = N(x), v = I(R), T = N(R), M = $(n), S = g.useMemo(() => t ? M?.find((i) => i.nodeFunctionId === t) : void 0, [M, t]), B = g.useMemo(() => t ? v.getNodeById(n, t)?.parameters?.nodes?.map((a) => a?.value).filter((a) => a?.__typename === "NodeFunctionIdWrapper") ?? [] : [], [n, t, v, T]), c = g.useMemo(() => o ? C(P(o, f), u) : void 0, [o, f, r, u]), p = U(n), m = j(n);
|
|
14
|
+
return g.useMemo(() => {
|
|
15
|
+
if (!c || !S) return [];
|
|
16
16
|
const {
|
|
17
17
|
depth: i,
|
|
18
|
-
scope:
|
|
19
|
-
node:
|
|
20
|
-
} =
|
|
21
|
-
return
|
|
18
|
+
scope: a,
|
|
19
|
+
node: l
|
|
20
|
+
} = S;
|
|
21
|
+
return p.flatMap((e) => {
|
|
22
22
|
if (e.node === null || e.node === void 0) return [];
|
|
23
23
|
if (e.depth === null || e.depth === void 0) return [];
|
|
24
24
|
if (e.scope === null || e.scope === void 0) return [];
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
if (
|
|
28
|
-
if (!
|
|
25
|
+
const d = e.parameterIndex !== void 0 && e.inputTypeIndex !== void 0, D = d ? e.scope?.every((s, F) => a?.[F] === s) : !0;
|
|
26
|
+
if (d && !D) return [];
|
|
27
|
+
if (B.some((s) => s.id === e.nodeFunctionId)) return [];
|
|
28
|
+
if (!d && e.node >= l) return [];
|
|
29
29
|
if (e.depth > i) return [];
|
|
30
|
-
if (e.scope.some((
|
|
31
|
-
const
|
|
32
|
-
return
|
|
30
|
+
if (e.scope.some((s) => !a.includes(s))) return [];
|
|
31
|
+
const h = m.get(e.nodeFunctionId), E = C(P(h, f), []);
|
|
32
|
+
return V(c, E) ? [{
|
|
33
33
|
path: [],
|
|
34
|
-
type:
|
|
35
|
-
displayText: [`${e.depth}-${e.scope}-${e.node || ""}-${e.referencePath?.map((
|
|
34
|
+
type: A.REF_OBJECT,
|
|
35
|
+
displayText: [`${e.depth}-${e.scope}-${e.node || ""}-${e.referencePath?.map((s) => s.path).join(".") ?? ""}`],
|
|
36
36
|
value: e
|
|
37
37
|
}] : [];
|
|
38
38
|
});
|
|
39
|
-
}, [
|
|
40
|
-
},
|
|
41
|
-
const t =
|
|
42
|
-
N(
|
|
43
|
-
const o =
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
}) ?? [], [r]),
|
|
39
|
+
}, [f, S, B, p, c]);
|
|
40
|
+
}, U = (n) => {
|
|
41
|
+
const t = I(x);
|
|
42
|
+
N(x);
|
|
43
|
+
const o = I(O), u = I(R), f = N(R), r = g.useMemo(() => u.getById(n), [n, f]), v = $(n), T = j(n), M = g.useMemo(() => r?.nodes?.nodes?.map((c) => {
|
|
44
|
+
const p = T.get(c?.id), m = v?.find((i) => i.nodeFunctionId === c?.id);
|
|
45
|
+
return p && m ? G(m, p, t) : {};
|
|
46
|
+
}) ?? [], [r]), S = g.useMemo(() => G({
|
|
47
47
|
node: 0,
|
|
48
48
|
depth: 0,
|
|
49
49
|
nodeFunctionId: "gid://sagittarius/NodeFunction/-1",
|
|
@@ -51,37 +51,37 @@ const oe = (n, t, o, m = []) => {
|
|
|
51
51
|
}, {
|
|
52
52
|
dataType: r?.inputType
|
|
53
53
|
}), [r]);
|
|
54
|
-
return [...
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
57
|
-
const
|
|
58
|
-
return (
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
61
|
-
const e = t.getDataType(
|
|
54
|
+
return [...g.useMemo(() => r?.nodes?.nodes?.length ? r.nodes.nodes.flatMap((c) => {
|
|
55
|
+
const p = o.getById(c?.functionDefinition?.id);
|
|
56
|
+
if (!p) return [];
|
|
57
|
+
const m = c?.parameters?.nodes?.map((i) => i?.value).filter(Boolean) ?? [];
|
|
58
|
+
return (p.parameterDefinitions ?? []).flatMap((i, a) => {
|
|
59
|
+
const l = i?.dataTypeIdentifier;
|
|
60
|
+
if (!l) return [];
|
|
61
|
+
const e = t.getDataType(l);
|
|
62
62
|
if (!e || e.variant !== "NODE") return [];
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
67
|
-
const
|
|
68
|
-
return
|
|
69
|
-
const
|
|
70
|
-
return
|
|
71
|
-
...
|
|
72
|
-
nodeFunctionId:
|
|
73
|
-
parameterIndex:
|
|
74
|
-
inputTypeIndex:
|
|
75
|
-
inputTypeIdentifier:
|
|
76
|
-
},
|
|
63
|
+
const d = c?.parameters?.nodes?.find((y) => y?.parameterDefinition?.id === i?.id);
|
|
64
|
+
if (!d?.value || d.value.__typename !== "NodeFunctionIdWrapper") return [];
|
|
65
|
+
const D = v?.find((y) => d?.value?.__typename === "NodeFunctionIdWrapper" && y.nodeFunctionId === d.value?.id);
|
|
66
|
+
if (!D) return [];
|
|
67
|
+
const h = e.rules?.nodes?.filter((y) => y?.variant === "INPUT_TYPES") ?? [], E = Y(p, m, t, o), s = k(p, l), F = new Map([...E].map(([y, b]) => [s.get(y) ?? y, b]));
|
|
68
|
+
return h.flatMap((y) => (y?.config?.inputTypes ?? []).flatMap((W, K) => {
|
|
69
|
+
const w = J(W.dataTypeIdentifier, F);
|
|
70
|
+
return w ? G({
|
|
71
|
+
...D,
|
|
72
|
+
nodeFunctionId: c?.id,
|
|
73
|
+
parameterIndex: a,
|
|
74
|
+
inputTypeIndex: K,
|
|
75
|
+
inputTypeIdentifier: W.inputIdentifier
|
|
76
|
+
}, w, t) : [];
|
|
77
77
|
}));
|
|
78
78
|
});
|
|
79
|
-
}) : [], [r, v, o, t]), ...
|
|
80
|
-
},
|
|
81
|
-
const
|
|
82
|
-
return
|
|
79
|
+
}) : [], [r, v, o, t]), ...S, ...M].flat();
|
|
80
|
+
}, G = (n, t, o) => {
|
|
81
|
+
const u = o ? o.getDataType(t) : t.dataType ?? t.genericType?.dataType;
|
|
82
|
+
return u ? [...u.rules?.nodes?.map((r) => {
|
|
83
83
|
if (r?.variant === "CONTAINS_KEY")
|
|
84
|
-
return t ?
|
|
84
|
+
return t ? G({
|
|
85
85
|
...n,
|
|
86
86
|
referencePath: [...n.referencePath ?? [], {
|
|
87
87
|
path: r.config.key
|
|
@@ -89,45 +89,44 @@ const oe = (n, t, o, m = []) => {
|
|
|
89
89
|
}, r.config.dataTypeIdentifier) : void 0;
|
|
90
90
|
}).flat().filter((r) => !!r) ?? [], {
|
|
91
91
|
__typename: "ReferenceValue",
|
|
92
|
-
dataTypeIdentifier: t,
|
|
93
92
|
nodeFunctionId: n.nodeFunctionId,
|
|
94
93
|
...n
|
|
95
94
|
}] : [];
|
|
96
|
-
},
|
|
97
|
-
const t =
|
|
98
|
-
return
|
|
99
|
-
if (!t || !o || !
|
|
95
|
+
}, $ = (n) => {
|
|
96
|
+
const t = I(x), o = I(R), u = I(O), f = N(R), r = N(O), v = N(x), T = g.useMemo(() => o.getById(n), [n, f]);
|
|
97
|
+
return g.useMemo(() => {
|
|
98
|
+
if (!t || !o || !u || !T?.startingNodeId) return;
|
|
100
99
|
let M = 0;
|
|
101
|
-
const
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
if (!
|
|
105
|
-
let
|
|
106
|
-
for (;
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
109
|
-
if (
|
|
110
|
-
for (const
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
|
|
100
|
+
const S = () => ++M;
|
|
101
|
+
let B = 0;
|
|
102
|
+
const c = () => ++B, p = [], m = (i, a, l) => {
|
|
103
|
+
if (!i) return;
|
|
104
|
+
let e = i.__typename === "NodeFunctionIdWrapper" ? o.getNodeById(n, i.id) : i;
|
|
105
|
+
for (; e; ) {
|
|
106
|
+
const d = u.getById(e.functionDefinition?.id);
|
|
107
|
+
if (!d) break;
|
|
108
|
+
if (e.parameters && d.parameterDefinitions)
|
|
109
|
+
for (const h of d.parameterDefinitions) {
|
|
110
|
+
const E = t.getDataType(h.dataTypeIdentifier), s = e.parameters?.nodes?.find((F) => F?.parameterDefinition?.id === h.id);
|
|
111
|
+
if (E?.variant === "NODE") {
|
|
112
|
+
if (s?.value && s.value.__typename === "NodeFunctionIdWrapper") {
|
|
113
|
+
const F = [...l, S()];
|
|
114
|
+
m(s.value, a + 1, F);
|
|
116
115
|
}
|
|
117
|
-
} else
|
|
116
|
+
} else s?.value && s.value.__typename === "NodeFunctionIdWrapper" && m(s.value, a, l);
|
|
118
117
|
}
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
node:
|
|
122
|
-
depth:
|
|
123
|
-
scope:
|
|
124
|
-
nodeFunctionId:
|
|
125
|
-
}),
|
|
118
|
+
const D = c();
|
|
119
|
+
p.push({
|
|
120
|
+
node: D,
|
|
121
|
+
depth: a,
|
|
122
|
+
scope: l,
|
|
123
|
+
nodeFunctionId: e.id
|
|
124
|
+
}), e = o.getNodeById(T.id, e.nextNodeId);
|
|
126
125
|
}
|
|
127
126
|
};
|
|
128
|
-
return
|
|
129
|
-
}, [t,
|
|
127
|
+
return m(o.getNodeById(T.id, T.startingNodeId), 0, [0]), p;
|
|
128
|
+
}, [t, T, n, o, u, v, f, r]) ?? [];
|
|
130
129
|
};
|
|
131
130
|
export {
|
|
132
|
-
|
|
131
|
+
re as useReferenceSuggestions
|
|
133
132
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const g = ["id", "__typename", "createdAt", "updatedAt", "aliases", "displayMessages", "name", "runtime"], h = (l, u) => {
|
|
2
|
-
if (l
|
|
2
|
+
if (l?.variant !== u?.variant) return !1;
|
|
3
3
|
const c = (e) => e !== null && typeof e == "object", i = (e, r) => {
|
|
4
4
|
if (e === r) return !0;
|
|
5
5
|
const a = Array.isArray(e), y = Array.isArray(r);
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import
|
|
1
|
+
import S from "react";
|
|
2
2
|
import { DFlowDataTypeReactiveService as E } from "../d-flow-data-type/DFlowDataType.service.js";
|
|
3
3
|
import { DataTypeView as C } from "../d-flow-data-type/DFlowDataType.view.js";
|
|
4
|
-
import { useService as V, useStore as
|
|
4
|
+
import { useService as V, useStore as _ } from "../../utils/contextStore.js";
|
|
5
5
|
import { InspectionSeverity as P } from "../../utils/inspection.js";
|
|
6
6
|
import "merge-props";
|
|
7
7
|
import { resolveGenericKeys as U, replaceGenericKeysInType as q, replaceGenericKeysInDataTypeObject as z } from "../../utils/generics.js";
|
|
8
8
|
import { useReturnType as H } from "../d-flow-function/DFlowFunction.return.hook.js";
|
|
9
9
|
import { DFlowFunctionReactiveService as G } from "../d-flow-function/DFlowFunction.service.js";
|
|
10
10
|
import "js-md5";
|
|
11
|
-
import { useDataTypeValidation as
|
|
12
|
-
import { useValueValidation as
|
|
11
|
+
import { useDataTypeValidation as O } from "./DDataTypeValidation.hook.js";
|
|
12
|
+
import { useValueValidation as w } from "./DValueValidation.hook.js";
|
|
13
13
|
import "../d-flow/DFlow.js";
|
|
14
|
-
import { DFlowReactiveService as
|
|
15
|
-
const
|
|
16
|
-
parameterId:
|
|
14
|
+
import { DFlowReactiveService as M } from "../d-flow/DFlow.service.js";
|
|
15
|
+
const N = (t) => t.__typename === "ReferenceValue", F = (t) => t.__typename === "NodeFunctionIdWrapper", b = (t, r) => new C(z(t.json, r)), W = (t, r, i) => ({
|
|
16
|
+
parameterId: t,
|
|
17
17
|
type: P.ERROR,
|
|
18
18
|
message: [{
|
|
19
19
|
code: "en-US",
|
|
20
|
-
content: `Argument of type ${
|
|
20
|
+
content: `Argument of type ${i?.name[0]?.content} is not assignable to parameter of type ${r?.name[0]?.content}`
|
|
21
21
|
}]
|
|
22
|
-
}), ae = (
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
return H(o,
|
|
22
|
+
}), ae = (t, r) => {
|
|
23
|
+
const i = V(G), j = _(G), f = V(M), I = _(M), n = V(E), K = _(E), s = f.getById(r), l = f.getNodeById(r, t), T = l?.parameters?.nodes?.map((e) => e?.value) ?? [], m = i.getById(l?.functionDefinition?.id), R = m?.parameterDefinitions ?? [], h = m?.genericKeys ?? [], D = S.useMemo(() => U(m, T, n, i, s), [m, T, n, K, s, I]), x = S.useCallback((e, a) => {
|
|
24
|
+
if (F(e) && a?.variant !== "NODE" || N(e)) {
|
|
25
|
+
const d = f.getNodeById(r, e.__typename == "NodeFunctionIdWrapper" ? e.id : e.__typename === "ReferenceValue" ? e.nodeFunctionId : void 0), o = i.getById(d?.functionDefinition?.id), g = d?.parameters?.nodes?.map((p) => p?.value) ?? [];
|
|
26
|
+
return H(o, g, n, i);
|
|
27
27
|
}
|
|
28
|
-
return
|
|
29
|
-
}, [
|
|
30
|
-
return
|
|
31
|
-
const
|
|
32
|
-
for (let
|
|
33
|
-
const
|
|
28
|
+
return n.getTypeFromValue(e, s);
|
|
29
|
+
}, [n, s, r, f, i]);
|
|
30
|
+
return S.useMemo(() => {
|
|
31
|
+
const e = [];
|
|
32
|
+
for (let a = 0; a < R.length; a++) {
|
|
33
|
+
const d = R[a], o = T[a], g = l?.parameters?.nodes?.find((v) => v?.parameterDefinition?.id === d.id);
|
|
34
34
|
if (!o) continue;
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
|
|
35
|
+
const p = d.dataTypeIdentifier, B = q(p, D), c = n.getDataType(B), $ = x(o, c), y = n.getDataType($);
|
|
36
|
+
if (!c || !y) {
|
|
37
|
+
e.push(W(g?.id, c, y));
|
|
38
38
|
continue;
|
|
39
39
|
}
|
|
40
|
-
const k = !!
|
|
41
|
-
let
|
|
40
|
+
const k = !!p?.genericType || !!p?.genericKey && h.includes(p.genericKey);
|
|
41
|
+
let u = !0;
|
|
42
42
|
if (k) {
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const A = b(
|
|
46
|
-
|
|
43
|
+
const v = b(c, D);
|
|
44
|
+
if (N(o) || F(o) && c.variant !== "NODE") {
|
|
45
|
+
const A = b(y, D);
|
|
46
|
+
u = O(v, A);
|
|
47
47
|
} else
|
|
48
|
-
|
|
48
|
+
u = w(o, v, n, s, B?.genericType?.genericMappers, i);
|
|
49
49
|
} else
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
N(o) || F(o) && c.variant !== "NODE" ? u = O(c, y) : u = w(o, c, n, s, [], i);
|
|
51
|
+
u || e.push(W(g?.id, c, y));
|
|
52
52
|
}
|
|
53
|
-
return
|
|
54
|
-
}, [s,
|
|
53
|
+
return e.length > 0 ? e : null;
|
|
54
|
+
}, [s, l, T, m, R, h, D, x, t, r, j, I, K, n]);
|
|
55
55
|
};
|
|
56
56
|
export {
|
|
57
57
|
ae as useNodeValidation
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Flow, GenericMapper, NodeParameterValue } from '@code0-tech/sagittarius-graphql-types';
|
|
2
2
|
import { DataTypeView, DFlowDataTypeReactiveService } from '../d-flow-data-type';
|
|
3
|
-
|
|
3
|
+
import { DFlowFunctionReactiveService } from '../d-flow-function';
|
|
4
|
+
export declare const useValueValidation: (value: NodeParameterValue, dataType: DataTypeView, dataTypeService: DFlowDataTypeReactiveService, flow?: Flow, generics?: GenericMapper[], functionService?: DFlowFunctionReactiveService) => boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RuleMap as r } from "../d-flow-data-type/rules/DFlowDataTypeRules.js";
|
|
2
|
-
import { VariantsMap as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
return
|
|
2
|
+
import { VariantsMap as u } from "../d-flow-data-type/variants/DFlowDataTypeVariants.js";
|
|
3
|
+
const c = (a, i, n, e, o, s) => {
|
|
4
|
+
const f = new Map(o?.map((t) => [t.target, t])), p = i?.rules?.nodes?.every((t) => !t || !t.variant || !t.config ? !1 : r.get(t.variant) ? r.get(t.variant)?.validate(a, t.config, f, e, n, s) : !0) ?? !0, m = u.get(i.variant)?.validate(a) ?? !0;
|
|
5
|
+
return p && m;
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
c as useValueValidation
|
|
9
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Namespace, NamespaceProject, NamespacesProjectsAssignRuntimesInput, NamespacesProjectsAssignRuntimesPayload, NamespacesProjectsCreateInput, NamespacesProjectsCreatePayload, NamespacesProjectsDeleteInput, NamespacesProjectsDeletePayload } from '@code0-tech/sagittarius-graphql-types';
|
|
1
|
+
import { Namespace, NamespaceProject, NamespacesProjectsAssignRuntimesInput, NamespacesProjectsAssignRuntimesPayload, NamespacesProjectsCreateInput, NamespacesProjectsCreatePayload, NamespacesProjectsDeleteInput, NamespacesProjectsDeletePayload, NamespacesProjectsUpdateInput, NamespacesProjectsUpdatePayload } from '@code0-tech/sagittarius-graphql-types';
|
|
2
2
|
import { DNamespaceProjectView } from './DNamespaceProject.view';
|
|
3
3
|
import { ReactiveArrayService } from '../../utils';
|
|
4
4
|
export type DProjectDependencies = {
|
|
@@ -7,6 +7,7 @@ export type DProjectDependencies = {
|
|
|
7
7
|
export declare abstract class DNamespaceProjectReactiveService extends ReactiveArrayService<DNamespaceProjectView, DProjectDependencies> {
|
|
8
8
|
getById(id: NamespaceProject['id'], dependencies?: DProjectDependencies): DNamespaceProjectView | undefined;
|
|
9
9
|
abstract projectAssignRuntimes(payload: NamespacesProjectsAssignRuntimesInput): Promise<NamespacesProjectsAssignRuntimesPayload | undefined>;
|
|
10
|
+
abstract projectUpdate(payload: NamespacesProjectsUpdateInput): Promise<NamespacesProjectsUpdatePayload | undefined>;
|
|
10
11
|
abstract projectCreate(payload: NamespacesProjectsCreateInput): Promise<NamespacesProjectsCreatePayload | undefined>;
|
|
11
12
|
abstract projectDelete(payload: NamespacesProjectsDeleteInput): Promise<NamespacesProjectsDeletePayload | undefined>;
|
|
12
13
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Code0Component } from '../../utils';
|
|
3
|
+
export type DataTableFilterOperator = "isOneOf" | "isNotOneOf";
|
|
4
|
+
export interface DataTableFilterProps {
|
|
5
|
+
[key: string]: {
|
|
6
|
+
operator: DataTableFilterOperator;
|
|
7
|
+
value: string | string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface DataTableSortProps {
|
|
11
|
+
[key: string]: 'asc' | 'desc' | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface DataTableProps<T> extends Omit<Code0Component<HTMLTableElement>, 'data' | 'children' | 'onSelect'> {
|
|
14
|
+
data: Array<T>;
|
|
15
|
+
sort?: DataTableSortProps;
|
|
16
|
+
filter?: DataTableFilterProps;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
loadingComponent?: React.ReactNode;
|
|
19
|
+
emptyComponent?: React.ReactNode;
|
|
20
|
+
onSelect?: (item: T | undefined) => void;
|
|
21
|
+
children?: (item: T, index: number) => React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare const DataTable: <T>(props: DataTableProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as g, jsx as O } from "react/jsx-runtime";
|
|
2
|
+
import h from "react";
|
|
3
|
+
import '../../assets/components/data-table/DataTable.style.css';/* empty css */
|
|
4
|
+
import "../../utils/contextStore.js";
|
|
5
|
+
import { mergeCode0Props as C } from "../../utils/utils.js";
|
|
6
|
+
const d = (l, y) => y.split(".").reduce((t, f) => {
|
|
7
|
+
if (t != null)
|
|
8
|
+
return Array.isArray(t) ? t.map((a) => a?.[f]).filter((a) => a !== void 0) : t[f];
|
|
9
|
+
}, l), N = (l) => {
|
|
10
|
+
const {
|
|
11
|
+
data: y,
|
|
12
|
+
sort: t,
|
|
13
|
+
filter: f,
|
|
14
|
+
loading: a,
|
|
15
|
+
loadingComponent: j,
|
|
16
|
+
emptyComponent: A,
|
|
17
|
+
onSelect: u,
|
|
18
|
+
children: p,
|
|
19
|
+
...b
|
|
20
|
+
} = l, m = y.filter((i) => Object.entries(f || {}).every(([o, {
|
|
21
|
+
operator: n,
|
|
22
|
+
value: r
|
|
23
|
+
}]) => {
|
|
24
|
+
const e = d(i, o);
|
|
25
|
+
return n === "isOneOf" && !Array.isArray(r) && !Array.isArray(e) ? e === r : n === "isOneOf" && !Array.isArray(r) && Array.isArray(e) ? Array.from(e).includes(r) : n === "isOneOf" && Array.isArray(r) && !Array.isArray(e) ? Array.from(r).some((s) => s === e) : n === "isOneOf" && Array.isArray(r) && Array.isArray(e) ? Array.from(r).some((s) => Array.from(e).includes(s)) : !1;
|
|
26
|
+
})), c = h.useMemo(() => t ? [...m].sort((i, o) => {
|
|
27
|
+
for (const [n, r] of Object.entries(t)) {
|
|
28
|
+
const e = d(i, n), s = d(o, n);
|
|
29
|
+
if (e < s) return r === "asc" ? -1 : 1;
|
|
30
|
+
if (e > s) return r === "asc" ? 1 : -1;
|
|
31
|
+
}
|
|
32
|
+
return 0;
|
|
33
|
+
}) : m, [m, t]);
|
|
34
|
+
return /* @__PURE__ */ g("table", { ...C("data-table", b), children: [
|
|
35
|
+
c.map((i, o) => /* @__PURE__ */ O("tr", { className: "data-table__row", onClick: () => u?.(i), children: p?.(i, o) })),
|
|
36
|
+
c.length === 0 && !a && A ? /* @__PURE__ */ O("tr", { className: "data-table__row", onClick: () => u?.(void 0), children: A }) : null
|
|
37
|
+
] });
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
N as DataTable
|
|
41
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Code0Component } from '../../utils';
|
|
3
|
+
export interface DataTableColumnProps extends Code0Component<HTMLTableCellElement> {
|
|
4
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
5
|
+
}
|
|
6
|
+
export declare const DataTableColumn: React.FC<DataTableColumnProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import "../../utils/contextStore.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { mergeCode0Props as s } from "../../utils/utils.js";
|
|
6
|
+
const x = (m) => {
|
|
7
|
+
const t = n.c(6);
|
|
8
|
+
let e, r;
|
|
9
|
+
if (t[0] !== m) {
|
|
10
|
+
const {
|
|
11
|
+
children: i,
|
|
12
|
+
...l
|
|
13
|
+
} = m;
|
|
14
|
+
e = i, r = s("", l), t[0] = m, t[1] = e, t[2] = r;
|
|
15
|
+
} else
|
|
16
|
+
e = t[1], r = t[2];
|
|
17
|
+
let o;
|
|
18
|
+
return t[3] !== e || t[4] !== r ? (o = /* @__PURE__ */ c("td", { ...r, children: e }), t[3] = e, t[4] = r, t[5] = o) : o = t[5], o;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
x as DataTableColumn
|
|
22
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StreamLanguage } from '@codemirror/language';
|
|
3
|
+
import { CompletionContext } from '@codemirror/autocomplete';
|
|
4
|
+
import { DataTableFilterOperator, DataTableFilterProps } from './DataTable';
|
|
5
|
+
export interface DataTableFilterTokens {
|
|
6
|
+
token: string;
|
|
7
|
+
key: string;
|
|
8
|
+
operators: DataTableFilterOperator[];
|
|
9
|
+
suggestion?: (context: CompletionContext, operator: DataTableFilterOperator, currentValue: string, applySuggestion: (value: string, silently?: boolean) => void) => React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface DataTableFilterInputProps {
|
|
12
|
+
filterTokens?: DataTableFilterTokens[];
|
|
13
|
+
onChange?: (filter: DataTableFilterProps) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const createFilterQueryLanguage: (validTokens: string[]) => StreamLanguage<{
|
|
16
|
+
tokens: string[];
|
|
17
|
+
}>;
|
|
18
|
+
export declare const DataTableFilterInput: React.FC<DataTableFilterInputProps>;
|