@indielayer/ui 1.8.0 → 1.8.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/docs/pages/component/form/usage.vue +1 -0
- package/docs/pages/component/modal/composed.vue +10 -1
- package/lib/components/checkbox/Checkbox.vue.d.ts +4 -0
- package/lib/components/datepicker/Datepicker.vue.d.ts +4 -0
- package/lib/components/formGroup/FormGroup.vue.d.ts +4 -0
- package/lib/components/input/Input.vue.d.ts +4 -0
- package/lib/components/modal/Modal.vue.js +74 -70
- package/lib/components/radio/Radio.vue.d.ts +4 -0
- package/lib/components/select/Select.vue.d.ts +4 -0
- package/lib/components/select/Select.vue.js +1 -0
- package/lib/components/slider/Slider.vue.d.ts +4 -0
- package/lib/components/textarea/Textarea.vue.d.ts +4 -0
- package/lib/components/toggle/Toggle.vue.d.ts +4 -0
- package/lib/composables/useInputtable.d.ts +1 -0
- package/lib/composables/useInputtable.js +31 -30
- package/lib/index.umd.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/modal/Modal.vue +11 -2
- package/src/components/select/Select.vue +7 -1
- package/src/composables/useInputtable.ts +6 -3
- package/src/version.ts +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ref as a, watch as
|
|
2
|
-
import { injectFormGroupKey as
|
|
3
|
-
const
|
|
4
|
-
const s = a(!0), o = a(r.error),
|
|
5
|
-
|
|
1
|
+
import { ref as a, watch as y, inject as h, computed as j, onMounted as k, onUnmounted as A } from "vue";
|
|
2
|
+
import { injectFormGroupKey as R, injectFormKey as O } from "./keys.js";
|
|
3
|
+
const G = (r, { focus: I, emit: n, withListeners: b = !0 }) => {
|
|
4
|
+
const s = a(!0), o = a(r.error), F = a(r.hideFooter), V = r.name ? r.name : (Math.random() + 1).toString(36).substring(7), i = a(V);
|
|
5
|
+
y(() => r.error, (e) => {
|
|
6
6
|
o.value = e;
|
|
7
|
-
}),
|
|
7
|
+
}), y(() => r.name, (e) => {
|
|
8
8
|
e && (i.value = e);
|
|
9
9
|
});
|
|
10
|
-
const t =
|
|
10
|
+
const t = h(R, {
|
|
11
11
|
registerInputGroup: () => {
|
|
12
12
|
},
|
|
13
13
|
unregisterInputGroup: () => {
|
|
@@ -17,8 +17,8 @@ const y = (r, { focus: I, emit: n, withListeners: b = !0 }) => {
|
|
|
17
17
|
isInsideFormGroup: !1,
|
|
18
18
|
value: void 0
|
|
19
19
|
});
|
|
20
|
-
t.isInsideFormGroup && (
|
|
21
|
-
const
|
|
20
|
+
t.isInsideFormGroup && (F.value = !0);
|
|
21
|
+
const m = h(O, {
|
|
22
22
|
registerInput: () => {
|
|
23
23
|
},
|
|
24
24
|
unregisterInput: () => {
|
|
@@ -26,21 +26,21 @@ const y = (r, { focus: I, emit: n, withListeners: b = !0 }) => {
|
|
|
26
26
|
isInsideForm: !1
|
|
27
27
|
}), S = () => {
|
|
28
28
|
o.value = "", s.value = !0, n("update:modelValue", "");
|
|
29
|
-
},
|
|
29
|
+
}, v = (e) => {
|
|
30
30
|
o.value = e;
|
|
31
|
-
},
|
|
31
|
+
}, c = (e) => {
|
|
32
32
|
e = e || r.modelValue, s.value = !1;
|
|
33
|
-
for (let
|
|
34
|
-
const u = r.rules[
|
|
33
|
+
for (let g = 0; g < r.rules.length; g++) {
|
|
34
|
+
const u = r.rules[g];
|
|
35
35
|
let l = !0;
|
|
36
36
|
if (typeof u == "function")
|
|
37
37
|
l = u(e);
|
|
38
38
|
else if (Array.isArray(u) && u.length === 2) {
|
|
39
|
-
const { 0: d, 1:
|
|
40
|
-
l = d(e,
|
|
39
|
+
const { 0: d, 1: p } = u;
|
|
40
|
+
l = d(e, p);
|
|
41
41
|
} else {
|
|
42
|
-
const d = u.fn, { options:
|
|
43
|
-
l = d(e,
|
|
42
|
+
const d = u.fn, { options: p } = u;
|
|
43
|
+
l = d(e, p);
|
|
44
44
|
}
|
|
45
45
|
if (l !== !0)
|
|
46
46
|
return o.value = l, !1;
|
|
@@ -54,7 +54,7 @@ const y = (r, { focus: I, emit: n, withListeners: b = !0 }) => {
|
|
|
54
54
|
f.value = !1, n("blur", e);
|
|
55
55
|
},
|
|
56
56
|
input: (e) => {
|
|
57
|
-
r.validateOnInput && !s.value &&
|
|
57
|
+
r.validateOnInput && !s.value && c(e.target.value), n("update:modelValue", e.target.value), n("input", e);
|
|
58
58
|
},
|
|
59
59
|
change: (e) => n("change", e)
|
|
60
60
|
})) : {
|
|
@@ -67,26 +67,26 @@ const y = (r, { focus: I, emit: n, withListeners: b = !0 }) => {
|
|
|
67
67
|
change: () => {
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
return
|
|
71
|
-
t.isInsideFormGroup ? t.registerInputGroup(i.value, I) :
|
|
72
|
-
}),
|
|
73
|
-
t.isInsideFormGroup ? t.unregisterInputGroup(i.value) :
|
|
70
|
+
return k(() => {
|
|
71
|
+
t.isInsideFormGroup ? t.registerInputGroup(i.value, I) : r.skipFormRegistry || m.registerInput(i.value, I, c, v);
|
|
72
|
+
}), A(() => {
|
|
73
|
+
t.isInsideFormGroup ? t.unregisterInputGroup(i.value) : r.skipFormRegistry || m.unregisterInput(i.value);
|
|
74
74
|
}), {
|
|
75
75
|
isFirstValidation: s,
|
|
76
76
|
errorInternal: o,
|
|
77
|
-
hideFooterInternal:
|
|
77
|
+
hideFooterInternal: F,
|
|
78
78
|
isFocused: f,
|
|
79
|
-
isInsideForm:
|
|
79
|
+
isInsideForm: r.skipFormRegistry ? !1 : m.isInsideForm,
|
|
80
80
|
isInsideFormGroup: t.isInsideFormGroup,
|
|
81
81
|
inputListeners: B,
|
|
82
82
|
formGroup: t,
|
|
83
83
|
reset: S,
|
|
84
|
-
validate:
|
|
85
|
-
setError:
|
|
84
|
+
validate: c,
|
|
85
|
+
setError: v
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
G.emits = (r = !0) => r ? ["update:modelValue", "blur", "focus", "input", "change"] : ["update:modelValue"];
|
|
89
|
+
G.props = () => ({
|
|
90
90
|
modelValue: {
|
|
91
91
|
type: [String, Number, Boolean, Object, Array],
|
|
92
92
|
default: void 0
|
|
@@ -107,8 +107,9 @@ y.props = () => ({
|
|
|
107
107
|
type: Array,
|
|
108
108
|
default: () => []
|
|
109
109
|
},
|
|
110
|
-
tooltip: String
|
|
110
|
+
tooltip: String,
|
|
111
|
+
skipFormRegistry: Boolean
|
|
111
112
|
});
|
|
112
113
|
export {
|
|
113
|
-
|
|
114
|
+
G as useInputtable
|
|
114
115
|
};
|