@caipira/tamandua 0.0.113 → 0.0.114

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/Form.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as m } from "./Form.vue_vue_type_script_setup_true_lang-BwcOBEkF.js";
2
- import { p as a } from "./plugin-DB0XiYOM.js";
1
+ import { _ as m } from "./Form.vue_vue_type_script_setup_true_lang-BCHodpyU.js";
2
+ import { p as a } from "./plugin-Dh8Ga8Cy.js";
3
3
  export {
4
4
  m as Form,
5
5
  a as FormPlugin
@@ -1,37 +1,37 @@
1
- import { reactive as C, defineComponent as $, ref as _, computed as N, watch as O, provide as z, resolveComponent as A, openBlock as J, createElementBlock as P, renderSlot as j, unref as E, createElementVNode as B, normalizeClass as T, withDirectives as W, createVNode as R, mergeProps as q, vShow as x } from "vue";
1
+ import { reactive as C, defineComponent as $, ref as _, computed as N, watch as O, provide as z, resolveComponent as A, openBlock as J, createElementBlock as P, renderSlot as j, unref as B, createElementVNode as E, normalizeClass as T, withDirectives as W, createVNode as R, mergeProps as q, vShow as x } from "vue";
2
2
  import { F as G } from "./ui-UhY-K-wS.js";
3
3
  import { F as s, a as f } from "./form-Dctryp6H.js";
4
4
  import { d as h, c as S, p as F, a as V } from "./transformers-BORZfvK0.js";
5
5
  const i = {
6
- default: (e, t, r) => (t[r] = e, t),
7
- price: (e, t, r, n = ["Currency", "Value"]) => {
8
- const [c, a] = F(e);
9
- return t[`${r}${n[0]}`] = c, t[`${r}${n[1]}`] = a, t;
6
+ default: (r, t, e) => (t[e] = r, t),
7
+ price: (r, t, e, n = ["Currency", "Value"]) => {
8
+ const [c, a] = F(r);
9
+ return t[`${e}${n[0]}`] = c, t[`${e}${n[1]}`] = a, t;
10
10
  },
11
- password: async (e, t, r) => (t[r] = V(e), t)
12
- }, H = async (e, t, r, n) => {
13
- switch (e) {
11
+ password: async (r, t, e) => (t[e] = V(r), t)
12
+ }, H = async (r, t, e, n) => {
13
+ switch (r) {
14
14
  case s.Address:
15
15
  return i.default(
16
- r,
16
+ e,
17
17
  t,
18
18
  n
19
19
  );
20
20
  case s.Boolean:
21
21
  return i.default(
22
- r,
22
+ e,
23
23
  t,
24
24
  n
25
25
  );
26
26
  case s.Country:
27
27
  return i.default(
28
- S(r),
28
+ S(e),
29
29
  t,
30
30
  n
31
31
  );
32
32
  case s.Date:
33
33
  return i.default(
34
- h(r),
34
+ h(e),
35
35
  t,
36
36
  n
37
37
  );
@@ -40,98 +40,101 @@ const i = {
40
40
  throw new Error("Cannot append files to JSON!");
41
41
  case s.Price:
42
42
  return i.price(
43
- r,
43
+ e,
44
44
  t,
45
45
  n
46
46
  );
47
47
  case s.Password:
48
48
  return await i.password(
49
- r,
49
+ e,
50
50
  t,
51
51
  n
52
52
  );
53
53
  case s.StringArray:
54
54
  return i.default(
55
- r,
55
+ e,
56
56
  t,
57
57
  n
58
58
  );
59
59
  default:
60
60
  return i.default(
61
- r,
61
+ e,
62
62
  t,
63
63
  n
64
64
  );
65
65
  }
66
- }, p = (e) => (e == null ? e = "" : typeof e == "object" ? e = JSON.stringify(e) : typeof e == "number" ? e = e.toString() : typeof e == "boolean" && (e = e ? "1" : "0"), e), u = {
67
- default: (e, t, r) => {
68
- const n = p(e);
69
- return e && t.append(r, n), t;
66
+ }, p = (r) => (r == null ? r = "" : typeof r == "object" ? r = JSON.stringify(r) : typeof r == "number" ? r = r.toString() : typeof r == "boolean" && (r = r ? "1" : "0"), r), u = {
67
+ boolean: (r, t, e) => (t.append(e, r ? "1" : "0"), t),
68
+ default: (r, t, e) => {
69
+ const n = p(r);
70
+ return r && t.append(e, n), t;
70
71
  },
71
- price: (e, t, r, n = ["Currency", "Value"]) => {
72
- const [c, a] = F(e);
73
- return t.append(`${r}${n[0]}`, p(c)), t.append(`${r}${n[1]}`, p(a)), t;
72
+ price: (r, t, e, n = ["Currency", "Value"]) => {
73
+ const [c, a] = F(r);
74
+ return t.append(`${e}${n[0]}`, p(c)), t.append(`${e}${n[1]}`, p(a)), t;
74
75
  },
75
- address: (e, t, r) => (t.append(
76
- r,
76
+ address: (r, t, e) => (t.append(
77
+ e,
77
78
  JSON.stringify({
78
- ...e,
79
- country: S(e?.country)
79
+ ...r,
80
+ country: S(r?.country)
80
81
  })
81
82
  ), t),
82
- documents: (e, t, r) => (r.endsWith("[]") || (r = `${r}[]`), Array.from(e).forEach((n) => t.append(r, n)), t),
83
- document: (e, t, r) => (t.append(r, e), t),
84
- stringArray: (e, t, r) => (r.endsWith("[]") || (r = `${r}[]`), e.forEach((n) => t.append(r, p(n))), t),
85
- object: (e, t, r) => (t.append(r, JSON.stringify(e)), t)
86
- }, I = async (e, t, r, n) => {
87
- switch (e) {
83
+ documents: (r, t, e) => (e.endsWith("[]") || (e = `${e}[]`), Array.from(r).forEach((n) => t.append(e, n)), t),
84
+ document: (r, t, e) => (t.append(e, r), t),
85
+ stringArray: (r, t, e) => (e.endsWith("[]") || (e = `${e}[]`), r.forEach((n) => t.append(e, p(n))), t),
86
+ object: (r, t, e) => (t.append(e, JSON.stringify(r)), t)
87
+ }, I = async (r, t, e, n) => {
88
+ switch (r) {
89
+ case s.Boolean:
90
+ return u.boolean(e, t, n);
88
91
  case s.Country:
89
- return u.default(S(r), t, n);
92
+ return u.default(S(e), t, n);
90
93
  case s.Document:
91
- return u.document(r, t, n);
94
+ return u.document(e, t, n);
92
95
  case s.Documents:
93
- return u.documents(r, t, n);
96
+ return u.documents(e, t, n);
94
97
  case s.Date:
95
- return u.default(h(r), t, n);
98
+ return u.default(h(e), t, n);
96
99
  case s.Address:
97
- return u.address(r, t, n);
100
+ return u.address(e, t, n);
98
101
  case s.Price:
99
- return u.price(r, t, n);
102
+ return u.price(e, t, n);
100
103
  case s.Password:
101
- return u.default(V(r), t, n);
104
+ return u.default(V(e), t, n);
102
105
  case s.StringArray:
103
- return u.stringArray(r, t, n);
106
+ return u.stringArray(e, t, n);
104
107
  case s.Object:
105
- return u.object(r, t, n);
108
+ return u.object(e, t, n);
106
109
  default:
107
- return u.default(r, t, n);
110
+ return u.default(e, t, n);
108
111
  }
109
- }, K = async (e, t, r) => {
110
- switch (r) {
112
+ }, K = async (r, t, e) => {
113
+ switch (e) {
111
114
  case f.JSON:
112
115
  let n = {};
113
- for (const a in e)
116
+ for (const a in r)
114
117
  n = await H(
115
118
  t[a],
116
119
  n,
117
- e[a],
120
+ r[a],
118
121
  a
119
122
  );
120
123
  return n;
121
124
  case f.FormData:
122
125
  default:
123
126
  let c = new FormData();
124
- for (const a in e)
127
+ for (const a in r)
125
128
  c = await I(
126
129
  t[a],
127
130
  c,
128
- e[a],
131
+ r[a],
129
132
  a
130
133
  );
131
134
  return c;
132
135
  }
133
136
  };
134
- function L(e) {
137
+ function L(r) {
135
138
  const t = C(
136
139
  {}
137
140
  );
@@ -147,12 +150,12 @@ function L(e) {
147
150
  const o = {
148
151
  ...t
149
152
  };
150
- return e.id && e.id.value && (o.id = e.id.value), {
153
+ return r.id && r.id.value && (o.id = r.id.value), {
151
154
  isValid: !0,
152
155
  form: await K(
153
156
  o,
154
- e.schema,
155
- e.format ?? f.JSON
157
+ r.schema,
158
+ r.format ?? f.JSON
156
159
  )
157
160
  };
158
161
  } };
@@ -172,8 +175,8 @@ const Z = /* @__PURE__ */ $({
172
175
  buttonWrapperClass: { default: "" }
173
176
  },
174
177
  emits: ["submit", "change"],
175
- setup(e, { expose: t, emit: r }) {
176
- const n = e, c = r, a = _(), { form: m, getValue: o, setValue: d, setValues: b, reset: y, submit: g } = L({
178
+ setup(r, { expose: t, emit: e }) {
179
+ const n = r, c = e, a = _(), { form: m, getValue: o, setValue: d, setValues: b, reset: y, submit: g } = L({
177
180
  id: N(() => n.identifier),
178
181
  schema: n.schema,
179
182
  format: n.submissionFormat
@@ -201,8 +204,8 @@ const Z = /* @__PURE__ */ $({
201
204
  ref_key: "formReference",
202
205
  ref: a
203
206
  }, [
204
- j(l.$slots, "default", { form: E(m) }),
205
- B("div", {
207
+ j(l.$slots, "default", { form: B(m) }),
208
+ E("div", {
206
209
  class: T([n.buttonWrapperClass])
207
210
  }, [
208
211
  W(R(D, q({
@@ -8,7 +8,7 @@ import { _ as l } from "./DialogProvider.vue_vue_type_script_setup_true_lang-ByN
8
8
  import { D as c } from "./Drawer-y5xBARd2.js";
9
9
  import { _ as T } from "./Dropdown.vue_vue_type_script_setup_true_lang-DzFX49Bk.js";
10
10
  import { _ as d } from "./FileDrop.vue_vue_type_script_setup_true_lang-Bq0lAgZ7.js";
11
- import { _ as g } from "./Form.vue_vue_type_script_setup_true_lang-BwcOBEkF.js";
11
+ import { _ as g } from "./Form.vue_vue_type_script_setup_true_lang-BCHodpyU.js";
12
12
  import { _ as b } from "./FormItem.vue_vue_type_script_setup_true_lang-CjK_w-y0.js";
13
13
  import { _ as G } from "./GraphyEmpty.vue_vue_type_script_setup_true_lang-B-hAjDCw.js";
14
14
  import { _ as k } from "./GraphyLabel.vue_vue_type_script_setup_true_lang-DIKuG0Po.js";
@@ -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-BwcOBEkF.js";
2
+ import { _ as s } from "./Form.vue_vue_type_script_setup_true_lang-BCHodpyU.js";
3
3
  const m = {
4
4
  install(o) {
5
5
  r(o, s);
@@ -17,8 +17,8 @@ import "./Dropdown.vue_vue_type_script_setup_true_lang-DzFX49Bk.js";
17
17
  import { p as l } from "./plugin-BUXGSpUK.js";
18
18
  import { p as g } from "./plugin-43q0Kzto.js";
19
19
  import { p as a } from "./plugin-CzWnCRfO.js";
20
- import "./Form.vue_vue_type_script_setup_true_lang-BwcOBEkF.js";
21
- import { p as s } from "./plugin-DB0XiYOM.js";
20
+ import "./Form.vue_vue_type_script_setup_true_lang-BCHodpyU.js";
21
+ import { p as s } from "./plugin-Dh8Ga8Cy.js";
22
22
  import { p as P } from "./plugin-Buc7eEox.js";
23
23
  import { p as f } from "./plugin-CC97Vx-s.js";
24
24
  import "./GraphyPrice.vue_vue_type_script_setup_true_lang-DYxzVfdC.js";
package/dist/plugins.js CHANGED
@@ -17,8 +17,8 @@ import "./Dropdown.vue_vue_type_script_setup_true_lang-DzFX49Bk.js";
17
17
  import { p as N } from "./plugin-BUXGSpUK.js";
18
18
  import { p as Q } from "./plugin-43q0Kzto.js";
19
19
  import { p as V } from "./plugin-CzWnCRfO.js";
20
- import "./Form.vue_vue_type_script_setup_true_lang-BwcOBEkF.js";
21
- import { p as X } from "./plugin-DB0XiYOM.js";
20
+ import "./Form.vue_vue_type_script_setup_true_lang-BCHodpyU.js";
21
+ import { p as X } from "./plugin-Dh8Ga8Cy.js";
22
22
  import { p as Z } from "./plugin-Buc7eEox.js";
23
23
  import { p as $ } from "./plugin-CC97Vx-s.js";
24
24
  import "./GraphyPrice.vue_vue_type_script_setup_true_lang-DYxzVfdC.js";
package/dist/tamandua.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as n } from "./plugins-DASyBRSp.js";
1
+ import { p as n } from "./plugins-Bj1rKGE_.js";
2
2
  const o = {
3
3
  install(s) {
4
4
  for (const i in n)
@@ -8,7 +8,7 @@ export type FormStyle = {
8
8
  };
9
9
  export type FormLayout = "horizontal" | "vertical" | "inline";
10
10
  export type FormProps<T extends FormSchema> = {
11
- size: `${FormControlSize}`;
11
+ size?: `${FormControlSize}`;
12
12
  schema?: T;
13
13
  layout?: FormLayout;
14
14
  formStyle?: FormStyle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caipira/tamandua",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
4
4
  "private": false,
5
5
  "description": "UI library for the Caipira ecosystem",
6
6
  "license": "GPL-3.0-only",