@kestra-io/ui-libs 0.0.228 → 0.0.230
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/VueFlowUtils-BhTB7zMW.cjs +2 -0
- package/dist/VueFlowUtils-BhTB7zMW.cjs.map +1 -0
- package/dist/{VueFlowUtils-8xjnZl4e.js → VueFlowUtils-BmNdCDFy.js} +461 -452
- package/dist/VueFlowUtils-BmNdCDFy.js.map +1 -0
- package/dist/assets/icons/RotatingDots.vue.d.ts +6 -0
- package/dist/assets/icons/RotatingDots.vue.d.ts.map +1 -0
- package/dist/components/misc/ExecutionInformations.vue.d.ts +1 -0
- package/dist/components/misc/ExecutionInformations.vue.d.ts.map +1 -1
- package/dist/components/nodes/BasicNode.vue.d.ts +44 -113
- package/dist/components/nodes/BasicNode.vue.d.ts.map +1 -1
- package/dist/components/nodes/EdgeNode.vue.d.ts +5 -7
- package/dist/components/nodes/EdgeNode.vue.d.ts.map +1 -1
- package/dist/components/nodes/TaskNode.vue.d.ts +48 -240
- package/dist/components/nodes/TaskNode.vue.d.ts.map +1 -1
- package/dist/components/plugins/PluginIndex.vue.d.ts +2 -8
- package/dist/components/plugins/PluginIndex.vue.d.ts.map +1 -1
- package/dist/components/topology/Topology.vue.d.ts +13 -4
- package/dist/components/topology/Topology.vue.d.ts.map +1 -1
- package/dist/components/topology/injectionKeys.d.ts +0 -1
- package/dist/components/topology/injectionKeys.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/kestra-index.cjs.js +14 -14
- package/dist/kestra-index.cjs.js.map +1 -1
- package/dist/kestra-index.es.js +3636 -3679
- package/dist/kestra-index.es.js.map +1 -1
- package/dist/kestra-vueflowutils.cjs.js +1 -1
- package/dist/kestra-vueflowutils.es.js +6 -6
- package/dist/ui-libs.css +1 -1
- package/dist/utils/Utils.d.ts +14 -7
- package/dist/utils/Utils.d.ts.map +1 -1
- package/dist/utils/state.d.ts +1 -0
- package/dist/utils/state.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons/RotatingDots.vue +25 -0
- package/src/components/misc/Duration.vue +2 -2
- package/src/components/misc/ExecutionInformations.vue +6 -36
- package/src/components/nodes/BasicNode.vue +127 -152
- package/src/components/nodes/TaskNode.vue +265 -189
- package/src/components/topology/Topology.vue +8 -3
- package/src/components/topology/injectionKeys.ts +1 -2
- package/src/index.ts +1 -0
- package/src/utils/Utils.ts +48 -34
- package/src/utils/state.ts +4 -0
- package/dist/VueFlowUtils-8xjnZl4e.js.map +0 -1
- package/dist/VueFlowUtils-dC12uRkV.cjs +0 -2
- package/dist/VueFlowUtils-dC12uRkV.cjs.map +0 -1
package/src/utils/Utils.ts
CHANGED
|
@@ -29,9 +29,10 @@ const humanizeDurationLanguages = {
|
|
|
29
29
|
export const DATE_FORMAT_STORAGE_KEY = "dateFormat";
|
|
30
30
|
export const TIMEZONE_STORAGE_KEY = "timezone";
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
|
|
33
|
+
export const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1)
|
|
34
|
+
|
|
35
|
+
export const dateFilter = (dateString: string, format: string) => {
|
|
35
36
|
const currentLocale = getCurrentInstance()?.appContext.config.globalProperties.$moment().locale();
|
|
36
37
|
const momentInstance = getCurrentInstance()?.appContext.config.globalProperties.$moment(dateString).locale(currentLocale);
|
|
37
38
|
let f;
|
|
@@ -44,39 +45,52 @@ export default {
|
|
|
44
45
|
return momentInstance
|
|
45
46
|
.tz(localStorage.getItem(TIMEZONE_STORAGE_KEY) ?? momentTz.tz.guess())
|
|
46
47
|
.format(f);
|
|
47
|
-
}
|
|
48
|
-
splitFirst(str: string, separator: string) {
|
|
49
|
-
return str.split(separator).slice(1).join(separator);
|
|
50
|
-
},
|
|
48
|
+
}
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
);
|
|
56
|
-
},
|
|
57
|
-
humanDuration(
|
|
58
|
-
value: number | string,
|
|
59
|
-
options?: HumanizeDurationOptions & { languages?: any }
|
|
60
|
-
) {
|
|
61
|
-
options = options || {maxDecimalPoints: 2};
|
|
62
|
-
options.spacer = "";
|
|
63
|
-
options.language = localStorage.getItem("lang") || "en";
|
|
64
|
-
options.languages = humanizeDurationLanguages;
|
|
65
|
-
options.largest = 2;
|
|
50
|
+
export function splitFirst(str: string, separator: string) {
|
|
51
|
+
return str.split(separator).slice(1).join(separator);
|
|
52
|
+
}
|
|
66
53
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
export function duration(isoString: string) {
|
|
55
|
+
return (
|
|
56
|
+
moment.duration(isoString, moment.ISO_8601 as any).asMilliseconds() / 1000
|
|
57
|
+
);
|
|
58
|
+
}
|
|
70
59
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
60
|
+
export function humanDuration(
|
|
61
|
+
value: number | string,
|
|
62
|
+
options?: HumanizeDurationOptions & { languages?: any }
|
|
63
|
+
) {
|
|
64
|
+
options = options || {maxDecimalPoints: 2};
|
|
65
|
+
options.spacer = "";
|
|
66
|
+
options.language = localStorage.getItem("lang") || "en";
|
|
67
|
+
options.languages = humanizeDurationLanguages;
|
|
68
|
+
options.largest = 2;
|
|
69
|
+
|
|
70
|
+
if (typeof value !== "number") {
|
|
71
|
+
value = duration(value);
|
|
81
72
|
}
|
|
73
|
+
|
|
74
|
+
return humanizeDuration(value * 1000, options).replace(
|
|
75
|
+
/\.([0-9])s$/i,
|
|
76
|
+
".$10s"
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function afterLastDot(str: string) {
|
|
81
|
+
return str.split(".").pop();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function distinctFilter(value: any, index: number, array: any[]) {
|
|
85
|
+
return array.indexOf(value) === index;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export default {
|
|
89
|
+
capitalize,
|
|
90
|
+
dateFilter,
|
|
91
|
+
splitFirst,
|
|
92
|
+
duration,
|
|
93
|
+
humanDuration,
|
|
94
|
+
afterLastDot,
|
|
95
|
+
distinctFilter
|
|
82
96
|
};
|