Flowfile 0.2.2__py3-none-any.whl → 0.3.0.1__py3-none-any.whl

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.

Potentially problematic release.


This version of Flowfile might be problematic. Click here for more details.

Files changed (149) hide show
  1. flowfile/__init__.py +14 -7
  2. flowfile/__main__.py +51 -15
  3. flowfile/api.py +379 -0
  4. flowfile/web/__init__.py +155 -0
  5. flowfile/web/static/assets/AirbyteReader-1ac35765.css +314 -0
  6. flowfile/web/static/assets/AirbyteReader-cb0c1d4a.js +921 -0
  7. flowfile/web/static/assets/CrossJoin-41efa4cb.css +100 -0
  8. flowfile/web/static/assets/CrossJoin-a514fa59.js +153 -0
  9. flowfile/web/static/assets/DatabaseConnectionSettings-0c04b2e5.css +77 -0
  10. flowfile/web/static/assets/DatabaseConnectionSettings-f2cecf33.js +151 -0
  11. flowfile/web/static/assets/DatabaseManager-30fa27e5.css +64 -0
  12. flowfile/web/static/assets/DatabaseManager-83ee3c98.js +484 -0
  13. flowfile/web/static/assets/DatabaseReader-dc0c6881.js +426 -0
  14. flowfile/web/static/assets/DatabaseReader-f50c6558.css +158 -0
  15. flowfile/web/static/assets/DatabaseWriter-2f570e53.css +96 -0
  16. flowfile/web/static/assets/DatabaseWriter-5afe9f8d.js +312 -0
  17. flowfile/web/static/assets/ExploreData-5bdae813.css +45 -0
  18. flowfile/web/static/assets/ExploreData-c7ee19cf.js +118306 -0
  19. flowfile/web/static/assets/ExternalSource-17b23a01.js +225 -0
  20. flowfile/web/static/assets/ExternalSource-e37b6275.css +94 -0
  21. flowfile/web/static/assets/Filter-90856b4f.js +238 -0
  22. flowfile/web/static/assets/Filter-a9d08ba1.css +20 -0
  23. flowfile/web/static/assets/Formula-38b71e9e.js +197 -0
  24. flowfile/web/static/assets/Formula-d60a74f4.css +17 -0
  25. flowfile/web/static/assets/FuzzyMatch-6857de82.css +254 -0
  26. flowfile/web/static/assets/FuzzyMatch-d0f1fe81.js +422 -0
  27. flowfile/web/static/assets/GoogleSheet-854294a4.js +2616 -0
  28. flowfile/web/static/assets/GoogleSheet-92084da7.css +233 -0
  29. flowfile/web/static/assets/GraphSolver-0c86bbc6.js +382 -0
  30. flowfile/web/static/assets/GraphSolver-17fd26db.css +68 -0
  31. flowfile/web/static/assets/GroupBy-ab1ea74b.css +51 -0
  32. flowfile/web/static/assets/GroupBy-f2772e9f.js +413 -0
  33. flowfile/web/static/assets/Join-41c0f331.css +109 -0
  34. flowfile/web/static/assets/Join-bc3e1cf7.js +247 -0
  35. flowfile/web/static/assets/ManualInput-03aa0245.js +391 -0
  36. flowfile/web/static/assets/ManualInput-ac7b9972.css +84 -0
  37. flowfile/web/static/assets/Output-48f81019.css +2642 -0
  38. flowfile/web/static/assets/Output-5b35eee8.js +536 -0
  39. flowfile/web/static/assets/Pivot-7164087c.js +408 -0
  40. flowfile/web/static/assets/Pivot-f415e85f.css +35 -0
  41. flowfile/web/static/assets/PolarsCode-3abf6507.js +2863 -0
  42. flowfile/web/static/assets/PolarsCode-650322d1.css +35 -0
  43. flowfile/web/static/assets/PopOver-b37ff9be.js +577 -0
  44. flowfile/web/static/assets/PopOver-bccfde04.css +32 -0
  45. flowfile/web/static/assets/Read-65966a3e.js +701 -0
  46. flowfile/web/static/assets/Read-80dc1675.css +197 -0
  47. flowfile/web/static/assets/RecordCount-c66c6d6d.js +121 -0
  48. flowfile/web/static/assets/RecordId-826dc095.js +339 -0
  49. flowfile/web/static/assets/Sample-4ed555c8.js +184 -0
  50. flowfile/web/static/assets/SecretManager-eac1e97d.js +382 -0
  51. flowfile/web/static/assets/Select-085f05cc.js +231 -0
  52. flowfile/web/static/assets/SettingsSection-1f5e79c1.js +87 -0
  53. flowfile/web/static/assets/SettingsSection-9c836ecc.css +47 -0
  54. flowfile/web/static/assets/Sort-3e6cb414.js +309 -0
  55. flowfile/web/static/assets/Sort-7ccfa0fe.css +51 -0
  56. flowfile/web/static/assets/TextToRows-606349bc.js +307 -0
  57. flowfile/web/static/assets/TextToRows-c92d1ec2.css +48 -0
  58. flowfile/web/static/assets/UnavailableFields-5edd5322.css +49 -0
  59. flowfile/web/static/assets/UnavailableFields-b41976ed.js +36 -0
  60. flowfile/web/static/assets/Union-8d9ac7f9.css +30 -0
  61. flowfile/web/static/assets/Union-fca91665.js +145 -0
  62. flowfile/web/static/assets/Unique-a59f830e.js +273 -0
  63. flowfile/web/static/assets/Unique-b5615727.css +51 -0
  64. flowfile/web/static/assets/Unpivot-246e9bbd.css +77 -0
  65. flowfile/web/static/assets/Unpivot-c3815565.js +441 -0
  66. flowfile/web/static/assets/airbyte-292aa232.png +0 -0
  67. flowfile/web/static/assets/api-22b338bd.js +60 -0
  68. flowfile/web/static/assets/cross_join-d30c0290.png +0 -0
  69. flowfile/web/static/assets/database_reader-ce1e55f3.svg +24 -0
  70. flowfile/web/static/assets/database_writer-b4ad0753.svg +23 -0
  71. flowfile/web/static/assets/designer-2394122a.css +10697 -0
  72. flowfile/web/static/assets/designer-e5bbe26f.js +69712 -0
  73. flowfile/web/static/assets/documentation-08045cf2.js +33 -0
  74. flowfile/web/static/assets/documentation-12216a74.css +50 -0
  75. flowfile/web/static/assets/dropDown-35135ba8.css +143 -0
  76. flowfile/web/static/assets/dropDown-5e7e9a5a.js +319 -0
  77. flowfile/web/static/assets/dropDownGeneric-50a91b99.js +72 -0
  78. flowfile/web/static/assets/dropDownGeneric-895680d6.css +10 -0
  79. flowfile/web/static/assets/element-icons-9c88a535.woff +0 -0
  80. flowfile/web/static/assets/element-icons-de5eb258.ttf +0 -0
  81. flowfile/web/static/assets/explore_data-8a0a2861.png +0 -0
  82. flowfile/web/static/assets/fa-brands-400-808443ae.ttf +0 -0
  83. flowfile/web/static/assets/fa-brands-400-d7236a19.woff2 +0 -0
  84. flowfile/web/static/assets/fa-regular-400-54cf6086.ttf +0 -0
  85. flowfile/web/static/assets/fa-regular-400-e3456d12.woff2 +0 -0
  86. flowfile/web/static/assets/fa-solid-900-aa759986.woff2 +0 -0
  87. flowfile/web/static/assets/fa-solid-900-d2f05935.ttf +0 -0
  88. flowfile/web/static/assets/fa-v4compatibility-0ce9033c.woff2 +0 -0
  89. flowfile/web/static/assets/fa-v4compatibility-30f6abf6.ttf +0 -0
  90. flowfile/web/static/assets/filter-d7708bda.png +0 -0
  91. flowfile/web/static/assets/formula-eeeb1611.png +0 -0
  92. flowfile/web/static/assets/fullEditor-178376bb.css +256 -0
  93. flowfile/web/static/assets/fullEditor-705c6ccb.js +630 -0
  94. flowfile/web/static/assets/fuzzy_match-40c161b2.png +0 -0
  95. flowfile/web/static/assets/genericNodeSettings-65587f20.js +137 -0
  96. flowfile/web/static/assets/genericNodeSettings-924759c7.css +46 -0
  97. flowfile/web/static/assets/graph_solver-8b7888b8.png +0 -0
  98. flowfile/web/static/assets/group_by-80561fc3.png +0 -0
  99. flowfile/web/static/assets/index-552863fd.js +58652 -0
  100. flowfile/web/static/assets/index-681a3ed0.css +8843 -0
  101. flowfile/web/static/assets/input_data-ab2eb678.png +0 -0
  102. flowfile/web/static/assets/join-349043ae.png +0 -0
  103. flowfile/web/static/assets/manual_input-ae98f31d.png +0 -0
  104. flowfile/web/static/assets/nodeTitle-cf9bae3c.js +227 -0
  105. flowfile/web/static/assets/nodeTitle-f4b12bcb.css +134 -0
  106. flowfile/web/static/assets/old_join-5d0eb604.png +0 -0
  107. flowfile/web/static/assets/output-06ec0371.png +0 -0
  108. flowfile/web/static/assets/pivot-9660df51.png +0 -0
  109. flowfile/web/static/assets/polars_code-05ce5dc6.png +0 -0
  110. flowfile/web/static/assets/record_count-dab44eb5.png +0 -0
  111. flowfile/web/static/assets/record_id-0b15856b.png +0 -0
  112. flowfile/web/static/assets/sample-693a88b5.png +0 -0
  113. flowfile/web/static/assets/secretApi-3ad510e1.js +46 -0
  114. flowfile/web/static/assets/select-b0d0437a.png +0 -0
  115. flowfile/web/static/assets/selectDynamic-b062bc9b.css +107 -0
  116. flowfile/web/static/assets/selectDynamic-bd644891.js +302 -0
  117. flowfile/web/static/assets/sort-2aa579f0.png +0 -0
  118. flowfile/web/static/assets/summarize-2a099231.png +0 -0
  119. flowfile/web/static/assets/text_to_rows-859b29ea.png +0 -0
  120. flowfile/web/static/assets/union-2d8609f4.png +0 -0
  121. flowfile/web/static/assets/unique-1958b98a.png +0 -0
  122. flowfile/web/static/assets/unpivot-d3cb4b5b.png +0 -0
  123. flowfile/web/static/assets/view-7a0f0be1.png +0 -0
  124. flowfile/web/static/assets/vue-codemirror.esm-dd17b478.js +22281 -0
  125. flowfile/web/static/assets/vue-content-loader.es-6b36f05e.js +210 -0
  126. flowfile/web/static/flowfile.svg +47 -0
  127. flowfile/web/static/icons/flowfile.png +0 -0
  128. flowfile/web/static/images/airbyte.png +0 -0
  129. flowfile/web/static/images/flowfile.svg +47 -0
  130. flowfile/web/static/images/google.svg +1 -0
  131. flowfile/web/static/images/sheets.png +0 -0
  132. flowfile/web/static/index.html +22 -0
  133. flowfile/web/static/vite.svg +1 -0
  134. flowfile/web/static/vue.svg +1 -0
  135. flowfile-0.3.0.1.dist-info/METADATA +219 -0
  136. {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/RECORD +147 -16
  137. {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/entry_points.txt +1 -1
  138. flowfile_core/configs/settings.py +7 -32
  139. flowfile_core/flowfile/FlowfileFlow.py +4 -2
  140. flowfile_core/flowfile/analytics/analytics_processor.py +1 -1
  141. flowfile_core/main.py +4 -1
  142. flowfile_core/schemas/input_schema.py +1 -8
  143. flowfile_frame/__init__.py +1 -2
  144. flowfile_frame/flow_frame.py +6 -6
  145. flowfile_frame/utils.py +1 -140
  146. flowfile-0.2.2.dist-info/METADATA +0 -225
  147. flowfile_frame/__main__.py +0 -12
  148. {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/LICENSE +0 -0
  149. {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,247 @@
1
+ import { C as CodeLoader } from "./vue-content-loader.es-6b36f05e.js";
2
+ import { u as useNodeStore } from "./PopOver-b37ff9be.js";
3
+ import { C as ColumnSelector } from "./dropDown-5e7e9a5a.js";
4
+ import { s as selectDynamic } from "./selectDynamic-bd644891.js";
5
+ import { G as GenericNodeSettings } from "./genericNodeSettings-65587f20.js";
6
+ import { d as defineComponent, r as ref, c as openBlock, e as createElementBlock, f as createVNode, w as withCtx, p as createBaseVNode, h as createBlock, i as createCommentVNode, F as Fragment, q as renderList, u as unref, _ as _export_sfc, n as onMounted, R as nextTick, a6 as Teleport } from "./index-552863fd.js";
7
+ import { N as NodeButton, a as NodeTitle } from "./nodeTitle-cf9bae3c.js";
8
+ import "./UnavailableFields-b41976ed.js";
9
+ import "./designer-e5bbe26f.js";
10
+ const _hoisted_1$1 = {
11
+ key: 0,
12
+ class: "listbox-wrapper"
13
+ };
14
+ const _hoisted_2 = { class: "join-content" };
15
+ const _hoisted_3 = { class: "join-type-selector" };
16
+ const _hoisted_4 = { class: "join-mapping-section" };
17
+ const _hoisted_5 = { class: "table-wrapper" };
18
+ const _hoisted_6 = { class: "selectors-container" };
19
+ const _hoisted_7 = { class: "action-buttons" };
20
+ const _hoisted_8 = ["onClick"];
21
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
22
+ __name: "join",
23
+ setup(__props, { expose: __expose }) {
24
+ const joinTypes = ["inner", "left", "right", "full", "semi", "anti", "cross"];
25
+ const handleJoinTypeError = (error) => {
26
+ console.error("Join type error:", error);
27
+ };
28
+ const result = ref(null);
29
+ const nodeStore = useNodeStore();
30
+ const dataLoaded = ref(false);
31
+ const nodeJoin = ref(null);
32
+ const updateSelectInputsHandler = (updatedInputs, isLeft) => {
33
+ if (isLeft && nodeJoin.value) {
34
+ nodeJoin.value.join_input.left_select.renames = updatedInputs;
35
+ } else if (nodeJoin.value) {
36
+ nodeJoin.value.join_input.right_select.renames = updatedInputs;
37
+ }
38
+ };
39
+ const loadNodeData = async (nodeId) => {
40
+ var _a;
41
+ result.value = await nodeStore.getNodeData(nodeId, false);
42
+ nodeJoin.value = (_a = result.value) == null ? void 0 : _a.setting_input;
43
+ if (result.value) {
44
+ dataLoaded.value = true;
45
+ }
46
+ nodeStore.isDrawerOpen = true;
47
+ };
48
+ const addJoinCondition = () => {
49
+ if (nodeJoin.value) {
50
+ nodeJoin.value.join_input.join_mapping.push({
51
+ left_col: "",
52
+ right_col: ""
53
+ });
54
+ }
55
+ };
56
+ const removeJoinCondition = (index) => {
57
+ if (nodeJoin.value && index >= 0) {
58
+ nodeJoin.value.join_input.join_mapping.splice(index, 1);
59
+ }
60
+ };
61
+ const handleChange = (newValue, index, side) => {
62
+ if (side === "left") {
63
+ if (nodeJoin.value) {
64
+ nodeJoin.value.join_input.join_mapping[index].left_col = newValue;
65
+ }
66
+ } else {
67
+ if (nodeJoin.value) {
68
+ nodeJoin.value.join_input.join_mapping[index].right_col = newValue;
69
+ }
70
+ }
71
+ };
72
+ const pushNodeData = async () => {
73
+ console.log("Pushing node data");
74
+ nodeStore.updateSettings(nodeJoin);
75
+ nodeStore.isDrawerOpen = false;
76
+ };
77
+ __expose({
78
+ loadNodeData,
79
+ pushNodeData
80
+ });
81
+ return (_ctx, _cache) => {
82
+ return dataLoaded.value && nodeJoin.value ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
83
+ createVNode(GenericNodeSettings, {
84
+ modelValue: nodeJoin.value,
85
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => nodeJoin.value = $event)
86
+ }, {
87
+ default: withCtx(() => {
88
+ var _a, _b, _c;
89
+ return [
90
+ _cache[6] || (_cache[6] = createBaseVNode("div", { class: "listbox-subtitle" }, "Join columns", -1)),
91
+ createBaseVNode("div", _hoisted_2, [
92
+ createBaseVNode("div", _hoisted_3, [
93
+ _cache[4] || (_cache[4] = createBaseVNode("label", { class: "join-type-label" }, "Join Type:", -1)),
94
+ nodeJoin.value ? (openBlock(), createBlock(ColumnSelector, {
95
+ key: 0,
96
+ modelValue: nodeJoin.value.join_input.how,
97
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => nodeJoin.value.join_input.how = $event),
98
+ "column-options": joinTypes,
99
+ placeholder: "Select join type",
100
+ "allow-other": false,
101
+ onError: handleJoinTypeError
102
+ }, null, 8, ["modelValue"])) : createCommentVNode("", true)
103
+ ]),
104
+ createBaseVNode("div", _hoisted_4, [
105
+ createBaseVNode("div", _hoisted_5, [
106
+ _cache[5] || (_cache[5] = createBaseVNode("div", { class: "selectors-header" }, [
107
+ createBaseVNode("div", { class: "selectors-title" }, "L"),
108
+ createBaseVNode("div", { class: "selectors-title" }, "R"),
109
+ createBaseVNode("div", { class: "selectors-title" })
110
+ ], -1)),
111
+ createBaseVNode("div", _hoisted_6, [
112
+ (openBlock(true), createElementBlock(Fragment, null, renderList((_a = nodeJoin.value) == null ? void 0 : _a.join_input.join_mapping, (selector, index) => {
113
+ var _a2, _b2, _c2, _d, _e, _f, _g;
114
+ return openBlock(), createElementBlock("div", {
115
+ key: index,
116
+ class: "selectors-row"
117
+ }, [
118
+ createVNode(ColumnSelector, {
119
+ modelValue: selector.left_col,
120
+ "onUpdate:modelValue": ($event) => selector.left_col = $event,
121
+ value: selector.left_col,
122
+ "column-options": (_b2 = (_a2 = result.value) == null ? void 0 : _a2.main_input) == null ? void 0 : _b2.columns,
123
+ "onUpdate:value": (value) => handleChange(value, index, "left")
124
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "value", "column-options", "onUpdate:value"]),
125
+ createVNode(ColumnSelector, {
126
+ modelValue: selector.right_col,
127
+ "onUpdate:modelValue": ($event) => selector.right_col = $event,
128
+ value: selector.right_col,
129
+ "column-options": (_d = (_c2 = result.value) == null ? void 0 : _c2.right_input) == null ? void 0 : _d.columns,
130
+ "onUpdate:value": (value) => handleChange(value, index, "right")
131
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "value", "column-options", "onUpdate:value"]),
132
+ createBaseVNode("div", _hoisted_7, [
133
+ index !== (((_e = nodeJoin.value) == null ? void 0 : _e.join_input.join_mapping.length) ?? 0) - 1 ? (openBlock(), createElementBlock("button", {
134
+ key: 0,
135
+ class: "action-button remove-button",
136
+ onClick: ($event) => removeJoinCondition(index)
137
+ }, " - ", 8, _hoisted_8)) : createCommentVNode("", true),
138
+ index === (((_g = (_f = nodeJoin.value) == null ? void 0 : _f.join_input.join_mapping) == null ? void 0 : _g.length) ?? 0) - 1 ? (openBlock(), createElementBlock("button", {
139
+ key: 1,
140
+ class: "action-button add-button",
141
+ onClick: addJoinCondition
142
+ }, " + ")) : createCommentVNode("", true)
143
+ ])
144
+ ]);
145
+ }), 128))
146
+ ])
147
+ ])
148
+ ])
149
+ ]),
150
+ createVNode(selectDynamic, {
151
+ "select-inputs": (_b = nodeJoin.value) == null ? void 0 : _b.join_input.left_select.renames,
152
+ "show-keep-option": true,
153
+ "show-title": true,
154
+ "show-headers": true,
155
+ "show-data": true,
156
+ title: "Left data",
157
+ onUpdateSelectInputs: _cache[1] || (_cache[1] = (updatedInputs) => updateSelectInputsHandler(updatedInputs, true))
158
+ }, null, 8, ["select-inputs"]),
159
+ createVNode(selectDynamic, {
160
+ "select-inputs": (_c = nodeJoin.value) == null ? void 0 : _c.join_input.right_select.renames,
161
+ "show-keep-option": true,
162
+ "show-headers": true,
163
+ "show-title": true,
164
+ "show-data": true,
165
+ title: "Right data",
166
+ onUpdateSelectInputs: _cache[2] || (_cache[2] = (updatedInputs) => updateSelectInputsHandler(updatedInputs, true))
167
+ }, null, 8, ["select-inputs"])
168
+ ];
169
+ }),
170
+ _: 1
171
+ }, 8, ["modelValue"])
172
+ ])) : (openBlock(), createBlock(unref(CodeLoader), { key: 1 }));
173
+ };
174
+ }
175
+ });
176
+ const join_vue_vue_type_style_index_0_scoped_ed38aa97_lang = "";
177
+ const joinInput = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ed38aa97"]]);
178
+ const _hoisted_1 = { ref: "el" };
179
+ const _sfc_main = /* @__PURE__ */ defineComponent({
180
+ __name: "Join",
181
+ props: {
182
+ nodeId: {
183
+ type: Number,
184
+ required: true
185
+ }
186
+ },
187
+ setup(__props) {
188
+ const nodeStore = useNodeStore();
189
+ const childComp = ref(null);
190
+ const drawer = ref(false);
191
+ const props = __props;
192
+ const closeOnDrawer = () => {
193
+ var _a;
194
+ (_a = childComp.value) == null ? void 0 : _a.pushNodeData();
195
+ drawer.value = false;
196
+ nodeStore.isDrawerOpen = false;
197
+ };
198
+ const openDrawer = async () => {
199
+ if (nodeStore.node_id === props.nodeId) {
200
+ return;
201
+ }
202
+ nodeStore.closeDrawer();
203
+ drawer.value = true;
204
+ const drawerOpen = nodeStore.isDrawerOpen;
205
+ nodeStore.isDrawerOpen = true;
206
+ await nextTick();
207
+ if (nodeStore.node_id === props.nodeId && drawerOpen) {
208
+ return;
209
+ }
210
+ if (childComp.value) {
211
+ childComp.value.loadNodeData(props.nodeId);
212
+ nodeStore.openDrawer(closeOnDrawer);
213
+ }
214
+ };
215
+ onMounted(async () => {
216
+ await nextTick();
217
+ });
218
+ return (_ctx, _cache) => {
219
+ return openBlock(), createElementBlock("div", _hoisted_1, [
220
+ createVNode(NodeButton, {
221
+ ref: "nodeButton",
222
+ "node-id": __props.nodeId,
223
+ "image-src": "join.png",
224
+ title: `${__props.nodeId}: Join`,
225
+ onClick: openDrawer
226
+ }, null, 8, ["node-id", "title"]),
227
+ drawer.value ? (openBlock(), createBlock(Teleport, {
228
+ key: 0,
229
+ to: "#nodesettings"
230
+ }, [
231
+ createVNode(NodeTitle, {
232
+ title: "Join",
233
+ intro: "Combine datasets based on one or more columns."
234
+ }),
235
+ createVNode(joinInput, {
236
+ ref_key: "childComp",
237
+ ref: childComp,
238
+ "node-id": __props.nodeId
239
+ }, null, 8, ["node-id"])
240
+ ])) : createCommentVNode("", true)
241
+ ], 512);
242
+ };
243
+ }
244
+ });
245
+ export {
246
+ _sfc_main as default
247
+ };
@@ -0,0 +1,391 @@
1
+ import { N as NodeButton, a as NodeTitle } from "./nodeTitle-cf9bae3c.js";
2
+ import { r as ref, d as defineComponent, l as computed, m as watch, b as resolveComponent, c as openBlock, e as createElementBlock, f as createVNode, w as withCtx, p as createBaseVNode, F as Fragment, q as renderList, a4 as withDirectives, a5 as vModelText, g as createTextVNode, s as normalizeClass, t as toDisplayString, i as createCommentVNode, E as ElNotification, _ as _export_sfc, n as onMounted, R as nextTick, h as createBlock, a6 as Teleport } from "./index-552863fd.js";
3
+ import { u as useNodeStore } from "./PopOver-b37ff9be.js";
4
+ import { G as GenericNodeSettings } from "./genericNodeSettings-65587f20.js";
5
+ import "./designer-e5bbe26f.js";
6
+ const createManualInput = (flowId = -1, nodeId = -1, pos_x = 0, pos_y = 0) => {
7
+ const nodeManualInput = ref({
8
+ flow_id: flowId,
9
+ node_id: nodeId,
10
+ pos_x,
11
+ pos_y,
12
+ cache_input: false,
13
+ raw_data: [],
14
+ cache_results: false
15
+ // Add the missing property 'cache_results'
16
+ });
17
+ return nodeManualInput;
18
+ };
19
+ const _hoisted_1 = { key: 0 };
20
+ const _hoisted_2 = { class: "settings-section" };
21
+ const _hoisted_3 = { class: "table-container" };
22
+ const _hoisted_4 = { class: "modern-table" };
23
+ const _hoisted_5 = ["onClick"];
24
+ const _hoisted_6 = ["onUpdate:modelValue"];
25
+ const _hoisted_7 = ["onUpdate:modelValue"];
26
+ const _hoisted_8 = ["onClick"];
27
+ const _hoisted_9 = { class: "controls-section" };
28
+ const _hoisted_10 = { class: "button-group" };
29
+ const _hoisted_11 = {
30
+ key: 0,
31
+ class: "raw-data-section"
32
+ };
33
+ const _hoisted_12 = { class: "raw-data-controls" };
34
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
35
+ __name: "manualInput",
36
+ props: {
37
+ nodeId: {}
38
+ },
39
+ setup(__props, { expose: __expose }) {
40
+ const nodeStore = useNodeStore();
41
+ const dataLoaded = ref(false);
42
+ const nodeManualInput = ref(null);
43
+ const columns = ref([]);
44
+ const rows = ref([]);
45
+ const showRawData = ref(false);
46
+ const rawDataString = ref("");
47
+ let nextColumnId = 1;
48
+ let nextRowId = 1;
49
+ const rawData = computed(() => {
50
+ return rows.value.map((row) => {
51
+ const obj = {};
52
+ for (const col of columns.value) {
53
+ obj[col.name] = row.values[col.id];
54
+ }
55
+ return obj;
56
+ });
57
+ });
58
+ const initializeEmptyTable = () => {
59
+ rows.value = [{ id: 1, values: { 1: "" } }];
60
+ columns.value = [{ id: 1, name: "Column 1" }];
61
+ nextColumnId = 2;
62
+ nextRowId = 2;
63
+ };
64
+ const populateTableFromData = (data) => {
65
+ rows.value = [];
66
+ columns.value = [];
67
+ data.forEach((item, rowIndex) => {
68
+ const row = { id: rowIndex + 1, values: {} };
69
+ Object.keys(item).forEach((key, colIndex) => {
70
+ if (rowIndex === 0) {
71
+ columns.value.push({ id: colIndex + 1, name: key });
72
+ }
73
+ row.values[colIndex + 1] = item[key];
74
+ });
75
+ rows.value.push(row);
76
+ });
77
+ nextColumnId = columns.value.length + 1;
78
+ nextRowId = rows.value.length + 1;
79
+ };
80
+ const loadNodeData = async (nodeId) => {
81
+ const nodeResult = await nodeStore.getNodeData(nodeId, false);
82
+ if (nodeResult == null ? void 0 : nodeResult.setting_input) {
83
+ nodeManualInput.value = nodeResult.setting_input;
84
+ if (nodeResult.setting_input.raw_data) {
85
+ populateTableFromData(nodeResult.setting_input.raw_data);
86
+ } else {
87
+ initializeEmptyTable();
88
+ }
89
+ } else {
90
+ nodeManualInput.value = createManualInput(nodeStore.flow_id, nodeStore.node_id).value;
91
+ initializeEmptyTable();
92
+ }
93
+ rawDataString.value = JSON.stringify(rawData.value, null, 2);
94
+ dataLoaded.value = true;
95
+ };
96
+ const addColumn = () => {
97
+ columns.value.push({ id: nextColumnId, name: `Column ${nextColumnId}` });
98
+ nextColumnId++;
99
+ };
100
+ const addRow = () => {
101
+ const newRow = { id: nextRowId, values: {} };
102
+ columns.value.forEach((col) => {
103
+ newRow.values[col.id] = "";
104
+ });
105
+ rows.value.push(newRow);
106
+ nextRowId++;
107
+ };
108
+ const deleteColumn = (id) => {
109
+ const index = columns.value.findIndex((col) => col.id === id);
110
+ if (index !== -1) {
111
+ columns.value.splice(index, 1);
112
+ rows.value.forEach((row) => {
113
+ delete row.values[id];
114
+ });
115
+ }
116
+ };
117
+ const deleteRow = (id) => {
118
+ const index = rows.value.findIndex((row) => row.id === id);
119
+ if (index !== -1) {
120
+ rows.value.splice(index, 1);
121
+ }
122
+ };
123
+ const toggleRawData = () => {
124
+ showRawData.value = !showRawData.value;
125
+ };
126
+ const updateTableFromRawData = () => {
127
+ try {
128
+ const newData = JSON.parse(rawDataString.value);
129
+ if (!Array.isArray(newData)) {
130
+ ElNotification({
131
+ title: "Error",
132
+ message: "Data must be an array of objects",
133
+ type: "error"
134
+ });
135
+ return;
136
+ }
137
+ populateTableFromData(newData);
138
+ ElNotification({
139
+ title: "Success",
140
+ message: "Table updated successfully",
141
+ type: "success"
142
+ });
143
+ } catch (error) {
144
+ ElNotification({
145
+ title: "Error",
146
+ message: "Invalid JSON format. Please check your input.",
147
+ type: "error"
148
+ });
149
+ }
150
+ };
151
+ const pushNodeData = async () => {
152
+ if (nodeManualInput.value) {
153
+ nodeManualInput.value.raw_data = rawData.value;
154
+ await nodeStore.updateSettings(nodeManualInput);
155
+ }
156
+ dataLoaded.value = false;
157
+ };
158
+ watch(rawData, (newVal) => {
159
+ rawDataString.value = JSON.stringify(newVal, null, 2);
160
+ });
161
+ __expose({
162
+ loadNodeData,
163
+ pushNodeData
164
+ });
165
+ return (_ctx, _cache) => {
166
+ const _component_el_button = resolveComponent("el-button");
167
+ const _component_el_input = resolveComponent("el-input");
168
+ const _component_el_collapse_transition = resolveComponent("el-collapse-transition");
169
+ return dataLoaded.value && nodeManualInput.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
170
+ createVNode(GenericNodeSettings, {
171
+ modelValue: nodeManualInput.value,
172
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => nodeManualInput.value = $event)
173
+ }, {
174
+ default: withCtx(() => [
175
+ createBaseVNode("div", _hoisted_2, [
176
+ createBaseVNode("div", _hoisted_3, [
177
+ createBaseVNode("table", _hoisted_4, [
178
+ createBaseVNode("thead", null, [
179
+ createBaseVNode("tr", null, [
180
+ (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (col) => {
181
+ return openBlock(), createElementBlock("td", {
182
+ key: "delete-" + col.id
183
+ }, [
184
+ createBaseVNode("button", {
185
+ class: "delete-button",
186
+ onClick: ($event) => deleteColumn(col.id)
187
+ }, null, 8, _hoisted_5)
188
+ ]);
189
+ }), 128))
190
+ ]),
191
+ createBaseVNode("tr", null, [
192
+ (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (col) => {
193
+ return openBlock(), createElementBlock("th", {
194
+ key: col.id
195
+ }, [
196
+ withDirectives(createBaseVNode("input", {
197
+ "onUpdate:modelValue": ($event) => col.name = $event,
198
+ class: "input-header",
199
+ type: "text"
200
+ }, null, 8, _hoisted_6), [
201
+ [vModelText, col.name]
202
+ ])
203
+ ]);
204
+ }), 128))
205
+ ])
206
+ ]),
207
+ createBaseVNode("tbody", null, [
208
+ (openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row) => {
209
+ return openBlock(), createElementBlock("tr", {
210
+ key: row.id
211
+ }, [
212
+ (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (col) => {
213
+ return openBlock(), createElementBlock("td", {
214
+ key: col.id
215
+ }, [
216
+ withDirectives(createBaseVNode("input", {
217
+ "onUpdate:modelValue": ($event) => row.values[col.id] = $event,
218
+ class: "input-cell",
219
+ type: "text"
220
+ }, null, 8, _hoisted_7), [
221
+ [vModelText, row.values[col.id]]
222
+ ])
223
+ ]);
224
+ }), 128)),
225
+ createBaseVNode("td", null, [
226
+ createBaseVNode("button", {
227
+ class: "delete-button",
228
+ onClick: ($event) => deleteRow(row.id)
229
+ }, null, 8, _hoisted_8)
230
+ ])
231
+ ]);
232
+ }), 128))
233
+ ])
234
+ ])
235
+ ]),
236
+ createBaseVNode("div", _hoisted_9, [
237
+ createBaseVNode("div", _hoisted_10, [
238
+ createVNode(_component_el_button, {
239
+ type: "primary",
240
+ size: "small",
241
+ onClick: addColumn
242
+ }, {
243
+ icon: withCtx(() => _cache[2] || (_cache[2] = [
244
+ createBaseVNode("i", { class: "fas fa-plus" }, null, -1)
245
+ ])),
246
+ default: withCtx(() => [
247
+ _cache[3] || (_cache[3] = createTextVNode(" Add Column "))
248
+ ]),
249
+ _: 1
250
+ }),
251
+ createVNode(_component_el_button, {
252
+ type: "primary",
253
+ size: "small",
254
+ onClick: addRow
255
+ }, {
256
+ icon: withCtx(() => _cache[4] || (_cache[4] = [
257
+ createBaseVNode("i", { class: "fas fa-plus" }, null, -1)
258
+ ])),
259
+ default: withCtx(() => [
260
+ _cache[5] || (_cache[5] = createTextVNode(" Add Row "))
261
+ ]),
262
+ _: 1
263
+ }),
264
+ createVNode(_component_el_button, {
265
+ type: "primary",
266
+ size: "small",
267
+ onClick: toggleRawData
268
+ }, {
269
+ icon: withCtx(() => [
270
+ createBaseVNode("i", {
271
+ class: normalizeClass(showRawData.value ? "fas fa-eye-slash" : "fas fa-eye")
272
+ }, null, 2)
273
+ ]),
274
+ default: withCtx(() => [
275
+ createTextVNode(" " + toDisplayString(showRawData.value ? "Hide" : "Show") + " Raw Data ", 1)
276
+ ]),
277
+ _: 1
278
+ })
279
+ ])
280
+ ]),
281
+ createVNode(_component_el_collapse_transition, null, {
282
+ default: withCtx(() => [
283
+ showRawData.value ? (openBlock(), createElementBlock("div", _hoisted_11, [
284
+ createVNode(_component_el_input, {
285
+ modelValue: rawDataString.value,
286
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => rawDataString.value = $event),
287
+ type: "textarea",
288
+ rows: 8,
289
+ placeholder: JSON.stringify({ column1: "value1" }, null, 2)
290
+ }, null, 8, ["modelValue", "placeholder"]),
291
+ createBaseVNode("div", _hoisted_12, [
292
+ createVNode(_component_el_button, {
293
+ type: "primary",
294
+ size: "small",
295
+ onClick: updateTableFromRawData
296
+ }, {
297
+ default: withCtx(() => _cache[6] || (_cache[6] = [
298
+ createTextVNode(" Update Table ")
299
+ ])),
300
+ _: 1
301
+ })
302
+ ])
303
+ ])) : createCommentVNode("", true)
304
+ ]),
305
+ _: 1
306
+ })
307
+ ])
308
+ ]),
309
+ _: 1
310
+ }, 8, ["modelValue"])
311
+ ])) : createCommentVNode("", true);
312
+ };
313
+ }
314
+ });
315
+ const manualInput_vue_vue_type_style_index_0_scoped_5c4222c9_lang = "";
316
+ const manualInput = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-5c4222c9"]]);
317
+ const _sfc_main = /* @__PURE__ */ defineComponent({
318
+ __name: "ManualInput",
319
+ props: {
320
+ nodeId: {
321
+ type: Number,
322
+ required: true
323
+ }
324
+ },
325
+ setup(__props) {
326
+ const nodeStore = useNodeStore();
327
+ const nodeButton = ref(null);
328
+ const childComp = ref(null);
329
+ const props = __props;
330
+ const el = ref(null);
331
+ const drawer = ref(false);
332
+ const closeOnDrawer = () => {
333
+ var _a;
334
+ drawer.value = false;
335
+ (_a = childComp.value) == null ? void 0 : _a.pushNodeData();
336
+ nodeStore.isDrawerOpen = false;
337
+ };
338
+ const openDrawer = async () => {
339
+ if (nodeStore.node_id === props.nodeId) {
340
+ return;
341
+ }
342
+ nodeStore.closeDrawer();
343
+ drawer.value = true;
344
+ const drawerOpen = nodeStore.isDrawerOpen;
345
+ nodeStore.isDrawerOpen = true;
346
+ await nextTick();
347
+ if (nodeStore.node_id === props.nodeId && drawerOpen) {
348
+ return;
349
+ }
350
+ if (childComp.value) {
351
+ childComp.value.loadNodeData(props.nodeId);
352
+ nodeStore.openDrawer(closeOnDrawer);
353
+ }
354
+ };
355
+ onMounted(async () => {
356
+ await nextTick();
357
+ });
358
+ return (_ctx, _cache) => {
359
+ return openBlock(), createElementBlock("div", {
360
+ ref_key: "el",
361
+ ref: el
362
+ }, [
363
+ createVNode(NodeButton, {
364
+ ref_key: "nodeButton",
365
+ ref: nodeButton,
366
+ "node-id": __props.nodeId,
367
+ "image-src": "manual_input.png",
368
+ title: `${__props.nodeId}: Manual input`,
369
+ onClick: openDrawer
370
+ }, null, 8, ["node-id", "title"]),
371
+ drawer.value ? (openBlock(), createBlock(Teleport, {
372
+ key: 0,
373
+ to: "#nodesettings"
374
+ }, [
375
+ createVNode(NodeTitle, {
376
+ title: "Provide manual input",
377
+ intro: "Provide a fixed data that can be used and combined with other tables."
378
+ }),
379
+ createVNode(manualInput, {
380
+ ref_key: "childComp",
381
+ ref: childComp,
382
+ "node-id": __props.nodeId
383
+ }, null, 8, ["node-id"])
384
+ ])) : createCommentVNode("", true)
385
+ ], 512);
386
+ };
387
+ }
388
+ });
389
+ export {
390
+ _sfc_main as default
391
+ };