@caipira/tamandua 0.0.39 → 0.0.41

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 (38) hide show
  1. package/dist/Form.js +2 -2
  2. package/dist/Form.vue_vue_type_script_setup_true_lang-CaCu47jH.js +217 -0
  3. package/dist/Link.js +2 -2
  4. package/dist/Link.vue_vue_type_script_setup_true_lang-CUOLot0A.js +51 -0
  5. package/dist/{ProgressLine-CY6aDj-H.js → ProgressLine-bKh0terH.js} +9 -9
  6. package/dist/ProgressLine.css +1 -1
  7. package/dist/ProgressLine.js +2 -2
  8. package/dist/Tab.js +2 -2
  9. package/dist/{Tab.vue_vue_type_script_setup_true_lang-VzvYvoqa.js → Tab.vue_vue_type_script_setup_true_lang-Bk9igf63.js} +15 -15
  10. package/dist/Tag.js +2 -2
  11. package/dist/Tag.vue_vue_type_script_setup_true_lang-DatNytmx.js +73 -0
  12. package/dist/components.js +5 -5
  13. package/dist/form2.js +15 -13
  14. package/dist/{plugin-5vn4G57V.js → plugin-BV-k02s1.js} +1 -1
  15. package/dist/{plugin-DgCa2m12.js → plugin-DXjluPIV.js} +1 -1
  16. package/dist/{plugin-Bk8QZgpY.js → plugin-VQZG4jD0.js} +1 -1
  17. package/dist/{plugin-dL6oP11N.js → plugin-t2MeakcO.js} +1 -1
  18. package/dist/{plugin-BFAUI0U3.js → plugin-uMlQixCx.js} +1 -1
  19. package/dist/{plugins-DfXmQBVL.js → plugins-BBSrXMww.js} +9 -9
  20. package/dist/plugins.js +9 -9
  21. package/dist/tamandua.js +1 -1
  22. package/dist/transformers-DLw_G6c6.js +15 -0
  23. package/dist/types/components/ChartLine/ChartLine.vue.d.ts +32 -2
  24. package/dist/types/components/ChartTreemap/types.d.ts +4 -1
  25. package/dist/types/components/ProgressLine/ProgressLine.vue.d.ts +52 -2
  26. package/dist/types/components/SensitiveInfo/SensitiveInfo.vue.d.ts +12 -3
  27. package/dist/types/components/Skeleton/Skeleton.vue.d.ts +7 -3
  28. package/dist/types/components/Tab/Tab.vue.d.ts +26 -3
  29. package/dist/types/components/Toast/Toast.vue.d.ts +16 -3
  30. package/dist/types/form/index.d.ts +3 -4
  31. package/dist/types/form/json-transformers.d.ts +4 -3
  32. package/dist/types/form/transformers.d.ts +9 -0
  33. package/dist/types/types/form.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/dist/Form.vue_vue_type_script_setup_true_lang-Cf0LqvyX.js +0 -203
  36. package/dist/Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js +0 -50
  37. package/dist/Tag.vue_vue_type_script_setup_true_lang-DMigzW22.js +0 -71
  38. package/dist/types/form/form-value-transformers.d.ts +0 -9
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-Cf0LqvyX.js";
16
- import { p as E } from "./plugin-BFAUI0U3.js";
15
+ import "./Form.vue_vue_type_script_setup_true_lang-CaCu47jH.js";
16
+ import { p as E } from "./plugin-uMlQixCx.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";
@@ -37,8 +37,8 @@ import { p as fr } from "./plugin-cVdTR_s6.js";
37
37
  import { p as hr } from "./plugin-DT7LVAli.js";
38
38
  import { p as Tr } from "./plugin-Bbt6pP0l.js";
39
39
  import { p as yr } from "./plugin-BQFwx3d5.js";
40
- import "./Link.vue_vue_type_script_setup_true_lang-DeBJ2UGi.js";
41
- import { p as Cr } from "./plugin-dL6oP11N.js";
40
+ import "./Link.vue_vue_type_script_setup_true_lang-CUOLot0A.js";
41
+ import { p as Cr } from "./plugin-t2MeakcO.js";
42
42
  import { p as Sr } from "./plugin-GUvrG7aO.js";
43
43
  import { p as vr } from "./plugin-DmPqmScT.js";
44
44
  import { p as Dr } from "./plugin-YUomn9tF.js";
@@ -48,15 +48,15 @@ import "./Popover.vue_vue_type_script_setup_true_lang-dnL75W40.js";
48
48
  import { p as Ar } from "./plugin-CdJ1wBq2.js";
49
49
  import "./ProgressCircle-BY2eeyGY.js";
50
50
  import { p as Er } from "./plugin-DXSsGfRI.js";
51
- import "./ProgressLine-CY6aDj-H.js";
52
- import { p as jr } from "./plugin-Bk8QZgpY.js";
51
+ import "./ProgressLine-bKh0terH.js";
52
+ import { p as jr } from "./plugin-VQZG4jD0.js";
53
53
  import { p as zr } from "./plugin-cvHKUGjm.js";
54
54
  import { p as Jr } from "./plugin-B9wG8DUw.js";
55
- import { p as Nr } from "./plugin-5vn4G57V.js";
55
+ import { p as Nr } from "./plugin-BV-k02s1.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-DMigzW22.js";
59
- import { p as Vr } from "./plugin-DgCa2m12.js";
58
+ import "./Tag.vue_vue_type_script_setup_true_lang-DatNytmx.js";
59
+ import { p as Vr } from "./plugin-DXjluPIV.js";
60
60
  import { p as Xr } from "./plugin-Dn96hI0e.js";
61
61
  export {
62
62
  T as AvatarPlugin,
package/dist/tamandua.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as n } from "./plugins-DfXmQBVL.js";
1
+ import { p as n } from "./plugins-BBSrXMww.js";
2
2
  const o = {
3
3
  install(s) {
4
4
  for (const i in n)
@@ -0,0 +1,15 @@
1
+ import { f as t } from "./index-CjvqeRf7.js";
2
+ const o = (r) => r ? t(r, "yyyy-MM-dd") : "", e = (r) => [`${r?.iso}`, `${r?.value}`], n = (r) => r?.iso2 ?? "", s = (r) => r?.hash ? r.hash : r?.raw ?? "", c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
+ __proto__: null,
4
+ country: n,
5
+ date: o,
6
+ password: s,
7
+ price: e
8
+ }, Symbol.toStringTag, { value: "Module" }));
9
+ export {
10
+ s as a,
11
+ n as c,
12
+ o as d,
13
+ e as p,
14
+ c as t
15
+ };
@@ -1,4 +1,34 @@
1
- declare const _default: import('vue').DefineComponent<any, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any>, {} | {
2
- [x: string]: any;
1
+ import { ChartLineProps } from './types.js';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChartLineProps>, {
4
+ options: () => {
5
+ scatterplot: boolean;
6
+ };
7
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ChartLineProps>, {
8
+ options: () => {
9
+ scatterplot: boolean;
10
+ };
11
+ }>>>, {
12
+ options: {
13
+ scatterplot?: boolean | undefined;
14
+ grid?: boolean | undefined;
15
+ };
3
16
  }, {}>;
4
17
  export default _default;
18
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
19
+ type __VLS_TypePropsToRuntimeProps<T> = {
20
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
21
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
22
+ } : {
23
+ type: import('vue').PropType<T[K]>;
24
+ required: true;
25
+ };
26
+ };
27
+ type __VLS_WithDefaults<P, D> = {
28
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
29
+ default: D[K];
30
+ }> : P[K];
31
+ };
32
+ type __VLS_Prettify<T> = {
33
+ [K in keyof T]: T[K];
34
+ } & {};
@@ -5,6 +5,9 @@ export type Node = {
5
5
  children?: Node[];
6
6
  };
7
7
  export type ChartTreemapProps = {
8
- data: Node[];
8
+ data: {
9
+ name: string;
10
+ children: Node[];
11
+ };
9
12
  options: never;
10
13
  };
@@ -1,9 +1,59 @@
1
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<any, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any>, {} | {
2
- [x: string]: any;
1
+ import { ProgressLineProps } from './types.js';
2
+
3
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ProgressLineProps>, {
4
+ value: number;
5
+ height: number;
6
+ borderRadius: number;
7
+ showPercentage: boolean;
8
+ svgClass: string;
9
+ labelClass: string;
10
+ overColor: string;
11
+ progressColor: string;
12
+ finishedColor: string;
13
+ backgroundColor: string;
14
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ProgressLineProps>, {
15
+ value: number;
16
+ height: number;
17
+ borderRadius: number;
18
+ showPercentage: boolean;
19
+ svgClass: string;
20
+ labelClass: string;
21
+ overColor: string;
22
+ progressColor: string;
23
+ finishedColor: string;
24
+ backgroundColor: string;
25
+ }>>>, {
26
+ value: number;
27
+ backgroundColor: string;
28
+ borderRadius: number;
29
+ height: number;
30
+ showPercentage: boolean;
31
+ svgClass: string;
32
+ labelClass: string;
33
+ overColor: string;
34
+ progressColor: string;
35
+ finishedColor: string;
3
36
  }, {}>, {
4
37
  label?(_: {}): any;
5
38
  }>;
6
39
  export default _default;
40
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
41
+ type __VLS_TypePropsToRuntimeProps<T> = {
42
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
43
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
44
+ } : {
45
+ type: import('vue').PropType<T[K]>;
46
+ required: true;
47
+ };
48
+ };
49
+ type __VLS_WithDefaults<P, D> = {
50
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
51
+ default: D[K];
52
+ }> : P[K];
53
+ };
54
+ type __VLS_Prettify<T> = {
55
+ [K in keyof T]: T[K];
56
+ } & {};
7
57
  type __VLS_WithTemplateSlots<T, S> = T & {
8
58
  new (): {
9
59
  $slots: S;
@@ -1,9 +1,18 @@
1
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<any, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any>, {} | {
2
- [x: string]: any;
3
- }, {}>, {
1
+ import { SensitiveInfoProps } from './types.js';
2
+
3
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<SensitiveInfoProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<SensitiveInfoProps>>>, {}, {}>, {
4
4
  default?(_: {}): any;
5
5
  }>;
6
6
  export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToRuntimeProps<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
7
16
  type __VLS_WithTemplateSlots<T, S> = T & {
8
17
  new (): {
9
18
  $slots: S;
@@ -1,4 +1,8 @@
1
- declare const _default: import('vue').DefineComponent<any, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any>, {} | {
2
- [x: string]: any;
3
- }, {}>;
1
+ declare const _default: import('vue').DefineComponent<Readonly<import("vue").ComponentPropsOptions<{
2
+ [x: string]: unknown;
3
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, readonly string[] | Readonly<import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
4
+ [x: string]: unknown;
5
+ }>>>>, {
6
+ readonly [x: number]: string;
7
+ } | {}, {}>;
4
8
  export default _default;
@@ -1,7 +1,30 @@
1
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<any, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any>, {} | {
2
- [x: string]: any;
3
- }, {}>, Partial<Record<any, (_: {}) => any>>>;
1
+ import { TabProps } from './types.js';
2
+
3
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TabProps>, {
4
+ tabs: () => never[];
5
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TabProps>, {
6
+ tabs: () => never[];
7
+ }>>>, {
8
+ tabs: import("../../index.js").Tab[];
9
+ }, {}>, Partial<Record<string, (_: {}) => any>>>;
4
10
  export default _default;
11
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
+ type __VLS_TypePropsToRuntimeProps<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: import('vue').PropType<T[K]>;
17
+ required: true;
18
+ };
19
+ };
20
+ type __VLS_WithDefaults<P, D> = {
21
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
22
+ default: D[K];
23
+ }> : P[K];
24
+ };
25
+ type __VLS_Prettify<T> = {
26
+ [K in keyof T]: T[K];
27
+ } & {};
5
28
  type __VLS_WithTemplateSlots<T, S> = T & {
6
29
  new (): {
7
30
  $slots: S;
@@ -1,4 +1,17 @@
1
- declare const _default: import('vue').DefineComponent<any, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any>, {} | {
2
- [x: string]: any;
3
- }, {}>;
1
+ import { ToastProps } from './types.js';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<ToastProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ close: (val: number) => void;
5
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ToastProps>>> & {
6
+ onClose?: ((val: number) => any) | undefined;
7
+ }, {}, {}>;
4
8
  export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToRuntimeProps<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -1,4 +1,3 @@
1
- import { jsonToFormData, formDataToJson } from './convertors.js';
2
- import { default as CrudService } from './crud.js';
3
-
4
- export { CrudService, jsonToFormData, formDataToJson };
1
+ export * as transformers from './transformers.js';
2
+ export { jsonToFormData, formDataToJson } from './convertors.js';
3
+ export { default as CrudService } from './crud.js';
@@ -1,4 +1,5 @@
1
- import { JSONForm, FormSchema, TransformedForm } from '../types/form.js';
2
- import { FormDataTypes, FormSubmissionFormat } from '../enums/form.js';
1
+ import { JSONForm, TransformedForm, FormSchemaValueMap } from '../types/form.js';
2
+ import { FormSubmissionFormat } from '../enums/form.js';
3
+ import { Maybe } from '../types/common.js';
3
4
 
4
- export declare const formValueToJSONFormValue: <T extends FormDataTypes>(schema: FormSchema[T], form: TransformedForm<FormSubmissionFormat.JSON>, value: any, key: string) => Promise<JSONForm>;
5
+ export declare const formValueToJSONFormValue: <T extends keyof FormSchemaValueMap>(schema: T, form: TransformedForm<FormSubmissionFormat.JSON>, value: Maybe<FormSchemaValueMap[T]>, key: string) => Promise<JSONForm>;
@@ -0,0 +1,9 @@
1
+ import { InputPasswordModel } from '../components/InputPassword/types.js';
2
+ import { InputPriceModel } from '../components/InputPrice/types.js';
3
+ import { Country } from '../types/address.js';
4
+
5
+ declare const date: (date: Date) => string;
6
+ declare const price: (priceValue: InputPriceModel) => string[];
7
+ declare const country: (country?: Country) => string;
8
+ declare const password: (password?: InputPasswordModel) => string;
9
+ export { date, price, country, password };
@@ -31,7 +31,7 @@ export type FormDataForm = InstanceType<typeof FormData>;
31
31
  * Form in the JSON format
32
32
  */
33
33
  export type JSONForm = {
34
- [prop: string]: string | number | boolean | string[];
34
+ [prop: string]: string | number | boolean | string[] | object;
35
35
  };
36
36
  /**
37
37
  * Form submission format map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caipira/tamandua",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "private": false,
5
5
  "description": "UI library for the Caipira ecosystem",
6
6
  "license": "GPL-3.0-only",
@@ -1,203 +0,0 @@
1
- import { reactive as D, defineComponent as C, ref as A, computed as P, watch as _, provide as T, resolveComponent as N, openBlock as O, createElementBlock as B, renderSlot as J, unref as E, createElementVNode as R, normalizeClass as W, withDirectives as j, createVNode as M, mergeProps as z, vShow as L } from "vue";
2
- import { B as I } from "./ui-BC6H9E93.js";
3
- import { F as s, a as p } from "./form-BkXpIJ0e.js";
4
- import { f as Y } from "./index-CjvqeRf7.js";
5
- const w = (t) => t ? Y(t, "yyyy-MM-dd") : "", y = (t) => [`${t?.iso}`, `${t?.value}`], h = (t) => t?.iso2 ?? "", F = async (t) => t?.hash ? t.hash : t?.raw ?? "", i = {
6
- default: (t, r, e) => (r[e] = t, r),
7
- price: (t, r, e, n = ["Currency", "Value"]) => {
8
- const [u, a] = y(t);
9
- return r[`${e}${n[0]}`] = u, r[`${e}${n[1]}`] = a, r;
10
- },
11
- password: async (t, r, e) => (r[e] = await F(t), r),
12
- stringArray: (t, r, e) => (r[e] = t, r)
13
- }, q = async (t, r, e, n) => {
14
- switch (t) {
15
- case s.Country:
16
- return i.default(
17
- h(e),
18
- r,
19
- n
20
- );
21
- case s.Documents:
22
- return i.default(e, r, n);
23
- case s.Date:
24
- return i.default(
25
- w(e),
26
- r,
27
- n
28
- );
29
- case s.Address:
30
- return i.default(e, r, n);
31
- case s.Price:
32
- return i.price(e, r, n);
33
- case s.Password:
34
- return await i.password(e, r, n);
35
- case s.StringArray:
36
- return i.stringArray(e, r, n);
37
- default:
38
- return i.default(e, r, 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, r, e) => {
42
- const n = f(t);
43
- return t && r.append(e, n), r;
44
- },
45
- price: (t, r, e, n = ["Currency", "Value"]) => {
46
- const [u, a] = y(t);
47
- return r.append(`${e}${n[0]}`, f(u)), r.append(`${e}${n[1]}`, f(a)), r;
48
- },
49
- address: (t, r, e) => (r.append(
50
- e,
51
- JSON.stringify({
52
- ...t,
53
- country: h(t?.country)
54
- })
55
- ), r),
56
- documents: (t, r, e) => (e.endsWith("[]") || (e = `${e}[]`), Array.from(t).forEach((n) => r.append(e, n)), r),
57
- document: (t, r, e) => (r.append(e, t), r),
58
- stringArray: (t, r, e) => (e.endsWith("[]") || (e = `${e}[]`), t.forEach((n) => r.append(e, f(n))), r)
59
- }, x = async (t, r, e, n) => {
60
- switch (t) {
61
- case s.Country:
62
- return c.default(
63
- h(e),
64
- r,
65
- n
66
- );
67
- case s.Document:
68
- return c.document(e, r, n);
69
- case s.Documents:
70
- return c.documents(e, r, n);
71
- case s.Date:
72
- return c.default(
73
- w(e),
74
- r,
75
- n
76
- );
77
- case s.Address:
78
- return c.address(e, r, n);
79
- case s.Price:
80
- return c.price(e, r, n);
81
- case s.Password:
82
- return c.default(
83
- await F(e),
84
- r,
85
- n
86
- );
87
- case s.StringArray:
88
- return c.stringArray(e, r, n);
89
- default:
90
- return c.default(e, r, n);
91
- }
92
- }, G = async (t, r, e) => {
93
- switch (e) {
94
- case p.JSON:
95
- let n = {};
96
- for (const a in t)
97
- n = await q(
98
- r[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 x(
109
- r[a],
110
- u,
111
- t[a],
112
- a
113
- );
114
- return u;
115
- }
116
- };
117
- function H(t) {
118
- const r = D(
119
- {}
120
- );
121
- return { form: r, setValue: (o, m) => {
122
- r[o] = m;
123
- }, setValues: (o) => {
124
- for (const [m, b] of Object.entries(o))
125
- r[m] = b;
126
- }, getValue: (o) => r[o], reset: () => {
127
- for (const o in r)
128
- delete r[o];
129
- }, submit: async () => {
130
- const o = {
131
- ...r
132
- };
133
- return t.id && t.id.value && (o.id = t.id.value), {
134
- isValid: !0,
135
- form: await G(
136
- o,
137
- t.schema,
138
- t.format ?? p.JSON
139
- )
140
- };
141
- } };
142
- }
143
- const v = /* @__PURE__ */ C({
144
- name: "TForm",
145
- __name: "Form",
146
- props: {
147
- id: { default: "" },
148
- schema: { default: () => ({}) },
149
- formStyle: { default: () => ({}) },
150
- showSubmit: { type: Boolean, default: !1 },
151
- submitLabel: { default: "Submit" },
152
- buttonProps: {},
153
- buttonVariant: { default: I.PRIMARY },
154
- submissionFormat: { default: p.FormData },
155
- buttonWrapperClasses: { default: "" }
156
- },
157
- emits: ["submit", "change"],
158
- setup(t, { expose: r, emit: e }) {
159
- const n = t, u = e, a = A(), { form: l, getValue: o, setValue: m, setValues: b, reset: S, submit: g } = H({
160
- id: P(() => n.id),
161
- schema: n.schema,
162
- format: n.submissionFormat
163
- }), V = async () => {
164
- const d = await g();
165
- return u("submit", d), d;
166
- };
167
- return _(l, (d) => {
168
- u("change", d);
169
- }), T("formStyle", n.formStyle), r({
170
- submit: V,
171
- reset: S,
172
- setValues: b,
173
- form: l,
174
- setValue: m,
175
- getValue: o
176
- }), (d, K) => {
177
- const $ = N("t-button");
178
- return O(), B("form", {
179
- onSubmit: V,
180
- ref_key: "formReference",
181
- ref: a
182
- }, [
183
- J(d.$slots, "default", { form: E(l) }),
184
- R("div", {
185
- class: W([n.buttonWrapperClasses])
186
- }, [
187
- j(M($, z(n.buttonProps, {
188
- type: "submit",
189
- class: "mt-4",
190
- variant: n.buttonVariant,
191
- label: n.submitLabel,
192
- onClick: V
193
- }), null, 16, ["variant", "label"]), [
194
- [L, n.showSubmit]
195
- ])
196
- ], 2)
197
- ], 544);
198
- };
199
- }
200
- });
201
- export {
202
- v as _
203
- };
@@ -1,50 +0,0 @@
1
- import { defineComponent as s, computed as d, resolveComponent as c, openBlock as o, createBlock as n, resolveDynamicComponent as m, withCtx as u, renderSlot as p, createElementBlock as f, Fragment as _, createTextVNode as k, toDisplayString as y, createCommentVNode as b } from "vue";
2
- import { L as l } from "./ui-BC6H9E93.js";
3
- const B = /* @__PURE__ */ s({
4
- name: "TLink",
5
- __name: "Link",
6
- props: {
7
- to: {},
8
- href: {},
9
- type: { default: l.Default },
10
- label: { default: "" },
11
- target: { default: "_self" },
12
- disabled: { type: Boolean, default: !1 }
13
- },
14
- setup(r, { emit: v }) {
15
- const e = r, t = d(() => {
16
- switch (e.type) {
17
- case l.Router:
18
- return "router-link";
19
- default:
20
- return "a";
21
- }
22
- });
23
- return (a, g) => {
24
- const i = c("t-icon");
25
- return o(), n(m(t.value), {
26
- href: t.value === "a" ? e.href : void 0,
27
- to: t.value === "router-link" ? e.to : void 0,
28
- disabled: e.disabled,
29
- target: e.target,
30
- class: "color-caipira-primary-inverted underline font-bold inline-flex items-baseline"
31
- }, {
32
- default: u(() => [
33
- a.$slots.default ? p(a.$slots, "default", { key: 0 }) : (o(), f(_, { key: 1 }, [
34
- k(y(e.label), 1)
35
- ], 64)),
36
- e.target === "_blank" ? (o(), n(i, {
37
- key: 2,
38
- size: 15,
39
- class: "ml-1",
40
- icon: "open-in-new"
41
- })) : b("", !0)
42
- ]),
43
- _: 3
44
- }, 8, ["href", "to", "disabled", "target"]);
45
- };
46
- }
47
- });
48
- export {
49
- B as _
50
- };
@@ -1,71 +0,0 @@
1
- import { defineComponent as y, resolveComponent as m, openBlock as o, createElementBlock as a, normalizeStyle as _, normalizeClass as p, createElementVNode as C, renderSlot as k, unref as l, toDisplayString as v, createBlock as u, withCtx as z, createVNode as g, createCommentVNode as h } from "vue";
2
- import { a as t } from "./ui-BC6H9E93.js";
3
- const B = ["role"], S = { class: "px-2" }, b = { key: 0 }, w = /* @__PURE__ */ y({
4
- name: "TTag",
5
- __name: "Tag",
6
- props: {
7
- text: { default: "" },
8
- size: { default: t.Default },
9
- role: { default: "" },
10
- color: { default: "" },
11
- confirmClose: { type: Boolean, default: !1 },
12
- hasCloseButton: { type: Boolean, default: !1 }
13
- },
14
- emits: ["close"],
15
- setup(f, { emit: d }) {
16
- const e = f, r = d;
17
- return (i, s) => {
18
- const c = m("t-button"), x = m("t-popconfirm");
19
- return o(), a("div", {
20
- style: _(`background-color:${e.color}`),
21
- class: p([{
22
- "bg-caipira-primary-inverted": !e.color
23
- }, "w-max inline-flex items-stretch rounded-sm select-none color-caipira-primary"]),
24
- role: e.role
25
- }, [
26
- C("div", S, [
27
- i.$slots.default ? k(i.$slots, "default", { key: 0 }) : (o(), a("span", {
28
- key: 1,
29
- class: p({
30
- "text-xs": e.size === l(t).ExtraSmall,
31
- "text-sm": e.size === l(t).Small,
32
- "text-base": e.size === l(t).Default,
33
- "text-lg": e.size === l(t).Large,
34
- "text-xl": e.size === l(t).ExtraLarge
35
- })
36
- }, v(e.text), 3))
37
- ]),
38
- e.hasCloseButton ? (o(), a("div", b, [
39
- e.confirmClose ? (o(), u(x, {
40
- key: 0,
41
- message: "Are you sure you want to remove it?",
42
- class: "h-full",
43
- onConfirm: s[0] || (s[0] = (n) => r("close"))
44
- }, {
45
- default: z(({ onTogglePopover: n }) => [
46
- g(c, {
47
- variant: "transparent",
48
- hover: !0,
49
- icon: "close",
50
- size: "",
51
- class: "px-1.5 h-full",
52
- onClick: n
53
- }, null, 8, ["onClick"])
54
- ]),
55
- _: 1
56
- })) : (o(), u(c, {
57
- key: 1,
58
- variant: "transparent",
59
- icon: "close",
60
- size: "sm",
61
- class: "px-1.5 h-full",
62
- onClick: s[1] || (s[1] = (n) => r("close"))
63
- }))
64
- ])) : h("", !0)
65
- ], 14, B);
66
- };
67
- }
68
- });
69
- export {
70
- w as _
71
- };
@@ -1,9 +0,0 @@
1
- import { InputPasswordModel } from '../components/InputPassword/types.js';
2
- import { InputPriceModel } from '../components/InputPrice/types.js';
3
- import { Country } from '../types/address.js';
4
-
5
- declare const formValueDateTransformer: (date: Date) => string;
6
- declare const formValuePriceTransformer: (price: InputPriceModel) => string[];
7
- declare const formValueCountryTransformer: (country?: Country) => string;
8
- declare const formValuePasswordTransformer: (password?: InputPasswordModel) => Promise<string>;
9
- export { formValueDateTransformer, formValuePriceTransformer, formValueCountryTransformer, formValuePasswordTransformer, };