@code0-tech/pictor 0.0.0-mvp.4 → 0.0.0-mvp.6
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/compiler-runtime.js +5 -0
- package/dist/_virtual/compiler-runtime2.js +4 -0
- package/dist/_virtual/react-compiler-runtime.development.js +4 -0
- package/dist/_virtual/react-compiler-runtime.production.js +4 -0
- package/dist/assets/components/d-flow/DFlow.style.css +1 -0
- package/dist/assets/{DFlow.css → node_modules/@xyflow/react/dist/style.css} +1 -1
- package/dist/components/avatar/Avatar.js +2 -2
- package/dist/components/badge/Badge.js +2 -2
- package/dist/components/breadcrumb/Breadcrumb.js +17 -16
- package/dist/components/button/Button.js +6 -5
- package/dist/components/button-group/ButtonGroup.js +6 -5
- package/dist/components/card/Card.js +2 -2
- package/dist/components/card/CardSection.js +1 -1
- package/dist/components/col/Col.js +9 -8
- package/dist/components/command/Command.js +19 -18
- package/dist/components/container/Container.js +12 -11
- package/dist/components/d-flow/DFlow.edges.hook.js +9 -10
- package/dist/components/d-flow/DFlow.js +6 -4
- package/dist/components/d-flow/DFlow.nodes.hook.js +18 -19
- package/dist/components/d-flow/control/DFlowControl.js +1 -1
- package/dist/components/d-flow/data-type/DFlowDataType.service.js +89 -5
- package/dist/components/d-flow/data-type/DFlowDataType.validation.value.js +18 -4
- package/dist/components/d-flow/data-type/index.js +1 -1
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsKeyRule.js +220 -4
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsTypeRule.js +227 -4
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeParentRule.js +1 -1
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeReturnTypeRule.js +241 -5
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeRules.js +8 -6
- package/dist/components/d-flow/edge/DFlowEdge.js +1 -1
- package/dist/components/d-flow/folder/DFlowFolder.js +16 -15
- package/dist/components/d-flow/function/DFlowFunction.return.hook.js +1 -1
- package/dist/components/d-flow/function/DFlowFunction.vaildation.hook.js +19 -20
- package/dist/components/d-flow/function/DFlowFunctionDefaultCard.js +51 -51
- package/dist/components/d-flow/function/DFlowFunctionGroupCard.js +1 -1
- package/dist/components/d-flow/function/DFlowFunctionTriggerCard.js +1 -1
- package/dist/components/d-flow/index.js +8 -8
- package/dist/components/d-flow/input/DFlowInputDataType.js +201 -201
- package/dist/components/d-flow/minimap/DFlowMiniMap.js +6 -5
- package/dist/components/d-flow/suggestion/DFlowSuggestion.hook.js +61 -62
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.js +1 -1
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenuFooter.js +1 -1
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenuSearchBar.js +1 -1
- package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.js +9 -8
- package/dist/components/d-flow/tab/DFlowTabs.js +1 -1
- package/dist/components/d-flow/validation/DFlowValidation.js +15 -14
- package/dist/components/d-fullscreen/DFullScreen.d.ts +1 -2
- package/dist/components/d-fullscreen/DFullScreen.js +15 -14
- package/dist/components/d-layout/DLayout.js +13 -12
- package/dist/components/d-namespace/index.js +6 -6
- package/dist/components/d-organization/index.js +5 -5
- package/dist/components/d-resizable/DResizable.js +17 -16
- package/dist/components/d-user/index.js +4 -4
- package/dist/components/dialog/Dialog.js +18 -17
- package/dist/components/file-tabs/FileTabs.js +41 -40
- package/dist/components/flex/Flex.js +2 -2
- package/dist/components/form/CheckboxInput.js +2 -2
- package/dist/components/form/Input.js +1 -1
- package/dist/components/form/InputDescription.js +1 -1
- package/dist/components/form/InputLabel.js +1 -1
- package/dist/components/form/InputMessage.js +1 -1
- package/dist/components/form/InputSuggestion.js +1 -1
- package/dist/components/form/PinInput.js +2 -2
- package/dist/components/form/RadioGroup.js +2 -2
- package/dist/components/form/RadioInput.js +2 -2
- package/dist/components/menu/Menu.js +2 -2
- package/dist/components/quote/Quote.js +4 -3
- package/dist/components/row/Row.js +10 -9
- package/dist/components/scroll-area/ScrollArea.js +18 -17
- package/dist/components/segmented-control/SegmentedControl.js +12 -11
- package/dist/components/text/Text.js +2 -2
- package/dist/components/tooltip/Tooltip.js +10 -9
- package/dist/index.js +219 -218
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +14 -0
- package/dist/node_modules/react/compiler-runtime.js +10 -0
- package/dist/utils/contextStore.js +1 -1
- package/dist/utils/generics.js +88 -89
- package/dist/utils/reactiveArrayService.d.ts +1 -1
- package/dist/utils/reactiveArrayService.js +51 -41
- package/package.json +3 -5
- package/dist/DFlowDataType.service-Dz8pQUeO.js +0 -793
- package/dist/compiler-runtime-BNHg76kC.js +0 -36
- /package/dist/assets/{Avatar.css → components/avatar/Avatar.style.css} +0 -0
- /package/dist/assets/{Badge.css → components/badge/Badge.style.css} +0 -0
- /package/dist/assets/{Breadcrumb.css → components/breadcrumb/Breadcrumb.style.css} +0 -0
- /package/dist/assets/{Button.css → components/button/Button.style.css} +0 -0
- /package/dist/assets/{ButtonGroup.css → components/button-group/ButtonGroup.style.css} +0 -0
- /package/dist/assets/{Card.css → components/card/Card.style.css} +0 -0
- /package/dist/assets/{Col.css → components/col/Col.style.css} +0 -0
- /package/dist/assets/{Command.css → components/command/Command.style.css} +0 -0
- /package/dist/assets/{Container.css → components/container/Container.style.css} +0 -0
- /package/dist/assets/{DFlowFolder.css → components/d-flow/folder/DFlowFolder.style.css} +0 -0
- /package/dist/assets/{DFlowFunctionDefaultCard.css → components/d-flow/function/DFlowFunctionDefaultCard.style.css} +0 -0
- /package/dist/assets/{DFlowInputDataType.css → components/d-flow/input/DFlowInputDataType.style.css} +0 -0
- /package/dist/assets/{DFlowMiniMap.css → components/d-flow/minimap/DFlowMiniMap.style.css} +0 -0
- /package/dist/assets/{DFlowSuggestionSearchInput.css → components/d-flow/suggestion/DFlowSuggestionSearchInput.style.css} +0 -0
- /package/dist/assets/{DFlowValidation.css → components/d-flow/validation/DFlowValidation.style.css} +0 -0
- /package/dist/assets/{DFullScreen.css → components/d-fullscreen/DFullScreen.style.css} +0 -0
- /package/dist/assets/{DLayout.css → components/d-layout/DLayout.style.css} +0 -0
- /package/dist/assets/{DResizable.css → components/d-resizable/DResizable.style.css} +0 -0
- /package/dist/assets/{Dialog.css → components/dialog/Dialog.style.css} +0 -0
- /package/dist/assets/{FileTabs.css → components/file-tabs/FileTabs.style.css} +0 -0
- /package/dist/assets/{Flex.css → components/flex/Flex.style.css} +0 -0
- /package/dist/assets/{Input.css → components/form/Input.style.css} +0 -0
- /package/dist/assets/{Menu.css → components/menu/Menu.style.css} +0 -0
- /package/dist/assets/{Quote.css → components/quote/Quote.style.css} +0 -0
- /package/dist/assets/{Row.css → components/row/Row.style.css} +0 -0
- /package/dist/assets/{ScrollArea.css → components/scroll-area/ScrollArea.style.css} +0 -0
- /package/dist/assets/{SegmentedControl.css → components/segmented-control/SegmentedControl.style.css} +0 -0
- /package/dist/assets/{Text.css → components/text/Text.style.css} +0 -0
- /package/dist/assets/{Tooltip.css → components/tooltip/Tooltip.style.css} +0 -0
|
@@ -1,307 +1,307 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsxs as S, jsx as c, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { c as be } from "../../../_virtual/compiler-runtime.js";
|
|
3
3
|
import y from "react";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { TextInput as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { IconSettings as
|
|
9
|
-
import { Text as
|
|
4
|
+
import { InputMessage as Me } from "../../form/InputMessage.js";
|
|
5
|
+
import '../../../assets/components/d-flow/input/DFlowInputDataType.style.css';/* empty css */
|
|
6
|
+
import { TextInput as F } from "../../form/TextInput.js";
|
|
7
|
+
import { Button as re } from "../../button/Button.js";
|
|
8
|
+
import { IconSettings as le, IconTrash as Oe } from "@tabler/icons-react";
|
|
9
|
+
import { Text as A } from "../../text/Text.js";
|
|
10
10
|
import { Flex as X } from "../../flex/Flex.js";
|
|
11
|
-
import { Badge as
|
|
12
|
-
import { InputLabel as
|
|
13
|
-
import { useSuggestions as
|
|
14
|
-
import { DFlowSuggestionMenuFooter as
|
|
15
|
-
import { toInputSuggestions as
|
|
16
|
-
import { DFlowSuggestionType as
|
|
17
|
-
import { Menu as Ae, MenuTrigger as
|
|
18
|
-
import { InputSuggestionMenuContent as
|
|
19
|
-
|
|
11
|
+
import { Badge as ve } from "../../badge/Badge.js";
|
|
12
|
+
import { InputLabel as De } from "../../form/InputLabel.js";
|
|
13
|
+
import { useSuggestions as ke } from "../suggestion/DFlowSuggestion.hook.js";
|
|
14
|
+
import { DFlowSuggestionMenuFooter as me } from "../suggestion/DFlowSuggestionMenuFooter.js";
|
|
15
|
+
import { toInputSuggestions as Be } from "../suggestion/DFlowSuggestionMenu.util.js";
|
|
16
|
+
import { DFlowSuggestionType as Ve } from "../suggestion/DFlowSuggestion.view.js";
|
|
17
|
+
import { Menu as Ae, MenuTrigger as _e, MenuPortal as Ke } from "../../menu/Menu.js";
|
|
18
|
+
import { InputSuggestionMenuContent as we, InputSuggestionMenuContentItems as Ge } from "../../form/InputSuggestion.js";
|
|
19
|
+
const Te = /* @__PURE__ */ new Set(["ITEM_OF_COLLECTION", "REGEX", "NUMBER_RANGE"]), he = "__blockingSignature", Fe = ["CONTAINS_KEY", "CONTAINS_TYPE", "ITEM_OF_COLLECTION", "NUMBER_RANGE", "REGEX"], de = (n) => {
|
|
20
20
|
const {
|
|
21
21
|
formValidation: e,
|
|
22
22
|
initialValue: t,
|
|
23
23
|
onDataTypeChange: p = () => {
|
|
24
24
|
},
|
|
25
|
-
blockingDataType:
|
|
26
|
-
} = n, m = y.useMemo(() =>
|
|
25
|
+
blockingDataType: s
|
|
26
|
+
} = n, m = y.useMemo(() => Ie(t, s), [t, s]), [a, u] = y.useState(m), T = y.useMemo(() => Y(a), [a]), l = y.useMemo(() => Y(s), [s]), B = y.useMemo(() => new Map((J(a) ? a.genericMappers ?? [] : []).map((r) => [r.target ?? "", r])), [a]), I = y.useMemo(() => l?.rules?.nodes?.filter(Boolean), [l]), E = y.useCallback((r) => {
|
|
27
27
|
u((o) => {
|
|
28
28
|
if (!o) return o;
|
|
29
|
-
const i =
|
|
30
|
-
return r(i), p(i),
|
|
29
|
+
const i = q(o);
|
|
30
|
+
return r(i), p(i), Le(o, i), i;
|
|
31
31
|
});
|
|
32
|
-
}, []),
|
|
33
|
-
|
|
34
|
-
const h =
|
|
32
|
+
}, []), b = y.useCallback((r, o, i) => {
|
|
33
|
+
E((N) => {
|
|
34
|
+
const h = Y(N);
|
|
35
35
|
if (!h) return;
|
|
36
|
-
const M =
|
|
37
|
-
if (!
|
|
38
|
-
const f =
|
|
36
|
+
const M = oe(h), R = M[r];
|
|
37
|
+
if (!R) return;
|
|
38
|
+
const f = Ce(R, l);
|
|
39
39
|
if (f && !i?.allowBlocked) return;
|
|
40
|
-
const g = o(
|
|
41
|
-
g !== void 0 && (f && (
|
|
40
|
+
const g = o(q(R));
|
|
41
|
+
g !== void 0 && (f && (ae(g, f), se(g, f)), M[r] = g);
|
|
42
42
|
});
|
|
43
|
-
}, [l,
|
|
44
|
-
|
|
45
|
-
const i =
|
|
43
|
+
}, [l, E]), V = y.useCallback((r) => {
|
|
44
|
+
E((o) => {
|
|
45
|
+
const i = Y(o);
|
|
46
46
|
if (!i) return;
|
|
47
|
-
const
|
|
48
|
-
h && (
|
|
47
|
+
const N = oe(i), h = N[r];
|
|
48
|
+
h && (Pe(h, l) || N.splice(r, 1));
|
|
49
49
|
});
|
|
50
|
-
}, [l,
|
|
51
|
-
|
|
50
|
+
}, [l, E]), d = y.useCallback((r, o) => {
|
|
51
|
+
b(r, (i) => (!("dataTypeIdentifier" in i?.config) || !i?.config?.dataTypeIdentifier || (L(o) ? (i.config.dataTypeIdentifier.dataType = o, delete i.config.dataTypeIdentifier.genericType) : J(o) && (i.config.dataTypeIdentifier.genericType = o, delete i.config.dataTypeIdentifier.dataType)), i), {
|
|
52
52
|
allowBlocked: !0
|
|
53
53
|
});
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
if (!
|
|
57
|
-
const h =
|
|
54
|
+
}, [b]), D = y.useCallback((r, o, i) => {
|
|
55
|
+
E((N) => {
|
|
56
|
+
if (!J(N)) return;
|
|
57
|
+
const h = N.genericMappers ?? [], M = h.findIndex((g) => g.target === r);
|
|
58
58
|
if (M === -1) return;
|
|
59
|
-
const
|
|
60
|
-
f[o] && (
|
|
59
|
+
const R = h[M], f = R?.sourceDataTypeIdentifiers ?? [];
|
|
60
|
+
f[o] && (L(i) ? (f[o].dataType = i, delete f[o].genericType) : J(i) && (f[o].genericType = i, delete f[o].dataType), R.sourceDataTypeIdentifiers = f, N.genericMappers = [...h], N.genericMappers[M] = R);
|
|
61
61
|
});
|
|
62
|
-
}, [
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
62
|
+
}, [E]);
|
|
63
|
+
return /* @__PURE__ */ S("div", { children: [
|
|
64
|
+
/* @__PURE__ */ S("div", { className: "d-flow-viewport-data-type-input", children: [
|
|
65
65
|
T?.rules?.nodes?.map((r, o) => {
|
|
66
66
|
if (!r) return null;
|
|
67
|
-
const i = I?.find((f) =>
|
|
68
|
-
return !
|
|
67
|
+
const i = I?.find((f) => ce(r, f)), N = r?.variant === "PARENT_TYPE", h = r?.config, M = (h?.dataTypeIdentifier?.dataType?.rules?.nodes?.length ?? 0) > 0 || (h?.dataTypeIdentifier?.genericType?.dataType?.rules?.nodes?.length ?? 0) > 0;
|
|
68
|
+
return !N || M ? /* @__PURE__ */ c(Ye, { rule: r, blockingRule: i, genericMap: B, onRemove: () => V(o), onConfigChange: (f) => b(o, (g) => (g.config = f, g)), onHeaderKeyChange: (f) => b(o, (g) => (g.config || (g.config = {}), g.config.key = f || null, g)), onHeaderDataTypeChange: (f) => b(o, (g) => {
|
|
69
69
|
g.config || (g.config = {}), "dataTypeIdentifier" in g.config || (g.config.dataTypeIdentifier = {});
|
|
70
|
-
const
|
|
71
|
-
return f ? (
|
|
72
|
-
}), onNestedChange: (f) => d(o, f), onGenericMapperChange:
|
|
70
|
+
const O = g.config.dataTypeIdentifier;
|
|
71
|
+
return f ? (L(f) ? (O.dataType = f, delete O.genericType) : J(f) && (O.genericType = f, delete O.dataType), g) : (delete O?.dataType, delete O?.genericType, g);
|
|
72
|
+
}), onNestedChange: (f) => d(o, f), onGenericMapperChange: D }, `${r.variant}-${o}`) : null;
|
|
73
73
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */ c(
|
|
76
|
-
/* @__PURE__ */ c(
|
|
74
|
+
/* @__PURE__ */ S(Ae, { children: [
|
|
75
|
+
/* @__PURE__ */ c(_e, { asChild: !0, children: /* @__PURE__ */ S(re, { color: "primary", children: [
|
|
76
|
+
/* @__PURE__ */ c(le, { size: 16 }),
|
|
77
77
|
" Add new rule"
|
|
78
78
|
] }) }),
|
|
79
|
-
/* @__PURE__ */ c(
|
|
80
|
-
/* @__PURE__ */ c(
|
|
81
|
-
|
|
79
|
+
/* @__PURE__ */ c(Ke, { children: /* @__PURE__ */ S(we, { children: [
|
|
80
|
+
/* @__PURE__ */ c(Ge, { onSuggestionSelect: (r) => {
|
|
81
|
+
E((o) => {
|
|
82
82
|
"rules" in o ? o?.rules?.nodes?.push(r.value) : "dataType" in o?.genericType && o?.genericType?.dataType?.rules?.nodes?.push(r.value);
|
|
83
83
|
});
|
|
84
|
-
}, suggestions:
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */ c(
|
|
87
|
-
/* @__PURE__ */ c(
|
|
84
|
+
}, suggestions: Fe.filter((r) => T?.variant == "OBJECT" ? r == "CONTAINS_KEY" : T?.variant == "ARRAY" ? r == "CONTAINS_TYPE" : !(r == "CONTAINS_TYPE" || r == "CONTAINS_KEY")).map((r) => ({
|
|
85
|
+
children: /* @__PURE__ */ S(j, { children: [
|
|
86
|
+
/* @__PURE__ */ c(le, { size: 16 }),
|
|
87
|
+
/* @__PURE__ */ c(A, { children: r })
|
|
88
88
|
] }),
|
|
89
89
|
value: {
|
|
90
90
|
variant: r,
|
|
91
91
|
config: {
|
|
92
92
|
__typename: `DataTypeRules${r[0]}Config`,
|
|
93
|
-
...r ===
|
|
93
|
+
...r === "NUMBER_RANGE" ? {
|
|
94
94
|
from: void 0,
|
|
95
95
|
to: void 0,
|
|
96
96
|
steps: void 0
|
|
97
97
|
} : {},
|
|
98
|
-
...r ===
|
|
98
|
+
...r === "REGEX" ? {
|
|
99
99
|
pattern: void 0
|
|
100
100
|
} : {},
|
|
101
|
-
...r ===
|
|
101
|
+
...r === "ITEM_OF_COLLECTION" ? {
|
|
102
102
|
items: void 0
|
|
103
103
|
} : {}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
})) }),
|
|
107
|
-
/* @__PURE__ */ c(
|
|
107
|
+
/* @__PURE__ */ c(me, {})
|
|
108
108
|
] }) })
|
|
109
109
|
] })
|
|
110
110
|
] }),
|
|
111
|
-
!e?.valid && e?.notValidMessage && /* @__PURE__ */ c(
|
|
111
|
+
!e?.valid && e?.notValidMessage && /* @__PURE__ */ c(Me, { children: e.notValidMessage })
|
|
112
112
|
] });
|
|
113
|
-
},
|
|
114
|
-
const e =
|
|
113
|
+
}, Ye = (n) => {
|
|
114
|
+
const e = be.c(56), {
|
|
115
115
|
rule: t,
|
|
116
116
|
blockingRule: p,
|
|
117
|
-
genericMap:
|
|
117
|
+
genericMap: s,
|
|
118
118
|
onRemove: m,
|
|
119
|
-
onConfigChange:
|
|
119
|
+
onConfigChange: a,
|
|
120
120
|
onHeaderKeyChange: u,
|
|
121
121
|
onHeaderDataTypeChange: T,
|
|
122
122
|
onNestedChange: l,
|
|
123
123
|
onGenericMapperChange: B
|
|
124
|
-
} = n, I = t?.config?.dataTypeIdentifier ?? void 0,
|
|
124
|
+
} = n, I = t?.config?.dataTypeIdentifier ?? void 0, E = !!I?.genericKey, [b, V] = y.useState(!1), d = !!p, D = t.variant, r = D ? !Te.has(D) : !1;
|
|
125
125
|
let o;
|
|
126
|
-
e[0] !== t.config ? (o = () =>
|
|
127
|
-
const [i,
|
|
126
|
+
e[0] !== t.config ? (o = () => ue(t?.config), e[0] = t.config, e[1] = o) : o = e[1];
|
|
127
|
+
const [i, N] = y.useState(o);
|
|
128
128
|
let h;
|
|
129
129
|
e[2] !== t.config ? (h = () => {
|
|
130
|
-
|
|
130
|
+
N(ue(t?.config));
|
|
131
131
|
}, e[2] = t.config, e[3] = h) : h = e[3];
|
|
132
132
|
let M;
|
|
133
133
|
e[4] !== t ? (M = [t], e[4] = t, e[5] = M) : M = e[5], y.useEffect(h, M);
|
|
134
|
-
let
|
|
134
|
+
let R;
|
|
135
135
|
e: {
|
|
136
136
|
if (!r) {
|
|
137
|
-
|
|
137
|
+
R = void 0;
|
|
138
138
|
break e;
|
|
139
139
|
}
|
|
140
140
|
if (!I) {
|
|
141
|
-
|
|
141
|
+
R = void 0;
|
|
142
142
|
break e;
|
|
143
143
|
}
|
|
144
144
|
if (I.genericKey) {
|
|
145
145
|
let C;
|
|
146
|
-
e[6] !==
|
|
147
|
-
const
|
|
148
|
-
|
|
146
|
+
e[6] !== s || e[7] !== I.genericKey ? (C = s.get(I.genericKey), e[6] = s, e[7] = I.genericKey, e[8] = C) : C = e[8];
|
|
147
|
+
const k = C?.sourceDataTypeIdentifiers?.[0];
|
|
148
|
+
R = k?.dataType?.name?.nodes?.[0]?.content ?? k?.genericType?.dataType?.name?.nodes?.[0]?.content;
|
|
149
149
|
break e;
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
R = I.dataType?.name?.nodes?.[0]?.content ?? I.genericType?.dataType?.name?.nodes?.[0]?.content;
|
|
152
152
|
}
|
|
153
|
-
const f =
|
|
153
|
+
const f = R;
|
|
154
154
|
let g;
|
|
155
155
|
e[9] === Symbol.for("react.memo_cache_sentinel") ? (g = (C) => {
|
|
156
|
-
const
|
|
157
|
-
|
|
156
|
+
const v = C.target.value;
|
|
157
|
+
N(v);
|
|
158
158
|
}, e[9] = g) : g = e[9];
|
|
159
|
-
const
|
|
160
|
-
let
|
|
161
|
-
e[10] !== i || e[11] !== d || e[12] !==
|
|
159
|
+
const O = g;
|
|
160
|
+
let P;
|
|
161
|
+
e[10] !== i || e[11] !== d || e[12] !== a || e[13] !== t.config || e[14] !== D ? (P = (C) => {
|
|
162
162
|
if (d)
|
|
163
163
|
return;
|
|
164
|
-
const
|
|
165
|
-
variant:
|
|
166
|
-
numberRangeKey:
|
|
164
|
+
const v = C?.target?.name, k = Je(i, t.config, {
|
|
165
|
+
variant: D,
|
|
166
|
+
numberRangeKey: v
|
|
167
167
|
});
|
|
168
|
-
|
|
169
|
-
}, e[10] = i, e[11] = d, e[12] =
|
|
170
|
-
const
|
|
171
|
-
let
|
|
172
|
-
e[16] !== t ? (
|
|
173
|
-
const
|
|
174
|
-
let
|
|
175
|
-
e[18] !== p ? (
|
|
176
|
-
const
|
|
177
|
-
let
|
|
178
|
-
e[20] !== f || e[21] !==
|
|
179
|
-
if (!
|
|
168
|
+
k && a(k);
|
|
169
|
+
}, e[10] = i, e[11] = d, e[12] = a, e[13] = t.config, e[14] = D, e[15] = P) : P = e[15];
|
|
170
|
+
const _ = P;
|
|
171
|
+
let z;
|
|
172
|
+
e[16] !== t ? (z = ye(t), e[16] = t, e[17] = z) : z = e[17];
|
|
173
|
+
const K = z;
|
|
174
|
+
let U;
|
|
175
|
+
e[18] !== p ? (U = ye(p), e[18] = p, e[19] = U) : U = e[19];
|
|
176
|
+
const W = U;
|
|
177
|
+
let $;
|
|
178
|
+
e[20] !== f || e[21] !== s || e[22] !== E || e[23] !== I || e[24] !== d || e[25] !== b || e[26] !== W || e[27] !== K || e[28] !== B || e[29] !== T || e[30] !== u || e[31] !== l || e[32] !== m || e[33] !== t ? ($ = () => {
|
|
179
|
+
if (!K && !E)
|
|
180
180
|
return null;
|
|
181
|
-
const C = /* @__PURE__ */ c(
|
|
182
|
-
if (
|
|
183
|
-
return /* @__PURE__ */
|
|
181
|
+
const C = /* @__PURE__ */ c(ge, { rule: t, genericMap: s, isBlocked: d, dataTypeLabel: f, onClick: () => V(ze), onRemove: d ? void 0 : m, onKeyChange: d ? void 0 : u, onDataTypeChange: d ? void 0 : T });
|
|
182
|
+
if (K)
|
|
183
|
+
return /* @__PURE__ */ S(j, { children: [
|
|
184
184
|
C,
|
|
185
|
-
|
|
185
|
+
b ? /* @__PURE__ */ c(de, { initialValue: K, blockingDataType: W, onDataTypeChange: l }) : null
|
|
186
186
|
] });
|
|
187
187
|
if (I?.genericKey) {
|
|
188
|
-
const
|
|
189
|
-
return /* @__PURE__ */
|
|
188
|
+
const v = s.get(I.genericKey);
|
|
189
|
+
return /* @__PURE__ */ S(j, { children: [
|
|
190
190
|
C,
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
if (!
|
|
191
|
+
b ? v?.sourceDataTypeIdentifiers?.map((k, fe) => {
|
|
192
|
+
const te = k?.dataType ?? k?.genericType;
|
|
193
|
+
if (!te)
|
|
194
194
|
return null;
|
|
195
|
-
const
|
|
196
|
-
return
|
|
195
|
+
const Se = d ? te : void 0, ie = I.genericKey;
|
|
196
|
+
return ie ? /* @__PURE__ */ c(de, { initialValue: te, blockingDataType: Se, onDataTypeChange: (Re) => B(ie, fe, Re) }, `${ie}-${fe}`) : null;
|
|
197
197
|
}) : null
|
|
198
198
|
] });
|
|
199
199
|
}
|
|
200
200
|
return null;
|
|
201
|
-
}, e[20] = f, e[21] =
|
|
202
|
-
const
|
|
203
|
-
if (r && (
|
|
201
|
+
}, e[20] = f, e[21] = s, e[22] = E, e[23] = I, e[24] = d, e[25] = b, e[26] = W, e[27] = K, e[28] = B, e[29] = T, e[30] = u, e[31] = l, e[32] = m, e[33] = t, e[34] = $) : $ = e[34];
|
|
202
|
+
const Q = $;
|
|
203
|
+
if (r && (K || E)) {
|
|
204
204
|
let C;
|
|
205
|
-
e[35] !==
|
|
206
|
-
let
|
|
207
|
-
return e[37] !== C ? (
|
|
205
|
+
e[35] !== Q ? (C = Q(), e[35] = Q, e[36] = C) : C = e[36];
|
|
206
|
+
let v;
|
|
207
|
+
return e[37] !== C ? (v = /* @__PURE__ */ c("div", { className: "d-flow-viewport-data-type-input__rule", children: C }), e[37] = C, e[38] = v) : v = e[38], v;
|
|
208
208
|
}
|
|
209
|
-
let
|
|
210
|
-
e[39] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
209
|
+
let x;
|
|
210
|
+
e[39] === Symbol.for("react.memo_cache_sentinel") ? (x = {
|
|
211
211
|
flex: 1
|
|
212
|
-
}, e[39] =
|
|
213
|
-
const
|
|
212
|
+
}, e[39] = x) : x = e[39];
|
|
213
|
+
const Z = d ? void 0 : m, ee = d ? void 0 : u, ne = d ? void 0 : T;
|
|
214
|
+
let w;
|
|
215
|
+
e[40] !== f || e[41] !== s || e[42] !== d || e[43] !== t || e[44] !== Z || e[45] !== ee || e[46] !== ne ? (w = /* @__PURE__ */ c(ge, { rule: t, genericMap: s, isBlocked: d, dataTypeLabel: f, onRemove: Z, onKeyChange: ee, onDataTypeChange: ne }), e[40] = f, e[41] = s, e[42] = d, e[43] = t, e[44] = Z, e[45] = ee, e[46] = ne, e[47] = w) : w = e[47];
|
|
214
216
|
let G;
|
|
215
|
-
e[
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
/* @__PURE__ */ c(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
]
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
] }) }), e[53] = G, e[54] = x, e[55] = U) : U = e[55], U;
|
|
227
|
-
}, pe = ({
|
|
217
|
+
e[48] !== i || e[49] !== _ || e[50] !== d || e[51] !== t.variant ? (G = t.variant === "REGEX" || t.variant === "ITEM_OF_COLLECTION" ? /* @__PURE__ */ c(F, { clearable: !0, left: /* @__PURE__ */ c(A, { size: "sm", children: t.variant === "REGEX" ? "Pattern" : "Items" }), leftType: "icon", defaultValue: i, onChange: O, onBlur: _, w: "100%", disabled: d }) : t.variant === "NUMBER_RANGE" ? /* @__PURE__ */ S(j, { children: [
|
|
218
|
+
/* @__PURE__ */ c(F, { clearable: !0, defaultValue: i?.from?.toString() ?? "", onChange: O, onBlur: _, w: "100%", left: /* @__PURE__ */ c(A, { size: "sm", children: "From" }), leftType: "icon", disabled: d, name: "from" }),
|
|
219
|
+
/* @__PURE__ */ c(F, { clearable: !0, defaultValue: i?.steps?.toString() ?? "", onChange: O, onBlur: _, left: /* @__PURE__ */ c(A, { size: "sm", children: "Steps" }), leftType: "icon", w: "100%", disabled: d, name: "steps" }),
|
|
220
|
+
/* @__PURE__ */ c(F, { clearable: !0, left: /* @__PURE__ */ c(A, { size: "sm", children: "To" }), leftType: "icon", defaultValue: i?.to?.toString() ?? "", onChange: O, onBlur: _, w: "100%", disabled: d, name: "to" })
|
|
221
|
+
] }) : null, e[48] = i, e[49] = _, e[50] = d, e[51] = t.variant, e[52] = G) : G = e[52];
|
|
222
|
+
let H;
|
|
223
|
+
return e[53] !== w || e[54] !== G ? (H = /* @__PURE__ */ c("div", { className: "d-flow-viewport-data-type-input__rule", children: /* @__PURE__ */ S("div", { style: x, children: [
|
|
224
|
+
w,
|
|
225
|
+
G
|
|
226
|
+
] }) }), e[53] = w, e[54] = G, e[55] = H) : H = e[55], H;
|
|
227
|
+
}, ge = ({
|
|
228
228
|
rule: n,
|
|
229
229
|
dataTypeLabel: e,
|
|
230
230
|
onClick: t,
|
|
231
231
|
onRemove: p,
|
|
232
|
-
isBlocked:
|
|
232
|
+
isBlocked: s,
|
|
233
233
|
onKeyChange: m,
|
|
234
|
-
onDataTypeChange:
|
|
234
|
+
onDataTypeChange: a,
|
|
235
235
|
genericMap: u
|
|
236
236
|
}) => {
|
|
237
|
-
const T = n.variant, l = T ? !
|
|
237
|
+
const T = n.variant, l = T ? !Te.has(T) : !1, B = l ? ke({
|
|
238
238
|
dataType: {
|
|
239
239
|
id: "gid://sagittarius/DataType/878634678"
|
|
240
240
|
}
|
|
241
|
-
}, [], "", 0, [0], 1, [
|
|
241
|
+
}, [], "", 0, [0], 1, [Ve.DATA_TYPE]) : [], I = n?.config?.dataTypeIdentifier?.dataType?.rules?.nodes?.length ?? n?.config?.dataTypeIdentifier?.genericType?.dataType?.rules?.nodes?.length ?? u.get(n?.config?.dataTypeIdentifier?.genericKey)?.sourceDataTypeIdentifiers?.map((i) => i?.dataType?.rules?.nodes?.length ?? i.genericType?.dataType?.rules?.nodes?.length) ?? 0, [E, b] = y.useState(() => "key" in (n?.config ?? {}) ? n?.config?.key ?? "" : ""), [V, d] = y.useState(() => e ?? "");
|
|
242
242
|
y.useEffect(() => {
|
|
243
|
-
|
|
243
|
+
b("key" in (n?.config ?? {}) ? n?.config?.key ?? "" : "");
|
|
244
244
|
}, [n]), y.useEffect(() => {
|
|
245
245
|
d(e ?? "");
|
|
246
246
|
}, [e]);
|
|
247
|
-
const
|
|
248
|
-
!m ||
|
|
249
|
-
}, [
|
|
250
|
-
!
|
|
251
|
-
}, [
|
|
252
|
-
if (!
|
|
253
|
-
const
|
|
254
|
-
if (!
|
|
255
|
-
|
|
247
|
+
const D = y.useCallback(() => {
|
|
248
|
+
!m || s || m(E);
|
|
249
|
+
}, [s, E, m]), r = y.useCallback(() => {
|
|
250
|
+
!a || s || V.trim() === "" && a(void 0);
|
|
251
|
+
}, [V, s, a]), o = y.useCallback((i) => {
|
|
252
|
+
if (!a || s) return;
|
|
253
|
+
const N = i.value;
|
|
254
|
+
if (!N) return;
|
|
255
|
+
a(N);
|
|
256
256
|
const h = i?.ref?.displayText?.join(" ") ?? e ?? "";
|
|
257
257
|
d(h);
|
|
258
|
-
}, [e,
|
|
259
|
-
return /* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */ c(
|
|
262
|
-
p ? /* @__PURE__ */ c(
|
|
258
|
+
}, [e, s, a]);
|
|
259
|
+
return /* @__PURE__ */ S("div", { children: [
|
|
260
|
+
/* @__PURE__ */ S(X, { justify: "space-between", children: [
|
|
261
|
+
/* @__PURE__ */ c(ve, { color: "info", children: n?.variant }),
|
|
262
|
+
p ? /* @__PURE__ */ c(re, { color: "error", onClick: p, children: /* @__PURE__ */ c(Oe, { size: 16 }) }) : null
|
|
263
263
|
] }),
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ S(X, { mt: 0.7, style: {
|
|
265
265
|
flexDirection: "column",
|
|
266
266
|
gap: ".7rem"
|
|
267
267
|
}, children: [
|
|
268
|
-
l ? /* @__PURE__ */
|
|
268
|
+
l ? /* @__PURE__ */ S(X, { align: "center", style: {
|
|
269
269
|
gap: ".7rem"
|
|
270
270
|
}, children: [
|
|
271
|
-
n.variant === "CONTAINS_KEY" ? /* @__PURE__ */ c(
|
|
272
|
-
/* @__PURE__ */ c(
|
|
271
|
+
n.variant === "CONTAINS_KEY" ? /* @__PURE__ */ c(F, { left: /* @__PURE__ */ c(A, { size: "sm", children: "Key" }), leftType: "icon", disabled: s, defaultValue: E, onChange: (i) => "value" in i.target && b(i.target.value), onBlur: D }) : null,
|
|
272
|
+
/* @__PURE__ */ c(F, { left: /* @__PURE__ */ c(A, { size: "sm", children: "DataType" }), leftType: "icon", disabled: s, suggestionsFooter: /* @__PURE__ */ c(me, {}), suggestions: Be(B), value: V, onChange: (i) => "value" in i.target && d(i.target.value), onBlur: r, onSuggestionSelect: o })
|
|
273
273
|
] }) : null,
|
|
274
|
-
n.variant != "REGEX" && n.variant != "ITEM_OF_COLLECTION" && n.variant != "NUMBER_RANGE" ? /* @__PURE__ */ c(
|
|
274
|
+
n.variant != "REGEX" && n.variant != "ITEM_OF_COLLECTION" && n.variant != "NUMBER_RANGE" ? /* @__PURE__ */ c(De, { children: /* @__PURE__ */ S(X, { align: "center", style: {
|
|
275
275
|
gap: ".7rem"
|
|
276
276
|
}, children: [
|
|
277
277
|
"+",
|
|
278
278
|
I,
|
|
279
279
|
" rules included",
|
|
280
|
-
/* @__PURE__ */ c(
|
|
280
|
+
/* @__PURE__ */ c(re, { color: "primary", onClick: t, children: "Show/Hide Rules" })
|
|
281
281
|
] }) }) : null
|
|
282
282
|
] })
|
|
283
283
|
] });
|
|
284
|
-
},
|
|
284
|
+
}, ue = (n) => n ? "pattern" in n || n?.__typename === "DataTypeRulesRegexConfig" ? n?.pattern ?? "" : "items" in n || n?.__typename === "DataTypeRulesItemOfCollectionConfig" ? JSON.stringify(n.items) : n : "", Je = (n, e, t) => {
|
|
285
285
|
const {
|
|
286
286
|
variant: p,
|
|
287
|
-
numberRangeKey:
|
|
288
|
-
} = t ?? {}, m = p ===
|
|
287
|
+
numberRangeKey: s
|
|
288
|
+
} = t ?? {}, m = p === "NUMBER_RANGE", a = e ?? void 0;
|
|
289
289
|
if (m) {
|
|
290
290
|
const u = {
|
|
291
291
|
__typename: "DataTypeRulesNumberRangeConfig",
|
|
292
|
-
...
|
|
292
|
+
...a
|
|
293
293
|
};
|
|
294
294
|
if (typeof n != "string")
|
|
295
295
|
return {
|
|
296
296
|
...u,
|
|
297
297
|
...n
|
|
298
298
|
};
|
|
299
|
-
if (!
|
|
299
|
+
if (!s)
|
|
300
300
|
return u;
|
|
301
301
|
const T = {
|
|
302
302
|
...u
|
|
303
303
|
};
|
|
304
|
-
switch (
|
|
304
|
+
switch (s) {
|
|
305
305
|
case "from":
|
|
306
306
|
T.from = (() => {
|
|
307
307
|
if (n.trim() === "") return;
|
|
@@ -326,7 +326,7 @@ import '../../../assets/DFlowInputDataType.css';const Ce = /* @__PURE__ */ new S
|
|
|
326
326
|
}
|
|
327
327
|
return T;
|
|
328
328
|
}
|
|
329
|
-
if (!
|
|
329
|
+
if (!a) {
|
|
330
330
|
if (typeof n != "string")
|
|
331
331
|
return n;
|
|
332
332
|
try {
|
|
@@ -337,63 +337,63 @@ import '../../../assets/DFlowInputDataType.css';const Ce = /* @__PURE__ */ new S
|
|
|
337
337
|
}
|
|
338
338
|
if (typeof n != "string")
|
|
339
339
|
return n;
|
|
340
|
-
if (
|
|
340
|
+
if (a.__typename === "DataTypeRulesRegexConfig" || "pattern" in a)
|
|
341
341
|
return {
|
|
342
|
-
...
|
|
342
|
+
...a,
|
|
343
343
|
pattern: n
|
|
344
344
|
};
|
|
345
|
-
if (
|
|
345
|
+
if (a.__typename === "DataTypeRulesItemOfCollectionConfig" || "items" in a)
|
|
346
346
|
try {
|
|
347
347
|
return {
|
|
348
|
-
...
|
|
348
|
+
...a,
|
|
349
349
|
items: JSON.parse(n)
|
|
350
350
|
};
|
|
351
351
|
} catch {
|
|
352
|
-
return
|
|
352
|
+
return a;
|
|
353
353
|
}
|
|
354
354
|
try {
|
|
355
355
|
return JSON.parse(n);
|
|
356
356
|
} catch {
|
|
357
|
-
return
|
|
357
|
+
return a;
|
|
358
358
|
}
|
|
359
|
-
},
|
|
359
|
+
}, q = (n) => n == null ? n : JSON.parse(JSON.stringify(n)), pe = (n) => {
|
|
360
360
|
if (n)
|
|
361
361
|
return JSON.stringify(n);
|
|
362
|
-
},
|
|
362
|
+
}, ye = (n) => {
|
|
363
363
|
if (n?.config?.dataTypeIdentifier)
|
|
364
364
|
return n?.config?.dataTypeIdentifier?.dataType ?? n?.config?.dataTypeIdentifier?.genericType ?? void 0;
|
|
365
|
-
},
|
|
365
|
+
}, Le = (n, e) => pe(n) === pe(e), Pe = (n, e) => !n || !e?.rules?.nodes || !Ne(n) ? !1 : !!Ce(n, e), Ce = (n, e) => !n || !e?.rules?.nodes ? void 0 : e.rules.nodes?.filter(Boolean).find((p) => ce(n, p)), L = (n) => n != null && n.rules !== void 0, J = (n) => n != null && typeof n == "object" && "genericMappers" in n, Y = (n) => {
|
|
366
366
|
if (n)
|
|
367
|
-
return
|
|
368
|
-
},
|
|
367
|
+
return L(n) ? n : n.dataType ?? void 0;
|
|
368
|
+
}, oe = (n) => (n.rules ? n.rules.nodes || (n.rules.nodes = []) : n.rules = {
|
|
369
369
|
nodes: []
|
|
370
|
-
}, n.rules.nodes),
|
|
370
|
+
}, n.rules.nodes), Ie = (n, e) => {
|
|
371
371
|
if (!n && !e) return;
|
|
372
|
-
const t =
|
|
373
|
-
if (!p || !
|
|
372
|
+
const t = q(n ?? e), p = Y(t), s = Y(e);
|
|
373
|
+
if (!p || !s)
|
|
374
374
|
return t;
|
|
375
|
-
const m =
|
|
376
|
-
return
|
|
375
|
+
const m = oe(p);
|
|
376
|
+
return s.rules?.nodes?.filter(Boolean)?.forEach((u) => {
|
|
377
377
|
if (!u) return;
|
|
378
|
-
const T = m.findIndex((l) =>
|
|
378
|
+
const T = m.findIndex((l) => ce(l, u));
|
|
379
379
|
if (T === -1) {
|
|
380
|
-
const l =
|
|
381
|
-
|
|
380
|
+
const l = q(u);
|
|
381
|
+
ae(l, u), m.push(l), se(l, u);
|
|
382
382
|
} else {
|
|
383
383
|
const l = m[T];
|
|
384
|
-
|
|
384
|
+
ae(l, u), se(l, u);
|
|
385
385
|
}
|
|
386
386
|
}), t;
|
|
387
387
|
}, se = (n, e) => {
|
|
388
388
|
const t = n?.config?.dataTypeIdentifier, p = e?.config?.dataTypeIdentifier;
|
|
389
389
|
if (!t || !p) return;
|
|
390
|
-
const
|
|
391
|
-
if (!
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
},
|
|
390
|
+
const s = t.dataType ?? t.genericType, m = p.dataType ?? p.genericType;
|
|
391
|
+
if (!s || !m) return;
|
|
392
|
+
const a = Ie(s, m);
|
|
393
|
+
a && (L(a) ? t.dataType = a : t.genericType = a);
|
|
394
|
+
}, ce = (n, e) => {
|
|
395
395
|
if (!n || !e) return !1;
|
|
396
|
-
const t =
|
|
396
|
+
const t = Ne(n), p = Ee(e);
|
|
397
397
|
return t && p ? t === p : n.id && e.id ? n.id === e.id : JSON.stringify({
|
|
398
398
|
variant: n.variant,
|
|
399
399
|
config: n.config
|
|
@@ -401,22 +401,22 @@ import '../../../assets/DFlowInputDataType.css';const Ce = /* @__PURE__ */ new S
|
|
|
401
401
|
variant: e.variant,
|
|
402
402
|
config: e.config
|
|
403
403
|
});
|
|
404
|
-
},
|
|
404
|
+
}, Ne = (n) => {
|
|
405
405
|
if (n)
|
|
406
|
-
return n?.[
|
|
407
|
-
},
|
|
406
|
+
return n?.[he];
|
|
407
|
+
}, Ee = (n) => {
|
|
408
408
|
if (n)
|
|
409
409
|
return n.id ? `id:${n.id}` : `config:${JSON.stringify({
|
|
410
410
|
variant: n.variant,
|
|
411
411
|
config: n.config
|
|
412
412
|
})}`;
|
|
413
|
-
},
|
|
414
|
-
const t =
|
|
415
|
-
t && (n[
|
|
413
|
+
}, ae = (n, e) => {
|
|
414
|
+
const t = Ee(e);
|
|
415
|
+
t && (n[he] = t);
|
|
416
416
|
};
|
|
417
|
-
function
|
|
417
|
+
function ze(n) {
|
|
418
418
|
return !n;
|
|
419
419
|
}
|
|
420
420
|
export {
|
|
421
|
-
|
|
421
|
+
de as DFlowInputDataType
|
|
422
422
|
};
|