@caipira/tamandua 0.0.32 → 0.0.34
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/README.md +12 -4
- package/dist/ChartTreemap.js +2 -2
- package/dist/{ChartTreemap.vue_vue_type_script_setup_true_lang-CG5aK3KH.js → ChartTreemap.vue_vue_type_script_setup_true_lang-DzIPutlk.js} +3 -1
- package/dist/Form.js +2 -2
- package/dist/Form.vue_vue_type_script_setup_true_lang-O6nqLPyU.js +205 -0
- package/dist/InputPassword.js +2 -2
- package/dist/InputPassword.vue_vue_type_script_setup_true_lang-DtP-Tv-2.js +167 -0
- package/dist/ModalForm.js +2 -2
- package/dist/{ModalForm.vue_vue_type_script_setup_true_lang-BSEORivR.js → ModalForm.vue_vue_type_script_setup_true_lang-BpkPebgZ.js} +34 -32
- package/dist/Tag.js +2 -2
- package/dist/{Tag.vue_vue_type_script_setup_true_lang-CgX-nT8V.js → Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js} +16 -19
- package/dist/components.js +5 -5
- package/dist/{crud-lKm5HfM4.js → crud-TcRx_r8S.js} +4 -4
- package/dist/form2.js +1 -1
- package/dist/{plugin-DOiXH9p9.js → plugin-BN2jubTY.js} +1 -1
- package/dist/{plugin-DF8iyfN5.js → plugin-BkoyYU7S.js} +1 -1
- package/dist/{plugin-BibUAa04.js → plugin-D4x3uASg.js} +1 -1
- package/dist/{plugin-D8CsjFdw.js → plugin-DgCa2m12.js} +1 -1
- package/dist/{plugin-C3jERS0X.js → plugin-JFEZqDsu.js} +1 -1
- package/dist/{plugins-ChB184ip.js → plugins-Bc8aBhAD.js} +7 -7
- package/dist/plugins.js +7 -7
- package/dist/tamandua.js +1 -1
- package/dist/types/components/Dropdown/types.d.ts +1 -1
- package/dist/types/components/Form/Form.vue.d.ts +42 -24
- package/dist/types/components/Form/types.d.ts +8 -4
- package/dist/types/components/InputPassword/InputPassword.vue.d.ts +1 -1
- package/dist/types/components/InputPassword/types.d.ts +10 -2
- package/dist/types/components/InputPrice/InputPrice.vue.d.ts +19 -3
- package/dist/types/components/InputPrice/types.d.ts +4 -0
- package/dist/types/components/InputSelect/InputSelect.story.d.ts +1 -1
- package/dist/types/components/InputSelect/InputSelect.vue.d.ts +69 -2
- package/dist/types/components/InputSelect/types.d.ts +33 -2
- package/dist/types/components/ModalForm/ModalForm.vue.d.ts +6 -1
- package/dist/types/components/ModalForm/types.d.ts +6 -4
- package/dist/types/composables/useForm.d.ts +20 -0
- package/dist/types/enums/form.d.ts +3 -3
- package/dist/types/enums/ui.d.ts +10 -10
- package/dist/types/form/crud.d.ts +5 -4
- package/dist/types/form/form-transformer.d.ts +2 -2
- package/dist/types/form/form-transformer.test.d.ts +1 -0
- package/dist/types/form/form-value-transformers.d.ts +2 -1
- package/dist/types/services/password.d.ts +1 -4
- package/dist/types/services/password.test.d.ts +1 -0
- package/dist/types/types/address.d.ts +8 -8
- package/dist/types/types/common.d.ts +1 -0
- package/dist/types/types/form.d.ts +14 -59
- package/package.json +6 -4
- package/dist/Form.vue_vue_type_script_setup_true_lang-CbuLc6sr.js +0 -186
- package/dist/InputPassword.vue_vue_type_script_setup_true_lang-Do7d1Qfe.js +0 -172
- /package/dist/types/components/Form/{Form.spec.d.ts → Form.test.d.ts} +0 -0
- /package/dist/types/{form/form.test.d.ts → composables/useForm.test.d.ts} +0 -0
package/dist/components.js
CHANGED
|
@@ -2,11 +2,11 @@ import { _ as e } from "./Avatar.vue_vue_type_script_setup_true_lang-C8p8_0Uc.js
|
|
|
2
2
|
import { _ as p } from "./Backdrop.vue_vue_type_script_setup_true_lang-OaEBTmYK.js";
|
|
3
3
|
import { B as s } from "./Button-CAiIEdkK.js";
|
|
4
4
|
import { _ as f } from "./ChartLine.vue_vue_type_style_index_0_lang-DO_gKCe4.js";
|
|
5
|
-
import { _ as n } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _ as n } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-DzIPutlk.js";
|
|
6
6
|
import { D as u } from "./Drawer-omdZnBPG.js";
|
|
7
7
|
import { _ as l } from "./Dropdown.vue_vue_type_script_setup_true_lang-pjG__bX2.js";
|
|
8
8
|
import { _ as h } from "./FileDrop.vue_vue_type_script_setup_true_lang-DLEH_LLX.js";
|
|
9
|
-
import { _ as T } from "./Form.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { _ as T } from "./Form.vue_vue_type_script_setup_true_lang-O6nqLPyU.js";
|
|
10
10
|
import { _ as y } from "./FormItem.vue_vue_type_script_setup_true_lang-CjW-P8Xf.js";
|
|
11
11
|
import { _ as C } from "./GraphyEmpty.vue_vue_type_script_setup_true_lang-B-hAjDCw.js";
|
|
12
12
|
import { _ as G } from "./GraphyLabel.vue_vue_type_script_setup_true_lang-n_0200p7.js";
|
|
@@ -19,7 +19,7 @@ import { _ as R } from "./InputCheckbox.vue_vue_type_script_setup_true_lang-Bh8H
|
|
|
19
19
|
import { _ as q } from "./InputColor.vue_vue_type_script_setup_true_lang-DT-MAgI2.js";
|
|
20
20
|
import { _ as H } from "./InputDate.vue_vue_type_script_setup_true_lang-BAgG9zPV.js";
|
|
21
21
|
import { _ as K } from "./InputMultiplier.vue_vue_type_script_setup_true_lang-BJJQTQzF.js";
|
|
22
|
-
import { _ as O } from "./InputPassword.vue_vue_type_script_setup_true_lang-
|
|
22
|
+
import { _ as O } from "./InputPassword.vue_vue_type_script_setup_true_lang-DtP-Tv-2.js";
|
|
23
23
|
import { _ as U } from "./InputPhone.vue_vue_type_script_setup_true_lang-B4TULqLW.js";
|
|
24
24
|
import { _ as W } from "./InputPrice.vue_vue_type_script_setup_true_lang-BX4rsYIr.js";
|
|
25
25
|
import { _ as Y } from "./InputRadio.vue_vue_type_script_setup_true_lang-Cu7lzDAh.js";
|
|
@@ -30,7 +30,7 @@ import { _ as er } from "./InputText.vue_vue_type_script_setup_true_lang-Dyvx9Ob
|
|
|
30
30
|
import { _ as pr } from "./InputTextarea.vue_vue_type_script_setup_true_lang-DRo5eIw4.js";
|
|
31
31
|
import { _ as sr } from "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
|
|
32
32
|
import { _ as fr } from "./Modal.vue_vue_type_script_setup_true_lang-DLl5shGS.js";
|
|
33
|
-
import { _ as nr } from "./ModalForm.vue_vue_type_script_setup_true_lang-
|
|
33
|
+
import { _ as nr } from "./ModalForm.vue_vue_type_script_setup_true_lang-BpkPebgZ.js";
|
|
34
34
|
import { _ as ur } from "./Pagination.vue_vue_type_script_setup_true_lang-PLZQJUd0.js";
|
|
35
35
|
import { _ as lr } from "./Popconfirm.vue_vue_type_script_setup_true_lang-XyjBUx0p.js";
|
|
36
36
|
import { _ as hr } from "./Popover.vue_vue_type_script_setup_true_lang-dnL75W40.js";
|
|
@@ -40,7 +40,7 @@ import { _ as Cr } from "./SensitiveInfo.vue_vue_type_script_setup_true_lang-lCd
|
|
|
40
40
|
import { _ as Gr } from "./Skeleton.vue_vue_type_script_setup_true_lang-BZItfVoN.js";
|
|
41
41
|
import { _ as gr } from "./Tab.vue_vue_type_script_setup_true_lang-VzvYvoqa.js";
|
|
42
42
|
import { T as vr } from "./Table-C0Sr_Lfm.js";
|
|
43
|
-
import { _ as Fr } from "./Tag.vue_vue_type_script_setup_true_lang-
|
|
43
|
+
import { _ as Fr } from "./Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js";
|
|
44
44
|
import { _ as Br } from "./Toast.vue_vue_type_script_setup_true_lang-Dezwl4qF.js";
|
|
45
45
|
export {
|
|
46
46
|
e as Avatar,
|
|
@@ -9,7 +9,7 @@ class h {
|
|
|
9
9
|
EDIT: "Edit "
|
|
10
10
|
};
|
|
11
11
|
isLoading = !1;
|
|
12
|
-
formReference
|
|
12
|
+
formReference;
|
|
13
13
|
constructor(e, s) {
|
|
14
14
|
this.titles.ADD = this.titles.ADD + e, this.titles.EDIT = this.titles.EDIT + e, this.formReference = s;
|
|
15
15
|
}
|
|
@@ -42,14 +42,14 @@ class h {
|
|
|
42
42
|
reset() {
|
|
43
43
|
this.id = "", this.formReference && this.formReference.reset && this.formReference?.reset(), this.isLoading && (this.isLoading = !1);
|
|
44
44
|
}
|
|
45
|
-
save() {
|
|
46
|
-
this.formReference && (this.isLoading = !0, this.formReference.submit());
|
|
45
|
+
async save() {
|
|
46
|
+
this.formReference && (this.isLoading = !0, await this.formReference.submit());
|
|
47
47
|
}
|
|
48
48
|
onSave(e = !0) {
|
|
49
49
|
e && this.close(), this.reset();
|
|
50
50
|
}
|
|
51
51
|
delete() {
|
|
52
|
-
this.formReference && (this.isLoading = !0, this.formReference.
|
|
52
|
+
this.formReference && (this.isLoading = !0, this.formReference.delete());
|
|
53
53
|
}
|
|
54
54
|
onDelete(e = !0) {
|
|
55
55
|
e && this.close(), this.reset();
|
package/dist/form2.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r } from "./register-component-B-fdqewb.js";
|
|
2
|
-
import { _ as s } from "./InputPassword.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as s } from "./InputPassword.vue_vue_type_script_setup_true_lang-DtP-Tv-2.js";
|
|
3
3
|
const m = {
|
|
4
4
|
install(o) {
|
|
5
5
|
r(o, s);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r } from "./register-component-B-fdqewb.js";
|
|
2
|
-
import { _ as s } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as s } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-DzIPutlk.js";
|
|
3
3
|
const m = {
|
|
4
4
|
install(o) {
|
|
5
5
|
r(o, s);
|
|
@@ -7,13 +7,13 @@ import { p as r } from "./plugin-DcWjzc_X.js";
|
|
|
7
7
|
import "./transform-DSaNEFMr.js";
|
|
8
8
|
import "./ChartLine.vue_vue_type_style_index_0_lang-DO_gKCe4.js";
|
|
9
9
|
import { p as o } from "./plugin-DDXOF4cU.js";
|
|
10
|
-
import { p as n } from "./plugin-
|
|
10
|
+
import { p as n } from "./plugin-D4x3uASg.js";
|
|
11
11
|
import "./Drawer-omdZnBPG.js";
|
|
12
12
|
import { p as m } from "./plugin-DRcJuXpS.js";
|
|
13
13
|
import { p as u } from "./plugin-CNqL90UL.js";
|
|
14
14
|
import { p as l } from "./plugin-BscWXR9h.js";
|
|
15
|
-
import "./Form.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { p as t } from "./plugin-
|
|
15
|
+
import "./Form.vue_vue_type_script_setup_true_lang-O6nqLPyU.js";
|
|
16
|
+
import { p as t } from "./plugin-BkoyYU7S.js";
|
|
17
17
|
import { p as g } from "./plugin-DLFPglIt.js";
|
|
18
18
|
import { p as a } from "./plugin-Buc7eEox.js";
|
|
19
19
|
import { p as s } from "./plugin-D9k93Uu1.js";
|
|
@@ -28,7 +28,7 @@ import { p as c } from "./plugin-DLkeyKDM.js";
|
|
|
28
28
|
import { p as h } from "./plugin-D9KHvOM3.js";
|
|
29
29
|
import { p as b } from "./plugin-BtF6kCcf.js";
|
|
30
30
|
import { p as d } from "./plugin-U6NcpOUL.js";
|
|
31
|
-
import { p as y } from "./plugin-
|
|
31
|
+
import { p as y } from "./plugin-BN2jubTY.js";
|
|
32
32
|
import { p as T } from "./plugin-CrHDShgh.js";
|
|
33
33
|
import { p as S } from "./plugin-z8Hr_T_O.js";
|
|
34
34
|
import { p as v } from "./plugin-Bog7k3Qf.js";
|
|
@@ -40,7 +40,7 @@ import { p as w } from "./plugin-BQFwx3d5.js";
|
|
|
40
40
|
import "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
|
|
41
41
|
import { p as x } from "./plugin-dL6oP11N.js";
|
|
42
42
|
import { p as D } from "./plugin-BZC231Oj.js";
|
|
43
|
-
import { p as F } from "./plugin-
|
|
43
|
+
import { p as F } from "./plugin-JFEZqDsu.js";
|
|
44
44
|
import { p as L } from "./plugin-YUomn9tF.js";
|
|
45
45
|
import "./Popconfirm.vue_vue_type_script_setup_true_lang-XyjBUx0p.js";
|
|
46
46
|
import { p as M } from "./plugin-Ee4Z5Rtp.js";
|
|
@@ -55,8 +55,8 @@ import { p as z } from "./plugin-B9wG8DUw.js";
|
|
|
55
55
|
import { p as E } from "./plugin-5vn4G57V.js";
|
|
56
56
|
import "./Table-C0Sr_Lfm.js";
|
|
57
57
|
import { p as O } from "./plugin-CTMcmMdr.js";
|
|
58
|
-
import "./Tag.vue_vue_type_script_setup_true_lang-
|
|
59
|
-
import { p as q } from "./plugin-
|
|
58
|
+
import "./Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js";
|
|
59
|
+
import { p as q } from "./plugin-DgCa2m12.js";
|
|
60
60
|
import { p as R } from "./plugin-Dn96hI0e.js";
|
|
61
61
|
const Vp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
62
62
|
__proto__: null,
|
package/dist/plugins.js
CHANGED
|
@@ -7,13 +7,13 @@ import { p as C } from "./plugin-DcWjzc_X.js";
|
|
|
7
7
|
import "./transform-DSaNEFMr.js";
|
|
8
8
|
import "./ChartLine.vue_vue_type_style_index_0_lang-DO_gKCe4.js";
|
|
9
9
|
import { p as S } from "./plugin-DDXOF4cU.js";
|
|
10
|
-
import { p as v } from "./plugin-
|
|
10
|
+
import { p as v } from "./plugin-D4x3uASg.js";
|
|
11
11
|
import "./Drawer-omdZnBPG.js";
|
|
12
12
|
import { p as D } from "./plugin-DRcJuXpS.js";
|
|
13
13
|
import { p as L } from "./plugin-CNqL90UL.js";
|
|
14
14
|
import { p as A } from "./plugin-BscWXR9h.js";
|
|
15
|
-
import "./Form.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { p as E } from "./plugin-
|
|
15
|
+
import "./Form.vue_vue_type_script_setup_true_lang-O6nqLPyU.js";
|
|
16
|
+
import { p as E } from "./plugin-BkoyYU7S.js";
|
|
17
17
|
import { p as j } from "./plugin-DLFPglIt.js";
|
|
18
18
|
import { p as z } from "./plugin-Buc7eEox.js";
|
|
19
19
|
import { p as J } from "./plugin-D9k93Uu1.js";
|
|
@@ -28,7 +28,7 @@ import { p as $ } from "./plugin-DLkeyKDM.js";
|
|
|
28
28
|
import { p as or } from "./plugin-D9KHvOM3.js";
|
|
29
29
|
import { p as tr } from "./plugin-BtF6kCcf.js";
|
|
30
30
|
import { p as er } from "./plugin-U6NcpOUL.js";
|
|
31
|
-
import { p as nr } from "./plugin-
|
|
31
|
+
import { p as nr } from "./plugin-BN2jubTY.js";
|
|
32
32
|
import { p as ur } from "./plugin-CrHDShgh.js";
|
|
33
33
|
import { p as Pr } from "./plugin-z8Hr_T_O.js";
|
|
34
34
|
import { p as gr } from "./plugin-Bog7k3Qf.js";
|
|
@@ -40,7 +40,7 @@ import { p as yr } from "./plugin-BQFwx3d5.js";
|
|
|
40
40
|
import "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
|
|
41
41
|
import { p as Cr } from "./plugin-dL6oP11N.js";
|
|
42
42
|
import { p as Sr } from "./plugin-BZC231Oj.js";
|
|
43
|
-
import { p as vr } from "./plugin-
|
|
43
|
+
import { p as vr } from "./plugin-JFEZqDsu.js";
|
|
44
44
|
import { p as Dr } from "./plugin-YUomn9tF.js";
|
|
45
45
|
import "./Popconfirm.vue_vue_type_script_setup_true_lang-XyjBUx0p.js";
|
|
46
46
|
import { p as Lr } from "./plugin-Ee4Z5Rtp.js";
|
|
@@ -55,8 +55,8 @@ import { p as Jr } from "./plugin-B9wG8DUw.js";
|
|
|
55
55
|
import { p as Nr } from "./plugin-5vn4G57V.js";
|
|
56
56
|
import "./Table-C0Sr_Lfm.js";
|
|
57
57
|
import { p as Qr } from "./plugin-CTMcmMdr.js";
|
|
58
|
-
import "./Tag.vue_vue_type_script_setup_true_lang-
|
|
59
|
-
import { p as Vr } from "./plugin-
|
|
58
|
+
import "./Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js";
|
|
59
|
+
import { p as Vr } from "./plugin-DgCa2m12.js";
|
|
60
60
|
import { p as Xr } from "./plugin-Dn96hI0e.js";
|
|
61
61
|
export {
|
|
62
62
|
T as AvatarPlugin,
|
package/dist/tamandua.js
CHANGED
|
@@ -4,10 +4,13 @@ import { FormSchema, FormInstance } from '../../types/form.js';
|
|
|
4
4
|
import { FormEvents } from './types.js';
|
|
5
5
|
|
|
6
6
|
declare const _default: <T extends FormSchema>(__VLS_props: {
|
|
7
|
-
id?: string | undefined;
|
|
7
|
+
id?: string | number | undefined;
|
|
8
8
|
idKey?: string | undefined;
|
|
9
9
|
schema?: T | undefined;
|
|
10
|
-
formStyle?:
|
|
10
|
+
formStyle?: {
|
|
11
|
+
input?: string | undefined;
|
|
12
|
+
label?: string | undefined;
|
|
13
|
+
} | undefined;
|
|
11
14
|
showSubmit?: boolean | undefined;
|
|
12
15
|
submitLabel?: string | undefined;
|
|
13
16
|
buttonProps?: import('../index.js').ButtonProps | undefined;
|
|
@@ -18,23 +21,29 @@ declare const _default: <T extends FormSchema>(__VLS_props: {
|
|
|
18
21
|
attrs: any;
|
|
19
22
|
slots: {
|
|
20
23
|
default?(_: {
|
|
21
|
-
form: import('@vue/reactivity').DistrubuteRef<import("vue").UnwrapNestedRefs<FormInstance<T>>>;
|
|
24
|
+
form: import('@vue/reactivity').DistrubuteRef<import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>>;
|
|
22
25
|
}): any;
|
|
23
26
|
};
|
|
24
27
|
emit: FormEvents;
|
|
25
28
|
} | undefined, __VLS_expose?: ((exposed: import('vue').ShallowUnwrapRef<{
|
|
26
|
-
submit: () => Promise<
|
|
29
|
+
submit: () => Promise<{
|
|
30
|
+
isValid: boolean;
|
|
31
|
+
form: FormData | import("@/types/form.js").JSONForm;
|
|
32
|
+
}>;
|
|
27
33
|
reset: () => void;
|
|
28
|
-
setValues: (values: Partial<FormInstance<T>>) => void;
|
|
29
|
-
|
|
30
|
-
setValue: <K extends keyof T
|
|
31
|
-
getValue: (key:
|
|
34
|
+
setValues: (values: Partial<FormInstance<T extends undefined ? never : T>>) => void;
|
|
35
|
+
form: import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>;
|
|
36
|
+
setValue: <K extends keyof import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>>(key: K, value: import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>[K]) => void;
|
|
37
|
+
getValue: (key: keyof import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>) => import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>[keyof import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>];
|
|
32
38
|
}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
33
39
|
props: {
|
|
34
|
-
id?: string | undefined;
|
|
40
|
+
id?: string | number | undefined;
|
|
35
41
|
idKey?: string | undefined;
|
|
36
42
|
schema?: T | undefined;
|
|
37
|
-
formStyle?:
|
|
43
|
+
formStyle?: {
|
|
44
|
+
input?: string | undefined;
|
|
45
|
+
label?: string | undefined;
|
|
46
|
+
} | undefined;
|
|
38
47
|
showSubmit?: boolean | undefined;
|
|
39
48
|
submitLabel?: string | undefined;
|
|
40
49
|
buttonProps?: import('../index.js').ButtonProps | undefined;
|
|
@@ -43,17 +52,20 @@ declare const _default: <T extends FormSchema>(__VLS_props: {
|
|
|
43
52
|
buttonWrapperClasses?: string | undefined;
|
|
44
53
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
45
54
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
46
|
-
submit: () => Promise<
|
|
55
|
+
submit: () => Promise<{
|
|
56
|
+
isValid: boolean;
|
|
57
|
+
form: FormData | import("@/types/form.js").JSONForm;
|
|
58
|
+
}>;
|
|
47
59
|
reset: () => void;
|
|
48
|
-
setValues: (values: Partial<FormInstance<T>>) => void;
|
|
49
|
-
|
|
50
|
-
setValue: <K extends keyof T
|
|
51
|
-
getValue: (key:
|
|
60
|
+
setValues: (values: Partial<FormInstance<T extends undefined ? never : T>>) => void;
|
|
61
|
+
form: import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>;
|
|
62
|
+
setValue: <K extends keyof import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>>(key: K, value: import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>[K]) => void;
|
|
63
|
+
getValue: (key: keyof import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>) => import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>[keyof import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>];
|
|
52
64
|
}>): void;
|
|
53
65
|
attrs: any;
|
|
54
66
|
slots: {
|
|
55
67
|
default?(_: {
|
|
56
|
-
form: import('@vue/reactivity').DistrubuteRef<import("vue").UnwrapNestedRefs<FormInstance<T>>>;
|
|
68
|
+
form: import('@vue/reactivity').DistrubuteRef<import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>>;
|
|
57
69
|
}): any;
|
|
58
70
|
};
|
|
59
71
|
emit: FormEvents;
|
|
@@ -62,10 +74,13 @@ declare const _default: <T extends FormSchema>(__VLS_props: {
|
|
|
62
74
|
}> & {
|
|
63
75
|
__ctx?: {
|
|
64
76
|
props: {
|
|
65
|
-
id?: string | undefined;
|
|
77
|
+
id?: string | number | undefined;
|
|
66
78
|
idKey?: string | undefined;
|
|
67
79
|
schema?: T | undefined;
|
|
68
|
-
formStyle?:
|
|
80
|
+
formStyle?: {
|
|
81
|
+
input?: string | undefined;
|
|
82
|
+
label?: string | undefined;
|
|
83
|
+
} | undefined;
|
|
69
84
|
showSubmit?: boolean | undefined;
|
|
70
85
|
submitLabel?: string | undefined;
|
|
71
86
|
buttonProps?: import('../index.js').ButtonProps | undefined;
|
|
@@ -74,17 +89,20 @@ declare const _default: <T extends FormSchema>(__VLS_props: {
|
|
|
74
89
|
buttonWrapperClasses?: string | undefined;
|
|
75
90
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
76
91
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
77
|
-
submit: () => Promise<
|
|
92
|
+
submit: () => Promise<{
|
|
93
|
+
isValid: boolean;
|
|
94
|
+
form: FormData | import("@/types/form.js").JSONForm;
|
|
95
|
+
}>;
|
|
78
96
|
reset: () => void;
|
|
79
|
-
setValues: (values: Partial<FormInstance<T>>) => void;
|
|
80
|
-
|
|
81
|
-
setValue: <K extends keyof T
|
|
82
|
-
getValue: (key:
|
|
97
|
+
setValues: (values: Partial<FormInstance<T extends undefined ? never : T>>) => void;
|
|
98
|
+
form: import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>;
|
|
99
|
+
setValue: <K extends keyof import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>>(key: K, value: import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>[K]) => void;
|
|
100
|
+
getValue: (key: keyof import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>) => import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>[keyof import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>];
|
|
83
101
|
}>): void;
|
|
84
102
|
attrs: any;
|
|
85
103
|
slots: {
|
|
86
104
|
default?(_: {
|
|
87
|
-
form: import('@vue/reactivity').DistrubuteRef<import("vue").UnwrapNestedRefs<FormInstance<T>>>;
|
|
105
|
+
form: import('@vue/reactivity').DistrubuteRef<import("vue").UnwrapNestedRefs<FormInstance<T extends undefined ? never : T>>>;
|
|
88
106
|
}): any;
|
|
89
107
|
};
|
|
90
108
|
emit: FormEvents;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { FormSubmissionFormat } from '../../enums/form.js';
|
|
2
2
|
import { ButtonVariant } from '../../enums/ui.js';
|
|
3
|
-
import { FormSchema, FormStyle, FormInstance, ValidationResult } from '../../types/form.js';
|
|
4
3
|
import { ButtonProps } from '../Button/types.js';
|
|
4
|
+
import { FormSchema, FormInstance, ValidationResult } from '../../types/form.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type FormStyle = {
|
|
7
|
+
[key in "label" | "input"]?: string;
|
|
8
|
+
};
|
|
9
|
+
export type FormProps<T extends FormSchema> = {
|
|
10
|
+
id?: string | number;
|
|
8
11
|
idKey?: string;
|
|
9
12
|
schema?: T;
|
|
10
13
|
formStyle?: FormStyle;
|
|
@@ -16,6 +19,7 @@ export type FormProps<T> = {
|
|
|
16
19
|
buttonWrapperClasses?: string;
|
|
17
20
|
};
|
|
18
21
|
export type FormEvents = {
|
|
19
|
-
(e: "submit", val: ValidationResult<
|
|
22
|
+
<T extends FormSubmissionFormat>(e: "submit", val: ValidationResult<T>): void;
|
|
20
23
|
<T extends FormSchema>(e: "change", val: FormInstance<T>): void;
|
|
21
24
|
};
|
|
25
|
+
export {};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export type InputPasswordModel = {
|
|
2
|
+
/** Unencrypted password */
|
|
3
|
+
raw: string;
|
|
4
|
+
/** If an encryptor was passed, this prop will hold the encrypted value */
|
|
5
|
+
hash?: string;
|
|
6
|
+
/** Strength of the password */
|
|
7
|
+
strength?: number;
|
|
8
|
+
/** Date of creation or last update */
|
|
9
|
+
updatedAt?: Date;
|
|
10
|
+
};
|
|
3
11
|
export type InputPasswordProps = {
|
|
4
12
|
autocomplete?: string;
|
|
5
13
|
encryptor?: (value: string) => Promise<string>;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { InputPriceModel } from './types.js';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<{
|
|
4
|
+
modelValue: import("vue").PropType<InputPriceModel>;
|
|
5
|
+
resource: {
|
|
6
|
+
type: import("vue").PropType<() => any>;
|
|
7
|
+
};
|
|
8
|
+
disabled: {
|
|
9
|
+
type: import("vue").PropType<boolean>;
|
|
10
|
+
};
|
|
11
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
modelValue: import("vue").PropType<InputPriceModel>;
|
|
13
|
+
resource: {
|
|
14
|
+
type: import("vue").PropType<() => any>;
|
|
15
|
+
};
|
|
16
|
+
disabled: {
|
|
17
|
+
type: import("vue").PropType<boolean>;
|
|
18
|
+
};
|
|
19
|
+
}>>, {}, {}>;
|
|
4
20
|
export default _default;
|
|
@@ -1,10 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ElementSize, ElementPosition } from '../../enums/ui.js';
|
|
2
|
+
import { SelectOption, InputSelectProps } from './types.js';
|
|
3
|
+
|
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputSelectProps>, {
|
|
5
|
+
size: ElementSize;
|
|
6
|
+
options: () => never[];
|
|
7
|
+
mapper: (i: any) => SelectOption;
|
|
8
|
+
filter: (input: string, option: SelectOption) => boolean;
|
|
9
|
+
tooltip: string;
|
|
10
|
+
multiple: boolean;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
isSearchable: boolean;
|
|
13
|
+
dropdownPlacement: ElementPosition;
|
|
14
|
+
/**
|
|
15
|
+
* CSS Classes
|
|
16
|
+
*/
|
|
17
|
+
widthClass: string;
|
|
18
|
+
borderClass: string;
|
|
19
|
+
roundnessClass: string;
|
|
20
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
"update:model-value": (val: any) => void;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputSelectProps>, {
|
|
23
|
+
size: ElementSize;
|
|
24
|
+
options: () => never[];
|
|
25
|
+
mapper: (i: any) => SelectOption;
|
|
26
|
+
filter: (input: string, option: SelectOption) => boolean;
|
|
27
|
+
tooltip: string;
|
|
28
|
+
multiple: boolean;
|
|
29
|
+
placeholder: string;
|
|
30
|
+
isSearchable: boolean;
|
|
31
|
+
dropdownPlacement: ElementPosition;
|
|
32
|
+
/**
|
|
33
|
+
* CSS Classes
|
|
34
|
+
*/
|
|
35
|
+
widthClass: string;
|
|
36
|
+
borderClass: string;
|
|
37
|
+
roundnessClass: string;
|
|
38
|
+
}>>> & {
|
|
39
|
+
"onUpdate:model-value"?: ((val: any) => any) | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
filter: (input: string, option: SelectOption) => boolean;
|
|
42
|
+
size: ElementSize;
|
|
43
|
+
multiple: boolean;
|
|
44
|
+
options: SelectOption[];
|
|
45
|
+
placeholder: string;
|
|
46
|
+
mapper: (i: any) => SelectOption;
|
|
47
|
+
tooltip: string;
|
|
48
|
+
isSearchable: boolean;
|
|
49
|
+
dropdownPlacement: "top-start" | "top" | "top-end" | "right-start" | "right" | "right-end" | "bottom-end" | "bottom" | "bottom-start" | "left-end" | "left" | "left-start";
|
|
50
|
+
widthClass: string;
|
|
51
|
+
borderClass: string;
|
|
52
|
+
roundnessClass: string;
|
|
3
53
|
}, {}>, {
|
|
4
54
|
selection?(_: {}): any;
|
|
5
55
|
default?(_: any): any;
|
|
6
56
|
}>;
|
|
7
57
|
export default _default;
|
|
58
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
59
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
60
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
61
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
62
|
+
} : {
|
|
63
|
+
type: import('vue').PropType<T[K]>;
|
|
64
|
+
required: true;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
type __VLS_WithDefaults<P, D> = {
|
|
68
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
69
|
+
default: D[K];
|
|
70
|
+
}> : P[K];
|
|
71
|
+
};
|
|
72
|
+
type __VLS_Prettify<T> = {
|
|
73
|
+
[K in keyof T]: T[K];
|
|
74
|
+
} & {};
|
|
8
75
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
9
76
|
new (): {
|
|
10
77
|
$slots: S;
|
|
@@ -1,8 +1,39 @@
|
|
|
1
|
-
import { ElementSize, ElementPosition } from '../../enums/ui.js';
|
|
2
|
-
import { SelectValue, SelectOption } from '../../types/form.js';
|
|
1
|
+
import { Icon, ElementSize, ElementPosition } from '../../enums/ui.js';
|
|
3
2
|
import { APISearchFilters } from '../../types/api.js';
|
|
4
3
|
import { Pagination } from '../../types/ui.js';
|
|
5
4
|
|
|
5
|
+
export type SelectValuePrimitives = string | number;
|
|
6
|
+
export type SelectValue = SelectValuePrimitives | Array<SelectValuePrimitives>;
|
|
7
|
+
export type SelectOption = {
|
|
8
|
+
/** Optional icon, to be appended to the label */
|
|
9
|
+
icon?: `${Icon}`;
|
|
10
|
+
/** Option label, either a string or an object containing the props necessary to render the option */
|
|
11
|
+
label: string | object;
|
|
12
|
+
/** Optional type, used to diferentiate options from one another */
|
|
13
|
+
type?: string;
|
|
14
|
+
/** Optional renderer, containing the fully resolved path to the component that will be used
|
|
15
|
+
* to render the option
|
|
16
|
+
*/
|
|
17
|
+
renderer?: string;
|
|
18
|
+
} & ({
|
|
19
|
+
/** If true, the option is a group label and can't be selected */
|
|
20
|
+
isGroupLabel: boolean;
|
|
21
|
+
value?: never;
|
|
22
|
+
action?: never;
|
|
23
|
+
} | {
|
|
24
|
+
/** Option value */
|
|
25
|
+
value: SelectValue;
|
|
26
|
+
action?: never;
|
|
27
|
+
isGroupLabel?: never;
|
|
28
|
+
} | {
|
|
29
|
+
/** Action to be executed once the option is selected */
|
|
30
|
+
action: (filters?: APISearchFilters) => Promise<{
|
|
31
|
+
items: unknown[];
|
|
32
|
+
pagination: Pagination;
|
|
33
|
+
}> | Promise<void> | void;
|
|
34
|
+
value?: never;
|
|
35
|
+
isGroupLabel?: never;
|
|
36
|
+
});
|
|
6
37
|
export type InputSelectProps = {
|
|
7
38
|
size?: ElementSize;
|
|
8
39
|
options?: SelectOption[];
|
|
@@ -6,6 +6,11 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
6
6
|
}>, {
|
|
7
7
|
open: (key: string, id?: string | undefined) => void;
|
|
8
8
|
delete: () => void;
|
|
9
|
+
submit: () => Promise<{
|
|
10
|
+
isValid: boolean;
|
|
11
|
+
form: FormData | import("../../index.js").JSONForm;
|
|
12
|
+
} | undefined>;
|
|
13
|
+
reset: () => void;
|
|
9
14
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
15
|
saved: () => void;
|
|
11
16
|
closed: () => void;
|
|
@@ -16,7 +21,7 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
16
21
|
onClosed?: (() => any) | undefined;
|
|
17
22
|
onSaved?: (() => any) | undefined;
|
|
18
23
|
}, {
|
|
19
|
-
options: import("
|
|
24
|
+
options: import("../InputSelect/types.js").SelectOption[];
|
|
20
25
|
formClass: string;
|
|
21
26
|
}, {}>;
|
|
22
27
|
export default _default;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentExposed } from 'vue-component-type-helpers';
|
|
2
|
+
import { SelectOption } from '../InputSelect/types.js';
|
|
3
|
+
import { default as Form } from '../Form/Form.vue';
|
|
2
4
|
|
|
3
|
-
export type
|
|
5
|
+
export type FormItem = {
|
|
4
6
|
key: string;
|
|
5
7
|
title: string;
|
|
6
|
-
component:
|
|
8
|
+
component: ComponentExposed<typeof Form>;
|
|
7
9
|
pinnable?: boolean;
|
|
8
10
|
};
|
|
9
11
|
export type ModalFormProps = {
|
|
10
|
-
forms:
|
|
12
|
+
forms: FormItem[];
|
|
11
13
|
options?: SelectOption[];
|
|
12
14
|
formClass?: string;
|
|
13
15
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FormSubmissionFormat } from '../enums/form.js';
|
|
2
|
+
import { FormSchema, FormInstance } from '../types/form.js';
|
|
3
|
+
import { Ref, UnwrapNestedRefs } from 'vue';
|
|
4
|
+
|
|
5
|
+
export default function useForm<TSchema extends FormSchema = FormSchema>(options: {
|
|
6
|
+
id?: Ref<string | number>;
|
|
7
|
+
idKey?: string;
|
|
8
|
+
schema: TSchema;
|
|
9
|
+
format?: FormSubmissionFormat;
|
|
10
|
+
}): {
|
|
11
|
+
form: UnwrapNestedRefs<FormInstance<TSchema>>;
|
|
12
|
+
setValue: <K extends keyof UnwrapNestedRefs<FormInstance<TSchema>>>(key: K, value: UnwrapNestedRefs<FormInstance<TSchema>>[K]) => void;
|
|
13
|
+
setValues: (values: Partial<FormInstance<TSchema>>) => void;
|
|
14
|
+
getValue: (key: keyof UnwrapNestedRefs<FormInstance<TSchema>>) => UnwrapNestedRefs<FormInstance<TSchema>>[keyof UnwrapNestedRefs<FormInstance<TSchema>>];
|
|
15
|
+
reset: () => void;
|
|
16
|
+
submit: () => Promise<{
|
|
17
|
+
isValid: boolean;
|
|
18
|
+
form: FormData | import('../types/form.js').JSONForm;
|
|
19
|
+
}>;
|
|
20
|
+
};
|