@sysvale/citizen-components 1.16.1 → 1.17.1
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/citizen-components.cjs.js +1 -22
- package/dist/citizen-components.css +1 -1
- package/dist/citizen-components.es.js +9 -11629
- package/dist/citizenFormRules-BgfY4bvO.js +155 -0
- package/dist/citizenFormRules-BvZGQyOP.cjs +9 -0
- package/dist/index-DcIU_4m3.cjs +22 -0
- package/dist/index-aP_qhndV.js +11740 -0
- package/dist/types.d.ts +1 -0
- package/package.json +3 -3
- package/dist/citizenFormRules-BOHYigWv.js +0 -133
- package/dist/citizenFormRules-D5PFwkSX.cjs +0 -9
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sysvale/citizen-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"luxon": "^3.7.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@sysvale/cuida": "^3.
|
|
48
|
+
"@sysvale/cuida": "^3.154.7",
|
|
49
49
|
"@sysvale/foundry": "^1.7.0",
|
|
50
50
|
"vee-validate": "^4.15.1",
|
|
51
51
|
"vue": "^3.5.13"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@semantic-release/github": "^12.0.0",
|
|
58
58
|
"@semantic-release/npm": "^13.1.1",
|
|
59
59
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
60
|
-
"@sysvale/cuida": "^3.
|
|
60
|
+
"@sysvale/cuida": "^3.154.7",
|
|
61
61
|
"@sysvale/foundry": "^1.7.0",
|
|
62
62
|
"@tsconfig/node22": "^22.0.1",
|
|
63
63
|
"@types/jsdom": "^21.1.7",
|
|
@@ -1,133 +0,0 @@
|
|
|
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");
|
|
@@ -1,9 +0,0 @@
|
|
|
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");
|