Flowfile 0.3.0__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.
- flowfile/__init__.py +13 -6
- flowfile/__main__.py +51 -15
- flowfile/api.py +379 -0
- flowfile/web/__init__.py +155 -0
- flowfile/web/static/assets/AirbyteReader-1ac35765.css +314 -0
- flowfile/web/static/assets/AirbyteReader-cb0c1d4a.js +921 -0
- flowfile/web/static/assets/CrossJoin-41efa4cb.css +100 -0
- flowfile/web/static/assets/CrossJoin-a514fa59.js +153 -0
- flowfile/web/static/assets/DatabaseConnectionSettings-0c04b2e5.css +77 -0
- flowfile/web/static/assets/DatabaseConnectionSettings-f2cecf33.js +151 -0
- flowfile/web/static/assets/DatabaseManager-30fa27e5.css +64 -0
- flowfile/web/static/assets/DatabaseManager-83ee3c98.js +484 -0
- flowfile/web/static/assets/DatabaseReader-dc0c6881.js +426 -0
- flowfile/web/static/assets/DatabaseReader-f50c6558.css +158 -0
- flowfile/web/static/assets/DatabaseWriter-2f570e53.css +96 -0
- flowfile/web/static/assets/DatabaseWriter-5afe9f8d.js +312 -0
- flowfile/web/static/assets/ExploreData-5bdae813.css +45 -0
- flowfile/web/static/assets/ExploreData-c7ee19cf.js +118306 -0
- flowfile/web/static/assets/ExternalSource-17b23a01.js +225 -0
- flowfile/web/static/assets/ExternalSource-e37b6275.css +94 -0
- flowfile/web/static/assets/Filter-90856b4f.js +238 -0
- flowfile/web/static/assets/Filter-a9d08ba1.css +20 -0
- flowfile/web/static/assets/Formula-38b71e9e.js +197 -0
- flowfile/web/static/assets/Formula-d60a74f4.css +17 -0
- flowfile/web/static/assets/FuzzyMatch-6857de82.css +254 -0
- flowfile/web/static/assets/FuzzyMatch-d0f1fe81.js +422 -0
- flowfile/web/static/assets/GoogleSheet-854294a4.js +2616 -0
- flowfile/web/static/assets/GoogleSheet-92084da7.css +233 -0
- flowfile/web/static/assets/GraphSolver-0c86bbc6.js +382 -0
- flowfile/web/static/assets/GraphSolver-17fd26db.css +68 -0
- flowfile/web/static/assets/GroupBy-ab1ea74b.css +51 -0
- flowfile/web/static/assets/GroupBy-f2772e9f.js +413 -0
- flowfile/web/static/assets/Join-41c0f331.css +109 -0
- flowfile/web/static/assets/Join-bc3e1cf7.js +247 -0
- flowfile/web/static/assets/ManualInput-03aa0245.js +391 -0
- flowfile/web/static/assets/ManualInput-ac7b9972.css +84 -0
- flowfile/web/static/assets/Output-48f81019.css +2642 -0
- flowfile/web/static/assets/Output-5b35eee8.js +536 -0
- flowfile/web/static/assets/Pivot-7164087c.js +408 -0
- flowfile/web/static/assets/Pivot-f415e85f.css +35 -0
- flowfile/web/static/assets/PolarsCode-3abf6507.js +2863 -0
- flowfile/web/static/assets/PolarsCode-650322d1.css +35 -0
- flowfile/web/static/assets/PopOver-b37ff9be.js +577 -0
- flowfile/web/static/assets/PopOver-bccfde04.css +32 -0
- flowfile/web/static/assets/Read-65966a3e.js +701 -0
- flowfile/web/static/assets/Read-80dc1675.css +197 -0
- flowfile/web/static/assets/RecordCount-c66c6d6d.js +121 -0
- flowfile/web/static/assets/RecordId-826dc095.js +339 -0
- flowfile/web/static/assets/Sample-4ed555c8.js +184 -0
- flowfile/web/static/assets/SecretManager-eac1e97d.js +382 -0
- flowfile/web/static/assets/Select-085f05cc.js +231 -0
- flowfile/web/static/assets/SettingsSection-1f5e79c1.js +87 -0
- flowfile/web/static/assets/SettingsSection-9c836ecc.css +47 -0
- flowfile/web/static/assets/Sort-3e6cb414.js +309 -0
- flowfile/web/static/assets/Sort-7ccfa0fe.css +51 -0
- flowfile/web/static/assets/TextToRows-606349bc.js +307 -0
- flowfile/web/static/assets/TextToRows-c92d1ec2.css +48 -0
- flowfile/web/static/assets/UnavailableFields-5edd5322.css +49 -0
- flowfile/web/static/assets/UnavailableFields-b41976ed.js +36 -0
- flowfile/web/static/assets/Union-8d9ac7f9.css +30 -0
- flowfile/web/static/assets/Union-fca91665.js +145 -0
- flowfile/web/static/assets/Unique-a59f830e.js +273 -0
- flowfile/web/static/assets/Unique-b5615727.css +51 -0
- flowfile/web/static/assets/Unpivot-246e9bbd.css +77 -0
- flowfile/web/static/assets/Unpivot-c3815565.js +441 -0
- flowfile/web/static/assets/airbyte-292aa232.png +0 -0
- flowfile/web/static/assets/api-22b338bd.js +60 -0
- flowfile/web/static/assets/cross_join-d30c0290.png +0 -0
- flowfile/web/static/assets/database_reader-ce1e55f3.svg +24 -0
- flowfile/web/static/assets/database_writer-b4ad0753.svg +23 -0
- flowfile/web/static/assets/designer-2394122a.css +10697 -0
- flowfile/web/static/assets/designer-e5bbe26f.js +69712 -0
- flowfile/web/static/assets/documentation-08045cf2.js +33 -0
- flowfile/web/static/assets/documentation-12216a74.css +50 -0
- flowfile/web/static/assets/dropDown-35135ba8.css +143 -0
- flowfile/web/static/assets/dropDown-5e7e9a5a.js +319 -0
- flowfile/web/static/assets/dropDownGeneric-50a91b99.js +72 -0
- flowfile/web/static/assets/dropDownGeneric-895680d6.css +10 -0
- flowfile/web/static/assets/element-icons-9c88a535.woff +0 -0
- flowfile/web/static/assets/element-icons-de5eb258.ttf +0 -0
- flowfile/web/static/assets/explore_data-8a0a2861.png +0 -0
- flowfile/web/static/assets/fa-brands-400-808443ae.ttf +0 -0
- flowfile/web/static/assets/fa-brands-400-d7236a19.woff2 +0 -0
- flowfile/web/static/assets/fa-regular-400-54cf6086.ttf +0 -0
- flowfile/web/static/assets/fa-regular-400-e3456d12.woff2 +0 -0
- flowfile/web/static/assets/fa-solid-900-aa759986.woff2 +0 -0
- flowfile/web/static/assets/fa-solid-900-d2f05935.ttf +0 -0
- flowfile/web/static/assets/fa-v4compatibility-0ce9033c.woff2 +0 -0
- flowfile/web/static/assets/fa-v4compatibility-30f6abf6.ttf +0 -0
- flowfile/web/static/assets/filter-d7708bda.png +0 -0
- flowfile/web/static/assets/formula-eeeb1611.png +0 -0
- flowfile/web/static/assets/fullEditor-178376bb.css +256 -0
- flowfile/web/static/assets/fullEditor-705c6ccb.js +630 -0
- flowfile/web/static/assets/fuzzy_match-40c161b2.png +0 -0
- flowfile/web/static/assets/genericNodeSettings-65587f20.js +137 -0
- flowfile/web/static/assets/genericNodeSettings-924759c7.css +46 -0
- flowfile/web/static/assets/graph_solver-8b7888b8.png +0 -0
- flowfile/web/static/assets/group_by-80561fc3.png +0 -0
- flowfile/web/static/assets/index-552863fd.js +58652 -0
- flowfile/web/static/assets/index-681a3ed0.css +8843 -0
- flowfile/web/static/assets/input_data-ab2eb678.png +0 -0
- flowfile/web/static/assets/join-349043ae.png +0 -0
- flowfile/web/static/assets/manual_input-ae98f31d.png +0 -0
- flowfile/web/static/assets/nodeTitle-cf9bae3c.js +227 -0
- flowfile/web/static/assets/nodeTitle-f4b12bcb.css +134 -0
- flowfile/web/static/assets/old_join-5d0eb604.png +0 -0
- flowfile/web/static/assets/output-06ec0371.png +0 -0
- flowfile/web/static/assets/pivot-9660df51.png +0 -0
- flowfile/web/static/assets/polars_code-05ce5dc6.png +0 -0
- flowfile/web/static/assets/record_count-dab44eb5.png +0 -0
- flowfile/web/static/assets/record_id-0b15856b.png +0 -0
- flowfile/web/static/assets/sample-693a88b5.png +0 -0
- flowfile/web/static/assets/secretApi-3ad510e1.js +46 -0
- flowfile/web/static/assets/select-b0d0437a.png +0 -0
- flowfile/web/static/assets/selectDynamic-b062bc9b.css +107 -0
- flowfile/web/static/assets/selectDynamic-bd644891.js +302 -0
- flowfile/web/static/assets/sort-2aa579f0.png +0 -0
- flowfile/web/static/assets/summarize-2a099231.png +0 -0
- flowfile/web/static/assets/text_to_rows-859b29ea.png +0 -0
- flowfile/web/static/assets/union-2d8609f4.png +0 -0
- flowfile/web/static/assets/unique-1958b98a.png +0 -0
- flowfile/web/static/assets/unpivot-d3cb4b5b.png +0 -0
- flowfile/web/static/assets/view-7a0f0be1.png +0 -0
- flowfile/web/static/assets/vue-codemirror.esm-dd17b478.js +22281 -0
- flowfile/web/static/assets/vue-content-loader.es-6b36f05e.js +210 -0
- flowfile/web/static/flowfile.svg +47 -0
- flowfile/web/static/icons/flowfile.png +0 -0
- flowfile/web/static/images/airbyte.png +0 -0
- flowfile/web/static/images/flowfile.svg +47 -0
- flowfile/web/static/images/google.svg +1 -0
- flowfile/web/static/images/sheets.png +0 -0
- flowfile/web/static/index.html +22 -0
- flowfile/web/static/vite.svg +1 -0
- flowfile/web/static/vue.svg +1 -0
- {flowfile-0.3.0.dist-info → flowfile-0.3.0.1.dist-info}/METADATA +1 -1
- {flowfile-0.3.0.dist-info → flowfile-0.3.0.1.dist-info}/RECORD +146 -15
- {flowfile-0.3.0.dist-info → flowfile-0.3.0.1.dist-info}/entry_points.txt +1 -1
- flowfile_core/configs/settings.py +7 -32
- flowfile_core/flowfile/FlowfileFlow.py +4 -2
- flowfile_core/flowfile/analytics/analytics_processor.py +1 -1
- flowfile_core/main.py +4 -1
- flowfile_core/schemas/input_schema.py +1 -8
- flowfile_frame/__init__.py +0 -1
- flowfile_frame/utils.py +0 -139
- flowfile_frame/__main__.py +0 -12
- {flowfile-0.3.0.dist-info → flowfile-0.3.0.1.dist-info}/LICENSE +0 -0
- {flowfile-0.3.0.dist-info → flowfile-0.3.0.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { d as defineComponent, l as computed, c as openBlock, h as createBlock, w as withCtx, f as createVNode, u as unref, ap as ElIcon, p as createBaseVNode, e as createElementBlock, i as createCommentVNode, aq as ElPopover, _ as _export_sfc, r as ref, n as onMounted, R as nextTick, o as onUnmounted, b as resolveComponent, F as Fragment, q as renderList, s as normalizeClass, v as withModifiers, t as toDisplayString, a6 as Teleport } from "./index-552863fd.js";
|
|
2
|
+
import { u as useNodeStore } from "./PopOver-b37ff9be.js";
|
|
3
|
+
import { C as ContextMenu, S as SettingsSection } from "./SettingsSection-1f5e79c1.js";
|
|
4
|
+
import { G as GenericNodeSettings } from "./genericNodeSettings-65587f20.js";
|
|
5
|
+
import { N as NodeButton, a as NodeTitle } from "./nodeTitle-cf9bae3c.js";
|
|
6
|
+
import "./designer-e5bbe26f.js";
|
|
7
|
+
const _hoisted_1$2 = { class: "validation-wrapper" };
|
|
8
|
+
const _hoisted_2$1 = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "error-message"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_3$1 = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "error-message"
|
|
15
|
+
};
|
|
16
|
+
const _hoisted_4$1 = {
|
|
17
|
+
key: 2,
|
|
18
|
+
class: "error-message"
|
|
19
|
+
};
|
|
20
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
21
|
+
__name: "PivotValidation",
|
|
22
|
+
props: {
|
|
23
|
+
pivotInput: {}
|
|
24
|
+
},
|
|
25
|
+
setup(__props) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const showValidationMessages = computed(() => {
|
|
28
|
+
return !props.pivotInput.pivot_column || !props.pivotInput.value_col || props.pivotInput.aggregations.length === 0;
|
|
29
|
+
});
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return showValidationMessages.value ? (openBlock(), createBlock(unref(ElPopover), {
|
|
32
|
+
key: 0,
|
|
33
|
+
placement: "top",
|
|
34
|
+
width: "200",
|
|
35
|
+
trigger: "hover",
|
|
36
|
+
content: "Some required fields are missing"
|
|
37
|
+
}, {
|
|
38
|
+
reference: withCtx(() => [
|
|
39
|
+
createVNode(unref(ElIcon), {
|
|
40
|
+
color: "#FF6B6B",
|
|
41
|
+
class: "warning-icon"
|
|
42
|
+
}, {
|
|
43
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
44
|
+
createBaseVNode("i", { class: "el-icon-warning" }, null, -1)
|
|
45
|
+
])),
|
|
46
|
+
_: 1
|
|
47
|
+
})
|
|
48
|
+
]),
|
|
49
|
+
default: withCtx(() => [
|
|
50
|
+
createBaseVNode("div", _hoisted_1$2, [
|
|
51
|
+
!_ctx.pivotInput.pivot_column ? (openBlock(), createElementBlock("p", _hoisted_2$1, "Pivot Column cannot be empty.")) : createCommentVNode("", true),
|
|
52
|
+
!_ctx.pivotInput.value_col ? (openBlock(), createElementBlock("p", _hoisted_3$1, "Value Column cannot be empty.")) : createCommentVNode("", true),
|
|
53
|
+
_ctx.pivotInput.aggregations.length === 0 ? (openBlock(), createElementBlock("p", _hoisted_4$1, " At least one aggregation must be selected. ")) : createCommentVNode("", true)
|
|
54
|
+
])
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
})) : createCommentVNode("", true);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const PivotValidation_vue_vue_type_style_index_0_scoped_3eb585b2_lang = "";
|
|
62
|
+
const PivotValidation = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-3eb585b2"]]);
|
|
63
|
+
const _hoisted_1$1 = {
|
|
64
|
+
key: 0,
|
|
65
|
+
class: "listbox-wrapper"
|
|
66
|
+
};
|
|
67
|
+
const _hoisted_2 = { class: "listbox-wrapper" };
|
|
68
|
+
const _hoisted_3 = { class: "listbox" };
|
|
69
|
+
const _hoisted_4 = ["onClick", "onContextmenu", "onDragstart", "onDrop"];
|
|
70
|
+
const _hoisted_5 = { class: "listbox-wrapper" };
|
|
71
|
+
const _hoisted_6 = { class: "list-wrapper" };
|
|
72
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
73
|
+
__name: "pivot",
|
|
74
|
+
setup(__props, { expose: __expose }) {
|
|
75
|
+
const nodeStore = useNodeStore();
|
|
76
|
+
const showContextMenu = ref(false);
|
|
77
|
+
const dataLoaded = ref(false);
|
|
78
|
+
const contextMenuPosition = ref({ x: 0, y: 0 });
|
|
79
|
+
const selectedColumns = ref([]);
|
|
80
|
+
const contextMenuOptions = ref([]);
|
|
81
|
+
const contextMenuRef = ref(null);
|
|
82
|
+
const nodeData = ref(null);
|
|
83
|
+
const draggedColumnName = ref(null);
|
|
84
|
+
const aggOptions = [
|
|
85
|
+
"sum",
|
|
86
|
+
"count",
|
|
87
|
+
"min",
|
|
88
|
+
"max",
|
|
89
|
+
"n_unique",
|
|
90
|
+
"mean",
|
|
91
|
+
"median",
|
|
92
|
+
"first",
|
|
93
|
+
"last",
|
|
94
|
+
"concat"
|
|
95
|
+
];
|
|
96
|
+
const pivotInput = ref({
|
|
97
|
+
index_columns: [],
|
|
98
|
+
pivot_column: null,
|
|
99
|
+
value_col: null,
|
|
100
|
+
aggregations: []
|
|
101
|
+
});
|
|
102
|
+
const nodePivot = ref(null);
|
|
103
|
+
const singleColumnSelected = computed(() => selectedColumns.value.length === 1);
|
|
104
|
+
const getColumnClass = (columnName) => {
|
|
105
|
+
return selectedColumns.value.includes(columnName) ? "is-selected" : "";
|
|
106
|
+
};
|
|
107
|
+
const onDragStart = (columnName, event) => {
|
|
108
|
+
var _a;
|
|
109
|
+
draggedColumnName.value = columnName;
|
|
110
|
+
(_a = event.dataTransfer) == null ? void 0 : _a.setData("text/plain", columnName);
|
|
111
|
+
};
|
|
112
|
+
const onDrop = (index) => {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
if (draggedColumnName.value) {
|
|
115
|
+
const colSchema = (_b = (_a = nodeData.value) == null ? void 0 : _a.main_input) == null ? void 0 : _b.table_schema;
|
|
116
|
+
if (colSchema) {
|
|
117
|
+
const fromIndex = colSchema.findIndex((col) => col.name === draggedColumnName.value);
|
|
118
|
+
if (fromIndex !== -1 && fromIndex !== index) {
|
|
119
|
+
const [movedColumn] = colSchema.splice(fromIndex, 1);
|
|
120
|
+
colSchema.splice(index, 0, movedColumn);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
draggedColumnName.value = null;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const onDropInSection = (section) => {
|
|
127
|
+
if (draggedColumnName.value) {
|
|
128
|
+
removeColumnIfExists(draggedColumnName.value);
|
|
129
|
+
if (section === "index" && !pivotInput.value.index_columns.includes(draggedColumnName.value)) {
|
|
130
|
+
pivotInput.value.index_columns.push(draggedColumnName.value);
|
|
131
|
+
} else if (section === "pivot") {
|
|
132
|
+
pivotInput.value.pivot_column = draggedColumnName.value;
|
|
133
|
+
} else if (section === "value") {
|
|
134
|
+
pivotInput.value.value_col = draggedColumnName.value;
|
|
135
|
+
}
|
|
136
|
+
draggedColumnName.value = null;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const openContextMenu = (columnName, event) => {
|
|
140
|
+
selectedColumns.value = [columnName];
|
|
141
|
+
contextMenuPosition.value = { x: event.clientX, y: event.clientY };
|
|
142
|
+
contextMenuOptions.value = [
|
|
143
|
+
{
|
|
144
|
+
label: "Add to Index",
|
|
145
|
+
action: "index",
|
|
146
|
+
disabled: isColumnAssigned(columnName)
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
label: "Set as Pivot",
|
|
150
|
+
action: "pivot",
|
|
151
|
+
disabled: isColumnAssigned(columnName) || !singleColumnSelected.value
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
label: "Set as Value",
|
|
155
|
+
action: "value",
|
|
156
|
+
disabled: isColumnAssigned(columnName) || !singleColumnSelected.value
|
|
157
|
+
}
|
|
158
|
+
];
|
|
159
|
+
showContextMenu.value = true;
|
|
160
|
+
};
|
|
161
|
+
const handleContextMenuSelect = (action) => {
|
|
162
|
+
const column = selectedColumns.value[0];
|
|
163
|
+
if (action === "index" && !pivotInput.value.index_columns.includes(column)) {
|
|
164
|
+
removeColumnIfExists(column);
|
|
165
|
+
pivotInput.value.index_columns.push(column);
|
|
166
|
+
} else if (action === "pivot") {
|
|
167
|
+
removeColumnIfExists(column);
|
|
168
|
+
pivotInput.value.pivot_column = column;
|
|
169
|
+
} else if (action === "value") {
|
|
170
|
+
removeColumnIfExists(column);
|
|
171
|
+
pivotInput.value.value_col = column;
|
|
172
|
+
}
|
|
173
|
+
closeContextMenu();
|
|
174
|
+
};
|
|
175
|
+
const isColumnAssigned = (columnName) => {
|
|
176
|
+
return pivotInput.value.index_columns.includes(columnName) || pivotInput.value.pivot_column === columnName || pivotInput.value.value_col === columnName;
|
|
177
|
+
};
|
|
178
|
+
const removeColumnIfExists = (column) => {
|
|
179
|
+
pivotInput.value.index_columns = pivotInput.value.index_columns.filter((col) => col !== column);
|
|
180
|
+
if (pivotInput.value.pivot_column === column)
|
|
181
|
+
pivotInput.value.pivot_column = null;
|
|
182
|
+
if (pivotInput.value.value_col === column)
|
|
183
|
+
pivotInput.value.value_col = null;
|
|
184
|
+
};
|
|
185
|
+
const removeColumn = (type, column) => {
|
|
186
|
+
if (type === "index") {
|
|
187
|
+
pivotInput.value.index_columns = pivotInput.value.index_columns.filter((col) => col !== column);
|
|
188
|
+
} else if (type === "pivot") {
|
|
189
|
+
pivotInput.value.pivot_column = null;
|
|
190
|
+
} else if (type === "value") {
|
|
191
|
+
pivotInput.value.value_col = null;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
const handleItemClick = (columnName) => {
|
|
195
|
+
selectedColumns.value = [columnName];
|
|
196
|
+
};
|
|
197
|
+
const loadNodeData = async (nodeId) => {
|
|
198
|
+
var _a;
|
|
199
|
+
nodeData.value = await nodeStore.getNodeData(nodeId, false);
|
|
200
|
+
nodePivot.value = (_a = nodeData.value) == null ? void 0 : _a.setting_input;
|
|
201
|
+
if (nodeData.value) {
|
|
202
|
+
if (nodePivot.value) {
|
|
203
|
+
if (nodePivot.value.pivot_input) {
|
|
204
|
+
pivotInput.value = nodePivot.value.pivot_input;
|
|
205
|
+
} else {
|
|
206
|
+
nodePivot.value.pivot_input = pivotInput.value;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
dataLoaded.value = true;
|
|
211
|
+
nodeStore.isDrawerOpen = true;
|
|
212
|
+
};
|
|
213
|
+
const handleClickOutside = (event) => {
|
|
214
|
+
const targetEvent = event.target;
|
|
215
|
+
if (targetEvent.id === "pivot-context-menu")
|
|
216
|
+
return;
|
|
217
|
+
showContextMenu.value = false;
|
|
218
|
+
};
|
|
219
|
+
const closeContextMenu = () => {
|
|
220
|
+
showContextMenu.value = false;
|
|
221
|
+
};
|
|
222
|
+
const pushNodeData = async () => {
|
|
223
|
+
if (pivotInput.value) {
|
|
224
|
+
nodeStore.updateSettings(nodePivot);
|
|
225
|
+
}
|
|
226
|
+
nodeStore.isDrawerOpen = false;
|
|
227
|
+
};
|
|
228
|
+
__expose({
|
|
229
|
+
loadNodeData,
|
|
230
|
+
pushNodeData
|
|
231
|
+
});
|
|
232
|
+
onMounted(async () => {
|
|
233
|
+
await nextTick();
|
|
234
|
+
window.addEventListener("click", handleClickOutside);
|
|
235
|
+
});
|
|
236
|
+
onUnmounted(() => {
|
|
237
|
+
window.removeEventListener("click", handleClickOutside);
|
|
238
|
+
});
|
|
239
|
+
return (_ctx, _cache) => {
|
|
240
|
+
const _component_el_option = resolveComponent("el-option");
|
|
241
|
+
const _component_el_select = resolveComponent("el-select");
|
|
242
|
+
return dataLoaded.value && nodePivot.value ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
243
|
+
createVNode(GenericNodeSettings, {
|
|
244
|
+
modelValue: nodePivot.value,
|
|
245
|
+
"onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => nodePivot.value = $event)
|
|
246
|
+
}, {
|
|
247
|
+
default: withCtx(() => {
|
|
248
|
+
var _a, _b;
|
|
249
|
+
return [
|
|
250
|
+
createBaseVNode("div", _hoisted_2, [
|
|
251
|
+
createBaseVNode("ul", _hoisted_3, [
|
|
252
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList((_b = (_a = nodeData.value) == null ? void 0 : _a.main_input) == null ? void 0 : _b.table_schema, (col_schema, index) => {
|
|
253
|
+
return openBlock(), createElementBlock("li", {
|
|
254
|
+
key: col_schema.name,
|
|
255
|
+
class: normalizeClass(getColumnClass(col_schema.name)),
|
|
256
|
+
draggable: "true",
|
|
257
|
+
onClick: ($event) => handleItemClick(col_schema.name),
|
|
258
|
+
onContextmenu: withModifiers(($event) => openContextMenu(col_schema.name, $event), ["prevent"]),
|
|
259
|
+
onDragstart: ($event) => onDragStart(col_schema.name, $event),
|
|
260
|
+
onDragover: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
261
|
+
}, ["prevent"])),
|
|
262
|
+
onDrop: ($event) => onDrop(index)
|
|
263
|
+
}, toDisplayString(col_schema.name) + " (" + toDisplayString(col_schema.data_type) + ") ", 43, _hoisted_4);
|
|
264
|
+
}), 128))
|
|
265
|
+
])
|
|
266
|
+
]),
|
|
267
|
+
showContextMenu.value ? (openBlock(), createBlock(ContextMenu, {
|
|
268
|
+
key: 0,
|
|
269
|
+
id: "pivot-context-menu",
|
|
270
|
+
ref_key: "contextMenuRef",
|
|
271
|
+
ref: contextMenuRef,
|
|
272
|
+
position: contextMenuPosition.value,
|
|
273
|
+
options: contextMenuOptions.value,
|
|
274
|
+
onSelect: handleContextMenuSelect,
|
|
275
|
+
onClose: closeContextMenu
|
|
276
|
+
}, null, 8, ["position", "options"])) : createCommentVNode("", true),
|
|
277
|
+
createBaseVNode("div", _hoisted_5, [
|
|
278
|
+
createVNode(SettingsSection, {
|
|
279
|
+
title: "Index Keys",
|
|
280
|
+
items: pivotInput.value.index_columns,
|
|
281
|
+
droppable: "true",
|
|
282
|
+
onRemoveItem: _cache[1] || (_cache[1] = ($event) => removeColumn("index", $event)),
|
|
283
|
+
onDragover: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
284
|
+
}, ["prevent"])),
|
|
285
|
+
onDrop: _cache[3] || (_cache[3] = ($event) => onDropInSection("index"))
|
|
286
|
+
}, null, 8, ["items"]),
|
|
287
|
+
createVNode(SettingsSection, {
|
|
288
|
+
title: "Pivot Column",
|
|
289
|
+
items: [pivotInput.value.pivot_column ?? ""],
|
|
290
|
+
droppable: "true",
|
|
291
|
+
onRemoveItem: _cache[4] || (_cache[4] = ($event) => removeColumn("pivot", $event)),
|
|
292
|
+
onDragover: _cache[5] || (_cache[5] = withModifiers(() => {
|
|
293
|
+
}, ["prevent"])),
|
|
294
|
+
onDrop: _cache[6] || (_cache[6] = ($event) => onDropInSection("pivot"))
|
|
295
|
+
}, null, 8, ["items"]),
|
|
296
|
+
createVNode(SettingsSection, {
|
|
297
|
+
title: "Value Column",
|
|
298
|
+
items: [pivotInput.value.value_col ?? ""],
|
|
299
|
+
droppable: "true",
|
|
300
|
+
onRemoveItem: _cache[7] || (_cache[7] = ($event) => removeColumn("value", $event)),
|
|
301
|
+
onDragover: _cache[8] || (_cache[8] = withModifiers(() => {
|
|
302
|
+
}, ["prevent"])),
|
|
303
|
+
onDrop: _cache[9] || (_cache[9] = ($event) => onDropInSection("value"))
|
|
304
|
+
}, null, 8, ["items"]),
|
|
305
|
+
createBaseVNode("div", _hoisted_6, [
|
|
306
|
+
_cache[12] || (_cache[12] = createBaseVNode("div", { class: "listbox-subtitle" }, "Select aggregations", -1)),
|
|
307
|
+
createVNode(_component_el_select, {
|
|
308
|
+
modelValue: pivotInput.value.aggregations,
|
|
309
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => pivotInput.value.aggregations = $event),
|
|
310
|
+
multiple: "",
|
|
311
|
+
placeholder: "Select",
|
|
312
|
+
size: "small",
|
|
313
|
+
style: { "width": "100%" }
|
|
314
|
+
}, {
|
|
315
|
+
default: withCtx(() => [
|
|
316
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(aggOptions, (item) => {
|
|
317
|
+
return createVNode(_component_el_option, {
|
|
318
|
+
key: item,
|
|
319
|
+
label: item,
|
|
320
|
+
value: item,
|
|
321
|
+
style: { "width": "400px" }
|
|
322
|
+
}, null, 8, ["label", "value"]);
|
|
323
|
+
}), 64))
|
|
324
|
+
]),
|
|
325
|
+
_: 1
|
|
326
|
+
}, 8, ["modelValue"])
|
|
327
|
+
]),
|
|
328
|
+
createVNode(PivotValidation, { "pivot-input": pivotInput.value }, null, 8, ["pivot-input"])
|
|
329
|
+
])
|
|
330
|
+
];
|
|
331
|
+
}),
|
|
332
|
+
_: 1
|
|
333
|
+
}, 8, ["modelValue"])
|
|
334
|
+
])) : createCommentVNode("", true);
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
const pivot_vue_vue_type_style_index_0_scoped_d0f14439_lang = "";
|
|
339
|
+
const readInput = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d0f14439"]]);
|
|
340
|
+
const _hoisted_1 = { ref: "el" };
|
|
341
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
342
|
+
__name: "Pivot",
|
|
343
|
+
props: {
|
|
344
|
+
nodeId: {
|
|
345
|
+
type: Number,
|
|
346
|
+
required: true
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
setup(__props) {
|
|
350
|
+
const nodeStore = useNodeStore();
|
|
351
|
+
const childComp = ref(null);
|
|
352
|
+
const props = __props;
|
|
353
|
+
const drawer = ref(false);
|
|
354
|
+
const closeOnDrawer = () => {
|
|
355
|
+
var _a;
|
|
356
|
+
drawer.value = false;
|
|
357
|
+
(_a = childComp.value) == null ? void 0 : _a.pushNodeData();
|
|
358
|
+
};
|
|
359
|
+
const openDrawer = async () => {
|
|
360
|
+
if (nodeStore.node_id === props.nodeId) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
nodeStore.closeDrawer();
|
|
364
|
+
drawer.value = true;
|
|
365
|
+
const drawerOpen = nodeStore.isDrawerOpen;
|
|
366
|
+
nodeStore.isDrawerOpen = true;
|
|
367
|
+
await nextTick();
|
|
368
|
+
if (nodeStore.node_id === props.nodeId && drawerOpen) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
if (childComp.value) {
|
|
372
|
+
childComp.value.loadNodeData(props.nodeId);
|
|
373
|
+
nodeStore.openDrawer(closeOnDrawer);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
onMounted(async () => {
|
|
377
|
+
await nextTick();
|
|
378
|
+
});
|
|
379
|
+
return (_ctx, _cache) => {
|
|
380
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
381
|
+
createVNode(NodeButton, {
|
|
382
|
+
ref: "nodeButton",
|
|
383
|
+
"node-id": __props.nodeId,
|
|
384
|
+
"image-src": "pivot.png",
|
|
385
|
+
title: `${__props.nodeId}: Pivot data`,
|
|
386
|
+
onClick: openDrawer
|
|
387
|
+
}, null, 8, ["node-id", "title"]),
|
|
388
|
+
drawer.value ? (openBlock(), createBlock(Teleport, {
|
|
389
|
+
key: 0,
|
|
390
|
+
to: "#nodesettings"
|
|
391
|
+
}, [
|
|
392
|
+
createVNode(NodeTitle, {
|
|
393
|
+
title: "Pivot data",
|
|
394
|
+
intro: "Pivot rows to columns, to understand your data better"
|
|
395
|
+
}),
|
|
396
|
+
createVNode(readInput, {
|
|
397
|
+
ref_key: "childComp",
|
|
398
|
+
ref: childComp,
|
|
399
|
+
"node-id": __props.nodeId
|
|
400
|
+
}, null, 8, ["node-id"])
|
|
401
|
+
])) : createCommentVNode("", true)
|
|
402
|
+
], 512);
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
export {
|
|
407
|
+
_sfc_main as default
|
|
408
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
.validation-wrapper[data-v-3eb585b2] {
|
|
3
|
+
background-color: #ffffff;
|
|
4
|
+
}
|
|
5
|
+
.error-message[data-v-3eb585b2] {
|
|
6
|
+
color: #991b1b;
|
|
7
|
+
margin: 5px 0;
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
}
|
|
10
|
+
.warning-icon[data-v-3eb585b2] {
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
font-size: 24px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.context-menu[data-v-d0f14439] {
|
|
16
|
+
position: fixed;
|
|
17
|
+
z-index: 1000;
|
|
18
|
+
border: 1px solid #ccc;
|
|
19
|
+
background-color: white;
|
|
20
|
+
padding: 8px;
|
|
21
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
|
|
22
|
+
border-radius: 4px;
|
|
23
|
+
}
|
|
24
|
+
.context-menu ul[data-v-d0f14439] {
|
|
25
|
+
list-style: none;
|
|
26
|
+
padding: 0;
|
|
27
|
+
margin: 0;
|
|
28
|
+
}
|
|
29
|
+
.context-menu li[data-v-d0f14439] {
|
|
30
|
+
padding: 8px 16px;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
}
|
|
33
|
+
.context-menu li[data-v-d0f14439]:hover {
|
|
34
|
+
background-color: #f0f0f0;
|
|
35
|
+
}
|