@c10t/nice-component-library 0.0.8-beta → 0.0.10-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.
@@ -39,23 +39,23 @@ export declare class CvaSmartTableComponent implements ControlValueAccessor, OnC
39
39
  formControl: AbstractControl | undefined;
40
40
  selectAllChecked: boolean;
41
41
  buttonColspan: number;
42
+ constructor(ref: ChangeDetectorRef, config: NiceComponentLibraryConfig, injector: Injector, ngControl: NgControl);
42
43
  get AlignEnum(): typeof AlignEnum;
43
44
  get IconTypes(): typeof IconTypeEnum;
44
45
  get TableService(): typeof TableService;
46
+ get displayedColumns(): string[];
47
+ get displayedFooters(): string[][];
48
+ get ColumnTypes(): typeof ColumnTypeEnum;
45
49
  propagateChange: (_: any) => void;
46
50
  writeValue(obj: any[] | any): void;
47
51
  getParentRowData(): any[];
48
52
  registerOnChange(fn: any): void;
49
53
  registerOnTouched(): void;
50
- constructor(ref: ChangeDetectorRef, config: NiceComponentLibraryConfig, injector: Injector, ngControl: NgControl);
51
54
  ngOnChanges(): void;
52
55
  ngOnInit(): void;
53
56
  ngAfterContentChecked(): void;
54
- get displayedColumns(): string[];
55
- get displayedFooters(): string[][];
56
57
  onClick(action: string, result: any, index: number | null): void;
57
58
  onCellValueChange(result: any, column: ColumnModel, $event: any): void;
58
- get ColumnTypes(): typeof ColumnTypeEnum;
59
59
  toggleSelectAll(val: MatCheckboxChange, col: ColumnModel): void;
60
60
  toggleSelect(val: MatCheckboxChange | null, result?: any, column?: ColumnModel): void;
61
61
  onDisplayHeaderCell(column: ColumnModel): boolean;
@@ -166,8 +166,6 @@ var AlignEnum;
166
166
  class ColumnModel {
167
167
  columnDef = '';
168
168
  header;
169
- title = (e) => `${e}`;
170
- cell = (e) => `${e}`;
171
169
  // set default theo ly thuyet, phai gan lai
172
170
  align = AlignEnum.LEFT;
173
171
  alignHeader;
@@ -192,11 +190,14 @@ class ColumnModel {
192
190
  validate;
193
191
  errorMessage;
194
192
  isTree = false;
193
+ isMultipleSelect = false;
195
194
  isDecimal = false;
196
195
  isExpandOptionColumn;
197
196
  footer;
198
197
  footers = [];
199
198
  button;
199
+ title = (e) => `${e}`;
200
+ cell = (e) => `${e}`;
200
201
  }
201
202
 
202
203
  class BaseModel {
@@ -2285,7 +2286,7 @@ class CvaHeaderExpandButtonComponent {
2285
2286
  <mat-checkbox style="width: 100%"
2286
2287
  [(ngModel)]="expandDisplayCols[col.columnDef]"
2287
2288
  [value]="col.columnDef"
2288
- (change)="this.onChange.emit()">
2289
+ (change)="this.onChange.emit(this.expandDisplayCols)">
2289
2290
  {{ (moduleName + '.table.header.' + col.header) | translate }}
2290
2291
  </mat-checkbox>
2291
2292
  </ng-container>
@@ -2326,7 +2327,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
2326
2327
  <mat-checkbox style="width: 100%"
2327
2328
  [(ngModel)]="expandDisplayCols[col.columnDef]"
2328
2329
  [value]="col.columnDef"
2329
- (change)="this.onChange.emit()">
2330
+ (change)="this.onChange.emit(this.expandDisplayCols)">
2330
2331
  {{ (moduleName + '.table.header.' + col.header) | translate }}
2331
2332
  </mat-checkbox>
2332
2333
  </ng-container>
@@ -4448,6 +4449,14 @@ class CvaSmartTableComponent {
4448
4449
  formControl;
4449
4450
  selectAllChecked = false;
4450
4451
  buttonColspan = 0;
4452
+ constructor(ref, config, injector, ngControl) {
4453
+ this.ref = ref;
4454
+ this.config = config;
4455
+ this.injector = injector;
4456
+ if (ngControl) {
4457
+ ngControl.valueAccessor = this;
4458
+ }
4459
+ }
4451
4460
  get AlignEnum() {
4452
4461
  return AlignEnum;
4453
4462
  }
@@ -4457,6 +4466,33 @@ class CvaSmartTableComponent {
4457
4466
  get TableService() {
4458
4467
  return TableService;
4459
4468
  }
4469
+ get displayedColumns() {
4470
+ if (!this.$displayedColumns || this.$displayedColumns.length <= 0) {
4471
+ this.$displayedColumns = this.columns.map((c) => c.columnDef);
4472
+ if (this.buttons) {
4473
+ this.$displayedColumns = this.$displayedColumns.concat(this.buttons.map((b) => b.columnDef));
4474
+ }
4475
+ }
4476
+ return this.$displayedColumns;
4477
+ }
4478
+ get displayedFooters() {
4479
+ if (!this.$displayedFooters || this.$displayedFooters.length <= 0) {
4480
+ for (const column of this.columns) {
4481
+ if (!!column.footers) {
4482
+ for (let i = 0; i < column.footers.length; i++) {
4483
+ if (!this.$displayedFooters[i]) {
4484
+ this.$displayedFooters[i] = [];
4485
+ }
4486
+ this.$displayedFooters[i] = this.$displayedFooters[i].concat([i + '-' + column.columnDef]);
4487
+ }
4488
+ }
4489
+ }
4490
+ }
4491
+ return this.$displayedFooters;
4492
+ }
4493
+ get ColumnTypes() {
4494
+ return ColumnTypeEnum;
4495
+ }
4460
4496
  propagateChange = (_) => {
4461
4497
  /*NON-EMPTY FOR COMPILE*/
4462
4498
  };
@@ -4496,14 +4532,6 @@ class CvaSmartTableComponent {
4496
4532
  registerOnTouched() {
4497
4533
  /*NON-EMPTY FOR COMPILE*/
4498
4534
  }
4499
- constructor(ref, config, injector, ngControl) {
4500
- this.ref = ref;
4501
- this.config = config;
4502
- this.injector = injector;
4503
- if (ngControl) {
4504
- ngControl.valueAccessor = this;
4505
- }
4506
- }
4507
4535
  ngOnChanges() {
4508
4536
  this.writeValue(this.value);
4509
4537
  }
@@ -4515,30 +4543,6 @@ class CvaSmartTableComponent {
4515
4543
  this.getHeaderButtonColspan();
4516
4544
  this.ref.detectChanges();
4517
4545
  }
4518
- get displayedColumns() {
4519
- if (!this.$displayedColumns || this.$displayedColumns.length <= 0) {
4520
- this.$displayedColumns = this.columns.map((c) => c.columnDef);
4521
- if (this.buttons) {
4522
- this.$displayedColumns = this.$displayedColumns.concat(this.buttons.map((b) => b.columnDef));
4523
- }
4524
- }
4525
- return this.$displayedColumns;
4526
- }
4527
- get displayedFooters() {
4528
- if (!this.$displayedFooters || this.$displayedFooters.length <= 0) {
4529
- for (const column of this.columns) {
4530
- if (!!column.footers) {
4531
- for (let i = 0; i < column.footers.length; i++) {
4532
- if (!this.$displayedFooters[i]) {
4533
- this.$displayedFooters[i] = [];
4534
- }
4535
- this.$displayedFooters[i] = this.$displayedFooters[i].concat([i + '-' + column.columnDef]);
4536
- }
4537
- }
4538
- }
4539
- }
4540
- return this.$displayedFooters;
4541
- }
4542
4546
  /*
4543
4547
  Nếu sử dụng expandTableRow khi xử lý sự kiện bên ngoài component không sử dụng index bên trong base, set index lại bằng indexOf
4544
4548
  */
@@ -4554,9 +4558,6 @@ class CvaSmartTableComponent {
4554
4558
  this.callValidator();
4555
4559
  this.onChange.emit();
4556
4560
  }
4557
- get ColumnTypes() {
4558
- return ColumnTypeEnum;
4559
- }
4560
4561
  toggleSelectAll(val, col) {
4561
4562
  if (this.value) {
4562
4563
  this.value.forEach(v => {
@@ -4818,7 +4819,8 @@ class CvaSmartTableComponent {
4818
4819
  [errorMessages]="getErrorMessageMap(column)"
4819
4820
  [required]="getRequired(column)"
4820
4821
  [disabled]="column.disabled ? column.disabled(result) : false"
4821
- [multiple]="false" [options]="column.optionValues(result)"
4822
+ [multiple]="column.isMultipleSelect"
4823
+ [options]="column.optionValues(result)"
4822
4824
  (selectionChange)="onCellValueChange(result, column, $event);">
4823
4825
  </cva-multi-select-autocomplete>
4824
4826
  <div class="checkbox-cell"
@@ -5039,7 +5041,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
5039
5041
  [errorMessages]="getErrorMessageMap(column)"
5040
5042
  [required]="getRequired(column)"
5041
5043
  [disabled]="column.disabled ? column.disabled(result) : false"
5042
- [multiple]="false" [options]="column.optionValues(result)"
5044
+ [multiple]="column.isMultipleSelect"
5045
+ [options]="column.optionValues(result)"
5043
5046
  (selectionChange)="onCellValueChange(result, column, $event);">
5044
5047
  </cva-multi-select-autocomplete>
5045
5048
  <div class="checkbox-cell"