ngx-vector-components 4.20.0 → 4.22.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/CHANGELOG.md +18 -0
- package/esm2020/lib/components/fields/data-table/data-table.component.mjs +2 -1
- package/esm2020/lib/models/profile.model.mjs +8 -1
- package/esm2020/lib/services/menu.service.mjs +1 -1
- package/esm2020/lib/services/profile.service.mjs +2 -1
- package/esm2020/lib/utils/cpf-cnpj-validator.util.mjs +116 -0
- package/esm2020/lib/utils/index.mjs +2 -1
- package/esm2020/lib/utils/mask.util.mjs +6 -1
- package/fesm2015/ngx-vector-components.mjs +132 -3
- package/fesm2015/ngx-vector-components.mjs.map +1 -1
- package/fesm2020/ngx-vector-components.mjs +132 -2
- package/fesm2020/ngx-vector-components.mjs.map +1 -1
- package/lib/models/profile.model.d.ts +8 -1
- package/lib/services/menu.service.d.ts +1 -1
- package/lib/utils/cpf-cnpj-validator.util.d.ts +5 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/mask.util.d.ts +2 -0
- package/package.json +1 -1
|
@@ -245,6 +245,13 @@ var ProfileModuleActionType;
|
|
|
245
245
|
ProfileModuleActionType["EDIT_LOCATION_SHIPPER"] = "Edit LocationShipper";
|
|
246
246
|
ProfileModuleActionType["SHOW_LOCATION_SHIPPER"] = "Show LocationShipper";
|
|
247
247
|
ProfileModuleActionType["DELETE_LOCATION_SHIPPER"] = "Delete LocationShipper";
|
|
248
|
+
ProfileModuleActionType["ADD_SCHEDULE"] = "Add Schedule";
|
|
249
|
+
ProfileModuleActionType["EDIT_SCHEDULE"] = "Edit Schedule";
|
|
250
|
+
ProfileModuleActionType["SHOW_SCHEDULE"] = "Show Schedule";
|
|
251
|
+
ProfileModuleActionType["ADD_VACANCIES_LOGISTIC"] = "Add Vacancies Logistic";
|
|
252
|
+
ProfileModuleActionType["ADD_VACANCIES_COMMERCIAL"] = "Add Vacancies Commercial";
|
|
253
|
+
ProfileModuleActionType["SHOW_VACANCIES_COMPLETE"] = "Show Vacancies Complete";
|
|
254
|
+
ProfileModuleActionType["ADD_SCHEDULE_OFF"] = "Add Schedule Off";
|
|
248
255
|
})(ProfileModuleActionType || (ProfileModuleActionType = {}));
|
|
249
256
|
|
|
250
257
|
var Role;
|
|
@@ -312,6 +319,122 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
312
319
|
}]
|
|
313
320
|
}] });
|
|
314
321
|
|
|
322
|
+
class CpfCnpjValidator {
|
|
323
|
+
static validateCpfOrCnpj(taxId) {
|
|
324
|
+
taxId = taxId.replace(/[^0-9]+/g, '');
|
|
325
|
+
if (taxId.length == 11) {
|
|
326
|
+
return this.validateCpf(taxId);
|
|
327
|
+
}
|
|
328
|
+
else if (taxId.length == 14) {
|
|
329
|
+
return this.validateCnpj(taxId);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
static validateCpf(cpf) {
|
|
336
|
+
if (!(cpf === null || cpf === void 0 ? void 0 : cpf.trim()) || cpf.length !== 11 || !cpf.match('^[0-9]+$')) {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
if ([
|
|
340
|
+
'00000000000',
|
|
341
|
+
'11111111111',
|
|
342
|
+
'22222222222',
|
|
343
|
+
'33333333333',
|
|
344
|
+
'44444444444',
|
|
345
|
+
'55555555555',
|
|
346
|
+
'66666666666',
|
|
347
|
+
'77777777777',
|
|
348
|
+
'88888888888',
|
|
349
|
+
'99999999999',
|
|
350
|
+
].includes(cpf)) {
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
let num = 0;
|
|
354
|
+
let caracter = '';
|
|
355
|
+
let counter = 10;
|
|
356
|
+
let sum = 0;
|
|
357
|
+
let rest = 0;
|
|
358
|
+
let firstDigit = 0;
|
|
359
|
+
let secondDigit = 0;
|
|
360
|
+
let cpfAux = '';
|
|
361
|
+
cpfAux = cpf.substring(0, 9);
|
|
362
|
+
for (let i = 0; i < 9; i++) {
|
|
363
|
+
caracter = cpfAux.charAt(i);
|
|
364
|
+
num = Number(caracter);
|
|
365
|
+
sum = sum + num * counter;
|
|
366
|
+
counter--;
|
|
367
|
+
}
|
|
368
|
+
rest = sum % 11;
|
|
369
|
+
firstDigit = 11 - rest;
|
|
370
|
+
if (firstDigit > 9) {
|
|
371
|
+
firstDigit = 0;
|
|
372
|
+
}
|
|
373
|
+
counter = 11;
|
|
374
|
+
sum = 0;
|
|
375
|
+
cpfAux = cpfAux + firstDigit;
|
|
376
|
+
for (let i = 0; i < 10; i++) {
|
|
377
|
+
caracter = cpfAux.charAt(i);
|
|
378
|
+
num = Number(caracter);
|
|
379
|
+
sum = sum + num * counter;
|
|
380
|
+
counter--;
|
|
381
|
+
}
|
|
382
|
+
rest = sum % 11;
|
|
383
|
+
secondDigit = 11 - rest;
|
|
384
|
+
if (secondDigit > 9) {
|
|
385
|
+
secondDigit = 0;
|
|
386
|
+
}
|
|
387
|
+
cpfAux = cpfAux + secondDigit;
|
|
388
|
+
return cpf === cpfAux;
|
|
389
|
+
}
|
|
390
|
+
static validateCnpj(cnpj) {
|
|
391
|
+
cnpj = cnpj.replace(/[^\d]+/g, '');
|
|
392
|
+
if (cnpj == '')
|
|
393
|
+
return false;
|
|
394
|
+
if (cnpj.length != 14)
|
|
395
|
+
return false;
|
|
396
|
+
if ([
|
|
397
|
+
'00000000000000',
|
|
398
|
+
'11111111111111',
|
|
399
|
+
'22222222222222',
|
|
400
|
+
'33333333333333',
|
|
401
|
+
'44444444444444',
|
|
402
|
+
'55555555555555',
|
|
403
|
+
'66666666666666',
|
|
404
|
+
'77777777777777',
|
|
405
|
+
'88888888888888',
|
|
406
|
+
'99999999999999',
|
|
407
|
+
].includes(cnpj))
|
|
408
|
+
return false;
|
|
409
|
+
let size = cnpj.length - 2;
|
|
410
|
+
let numbers = cnpj.substring(0, size);
|
|
411
|
+
let digits = cnpj.substring(size);
|
|
412
|
+
let sum = 0;
|
|
413
|
+
let pos = size - 7;
|
|
414
|
+
for (let i = size; i >= 1; i--) {
|
|
415
|
+
sum += parseInt(numbers.charAt(size - i)) * pos--;
|
|
416
|
+
if (pos < 2)
|
|
417
|
+
pos = 9;
|
|
418
|
+
}
|
|
419
|
+
let resultado = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
420
|
+
if (resultado != parseInt(digits.charAt(0)))
|
|
421
|
+
return false;
|
|
422
|
+
size = size + 1;
|
|
423
|
+
numbers = cnpj.substring(0, size);
|
|
424
|
+
sum = 0;
|
|
425
|
+
pos = size - 7;
|
|
426
|
+
for (let i = size; i >= 1; i--) {
|
|
427
|
+
sum += parseInt(numbers.charAt(size - i)) * pos--;
|
|
428
|
+
if (pos < 2)
|
|
429
|
+
pos = 9;
|
|
430
|
+
}
|
|
431
|
+
resultado = sum % 11 < 2 ? 0 : 11 - (sum % 11);
|
|
432
|
+
if (resultado != parseInt(digits.charAt(1)))
|
|
433
|
+
return false;
|
|
434
|
+
return true;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
315
438
|
class FileUtil {
|
|
316
439
|
static getBlob(base64StringData, mimeType) {
|
|
317
440
|
const decodedData = atob(base64StringData);
|
|
@@ -332,6 +455,7 @@ const BOLETO_PATTERN = '#####.##### #####.###### #####.###### # ############## #
|
|
|
332
455
|
const POSTALCODE_PATTERN = '#####-###';
|
|
333
456
|
const CELLPHONE_PATTERN = '(##) #####-####';
|
|
334
457
|
const PHONE_PATTERN = '(##) ####-####';
|
|
458
|
+
const PLATE_PATTERN = '###-####';
|
|
335
459
|
class MaskUtil {
|
|
336
460
|
static formatDocument(stringValue) {
|
|
337
461
|
if (!stringValue) {
|
|
@@ -363,6 +487,9 @@ class MaskUtil {
|
|
|
363
487
|
}
|
|
364
488
|
return stringValue;
|
|
365
489
|
}
|
|
490
|
+
static formatPlate(stringValue) {
|
|
491
|
+
return this.doMaskString(stringValue, PLATE_PATTERN);
|
|
492
|
+
}
|
|
366
493
|
static doMaskString(str, pattern) {
|
|
367
494
|
if (!(str === null || str === void 0 ? void 0 : str.trim())) {
|
|
368
495
|
return '';
|
|
@@ -380,7 +507,8 @@ MaskUtil.CNPJ_TEXT_FIELD_PATTERN = '99.999.999/9999-99';
|
|
|
380
507
|
MaskUtil.BOLETO_TEXT_FIELD_PATTERN = '99999.99999 99999.999999 99999.999999 9 99999999999999 9';
|
|
381
508
|
MaskUtil.CELLPHONE_TEXT_FIELD_PATTERN = '(99) 99999-9999';
|
|
382
509
|
MaskUtil.PHONE_TEXT_FIELD_PATTERN = '(99) 9999-9999';
|
|
383
|
-
MaskUtil.POSTALCODE_TEXT_FIELD_PATTERN = '99999-999';
|
|
510
|
+
MaskUtil.POSTALCODE_TEXT_FIELD_PATTERN = '99999-999';
|
|
511
|
+
MaskUtil.PLATE_FIELD_PATTERN = 'aaa-9*99';
|
|
384
512
|
|
|
385
513
|
class ObjectUtil {
|
|
386
514
|
static getObjectKeys(obj) {
|
|
@@ -1443,6 +1571,7 @@ class ProfileService {
|
|
|
1443
1571
|
shipper: response === null || response === void 0 ? void 0 : response.shipper,
|
|
1444
1572
|
carrierId: response === null || response === void 0 ? void 0 : response.carrierId,
|
|
1445
1573
|
profileTypeId: response === null || response === void 0 ? void 0 : response.profile.profileTypeId,
|
|
1574
|
+
profileName: response === null || response === void 0 ? void 0 : response.profile.name,
|
|
1446
1575
|
};
|
|
1447
1576
|
this.storageService.setSession('userInfo', dataObject);
|
|
1448
1577
|
this.profileTypeItens$.next(dataObject);
|
|
@@ -2477,7 +2606,7 @@ class DataTableComponent {
|
|
|
2477
2606
|
: [{ column: 0, dir: 'desc' }], columns: columns });
|
|
2478
2607
|
}
|
|
2479
2608
|
else {
|
|
2480
|
-
this._lastLazyLoadEvent = Object.assign(Object.assign({}, this._lastLazyLoadEvent), params.data);
|
|
2609
|
+
this._lastLazyLoadEvent = Object.assign(Object.assign(Object.assign({}, this._lastLazyLoadEvent), params.data), { start: 0 });
|
|
2481
2610
|
if (this._tabSelected) {
|
|
2482
2611
|
this._lastLazyLoadEvent = Object.assign(Object.assign({}, (this._lastLazyLoadEvent || {})), { Status: this._tabSelected.code });
|
|
2483
2612
|
}
|
|
@@ -4137,5 +4266,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
4137
4266
|
* Generated bundle index. Do not edit.
|
|
4138
4267
|
*/
|
|
4139
4268
|
|
|
4140
|
-
export { AppName, AuthService, BadgeComponent, BadgeModule, BooleanType, BreadcrumbComponent, BreadcrumbModule, ButtonComponent, CalendarComponent, CheckboxFieldComponent, CrudBaseComponent, CrudBaseService, CrudFooterComponent, CrudHeaderComponent, CrudHeaderModule, CrudHistory, CrudHistoryComponent, CrudHistoryModule, CrudListHasItemsGuard, CrudMode, CurrencyBrlPipe, CurrencyFieldComponent, DataTableComponent, DocumentType, DropdownFieldComponent, EnumService, ErrorMessageService, FieldErrorMessageComponent, FieldType, FieldsModule, FileUtil, FiltersComponent, FooterModule, FormatDocumentPipe, GenericErrorModalComponent, GenericErrorModalModule, GenericModalComponent, GenericModalModule, GeolocationService, GetSelectedCrudItemResolver, GetTokenByGuidGuard, HasPermissionGuard, HttpInterceptorProvider, InputNumberFieldComponent, LoadingService, MaskPipe, MaskUtil, MenuComponent, MenuModule, MenuService, MessageStatus, ModalService, MultiselectFieldComponent, NotHiddenPipe, ObjectUtil, OnlyActivePipe, PanelComponent, PanelModule, PercentageFieldComponent, PipesModule, ProfileModuleActionType, ProfileModuleType, ProfileService, RadioButtonFieldComponent, RangeValueComponent, RemoveLastChildPipe, Role, RoleGuard, SearchFieldComponent, SelectButtonFieldComponent, SelectionType, Status, StorageService, StringUtil, SubMenusListComponent, TableColumnType, TextFieldComponent, TextareaFieldComponent, TokenIsPresentGuard, TopBarComponent, TopBarModule, ValidationUtil, View, WindowUtil };
|
|
4269
|
+
export { AppName, AuthService, BadgeComponent, BadgeModule, BooleanType, BreadcrumbComponent, BreadcrumbModule, ButtonComponent, CalendarComponent, CheckboxFieldComponent, CpfCnpjValidator, CrudBaseComponent, CrudBaseService, CrudFooterComponent, CrudHeaderComponent, CrudHeaderModule, CrudHistory, CrudHistoryComponent, CrudHistoryModule, CrudListHasItemsGuard, CrudMode, CurrencyBrlPipe, CurrencyFieldComponent, DataTableComponent, DocumentType, DropdownFieldComponent, EnumService, ErrorMessageService, FieldErrorMessageComponent, FieldType, FieldsModule, FileUtil, FiltersComponent, FooterModule, FormatDocumentPipe, GenericErrorModalComponent, GenericErrorModalModule, GenericModalComponent, GenericModalModule, GeolocationService, GetSelectedCrudItemResolver, GetTokenByGuidGuard, HasPermissionGuard, HttpInterceptorProvider, InputNumberFieldComponent, LoadingService, MaskPipe, MaskUtil, MenuComponent, MenuModule, MenuService, MessageStatus, ModalService, MultiselectFieldComponent, NotHiddenPipe, ObjectUtil, OnlyActivePipe, PanelComponent, PanelModule, PercentageFieldComponent, PipesModule, ProfileModuleActionType, ProfileModuleType, ProfileService, RadioButtonFieldComponent, RangeValueComponent, RemoveLastChildPipe, Role, RoleGuard, SearchFieldComponent, SelectButtonFieldComponent, SelectionType, Status, StorageService, StringUtil, SubMenusListComponent, TableColumnType, TextFieldComponent, TextareaFieldComponent, TokenIsPresentGuard, TopBarComponent, TopBarModule, ValidationUtil, View, WindowUtil };
|
|
4141
4270
|
//# sourceMappingURL=ngx-vector-components.mjs.map
|