@seedgrid/fe-components 2026.10.1 → 2026.10.3
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/ai/seedgrid-components.manifest.json +71 -24
- package/dist/buttons/SgFloatActionButton.meta.js +2 -2
- package/dist/buttons/SgSplitButton.meta.js +1 -1
- package/dist/gadgets/string-animator/SgStringAnimator.meta.js +2 -2
- package/dist/generated/compiledStyles.d.ts +1 -1
- package/dist/generated/compiledStyles.d.ts.map +1 -1
- package/dist/generated/compiledStyles.js +1 -1
- package/dist/i18n/es.js +63 -63
- package/dist/i18n/fr.js +49 -49
- package/dist/i18n/pt-BR.js +9 -9
- package/dist/i18n/pt-PT.js +9 -9
- package/dist/inputs/SgDatatable.meta.js +2 -2
- package/dist/inputs/SgInputCNPJ.d.ts.map +1 -1
- package/dist/inputs/SgInputCNPJ.js +1 -6
- package/dist/inputs/SgInputCPFCNPJ.d.ts +10 -0
- package/dist/inputs/SgInputCPFCNPJ.d.ts.map +1 -1
- package/dist/inputs/SgInputCPFCNPJ.js +55 -2
- package/dist/inputs/SgInputCPFCNPJ.meta.d.ts.map +1 -1
- package/dist/inputs/SgInputCPFCNPJ.meta.js +11 -0
- package/dist/inputs/SgInputCurrency.meta.js +1 -1
- package/dist/inputs/SgInputDate.meta.js +1 -1
- package/dist/inputs/SgInputNumber.meta.js +1 -1
- package/dist/inputs/SgInputPassword.d.ts.map +1 -1
- package/dist/inputs/SgInputPassword.js +6 -0
- package/dist/inputs/SgPickList.meta.js +1 -1
- package/dist/inputs/SgRating.meta.js +2 -2
- package/dist/inputs/SgTextEditor.meta.js +2 -2
- package/dist/inputs/publicaCnpj.d.ts +3 -0
- package/dist/inputs/publicaCnpj.d.ts.map +1 -0
- package/dist/inputs/publicaCnpj.js +7 -0
- package/dist/layout/SgAccordion.meta.js +2 -2
- package/dist/layout/SgCard.meta.js +1 -1
- package/dist/layout/SgMenu.meta.js +1 -1
- package/dist/layout/SgPageControl.meta.js +1 -1
- package/dist/layout/SgPanel.meta.js +2 -2
- package/dist/overlay/SgDialog.d.ts.map +1 -1
- package/dist/overlay/SgDialog.js +15 -11
- package/dist/sandbox.cjs +47 -47
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/i18n/fr.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
const fr = {
|
|
2
2
|
"components.actions.clear": "Effacer",
|
|
3
3
|
"components.wizard.next": "Suivant",
|
|
4
|
-
"components.wizard.previous": "
|
|
4
|
+
"components.wizard.previous": "Précédent",
|
|
5
5
|
"components.wizard.finish": "Terminer",
|
|
6
6
|
"components.password.show": "Afficher le mot de passe",
|
|
7
7
|
"components.password.hide": "Masquer le mot de passe",
|
|
8
|
-
"components.password.generate": "
|
|
8
|
+
"components.password.generate": "Générer un mot de passe",
|
|
9
9
|
"components.password.common": "Le mot de passe est trop courant. Choisissez-en un plus fort.",
|
|
10
|
-
"components.password.minSize": "Minimum de {min}
|
|
10
|
+
"components.password.minSize": "Minimum de {min} caractères.",
|
|
11
11
|
"components.password.upper": "Au moins 1 lettre majuscule.",
|
|
12
12
|
"components.password.lower": "Au moins 1 lettre minuscule.",
|
|
13
13
|
"components.password.number": "Au moins 1 chiffre.",
|
|
14
|
-
"components.password.special": "Au moins 1
|
|
15
|
-
"components.password.noRepeat": "Ne
|
|
16
|
-
"components.password.noSeqAsc": "N'utilisez pas de
|
|
17
|
-
"components.password.noSeqDesc": "N'utilisez pas de
|
|
14
|
+
"components.password.special": "Au moins 1 caractère spécial.",
|
|
15
|
+
"components.password.noRepeat": "Ne répétez pas des caractères en séquence.",
|
|
16
|
+
"components.password.noSeqAsc": "N'utilisez pas de séquences ascendantes (ex. 1234, abcd).",
|
|
17
|
+
"components.password.noSeqDesc": "N'utilisez pas de séquences descendantes (ex. 4321, dcba).",
|
|
18
18
|
"components.inputs.required": "Champ obligatoire.",
|
|
19
|
-
"components.inputs.maxLength": "Le champ doit contenir au maximum {max}
|
|
20
|
-
"components.inputs.minLength": "Le champ doit contenir au moins {min}
|
|
19
|
+
"components.inputs.maxLength": "Le champ doit contenir au maximum {max} caractère(s).",
|
|
20
|
+
"components.inputs.minLength": "Le champ doit contenir au moins {min} caractère(s).",
|
|
21
21
|
"components.inputs.minWords": "Le champ doit contenir au moins {min} mot(s).",
|
|
22
22
|
"components.inputs.textarea.required": "Ce champ est obligatoire.",
|
|
23
|
-
"components.inputs.textarea.maxLength": "Le texte doit contenir au maximum {max}
|
|
24
|
-
"components.inputs.textarea.minLength": "Le texte doit contenir au moins {min}
|
|
23
|
+
"components.inputs.textarea.maxLength": "Le texte doit contenir au maximum {max} caractère(s).",
|
|
24
|
+
"components.inputs.textarea.minLength": "Le texte doit contenir au moins {min} caractère(s).",
|
|
25
25
|
"components.inputs.textarea.minWords": "Le texte doit contenir au moins {min} mot(s).",
|
|
26
26
|
"components.inputs.textarea.minLines": "Le texte doit contenir au moins {min} ligne(s).",
|
|
27
27
|
"components.inputs.cpf.length": "Le CPF doit contenir 11 chiffres.",
|
|
@@ -38,67 +38,67 @@ const fr = {
|
|
|
38
38
|
"components.inputs.postalCode.ES.invalid": "Code postal invalide.",
|
|
39
39
|
"components.inputs.postalCode.UY.length": "Le code postal doit contenir 5 chiffres.",
|
|
40
40
|
"components.inputs.postalCode.UY.invalid": "Code postal invalide.",
|
|
41
|
-
"components.inputs.postalCode.AR.length": "Le code postal doit contenir 4 ou 8
|
|
41
|
+
"components.inputs.postalCode.AR.length": "Le code postal doit contenir 4 ou 8 caractères.",
|
|
42
42
|
"components.inputs.postalCode.AR.invalid": "Code postal invalide.",
|
|
43
43
|
"components.inputs.postalCode.PY.length": "Le code postal doit contenir 6 chiffres.",
|
|
44
44
|
"components.inputs.postalCode.PY.invalid": "Code postal invalide.",
|
|
45
|
-
"components.inputs.phone.invalid": "
|
|
45
|
+
"components.inputs.phone.invalid": "Numéro de téléphone invalide.",
|
|
46
46
|
"components.inputs.email.invalid": "Email invalide.",
|
|
47
|
-
"components.inputs.otp.slot": "Code
|
|
48
|
-
"components.inputs.otp.group": "Code
|
|
47
|
+
"components.inputs.otp.slot": "Code à usage unique {slot}",
|
|
48
|
+
"components.inputs.otp.group": "Code à usage unique",
|
|
49
49
|
"components.inputs.toggle.ariaLabel": "Basculer option",
|
|
50
|
-
"components.inputs.email.tempInvalid": "Les emails temporaires ne sont pas
|
|
50
|
+
"components.inputs.email.tempInvalid": "Les emails temporaires ne sont pas autorisés.",
|
|
51
51
|
"components.inputs.date.invalid": "Date invalide.",
|
|
52
|
-
"components.inputs.date.range": "La date doit
|
|
53
|
-
"components.inputs.date.min": "La date doit
|
|
54
|
-
"components.inputs.date.max": "La date doit
|
|
52
|
+
"components.inputs.date.range": "La date doit être comprise entre {min} et {max}.",
|
|
53
|
+
"components.inputs.date.min": "La date doit être le {min} ou après.",
|
|
54
|
+
"components.inputs.date.max": "La date doit être le {max} ou avant.",
|
|
55
55
|
"components.inputs.birthdate.required": "Veuillez renseigner votre date de naissance.",
|
|
56
|
-
"components.validators.password.empty": "Le mot de passe ne peut pas
|
|
57
|
-
"components.validators.password.minSize": "minimum de {min}
|
|
56
|
+
"components.validators.password.empty": "Le mot de passe ne peut pas être vide.",
|
|
57
|
+
"components.validators.password.minSize": "minimum de {min} caractères",
|
|
58
58
|
"components.validators.password.upper": "doit inclure une lettre majuscule",
|
|
59
59
|
"components.validators.password.lower": "doit inclure une lettre minuscule",
|
|
60
60
|
"components.validators.password.number": "doit inclure un chiffre",
|
|
61
|
-
"components.validators.password.special": "doit inclure un
|
|
62
|
-
"components.validators.password.sequence": "ne peut pas contenir de
|
|
63
|
-
"components.validators.password.repeated": "ne peut pas contenir de
|
|
61
|
+
"components.validators.password.special": "doit inclure un caractère spécial",
|
|
62
|
+
"components.validators.password.sequence": "ne peut pas contenir de séquences (ex. abc, 123)",
|
|
63
|
+
"components.validators.password.repeated": "ne peut pas contenir de caractères répétés en séquence (ex. aaa, 1111)",
|
|
64
64
|
"components.validators.password.invalid": "Mot de passe invalide : {reasons}",
|
|
65
65
|
"components.validators.birthdate.configMissing": "Configuration invalide : fournissez minAge et/ou maxAge.",
|
|
66
|
-
"components.validators.birthdate.configRange": "Configuration invalide : minAge doit
|
|
66
|
+
"components.validators.birthdate.configRange": "Configuration invalide : minAge doit être <= maxAge.",
|
|
67
67
|
"components.validators.birthdate.invalidDate": "Date invalide.",
|
|
68
|
-
"components.validators.birthdate.ageBetween": "L'
|
|
69
|
-
"components.validators.birthdate.ageMin": "L'
|
|
70
|
-
"components.validators.birthdate.ageMax": "L'
|
|
71
|
-
"components.autocomplete.empty": "Aucun enregistrement trouv
|
|
68
|
+
"components.validators.birthdate.ageBetween": "L'âge doit être compris entre {min} et {max} ans.",
|
|
69
|
+
"components.validators.birthdate.ageMin": "L'âge doit être d'au moins {min} ans.",
|
|
70
|
+
"components.validators.birthdate.ageMax": "L'âge doit être d'au plus {max} ans.",
|
|
71
|
+
"components.autocomplete.empty": "Aucun enregistrement trouvé.",
|
|
72
72
|
"components.autocomplete.loading": "Chargement...",
|
|
73
|
-
"components.inputs.number.min": "La valeur doit
|
|
74
|
-
"components.inputs.number.max": "La valeur doit
|
|
75
|
-
"components.fab.resetConfirm": "
|
|
76
|
-
"components.fab.resetPosition": "
|
|
73
|
+
"components.inputs.number.min": "La valeur doit être au moins {min}.",
|
|
74
|
+
"components.inputs.number.max": "La valeur doit être au plus {max}.",
|
|
75
|
+
"components.fab.resetConfirm": "Réinitialiser la position du bouton ?",
|
|
76
|
+
"components.fab.resetPosition": "Réinitialiser la position",
|
|
77
77
|
"components.fab.yes": "Oui",
|
|
78
78
|
"components.fab.no": "Non",
|
|
79
|
-
"components.dock.resetPosition": "
|
|
80
|
-
"components.dock.resetConfirm": "Voulez-vous vraiment
|
|
81
|
-
"components.dock.dropHere": "
|
|
79
|
+
"components.dock.resetPosition": "Réinitialiser la position",
|
|
80
|
+
"components.dock.resetConfirm": "Voulez-vous vraiment réinitialiser la position du dock par défaut ?",
|
|
81
|
+
"components.dock.dropHere": "Déposer ici",
|
|
82
82
|
"components.actions.cancel": "Annuler",
|
|
83
83
|
"components.actions.confirm": "Confirmer",
|
|
84
84
|
"components.rating.required": "Veuillez fournir une note",
|
|
85
85
|
"components.rating.cancel": "Annuler la note",
|
|
86
86
|
"components.radiogroup.cancel": "Aucune option",
|
|
87
|
-
"components.checkboxgroup.checkAll": "Tout
|
|
88
|
-
"components.orderlist.moveTop": "
|
|
89
|
-
"components.orderlist.moveUp": "
|
|
90
|
-
"components.orderlist.moveDown": "
|
|
91
|
-
"components.orderlist.moveBottom": "
|
|
92
|
-
"components.orderlist.empty": "Aucun
|
|
93
|
-
"components.picklist.moveToTarget": "
|
|
94
|
-
"components.picklist.moveAllToTarget": "Tout
|
|
95
|
-
"components.picklist.moveToSource": "
|
|
96
|
-
"components.picklist.moveAllToSource": "Tout
|
|
87
|
+
"components.checkboxgroup.checkAll": "Tout sélectionner",
|
|
88
|
+
"components.orderlist.moveTop": "Déplacer en haut",
|
|
89
|
+
"components.orderlist.moveUp": "Déplacer vers le haut",
|
|
90
|
+
"components.orderlist.moveDown": "Déplacer vers le bas",
|
|
91
|
+
"components.orderlist.moveBottom": "Déplacer en bas",
|
|
92
|
+
"components.orderlist.empty": "Aucun élément disponible.",
|
|
93
|
+
"components.picklist.moveToTarget": "Déplacer la sélection vers la cible",
|
|
94
|
+
"components.picklist.moveAllToTarget": "Tout déplacer vers la cible",
|
|
95
|
+
"components.picklist.moveToSource": "Déplacer la sélection vers la source",
|
|
96
|
+
"components.picklist.moveAllToSource": "Tout déplacer vers la source",
|
|
97
97
|
"components.picklist.sourceHeader": "Source",
|
|
98
98
|
"components.picklist.targetHeader": "Cible",
|
|
99
99
|
"components.picklist.sourceFilterPlaceholder": "Rechercher dans la source",
|
|
100
100
|
"components.picklist.targetFilterPlaceholder": "Rechercher dans la cible",
|
|
101
|
-
"components.picklist.empty": "Aucun
|
|
101
|
+
"components.picklist.empty": "Aucun élément disponible.",
|
|
102
102
|
"components.gadgets.clock.title": "Horloge",
|
|
103
103
|
"components.gadgets.calendar.title": "Calendrier",
|
|
104
104
|
"components.gadgets.calendar.previousMonth": "Mois precedent",
|
|
@@ -108,8 +108,8 @@ const fr = {
|
|
|
108
108
|
"components.gadgets.gauge.radialAria": "Jauge radiale",
|
|
109
109
|
"components.gadgets.gauge.linearAria": "Jauge lineaire",
|
|
110
110
|
"components.gadgets.gauge.value": "Valeur",
|
|
111
|
-
"components.datatable.empty": "Aucun enregistrement trouv
|
|
112
|
-
"components.datatable.loading": "Chargement des
|
|
111
|
+
"components.datatable.empty": "Aucun enregistrement trouvé.",
|
|
112
|
+
"components.datatable.loading": "Chargement des données...",
|
|
113
113
|
"components.datatable.globalFilterPlaceholder": "Rechercher dans toutes les colonnes",
|
|
114
114
|
"components.datatable.clearFilters": "Effacer les filtres",
|
|
115
115
|
"components.datatable.pagination": "Pagination",
|
package/dist/i18n/pt-BR.js
CHANGED
|
@@ -44,9 +44,9 @@ const ptBR = {
|
|
|
44
44
|
"components.inputs.postalCode.PY.invalid": "Código postal inválido.",
|
|
45
45
|
"components.inputs.phone.invalid": "Telefone inválido.",
|
|
46
46
|
"components.inputs.email.invalid": "Email inválido.",
|
|
47
|
-
"components.inputs.otp.slot": "
|
|
48
|
-
"components.inputs.otp.group": "
|
|
49
|
-
"components.inputs.toggle.ariaLabel": "Alternar
|
|
47
|
+
"components.inputs.otp.slot": "Código único {slot}",
|
|
48
|
+
"components.inputs.otp.group": "Código único",
|
|
49
|
+
"components.inputs.toggle.ariaLabel": "Alternar opção",
|
|
50
50
|
"components.inputs.email.tempInvalid": "Email temporário inválido.",
|
|
51
51
|
"components.inputs.date.invalid": "Data inválida.",
|
|
52
52
|
"components.inputs.date.range": "Data deve estar entre {min} e {max}.",
|
|
@@ -101,10 +101,10 @@ const ptBR = {
|
|
|
101
101
|
"components.picklist.empty": "Nenhum item disponivel.",
|
|
102
102
|
"components.gadgets.clock.title": "Rel\u00f3gio",
|
|
103
103
|
"components.gadgets.calendar.title": "Calend\u00e1rio",
|
|
104
|
-
"components.gadgets.calendar.previousMonth": "
|
|
105
|
-
"components.gadgets.calendar.nextMonth": "
|
|
104
|
+
"components.gadgets.calendar.previousMonth": "Mês anterior",
|
|
105
|
+
"components.gadgets.calendar.nextMonth": "Próximo mês",
|
|
106
106
|
"components.gadgets.calendar.goToday": "Ir para hoje",
|
|
107
|
-
"components.gadgets.qrcode.title": "
|
|
107
|
+
"components.gadgets.qrcode.title": "Código QR",
|
|
108
108
|
"components.gadgets.gauge.radialAria": "Medidor radial",
|
|
109
109
|
"components.gadgets.gauge.linearAria": "Medidor linear",
|
|
110
110
|
"components.gadgets.gauge.value": "Valor",
|
|
@@ -201,10 +201,10 @@ const ptBR = {
|
|
|
201
201
|
"components.menu.drag": "Arrastar menu",
|
|
202
202
|
"components.menu.ariaLabel": "Menu",
|
|
203
203
|
"components.toolbar.toggle": "Alternar barra de ferramentas",
|
|
204
|
-
"components.breadcrumb.ariaLabel": "
|
|
204
|
+
"components.breadcrumb.ariaLabel": "Navegação estrutural",
|
|
205
205
|
"components.breadcrumb.overflow": "Mais caminhos",
|
|
206
|
-
"components.pageControl.ariaLabel": "Controle de
|
|
207
|
-
"components.pageControl.empty": "Nenhuma
|
|
206
|
+
"components.pageControl.ariaLabel": "Controle de páginas",
|
|
207
|
+
"components.pageControl.empty": "Nenhuma página visível.",
|
|
208
208
|
"components.expandablePanel.ariaLabel": "Painel expansivel",
|
|
209
209
|
"components.carousel.goToSlide": "Ir para o slide {slide}",
|
|
210
210
|
"components.wizard.progress": "Progresso",
|
package/dist/i18n/pt-PT.js
CHANGED
|
@@ -44,9 +44,9 @@ const ptPT = {
|
|
|
44
44
|
"components.inputs.postalCode.PY.invalid": "Código postal inválido.",
|
|
45
45
|
"components.inputs.phone.invalid": "Telefone inválido.",
|
|
46
46
|
"components.inputs.email.invalid": "Email inválido.",
|
|
47
|
-
"components.inputs.otp.slot": "
|
|
48
|
-
"components.inputs.otp.group": "
|
|
49
|
-
"components.inputs.toggle.ariaLabel": "Alternar
|
|
47
|
+
"components.inputs.otp.slot": "Código único {slot}",
|
|
48
|
+
"components.inputs.otp.group": "Código único",
|
|
49
|
+
"components.inputs.toggle.ariaLabel": "Alternar opção",
|
|
50
50
|
"components.inputs.email.tempInvalid": "Email temporário inválido.",
|
|
51
51
|
"components.inputs.date.invalid": "Data inválida.",
|
|
52
52
|
"components.inputs.date.range": "Data deve estar entre {min} e {max}.",
|
|
@@ -101,10 +101,10 @@ const ptPT = {
|
|
|
101
101
|
"components.picklist.empty": "Nenhum item disponivel.",
|
|
102
102
|
"components.gadgets.clock.title": "Rel\u00f3gio",
|
|
103
103
|
"components.gadgets.calendar.title": "Calend\u00e1rio",
|
|
104
|
-
"components.gadgets.calendar.previousMonth": "
|
|
105
|
-
"components.gadgets.calendar.nextMonth": "
|
|
104
|
+
"components.gadgets.calendar.previousMonth": "Mês anterior",
|
|
105
|
+
"components.gadgets.calendar.nextMonth": "Próximo mês",
|
|
106
106
|
"components.gadgets.calendar.goToday": "Ir para hoje",
|
|
107
|
-
"components.gadgets.qrcode.title": "
|
|
107
|
+
"components.gadgets.qrcode.title": "Código QR",
|
|
108
108
|
"components.gadgets.gauge.radialAria": "Medidor radial",
|
|
109
109
|
"components.gadgets.gauge.linearAria": "Medidor linear",
|
|
110
110
|
"components.gadgets.gauge.value": "Valor",
|
|
@@ -201,10 +201,10 @@ const ptPT = {
|
|
|
201
201
|
"components.menu.drag": "Arrastar menu",
|
|
202
202
|
"components.menu.ariaLabel": "Menu",
|
|
203
203
|
"components.toolbar.toggle": "Alternar barra de ferramentas",
|
|
204
|
-
"components.breadcrumb.ariaLabel": "
|
|
204
|
+
"components.breadcrumb.ariaLabel": "Navegação estrutural",
|
|
205
205
|
"components.breadcrumb.overflow": "Mais caminhos",
|
|
206
|
-
"components.pageControl.ariaLabel": "Controlo de
|
|
207
|
-
"components.pageControl.empty": "Nenhuma
|
|
206
|
+
"components.pageControl.ariaLabel": "Controlo de páginas",
|
|
207
|
+
"components.pageControl.empty": "Nenhuma página visível.",
|
|
208
208
|
"components.expandablePanel.ariaLabel": "Painel expansivel",
|
|
209
209
|
"components.carousel.goToSlide": "Ir para o slide {slide}",
|
|
210
210
|
"components.wizard.progress": "Progresso",
|
|
@@ -14,8 +14,8 @@ export const sgMeta = {
|
|
|
14
14
|
props: [
|
|
15
15
|
{ name: "id", type: "string", description: "Identificador da tabela usado para DOM e persistencia do layout de colunas.", semanticRole: "data", bindable: true },
|
|
16
16
|
{ name: "columns", type: "SgDatatableColumn[]", description: "Definicao das colunas da tabela.", semanticRole: "data", bindable: true },
|
|
17
|
-
{ name: "rows", type: "
|
|
18
|
-
{ name: "selectionMode", type: "
|
|
17
|
+
{ name: "rows", type: "number", description: "Linhas por pagina quando a paginacao esta ativa (os dados vao em value).", semanticRole: "behavior", bindable: true },
|
|
18
|
+
{ name: "selectionMode", type: "\"single\" | \"multiple\"", description: "Modo de selecao de linhas.", semanticRole: "behavior", bindable: true },
|
|
19
19
|
{ name: "loading", type: "boolean", default: false, description: "Indica estado de carregamento.", semanticRole: "appearance", bindable: true },
|
|
20
20
|
{ name: "paginator", type: "boolean", default: false, description: "Ativa paginacao.", semanticRole: "behavior", bindable: true },
|
|
21
21
|
{ name: "onPage", type: "(event: SgDatatablePageEvent) => void", description: "Callback de paginacao.", semanticRole: "event", bindable: false },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgInputCNPJ.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputCNPJ.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"SgInputCNPJ.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputCNPJ.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAA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
import { isValidCnpj } from "../validators";
|
|
8
8
|
import { t, useComponentsI18n } from "../i18n";
|
|
9
|
+
import { defaultPublicaCnpjFetch } from "./publicaCnpj";
|
|
9
10
|
function onlyAlnumUpper(value) {
|
|
10
11
|
return value.replace(/[^0-9A-Za-z]/g, "").toUpperCase();
|
|
11
12
|
}
|
|
12
13
|
function onlyDigits(value) {
|
|
13
14
|
return value.replace(/\D/g, "");
|
|
14
15
|
}
|
|
15
|
-
const defaultPublicaCnpjFetch = async (cnpj) => {
|
|
16
|
-
const response = await fetch(`https://publica.cnpj.ws/cnpj/${cnpj}`);
|
|
17
|
-
if (!response.ok)
|
|
18
|
-
return null;
|
|
19
|
-
return response.json();
|
|
20
|
-
};
|
|
21
16
|
export function SgInputCNPJ(props) {
|
|
22
17
|
const i18n = useComponentsI18n();
|
|
23
18
|
const { required, requiredMessage, lengthMessage, invalidMessage, validateOnBlur, error, validation, validateWithPublicaCnpj, publicaCnpjErrorMessage, publicaCnpjFetch, onPublicaCnpjResult, onPublicaCnpjError, ...rest } = props;
|
|
@@ -16,6 +16,16 @@ export type SgInputCPFCNPJProps = Omit<SgInputTextProps, "inputProps" | "error">
|
|
|
16
16
|
validation?: (value: string) => string | null;
|
|
17
17
|
onValidation?: (message: string | null) => void;
|
|
18
18
|
validateOnBlur?: boolean;
|
|
19
|
+
/** Quando o documento e um CNPJ numerico valido, confirma na base publica (publica.cnpj.ws) que ele existe. */
|
|
20
|
+
validateWithPublicaCnpj?: boolean;
|
|
21
|
+
/** Mensagem quando a base publica nao encontra o CNPJ. */
|
|
22
|
+
publicaCnpjErrorMessage?: string;
|
|
23
|
+
/** Consulta injetavel (testes sem rede). Padrao: https://publica.cnpj.ws. */
|
|
24
|
+
publicaCnpjFetch?: (cnpj: string) => Promise<unknown | null>;
|
|
25
|
+
/** Recebe o resultado da consulta (`null` quando nao achou). */
|
|
26
|
+
onPublicaCnpjResult?: (data: unknown | null) => void;
|
|
27
|
+
/** Chamado quando a consulta falha (rede ou limite da API); a validacao passa. */
|
|
28
|
+
onPublicaCnpjError?: (error: unknown) => void;
|
|
19
29
|
};
|
|
20
30
|
export declare function SgInputCPFCNPJ(props: SgInputCPFCNPJProps): import("react/jsx-runtime").JSX.Element;
|
|
21
31
|
//# sourceMappingURL=SgInputCPFCNPJ.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgInputCPFCNPJ.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputCPFCNPJ.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"SgInputCPFCNPJ.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputCPFCNPJ.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAOnE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG;IACjF,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;QACzD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;KACnC,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,+GAA+G;IAC/G,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0DAA0D;IAC1D,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAC7D,gEAAgE;IAChE,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C,CAAC;AAUF,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAgKxD"}
|
|
@@ -6,6 +6,7 @@ import { resolveFieldError } from "../rhf";
|
|
|
6
6
|
import { maskCpfCnpj } from "../masks";
|
|
7
7
|
import { isValidCnpj, isValidCpf } from "../validators";
|
|
8
8
|
import { t, useComponentsI18n } from "../i18n";
|
|
9
|
+
import { defaultPublicaCnpjFetch } from "./publicaCnpj";
|
|
9
10
|
function onlyDigits(value) {
|
|
10
11
|
return value.replace(/\D/g, "");
|
|
11
12
|
}
|
|
@@ -14,8 +15,10 @@ function onlyAlnumUpper(value) {
|
|
|
14
15
|
}
|
|
15
16
|
export function SgInputCPFCNPJ(props) {
|
|
16
17
|
const i18n = useComponentsI18n();
|
|
17
|
-
const { required, requiredMessage, lengthMessage, invalidMessage, validateOnBlur, error, validation, ...rest } = props;
|
|
18
|
+
const { required, requiredMessage, lengthMessage, invalidMessage, validateOnBlur, error, validation, validateWithPublicaCnpj, publicaCnpjErrorMessage, publicaCnpjFetch, onPublicaCnpjResult, onPublicaCnpjError, ...rest } = props;
|
|
18
19
|
const [internalError, setInternalError] = React.useState(null);
|
|
20
|
+
const lastValidatedCnpjRef = React.useRef(null);
|
|
21
|
+
const lastPublicaFoundRef = React.useRef(null);
|
|
19
22
|
const runValidation = React.useCallback((value) => {
|
|
20
23
|
const raw = onlyAlnumUpper(value);
|
|
21
24
|
if (!raw && !required) {
|
|
@@ -68,9 +71,59 @@ export function SgInputCPFCNPJ(props) {
|
|
|
68
71
|
props.onValidation?.(message);
|
|
69
72
|
return;
|
|
70
73
|
}
|
|
74
|
+
if (validateWithPublicaCnpj && !/[A-Z]/.test(raw)) {
|
|
75
|
+
const digits = onlyDigits(raw);
|
|
76
|
+
if (digits.length === 14) {
|
|
77
|
+
const message = publicaCnpjErrorMessage ?? invalidMessage ?? t(i18n, "components.inputs.cnpj.invalid");
|
|
78
|
+
if (lastValidatedCnpjRef.current === digits) {
|
|
79
|
+
if (lastPublicaFoundRef.current === false) {
|
|
80
|
+
setInternalError(message);
|
|
81
|
+
props.onValidation?.(message);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
setInternalError(null);
|
|
85
|
+
props.onValidation?.(null);
|
|
86
|
+
}
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
void (async () => {
|
|
90
|
+
try {
|
|
91
|
+
const checker = publicaCnpjFetch ?? defaultPublicaCnpjFetch;
|
|
92
|
+
const data = await checker(digits);
|
|
93
|
+
lastValidatedCnpjRef.current = digits;
|
|
94
|
+
lastPublicaFoundRef.current = Boolean(data);
|
|
95
|
+
onPublicaCnpjResult?.(data);
|
|
96
|
+
if (!data) {
|
|
97
|
+
setInternalError(message);
|
|
98
|
+
props.onValidation?.(message);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
onPublicaCnpjError?.(err);
|
|
104
|
+
}
|
|
105
|
+
setInternalError(null);
|
|
106
|
+
props.onValidation?.(null);
|
|
107
|
+
})();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
71
111
|
setInternalError(null);
|
|
72
112
|
props.onValidation?.(null);
|
|
73
|
-
}, [
|
|
113
|
+
}, [
|
|
114
|
+
i18n,
|
|
115
|
+
required,
|
|
116
|
+
requiredMessage,
|
|
117
|
+
lengthMessage,
|
|
118
|
+
invalidMessage,
|
|
119
|
+
validation,
|
|
120
|
+
props,
|
|
121
|
+
validateWithPublicaCnpj,
|
|
122
|
+
publicaCnpjErrorMessage,
|
|
123
|
+
publicaCnpjFetch,
|
|
124
|
+
onPublicaCnpjResult,
|
|
125
|
+
onPublicaCnpjError
|
|
126
|
+
]);
|
|
74
127
|
const inputProps = {
|
|
75
128
|
...rest.inputProps,
|
|
76
129
|
inputMode: rest.inputProps?.inputMode ?? "text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgInputCPFCNPJ.meta.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputCPFCNPJ.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9D,eAAO,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"SgInputCPFCNPJ.meta.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputCPFCNPJ.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9D,eAAO,MAAM,MAAM,EAAE,QAiEpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAyBrB,CAAC"}
|
|
@@ -19,6 +19,11 @@ export const sgMeta = {
|
|
|
19
19
|
{ name: "lengthMessage", type: "string", description: "Mensagem para comprimento invalido.", semanticRole: "validation", bindable: true },
|
|
20
20
|
{ name: "invalidMessage", type: "string", description: "Mensagem para documento invalido.", semanticRole: "validation", bindable: true },
|
|
21
21
|
{ name: "validateOnBlur", type: "boolean", default: true, description: "Executa validacao no blur.", semanticRole: "behavior", bindable: true },
|
|
22
|
+
{ name: "validateWithPublicaCnpj", type: "boolean", default: false, description: "Confirma na base publica que o CNPJ numerico existe.", semanticRole: "behavior", bindable: true },
|
|
23
|
+
{ name: "publicaCnpjErrorMessage", type: "string", description: "Mensagem quando a base publica nao encontra o CNPJ.", semanticRole: "validation", bindable: true },
|
|
24
|
+
{ name: "publicaCnpjFetch", type: "(cnpj: string) => Promise<unknown | null>", description: "Consulta injetavel (padrao publica.cnpj.ws).", semanticRole: "behavior", bindable: false },
|
|
25
|
+
{ name: "onPublicaCnpjResult", type: "(data: unknown | null) => void", description: "Recebe o resultado da consulta.", semanticRole: "event", bindable: false },
|
|
26
|
+
{ name: "onPublicaCnpjError", type: "(error: unknown) => void", description: "Chamado quando a consulta falha.", semanticRole: "event", bindable: false },
|
|
22
27
|
{ name: "validation", type: "(value: string) => string | null", description: "Validacao customizada adicional.", semanticRole: "validation", bindable: false },
|
|
23
28
|
{ name: "onValidation", type: "(message: string | null) => void", description: "Callback para estado de validacao.", semanticRole: "event", bindable: false }
|
|
24
29
|
],
|
|
@@ -30,6 +35,12 @@ export const sgMeta = {
|
|
|
30
35
|
file: "apps/showcase/src/app/components/sg-input-cpf-cnpj/samples/basico.tsx.sample",
|
|
31
36
|
kind: "sample"
|
|
32
37
|
},
|
|
38
|
+
{
|
|
39
|
+
id: "publica-cnpj",
|
|
40
|
+
title: "Consulta na base publica",
|
|
41
|
+
file: "apps/showcase/src/app/components/sg-input-cpf-cnpj/samples/cnpj-publico.tsx.sample",
|
|
42
|
+
kind: "sample"
|
|
43
|
+
},
|
|
33
44
|
{
|
|
34
45
|
id: "playground",
|
|
35
46
|
title: "Playground",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgInputPassword.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputPassword.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAInE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,gBAAg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AC;IAChD,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,iCAAiC,CAAC,EAAE,OAAO,CAAC;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,2CAqbpE"}
|
|
@@ -12,6 +12,8 @@ export function SgInputPassword(props) {
|
|
|
12
12
|
const [isHidden, setIsHidden] = React.useState(hidePassword ?? true);
|
|
13
13
|
const [hasInteracted, setHasInteracted] = React.useState(false);
|
|
14
14
|
const [unmetRequirements, setUnmetRequirements] = React.useState([]);
|
|
15
|
+
// Barra de forca: sem texto digitado nao ha o que medir (antes ficava toda verde com o campo vazio).
|
|
16
|
+
const [hasText, setHasText] = React.useState(false);
|
|
15
17
|
const inputRef = React.useRef(null);
|
|
16
18
|
const commonPasswordSet = React.useMemo(() => {
|
|
17
19
|
if (!commonPasswordCheck)
|
|
@@ -80,11 +82,14 @@ export function SgInputPassword(props) {
|
|
|
80
82
|
prohibitsSequentialAscCharacters,
|
|
81
83
|
prohibitsSequentialDescCharacters
|
|
82
84
|
];
|
|
85
|
+
if (!hasText)
|
|
86
|
+
return 0;
|
|
83
87
|
const activeChecks = totalChecks.filter((v) => v !== false).length;
|
|
84
88
|
if (activeChecks === 0)
|
|
85
89
|
return 0;
|
|
86
90
|
return activeChecks - unmetRequirements.length;
|
|
87
91
|
}, [
|
|
92
|
+
hasText,
|
|
88
93
|
lowerRequired,
|
|
89
94
|
minSize,
|
|
90
95
|
numberRequired,
|
|
@@ -174,6 +179,7 @@ export function SgInputPassword(props) {
|
|
|
174
179
|
upperRequired
|
|
175
180
|
]);
|
|
176
181
|
const runValidation = React.useCallback((value) => {
|
|
182
|
+
setHasText(value.length > 0);
|
|
177
183
|
if (!value && !required) {
|
|
178
184
|
setInternalError(null);
|
|
179
185
|
onValidation?.(null);
|
|
@@ -14,7 +14,7 @@ export const sgMeta = {
|
|
|
14
14
|
props: [
|
|
15
15
|
{ name: "id", type: "string", description: "Identificador unico do componente.", semanticRole: "data", bindable: false },
|
|
16
16
|
{ name: "value", type: "SgPickListValue", description: "Estado atual das listas.", semanticRole: "value", bindable: true },
|
|
17
|
-
{ name: "selectionMode", type: "
|
|
17
|
+
{ name: "selectionMode", type: "\"single\" | \"multiple\"", description: "Modo de selecao nas listas.", semanticRole: "behavior", bindable: true },
|
|
18
18
|
{ name: "disabled", type: "boolean", default: false, description: "Desabilita interacao.", semanticRole: "behavior", bindable: true },
|
|
19
19
|
{ name: "onChange", type: "(event: SgPickListChangeEvent) => void", description: "Callback ao mover itens.", semanticRole: "event", bindable: false }
|
|
20
20
|
],
|
|
@@ -17,8 +17,8 @@ export const sgMeta = {
|
|
|
17
17
|
{ name: "value", type: "number", description: "Nota atual.", semanticRole: "value", bindable: true },
|
|
18
18
|
{ name: "readOnly", type: "boolean", default: false, description: "Impede alteracao da nota.", semanticRole: "behavior", bindable: true },
|
|
19
19
|
{ name: "disabled", type: "boolean", default: false, description: "Desabilita interacao.", semanticRole: "behavior", bindable: true },
|
|
20
|
-
{ name: "size", type: "
|
|
21
|
-
{ name: "onChange", type: "(value: number
|
|
20
|
+
{ name: "size", type: "\"sm\" | \"md\" | \"lg\" | \"xl\"", description: "Tamanho visual do controle.", semanticRole: "appearance", bindable: true },
|
|
21
|
+
{ name: "onChange", type: "(value: number) => void", description: "Callback de mudanca.", semanticRole: "event", bindable: false }
|
|
22
22
|
],
|
|
23
23
|
states: ["default", "disabled", "readOnly", "error"],
|
|
24
24
|
showcase: { route: "/components/sg-rating", hasPlayground: true, hasPropsTable: true },
|
|
@@ -14,8 +14,8 @@ export const sgMeta = {
|
|
|
14
14
|
props: [
|
|
15
15
|
{ name: "id", type: "string", description: "Identificador unico do editor.", semanticRole: "data", bindable: false },
|
|
16
16
|
{ name: "placeholder", type: "string", description: "Texto de ajuda inicial.", semanticRole: "appearance", bindable: true },
|
|
17
|
-
{ name: "height", type: "number
|
|
18
|
-
{ name: "onSave", type: "(meta: SgTextEditorSaveMeta) => void", description: "Callback de persistencia do conteudo.", semanticRole: "event", bindable: false }
|
|
17
|
+
{ name: "height", type: "number", description: "Altura do editor.", semanticRole: "appearance", bindable: true },
|
|
18
|
+
{ name: "onSave", type: "(file: File, meta: SgTextEditorSaveMeta) => void", description: "Callback de persistencia do conteudo.", semanticRole: "event", bindable: false }
|
|
19
19
|
],
|
|
20
20
|
states: ["default", "readOnly", "disabled", "error"],
|
|
21
21
|
showcase: { route: "/components/sg-text-editor", hasPlayground: true, hasPropsTable: true },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicaCnpj.d.ts","sourceRoot":"","sources":["../../src/inputs/publicaCnpj.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,eAAO,MAAM,uBAAuB,GAAU,MAAM,MAAM,iBAIzD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Consulta padrao da base publica de CNPJ (publica.cnpj.ws). Resposta nao-2xx vira `null` ("nao achou"). */
|
|
2
|
+
export const defaultPublicaCnpjFetch = async (cnpj) => {
|
|
3
|
+
const response = await fetch(`https://publica.cnpj.ws/cnpj/${cnpj}`);
|
|
4
|
+
if (!response.ok)
|
|
5
|
+
return null;
|
|
6
|
+
return response.json();
|
|
7
|
+
};
|
|
@@ -46,14 +46,14 @@ export const sgMeta = {
|
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
name: "activeIndex",
|
|
49
|
-
type: "number[]",
|
|
49
|
+
type: "number | number[]",
|
|
50
50
|
description: "Estado controlado dos paineis abertos.",
|
|
51
51
|
semanticRole: "value",
|
|
52
52
|
bindable: true
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
name: "defaultActiveIndex",
|
|
56
|
-
type: "number[]",
|
|
56
|
+
type: "number | number[]",
|
|
57
57
|
description: "Estado inicial dos paineis abertos.",
|
|
58
58
|
semanticRole: "behavior",
|
|
59
59
|
bindable: true
|
|
@@ -37,7 +37,7 @@ export const sgMeta = {
|
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
name: "menuVariantStyle",
|
|
40
|
-
type:
|
|
40
|
+
type: "\"panel\" | \"tiered\" | \"mega-horizontal\" | \"mega-vertical\" | \"PanelMenu\" | \"Tiered\" | \"MegaMenuHorizontal\" | \"MegaMenuVertical\"",
|
|
41
41
|
default: "panel",
|
|
42
42
|
description: "Variante visual e comportamental do menu.",
|
|
43
43
|
semanticRole: "behavior",
|
|
@@ -20,7 +20,7 @@ export const sgMeta = {
|
|
|
20
20
|
{ name: "size", type: '"sm" | "md" | "lg"', default: "md", description: "Escala visual das abas.", semanticRole: "appearance", bindable: true },
|
|
21
21
|
{ name: "fullWidthTabs", type: "boolean", default: false, description: "Distribui as abas em larguras iguais a partir do tablet; no celular elas mantem a largura natural e a lista rola.", semanticRole: "appearance", bindable: true },
|
|
22
22
|
{ name: "mobilePageControl", type: '"scroll" | "select"', default: "scroll", description: "Comportamento no celular: rolagem horizontal das abas ou troca por um select nativo.", semanticRole: "behavior", bindable: true },
|
|
23
|
-
{ name: "onActivePageIdChange", type: "(pageId: string, context:
|
|
23
|
+
{ name: "onActivePageIdChange", type: "(pageId: string, context: { index: number; page: SgPageControlPageProps }) => void", description: "Callback disparado quando a pagina ativa muda.", semanticRole: "event", bindable: false }
|
|
24
24
|
],
|
|
25
25
|
states: ["default", "controlled", "keyboard-navigation"],
|
|
26
26
|
examples: [
|