@c10t/nice-component-library 0.0.1-beta → 0.0.2-beta
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/components/cva-counter-input.component.d.ts +2 -2
- package/components/cva-input.component.d.ts +2 -2
- package/components/cva-multi-select-autocomplete.d.ts +2 -2
- package/components/cva-quill-editor.component.d.ts +2 -2
- package/components/cva-radiobutton.component.d.ts +2 -2
- package/components/datepicker/cva-date-picker.component.d.ts +2 -2
- package/components/datepicker/cva-range-date-picker.component.d.ts +2 -2
- package/components/tree/cva-flat-tree.component.d.ts +2 -2
- package/fesm2022/c10t-nice-component-library.mjs +49 -51
- package/fesm2022/c10t-nice-component-library.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +4 -4
- package/services/{ns-validator.service.d.ts → validator.service.d.ts} +3 -3
- package/src/styles/base.theme.scss +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, Injector, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { AbstractControl, ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
|
-
import {
|
|
3
|
+
import { ValidatorService } from '../services/validator.service';
|
|
4
4
|
import { AlignEnum } from '../enums/align.enum';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class CvaCounterInputComponent implements ControlValueAccessor, OnInit, OnChanges {
|
|
@@ -24,7 +24,7 @@ export declare class CvaCounterInputComponent implements ControlValueAccessor, O
|
|
|
24
24
|
isFormControl: boolean;
|
|
25
25
|
onChange: EventEmitter<number>;
|
|
26
26
|
formControl: AbstractControl | undefined;
|
|
27
|
-
get NsValidator(): typeof
|
|
27
|
+
get NsValidator(): typeof ValidatorService;
|
|
28
28
|
constructor(injector: Injector, ngControl: NgControl);
|
|
29
29
|
ngOnChanges(changes: SimpleChanges): void;
|
|
30
30
|
ngOnInit(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AfterViewInit, EventEmitter, Injector, OnInit } from '@angular/core';
|
|
2
2
|
import { AbstractControl, ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
|
-
import {
|
|
3
|
+
import { ValidatorService } from '../services/validator.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class CvaInputComponent implements ControlValueAccessor, OnInit, AfterViewInit {
|
|
6
6
|
private injector;
|
|
@@ -29,7 +29,7 @@ export declare class CvaInputComponent implements ControlValueAccessor, OnInit,
|
|
|
29
29
|
isFormControl: boolean;
|
|
30
30
|
formatFunc: any;
|
|
31
31
|
control: AbstractControl | undefined;
|
|
32
|
-
get NsValidator(): typeof
|
|
32
|
+
get NsValidator(): typeof ValidatorService;
|
|
33
33
|
constructor(injector: Injector, ngControl: NgControl);
|
|
34
34
|
ngAfterViewInit(): void;
|
|
35
35
|
ngOnInit(): void;
|
|
@@ -4,7 +4,7 @@ import { SelectModel } from '../models/components/select.model';
|
|
|
4
4
|
import { MatCheckboxChange } from '@angular/material/checkbox';
|
|
5
5
|
import { MatSelectChange } from '@angular/material/select';
|
|
6
6
|
import { TranslateService } from '@ngx-translate/core';
|
|
7
|
-
import {
|
|
7
|
+
import { ValidatorService } from '../services/validator.service';
|
|
8
8
|
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
9
9
|
import { MatOptionSelectionChange } from '@angular/material/core';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
@@ -37,7 +37,7 @@ export declare class CvaMultiSelectAutocomplete implements ControlValueAccessor,
|
|
|
37
37
|
get displayString(): string;
|
|
38
38
|
labelCount: number;
|
|
39
39
|
cdkVirtualScrollViewPort: CdkVirtualScrollViewport | undefined;
|
|
40
|
-
get NsValidator(): typeof
|
|
40
|
+
get NsValidator(): typeof ValidatorService;
|
|
41
41
|
constructor(translateService: TranslateService, injector: Injector, ngControl: NgControl);
|
|
42
42
|
ngOnInit(): void;
|
|
43
43
|
getRequired(): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter, Injector, OnInit } from '@angular/core';
|
|
2
2
|
import { AbstractControl, ControlValueAccessor, NgControl, ValidationErrors } from '@angular/forms';
|
|
3
3
|
import { QuillEditorComponent, QuillModules } from 'ngx-quill';
|
|
4
|
-
import {
|
|
4
|
+
import { ValidatorService } from '../services/validator.service';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class CvaQuillEditorComponent implements ControlValueAccessor, OnInit {
|
|
7
7
|
private injector;
|
|
@@ -33,7 +33,7 @@ export declare class CvaQuillEditorComponent implements ControlValueAccessor, On
|
|
|
33
33
|
isFormControl: boolean;
|
|
34
34
|
formatFunc: any;
|
|
35
35
|
control: AbstractControl | undefined;
|
|
36
|
-
get NsValidator(): typeof
|
|
36
|
+
get NsValidator(): typeof ValidatorService;
|
|
37
37
|
constructor(injector: Injector, ngControl: NgControl);
|
|
38
38
|
ngOnInit(): void;
|
|
39
39
|
get textValue(): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter, Injector, OnChanges, OnInit } from '@angular/core';
|
|
2
2
|
import { AbstractControl, ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
3
|
import { SelectModel } from '../models/components/select.model';
|
|
4
|
-
import {
|
|
4
|
+
import { ValidatorService } from "../services/validator.service";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class CvaRadiobuttonComponent implements ControlValueAccessor, OnChanges, OnInit {
|
|
7
7
|
private injector;
|
|
@@ -18,7 +18,7 @@ export declare class CvaRadiobuttonComponent implements ControlValueAccessor, On
|
|
|
18
18
|
control: AbstractControl | undefined;
|
|
19
19
|
get selectedValue(): number;
|
|
20
20
|
set selectedValue(val: number);
|
|
21
|
-
get NsValidator(): typeof
|
|
21
|
+
get NsValidator(): typeof ValidatorService;
|
|
22
22
|
constructor(injector: Injector, ngControl: NgControl);
|
|
23
23
|
ngOnChanges(): void;
|
|
24
24
|
ngOnInit(): void;
|
|
@@ -2,7 +2,7 @@ import { EventEmitter, Injector, OnInit } from '@angular/core';
|
|
|
2
2
|
import { AbstractControl, ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
3
|
import { DateUtilService } from '../../services/date-util.service';
|
|
4
4
|
import { NiceComponentLibraryConfig } from '../../models/nice-component-library.config';
|
|
5
|
-
import {
|
|
5
|
+
import { ValidatorService } from '../../services/validator.service';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class CvaDatePickerComponent implements ControlValueAccessor, OnInit {
|
|
8
8
|
private dateServiceUtil;
|
|
@@ -23,7 +23,7 @@ export declare class CvaDatePickerComponent implements ControlValueAccessor, OnI
|
|
|
23
23
|
config: NiceComponentLibraryConfig;
|
|
24
24
|
isFormControl: boolean;
|
|
25
25
|
formControl: AbstractControl | undefined;
|
|
26
|
-
get NsValidator(): typeof
|
|
26
|
+
get NsValidator(): typeof ValidatorService;
|
|
27
27
|
constructor(dateServiceUtil: DateUtilService, ngControl: NgControl, injector: Injector);
|
|
28
28
|
ngOnInit(): void;
|
|
29
29
|
callValidator(): void;
|
|
@@ -2,7 +2,7 @@ import { EventEmitter, Injector, OnInit } from '@angular/core';
|
|
|
2
2
|
import { AbstractControl, ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
3
|
import { RangeDatePickerModel } from '../../models/components/range-date-picker.model';
|
|
4
4
|
import { DateUtilService } from '../../services/date-util.service';
|
|
5
|
-
import {
|
|
5
|
+
import { ValidatorService } from '../../services/validator.service';
|
|
6
6
|
import { MatDateRangePicker } from '@angular/material/datepicker';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class CvaRangeDatePickerComponent implements ControlValueAccessor, OnInit {
|
|
@@ -38,7 +38,7 @@ export declare class CvaRangeDatePickerComponent implements ControlValueAccessor
|
|
|
38
38
|
isFormControl: boolean;
|
|
39
39
|
formControl: AbstractControl | undefined;
|
|
40
40
|
defaultFromDate: any;
|
|
41
|
-
get NsValiator(): typeof
|
|
41
|
+
get NsValiator(): typeof ValidatorService;
|
|
42
42
|
constructor(dateServiceUtil: DateUtilService, ngControl: NgControl, injector: Injector);
|
|
43
43
|
get fromDateValue(): any;
|
|
44
44
|
set fromDateValue(val: any);
|
|
@@ -5,7 +5,7 @@ import { AbstractControl, ControlValueAccessor, NgControl } from '@angular/forms
|
|
|
5
5
|
import { TranslateService } from '@ngx-translate/core';
|
|
6
6
|
import { FlatTreeConfigModel } from '../../models/components/flat-tree-config.model';
|
|
7
7
|
import { FlatTreeNodeModel } from '../../models/components/flat-tree-node.model';
|
|
8
|
-
import {
|
|
8
|
+
import { ValidatorService } from '../../services/validator.service';
|
|
9
9
|
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
export declare class CvaFlatTreeComponent implements ControlValueAccessor, OnInit, AfterViewInit, OnChanges {
|
|
@@ -52,7 +52,7 @@ export declare class CvaFlatTreeComponent implements ControlValueAccessor, OnIni
|
|
|
52
52
|
formControl: AbstractControl | undefined;
|
|
53
53
|
chooseVirtualScroll?: CdkVirtualScrollViewport;
|
|
54
54
|
selectedVirtualScroll?: CdkVirtualScrollViewport;
|
|
55
|
-
get NsValiator(): typeof
|
|
55
|
+
get NsValiator(): typeof ValidatorService;
|
|
56
56
|
constructor(translateService: TranslateService, injector: Injector, cdr: ChangeDetectorRef, ngControl: NgControl);
|
|
57
57
|
setSelectedNode(): void;
|
|
58
58
|
setDataSourceOrigin(): void;
|
|
@@ -1522,7 +1522,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
1522
1522
|
type: Injectable
|
|
1523
1523
|
}] });
|
|
1524
1524
|
|
|
1525
|
-
class
|
|
1525
|
+
class ValidatorService {
|
|
1526
1526
|
static invalid(control) {
|
|
1527
1527
|
return !!control && control.dirty ? control.invalid : false;
|
|
1528
1528
|
}
|
|
@@ -1559,7 +1559,7 @@ class NsValidator {
|
|
|
1559
1559
|
const validationFns = [];
|
|
1560
1560
|
const validation = (control) => {
|
|
1561
1561
|
const value = control.value;
|
|
1562
|
-
if (
|
|
1562
|
+
if (ValidatorService.getRequiredDynamic(conditions.required) && (value === undefined || value === null || value === ''
|
|
1563
1563
|
|| (!!conditions.multiple && value.length === 0))) {
|
|
1564
1564
|
return { required: true };
|
|
1565
1565
|
}
|
|
@@ -1595,13 +1595,13 @@ class NsValidator {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
if (conditions.min != undefined && conditions.min != null) {
|
|
1597
1597
|
const validationMin = (control) => {
|
|
1598
|
-
return
|
|
1598
|
+
return ValidatorService.customMinValueNsCounterInput(control.value, ValidatorService.getMinMaxDynamic(conditions.min));
|
|
1599
1599
|
};
|
|
1600
1600
|
validationFns.push(validationMin);
|
|
1601
1601
|
}
|
|
1602
1602
|
if (conditions.max != undefined && conditions.max != null) {
|
|
1603
1603
|
const validationMax = (control) => {
|
|
1604
|
-
return
|
|
1604
|
+
return ValidatorService.customMaxValueNsCounterInput(control.value, ValidatorService.getMinMaxDynamic(conditions.max));
|
|
1605
1605
|
};
|
|
1606
1606
|
validationFns.push(validationMax);
|
|
1607
1607
|
}
|
|
@@ -1629,10 +1629,10 @@ class NsValidator {
|
|
|
1629
1629
|
// || NsValidator.getRequiredDynamic(conditions.requiredToDate)) {
|
|
1630
1630
|
const validation = (control) => {
|
|
1631
1631
|
const range = control.value;
|
|
1632
|
-
if (!range?.fromDate &&
|
|
1632
|
+
if (!range?.fromDate && ValidatorService.getRequiredDynamic(conditions.requiredFromDate)) {
|
|
1633
1633
|
return { requiredFromDate: true };
|
|
1634
1634
|
}
|
|
1635
|
-
if (!range?.toDate &&
|
|
1635
|
+
if (!range?.toDate && ValidatorService.getRequiredDynamic(conditions.requiredToDate)) {
|
|
1636
1636
|
return { requiredToDate: true };
|
|
1637
1637
|
}
|
|
1638
1638
|
return null;
|
|
@@ -1713,28 +1713,28 @@ class NsValidator {
|
|
|
1713
1713
|
const tempControl = new FormControl();
|
|
1714
1714
|
tempControl.setValue(row[column.columnDef]);
|
|
1715
1715
|
if (TableService.getColumnType(column, row) === ColumnTypeEnum.MULTI_SELECT_AUTOCOMPLETE) {
|
|
1716
|
-
if (
|
|
1716
|
+
if (ValidatorService.getRequired(column)) {
|
|
1717
1717
|
tempControl.setValidators(Validators.required);
|
|
1718
1718
|
}
|
|
1719
1719
|
}
|
|
1720
1720
|
else if (TableService.getColumnType(column, row) === ColumnTypeEnum.INPUT_COUNTER) {
|
|
1721
|
-
tempControl.setValidators(
|
|
1722
|
-
required:
|
|
1721
|
+
tempControl.setValidators(ValidatorService.generateNsCounterInputValidators({
|
|
1722
|
+
required: ValidatorService.getRequired(column),
|
|
1723
1723
|
min: null,
|
|
1724
1724
|
max: null,
|
|
1725
|
-
isDecimal:
|
|
1725
|
+
isDecimal: ValidatorService.getIsDecimal(column),
|
|
1726
1726
|
}));
|
|
1727
1727
|
}
|
|
1728
1728
|
else if (TableService.getColumnType(column, row) === ColumnTypeEnum.DATE_PICKER) {
|
|
1729
|
-
tempControl.setValidators(
|
|
1730
|
-
required:
|
|
1729
|
+
tempControl.setValidators(ValidatorService.generateNsDatePickerValidators({
|
|
1730
|
+
required: ValidatorService.getRequired(column),
|
|
1731
1731
|
min: null,
|
|
1732
1732
|
max: null,
|
|
1733
1733
|
}));
|
|
1734
1734
|
}
|
|
1735
1735
|
else if (TableService.getColumnType(column, row) === ColumnTypeEnum.INPUT) {
|
|
1736
|
-
tempControl.setValidators(
|
|
1737
|
-
required:
|
|
1736
|
+
tempControl.setValidators(ValidatorService.generateNsInputValidators({
|
|
1737
|
+
required: ValidatorService.getRequired(column),
|
|
1738
1738
|
maxLength: column.max ? column.max(row) : undefined,
|
|
1739
1739
|
minLength: column.min ? column.min(row) : undefined,
|
|
1740
1740
|
pattern: undefined
|
|
@@ -1746,11 +1746,11 @@ class NsValidator {
|
|
|
1746
1746
|
if (tempControl.errors) {
|
|
1747
1747
|
errorsArr.push(tempControl.errors);
|
|
1748
1748
|
}
|
|
1749
|
-
if (
|
|
1750
|
-
errorsArr.push(
|
|
1749
|
+
if (ValidatorService.customMinDateValidatorControl(tempControl.value, column.min ? column.min(row) : null)) {
|
|
1750
|
+
errorsArr.push(ValidatorService.customMinDateValidatorControl(tempControl.value, column.min ? column.min(row) : null));
|
|
1751
1751
|
}
|
|
1752
|
-
if (
|
|
1753
|
-
errorsArr.push(
|
|
1752
|
+
if (ValidatorService.customMaxDateValidatorControl(tempControl.value, column.max ? column.max(row) : null)) {
|
|
1753
|
+
errorsArr.push(ValidatorService.customMaxDateValidatorControl(tempControl.value, column.max ? column.max(row) : null));
|
|
1754
1754
|
}
|
|
1755
1755
|
if (errorsArr.length > 0) {
|
|
1756
1756
|
tempControl.setErrors(errorsArr);
|
|
@@ -1761,11 +1761,11 @@ class NsValidator {
|
|
|
1761
1761
|
if (tempControl.errors) {
|
|
1762
1762
|
errorsArr.push(tempControl.errors);
|
|
1763
1763
|
}
|
|
1764
|
-
if (
|
|
1765
|
-
errorsArr.push(
|
|
1764
|
+
if (ValidatorService.customMinValueNsCounterInput(tempControl.value, column.min ? column.min(row) : null)) {
|
|
1765
|
+
errorsArr.push(ValidatorService.customMinValueNsCounterInput(tempControl.value, column.min ? column.min(row) : null));
|
|
1766
1766
|
}
|
|
1767
|
-
if (
|
|
1768
|
-
errorsArr.push(
|
|
1767
|
+
if (ValidatorService.customMaxValueNsCounterInput(tempControl.value, column.max ? column.max(row) : null)) {
|
|
1768
|
+
errorsArr.push(ValidatorService.customMaxValueNsCounterInput(tempControl.value, column.max ? column.max(row) : null));
|
|
1769
1769
|
}
|
|
1770
1770
|
if (errorsArr.length > 0) {
|
|
1771
1771
|
tempControl.setErrors(errorsArr);
|
|
@@ -1781,10 +1781,10 @@ class NsValidator {
|
|
|
1781
1781
|
};
|
|
1782
1782
|
return validator;
|
|
1783
1783
|
}
|
|
1784
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type:
|
|
1785
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type:
|
|
1784
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ValidatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1785
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ValidatorService });
|
|
1786
1786
|
}
|
|
1787
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type:
|
|
1787
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ValidatorService, decorators: [{
|
|
1788
1788
|
type: Injectable
|
|
1789
1789
|
}] });
|
|
1790
1790
|
|
|
@@ -1813,7 +1813,7 @@ class CvaCounterInputComponent {
|
|
|
1813
1813
|
// Cái này là để gắn khi nó là FormControl trong 1 FormGroup
|
|
1814
1814
|
formControl;
|
|
1815
1815
|
get NsValidator() {
|
|
1816
|
-
return
|
|
1816
|
+
return ValidatorService;
|
|
1817
1817
|
}
|
|
1818
1818
|
constructor(injector, ngControl) {
|
|
1819
1819
|
this.injector = injector;
|
|
@@ -1863,7 +1863,7 @@ class CvaCounterInputComponent {
|
|
|
1863
1863
|
// - Nếu this.formControl là parent FormControl thì sẽ show error lên FormGroup
|
|
1864
1864
|
// - Nếu this.formControl là new FormControl thì sẽ quét QueryList để check {errors}
|
|
1865
1865
|
if (this.formControl) {
|
|
1866
|
-
this.formControl.setValidators(
|
|
1866
|
+
this.formControl.setValidators(ValidatorService.generateNsCounterInputValidators({
|
|
1867
1867
|
required: this.required,
|
|
1868
1868
|
min: this.min,
|
|
1869
1869
|
max: this.max,
|
|
@@ -1879,11 +1879,11 @@ class CvaCounterInputComponent {
|
|
|
1879
1879
|
// Nếu là parent FormControl rồi thì kệ
|
|
1880
1880
|
this.formControl.updateValueAndValidity();
|
|
1881
1881
|
if (!this.formControl.errors) {
|
|
1882
|
-
const minErr =
|
|
1882
|
+
const minErr = ValidatorService.customMinValueNsCounterInput(this.value, this.getMinNumber());
|
|
1883
1883
|
if (minErr) {
|
|
1884
1884
|
this.formControl.setErrors(minErr);
|
|
1885
1885
|
}
|
|
1886
|
-
const maxErr =
|
|
1886
|
+
const maxErr = ValidatorService.customMaxValueNsCounterInput(this.value, this.getMaxNumber());
|
|
1887
1887
|
if (maxErr) {
|
|
1888
1888
|
this.formControl.setErrors(maxErr);
|
|
1889
1889
|
}
|
|
@@ -3207,7 +3207,7 @@ class CvaInputComponent {
|
|
|
3207
3207
|
formatFunc;
|
|
3208
3208
|
control = undefined;
|
|
3209
3209
|
get NsValidator() {
|
|
3210
|
-
return
|
|
3210
|
+
return ValidatorService;
|
|
3211
3211
|
}
|
|
3212
3212
|
constructor(injector, ngControl) {
|
|
3213
3213
|
this.injector = injector;
|
|
@@ -3249,7 +3249,7 @@ class CvaInputComponent {
|
|
|
3249
3249
|
// - Nếu this.formControl là new FormControl thì sẽ quét QueryList để check {errors}
|
|
3250
3250
|
if (this.control) {
|
|
3251
3251
|
if (this.control.validator) {
|
|
3252
|
-
this.control.setValidators([...
|
|
3252
|
+
this.control.setValidators([...ValidatorService.generateNsInputValidators({
|
|
3253
3253
|
required: this.required,
|
|
3254
3254
|
minLength: this.minLength,
|
|
3255
3255
|
maxLength: this.maxLength,
|
|
@@ -3257,7 +3257,7 @@ class CvaInputComponent {
|
|
|
3257
3257
|
}), this.control.validator]);
|
|
3258
3258
|
}
|
|
3259
3259
|
else {
|
|
3260
|
-
this.control.setValidators([...
|
|
3260
|
+
this.control.setValidators([...ValidatorService.generateNsInputValidators({
|
|
3261
3261
|
required: this.required,
|
|
3262
3262
|
minLength: this.minLength,
|
|
3263
3263
|
maxLength: this.maxLength,
|
|
@@ -3604,7 +3604,7 @@ class CvaDatePickerComponent {
|
|
|
3604
3604
|
isFormControl = true;
|
|
3605
3605
|
formControl;
|
|
3606
3606
|
get NsValidator() {
|
|
3607
|
-
return
|
|
3607
|
+
return ValidatorService;
|
|
3608
3608
|
}
|
|
3609
3609
|
constructor(dateServiceUtil, ngControl, injector) {
|
|
3610
3610
|
this.dateServiceUtil = dateServiceUtil;
|
|
@@ -3635,7 +3635,7 @@ class CvaDatePickerComponent {
|
|
|
3635
3635
|
// - Nếu this.formControl là parent FormControl thì sẽ show error lên FormGroup
|
|
3636
3636
|
// - Nếu this.formControl là new FormControl thì sẽ quét QueryList để check {errors}
|
|
3637
3637
|
if (this.formControl) {
|
|
3638
|
-
this.formControl.setValidators(
|
|
3638
|
+
this.formControl.setValidators(ValidatorService.generateNsDatePickerValidators({
|
|
3639
3639
|
required: this.required,
|
|
3640
3640
|
min: this.getMinDate(),
|
|
3641
3641
|
max: this.getMaxDate(),
|
|
@@ -3656,13 +3656,13 @@ class CvaDatePickerComponent {
|
|
|
3656
3656
|
errorsObj[key] = errors[key];
|
|
3657
3657
|
});
|
|
3658
3658
|
}
|
|
3659
|
-
const minValidation =
|
|
3659
|
+
const minValidation = ValidatorService.customMinDateValidatorControl(this.value, this.getMinDate());
|
|
3660
3660
|
if (minValidation) {
|
|
3661
3661
|
Object.keys(minValidation).forEach(key => {
|
|
3662
3662
|
errorsObj[key] = minValidation[key];
|
|
3663
3663
|
});
|
|
3664
3664
|
}
|
|
3665
|
-
const maxValidation =
|
|
3665
|
+
const maxValidation = ValidatorService.customMaxDateValidatorControl(this.value, this.getMaxDate());
|
|
3666
3666
|
if (maxValidation) {
|
|
3667
3667
|
Object.keys(maxValidation).forEach(key => {
|
|
3668
3668
|
errorsObj[key] = maxValidation[key];
|
|
@@ -3904,7 +3904,7 @@ class CvaMultiSelectAutocomplete {
|
|
|
3904
3904
|
labelCount = 1;
|
|
3905
3905
|
cdkVirtualScrollViewPort;
|
|
3906
3906
|
get NsValidator() {
|
|
3907
|
-
return
|
|
3907
|
+
return ValidatorService;
|
|
3908
3908
|
}
|
|
3909
3909
|
constructor(translateService, injector, ngControl) {
|
|
3910
3910
|
this.translateService = translateService;
|
|
@@ -3930,7 +3930,7 @@ class CvaMultiSelectAutocomplete {
|
|
|
3930
3930
|
this.formControl = new FormControl();
|
|
3931
3931
|
}
|
|
3932
3932
|
if (this.formControl) {
|
|
3933
|
-
this.formControl.setValidators(
|
|
3933
|
+
this.formControl.setValidators(ValidatorService.generateNsMultiSelectValidators({
|
|
3934
3934
|
required: this.required,
|
|
3935
3935
|
multiple: this.multiple,
|
|
3936
3936
|
}));
|
|
@@ -4583,7 +4583,7 @@ class CvaSmartTableComponent {
|
|
|
4583
4583
|
this.formControl = new FormControl();
|
|
4584
4584
|
}
|
|
4585
4585
|
if (this.formControl) {
|
|
4586
|
-
this.formControl.setValidators(
|
|
4586
|
+
this.formControl.setValidators(ValidatorService.generateNsSmartTableValidators({
|
|
4587
4587
|
columns: this.columns,
|
|
4588
4588
|
minRow: this.minRow,
|
|
4589
4589
|
maxRow: this.maxRow,
|
|
@@ -5179,7 +5179,7 @@ class CvaRangeDatePickerComponent {
|
|
|
5179
5179
|
formControl;
|
|
5180
5180
|
defaultFromDate; // lưu giá trị khởi tạo ban đầu khi truyền từ bên ngoài vào
|
|
5181
5181
|
get NsValiator() {
|
|
5182
|
-
return
|
|
5182
|
+
return ValidatorService;
|
|
5183
5183
|
}
|
|
5184
5184
|
constructor(dateServiceUtil, ngControl, injector) {
|
|
5185
5185
|
this.dateServiceUtil = dateServiceUtil;
|
|
@@ -5317,7 +5317,7 @@ class CvaRangeDatePickerComponent {
|
|
|
5317
5317
|
}
|
|
5318
5318
|
}
|
|
5319
5319
|
if (!(this.getDisabled(this.disabledFromDate) || this.getDisabled(this.disabledAll))) {
|
|
5320
|
-
const minValidation =
|
|
5320
|
+
const minValidation = ValidatorService.customMinDateValidatorControl(this.value.fromDate, this.getMinDate());
|
|
5321
5321
|
if (minValidation) {
|
|
5322
5322
|
Object.keys(minValidation).forEach(key => {
|
|
5323
5323
|
errorsObj[key] = minValidation[key];
|
|
@@ -5325,7 +5325,7 @@ class CvaRangeDatePickerComponent {
|
|
|
5325
5325
|
this.formControl.markAsDirty();
|
|
5326
5326
|
}
|
|
5327
5327
|
}
|
|
5328
|
-
const maxValidation =
|
|
5328
|
+
const maxValidation = ValidatorService.customMaxDateValidatorControl(this.value.toDate, this.getMaxDate());
|
|
5329
5329
|
if (maxValidation) {
|
|
5330
5330
|
Object.keys(maxValidation).forEach(key => {
|
|
5331
5331
|
errorsObj[key] = maxValidation[key];
|
|
@@ -6838,7 +6838,7 @@ class CvaRadiobuttonComponent {
|
|
|
6838
6838
|
this.writeValue(val);
|
|
6839
6839
|
}
|
|
6840
6840
|
get NsValidator() {
|
|
6841
|
-
return
|
|
6841
|
+
return ValidatorService;
|
|
6842
6842
|
}
|
|
6843
6843
|
constructor(injector, ngControl) {
|
|
6844
6844
|
this.injector = injector;
|
|
@@ -6973,8 +6973,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
6973
6973
|
</div>
|
|
6974
6974
|
</div>
|
|
6975
6975
|
`,
|
|
6976
|
-
// encapsulation: ViewEncapsulation.None,
|
|
6977
|
-
// styleUrls: ['../styles/ns-style/cva-radio-button.scss'],
|
|
6978
6976
|
}]
|
|
6979
6977
|
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1$2.NgControl, decorators: [{
|
|
6980
6978
|
type: Self
|
|
@@ -7338,7 +7336,7 @@ class CvaFlatTreeComponent {
|
|
|
7338
7336
|
chooseVirtualScroll;
|
|
7339
7337
|
selectedVirtualScroll;
|
|
7340
7338
|
get NsValiator() {
|
|
7341
|
-
return
|
|
7339
|
+
return ValidatorService;
|
|
7342
7340
|
}
|
|
7343
7341
|
constructor(translateService, injector, cdr, ngControl) {
|
|
7344
7342
|
this.translateService = translateService;
|
|
@@ -8264,7 +8262,7 @@ class CvaQuillEditorComponent {
|
|
|
8264
8262
|
formatFunc;
|
|
8265
8263
|
control = undefined;
|
|
8266
8264
|
get NsValidator() {
|
|
8267
|
-
return
|
|
8265
|
+
return ValidatorService;
|
|
8268
8266
|
}
|
|
8269
8267
|
constructor(injector, ngControl) {
|
|
8270
8268
|
this.injector = injector;
|
|
@@ -8347,7 +8345,7 @@ class CvaQuillEditorComponent {
|
|
|
8347
8345
|
// - Nếu this.formControl là new FormControl thì sẽ quét QueryList để check {errors}
|
|
8348
8346
|
if (this.control) {
|
|
8349
8347
|
if (this.control.validator) {
|
|
8350
|
-
this.control.setValidators([...
|
|
8348
|
+
this.control.setValidators([...ValidatorService.generateNsInputValidators({
|
|
8351
8349
|
required: this.required,
|
|
8352
8350
|
minLength: undefined,
|
|
8353
8351
|
maxLength: undefined,
|
|
@@ -8355,7 +8353,7 @@ class CvaQuillEditorComponent {
|
|
|
8355
8353
|
}), this.control.validator, this.customLengthValidator, this.customSizeValidator]);
|
|
8356
8354
|
}
|
|
8357
8355
|
else {
|
|
8358
|
-
this.control.setValidators([...
|
|
8356
|
+
this.control.setValidators([...ValidatorService.generateNsInputValidators({
|
|
8359
8357
|
required: this.required,
|
|
8360
8358
|
minLength: undefined,
|
|
8361
8359
|
maxLength: undefined,
|
|
@@ -8860,7 +8858,7 @@ class NiceComponentLibraryModule {
|
|
|
8860
8858
|
return {
|
|
8861
8859
|
ngModule: NiceComponentLibraryModule,
|
|
8862
8860
|
providers: [
|
|
8863
|
-
ApiService, DateUtilService, FormStateService, UtilsService, LoaderService,
|
|
8861
|
+
ApiService, DateUtilService, FormStateService, UtilsService, LoaderService, ValidatorService,
|
|
8864
8862
|
AuthoritiesService, AuthoritiesResolverService, SingletonTranslateService,
|
|
8865
8863
|
{ provide: InjectTokenNextSolutionsConfig, useValue: config ? config.data : {} }
|
|
8866
8864
|
],
|
|
@@ -9020,5 +9018,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
9020
9018
|
* Generated bundle index. Do not edit.
|
|
9021
9019
|
*/
|
|
9022
9020
|
|
|
9023
|
-
export { ActionTypeEnum, AlignEnum, ApiService, AuthoritiesResolverService, AuthoritiesService, Authority, BaseAddEditComponent, BaseModel, BaseSearchComponent, BaseTableComponent, BreadCrumbModel, ButtonClickEvent, ButtonModel, CheckboxModel, ColumnModel, ColumnTypeEnum, CustomDialogDataConfigModel, CvaBreadcrumbComponent, CvaCounterInputComponent, CvaCustomDialogComponent, CvaDatePickerComponent, CvaDialogImportFileComponent, CvaFlatTreeComponent, CvaFlatTreeNodeLeftComponent, CvaFlatTreeNodeRightComponent, CvaInputComponent, CvaLoaderComponent, CvaMultiSelectAutocomplete, CvaMultiUploadComponent, CvaMultiUploadImgComponent, CvaQuillEditorComponent, CvaRadiobuttonComponent, CvaRangeDatePickerComponent, CvaSmartTableComponent, CvaTableComponent, CvaTreeComponent, CvaUploadFileComponent, DateUtilService, DialogImportFileConfigModel, DialogTypeEnum, DragDropDirective, FileTypeEnum, FlatTreeConfigModel, FlatTreeModel, FlatTreeNodeModel, FormStateService, FormatInputDirective, IconTypeEnum, InjectTokenNextSolutionsConfig, JsogHttpInterceptor, LoaderInterceptor, LoaderService, MenuModel, MultiTranslateHttpLoader, NavigatorModel, NiceComponentLibraryModule,
|
|
9021
|
+
export { ActionTypeEnum, AlignEnum, ApiService, AuthoritiesResolverService, AuthoritiesService, Authority, BaseAddEditComponent, BaseModel, BaseSearchComponent, BaseTableComponent, BreadCrumbModel, ButtonClickEvent, ButtonModel, CheckboxModel, ColumnModel, ColumnTypeEnum, CustomDialogDataConfigModel, CvaBreadcrumbComponent, CvaCounterInputComponent, CvaCustomDialogComponent, CvaDatePickerComponent, CvaDialogImportFileComponent, CvaFlatTreeComponent, CvaFlatTreeNodeLeftComponent, CvaFlatTreeNodeRightComponent, CvaInputComponent, CvaLoaderComponent, CvaMultiSelectAutocomplete, CvaMultiUploadComponent, CvaMultiUploadImgComponent, CvaQuillEditorComponent, CvaRadiobuttonComponent, CvaRangeDatePickerComponent, CvaSmartTableComponent, CvaTableComponent, CvaTreeComponent, CvaUploadFileComponent, DateUtilService, DialogImportFileConfigModel, DialogTypeEnum, DragDropDirective, FileTypeEnum, FlatTreeConfigModel, FlatTreeModel, FlatTreeNodeModel, FormStateService, FormatInputDirective, IconTypeEnum, InjectTokenNextSolutionsConfig, JsogHttpInterceptor, LoaderInterceptor, LoaderService, MenuModel, MultiTranslateHttpLoader, NavigatorModel, NiceComponentLibraryModule, OAuth2AuthenticationDto, PatternDirective, PermissionModel, Principal, RangeDatePickerModel, RoleModel, SecureImgPipe, SelectModel, SingletonTranslateService, StylePaginatorDirective, TableFooterModel, TablePagingRequestModel, TablePagingResponseModel, TableService, UIState, UploadModel, UtilsService, ValidatorService };
|
|
9024
9022
|
//# sourceMappingURL=c10t-nice-component-library.mjs.map
|