@flowgram.ai/form-materials 0.4.13 → 0.4.14
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/cjs/components/code-editor/editor.js +54 -77
- package/dist/cjs/components/code-editor/index.js +10 -2
- package/dist/cjs/components/code-editor/language-features.js +119 -16
- package/dist/cjs/components/code-editor/theme/dark.js +120 -50
- package/dist/cjs/components/code-editor/theme/light.js +110 -61
- package/dist/cjs/components/condition-context/context.js +59 -0
- package/dist/cjs/components/condition-context/hooks/use-condition.js +97 -0
- package/dist/cjs/components/condition-context/index.js +47 -0
- package/dist/cjs/components/condition-context/op.js +117 -0
- package/dist/cjs/components/condition-row/index.js +43 -26
- package/dist/cjs/components/condition-row/types.js +1 -35
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tag.js +4 -3
- package/dist/cjs/components/coze-editor-extensions/extensions/variable-tree.js +3 -0
- package/dist/cjs/components/db-condition-row/index.js +59 -34
- package/dist/cjs/form-plugins/infer-inputs-plugin/index.js +30 -3
- package/dist/cjs/plugins/json-schema-preset/create-type-preset-plugin.js +1 -0
- package/dist/cjs/plugins/json-schema-preset/react.js +1 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/array.js +30 -1
- package/dist/cjs/plugins/json-schema-preset/type-definition/boolean.js +23 -0
- package/dist/cjs/plugins/json-schema-preset/type-definition/date-time.js +31 -2
- package/dist/cjs/plugins/json-schema-preset/type-definition/index.js +9 -1
- package/dist/cjs/plugins/json-schema-preset/type-definition/integer.js +34 -1
- package/dist/cjs/{components/code-editor/init-worker.js → plugins/json-schema-preset/type-definition/map.js} +21 -23
- package/dist/cjs/plugins/json-schema-preset/type-definition/number.js +34 -1
- package/dist/cjs/plugins/json-schema-preset/type-definition/object.js +6 -1
- package/dist/cjs/plugins/json-schema-preset/type-definition/string.js +30 -1
- package/dist/cjs/plugins/json-schema-preset/types.js +18 -0
- package/dist/cjs/shared/flow-value/utils.js +22 -8
- package/dist/esm/components/code-editor/editor.mjs +4 -9
- package/dist/esm/components/code-editor/index.mjs +5 -2
- package/dist/esm/components/code-editor/language-features.mjs +49 -13
- package/dist/esm/components/code-editor/theme/dark.mjs +117 -50
- package/dist/esm/components/code-editor/theme/light.mjs +108 -62
- package/dist/esm/components/condition-context/context.mjs +19 -0
- package/dist/esm/components/condition-context/hooks/use-condition.mjs +63 -0
- package/dist/esm/components/condition-context/index.mjs +4 -0
- package/dist/esm/components/condition-context/op.mjs +80 -0
- package/dist/esm/components/condition-row/index.mjs +45 -28
- package/dist/esm/components/condition-row/types.mjs +0 -18
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tag.mjs +4 -3
- package/dist/esm/components/coze-editor-extensions/extensions/variable-tree.mjs +3 -0
- package/dist/esm/components/db-condition-row/index.mjs +59 -34
- package/dist/esm/form-plugins/infer-inputs-plugin/index.mjs +31 -4
- package/dist/esm/plugins/json-schema-preset/create-type-preset-plugin.mjs +2 -1
- package/dist/esm/plugins/json-schema-preset/react.mjs +2 -1
- package/dist/esm/plugins/json-schema-preset/type-definition/array.mjs +30 -1
- package/dist/esm/plugins/json-schema-preset/type-definition/boolean.mjs +23 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/date-time.mjs +31 -2
- package/dist/esm/plugins/json-schema-preset/type-definition/index.mjs +7 -2
- package/dist/esm/plugins/json-schema-preset/type-definition/integer.mjs +34 -1
- package/dist/esm/plugins/json-schema-preset/type-definition/map.mjs +20 -0
- package/dist/esm/plugins/json-schema-preset/type-definition/number.mjs +34 -1
- package/dist/esm/plugins/json-schema-preset/type-definition/object.mjs +6 -1
- package/dist/esm/plugins/json-schema-preset/type-definition/string.mjs +30 -1
- package/dist/esm/plugins/json-schema-preset/types.mjs +0 -0
- package/dist/esm/shared/flow-value/utils.mjs +22 -8
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/components/code-editor/editor.d.ts +0 -2
- package/dist/types/components/code-editor/language-features.d.ts +4 -1
- package/dist/types/components/code-editor/theme/dark.d.ts +29 -0
- package/dist/types/components/code-editor/theme/light.d.ts +24 -0
- package/dist/types/components/condition-context/context.d.ts +14 -0
- package/dist/types/components/condition-context/hooks/use-condition.d.ts +29 -0
- package/dist/types/components/condition-context/index.d.ts +8 -0
- package/dist/types/components/condition-context/op.d.ts +22 -0
- package/dist/types/components/condition-context/types.d.ts +14 -0
- package/dist/types/components/condition-row/index.d.ts +4 -7
- package/dist/types/components/condition-row/types.d.ts +0 -24
- package/dist/types/components/db-condition-row/index.d.ts +4 -3
- package/dist/types/components/db-condition-row/types.d.ts +0 -8
- package/dist/types/form-plugins/infer-inputs-plugin/index.d.ts +4 -0
- package/dist/types/plugins/json-schema-preset/create-type-preset-plugin.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/index.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/react.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/array.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/boolean.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/date-time.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/index.d.ts +3 -1
- package/dist/types/plugins/json-schema-preset/type-definition/integer.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/map.d.ts +6 -0
- package/dist/types/plugins/json-schema-preset/type-definition/number.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/object.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/type-definition/string.d.ts +1 -1
- package/dist/types/plugins/json-schema-preset/{manager.d.ts → types.d.ts} +5 -0
- package/dist/types/shared/flow-value/utils.d.ts +3 -1
- package/package.json +7 -6
- package/src/components/code-editor/editor.tsx +7 -10
- package/src/components/code-editor/index.tsx +3 -1
- package/src/components/code-editor/language-features.ts +52 -14
- package/src/components/code-editor/theme/dark.ts +62 -77
- package/src/components/code-editor/theme/light.ts +60 -91
- package/src/components/condition-context/context.tsx +28 -0
- package/src/components/condition-context/hooks/use-condition.tsx +99 -0
- package/src/components/condition-context/index.tsx +14 -0
- package/src/components/condition-context/op.ts +86 -0
- package/src/components/condition-context/types.ts +22 -0
- package/src/components/condition-row/index.tsx +44 -22
- package/src/components/condition-row/types.ts +0 -30
- package/src/components/coze-editor-extensions/extensions/variable-tag.tsx +6 -3
- package/src/components/coze-editor-extensions/extensions/variable-tree.tsx +3 -0
- package/src/components/db-condition-row/index.tsx +76 -24
- package/src/components/db-condition-row/types.ts +0 -13
- package/src/form-plugins/infer-inputs-plugin/index.ts +62 -14
- package/src/plugins/json-schema-preset/create-type-preset-plugin.tsx +4 -2
- package/src/plugins/json-schema-preset/index.tsx +1 -1
- package/src/plugins/json-schema-preset/react.tsx +5 -2
- package/src/plugins/json-schema-preset/type-definition/array.tsx +10 -1
- package/src/plugins/json-schema-preset/type-definition/boolean.tsx +17 -1
- package/src/plugins/json-schema-preset/type-definition/date-time.tsx +21 -2
- package/src/plugins/json-schema-preset/type-definition/index.tsx +10 -1
- package/src/plugins/json-schema-preset/type-definition/integer.tsx +19 -1
- package/src/plugins/json-schema-preset/type-definition/map.tsx +31 -0
- package/src/plugins/json-schema-preset/type-definition/number.tsx +19 -1
- package/src/plugins/json-schema-preset/type-definition/object.tsx +6 -1
- package/src/plugins/json-schema-preset/type-definition/string.tsx +19 -1
- package/src/plugins/json-schema-preset/{manager.ts → types.ts} +7 -0
- package/src/shared/flow-value/utils.ts +22 -9
- package/dist/cjs/components/condition-row/constants.js +0 -165
- package/dist/cjs/components/condition-row/hooks/useOp.js +0 -78
- package/dist/cjs/components/condition-row/hooks/useRule.js +0 -68
- package/dist/cjs/components/db-condition-row/hooks/use-left.js +0 -86
- package/dist/cjs/components/db-condition-row/hooks/use-op.js +0 -79
- package/dist/esm/components/code-editor/init-worker.mjs +0 -19
- package/dist/esm/components/condition-row/constants.mjs +0 -128
- package/dist/esm/components/condition-row/hooks/useOp.mjs +0 -44
- package/dist/esm/components/condition-row/hooks/useRule.mjs +0 -34
- package/dist/esm/components/db-condition-row/hooks/use-left.mjs +0 -52
- package/dist/esm/components/db-condition-row/hooks/use-op.mjs +0 -45
- package/dist/types/components/code-editor/init-worker.d.ts +0 -5
- package/dist/types/components/condition-row/constants.d.ts +0 -7
- package/dist/types/components/condition-row/hooks/useOp.d.ts +0 -18
- package/dist/types/components/condition-row/hooks/useRule.d.ts +0 -9
- package/dist/types/components/db-condition-row/hooks/use-left.d.ts +0 -18
- package/dist/types/components/db-condition-row/hooks/use-op.d.ts +0 -18
- package/src/components/code-editor/init-worker.ts +0 -27
- package/src/components/condition-row/constants.ts +0 -134
- package/src/components/condition-row/hooks/useOp.tsx +0 -56
- package/src/components/condition-row/hooks/useRule.ts +0 -35
- package/src/components/db-condition-row/hooks/use-left.tsx +0 -66
- package/src/components/db-condition-row/hooks/use-op.tsx +0 -59
- /package/dist/cjs/{plugins/json-schema-preset/manager.js → components/condition-context/types.js} +0 -0
- /package/dist/esm/{plugins/json-schema-preset/manager.mjs → components/condition-context/types.mjs} +0 -0
|
@@ -28,43 +28,62 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const external_react_namespaceObject = require("react");
|
|
31
|
+
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
31
32
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
32
33
|
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
34
|
+
const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
|
|
33
35
|
const index_js_namespaceObject = require("../variable-selector/index.js");
|
|
34
36
|
const external_dynamic_value_input_index_js_namespaceObject = require("../dynamic-value-input/index.js");
|
|
37
|
+
const external_condition_context_index_js_namespaceObject = require("../condition-context/index.js");
|
|
35
38
|
const external_styles_js_namespaceObject = require("./styles.js");
|
|
36
|
-
const useRule_js_namespaceObject = require("./hooks/useRule.js");
|
|
37
|
-
const useOp_js_namespaceObject = require("./hooks/useOp.js");
|
|
38
|
-
const external_constants_js_namespaceObject = require("./constants.js");
|
|
39
39
|
const defaultRuleConfig = {
|
|
40
40
|
ops: {},
|
|
41
41
|
rules: {}
|
|
42
42
|
};
|
|
43
43
|
function ConditionRow({ style, value, onChange, readonly, ruleConfig = defaultRuleConfig }) {
|
|
44
44
|
const { left, operator, right } = value || {};
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return targetType ? {
|
|
59
|
-
type: targetType,
|
|
60
|
-
extra: {
|
|
61
|
-
weak: true
|
|
62
|
-
}
|
|
63
|
-
} : null;
|
|
45
|
+
const available = (0, editor_namespaceObject.useScopeAvailable)();
|
|
46
|
+
const variable = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
47
|
+
if (!left) return;
|
|
48
|
+
return available.getByKeyPath(left.content);
|
|
49
|
+
}, [
|
|
50
|
+
available,
|
|
51
|
+
left
|
|
52
|
+
]);
|
|
53
|
+
const leftSchema = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
54
|
+
if (!variable) return;
|
|
55
|
+
return json_schema_namespaceObject.JsonSchemaUtils.astToSchema(variable.type, {
|
|
56
|
+
drilldown: false
|
|
57
|
+
});
|
|
64
58
|
}, [
|
|
65
|
-
|
|
66
|
-
opConfig
|
|
59
|
+
variable?.type?.hash
|
|
67
60
|
]);
|
|
61
|
+
const { rule, opConfig, opOptionList, targetSchema } = (0, external_condition_context_index_js_namespaceObject.useCondition)({
|
|
62
|
+
leftSchema,
|
|
63
|
+
operator
|
|
64
|
+
});
|
|
65
|
+
const renderOpSelect = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Select, {
|
|
66
|
+
style: {
|
|
67
|
+
height: 22
|
|
68
|
+
},
|
|
69
|
+
disabled: readonly,
|
|
70
|
+
size: "small",
|
|
71
|
+
value: operator,
|
|
72
|
+
optionList: opOptionList,
|
|
73
|
+
onChange: (v)=>{
|
|
74
|
+
onChange({
|
|
75
|
+
...value,
|
|
76
|
+
operator: v
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
triggerRender: ({ value })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Button, {
|
|
80
|
+
size: "small",
|
|
81
|
+
disabled: !rule,
|
|
82
|
+
children: opConfig?.abbreviation || /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_icons_namespaceObject.IconChevronDownStroked, {
|
|
83
|
+
size: "small"
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
});
|
|
68
87
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_styles_js_namespaceObject.UIContainer, {
|
|
69
88
|
style: style,
|
|
70
89
|
children: [
|
|
@@ -112,8 +131,6 @@ function ConditionRow({ style, value, onChange, readonly, ruleConfig = defaultRu
|
|
|
112
131
|
]
|
|
113
132
|
});
|
|
114
133
|
}
|
|
115
|
-
ConditionRow.defaultRules = external_constants_js_namespaceObject.defaultRules;
|
|
116
|
-
ConditionRow.defaultOpConfigs = external_constants_js_namespaceObject.defaultOpConfigs;
|
|
117
134
|
exports.ConditionRow = __webpack_exports__.ConditionRow;
|
|
118
135
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
119
136
|
"ConditionRow"
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
3
|
(()=>{
|
|
15
4
|
__webpack_require__.r = (exports1)=>{
|
|
16
5
|
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
@@ -23,30 +12,7 @@ var __webpack_require__ = {};
|
|
|
23
12
|
})();
|
|
24
13
|
var __webpack_exports__ = {};
|
|
25
14
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
|
|
27
|
-
Op: ()=>Op
|
|
28
|
-
});
|
|
29
|
-
var Op = /*#__PURE__*/ function(Op) {
|
|
30
|
-
Op["EQ"] = "eq";
|
|
31
|
-
Op["NEQ"] = "neq";
|
|
32
|
-
Op["GT"] = "gt";
|
|
33
|
-
Op["GTE"] = "gte";
|
|
34
|
-
Op["LT"] = "lt";
|
|
35
|
-
Op["LTE"] = "lte";
|
|
36
|
-
Op["IN"] = "in";
|
|
37
|
-
Op["NIN"] = "nin";
|
|
38
|
-
Op["CONTAINS"] = "contains";
|
|
39
|
-
Op["NOT_CONTAINS"] = "not_contains";
|
|
40
|
-
Op["IS_EMPTY"] = "is_empty";
|
|
41
|
-
Op["IS_NOT_EMPTY"] = "is_not_empty";
|
|
42
|
-
Op["IS_TRUE"] = "is_true";
|
|
43
|
-
Op["IS_FALSE"] = "is_false";
|
|
44
|
-
return Op;
|
|
45
|
-
}({});
|
|
46
|
-
exports.Op = __webpack_exports__.Op;
|
|
47
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
48
|
-
"Op"
|
|
49
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
15
|
+
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
50
16
|
Object.defineProperty(exports, '__esModule', {
|
|
51
17
|
value: true
|
|
52
18
|
});
|
|
@@ -58,9 +58,10 @@ class VariableTagWidget extends view_namespaceObject.WidgetType {
|
|
|
58
58
|
color: "amber",
|
|
59
59
|
children: "Unknown"
|
|
60
60
|
}));
|
|
61
|
-
const rootField = (0, external_lodash_es_namespaceObject.last)(v.parentFields);
|
|
61
|
+
const rootField = (0, external_lodash_es_namespaceObject.last)(v.parentFields) || v;
|
|
62
|
+
const isRoot = v === rootField;
|
|
62
63
|
const rootTitle = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UIRootTitle, {
|
|
63
|
-
children: rootField?.
|
|
64
|
+
children: rootField.meta?.title ? `${rootField.meta.title} ${isRoot ? '' : '-'} ` : ''
|
|
64
65
|
});
|
|
65
66
|
const rootIcon = this.renderIcon(rootField?.meta.icon);
|
|
66
67
|
this.root.render(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Popover, {
|
|
@@ -77,7 +78,7 @@ class VariableTagWidget extends view_namespaceObject.WidgetType {
|
|
|
77
78
|
prefixIcon: rootIcon,
|
|
78
79
|
children: [
|
|
79
80
|
rootTitle,
|
|
80
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UIVarName, {
|
|
81
|
+
!isRoot && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UIVarName, {
|
|
81
82
|
children: v?.key
|
|
82
83
|
})
|
|
83
84
|
]
|
|
@@ -84,6 +84,9 @@ function VariableTree({ triggerCharacters = DEFAULT_TRIGGER_CHARACTER }) {
|
|
|
84
84
|
},
|
|
85
85
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Tree, {
|
|
86
86
|
treeData: treeData,
|
|
87
|
+
onExpand: (v)=>{
|
|
88
|
+
setPosKey(String(Math.random()));
|
|
89
|
+
},
|
|
87
90
|
onSelect: (v)=>{
|
|
88
91
|
insert(v);
|
|
89
92
|
}
|
|
@@ -30,48 +30,73 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
const external_react_namespaceObject = require("react");
|
|
31
31
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
32
32
|
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
33
|
-
const
|
|
33
|
+
const semi_icons_namespaceObject = require("@douyinfe/semi-icons");
|
|
34
|
+
const index_js_namespaceObject = require("../../plugins/index.js");
|
|
35
|
+
const external_dynamic_value_input_index_js_namespaceObject = require("../dynamic-value-input/index.js");
|
|
36
|
+
const external_condition_context_index_js_namespaceObject = require("../condition-context/index.js");
|
|
34
37
|
const external_styles_js_namespaceObject = require("./styles.js");
|
|
35
|
-
const use_op_js_namespaceObject = require("./hooks/use-op.js");
|
|
36
|
-
const use_left_js_namespaceObject = require("./hooks/use-left.js");
|
|
37
38
|
const defaultRuleConfig = {
|
|
38
39
|
ops: {},
|
|
39
40
|
rules: {}
|
|
40
41
|
};
|
|
41
42
|
function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig = defaultRuleConfig }) {
|
|
42
43
|
const { left, operator, right } = value || {};
|
|
43
|
-
const
|
|
44
|
+
const typeManager = (0, index_js_namespaceObject.useTypeManager)();
|
|
45
|
+
const leftSchema = (0, external_react_namespaceObject.useMemo)(()=>options?.find((item)=>item.value === left)?.schema, [
|
|
44
46
|
left,
|
|
45
|
-
options
|
|
46
|
-
onChange: (leftKey)=>onChange({
|
|
47
|
-
...value,
|
|
48
|
-
left: leftKey
|
|
49
|
-
}),
|
|
50
|
-
readonly,
|
|
51
|
-
userRules: ruleConfig.rules
|
|
52
|
-
});
|
|
53
|
-
const { renderOpSelect, opConfig } = (0, use_op_js_namespaceObject.useOp)({
|
|
54
|
-
rule,
|
|
55
|
-
op: operator,
|
|
56
|
-
onChange: (v)=>onChange({
|
|
57
|
-
...value,
|
|
58
|
-
operator: v
|
|
59
|
-
}),
|
|
60
|
-
readonly,
|
|
61
|
-
userOps: ruleConfig.ops
|
|
62
|
-
});
|
|
63
|
-
const targetSchema = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
64
|
-
const targetType = rule?.[operator || ''] || null;
|
|
65
|
-
return targetType ? {
|
|
66
|
-
type: targetType,
|
|
67
|
-
extra: {
|
|
68
|
-
weak: true
|
|
69
|
-
}
|
|
70
|
-
} : null;
|
|
71
|
-
}, [
|
|
72
|
-
rule,
|
|
73
|
-
opConfig
|
|
47
|
+
options
|
|
74
48
|
]);
|
|
49
|
+
const { opConfig, rule, opOptionList, targetSchema } = (0, external_condition_context_index_js_namespaceObject.useCondition)({
|
|
50
|
+
leftSchema,
|
|
51
|
+
operator,
|
|
52
|
+
ruleConfig
|
|
53
|
+
});
|
|
54
|
+
const renderDBOptionSelect = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UISelect, {
|
|
55
|
+
disabled: readonly,
|
|
56
|
+
size: "small",
|
|
57
|
+
style: {
|
|
58
|
+
width: '100%'
|
|
59
|
+
},
|
|
60
|
+
value: left,
|
|
61
|
+
onChange: (v)=>onChange({
|
|
62
|
+
...value,
|
|
63
|
+
left: v
|
|
64
|
+
}),
|
|
65
|
+
optionList: options?.map((item)=>({
|
|
66
|
+
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_styles_js_namespaceObject.UIOptionLabel, {
|
|
67
|
+
children: [
|
|
68
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Icon, {
|
|
69
|
+
size: "small",
|
|
70
|
+
svg: typeManager.getDisplayIcon(item.schema)
|
|
71
|
+
}),
|
|
72
|
+
item.label
|
|
73
|
+
]
|
|
74
|
+
}),
|
|
75
|
+
value: item.value
|
|
76
|
+
})) || []
|
|
77
|
+
});
|
|
78
|
+
const renderOpSelect = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Select, {
|
|
79
|
+
style: {
|
|
80
|
+
height: 22
|
|
81
|
+
},
|
|
82
|
+
disabled: readonly,
|
|
83
|
+
size: "small",
|
|
84
|
+
value: operator,
|
|
85
|
+
optionList: opOptionList,
|
|
86
|
+
onChange: (v)=>{
|
|
87
|
+
onChange({
|
|
88
|
+
...value,
|
|
89
|
+
operator: v
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
triggerRender: ({ value })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.Button, {
|
|
93
|
+
size: "small",
|
|
94
|
+
disabled: !rule,
|
|
95
|
+
children: opConfig?.abbreviation || /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_icons_namespaceObject.IconChevronDownStroked, {
|
|
96
|
+
size: "small"
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
});
|
|
75
100
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_styles_js_namespaceObject.UIContainer, {
|
|
76
101
|
style: style,
|
|
77
102
|
children: [
|
|
@@ -84,7 +109,7 @@ function DBConditionRow({ style, value, onChange, readonly, options, ruleConfig
|
|
|
84
109
|
children: renderDBOptionSelect()
|
|
85
110
|
}),
|
|
86
111
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_styles_js_namespaceObject.UIRight, {
|
|
87
|
-
children: targetSchema ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
112
|
+
children: targetSchema ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dynamic_value_input_index_js_namespaceObject.InjectDynamicValueInput, {
|
|
88
113
|
readonly: readonly || !rule,
|
|
89
114
|
value: right,
|
|
90
115
|
schema: targetSchema,
|
|
@@ -27,13 +27,40 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
createInferInputsPlugin: ()=>createInferInputsPlugin
|
|
28
28
|
});
|
|
29
29
|
const external_lodash_es_namespaceObject = require("lodash-es");
|
|
30
|
+
const external_immer_namespaceObject = require("immer");
|
|
30
31
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
31
32
|
const index_js_namespaceObject = require("../../shared/index.js");
|
|
33
|
+
const { produce } = new external_immer_namespaceObject.Immer({
|
|
34
|
+
autoFreeze: false
|
|
35
|
+
});
|
|
32
36
|
const createInferInputsPlugin = (0, editor_namespaceObject.defineFormPluginCreator)({
|
|
33
|
-
onSetupFormMeta ({ addFormatOnSubmit }, { sourceKey, targetKey, scope }) {
|
|
37
|
+
onSetupFormMeta ({ addFormatOnSubmit, addFormatOnInit }, { sourceKey, targetKey, scope, ignoreConstantSchema }) {
|
|
34
38
|
if (!sourceKey || !targetKey) return;
|
|
35
|
-
addFormatOnSubmit((formData, ctx)=>{
|
|
36
|
-
|
|
39
|
+
addFormatOnSubmit((formData, ctx)=>produce(formData, (draft)=>{
|
|
40
|
+
const sourceData = (0, external_lodash_es_namespaceObject.get)(formData, sourceKey);
|
|
41
|
+
(0, external_lodash_es_namespaceObject.set)(draft, targetKey, index_js_namespaceObject.FlowValueUtils.inferJsonSchema(sourceData, 'private' === scope ? (0, editor_namespaceObject.getNodePrivateScope)(ctx.node) : (0, editor_namespaceObject.getNodeScope)(ctx.node)));
|
|
42
|
+
if (ignoreConstantSchema) {
|
|
43
|
+
for (const { value, path } of index_js_namespaceObject.FlowValueUtils.traverse(sourceData, {
|
|
44
|
+
includeTypes: [
|
|
45
|
+
'constant'
|
|
46
|
+
]
|
|
47
|
+
}))if (index_js_namespaceObject.FlowValueUtils.isConstant(value) && value?.schema) (0, external_lodash_es_namespaceObject.set)(formData, `${sourceKey}.${path}`, (0, external_lodash_es_namespaceObject.omit)(value, [
|
|
48
|
+
'schema'
|
|
49
|
+
]));
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
if (ignoreConstantSchema) addFormatOnInit((formData, ctx)=>{
|
|
53
|
+
const targetSchema = (0, external_lodash_es_namespaceObject.get)(formData, targetKey);
|
|
54
|
+
if (!targetSchema) return formData;
|
|
55
|
+
for (const { value, pathArr } of index_js_namespaceObject.FlowValueUtils.traverse((0, external_lodash_es_namespaceObject.get)(formData, sourceKey), {
|
|
56
|
+
includeTypes: [
|
|
57
|
+
'constant'
|
|
58
|
+
]
|
|
59
|
+
}))if (index_js_namespaceObject.FlowValueUtils.isConstant(value) && !value?.schema) {
|
|
60
|
+
const schemaPath = pathArr.map((_item)=>`properties.${_item}`).join('.');
|
|
61
|
+
const schema = (0, external_lodash_es_namespaceObject.get)(targetSchema, schemaPath);
|
|
62
|
+
if (schema) (0, external_lodash_es_namespaceObject.set)(value, 'schema', schema);
|
|
63
|
+
}
|
|
37
64
|
return formData;
|
|
38
65
|
});
|
|
39
66
|
}
|
|
@@ -29,6 +29,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
30
30
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
31
31
|
const index_js_namespaceObject = require("./type-definition/index.js");
|
|
32
|
+
(0, index_js_namespaceObject.initRegistries)();
|
|
32
33
|
const createTypePresetPlugin = (0, editor_namespaceObject.definePluginCreator)({
|
|
33
34
|
onInit (ctx, opts) {
|
|
34
35
|
const typeManager = ctx.get(json_schema_namespaceObject.BaseTypeManager);
|
|
@@ -31,6 +31,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
31
31
|
require("react");
|
|
32
32
|
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
33
33
|
const index_js_namespaceObject = require("./type-definition/index.js");
|
|
34
|
+
(0, index_js_namespaceObject.initRegistries)();
|
|
34
35
|
const useTypeManager = ()=>(0, json_schema_namespaceObject.useTypeManager)();
|
|
35
36
|
const JsonSchemaTypePresetProvider = ({ types = [], children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(json_schema_namespaceObject.TypePresetProvider, {
|
|
36
37
|
types: [
|
|
@@ -29,6 +29,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
require("react");
|
|
31
31
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
32
|
+
const op_js_namespaceObject = require("../../../components/condition-context/op.js");
|
|
32
33
|
const index_js_namespaceObject = require("../../../components/code-editor-mini/index.js");
|
|
33
34
|
const arrayRegistry = {
|
|
34
35
|
type: 'array',
|
|
@@ -38,7 +39,35 @@ const arrayRegistry = {
|
|
|
38
39
|
onChange: (v)=>props.onChange?.(v),
|
|
39
40
|
placeholder: editor_namespaceObject.I18n.t('Please Input Array'),
|
|
40
41
|
readonly: props.readonly
|
|
41
|
-
})
|
|
42
|
+
}),
|
|
43
|
+
conditionRule: {
|
|
44
|
+
[op_js_namespaceObject.ConditionPresetOp.IS_EMPTY]: null,
|
|
45
|
+
[op_js_namespaceObject.ConditionPresetOp.IS_NOT_EMPTY]: null,
|
|
46
|
+
[op_js_namespaceObject.ConditionPresetOp.CONTAINS]: {
|
|
47
|
+
type: 'array',
|
|
48
|
+
extra: {
|
|
49
|
+
weak: true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
[op_js_namespaceObject.ConditionPresetOp.NOT_CONTAINS]: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
extra: {
|
|
55
|
+
weak: true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[op_js_namespaceObject.ConditionPresetOp.EQ]: {
|
|
59
|
+
type: 'array',
|
|
60
|
+
extra: {
|
|
61
|
+
weak: true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
[op_js_namespaceObject.ConditionPresetOp.NEQ]: {
|
|
65
|
+
type: 'array',
|
|
66
|
+
extra: {
|
|
67
|
+
weak: true
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
42
71
|
};
|
|
43
72
|
exports.arrayRegistry = __webpack_exports__.arrayRegistry;
|
|
44
73
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
@@ -30,6 +30,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
require("react");
|
|
31
31
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
32
32
|
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
33
|
+
const op_js_namespaceObject = require("../../../components/condition-context/op.js");
|
|
33
34
|
const booleanRegistry = {
|
|
34
35
|
type: 'boolean',
|
|
35
36
|
ConstantRenderer: (props)=>{
|
|
@@ -52,6 +53,28 @@ const booleanRegistry = {
|
|
|
52
53
|
onChange: (value)=>onChange?.(!!value),
|
|
53
54
|
...rest
|
|
54
55
|
});
|
|
56
|
+
},
|
|
57
|
+
conditionRule: {
|
|
58
|
+
[op_js_namespaceObject.ConditionPresetOp.EQ]: {
|
|
59
|
+
type: 'boolean'
|
|
60
|
+
},
|
|
61
|
+
[op_js_namespaceObject.ConditionPresetOp.NEQ]: {
|
|
62
|
+
type: 'boolean'
|
|
63
|
+
},
|
|
64
|
+
[op_js_namespaceObject.ConditionPresetOp.IS_TRUE]: null,
|
|
65
|
+
[op_js_namespaceObject.ConditionPresetOp.IS_FALSE]: null,
|
|
66
|
+
[op_js_namespaceObject.ConditionPresetOp.IN]: {
|
|
67
|
+
type: 'array',
|
|
68
|
+
items: {
|
|
69
|
+
type: 'boolean'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
[op_js_namespaceObject.ConditionPresetOp.NIN]: {
|
|
73
|
+
type: 'array',
|
|
74
|
+
items: {
|
|
75
|
+
type: 'boolean'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
55
78
|
}
|
|
56
79
|
};
|
|
57
80
|
exports.booleanRegistry = __webpack_exports__.booleanRegistry;
|
|
@@ -28,20 +28,49 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
require("react");
|
|
31
|
+
const external_date_fns_namespaceObject = require("date-fns");
|
|
31
32
|
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
33
|
+
const op_js_namespaceObject = require("../../../components/condition-context/op.js");
|
|
32
34
|
const dateTimeRegistry = {
|
|
33
35
|
type: 'date-time',
|
|
34
36
|
ConstantRenderer: (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.DatePicker, {
|
|
35
37
|
size: "small",
|
|
36
38
|
type: "dateTime",
|
|
37
39
|
density: "compact",
|
|
40
|
+
defaultValue: Date.now(),
|
|
38
41
|
style: {
|
|
39
42
|
width: '100%',
|
|
40
43
|
...props.style || {}
|
|
41
44
|
},
|
|
42
45
|
disabled: props.readonly,
|
|
43
|
-
...props
|
|
44
|
-
|
|
46
|
+
...props,
|
|
47
|
+
onChange: (date)=>{
|
|
48
|
+
props.onChange?.((0, external_date_fns_namespaceObject.format)(date, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"));
|
|
49
|
+
},
|
|
50
|
+
value: props.value
|
|
51
|
+
}),
|
|
52
|
+
conditionRule: {
|
|
53
|
+
[op_js_namespaceObject.ConditionPresetOp.EQ]: {
|
|
54
|
+
type: 'date-time'
|
|
55
|
+
},
|
|
56
|
+
[op_js_namespaceObject.ConditionPresetOp.NEQ]: {
|
|
57
|
+
type: 'date-time'
|
|
58
|
+
},
|
|
59
|
+
[op_js_namespaceObject.ConditionPresetOp.GT]: {
|
|
60
|
+
type: 'date-time'
|
|
61
|
+
},
|
|
62
|
+
[op_js_namespaceObject.ConditionPresetOp.GTE]: {
|
|
63
|
+
type: 'date-time'
|
|
64
|
+
},
|
|
65
|
+
[op_js_namespaceObject.ConditionPresetOp.LT]: {
|
|
66
|
+
type: 'date-time'
|
|
67
|
+
},
|
|
68
|
+
[op_js_namespaceObject.ConditionPresetOp.LTE]: {
|
|
69
|
+
type: 'date-time'
|
|
70
|
+
},
|
|
71
|
+
[op_js_namespaceObject.ConditionPresetOp.IS_EMPTY]: null,
|
|
72
|
+
[op_js_namespaceObject.ConditionPresetOp.IS_NOT_EMPTY]: null
|
|
73
|
+
}
|
|
45
74
|
};
|
|
46
75
|
exports.dateTimeRegistry = __webpack_exports__.dateTimeRegistry;
|
|
47
76
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
@@ -24,12 +24,14 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
initRegistries: ()=>initRegistries,
|
|
27
28
|
jsonSchemaTypePreset: ()=>jsonSchemaTypePreset
|
|
28
29
|
});
|
|
29
30
|
const json_schema_namespaceObject = require("@flowgram.ai/json-schema");
|
|
30
31
|
const external_string_js_namespaceObject = require("./string.js");
|
|
31
32
|
const external_object_js_namespaceObject = require("./object.js");
|
|
32
33
|
const external_number_js_namespaceObject = require("./number.js");
|
|
34
|
+
const external_map_js_namespaceObject = require("./map.js");
|
|
33
35
|
const external_integer_js_namespaceObject = require("./integer.js");
|
|
34
36
|
const external_date_time_js_namespaceObject = require("./date-time.js");
|
|
35
37
|
const external_boolean_js_namespaceObject = require("./boolean.js");
|
|
@@ -41,11 +43,17 @@ const jsonSchemaTypePreset = [
|
|
|
41
43
|
external_integer_js_namespaceObject.integerRegistry,
|
|
42
44
|
external_boolean_js_namespaceObject.booleanRegistry,
|
|
43
45
|
external_array_js_namespaceObject.arrayRegistry,
|
|
46
|
+
external_map_js_namespaceObject.mapRegistry,
|
|
44
47
|
external_date_time_js_namespaceObject.dateTimeRegistry
|
|
45
48
|
];
|
|
46
|
-
|
|
49
|
+
const initRegistries = ()=>{
|
|
50
|
+
if (json_schema_namespaceObject.jsonSchemaTypeManager.getTypeByName('string')?.ConstantRenderer) return;
|
|
51
|
+
jsonSchemaTypePreset.forEach((_type)=>json_schema_namespaceObject.jsonSchemaTypeManager.register(_type));
|
|
52
|
+
};
|
|
53
|
+
exports.initRegistries = __webpack_exports__.initRegistries;
|
|
47
54
|
exports.jsonSchemaTypePreset = __webpack_exports__.jsonSchemaTypePreset;
|
|
48
55
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
56
|
+
"initRegistries",
|
|
49
57
|
"jsonSchemaTypePreset"
|
|
50
58
|
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
51
59
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -30,6 +30,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
require("react");
|
|
31
31
|
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
32
32
|
const semi_ui_namespaceObject = require("@douyinfe/semi-ui");
|
|
33
|
+
const op_js_namespaceObject = require("../../../components/condition-context/op.js");
|
|
33
34
|
const integerRegistry = {
|
|
34
35
|
type: 'integer',
|
|
35
36
|
ConstantRenderer: (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(semi_ui_namespaceObject.InputNumber, {
|
|
@@ -38,7 +39,39 @@ const integerRegistry = {
|
|
|
38
39
|
disabled: props.readonly,
|
|
39
40
|
precision: 0,
|
|
40
41
|
...props
|
|
41
|
-
})
|
|
42
|
+
}),
|
|
43
|
+
conditionRule: {
|
|
44
|
+
[op_js_namespaceObject.ConditionPresetOp.EQ]: {
|
|
45
|
+
type: 'number'
|
|
46
|
+
},
|
|
47
|
+
[op_js_namespaceObject.ConditionPresetOp.NEQ]: {
|
|
48
|
+
type: 'number'
|
|
49
|
+
},
|
|
50
|
+
[op_js_namespaceObject.ConditionPresetOp.GT]: {
|
|
51
|
+
type: 'number'
|
|
52
|
+
},
|
|
53
|
+
[op_js_namespaceObject.ConditionPresetOp.GTE]: {
|
|
54
|
+
type: 'number'
|
|
55
|
+
},
|
|
56
|
+
[op_js_namespaceObject.ConditionPresetOp.LT]: {
|
|
57
|
+
type: 'number'
|
|
58
|
+
},
|
|
59
|
+
[op_js_namespaceObject.ConditionPresetOp.LTE]: {
|
|
60
|
+
type: 'number'
|
|
61
|
+
},
|
|
62
|
+
[op_js_namespaceObject.ConditionPresetOp.IN]: {
|
|
63
|
+
type: 'array',
|
|
64
|
+
extra: {
|
|
65
|
+
weak: true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
[op_js_namespaceObject.ConditionPresetOp.NIN]: {
|
|
69
|
+
type: 'array',
|
|
70
|
+
extra: {
|
|
71
|
+
weak: true
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
42
75
|
};
|
|
43
76
|
exports.integerRegistry = __webpack_exports__.integerRegistry;
|
|
44
77
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
|
-
return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
|
-
}();
|
|
5
2
|
var __webpack_require__ = {};
|
|
6
3
|
(()=>{
|
|
7
4
|
__webpack_require__.d = (exports1, definition)=>{
|
|
@@ -27,29 +24,30 @@ var __webpack_require__ = {};
|
|
|
27
24
|
var __webpack_exports__ = {};
|
|
28
25
|
__webpack_require__.r(__webpack_exports__);
|
|
29
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
30
|
-
|
|
27
|
+
mapRegistry: ()=>mapRegistry
|
|
31
28
|
});
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
require("react");
|
|
31
|
+
const editor_namespaceObject = require("@flowgram.ai/editor");
|
|
32
|
+
const op_js_namespaceObject = require("../../../components/condition-context/op.js");
|
|
33
|
+
const index_js_namespaceObject = require("../../../components/code-editor-mini/index.js");
|
|
34
|
+
const mapRegistry = {
|
|
35
|
+
type: 'map',
|
|
36
|
+
ConstantRenderer: (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.CodeEditorMini, {
|
|
37
|
+
value: props.value,
|
|
38
|
+
onChange: (v)=>props.onChange?.(v),
|
|
39
|
+
languageId: "json",
|
|
40
|
+
placeholder: editor_namespaceObject.I18n.t('Please Input Map'),
|
|
41
|
+
readonly: props.readonly
|
|
42
|
+
}),
|
|
43
|
+
conditionRule: {
|
|
44
|
+
[op_js_namespaceObject.ConditionPresetOp.IS_EMPTY]: null,
|
|
45
|
+
[op_js_namespaceObject.ConditionPresetOp.IS_NOT_EMPTY]: null
|
|
46
|
+
}
|
|
49
47
|
};
|
|
50
|
-
exports.
|
|
48
|
+
exports.mapRegistry = __webpack_exports__.mapRegistry;
|
|
51
49
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
52
|
-
"
|
|
50
|
+
"mapRegistry"
|
|
53
51
|
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
54
52
|
Object.defineProperty(exports, '__esModule', {
|
|
55
53
|
value: true
|