@caipira/tamandua 0.0.33 → 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.
Files changed (35) hide show
  1. package/dist/Form.js +2 -2
  2. package/dist/Form.vue_vue_type_script_setup_true_lang-O6nqLPyU.js +205 -0
  3. package/dist/ModalForm.js +2 -2
  4. package/dist/{ModalForm.vue_vue_type_script_setup_true_lang-BSEORivR.js → ModalForm.vue_vue_type_script_setup_true_lang-BpkPebgZ.js} +34 -32
  5. package/dist/components.js +2 -2
  6. package/dist/{crud-lKm5HfM4.js → crud-TcRx_r8S.js} +4 -4
  7. package/dist/form2.js +1 -1
  8. package/dist/{plugin-DF8iyfN5.js → plugin-BkoyYU7S.js} +1 -1
  9. package/dist/{plugin-C3jERS0X.js → plugin-JFEZqDsu.js} +1 -1
  10. package/dist/{plugins-BA8tojIo.js → plugins-Bc8aBhAD.js} +3 -3
  11. package/dist/plugins.js +3 -3
  12. package/dist/tamandua.js +1 -1
  13. package/dist/types/components/Dropdown/types.d.ts +1 -1
  14. package/dist/types/components/Form/Form.vue.d.ts +42 -24
  15. package/dist/types/components/Form/types.d.ts +8 -4
  16. package/dist/types/components/InputPassword/InputPassword.vue.d.ts +1 -1
  17. package/dist/types/components/InputPassword/types.d.ts +10 -2
  18. package/dist/types/components/InputPrice/InputPrice.vue.d.ts +19 -3
  19. package/dist/types/components/InputPrice/types.d.ts +4 -0
  20. package/dist/types/components/InputSelect/InputSelect.story.d.ts +1 -1
  21. package/dist/types/components/InputSelect/InputSelect.vue.d.ts +69 -2
  22. package/dist/types/components/InputSelect/types.d.ts +33 -2
  23. package/dist/types/components/ModalForm/ModalForm.vue.d.ts +6 -1
  24. package/dist/types/components/ModalForm/types.d.ts +6 -4
  25. package/dist/types/composables/useForm.d.ts +20 -0
  26. package/dist/types/form/crud.d.ts +5 -4
  27. package/dist/types/form/form-transformer.d.ts +2 -2
  28. package/dist/types/form/form-transformer.test.d.ts +1 -0
  29. package/dist/types/form/form-value-transformers.d.ts +2 -1
  30. package/dist/types/types/address.d.ts +8 -8
  31. package/dist/types/types/common.d.ts +1 -0
  32. package/dist/types/types/form.d.ts +14 -59
  33. package/package.json +7 -4
  34. package/dist/Form.vue_vue_type_script_setup_true_lang-CbuLc6sr.js +0 -186
  35. /package/dist/types/{form/form.test.d.ts → composables/useForm.test.d.ts} +0 -0
package/dist/Form.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as m } from "./Form.vue_vue_type_script_setup_true_lang-CbuLc6sr.js";
2
- import { p as a } from "./plugin-DF8iyfN5.js";
1
+ import { _ as m } from "./Form.vue_vue_type_script_setup_true_lang-O6nqLPyU.js";
2
+ import { p as a } from "./plugin-BkoyYU7S.js";
3
3
  export {
4
4
  m as Form,
5
5
  a as FormPlugin
@@ -0,0 +1,205 @@
1
+ import { reactive as C, defineComponent as A, ref as y, watch as P, provide as _, resolveComponent as T, openBlock as N, createElementBlock as O, renderSlot as B, unref as J, createElementVNode as E, normalizeClass as R, withDirectives as W, createVNode as j, mergeProps as K, vShow as M } from "vue";
2
+ import { B as z } from "./ui-BC6H9E93.js";
3
+ import { F as s, a as p } from "./form-BkXpIJ0e.js";
4
+ import { f as L } from "./index-CjvqeRf7.js";
5
+ const w = (t) => t ? L(t, "yyyy-MM-dd") : "", F = (t) => [`${t?.iso}`, `${t?.value}`], h = (t) => t?.iso2 ?? "", S = async (t) => t?.hash ? t.hash : t?.raw ?? "", i = {
6
+ default: (t, e, r) => (e[r] = t, e),
7
+ price: (t, e, r, n = ["Currency", "Value"]) => {
8
+ const [u, a] = F(t);
9
+ return e[`${r}${n[0]}`] = u, e[`${r}${n[1]}`] = a, e;
10
+ },
11
+ password: async (t, e, r) => (e[r] = await S(t), e),
12
+ stringArray: (t, e, r) => (e[r] = t, e)
13
+ }, I = async (t, e, r, n) => {
14
+ switch (t) {
15
+ case s.Country:
16
+ return i.default(
17
+ h(r),
18
+ e,
19
+ n
20
+ );
21
+ case s.Documents:
22
+ return i.default(r, e, n);
23
+ case s.Date:
24
+ return i.default(
25
+ w(r),
26
+ e,
27
+ n
28
+ );
29
+ case s.Address:
30
+ return i.default(r, e, n);
31
+ case s.Price:
32
+ return i.price(r, e, n);
33
+ case s.Password:
34
+ return await i.password(r, e, n);
35
+ case s.StringArray:
36
+ return i.stringArray(r, e, n);
37
+ default:
38
+ return i.default(r, e, n);
39
+ }
40
+ }, f = (t) => (t == null ? t = "" : typeof t == "object" ? t = JSON.stringify(t) : typeof t == "number" ? t = t.toString() : typeof t == "boolean" && (t = t ? "1" : "0"), t), c = {
41
+ default: (t, e, r) => {
42
+ const n = f(t);
43
+ return t && e.append(r, n), e;
44
+ },
45
+ price: (t, e, r, n = ["Currency", "Value"]) => {
46
+ const [u, a] = F(t);
47
+ return e.append(`${r}${n[0]}`, f(u)), e.append(`${r}${n[1]}`, f(a)), e;
48
+ },
49
+ address: (t, e, r) => (e.append(
50
+ r,
51
+ JSON.stringify({
52
+ ...t,
53
+ country: h(t?.country)
54
+ })
55
+ ), e),
56
+ documents: (t, e, r) => (r.endsWith("[]") || (r = `${r}[]`), Array.from(t).forEach((n) => e.append(r, n)), e),
57
+ document: (t, e, r) => (e.append(r, t), e),
58
+ stringArray: (t, e, r) => (r.endsWith("[]") || (r = `${r}[]`), t.forEach((n) => e.append(r, f(n))), e)
59
+ }, Y = async (t, e, r, n) => {
60
+ switch (t) {
61
+ case s.Country:
62
+ return c.default(
63
+ h(r),
64
+ e,
65
+ n
66
+ );
67
+ case s.Document:
68
+ return c.document(r, e, n);
69
+ case s.Documents:
70
+ return c.documents(r, e, n);
71
+ case s.Date:
72
+ return c.default(
73
+ w(r),
74
+ e,
75
+ n
76
+ );
77
+ case s.Address:
78
+ return c.address(r, e, n);
79
+ case s.Price:
80
+ return c.price(r, e, n);
81
+ case s.Password:
82
+ return c.default(
83
+ await S(r),
84
+ e,
85
+ n
86
+ );
87
+ case s.StringArray:
88
+ return c.stringArray(r, e, n);
89
+ default:
90
+ return c.default(r, e, n);
91
+ }
92
+ }, q = async (t, e, r) => {
93
+ switch (r) {
94
+ case p.JSON:
95
+ let n = {};
96
+ for (const a in t)
97
+ n = await I(
98
+ e[a],
99
+ n,
100
+ t[a],
101
+ a
102
+ );
103
+ return n;
104
+ case p.FormData:
105
+ default:
106
+ let u = new FormData();
107
+ for (const a in t)
108
+ u = await Y(
109
+ e[a],
110
+ u,
111
+ t[a],
112
+ a
113
+ );
114
+ return u;
115
+ }
116
+ };
117
+ function x(t) {
118
+ const e = C(
119
+ {}
120
+ );
121
+ return { form: e, setValue: (o, d) => {
122
+ e[o] = d;
123
+ }, setValues: (o) => {
124
+ for (const [d, b] of Object.entries(o))
125
+ e[d] = b;
126
+ }, getValue: (o) => e[o], reset: () => {
127
+ for (const o in e)
128
+ delete e[o];
129
+ }, submit: async () => {
130
+ const o = {
131
+ ...e
132
+ };
133
+ return t?.id?.value && (o.id = t.id.value), {
134
+ isValid: !0,
135
+ form: await q(
136
+ o,
137
+ t.schema,
138
+ t.format ?? p.JSON
139
+ )
140
+ };
141
+ } };
142
+ }
143
+ const Z = /* @__PURE__ */ A({
144
+ name: "TForm",
145
+ __name: "Form",
146
+ props: {
147
+ id: { default: "" },
148
+ idKey: { default: "id" },
149
+ schema: { default: () => ({}) },
150
+ formStyle: { default: () => ({}) },
151
+ showSubmit: { type: Boolean, default: !1 },
152
+ submitLabel: { default: "Submit" },
153
+ buttonProps: {},
154
+ buttonVariant: { default: z.PRIMARY },
155
+ submissionFormat: { default: p.FormData },
156
+ buttonWrapperClasses: { default: "" }
157
+ },
158
+ emits: ["submit", "change"],
159
+ setup(t, { expose: e, emit: r }) {
160
+ const n = t, u = r, a = y(), { form: l, getValue: o, setValue: d, setValues: b, reset: g, submit: $ } = x({
161
+ id: y(n.id),
162
+ idKey: n.idKey,
163
+ schema: n.schema,
164
+ format: n.submissionFormat
165
+ }), V = async () => {
166
+ const m = await $();
167
+ return u("submit", m), m;
168
+ };
169
+ return P(l, (m) => {
170
+ u("change", m);
171
+ }), _("formStyle", n.formStyle), e({
172
+ submit: V,
173
+ reset: g,
174
+ setValues: b,
175
+ form: l,
176
+ setValue: d,
177
+ getValue: o
178
+ }), (m, G) => {
179
+ const D = T("t-button");
180
+ return N(), O("form", {
181
+ onSubmit: V,
182
+ ref_key: "formReference",
183
+ ref: a
184
+ }, [
185
+ B(m.$slots, "default", { form: J(l) }),
186
+ E("div", {
187
+ class: R([n.buttonWrapperClasses])
188
+ }, [
189
+ W(j(D, K(n.buttonProps, {
190
+ type: "submit",
191
+ class: "mt-4",
192
+ variant: n.buttonVariant,
193
+ label: n.submitLabel,
194
+ onClick: V
195
+ }), null, 16, ["variant", "label"]), [
196
+ [M, n.showSubmit]
197
+ ])
198
+ ], 2)
199
+ ], 544);
200
+ };
201
+ }
202
+ });
203
+ export {
204
+ Z as _
205
+ };
package/dist/ModalForm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as a } from "./ModalForm.vue_vue_type_script_setup_true_lang-BSEORivR.js";
2
- import { p as l } from "./plugin-C3jERS0X.js";
1
+ import { _ as a } from "./ModalForm.vue_vue_type_script_setup_true_lang-BpkPebgZ.js";
2
+ import { p as l } from "./plugin-JFEZqDsu.js";
3
3
  export {
4
4
  a as ModalForm,
5
5
  l as ModalFormPlugin
@@ -1,9 +1,9 @@
1
- import { defineComponent as K, ref as u, computed as L, resolveComponent as o, openBlock as l, createBlock as a, withCtx as n, createCommentVNode as d, createElementBlock as M, createVNode as c, normalizeClass as b, resolveDynamicComponent as N } from "vue";
2
- import { C as R } from "./crud-lKm5HfM4.js";
3
- const $ = {
1
+ import { defineComponent as M, ref as c, computed as N, resolveComponent as o, openBlock as n, createBlock as a, withCtx as l, createCommentVNode as d, createElementBlock as R, createVNode as m, normalizeClass as b, resolveDynamicComponent as $ } from "vue";
2
+ import { C as A } from "./crud-TcRx_r8S.js";
3
+ const I = {
4
4
  key: 0,
5
5
  class: "inline-flex"
6
- }, O = /* @__PURE__ */ K({
6
+ }, U = /* @__PURE__ */ M({
7
7
  name: "TModalForm",
8
8
  __name: "ModalForm",
9
9
  props: {
@@ -13,41 +13,43 @@ const $ = {
13
13
  },
14
14
  emits: ["saved", "closed"],
15
15
  setup(y, { expose: C, emit: k }) {
16
- const i = y, p = k, e = u(null), m = u(!1), v = u(""), f = u(null), s = L(() => i.forms.find((r) => r.key === v.value)), g = (r, t) => {
17
- v.value = r, e.value = new R(s.value?.title, f), t ? e.value?.edit(t) : e.value?.show();
16
+ const i = y, v = k, e = c(null), p = c(!1), f = c(""), r = c(), s = N(() => i.forms.find((u) => u.key === f.value)), g = (u, t) => {
17
+ f.value = u, e.value = new A(s.value?.title, r), t ? e.value?.edit(t) : e.value?.show();
18
18
  }, w = () => {
19
- e.value?.onSave(!m.value), p("saved");
19
+ e.value?.onSave(!p.value), v("saved");
20
20
  }, x = () => {
21
21
  e.value?.delete();
22
- }, S = () => {
23
- e.value?.close(), p("closed");
22
+ }, S = async () => await r.value?.submit(), V = () => {
23
+ r.value?.reset();
24
+ }, D = () => {
25
+ e.value?.close(), v("closed");
24
26
  };
25
- return C({ open: g, delete: x }), (r, t) => {
26
- const V = o("t-input-switch"), D = o("t-icon"), E = o("t-dropdown"), B = o("t-popover"), _ = o("t-button"), h = o("t-popconfirm"), z = o("t-modal");
27
- return e.value?.visible ? (l(), a(z, {
27
+ return C({ open: g, delete: x, submit: S, reset: V }), (u, t) => {
28
+ const E = o("t-input-switch"), B = o("t-icon"), h = o("t-dropdown"), z = o("t-popover"), _ = o("t-button"), F = o("t-popconfirm"), K = o("t-modal");
29
+ return e.value?.visible ? (n(), a(K, {
28
30
  key: 0,
29
31
  title: e.value?.title,
30
- onClosed: S
32
+ onClosed: D
31
33
  }, {
32
- header: n(() => [
33
- s.value?.pinnable && !e.value?.isEditing ? (l(), a(V, {
34
+ header: l(() => [
35
+ s.value?.pinnable && !e.value?.isEditing ? (n(), a(E, {
34
36
  key: 0,
35
- modelValue: m.value,
36
- "onUpdate:modelValue": t[0] || (t[0] = (F) => m.value = F),
37
+ modelValue: p.value,
38
+ "onUpdate:modelValue": t[0] || (t[0] = (L) => p.value = L),
37
39
  label: "Keep open",
38
40
  class: "mt-4"
39
41
  }, null, 8, ["modelValue"])) : d("", !0)
40
42
  ]),
41
- footer: n(() => [
42
- i.options.length ? (l(), M("div", $, [
43
- c(B, { placement: "bottom-start" }, {
44
- content: n(() => [
45
- c(E, {
43
+ footer: l(() => [
44
+ i.options.length ? (n(), R("div", I, [
45
+ m(z, { placement: "bottom-start" }, {
46
+ content: l(() => [
47
+ m(h, {
46
48
  items: i.options
47
49
  }, null, 8, ["items"])
48
50
  ]),
49
- default: n(() => [
50
- c(D, {
51
+ default: l(() => [
52
+ m(B, {
51
53
  icon: "dots-vertical",
52
54
  class: "text-lg mr-6",
53
55
  size: "sm",
@@ -57,13 +59,13 @@ const $ = {
57
59
  ]),
58
60
  _: 1
59
61
  })
60
- ])) : (l(), a(h, {
62
+ ])) : (n(), a(F, {
61
63
  key: 1,
62
64
  message: `Are you sure you want to delete this ${s.value?.title}?`,
63
65
  onConfirm: t[2] || (t[2] = () => e.value?.delete())
64
66
  }, {
65
- default: n(() => [
66
- e.value?.isEditing ? (l(), a(_, {
67
+ default: l(() => [
68
+ e.value?.isEditing ? (n(), a(_, {
67
69
  key: 0,
68
70
  variant: "danger",
69
71
  icon: "trash-can-outline",
@@ -74,7 +76,7 @@ const $ = {
74
76
  ]),
75
77
  _: 1
76
78
  }, 8, ["message"])),
77
- c(_, {
79
+ m(_, {
78
80
  variant: "success",
79
81
  icon: "save",
80
82
  label: "Save",
@@ -85,13 +87,13 @@ const $ = {
85
87
  onClick: t[3] || (t[3] = () => e.value?.save())
86
88
  }, null, 8, ["is-disabled", "class"])
87
89
  ]),
88
- default: n(() => [
89
- s.value ? (l(), a(N(s.value.component), {
90
+ default: l(() => [
91
+ s.value ? (n(), a($(s.value.component), {
90
92
  key: 0,
91
93
  id: `${e.value?.id}`,
92
94
  class: b([i.formClass]),
93
95
  ref_key: "formReference",
94
- ref: f,
96
+ ref: r,
95
97
  onDeleted: t[1] || (t[1] = () => e.value?.onDelete()),
96
98
  onSaved: w
97
99
  }, null, 40, ["id", "class"])) : d("", !0)
@@ -102,5 +104,5 @@ const $ = {
102
104
  }
103
105
  });
104
106
  export {
105
- O as _
107
+ U as _
106
108
  };
@@ -6,7 +6,7 @@ import { _ as n } from "./ChartTreemap.vue_vue_type_script_setup_true_lang-DzIPu
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-CbuLc6sr.js";
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";
@@ -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-BSEORivR.js";
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";
@@ -9,7 +9,7 @@ class h {
9
9
  EDIT: "Edit "
10
10
  };
11
11
  isLoading = !1;
12
- formReference = null;
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.deleteItem());
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,4 +1,4 @@
1
- import { C as i } from "./crud-lKm5HfM4.js";
1
+ import { C as i } from "./crud-TcRx_r8S.js";
2
2
  const e = (r) => {
3
3
  const o = new FormData();
4
4
  if (r)
@@ -1,5 +1,5 @@
1
1
  import { r } from "./register-component-B-fdqewb.js";
2
- import { _ as s } from "./Form.vue_vue_type_script_setup_true_lang-CbuLc6sr.js";
2
+ import { _ as s } from "./Form.vue_vue_type_script_setup_true_lang-O6nqLPyU.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 "./ModalForm.vue_vue_type_script_setup_true_lang-BSEORivR.js";
2
+ import { _ as s } from "./ModalForm.vue_vue_type_script_setup_true_lang-BpkPebgZ.js";
3
3
  const m = {
4
4
  install(o) {
5
5
  r(o, s);
@@ -12,8 +12,8 @@ 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-CbuLc6sr.js";
16
- import { p as t } from "./plugin-DF8iyfN5.js";
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";
@@ -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-C3jERS0X.js";
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";
package/dist/plugins.js CHANGED
@@ -12,8 +12,8 @@ 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-CbuLc6sr.js";
16
- import { p as E } from "./plugin-DF8iyfN5.js";
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";
@@ -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-C3jERS0X.js";
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";
package/dist/tamandua.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as n } from "./plugins-BA8tojIo.js";
1
+ import { p as n } from "./plugins-Bc8aBhAD.js";
2
2
  const o = {
3
3
  install(s) {
4
4
  for (const i in n)
@@ -1,5 +1,5 @@
1
1
  import { getCurrentInstance } from 'vue';
2
- import { SelectOption } from '../../types/form.js';
2
+ import { SelectOption } from '../InputSelect/types.js';
3
3
 
4
4
  export type DropdownProps = {
5
5
  items?: SelectOption[];
@@ -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?: import('../../types/form.js').FormStyle | undefined;
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<void>;
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
- getValues: () => import("vue").UnwrapNestedRefs<FormInstance<T>>;
30
- setValue: <K extends keyof T>(name: K, value: T[K]) => void;
31
- getValue: (key: string) => any;
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?: import('../../types/form.js').FormStyle | undefined;
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<void>;
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
- getValues: () => import("vue").UnwrapNestedRefs<FormInstance<T>>;
50
- setValue: <K extends keyof T>(name: K, value: T[K]) => void;
51
- getValue: (key: string) => any;
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?: import('../../types/form.js').FormStyle | undefined;
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<void>;
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
- getValues: () => import("vue").UnwrapNestedRefs<FormInstance<T>>;
81
- setValue: <K extends keyof T>(name: K, value: T[K]) => void;
82
- getValue: (key: string) => any;
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
- export type FormProps<T> = {
7
- id?: string;
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<FormSubmissionFormat>): void;
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,4 +1,4 @@
1
- import { InputPasswordModel } from '../../types/form.js';
1
+ import { InputPasswordModel } from './types.js';
2
2
 
3
3
  declare const _default: import('vue').DefineComponent<{
4
4
  modelValue: import("vue").PropType<InputPasswordModel>;
@@ -1,5 +1,13 @@
1
- import { InputPasswordModel } from '../../types/form.js';
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>;