@sysvale/citizen-components 1.10.0 → 1.11.0
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 +3 -0
- package/dist/citizen-components.cjs.js +17 -11
- package/dist/citizen-components.css +1 -1
- package/dist/citizen-components.es.js +9236 -2780
- package/dist/citizenFormRules-BOHYigWv.js +133 -0
- package/dist/citizenFormRules-D5PFwkSX.cjs +9 -0
- package/dist/index.d.ts +18 -0
- package/dist/services/citizen/citizen.types.d.ts +51 -10
- package/dist/types.d.ts +48 -0
- package/package.json +5 -2
- package/dist/citizenFormRules-CLFR0T1X.cjs +0 -1
- package/dist/citizenFormRules-CRqDhESI.js +0 -6
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { configure as N, defineRule as c } from "vee-validate";
|
|
2
|
+
import "vue";
|
|
3
|
+
import { cpfValidator as E, cnsValidator as P } from "@sysvale/foundry";
|
|
4
|
+
/**
|
|
5
|
+
* vee-validate v4.15.1
|
|
6
|
+
* (c) 2025 Abdelrahman Awad
|
|
7
|
+
* @license MIT
|
|
8
|
+
*/
|
|
9
|
+
function R(r, t) {
|
|
10
|
+
return Array.isArray(r) ? r[0] : r[t];
|
|
11
|
+
}
|
|
12
|
+
function y(r) {
|
|
13
|
+
return !!(r == null || r === "" || Array.isArray(r) && r.length === 0);
|
|
14
|
+
}
|
|
15
|
+
const h = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, S = (r) => y(r) ? !0 : Array.isArray(r) ? r.every((t) => h.test(String(t))) : h.test(String(r)), j = (r, t) => {
|
|
16
|
+
if (y(r))
|
|
17
|
+
return !0;
|
|
18
|
+
const e = R(t, "length");
|
|
19
|
+
return Array.isArray(r) ? r.every((n) => j(n, { length: e })) : [...String(r)].length >= Number(e);
|
|
20
|
+
};
|
|
21
|
+
function x(r) {
|
|
22
|
+
return r == null;
|
|
23
|
+
}
|
|
24
|
+
function D(r) {
|
|
25
|
+
return Array.isArray(r) && r.length === 0;
|
|
26
|
+
}
|
|
27
|
+
const $ = (r) => x(r) || D(r) || r === !1 ? !1 : !!String(r).trim().length;
|
|
28
|
+
/**
|
|
29
|
+
* vee-validate v4.15.1
|
|
30
|
+
* (c) 2025 Abdelrahman Awad
|
|
31
|
+
* @license MIT
|
|
32
|
+
*/
|
|
33
|
+
function p(r) {
|
|
34
|
+
return typeof r == "function";
|
|
35
|
+
}
|
|
36
|
+
function q(r) {
|
|
37
|
+
return typeof r == "object" && r !== null;
|
|
38
|
+
}
|
|
39
|
+
function V(r) {
|
|
40
|
+
return r == null ? r === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(r);
|
|
41
|
+
}
|
|
42
|
+
function O(r) {
|
|
43
|
+
if (!q(r) || V(r) !== "[object Object]")
|
|
44
|
+
return !1;
|
|
45
|
+
if (Object.getPrototypeOf(r) === null)
|
|
46
|
+
return !0;
|
|
47
|
+
let t = r;
|
|
48
|
+
for (; Object.getPrototypeOf(t) !== null; )
|
|
49
|
+
t = Object.getPrototypeOf(t);
|
|
50
|
+
return Object.getPrototypeOf(r) === t;
|
|
51
|
+
}
|
|
52
|
+
function v(r, t) {
|
|
53
|
+
return Object.keys(t).forEach((e) => {
|
|
54
|
+
if (O(t[e]) && O(r[e])) {
|
|
55
|
+
r[e] || (r[e] = {}), v(r[e], t[e]);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
r[e] = t[e];
|
|
59
|
+
}), r;
|
|
60
|
+
}
|
|
61
|
+
function _(r, t, e) {
|
|
62
|
+
const { prefix: n, suffix: i } = e, s = Z(n, i);
|
|
63
|
+
return r.replace(s, function(a, o, f) {
|
|
64
|
+
if (!o || !t.params)
|
|
65
|
+
return f in t ? t[f] : t.params && f in t.params ? t.params[f] : `${n}${f}${i}`;
|
|
66
|
+
if (!Array.isArray(t.params))
|
|
67
|
+
return f in t.params ? t.params[f] : `${n}${f}${i}`;
|
|
68
|
+
const u = Number(o.replace(":", ""));
|
|
69
|
+
return u in t.params ? t.params[u] : `${o}${n}${f}${i}`;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function A(r) {
|
|
73
|
+
return r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
74
|
+
}
|
|
75
|
+
function Z(r, t) {
|
|
76
|
+
const e = A(r), n = A(t);
|
|
77
|
+
return new RegExp(`([0-9]:)?${e}((?:(?!${n}).)+)${n}`, "g");
|
|
78
|
+
}
|
|
79
|
+
class w {
|
|
80
|
+
constructor(t, e, n = { prefix: "{", suffix: "}" }) {
|
|
81
|
+
this.container = {}, this.locale = t, this.interpolateOptions = n, this.merge(e);
|
|
82
|
+
}
|
|
83
|
+
resolve(t, e) {
|
|
84
|
+
let n = this.format(this.locale, t, e);
|
|
85
|
+
return !n && this.fallbackLocale && this.fallbackLocale !== this.locale && (n = this.format(this.fallbackLocale, t, e)), n || this.getDefaultMessage(this.locale, t);
|
|
86
|
+
}
|
|
87
|
+
getDefaultMessage(t, e) {
|
|
88
|
+
const { label: n, name: i } = e;
|
|
89
|
+
return `${this.resolveLabel(t, i, n)} is not valid`;
|
|
90
|
+
}
|
|
91
|
+
getLocaleDefault(t, e) {
|
|
92
|
+
var n, i, s, a, o;
|
|
93
|
+
return ((s = (i = (n = this.container[t]) === null || n === void 0 ? void 0 : n.fields) === null || i === void 0 ? void 0 : i[e]) === null || s === void 0 ? void 0 : s._default) || ((o = (a = this.container[t]) === null || a === void 0 ? void 0 : a.messages) === null || o === void 0 ? void 0 : o._default);
|
|
94
|
+
}
|
|
95
|
+
resolveLabel(t, e, n) {
|
|
96
|
+
var i, s, a, o;
|
|
97
|
+
return n ? ((s = (i = this.container[t]) === null || i === void 0 ? void 0 : i.names) === null || s === void 0 ? void 0 : s[n]) || n : ((o = (a = this.container[t]) === null || a === void 0 ? void 0 : a.names) === null || o === void 0 ? void 0 : o[e]) || e;
|
|
98
|
+
}
|
|
99
|
+
format(t, e, n) {
|
|
100
|
+
var i, s, a, o, f;
|
|
101
|
+
let u;
|
|
102
|
+
const { rule: l, form: g, label: L, name: d } = e, b = this.resolveLabel(t, d, L);
|
|
103
|
+
return l ? (u = ((a = (s = (i = this.container[t]) === null || i === void 0 ? void 0 : i.fields) === null || s === void 0 ? void 0 : s[d]) === null || a === void 0 ? void 0 : a[l.name]) || ((f = (o = this.container[t]) === null || o === void 0 ? void 0 : o.messages) === null || f === void 0 ? void 0 : f[l.name]), u || (u = this.getLocaleDefault(t, d) || ""), p(u) ? u(e) : _(u, Object.assign(Object.assign({}, g), { field: b, params: l.params }), n ?? this.interpolateOptions)) : (u = this.getLocaleDefault(t, d) || "", p(u) ? u(e) : _(u, Object.assign(Object.assign({}, g), { field: b }), n ?? this.interpolateOptions));
|
|
104
|
+
}
|
|
105
|
+
merge(t) {
|
|
106
|
+
v(this.container, t);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const m = new w("en", {});
|
|
110
|
+
function C(r, t, e) {
|
|
111
|
+
const n = (i) => m.resolve(i, e);
|
|
112
|
+
return m.locale = r, t && m.merge({ [r]: t }), n;
|
|
113
|
+
}
|
|
114
|
+
function I(r) {
|
|
115
|
+
m.locale = r;
|
|
116
|
+
}
|
|
117
|
+
const M = (r, t) => t[0] ? !0 : $(r);
|
|
118
|
+
I("pt-BR");
|
|
119
|
+
N({
|
|
120
|
+
generateMessage: C("pt-BR", {
|
|
121
|
+
messages: {
|
|
122
|
+
required: "Este campo é obrigatório",
|
|
123
|
+
email: "O e-mail é inválido",
|
|
124
|
+
min: "O campo deve ter no mínimo 0:{min} caracteres"
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
});
|
|
128
|
+
c("required", $);
|
|
129
|
+
c("min", j);
|
|
130
|
+
c("email", S);
|
|
131
|
+
c("required_without", (r, t) => M(r, t) ? !0 : "Este campo é obrigatório");
|
|
132
|
+
c("cpf", (r) => E(r ?? "") ? !0 : "O CPF é inválido");
|
|
133
|
+
c("cns", (r) => !r || r === "" || P(r ?? "") ? !0 : "O CNS é inválido");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";const c=require("vee-validate");require("vue");const A=require("@sysvale/foundry");/**
|
|
2
|
+
* vee-validate v4.15.1
|
|
3
|
+
* (c) 2025 Abdelrahman Awad
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/function N(e,r){return Array.isArray(e)?e[0]:e[r]}function j(e){return!!(e==null||e===""||Array.isArray(e)&&e.length===0)}const h=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,q=e=>j(e)?!0:Array.isArray(e)?e.every(r=>h.test(String(r))):h.test(String(e)),$=(e,r)=>{if(j(e))return!0;const t=N(r,"length");return Array.isArray(e)?e.every(n=>$(n,{length:t})):[...String(e)].length>=Number(t)};function E(e){return e==null}function P(e){return Array.isArray(e)&&e.length===0}const v=e=>E(e)||P(e)||e===!1?!1:!!String(e).trim().length;/**
|
|
6
|
+
* vee-validate v4.15.1
|
|
7
|
+
* (c) 2025 Abdelrahman Awad
|
|
8
|
+
* @license MIT
|
|
9
|
+
*/function p(e){return typeof e=="function"}function S(e){return typeof e=="object"&&e!==null}function x(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function O(e){if(!S(e)||x(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function R(e,r){return Object.keys(r).forEach(t=>{if(O(r[t])&&O(e[t])){e[t]||(e[t]={}),R(e[t],r[t]);return}e[t]=r[t]}),e}function _(e,r,t){const{prefix:n,suffix:i}=t,o=D(n,i);return e.replace(o,function(a,s,f){if(!s||!r.params)return f in r?r[f]:r.params&&f in r.params?r.params[f]:`${n}${f}${i}`;if(!Array.isArray(r.params))return f in r.params?r.params[f]:`${n}${f}${i}`;const u=Number(s.replace(":",""));return u in r.params?r.params[u]:`${s}${n}${f}${i}`})}function y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function D(e,r){const t=y(e),n=y(r);return new RegExp(`([0-9]:)?${t}((?:(?!${n}).)+)${n}`,"g")}class V{constructor(r,t,n={prefix:"{",suffix:"}"}){this.container={},this.locale=r,this.interpolateOptions=n,this.merge(t)}resolve(r,t){let n=this.format(this.locale,r,t);return!n&&this.fallbackLocale&&this.fallbackLocale!==this.locale&&(n=this.format(this.fallbackLocale,r,t)),n||this.getDefaultMessage(this.locale,r)}getDefaultMessage(r,t){const{label:n,name:i}=t;return`${this.resolveLabel(r,i,n)} is not valid`}getLocaleDefault(r,t){var n,i,o,a,s;return((o=(i=(n=this.container[r])===null||n===void 0?void 0:n.fields)===null||i===void 0?void 0:i[t])===null||o===void 0?void 0:o._default)||((s=(a=this.container[r])===null||a===void 0?void 0:a.messages)===null||s===void 0?void 0:s._default)}resolveLabel(r,t,n){var i,o,a,s;return n?((o=(i=this.container[r])===null||i===void 0?void 0:i.names)===null||o===void 0?void 0:o[n])||n:((s=(a=this.container[r])===null||a===void 0?void 0:a.names)===null||s===void 0?void 0:s[t])||t}format(r,t,n){var i,o,a,s,f;let u;const{rule:l,form:g,label:L,name:d}=t,b=this.resolveLabel(r,d,L);return l?(u=((a=(o=(i=this.container[r])===null||i===void 0?void 0:i.fields)===null||o===void 0?void 0:o[d])===null||a===void 0?void 0:a[l.name])||((f=(s=this.container[r])===null||s===void 0?void 0:s.messages)===null||f===void 0?void 0:f[l.name]),u||(u=this.getLocaleDefault(r,d)||""),p(u)?u(t):_(u,Object.assign(Object.assign({},g),{field:b,params:l.params}),n??this.interpolateOptions)):(u=this.getLocaleDefault(r,d)||"",p(u)?u(t):_(u,Object.assign(Object.assign({},g),{field:b}),n??this.interpolateOptions))}merge(r){R(this.container,r)}}const m=new V("en",{});function Z(e,r,t){const n=i=>m.resolve(i,t);return m.locale=e,r&&m.merge({[e]:r}),n}function w(e){m.locale=e}const C=(e,r)=>r[0]?!0:v(e);w("pt-BR");c.configure({generateMessage:Z("pt-BR",{messages:{required:"Este campo é obrigatório",email:"O e-mail é inválido",min:"O campo deve ter no mínimo 0:{min} caracteres"}})});c.defineRule("required",v);c.defineRule("min",$);c.defineRule("email",q);c.defineRule("required_without",(e,r)=>C(e,r)?!0:"Este campo é obrigatório");c.defineRule("cpf",e=>A.cpfValidator(e??"")?!0:"O CPF é inválido");c.defineRule("cns",e=>!e||e===""||A.cnsValidator(e??"")?!0:"O CNS é inválido");
|
package/dist/index.d.ts
CHANGED
|
@@ -37,10 +37,28 @@ export interface CreateCitizenSidesheetProps {
|
|
|
37
37
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
export interface EditCitizenSidesheetProps {
|
|
41
|
+
okButtonText?: string;
|
|
42
|
+
cancelButtonText?: string;
|
|
43
|
+
actionButtonVariant?: string;
|
|
44
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
45
|
+
citizen: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface CitizenSummaryViewerProps {
|
|
49
|
+
citizen: Partial<Citizen>,
|
|
50
|
+
fluid?: boolean,
|
|
51
|
+
hideEditButton?: boolean,
|
|
52
|
+
hideCloseButton?: boolean,
|
|
53
|
+
hideActions?: boolean,
|
|
54
|
+
}
|
|
55
|
+
|
|
40
56
|
// Export components
|
|
41
57
|
export declare const CitizenSelect: DefineComponent<CitizenSelectProps>;
|
|
42
58
|
export declare const CitizenTable: DefineComponent<CitizenTableProps>;
|
|
43
59
|
export declare const CreateCitizenSidesheet: DefineComponent<CreateCitizenSidesheetProps>;
|
|
60
|
+
export declare const EditCitizenSidesheet: DefineComponent<EditCitizenSidesheetProps>;
|
|
61
|
+
export declare const CitizenSummaryViewer: DefineComponent<CitizenSummaryViewerProps>;
|
|
44
62
|
|
|
45
63
|
// Export plugin
|
|
46
64
|
export declare const CitizenComponentsPlugin: Plugin;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Address } from '../../types';
|
|
1
2
|
export type Nullable<T> = T | null;
|
|
2
3
|
export interface CitizenResponse {
|
|
3
4
|
data: Citizen[];
|
|
@@ -11,6 +12,9 @@ export interface CitizenResponse {
|
|
|
11
12
|
to?: number;
|
|
12
13
|
};
|
|
13
14
|
}
|
|
15
|
+
export interface ReadCitizenResponse {
|
|
16
|
+
data: Citizen[];
|
|
17
|
+
}
|
|
14
18
|
export interface CitizenServiceParams {
|
|
15
19
|
page: number;
|
|
16
20
|
fields?: string[];
|
|
@@ -23,21 +27,13 @@ export interface Citizen {
|
|
|
23
27
|
cns: string;
|
|
24
28
|
name: string;
|
|
25
29
|
gender: string;
|
|
26
|
-
cpf_responsible
|
|
30
|
+
cpf_responsible?: Nullable<string>;
|
|
27
31
|
mother_name: string;
|
|
28
32
|
birth_date: string;
|
|
29
33
|
phone: Nullable<string>;
|
|
30
34
|
cellphone: Nullable<string>;
|
|
31
35
|
email: Nullable<string>;
|
|
32
|
-
address:
|
|
33
|
-
cep: Nullable<string>;
|
|
34
|
-
street: Nullable<string>;
|
|
35
|
-
number: Nullable<string>;
|
|
36
|
-
complement: Nullable<string>;
|
|
37
|
-
neighborhood: Nullable<string>;
|
|
38
|
-
city: Nullable<string>;
|
|
39
|
-
uf: Nullable<string>;
|
|
40
|
-
};
|
|
36
|
+
address: Address;
|
|
41
37
|
race: string;
|
|
42
38
|
co_cidadao: number;
|
|
43
39
|
is_dead: boolean;
|
|
@@ -45,15 +41,60 @@ export interface Citizen {
|
|
|
45
41
|
identification_document?: Nullable<string>;
|
|
46
42
|
issuing_agency?: Nullable<string>;
|
|
47
43
|
}
|
|
44
|
+
export interface CitizenParams {
|
|
45
|
+
id?: string;
|
|
46
|
+
name: string;
|
|
47
|
+
birth_date: string;
|
|
48
|
+
cpf: string;
|
|
49
|
+
cns: string;
|
|
50
|
+
gender: string;
|
|
51
|
+
identification_document?: string;
|
|
52
|
+
issuing_agency?: string;
|
|
53
|
+
mother_name?: string;
|
|
54
|
+
pregnant?: boolean;
|
|
55
|
+
cpf_responsible?: string;
|
|
56
|
+
address: Address;
|
|
57
|
+
phone: string;
|
|
58
|
+
cellphone?: string;
|
|
59
|
+
email: string;
|
|
60
|
+
race?: string;
|
|
61
|
+
}
|
|
48
62
|
export interface CreateCitizenParams {
|
|
49
63
|
name: string;
|
|
50
64
|
birth_date: string;
|
|
51
65
|
cpf: string;
|
|
52
66
|
cns: string;
|
|
53
67
|
gender: string;
|
|
68
|
+
identification_document?: string;
|
|
69
|
+
issuing_agency?: string;
|
|
70
|
+
pregnant?: boolean;
|
|
71
|
+
cpf_responsible?: string;
|
|
72
|
+
address: Address;
|
|
73
|
+
phone: string;
|
|
74
|
+
cellphone?: string;
|
|
75
|
+
email: string;
|
|
76
|
+
race?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface UpdateCitizenParams {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
birth_date: string;
|
|
82
|
+
cpf: string;
|
|
83
|
+
cns: string;
|
|
84
|
+
gender: string;
|
|
85
|
+
identification_document?: string;
|
|
86
|
+
pregnant?: boolean;
|
|
87
|
+
cpf_responsible?: string;
|
|
88
|
+
address: Address;
|
|
89
|
+
phone: string;
|
|
90
|
+
email: string;
|
|
91
|
+
race?: string;
|
|
54
92
|
}
|
|
55
93
|
export interface CreateCitizenResponse {
|
|
56
94
|
data: {
|
|
57
95
|
citizen: Citizen;
|
|
58
96
|
};
|
|
59
97
|
}
|
|
98
|
+
export interface ReadCitizenParams {
|
|
99
|
+
search_string: string;
|
|
100
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -5,6 +5,19 @@ export interface TableField {
|
|
|
5
5
|
key: keyof Citizen | 'actions';
|
|
6
6
|
label: string;
|
|
7
7
|
}
|
|
8
|
+
export interface CitizenFormField {
|
|
9
|
+
name: keyof Citizen | keyof Address;
|
|
10
|
+
label: string;
|
|
11
|
+
rules: string;
|
|
12
|
+
colSpan: number;
|
|
13
|
+
component: string | object;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
mask?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
options?: any[];
|
|
18
|
+
maxDate?: string;
|
|
19
|
+
optionsField?: string;
|
|
20
|
+
}
|
|
8
21
|
export interface CustomTableField extends TableField {
|
|
9
22
|
visible: boolean;
|
|
10
23
|
}
|
|
@@ -12,3 +25,38 @@ export interface Gender {
|
|
|
12
25
|
name: 'Masculino' | 'Feminino';
|
|
13
26
|
value: 'M' | 'F';
|
|
14
27
|
}
|
|
28
|
+
export type Race = {
|
|
29
|
+
name: 'Branca';
|
|
30
|
+
value: 'white';
|
|
31
|
+
} | {
|
|
32
|
+
name: 'Preta';
|
|
33
|
+
value: 'black';
|
|
34
|
+
} | {
|
|
35
|
+
name: 'Parda';
|
|
36
|
+
value: 'mixed';
|
|
37
|
+
} | {
|
|
38
|
+
name: 'Amarela';
|
|
39
|
+
value: 'asian';
|
|
40
|
+
} | {
|
|
41
|
+
name: 'Indígena';
|
|
42
|
+
value: 'indigenous';
|
|
43
|
+
};
|
|
44
|
+
export interface Address {
|
|
45
|
+
street?: string;
|
|
46
|
+
number?: string;
|
|
47
|
+
complement?: string;
|
|
48
|
+
neighborhood?: string;
|
|
49
|
+
city?: {
|
|
50
|
+
id: string;
|
|
51
|
+
value: string;
|
|
52
|
+
};
|
|
53
|
+
uf?: {
|
|
54
|
+
ibgeCode: number | string;
|
|
55
|
+
name: string;
|
|
56
|
+
shortName: string;
|
|
57
|
+
id: string;
|
|
58
|
+
};
|
|
59
|
+
asFormData?: any;
|
|
60
|
+
asRequestPayload?: any;
|
|
61
|
+
fancyAddress: string;
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sysvale/citizen-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,8 +38,11 @@
|
|
|
38
38
|
"semantic-release:test": "semantic-release --dry-run --no-ci"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
+
"@vee-validate/i18n": "^4.15.1",
|
|
42
|
+
"@vee-validate/rules": "^4.15.1",
|
|
41
43
|
"@vueuse/core": "^13.9.0",
|
|
42
|
-
"lodash": "^4.17.21"
|
|
44
|
+
"lodash": "^4.17.21",
|
|
45
|
+
"luxon": "^3.7.2"
|
|
43
46
|
},
|
|
44
47
|
"peerDependencies": {
|
|
45
48
|
"@sysvale/cuida": "^3.151.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("vee-validate"),t=require("@sysvale/foundry");n.defineRule("required",e=>e?!0:"Esse campo é obrigatório");n.defineRule("minLength",(e,[r])=>!e||!e.length?!0:e.length<r?`O campo deve ter no mínimo ${r} caracteres`:!0);n.defineRule("cpf",e=>t.cpfValidator(e)?!0:"O CPF é inválido");n.defineRule("cns",e=>t.cnsValidator(e)?!0:"O CNS é inválido");
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { defineRule as t } from "vee-validate";
|
|
2
|
-
import { cpfValidator as n, cnsValidator as i } from "@sysvale/foundry";
|
|
3
|
-
t("required", (r) => r ? !0 : "Esse campo é obrigatório");
|
|
4
|
-
t("minLength", (r, [e]) => !r || !r.length ? !0 : r.length < e ? `O campo deve ter no mínimo ${e} caracteres` : !0);
|
|
5
|
-
t("cpf", (r) => n(r) ? !0 : "O CPF é inválido");
|
|
6
|
-
t("cns", (r) => i(r) ? !0 : "O CNS é inválido");
|