lkt-step-process 1.1.0 → 1.2.0

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { ve as default };
2
- declare namespace ve {
3
- function install(v: any, g?: {}): void;
1
+ export { ie as default };
2
+ declare namespace ie {
3
+ function install(v: any, h?: {}): void;
4
4
  }
package/dist/build.js CHANGED
@@ -1,12 +1,12 @@
1
- import { defineComponent as K, useSlots as M, ref as c, computed as l, resolveComponent as S, openBlock as u, createElementBlock as o, normalizeClass as Q, createElementVNode as f, toDisplayString as U, renderSlot as m, createCommentVNode as _, withDirectives as y, createVNode as H, withCtx as B, unref as D, vShow as h, Fragment as W, renderList as X, createBlock as Y } from "vue";
1
+ import { defineComponent as K, useSlots as M, ref as c, computed as l, 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 B, unref as D, 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
5
  }, ee = { class: "lkt-step-process_header-title" }, te = { class: "lkt-step-process_header-slot" }, re = { class: "lkt-step-process-buttons" }, le = { key: 1 }, ne = { key: 1 }, ae = {
6
6
  key: 1,
7
7
  class: "lkt-step-process_content"
8
- }, ue = { class: "lkt-grid-1" }, oe = { name: "LktStepProcess", inheritAttrs: !1 }, se = /* @__PURE__ */ K({
9
- ...oe,
8
+ }, ue = { class: "lkt-grid-1" }, oe = /* @__PURE__ */ K({
9
+ __name: "LktStepProcess",
10
10
  props: {
11
11
  modelValue: { type: Object, required: !1, default: () => ({ step: 1, steps: [], data: {} }) },
12
12
  title: { type: String, default: "" },
@@ -15,12 +15,15 @@ const Z = {
15
15
  nextValidator: { type: Function, required: !1, default: () => !0 },
16
16
  prevValidator: { type: Function, required: !1, default: () => !0 }
17
17
  },
18
- emits: ["next", "prev", "finish"],
19
- setup(v, { expose: g, emit: N }) {
18
+ emits: [
19
+ "next",
20
+ "prev",
21
+ "finish"
22
+ ],
23
+ setup(v, { expose: h, emit: N }) {
20
24
  const s = v, p = M(), x = N, n = c(!1), e = c(s.modelValue), V = c(null), b = c(null), L = l(() => n.value ? !1 : s.title || !!p["post-title"]), R = l(() => {
21
25
  let r = [];
22
- for (let k in p)
23
- k.indexOf("step-") !== -1 && r.push(k.substring(5));
26
+ for (let k in p) k.indexOf("step-") !== -1 && r.push(k.substring(5));
24
27
  return r;
25
28
  }), d = l(() => e.value.step ? e.value.step : !e.value.steps || !e.value.steps[0] ? null : e.value.steps[0].name), a = l(() => e.value.steps.findIndex((r) => r.name === d.value)), t = l(() => e.value.steps[a.value]), $ = l(() => 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 = l(() => 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 = l(() => a.value === 0 || !$.value), q = l(() => a.value === e.value.steps.length - 1 || !P.value), w = l(() => typeof t.value.prevHidden == "function" ? t.value.prevHidden(e.value) : typeof t.value.prevHidden == "boolean" ? t.value.prevHidden : a.value === 0), F = l(() => 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 = l(() => typeof t.value.prevConfirm == "string" ? t.value.prevConfirm : ""), I = l(() => typeof t.value.nextConfirm == "string" ? t.value.nextConfirm : ""), O = l(() => typeof t.value.nextResource == "string" ? t.value.nextResource : ""), T = l(() => typeof t.value.nextResourceData == "object" ? t.value.nextResourceData : {}), z = l(() => {
26
29
  const r = ["lkt-step-process"];
@@ -30,7 +33,7 @@ const Z = {
30
33
  }, G = (r) => {
31
34
  e.value.step = e.value.steps[a.value - 1].name, x("prev", r);
32
35
  };
33
- return g({
36
+ return h({
34
37
  goNext: () => {
35
38
  b.value.click();
36
39
  },
@@ -45,16 +48,16 @@ const Z = {
45
48
  class: Q(z.value)
46
49
  }, [
47
50
  L.value ? (u(), o("header", Z, [
48
- f("h1", ee, U(v.title), 1),
51
+ f("h1", ee, W(v.title), 1),
49
52
  f("div", te, [
50
53
  m(r.$slots, "post-title", {
51
54
  config: e.value,
52
55
  loading: n.value
53
56
  })
54
57
  ])
55
- ])) : _("", !0),
58
+ ])) : y("", !0),
56
59
  f("div", re, [
57
- y(H(C, {
60
+ _(H(C, {
58
61
  ref: (i) => V.value = i,
59
62
  palette: "danger",
60
63
  disabled: j.value,
@@ -69,9 +72,9 @@ const Z = {
69
72
  ]),
70
73
  _: 3
71
74
  }, 8, ["disabled", "confirm-modal"]), [
72
- [h, !n.value && !w.value]
75
+ [g, !n.value && !w.value]
73
76
  ]),
74
- y(H(C, {
77
+ _(H(C, {
75
78
  ref: (i) => b.value = i,
76
79
  palette: "success",
77
80
  disabled: q.value,
@@ -88,27 +91,27 @@ const Z = {
88
91
  ]),
89
92
  _: 3
90
93
  }, 8, ["disabled", "confirm-modal", "resource", "resource-data"]), [
91
- [h, !n.value && !F.value]
94
+ [g, !n.value && !F.value]
92
95
  ])
93
96
  ]),
94
- n.value ? _("", !0) : (u(), o("div", ae, [
97
+ n.value ? y("", !0) : (u(), o("div", ae, [
95
98
  f("div", ue, [
96
- (u(!0), o(W, null, X(R.value, (i) => y((u(), o("div", null, [
99
+ (u(!0), o(X, null, Y(R.value, (i) => _((u(), o("div", null, [
97
100
  m(r.$slots, "step-" + i, { config: e.value })
98
101
  ], 512)), [
99
- [h, i === d.value]
102
+ [g, i === d.value]
100
103
  ])), 256))
101
104
  ])
102
105
  ])),
103
- n.value ? (u(), Y(J, { key: 2 })) : _("", !0)
106
+ n.value ? (u(), U(J, { key: 2 })) : y("", !0)
104
107
  ], 2);
105
108
  };
106
109
  }
107
- }), ve = {
108
- install: (v, g = {}) => {
109
- v.component("lkt-step-process", se);
110
+ }), ie = {
111
+ install: (v, h = {}) => {
112
+ v.component("lkt-step-process", oe);
110
113
  }
111
114
  };
112
115
  export {
113
- ve as default
116
+ ie as default
114
117
  };
@@ -1,5 +1,125 @@
1
1
  import { StepProcess } from "../types/StepProcess";
2
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
+ declare const slots: Readonly<{
3
+ [name: string]: import("vue").Slot<any> | undefined;
4
+ }>;
5
+ declare const isLoading: import("vue").Ref<boolean, boolean>, config: import("vue").Ref<Record<string, any>, Record<string, any>>, prevButton: import("vue").Ref<null, null>, nextButton: import("vue").Ref<null, null>;
6
+ declare const displayHeader: import("vue").ComputedRef<string | boolean>;
7
+ declare const slotsSteps: import("vue").ComputedRef<string[]>;
8
+ declare const currentStep: import("vue").ComputedRef<any>, prevDisabled: import("vue").ComputedRef<boolean>, nextDisabled: import("vue").ComputedRef<boolean>, prevHidden: import("vue").ComputedRef<any>, nextHidden: import("vue").ComputedRef<any>, prevConfirm: import("vue").ComputedRef<any>, nextConfirm: import("vue").ComputedRef<any>, nextResource: import("vue").ComputedRef<any>, nextResourceData: import("vue").ComputedRef<any>, classes: import("vue").ComputedRef<string>;
9
+ declare const onNext: (data: any) => void, onPrev: (data: any) => void;
10
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
11
+ declare var __VLS_1: {
12
+ config: Record<string, any>;
13
+ loading: boolean;
14
+ }, __VLS_10: {
15
+ config: Record<string, any>;
16
+ }, __VLS_19: {
17
+ config: Record<string, any>;
18
+ }, __VLS_22: string, __VLS_23: {
19
+ config: Record<string, any>;
20
+ };
21
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
22
+ [K in NonNullable<typeof __VLS_22>]?: (props: typeof __VLS_23) => any;
23
+ } & {
24
+ 'post-title'?: (props: typeof __VLS_1) => any;
25
+ } & {
26
+ 'button-prev'?: (props: typeof __VLS_10) => any;
27
+ } & {
28
+ 'button-next'?: (props: typeof __VLS_19) => any;
29
+ }>;
30
+ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
31
+ modelValue: {
32
+ type: ObjectConstructor;
33
+ required: false;
34
+ default: () => StepProcess;
35
+ };
36
+ title: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ nextText: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ };
44
+ prevText: {
45
+ type: StringConstructor;
46
+ default: string;
47
+ };
48
+ nextValidator: {
49
+ type: FunctionConstructor;
50
+ required: false;
51
+ default: () => boolean;
52
+ };
53
+ prevValidator: {
54
+ type: FunctionConstructor;
55
+ required: false;
56
+ default: () => boolean;
57
+ };
58
+ }>, {
59
+ slots: typeof slots;
60
+ isLoading: typeof isLoading;
61
+ config: typeof config;
62
+ prevButton: typeof prevButton;
63
+ nextButton: typeof nextButton;
64
+ displayHeader: typeof displayHeader;
65
+ slotsSteps: typeof slotsSteps;
66
+ currentStep: typeof currentStep;
67
+ prevDisabled: typeof prevDisabled;
68
+ nextDisabled: typeof nextDisabled;
69
+ prevHidden: typeof prevHidden;
70
+ nextHidden: typeof nextHidden;
71
+ prevConfirm: typeof prevConfirm;
72
+ nextConfirm: typeof nextConfirm;
73
+ nextResource: typeof nextResource;
74
+ nextResourceData: typeof nextResourceData;
75
+ classes: typeof classes;
76
+ onNext: typeof onNext;
77
+ onPrev: typeof onPrev;
78
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
79
+ finish: (...args: any[]) => void;
80
+ next: (...args: any[]) => void;
81
+ prev: (...args: any[]) => void;
82
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
83
+ modelValue: {
84
+ type: ObjectConstructor;
85
+ required: false;
86
+ default: () => StepProcess;
87
+ };
88
+ title: {
89
+ type: StringConstructor;
90
+ default: string;
91
+ };
92
+ nextText: {
93
+ type: StringConstructor;
94
+ default: string;
95
+ };
96
+ prevText: {
97
+ type: StringConstructor;
98
+ default: string;
99
+ };
100
+ nextValidator: {
101
+ type: FunctionConstructor;
102
+ required: false;
103
+ default: () => boolean;
104
+ };
105
+ prevValidator: {
106
+ type: FunctionConstructor;
107
+ required: false;
108
+ default: () => boolean;
109
+ };
110
+ }>> & Readonly<{
111
+ onFinish?: ((...args: any[]) => any) | undefined;
112
+ onNext?: ((...args: any[]) => any) | undefined;
113
+ onPrev?: ((...args: any[]) => any) | undefined;
114
+ }>, {
115
+ title: string;
116
+ modelValue: Record<string, any>;
117
+ nextText: string;
118
+ prevText: string;
119
+ nextValidator: Function;
120
+ prevValidator: Function;
121
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
122
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
123
  modelValue: {
4
124
  type: ObjectConstructor;
5
125
  required: false;
@@ -27,12 +147,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
27
147
  required: false;
28
148
  default: () => boolean;
29
149
  };
30
- }, {
150
+ }>, {
31
151
  goNext: () => void;
32
152
  goPrev: () => void;
33
153
  startLoader: () => boolean;
34
154
  stopLoader: () => boolean;
35
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
155
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
36
156
  finish: (...args: any[]) => void;
37
157
  next: (...args: any[]) => void;
38
158
  prev: (...args: any[]) => void;
@@ -64,33 +184,21 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
64
184
  required: false;
65
185
  default: () => boolean;
66
186
  };
67
- }>> & {
68
- onNext?: ((...args: any[]) => any) | undefined;
187
+ }>> & Readonly<{
69
188
  onFinish?: ((...args: any[]) => any) | undefined;
189
+ onNext?: ((...args: any[]) => any) | undefined;
70
190
  onPrev?: ((...args: any[]) => any) | undefined;
71
- }, {
191
+ }>, {
72
192
  title: string;
73
193
  modelValue: Record<string, any>;
74
194
  nextText: string;
75
195
  prevText: string;
76
196
  nextValidator: Function;
77
197
  prevValidator: Function;
78
- }, {}>, Partial<Record<string, (_: {
79
- config: Record<string, any>;
80
- }) => any>> & {
81
- "post-title"?(_: {
82
- config: Record<string, any>;
83
- loading: boolean;
84
- }): any;
85
- "button-prev"?(_: {
86
- config: Record<string, any>;
87
- }): any;
88
- "button-next"?(_: {
89
- config: Record<string, any>;
90
- }): any;
91
- }>;
198
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
199
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
92
200
  export default _default;
93
- type __VLS_WithTemplateSlots<T, S> = T & {
201
+ type __VLS_WithSlots<T, S> = T & {
94
202
  new (): {
95
203
  $slots: S;
96
204
  };
@@ -1,4 +1,4 @@
1
- import { LktObject } from "lkt-ts-interfaces";
1
+ import { LktObject } from "lkt-vue-kernel";
2
2
  export type Step = {
3
3
  name: string;
4
4
  readResource?: string;
@@ -1,4 +1,4 @@
1
- import { LktObject } from "lkt-ts-interfaces";
1
+ import { LktObject } from "lkt-vue-kernel";
2
2
  import { Step } from "./Step";
3
3
  export type StepProcess = {
4
4
  step: number | string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-step-process",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -8,40 +8,39 @@
8
8
  ".": {
9
9
  "import": "./dist/build.js"
10
10
  },
11
- "./styles": "./dist/style.css"
11
+ "./styles": "./dist/build.css"
12
12
  },
13
13
  "types": "./dist/index.d.ts",
14
14
  "files": ["dist/*", "src/**/*.vue"],
15
15
  "license": "MIT",
16
16
  "sideEffects": false,
17
17
  "scripts": {
18
- "build": "rm -rf dist/*; vue-tsc --declaration --emitDeclarationOnly; vite build; tsc --project tsconfig.build.json; cp build/* dist/"
18
+ "build": "vue-tsc --declaration --emitDeclarationOnly; vite build; tsc --project tsconfig.build.json; cp build/* dist/",
19
+ "rebuild": "rm -rf dist/*; vue-tsc --declaration --emitDeclarationOnly; vite build; tsc --project tsconfig.build.json; cp build/* dist/"
19
20
  },
20
21
  "author": "Antonio Ibáñez",
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
21
25
  "devDependencies": {
22
26
  "@babel/types": "^7.23.6",
23
27
  "@types/node": "^20.11.19",
24
28
  "@types/rollup": "^0.54.0",
25
- "@vitejs/plugin-vue": "^5.0.4",
26
- "rollup": "^4.9.6",
27
- "typescript": "^5.3.3",
28
- "vite": "^5.1.3",
29
+ "@vitejs/plugin-vue": "^5.2.1",
30
+ "rollup": "^4.34.8",
31
+ "typescript": "^5.7.3",
32
+ "vite": "^6.1.1",
29
33
  "vue": "^3.3.0",
30
- "vue-tsc": "^1.8.27"
31
- },
32
- "engines": {
33
- "node": ">=18"
34
+ "vue-tsc": "^2.2.0"
34
35
  },
35
- "dependencies": {
36
- "lkt-button": "^1.0.14",
37
- "lkt-data-state": "^1.0.9",
38
- "lkt-events": "^1.0.2",
39
- "lkt-field-switch": "^1.0.0",
40
- "lkt-http-client": "^1.0.12",
41
- "lkt-http-info": "^1.0.2",
42
- "lkt-loader": "^1.0.2",
43
- "lkt-string-tools": "^1.0.2",
44
- "lkt-ts-interfaces": "^1.0.2",
36
+ "peerDependencies": {
37
+ "lkt-button": "^2.0.7",
38
+ "lkt-data-state": "^1.0.11",
39
+ "lkt-http-client": "^1.0.34",
40
+ "lkt-http-info": "^1.1.1",
41
+ "lkt-loader": "^1.2.0",
42
+ "lkt-string-tools": "^1.0.8",
43
+ "lkt-vue-kernel": "^1.0.33",
45
44
  "path": "^0.12.7",
46
45
  "vue": "^3.3.0"
47
46
  }
@@ -1,7 +1,3 @@
1
- <script lang="ts">
2
- export default {name: "LktStepProcess", inheritAttrs: false}
3
- </script>
4
-
5
1
  <script setup lang="ts">
6
2
  import {ref, useSlots, computed} from "vue";
7
3
  import {StepProcess} from "../types/StepProcess";
@@ -20,7 +16,11 @@ const props = defineProps({
20
16
 
21
17
  const slots = useSlots();
22
18
 
23
- const emit = defineEmits(['next', 'prev', 'finish']);
19
+ const emit = defineEmits([
20
+ 'next',
21
+ 'prev',
22
+ 'finish'
23
+ ]);
24
24
 
25
25
  const isLoading = ref(false),
26
26
  config = ref(props.modelValue),
File without changes