@kestra-io/ui-libs 0.0.227 → 0.0.229

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.
Files changed (58) hide show
  1. package/dist/{FlowYamlUtils-MCAmyY3D.js → FlowYamlUtils-BrY8bEv7.js} +24 -17
  2. package/dist/{FlowYamlUtils-MCAmyY3D.js.map → FlowYamlUtils-BrY8bEv7.js.map} +1 -1
  3. package/dist/{FlowYamlUtils-DAm_-0Qh.cjs → FlowYamlUtils-DvtepVr2.cjs} +3 -2
  4. package/dist/{FlowYamlUtils-DAm_-0Qh.cjs.map → FlowYamlUtils-DvtepVr2.cjs.map} +1 -1
  5. package/dist/VueFlowUtils-BhTB7zMW.cjs +2 -0
  6. package/dist/VueFlowUtils-BhTB7zMW.cjs.map +1 -0
  7. package/dist/{VueFlowUtils-A_7_qgxS.js → VueFlowUtils-BmNdCDFy.js} +461 -452
  8. package/dist/VueFlowUtils-BmNdCDFy.js.map +1 -0
  9. package/dist/assets/icons/RotatingDots.vue.d.ts +6 -0
  10. package/dist/assets/icons/RotatingDots.vue.d.ts.map +1 -0
  11. package/dist/components/misc/Collapsible.vue.d.ts.map +1 -1
  12. package/dist/components/misc/ExecutionInformations.vue.d.ts +1 -0
  13. package/dist/components/misc/ExecutionInformations.vue.d.ts.map +1 -1
  14. package/dist/components/nodes/BasicNode.vue.d.ts +44 -113
  15. package/dist/components/nodes/BasicNode.vue.d.ts.map +1 -1
  16. package/dist/components/nodes/EdgeNode.vue.d.ts +5 -7
  17. package/dist/components/nodes/EdgeNode.vue.d.ts.map +1 -1
  18. package/dist/components/nodes/TaskNode.vue.d.ts +48 -240
  19. package/dist/components/nodes/TaskNode.vue.d.ts.map +1 -1
  20. package/dist/components/plugins/PluginIndex.vue.d.ts +2 -8
  21. package/dist/components/plugins/PluginIndex.vue.d.ts.map +1 -1
  22. package/dist/components/topology/Topology.vue.d.ts +13 -4
  23. package/dist/components/topology/Topology.vue.d.ts.map +1 -1
  24. package/dist/components/topology/injectionKeys.d.ts +0 -1
  25. package/dist/components/topology/injectionKeys.d.ts.map +1 -1
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/kestra-flowyamlutils.cjs.js +1 -1
  29. package/dist/kestra-flowyamlutils.es.js +1 -1
  30. package/dist/kestra-index.cjs.js +15 -15
  31. package/dist/kestra-index.cjs.js.map +1 -1
  32. package/dist/kestra-index.es.js +3611 -3656
  33. package/dist/kestra-index.es.js.map +1 -1
  34. package/dist/kestra-vueflowutils.cjs.js +1 -1
  35. package/dist/kestra-vueflowutils.es.js +7 -7
  36. package/dist/ui-libs.css +1 -1
  37. package/dist/utils/FlowYamlUtils.d.ts.map +1 -1
  38. package/dist/utils/Utils.d.ts +14 -7
  39. package/dist/utils/Utils.d.ts.map +1 -1
  40. package/dist/utils/state.d.ts +1 -0
  41. package/dist/utils/state.d.ts.map +1 -1
  42. package/package.json +1 -1
  43. package/src/assets/icons/RotatingDots.vue +25 -0
  44. package/src/components/misc/Collapsible.vue +2 -5
  45. package/src/components/misc/Duration.vue +2 -2
  46. package/src/components/misc/ExecutionInformations.vue +6 -36
  47. package/src/components/nodes/BasicNode.vue +121 -152
  48. package/src/components/nodes/TaskNode.vue +265 -189
  49. package/src/components/topology/Topology.vue +8 -3
  50. package/src/components/topology/injectionKeys.ts +1 -2
  51. package/src/index.ts +1 -0
  52. package/src/utils/FlowYamlUtils.test.ts +11 -0
  53. package/src/utils/FlowYamlUtils.ts +16 -5
  54. package/src/utils/Utils.ts +48 -34
  55. package/src/utils/state.ts +4 -0
  56. package/dist/VueFlowUtils-A_7_qgxS.js.map +0 -1
  57. package/dist/VueFlowUtils-CL70qtJ4.cjs +0 -2
  58. package/dist/VueFlowUtils-CL70qtJ4.cjs.map +0 -1
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <div
3
- :class="classes"
4
- class="node-wrapper rounded-3 border"
3
+ class="node-wrapper rounded-3"
4
+ :style="{borderColor: state ? `var(--ks-border-${state.toLowerCase()})` : undefined}"
5
+ :class="{...classes, 'running-border-animation': state === 'RUNNING'}"
5
6
  @mouseover="mouseover"
6
7
  @mouseleave="mouseleave"
7
8
  >
8
- <div v-if="state" class="status-div" :class="[`bg-${stateColor}`]" />
9
9
  <div class="icon rounded">
10
10
  <component :is="iconComponent || TaskIcon" :cls="cls" :class="taskIconBg" class="rounded bg-white" theme="light" :icons="icons" />
11
11
  </div>
@@ -59,164 +59,104 @@
59
59
  </div>
60
60
  </template>
61
61
 
62
- <script setup>
62
+ <script lang="ts" setup>
63
+ import {computed} from "vue";
63
64
  import TaskIcon from "../misc/TaskIcon.vue";
64
- </script>
65
-
66
- <script>
67
65
  import InformationOutline from "vue-material-design-icons/InformationOutline.vue";
68
66
  import {EVENTS} from "../../utils/constants";
69
67
  import ArrowExpand from "vue-material-design-icons/ArrowExpand.vue";
70
68
  import OpenInNew from "vue-material-design-icons/OpenInNew.vue";
71
69
  import Tooltip from "../misc/Tooltip.vue";
72
70
  import Utils from "../../utils/Utils";
73
- import {EXECUTION_INJECTION_KEY} from "../topology/injectionKeys";
74
-
75
- export default {
76
- components: {
77
- ArrowExpand,
78
- InformationOutline,
79
- OpenInNew,
80
- Tooltip
81
- },
82
-
83
- emits: [
84
- EVENTS.EXPAND,
85
- EVENTS.OPEN_LINK,
86
- EVENTS.SHOW_LOGS,
87
- EVENTS.MOUSE_OVER,
88
- EVENTS.MOUSE_LEAVE,
89
- EVENTS.ADD_ERROR,
90
- EVENTS.EDIT,
91
- EVENTS.DELETE,
92
- EVENTS.ADD_TASK,
93
- EVENTS.SHOW_DESCRIPTION
94
- ],
71
+
72
+ const emit = defineEmits([
73
+ EVENTS.EXPAND,
74
+ EVENTS.OPEN_LINK,
75
+ EVENTS.SHOW_LOGS,
76
+ EVENTS.MOUSE_OVER,
77
+ EVENTS.MOUSE_LEAVE,
78
+ EVENTS.ADD_ERROR,
79
+ EVENTS.EDIT,
80
+ EVENTS.DELETE,
81
+ EVENTS.ADD_TASK,
82
+ EVENTS.SHOW_DESCRIPTION
83
+ ]);
84
+
85
+ defineOptions({
86
+ name: "BasicNode",
95
87
  inheritAttrs: false,
96
- props: {
97
- id: {
98
- type: String,
99
- default: undefined
100
- },
101
- title: {
102
- type: String,
103
- default: undefined
104
- },
105
- type: {
106
- type: String,
107
- default: undefined
108
- },
109
- disabled: {
110
- type: Boolean,
111
- default: undefined
112
- },
113
- state: {
114
- type: String,
115
- default: undefined
116
- },
117
- data: {
118
- type: Object,
119
- required: true
120
- },
121
- icons: {
122
- type: Object,
123
- default: undefined
124
- },
125
- iconComponent: {
126
- type: Object,
127
- default: undefined
128
- }
129
- },
130
- methods: {
131
- mouseover() {
132
- this.$emit(EVENTS.MOUSE_OVER, this.data.node);
133
- },
134
- mouseleave() {
135
- this.$emit(EVENTS.MOUSE_LEAVE);
136
- },
137
- },
138
- data() {
139
- return {
140
- filter: undefined,
141
- isOpen: false,
142
- };
143
- },
144
- inject: {
145
- execution: {
146
- from: EXECUTION_INJECTION_KEY,
147
- },
148
- },
149
- computed: {
150
- Utils() {
151
- return Utils
152
- },
153
- borderColor() {
154
- const color = this.data.color ? this.data.color === "default" ? null : this.data.color : null
155
- return color ? color : this.expandable ? "blue" : null
156
- },
157
- EVENTS() {
158
- return EVENTS
159
- },
160
- expandable() {
161
- return this.data?.expandable || false
162
- },
163
- description() {
164
- const node = this.data.node.task ?? this.data.node.trigger ?? null
165
- if (node) {
166
- return node.description ?? null
167
- }
168
- return null
169
- },
170
- trimmedId() {
171
- return Utils.afterLastDot(this.id);
172
- },
173
- taskIconBg() {
174
- return !["default", "danger"].includes(this.data.color) ? this.data.color : "";
175
- },
176
- stateColor() {
177
- switch (this.state) {
178
- case "RUNNING":
179
- return "primary"
180
- case "SUCCESS":
181
- return "success"
182
- case "WARNING":
183
- return "warning"
184
- case "FAILED":
185
- return "danger"
186
- default:
187
- return null;
188
- }
189
- },
190
- classes() {
191
- return {
192
- "unused-path": this.data.unused,
193
- [`border-${this.borderColor}`]: this.borderColor,
194
- "disabled": this.data.node.task?.disabled || this.data.parent?.taskNode?.task?.disabled,
195
- [this.$attrs.class]: true
196
- }
197
- },
198
- cls() {
199
- if (this.data.node.triggerDeclaration) {
200
- return this.data.node.triggerDeclaration.type;
201
- }
202
-
203
- if (!this.data.node?.task) {
204
- return undefined;
205
- }
206
-
207
- return this.data.node.task.type;
208
- },
209
- hoverTooltip() {
210
- if (this.data.node.type?.endsWith("SubflowGraphTask")) {
211
- const subflowIdContainer = this.data.node.task.subflowId ?? this.data.node.task;
212
-
213
- return subflowIdContainer.namespace + " " + subflowIdContainer.flowId;
214
- }
215
-
216
- return this.trimmedId;
217
- }
218
- }
88
+ });
89
+
90
+ const props = defineProps<{
91
+ id?: string;
92
+ title?: string;
93
+ type?: string;
94
+ disabled?: boolean;
95
+ state?: string;
96
+ data: any;
97
+ icons: any;
98
+ iconComponent: any;
99
+ class?: string | string[] | Record<string, boolean>;
100
+ }>();
101
+
102
+ function mouseover() {
103
+ emit(EVENTS.MOUSE_OVER, props.data.node);
219
104
  }
105
+
106
+ function mouseleave() {
107
+ emit(EVENTS.MOUSE_LEAVE);
108
+ }
109
+
110
+ const expandable = computed(() => {
111
+ return props.data?.expandable || false
112
+ })
113
+
114
+ const description = computed(() => {
115
+ const node = props.data.node.task ?? props.data.node.trigger ?? null
116
+ if (node) {
117
+ return node.description ?? null
118
+ }
119
+ return null
120
+ })
121
+
122
+ const trimmedId = computed(() => {
123
+ return Utils.afterLastDot(props.id ?? "");
124
+ })
125
+
126
+ const taskIconBg = computed(() => {
127
+ return !["default", "danger"].includes(props.data.color) ? props.data.color : "";
128
+ })
129
+
130
+ const classes = computed(() => {
131
+ return [{
132
+ "unused-path": props.data.unused,
133
+ "disabled": props.data.node.task?.disabled || props.data.parent?.taskNode?.task?.disabled,
134
+ },
135
+ props.class
136
+ ]
137
+ })
138
+
139
+ const cls = computed(() => {
140
+ if (props.data.node.triggerDeclaration) {
141
+ return props.data.node.triggerDeclaration.type;
142
+ }
143
+
144
+ if (!props.data.node?.task) {
145
+ return undefined;
146
+ }
147
+
148
+ return props.data.node.task.type;
149
+ })
150
+
151
+ const hoverTooltip = computed(() => {
152
+ if (props.data.node.type?.endsWith("SubflowGraphTask")) {
153
+ const subflowIdContainer = props.data.node.task.subflowId ?? props.data.node.task;
154
+
155
+ return subflowIdContainer.namespace + " " + subflowIdContainer.flowId;
156
+ }
157
+
158
+ return trimmedId.value;
159
+ })
220
160
  </script>
221
161
 
222
162
  <style lang="scss" scoped>
@@ -231,6 +171,7 @@
231
171
  z-index: 150000;
232
172
  align-items: center;
233
173
  box-shadow: 0 12px 12px 0 rgba(130, 103, 158, 0.10);
174
+ border: 1px solid var(--ks-border-primary);
234
175
 
235
176
  &.execution-no-taskrun, &.disabled {
236
177
  background-color: var(--ks-background-card);
@@ -292,4 +233,32 @@
292
233
  left: -0.04438rem;
293
234
  border-radius: 0.5rem 0 0 0.5rem;
294
235
  }
236
+
237
+ .running-border-animation {
238
+ border-color: transparent !important;
239
+ &:before{
240
+ position: absolute;
241
+ content: '';
242
+ z-index: -1;
243
+ top: -1px;
244
+ left: -1px;
245
+ right: -1px;
246
+ bottom: -1px;
247
+ border-radius: .55rem;
248
+ background: conic-gradient(from calc(var(--border-angle-running) + 50.37deg) at 50% 50%, var(--ks-border-running) 0%, white 25%, var(--ks-border-running) 30%, var(--ks-border-running) 100%);
249
+ animation: running-border 2s linear infinite;
250
+ }
251
+ }
252
+
253
+ @keyframes running-border {
254
+ to {
255
+ --border-angle-running: 1turn;
256
+ }
257
+ }
258
+
259
+ @property --border-angle-running {
260
+ syntax: "<angle>";
261
+ inherits: true;
262
+ initial-value: 0turn;
263
+ }
295
264
  </style>