lkt-step-process 1.2.0 → 1.2.1
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/build.js +19 -21
- package/package.json +1 -1
- package/src/lib-components/LktStepProcess.vue +5 -7
package/dist/build.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as K, useSlots as M, ref as c, computed as
|
|
1
|
+
import { defineComponent as K, useSlots as M, ref as c, computed as n, resolveComponent as S, createElementBlock as o, openBlock as u, normalizeClass as Q, createCommentVNode as y, createElementVNode as f, createBlock as U, toDisplayString as W, renderSlot as m, withDirectives as _, createVNode as H, withCtx as N, unref as B, vShow as g, Fragment as X, renderList as Y } from "vue";
|
|
2
2
|
const Z = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "lkt-step-process_header"
|
|
5
|
-
}, ee = { class: "lkt-step-process_header-title" }, te = { class: "lkt-step-process_header-slot" }, re = { class: "lkt-step-process-buttons" },
|
|
5
|
+
}, ee = { class: "lkt-step-process_header-title" }, te = { class: "lkt-step-process_header-slot" }, re = { class: "lkt-step-process-buttons" }, ne = { key: 1 }, le = { key: 1 }, ae = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "lkt-step-process_content"
|
|
8
8
|
}, ue = { class: "lkt-grid-1" }, oe = /* @__PURE__ */ K({
|
|
@@ -20,16 +20,16 @@ const Z = {
|
|
|
20
20
|
"prev",
|
|
21
21
|
"finish"
|
|
22
22
|
],
|
|
23
|
-
setup(v, { expose: h, emit:
|
|
24
|
-
const s = v, p = M(), x =
|
|
23
|
+
setup(v, { expose: h, emit: D }) {
|
|
24
|
+
const s = v, p = M(), x = D, l = c(!1), e = c(s.modelValue), V = c(null), b = c(null), L = n(() => l.value ? !1 : s.title || !!p["post-title"]), R = n(() => {
|
|
25
25
|
let r = [];
|
|
26
26
|
for (let k in p) k.indexOf("step-") !== -1 && r.push(k.substring(5));
|
|
27
27
|
return r;
|
|
28
|
-
}), d =
|
|
28
|
+
}), d = n(() => e.value.step ? e.value.step : !e.value.steps || !e.value.steps[0] ? null : e.value.steps[0].name), a = n(() => e.value.steps.findIndex((r) => r.name === d.value)), t = n(() => e.value.steps[a.value]), $ = n(() => typeof t.value.prevValidator == "function" ? t.value.prevValidator(e.value) : typeof t.value.prevValidator == "boolean" ? t.value.prevValidator : typeof s.prevValidator == "function" ? s.prevValidator(e.value) : !0), P = n(() => typeof t.value.nextValidator == "function" ? t.value.nextValidator(e.value) : typeof t.value.nextValidator == "boolean" ? t.value.nextValidator : typeof s.nextValidator == "function" ? s.nextValidator(e.value) : !0), j = n(() => a.value === 0 || !$.value), q = n(() => a.value === e.value.steps.length - 1 || !P.value), w = n(() => typeof t.value.prevHidden == "function" ? t.value.prevHidden(e.value) : typeof t.value.prevHidden == "boolean" ? t.value.prevHidden : a.value === 0), F = n(() => typeof t.value.nextHidden == "function" ? t.value.nextHidden(e.value) : typeof t.value.nextHidden == "boolean" ? t.value.nextHidden : a.value === e.value.steps.length - 1), E = n(() => typeof t.value.prevConfirm == "string" ? t.value.prevConfirm : ""), I = n(() => typeof t.value.nextConfirm == "string" ? t.value.nextConfirm : ""), O = n(() => typeof t.value.nextResource == "string" ? t.value.nextResource : ""), T = n(() => typeof t.value.nextResourceData == "object" ? t.value.nextResourceData : {}), z = n(() => {
|
|
29
29
|
const r = ["lkt-step-process"];
|
|
30
30
|
return d.value && r.push(`step-${d.value}`), r.join(" ");
|
|
31
31
|
}), A = (r) => {
|
|
32
|
-
e.value.step = e.value.steps[a.value + 1].name, a.value === e.value.steps.length - 1 ? x("finish", r) : x("next", r);
|
|
32
|
+
console.log("onNext: ", r), e.value.step = e.value.steps[a.value + 1].name, a.value === e.value.steps.length - 1 ? x("finish", r) : x("next", r);
|
|
33
33
|
}, G = (r) => {
|
|
34
34
|
e.value.step = e.value.steps[a.value - 1].name, x("prev", r);
|
|
35
35
|
};
|
|
@@ -40,8 +40,8 @@ const Z = {
|
|
|
40
40
|
goPrev: () => {
|
|
41
41
|
V.value.click();
|
|
42
42
|
},
|
|
43
|
-
startLoader: () =>
|
|
44
|
-
stopLoader: () =>
|
|
43
|
+
startLoader: () => l.value = !0,
|
|
44
|
+
stopLoader: () => l.value = !1
|
|
45
45
|
}), (r, k) => {
|
|
46
46
|
const C = S("lkt-button"), J = S("lkt-loader");
|
|
47
47
|
return u(), o("article", {
|
|
@@ -52,49 +52,47 @@ const Z = {
|
|
|
52
52
|
f("div", te, [
|
|
53
53
|
m(r.$slots, "post-title", {
|
|
54
54
|
config: e.value,
|
|
55
|
-
loading:
|
|
55
|
+
loading: l.value
|
|
56
56
|
})
|
|
57
57
|
])
|
|
58
58
|
])) : y("", !0),
|
|
59
59
|
f("div", re, [
|
|
60
60
|
_(H(C, {
|
|
61
61
|
ref: (i) => V.value = i,
|
|
62
|
-
palette: "danger",
|
|
63
62
|
disabled: j.value,
|
|
64
63
|
"confirm-modal": E.value,
|
|
65
64
|
onClick: G
|
|
66
65
|
}, {
|
|
67
|
-
default:
|
|
68
|
-
|
|
66
|
+
default: N(() => [
|
|
67
|
+
B(p)["button-prev"] ? m(r.$slots, "button-prev", {
|
|
69
68
|
key: 0,
|
|
70
69
|
config: e.value
|
|
71
|
-
}) : (u(), o("span",
|
|
70
|
+
}) : (u(), o("span", ne, "Back"))
|
|
72
71
|
]),
|
|
73
72
|
_: 3
|
|
74
73
|
}, 8, ["disabled", "confirm-modal"]), [
|
|
75
|
-
[g, !
|
|
74
|
+
[g, !l.value && !w.value]
|
|
76
75
|
]),
|
|
77
76
|
_(H(C, {
|
|
78
77
|
ref: (i) => b.value = i,
|
|
79
|
-
palette: "success",
|
|
80
78
|
disabled: q.value,
|
|
81
79
|
"confirm-modal": I.value,
|
|
82
80
|
resource: O.value,
|
|
83
81
|
"resource-data": T.value,
|
|
84
82
|
onClick: A
|
|
85
83
|
}, {
|
|
86
|
-
default:
|
|
87
|
-
|
|
84
|
+
default: N(() => [
|
|
85
|
+
B(p)["button-next"] ? m(r.$slots, "button-next", {
|
|
88
86
|
key: 0,
|
|
89
87
|
config: e.value
|
|
90
|
-
}) : (u(), o("span",
|
|
88
|
+
}) : (u(), o("span", le, "Next"))
|
|
91
89
|
]),
|
|
92
90
|
_: 3
|
|
93
91
|
}, 8, ["disabled", "confirm-modal", "resource", "resource-data"]), [
|
|
94
|
-
[g, !
|
|
92
|
+
[g, !l.value && !F.value]
|
|
95
93
|
])
|
|
96
94
|
]),
|
|
97
|
-
|
|
95
|
+
l.value ? y("", !0) : (u(), o("div", ae, [
|
|
98
96
|
f("div", ue, [
|
|
99
97
|
(u(!0), o(X, null, Y(R.value, (i) => _((u(), o("div", null, [
|
|
100
98
|
m(r.$slots, "step-" + i, { config: e.value })
|
|
@@ -103,7 +101,7 @@ const Z = {
|
|
|
103
101
|
])), 256))
|
|
104
102
|
])
|
|
105
103
|
])),
|
|
106
|
-
|
|
104
|
+
l.value ? (u(), U(J, { key: 2 })) : y("", !0)
|
|
107
105
|
], 2);
|
|
108
106
|
};
|
|
109
107
|
}
|
package/package.json
CHANGED
|
@@ -169,31 +169,29 @@ defineExpose({
|
|
|
169
169
|
<header class="lkt-step-process_header" v-if="displayHeader">
|
|
170
170
|
<h1 class="lkt-step-process_header-title">{{ title }}</h1>
|
|
171
171
|
<div class="lkt-step-process_header-slot">
|
|
172
|
-
<slot name="post-title" v-bind:config="config" v-bind:loading="isLoading"
|
|
172
|
+
<slot name="post-title" v-bind:config="config" v-bind:loading="isLoading"/>
|
|
173
173
|
</div>
|
|
174
174
|
</header>
|
|
175
175
|
<div class="lkt-step-process-buttons">
|
|
176
176
|
<lkt-button
|
|
177
177
|
:ref="(el:any) => prevButton = el"
|
|
178
178
|
v-show="!isLoading && !prevHidden"
|
|
179
|
-
palette="danger"
|
|
180
179
|
v-bind:disabled="prevDisabled"
|
|
181
180
|
v-bind:confirm-modal="prevConfirm"
|
|
182
181
|
v-on:click="onPrev">
|
|
183
|
-
<slot v-if="!!slots['button-prev']" name="button-prev" v-bind:config="config"
|
|
182
|
+
<slot v-if="!!slots['button-prev']" name="button-prev" v-bind:config="config"/>
|
|
184
183
|
<span v-else>Back</span>
|
|
185
184
|
</lkt-button>
|
|
186
185
|
|
|
187
186
|
<lkt-button
|
|
188
187
|
:ref="(el:any) => nextButton = el"
|
|
189
188
|
v-show="!isLoading && !nextHidden"
|
|
190
|
-
palette="success"
|
|
191
189
|
v-bind:disabled="nextDisabled"
|
|
192
190
|
v-bind:confirm-modal="nextConfirm"
|
|
193
191
|
v-bind:resource="nextResource"
|
|
194
192
|
v-bind:resource-data="nextResourceData"
|
|
195
193
|
v-on:click="onNext">
|
|
196
|
-
<slot v-if="!!slots['button-next']" name="button-next" v-bind:config="config"
|
|
194
|
+
<slot v-if="!!slots['button-next']" name="button-next" v-bind:config="config"/>
|
|
197
195
|
<span v-else>Next</span>
|
|
198
196
|
</lkt-button>
|
|
199
197
|
</div>
|
|
@@ -201,10 +199,10 @@ defineExpose({
|
|
|
201
199
|
<div class="lkt-step-process_content" v-if="!isLoading">
|
|
202
200
|
<div class="lkt-grid-1">
|
|
203
201
|
<div v-for="step in slotsSteps" v-show="step === currentStep">
|
|
204
|
-
<slot :name="'step-'+step" v-bind:config="config"
|
|
202
|
+
<slot :name="'step-'+step" v-bind:config="config"/>
|
|
205
203
|
</div>
|
|
206
204
|
</div>
|
|
207
205
|
</div>
|
|
208
|
-
<lkt-loader v-if="isLoading"
|
|
206
|
+
<lkt-loader v-if="isLoading"/>
|
|
209
207
|
</article>
|
|
210
208
|
</template>
|