@c10t/nice-component-library 0.0.21-d → 0.0.21-f
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, Injector, OnInit } from '@angular/core';
|
|
2
2
|
import { AbstractControl, ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
|
+
import { MatDatepicker } from '@angular/material/datepicker';
|
|
3
4
|
import { DateUtilService } from '../../services/date-util.service';
|
|
4
5
|
import { NiceComponentLibraryConfig } from '../../models/nice-component-library.config';
|
|
5
6
|
import { ValidatorService } from '../../services/validator.service';
|
|
@@ -23,6 +24,7 @@ export declare class CvaDatePickerComponent implements ControlValueAccessor, OnI
|
|
|
23
24
|
config: NiceComponentLibraryConfig;
|
|
24
25
|
isFormControl: boolean;
|
|
25
26
|
formControl: AbstractControl | undefined;
|
|
27
|
+
datepicker: MatDatepicker<any> | undefined;
|
|
26
28
|
constructor(dateServiceUtil: DateUtilService, ngControl: NgControl, injector: Injector);
|
|
27
29
|
get NsValidator(): typeof ValidatorService;
|
|
28
30
|
get datepickerValue(): any;
|
|
@@ -39,6 +41,7 @@ export declare class CvaDatePickerComponent implements ControlValueAccessor, OnI
|
|
|
39
41
|
getMaxDate(): Date;
|
|
40
42
|
isString(inputValue: any): boolean;
|
|
41
43
|
isShowControl(): boolean;
|
|
44
|
+
openDatepicker(event: MouseEvent): void;
|
|
42
45
|
static ɵfac: i0.ɵɵFactoryDeclaration<CvaDatePickerComponent, [null, { optional: true; self: true; }, null]>;
|
|
43
46
|
static ɵcmp: i0.ɵɵComponentDeclaration<CvaDatePickerComponent, "cva-date-picker", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "isLabelOutside": { "alias": "isLabelOutside"; "required": false; }; "isFloatLabel": { "alias": "isFloatLabel"; "required": false; }; "percentOfLabelOutside": { "alias": "percentOfLabelOutside"; "required": false; }; "isFormControl": { "alias": "isFormControl"; "required": false; }; }, { "onChange": "onChange"; }, never, never, false, never>;
|
|
44
47
|
}
|
|
@@ -38,6 +38,7 @@ export declare class CvaRangeDatePickerComponent implements ControlValueAccessor
|
|
|
38
38
|
isFormControl: boolean;
|
|
39
39
|
formControl: AbstractControl | undefined;
|
|
40
40
|
defaultFromDate: any;
|
|
41
|
+
picker: MatDateRangePicker<any> | undefined;
|
|
41
42
|
constructor(dateServiceUtil: DateUtilService, ngControl: NgControl, injector: Injector);
|
|
42
43
|
get NsValiator(): typeof ValidatorService;
|
|
43
44
|
get fromDateValue(): any;
|
|
@@ -59,6 +60,7 @@ export declare class CvaRangeDatePickerComponent implements ControlValueAccessor
|
|
|
59
60
|
checkRequired(isRequired: boolean | (() => boolean)): boolean;
|
|
60
61
|
clearRange(event: Event): void;
|
|
61
62
|
openPicker(picker: MatDateRangePicker<any>): void;
|
|
63
|
+
openRangePicker(event: MouseEvent): void;
|
|
62
64
|
static ɵfac: i0.ɵɵFactoryDeclaration<CvaRangeDatePickerComponent, [null, { optional: true; self: true; }, null]>;
|
|
63
65
|
static ɵcmp: i0.ɵɵComponentDeclaration<CvaRangeDatePickerComponent, "cva-range-date-picker", never, { "label": { "alias": "label"; "required": false; }; "placeholderFromDate": { "alias": "placeholderFromDate"; "required": false; }; "placeholderToDate": { "alias": "placeholderToDate"; "required": false; }; "disabledAll": { "alias": "disabledAll"; "required": false; }; "disabledFromDate": { "alias": "disabledFromDate"; "required": false; }; "value": { "alias": "value"; "required": false; }; "requiredFromDate": { "alias": "requiredFromDate"; "required": false; }; "requiredToDate": { "alias": "requiredToDate"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "isLabelOutside": { "alias": "isLabelOutside"; "required": false; }; "isFloatLabel": { "alias": "isFloatLabel"; "required": false; }; "percentOfLabelOutside": { "alias": "percentOfLabelOutside"; "required": false; }; "fromDateControlName": { "alias": "fromDateControlName"; "required": false; }; "toDateControlName": { "alias": "toDateControlName"; "required": false; }; "isFormControl": { "alias": "isFormControl"; "required": false; }; }, { "onChange": "onChange"; "onOpenPicker": "onOpenPicker"; }, never, never, false, never>;
|
|
64
66
|
}
|
|
@@ -3772,6 +3772,7 @@ class CvaDatePickerComponent {
|
|
|
3772
3772
|
// Chỉ bằng false khi trong NsSmartTable thôi @@
|
|
3773
3773
|
isFormControl = true;
|
|
3774
3774
|
formControl;
|
|
3775
|
+
datepicker;
|
|
3775
3776
|
constructor(dateServiceUtil, ngControl, injector) {
|
|
3776
3777
|
this.dateServiceUtil = dateServiceUtil;
|
|
3777
3778
|
this.injector = injector;
|
|
@@ -3912,6 +3913,12 @@ class CvaDatePickerComponent {
|
|
|
3912
3913
|
isShowControl() {
|
|
3913
3914
|
return !this.disabled || (this.disabled && this.config && this.config.STYLE_DISABLE === 'CONTROL');
|
|
3914
3915
|
}
|
|
3916
|
+
openDatepicker(event) {
|
|
3917
|
+
if (!this.disabled && this.datepicker) {
|
|
3918
|
+
event.stopPropagation();
|
|
3919
|
+
this.datepicker.open();
|
|
3920
|
+
}
|
|
3921
|
+
}
|
|
3915
3922
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaDatePickerComponent, deps: [{ token: DateUtilService }, { token: i1$2.NgControl, optional: true, self: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
3916
3923
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaDatePickerComponent, isStandalone: false, selector: "cva-date-picker", inputs: { label: "label", placeholder: "placeholder", value: "value", disabled: "disabled", required: "required", minDate: "minDate", maxDate: "maxDate", errorMessages: "errorMessages", isLabelOutside: "isLabelOutside", isFloatLabel: "isFloatLabel", percentOfLabelOutside: "percentOfLabelOutside", isFormControl: "isFormControl" }, outputs: { onChange: "onChange" }, providers: [
|
|
3917
3924
|
{ provide: DateAdapter, useClass: NsDateAdapter },
|
|
@@ -3919,7 +3926,7 @@ class CvaDatePickerComponent {
|
|
|
3919
3926
|
provide: MAT_DATE_FORMATS,
|
|
3920
3927
|
useValue: APP_DATE_FORMATS,
|
|
3921
3928
|
},
|
|
3922
|
-
], ngImport: i0, template: `
|
|
3929
|
+
], viewQueries: [{ propertyName: "datepicker", first: true, predicate: ["xDatepicker"], descendants: true }], ngImport: i0, template: `
|
|
3923
3930
|
<!-- css labelOutside trong base.theme-->
|
|
3924
3931
|
<div class="cva-date-picker"
|
|
3925
3932
|
[ngClass]="{'labelOutside': isLabelOutside, 'float_label': isFloatLabel && !isLabelOutside}"
|
|
@@ -3945,7 +3952,8 @@ class CvaDatePickerComponent {
|
|
|
3945
3952
|
[readonly]="true"
|
|
3946
3953
|
[required]="checkRequired(required)"
|
|
3947
3954
|
[title]="title ? title : ''"
|
|
3948
|
-
[min]="getMinDate()" [max]="getMaxDate()"
|
|
3955
|
+
[min]="getMinDate()" [max]="getMaxDate()"
|
|
3956
|
+
(click)="openDatepicker($event)">
|
|
3949
3957
|
<mat-datepicker-toggle matPrefix [for]="xDatepicker" [disabled]="disabled"></mat-datepicker-toggle>
|
|
3950
3958
|
<mat-datepicker #xDatepicker></mat-datepicker>
|
|
3951
3959
|
<button mat-icon-button color="warn" class="btnDatePicker" matSuffix (click)="onClear()" [disabled]="disabled">
|
|
@@ -4002,7 +4010,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
4002
4010
|
[readonly]="true"
|
|
4003
4011
|
[required]="checkRequired(required)"
|
|
4004
4012
|
[title]="title ? title : ''"
|
|
4005
|
-
[min]="getMinDate()" [max]="getMaxDate()"
|
|
4013
|
+
[min]="getMinDate()" [max]="getMaxDate()"
|
|
4014
|
+
(click)="openDatepicker($event)">
|
|
4006
4015
|
<mat-datepicker-toggle matPrefix [for]="xDatepicker" [disabled]="disabled"></mat-datepicker-toggle>
|
|
4007
4016
|
<mat-datepicker #xDatepicker></mat-datepicker>
|
|
4008
4017
|
<button mat-icon-button color="warn" class="btnDatePicker" matSuffix (click)="onClear()" [disabled]="disabled">
|
|
@@ -4065,6 +4074,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
4065
4074
|
type: Input
|
|
4066
4075
|
}], isFormControl: [{
|
|
4067
4076
|
type: Input
|
|
4077
|
+
}], datepicker: [{
|
|
4078
|
+
type: ViewChild,
|
|
4079
|
+
args: ['xDatepicker']
|
|
4068
4080
|
}] } });
|
|
4069
4081
|
|
|
4070
4082
|
class CvaMultiSelectAutocomplete {
|
|
@@ -5291,7 +5303,7 @@ class CvaSmartTableComponent {
|
|
|
5291
5303
|
class="{{TableService.getColumnClassName(column, result)}}"
|
|
5292
5304
|
fxLayout="row" [fxLayoutAlign]="TableService.alignCellContent(column)"
|
|
5293
5305
|
(click)="$event.stopPropagation()">
|
|
5294
|
-
<button mat-icon-button
|
|
5306
|
+
<button mat-icon-button type="button"
|
|
5295
5307
|
color="{{column.button.color}}"
|
|
5296
5308
|
[ngClass]="column.button.className"
|
|
5297
5309
|
(click)="onClick(column.button.click, result, i)"
|
|
@@ -5393,7 +5405,7 @@ class CvaSmartTableComponent {
|
|
|
5393
5405
|
[attr.colspan]="buttonColspan">
|
|
5394
5406
|
<!-- [fxFlex]="getHeaderButtonWidth(i) + 'px' "-->
|
|
5395
5407
|
<ng-container *ngIf="TableService.getButtonHeader(button) as btnHeader">
|
|
5396
|
-
<button mat-icon-button
|
|
5408
|
+
<button mat-icon-button type="button"
|
|
5397
5409
|
class="{{button.className}}"
|
|
5398
5410
|
color="{{$any(btnHeader).color}}"
|
|
5399
5411
|
(click)="onClick($any(btnHeader).click, null, null)"
|
|
@@ -5419,7 +5431,7 @@ class CvaSmartTableComponent {
|
|
|
5419
5431
|
<td mat-cell [ngClass]="button.className"
|
|
5420
5432
|
*ngIf="TableService.onDisplayButtonCell(button, cell)"
|
|
5421
5433
|
(click)="$event.stopPropagation()">
|
|
5422
|
-
<button mat-icon-button
|
|
5434
|
+
<button mat-icon-button type="button"
|
|
5423
5435
|
color="{{button.color}}"
|
|
5424
5436
|
[ngClass]="button.className"
|
|
5425
5437
|
(click)="onClick(button.click, cell, i)"
|
|
@@ -5538,7 +5550,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
5538
5550
|
class="{{TableService.getColumnClassName(column, result)}}"
|
|
5539
5551
|
fxLayout="row" [fxLayoutAlign]="TableService.alignCellContent(column)"
|
|
5540
5552
|
(click)="$event.stopPropagation()">
|
|
5541
|
-
<button mat-icon-button
|
|
5553
|
+
<button mat-icon-button type="button"
|
|
5542
5554
|
color="{{column.button.color}}"
|
|
5543
5555
|
[ngClass]="column.button.className"
|
|
5544
5556
|
(click)="onClick(column.button.click, result, i)"
|
|
@@ -5640,7 +5652,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
5640
5652
|
[attr.colspan]="buttonColspan">
|
|
5641
5653
|
<!-- [fxFlex]="getHeaderButtonWidth(i) + 'px' "-->
|
|
5642
5654
|
<ng-container *ngIf="TableService.getButtonHeader(button) as btnHeader">
|
|
5643
|
-
<button mat-icon-button
|
|
5655
|
+
<button mat-icon-button type="button"
|
|
5644
5656
|
class="{{button.className}}"
|
|
5645
5657
|
color="{{$any(btnHeader).color}}"
|
|
5646
5658
|
(click)="onClick($any(btnHeader).click, null, null)"
|
|
@@ -5666,7 +5678,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
5666
5678
|
<td mat-cell [ngClass]="button.className"
|
|
5667
5679
|
*ngIf="TableService.onDisplayButtonCell(button, cell)"
|
|
5668
5680
|
(click)="$event.stopPropagation()">
|
|
5669
|
-
<button mat-icon-button
|
|
5681
|
+
<button mat-icon-button type="button"
|
|
5670
5682
|
color="{{button.color}}"
|
|
5671
5683
|
[ngClass]="button.className"
|
|
5672
5684
|
(click)="onClick(button.click, cell, i)"
|
|
@@ -5792,6 +5804,7 @@ class CvaRangeDatePickerComponent {
|
|
|
5792
5804
|
isFormControl = true;
|
|
5793
5805
|
formControl;
|
|
5794
5806
|
defaultFromDate; // lưu giá trị khởi tạo ban đầu khi truyền từ bên ngoài vào
|
|
5807
|
+
picker;
|
|
5795
5808
|
constructor(dateServiceUtil, ngControl, injector) {
|
|
5796
5809
|
this.dateServiceUtil = dateServiceUtil;
|
|
5797
5810
|
this.injector = injector;
|
|
@@ -6002,6 +6015,12 @@ class CvaRangeDatePickerComponent {
|
|
|
6002
6015
|
this.onOpenPicker.emit(picker);
|
|
6003
6016
|
}
|
|
6004
6017
|
}
|
|
6018
|
+
openRangePicker(event) {
|
|
6019
|
+
if (!this.getDisabled(this.disabledAll) && this.picker) {
|
|
6020
|
+
event.stopPropagation();
|
|
6021
|
+
this.picker.open();
|
|
6022
|
+
}
|
|
6023
|
+
}
|
|
6005
6024
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaRangeDatePickerComponent, deps: [{ token: DateUtilService }, { token: i1$2.NgControl, optional: true, self: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
6006
6025
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaRangeDatePickerComponent, isStandalone: false, selector: "cva-range-date-picker", inputs: { label: "label", placeholderFromDate: "placeholderFromDate", placeholderToDate: "placeholderToDate", disabledAll: "disabledAll", disabledFromDate: "disabledFromDate", value: "value", requiredFromDate: "requiredFromDate", requiredToDate: "requiredToDate", minDate: "minDate", maxDate: "maxDate", errorMessages: "errorMessages", isLabelOutside: "isLabelOutside", isFloatLabel: "isFloatLabel", percentOfLabelOutside: "percentOfLabelOutside", fromDateControlName: "fromDateControlName", toDateControlName: "toDateControlName", isFormControl: "isFormControl" }, outputs: { onChange: "onChange", onOpenPicker: "onOpenPicker" }, providers: [
|
|
6007
6026
|
{ provide: DateAdapter, useClass: NsDateAdapter },
|
|
@@ -6009,7 +6028,7 @@ class CvaRangeDatePickerComponent {
|
|
|
6009
6028
|
provide: MAT_DATE_FORMATS,
|
|
6010
6029
|
useValue: APP_DATE_FORMATS,
|
|
6011
6030
|
},
|
|
6012
|
-
], ngImport: i0, template: `
|
|
6031
|
+
], viewQueries: [{ propertyName: "picker", first: true, predicate: ["picker"], descendants: true }], ngImport: i0, template: `
|
|
6013
6032
|
<div class="cva-range-date-picker"
|
|
6014
6033
|
[ngClass]="{'labelOutside': isLabelOutside, 'float_label': isFloatLabel && !isLabelOutside}"
|
|
6015
6034
|
fxLayout="row" fxLayout.lt-sm="row wrap">
|
|
@@ -6034,11 +6053,13 @@ class CvaRangeDatePickerComponent {
|
|
|
6034
6053
|
<input matStartDate
|
|
6035
6054
|
[(ngModel)]="fromDateValue"
|
|
6036
6055
|
readonly="readonly"
|
|
6037
|
-
[placeholder]="placeholderFromDate|translate"
|
|
6056
|
+
[placeholder]="placeholderFromDate|translate"
|
|
6057
|
+
(click)="openRangePicker($event)">
|
|
6038
6058
|
<input matEndDate
|
|
6039
6059
|
[(ngModel)]="toDateValue"
|
|
6040
6060
|
readOnly="true"
|
|
6041
|
-
[placeholder]="placeholderToDate|translate"
|
|
6061
|
+
[placeholder]="placeholderToDate|translate"
|
|
6062
|
+
(click)="openRangePicker($event)">
|
|
6042
6063
|
</mat-date-range-input>
|
|
6043
6064
|
|
|
6044
6065
|
<mat-datepicker-toggle matPrefix [for]="picker"
|
|
@@ -6090,11 +6111,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
6090
6111
|
<input matStartDate
|
|
6091
6112
|
[(ngModel)]="fromDateValue"
|
|
6092
6113
|
readonly="readonly"
|
|
6093
|
-
[placeholder]="placeholderFromDate|translate"
|
|
6114
|
+
[placeholder]="placeholderFromDate|translate"
|
|
6115
|
+
(click)="openRangePicker($event)">
|
|
6094
6116
|
<input matEndDate
|
|
6095
6117
|
[(ngModel)]="toDateValue"
|
|
6096
6118
|
readOnly="true"
|
|
6097
|
-
[placeholder]="placeholderToDate|translate"
|
|
6119
|
+
[placeholder]="placeholderToDate|translate"
|
|
6120
|
+
(click)="openRangePicker($event)">
|
|
6098
6121
|
</mat-date-range-input>
|
|
6099
6122
|
|
|
6100
6123
|
<mat-datepicker-toggle matPrefix [for]="picker"
|
|
@@ -6165,6 +6188,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
6165
6188
|
type: Input
|
|
6166
6189
|
}], isFormControl: [{
|
|
6167
6190
|
type: Input
|
|
6191
|
+
}], picker: [{
|
|
6192
|
+
type: ViewChild,
|
|
6193
|
+
args: ['picker']
|
|
6168
6194
|
}] } });
|
|
6169
6195
|
|
|
6170
6196
|
class DragDropDirective {
|