@effect-app/vue-components 4.0.0-beta.180 → 4.0.0-beta.182
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { computed as e, createBlock as t, createCommentVNode as n,
|
|
2
|
-
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementVNode as r, createSlots as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeProps as c, openBlock as l, renderSlot as u, resolveComponent as d, toDisplayString as f, withCtx as p } from "vue";
|
|
2
|
+
//#region src/components/CommandButton.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var m = { class: "ml-2" }, h = { class: "ml-2" }, g = /* @__PURE__ */ s({
|
|
3
4
|
name: "CommandButton",
|
|
4
5
|
props: {
|
|
5
6
|
input: {},
|
|
@@ -8,40 +9,64 @@ var d = /* @__PURE__ */ i({
|
|
|
8
9
|
disabled: {},
|
|
9
10
|
title: {}
|
|
10
11
|
},
|
|
11
|
-
setup(
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
setup(s) {
|
|
13
|
+
let g = s, _ = e(() => g.command.blocked || g.disabled), v = e(() => {
|
|
14
|
+
let e = g.command.progress;
|
|
15
|
+
if (e !== void 0) return typeof e == "string" ? e : e.text;
|
|
16
|
+
}), y = e(() => {
|
|
17
|
+
let e = g.command.progress;
|
|
18
|
+
return typeof e == "object" && e ? e.percentage : void 0;
|
|
19
|
+
}), b = () => {
|
|
20
|
+
if (_.value) return;
|
|
21
|
+
let e = "input" in g && g.input ? g.input : void 0, t = g.command.handle;
|
|
15
22
|
t(e);
|
|
16
23
|
};
|
|
17
|
-
return (e,
|
|
18
|
-
let
|
|
19
|
-
return
|
|
20
|
-
loading:
|
|
21
|
-
"aria-disabled":
|
|
22
|
-
title:
|
|
23
|
-
class: { "v-btn--disabled":
|
|
24
|
-
onClick:
|
|
25
|
-
}), {
|
|
26
|
-
default:
|
|
27
|
-
loading:
|
|
28
|
-
disabled:
|
|
29
|
-
label:
|
|
30
|
-
title:
|
|
31
|
-
}, () => [
|
|
32
|
-
_:
|
|
33
|
-
},
|
|
24
|
+
return (e, g) => {
|
|
25
|
+
let x = d("v-progress-circular"), S = d("v-btn");
|
|
26
|
+
return s.command.allowed && !s.empty ? (l(), t(S, c({ key: 0 }, e.$attrs, {
|
|
27
|
+
loading: s.command.waiting,
|
|
28
|
+
"aria-disabled": _.value,
|
|
29
|
+
title: s.title ?? s.command.action,
|
|
30
|
+
class: { "v-btn--disabled": _.value },
|
|
31
|
+
onClick: b
|
|
32
|
+
}), i({
|
|
33
|
+
default: p(() => [u(e.$slots, "default", {
|
|
34
|
+
loading: s.command.waiting,
|
|
35
|
+
disabled: _.value,
|
|
36
|
+
label: s.command.label,
|
|
37
|
+
title: s.title ?? s.command.action
|
|
38
|
+
}, () => [a(f(s.command.label), 1)])]),
|
|
39
|
+
_: 2
|
|
40
|
+
}, [v.value === void 0 ? void 0 : {
|
|
41
|
+
name: "loader",
|
|
42
|
+
fn: p(() => [o(x, {
|
|
43
|
+
indeterminate: y.value === void 0,
|
|
44
|
+
"model-value": y.value,
|
|
45
|
+
size: "20",
|
|
46
|
+
width: "2"
|
|
47
|
+
}, null, 8, ["indeterminate", "model-value"]), r("span", m, f(v.value), 1)]),
|
|
48
|
+
key: "0"
|
|
49
|
+
}]), 1040, [
|
|
34
50
|
"loading",
|
|
35
51
|
"aria-disabled",
|
|
36
52
|
"title",
|
|
37
53
|
"class"
|
|
38
|
-
])) :
|
|
39
|
-
loading:
|
|
40
|
-
"aria-disabled":
|
|
41
|
-
title:
|
|
42
|
-
class: { "v-btn--disabled":
|
|
43
|
-
onClick:
|
|
44
|
-
}),
|
|
54
|
+
])) : s.command.allowed ? (l(), t(S, c({ key: 1 }, e.$attrs, {
|
|
55
|
+
loading: s.command.waiting,
|
|
56
|
+
"aria-disabled": _.value,
|
|
57
|
+
title: s.title ?? s.command.action,
|
|
58
|
+
class: { "v-btn--disabled": _.value },
|
|
59
|
+
onClick: b
|
|
60
|
+
}), i({ _: 2 }, [v.value === void 0 ? void 0 : {
|
|
61
|
+
name: "loader",
|
|
62
|
+
fn: p(() => [o(x, {
|
|
63
|
+
indeterminate: y.value === void 0,
|
|
64
|
+
"model-value": y.value,
|
|
65
|
+
size: "20",
|
|
66
|
+
width: "2"
|
|
67
|
+
}, null, 8, ["indeterminate", "model-value"]), r("span", h, f(v.value), 1)]),
|
|
68
|
+
key: "0"
|
|
69
|
+
}]), 1040, [
|
|
45
70
|
"loading",
|
|
46
71
|
"aria-disabled",
|
|
47
72
|
"title",
|
|
@@ -51,4 +76,4 @@ var d = /* @__PURE__ */ i({
|
|
|
51
76
|
}
|
|
52
77
|
});
|
|
53
78
|
//#endregion
|
|
54
|
-
export {
|
|
79
|
+
export { g as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.182",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"effect": "^4.0.0-beta.59",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"highlight.js": "^11.11.1",
|
|
58
58
|
"mitt": "^3.0.1",
|
|
59
59
|
"vue3-highlightjs": "^1.0.5",
|
|
60
|
-
"@effect-app/vue": "4.0.0-beta.
|
|
61
|
-
"effect-app": "4.0.0-beta.
|
|
60
|
+
"@effect-app/vue": "4.0.0-beta.182",
|
|
61
|
+
"effect-app": "4.0.0-beta.182"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"check": "vue-tsc",
|
|
@@ -32,6 +32,17 @@ const props = defineProps<
|
|
|
32
32
|
|
|
33
33
|
const isDisabled = computed(() => props.command.blocked || props.disabled)
|
|
34
34
|
|
|
35
|
+
const progressText = computed(() => {
|
|
36
|
+
const p = props.command.progress
|
|
37
|
+
if (p === undefined) return undefined
|
|
38
|
+
return typeof p === "string" ? p : p.text
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const progressPercentage = computed(() => {
|
|
42
|
+
const p = props.command.progress
|
|
43
|
+
return typeof p === "object" && p !== null ? p.percentage : undefined
|
|
44
|
+
})
|
|
45
|
+
|
|
35
46
|
const handleClick = () => {
|
|
36
47
|
// Block execution if button is disabled
|
|
37
48
|
if (isDisabled.value) {
|
|
@@ -62,6 +73,18 @@ export default {
|
|
|
62
73
|
:class="{ 'v-btn--disabled': isDisabled }"
|
|
63
74
|
@click="handleClick"
|
|
64
75
|
>
|
|
76
|
+
<template
|
|
77
|
+
v-if="progressText !== undefined"
|
|
78
|
+
#loader
|
|
79
|
+
>
|
|
80
|
+
<v-progress-circular
|
|
81
|
+
:indeterminate="progressPercentage === undefined"
|
|
82
|
+
:model-value="progressPercentage"
|
|
83
|
+
size="20"
|
|
84
|
+
width="2"
|
|
85
|
+
/>
|
|
86
|
+
<span class="ml-2">{{ progressText }}</span>
|
|
87
|
+
</template>
|
|
65
88
|
<slot
|
|
66
89
|
:loading="command.waiting"
|
|
67
90
|
:disabled="isDisabled"
|
|
@@ -79,5 +102,18 @@ export default {
|
|
|
79
102
|
:title="title ?? command.action"
|
|
80
103
|
:class="{ 'v-btn--disabled': isDisabled }"
|
|
81
104
|
@click="handleClick"
|
|
82
|
-
|
|
105
|
+
>
|
|
106
|
+
<template
|
|
107
|
+
v-if="progressText !== undefined"
|
|
108
|
+
#loader
|
|
109
|
+
>
|
|
110
|
+
<v-progress-circular
|
|
111
|
+
:indeterminate="progressPercentage === undefined"
|
|
112
|
+
:model-value="progressPercentage"
|
|
113
|
+
size="20"
|
|
114
|
+
width="2"
|
|
115
|
+
/>
|
|
116
|
+
<span class="ml-2">{{ progressText }}</span>
|
|
117
|
+
</template>
|
|
118
|
+
</v-btn>
|
|
83
119
|
</template>
|