@c10t/nice-component-library 0.0.16 → 0.0.18

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.
@@ -11,6 +11,8 @@ export declare class CvaFlatTreeNodeLeftComponent {
11
11
  onLeafNodeClick: EventEmitter<void>;
12
12
  ngModelParentChange: EventEmitter<boolean>;
13
13
  ngModelLeafChange: EventEmitter<boolean>;
14
+ nodeClicked: FlatTreeNodeModel | undefined;
15
+ protected readonly menubar: BarProp;
14
16
  hasChild: (node: FlatTreeNodeModel) => boolean;
15
17
  checkDisabledNode(node: FlatTreeNodeModel): boolean;
16
18
  getDisabledInputFunc(node: FlatTreeNodeModel): boolean;
@@ -18,5 +20,5 @@ export declare class CvaFlatTreeNodeLeftComponent {
18
20
  descendantsPartiallySelected(node: FlatTreeNodeModel): boolean;
19
21
  onDisabledParent(parent: FlatTreeNodeModel): boolean;
20
22
  static ɵfac: i0.ɵɵFactoryDeclaration<CvaFlatTreeNodeLeftComponent, never>;
21
- static ɵcmp: i0.ɵɵComponentDeclaration<CvaFlatTreeNodeLeftComponent, "cva-flat-tree-node-left", never, { "treeControl": { "alias": "treeControl"; "required": false; }; "isHideCheckbox": { "alias": "isHideCheckbox"; "required": false; }; "node": { "alias": "node"; "required": false; }; }, { "toggle": "toggle"; "onParentNodeClick": "onParentNodeClick"; "onLeafNodeClick": "onLeafNodeClick"; "ngModelParentChange": "ngModelParentChange"; "ngModelLeafChange": "ngModelLeafChange"; }, never, never, false, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<CvaFlatTreeNodeLeftComponent, "cva-flat-tree-node-left", never, { "treeControl": { "alias": "treeControl"; "required": false; }; "isHideCheckbox": { "alias": "isHideCheckbox"; "required": false; }; "node": { "alias": "node"; "required": false; }; "nodeClicked": { "alias": "nodeClicked"; "required": false; }; }, { "toggle": "toggle"; "onParentNodeClick": "onParentNodeClick"; "onLeafNodeClick": "onLeafNodeClick"; "ngModelParentChange": "ngModelParentChange"; "ngModelLeafChange": "ngModelLeafChange"; }, never, never, false, never>;
22
24
  }
@@ -48,6 +48,8 @@ export declare class CvaFlatTreeComponent implements ControlValueAccessor, OnIni
48
48
  selectedFullDataSource: FlatTreeNodeModel[];
49
49
  selectedFullValues: Map<any, any>;
50
50
  selectionChange: EventEmitter<any>;
51
+ onNodeClick: EventEmitter<FlatTreeNodeModel>;
52
+ nodeClicked: FlatTreeNodeModel | undefined;
51
53
  isFormControl: boolean;
52
54
  formControl: AbstractControl | undefined;
53
55
  mapIndexes: Map<any, any>;
@@ -94,5 +96,5 @@ export declare class CvaFlatTreeComponent implements ControlValueAccessor, OnIni
94
96
  private _isExpandable;
95
97
  private _getChildren;
96
98
  static ɵfac: i0.ɵɵFactoryDeclaration<CvaFlatTreeComponent, [null, null, null, { optional: true; self: true; }]>;
97
- static ɵcmp: i0.ɵɵComponentDeclaration<CvaFlatTreeComponent, "cva-flat-tree", never, { "label": { "alias": "label"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "isView": { "alias": "isView"; "required": false; }; "isDisplayChooseTreeOnly": { "alias": "isDisplayChooseTreeOnly"; "required": false; }; "isHideCheckbox": { "alias": "isHideCheckbox"; "required": false; }; "isCollapseSelected": { "alias": "isCollapseSelected"; "required": false; }; "selectedLabelTitle": { "alias": "selectedLabelTitle"; "required": false; }; "viewHeight": { "alias": "viewHeight"; "required": false; }; "itemSize": { "alias": "itemSize"; "required": false; }; "percentOfLabelOutside": { "alias": "percentOfLabelOutside"; "required": false; }; "treeConfig": { "alias": "treeConfig"; "required": false; }; "isSearchOutSide": { "alias": "isSearchOutSide"; "required": false; }; "searchTextOutSide": { "alias": "searchTextOutSide"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "fullDatasource": { "alias": "fullDatasource"; "required": false; }; "isFormControl": { "alias": "isFormControl"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, false, never>;
99
+ static ɵcmp: i0.ɵɵComponentDeclaration<CvaFlatTreeComponent, "cva-flat-tree", never, { "label": { "alias": "label"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "isView": { "alias": "isView"; "required": false; }; "isDisplayChooseTreeOnly": { "alias": "isDisplayChooseTreeOnly"; "required": false; }; "isHideCheckbox": { "alias": "isHideCheckbox"; "required": false; }; "isCollapseSelected": { "alias": "isCollapseSelected"; "required": false; }; "selectedLabelTitle": { "alias": "selectedLabelTitle"; "required": false; }; "viewHeight": { "alias": "viewHeight"; "required": false; }; "itemSize": { "alias": "itemSize"; "required": false; }; "percentOfLabelOutside": { "alias": "percentOfLabelOutside"; "required": false; }; "treeConfig": { "alias": "treeConfig"; "required": false; }; "isSearchOutSide": { "alias": "isSearchOutSide"; "required": false; }; "searchTextOutSide": { "alias": "searchTextOutSide"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "fullDatasource": { "alias": "fullDatasource"; "required": false; }; "isFormControl": { "alias": "isFormControl"; "required": false; }; }, { "selectionChange": "selectionChange"; "onNodeClick": "onNodeClick"; }, never, never, false, never>;
98
100
  }
@@ -1422,7 +1422,6 @@ class MultiTranslateHttpLoader {
1422
1422
  for (const index in responses) {
1423
1423
  Object.assign(target, responses[index]);
1424
1424
  }
1425
- console.log(target, responses);
1426
1425
  return target;
1427
1426
  }));
1428
1427
  }
@@ -1738,7 +1737,6 @@ class ValidatorService {
1738
1737
  const validator = (control) => {
1739
1738
  let errors = null;
1740
1739
  if (control) {
1741
- // console.log('NsSmartTable - validate', control);
1742
1740
  const controlValueLength = control.value ? control.value.length : 0;
1743
1741
  if (conditions.minRow > controlValueLength) {
1744
1742
  return { minRow: { valid: false, min: conditions.minRow, actual: controlValueLength } };
@@ -1750,7 +1748,6 @@ class ValidatorService {
1750
1748
  return null;
1751
1749
  }
1752
1750
  control.value.forEach((row) => {
1753
- // console.log('NsSmartTable - validate - errors: ', errors);
1754
1751
  if (errors || !conditions.columns) {
1755
1752
  return;
1756
1753
  }
@@ -1758,7 +1755,6 @@ class ValidatorService {
1758
1755
  if (errors) {
1759
1756
  return;
1760
1757
  }
1761
- // console.log('NsSmartTable - validate - value+columns: ', row, column);
1762
1758
  const tempControl = new FormControl();
1763
1759
  tempControl.setValue(row[column.columnDef]);
1764
1760
  if (TableService.getColumnType(column, row) === ColumnTypeEnum.MULTI_SELECT_AUTOCOMPLETE) {
@@ -1821,7 +1817,6 @@ class ValidatorService {
1821
1817
  }
1822
1818
  }
1823
1819
  tempControl.markAllAsTouched();
1824
- // console.log('NsSmartTable - validate - tempControl.errors: ', TableService.getColumnType(column,row), row[column.columnDef], tempControl.errors);
1825
1820
  errors = tempControl.errors;
1826
1821
  });
1827
1822
  });
@@ -1866,7 +1861,6 @@ class CvaCounterInputComponent {
1866
1861
  constructor(injector, ngControl) {
1867
1862
  this.injector = injector;
1868
1863
  if (ngControl) {
1869
- // console.log('nsCounterInput - ngControl: ', ngControl);
1870
1864
  // ngControl là parent FormControl
1871
1865
  // Hành động này thay cho provide: NG_VALUE_ACCESSOR và gắn ControlValueAccessor này vào parent FormControl
1872
1866
  ngControl.valueAccessor = this;
@@ -1888,7 +1882,6 @@ class CvaCounterInputComponent {
1888
1882
  }
1889
1883
  }
1890
1884
  ngOnInit() {
1891
- // console.log('CvaCounterInputComponent - ngOnInit');
1892
1885
  this.callValidator();
1893
1886
  }
1894
1887
  getMinNumber() {
@@ -1899,7 +1892,6 @@ class CvaCounterInputComponent {
1899
1892
  }
1900
1893
  callValidator() {
1901
1894
  const ngControl = this.injector.get(NgControl);
1902
- // console.log('CvaCounterInputComponent - callValidator - ngControl: ', ngControl);
1903
1895
  // Nếu parent FormControl khởi tạo xong và formControl chưa có giá trị lưu
1904
1896
  if (ngControl && !this.formControl) {
1905
1897
  // Nếu là NsSmartTable thì phải tự new FormControl còn không thì cứ hóng parent FormControl về ^^
@@ -1909,7 +1901,6 @@ class CvaCounterInputComponent {
1909
1901
  else {
1910
1902
  this.formControl = new FormControl();
1911
1903
  }
1912
- // console.log('CvaCounterInputComponent - callValidator - this.formControl: ', this.formControl);
1913
1904
  // Hành động này gắn validator vào this.formControl
1914
1905
  // - Nếu this.formControl là parent FormControl thì sẽ show error lên FormGroup
1915
1906
  // - Nếu this.formControl là new FormControl thì sẽ quét QueryList để check {errors}
@@ -1949,7 +1940,6 @@ class CvaCounterInputComponent {
1949
1940
  if (value !== undefined) {
1950
1941
  this.value = value;
1951
1942
  this.propagateChange(this.value);
1952
- // console.log('CvaCounterInputComponent - writeValue: ', this.value);
1953
1943
  this.callValidator();
1954
1944
  this.onChange.emit(this.value);
1955
1945
  }
@@ -2473,6 +2463,7 @@ class CvaTableComponent {
2473
2463
  this.varPaging.pageSize = pageable.pageSize;
2474
2464
  this.pagingChange.emit(this.varPaging);
2475
2465
  this.toggleSelect(null, null);
2466
+ this.goToPageNumber = this.varPaging.pageNumber;
2476
2467
  }
2477
2468
  onClick(action, result) {
2478
2469
  const buttonClickEvent = new ButtonClickEvent(action, result);
@@ -3016,7 +3007,6 @@ class PatternDirective {
3016
3007
  }
3017
3008
  // @Output() valueChange = new EventEmitter()
3018
3009
  // @HostListener('input', ['$event']) onInputChange(event: any) {
3019
- // console.log('input changeeeeeeeeeeeeeeeeeeeeeee')
3020
3010
  // const initalValue = this.el.nativeElement.value;
3021
3011
  // const newValue = initalValue.replace(/[^0-9]*/g, '');
3022
3012
  // this.el.nativeElement.value = newValue;
@@ -3044,7 +3034,6 @@ class PatternDirective {
3044
3034
  // (e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) &&
3045
3035
  // (e.keyCode < 96 || e.keyCode > 105)
3046
3036
  // ) {
3047
- // console.log('eeeeeeeeeeeeeeeeeeeee',e)
3048
3037
  // e.preventDefault();
3049
3038
  // }
3050
3039
  if (!e.key.match(this.$regPattern)) {
@@ -3054,7 +3043,6 @@ class PatternDirective {
3054
3043
  const current = this.el.nativeElement.value;
3055
3044
  // @ts-ignore
3056
3045
  const next = current ? current.concat(e.key) : e.key;
3057
- // console.log('curentttttttttt', current, next, this.el.nativeElement)
3058
3046
  // @ts-ignore
3059
3047
  if (!next || !next.replaceAll(',', '').match(this.$regPattern)) {
3060
3048
  e.preventDefault();
@@ -3074,7 +3062,6 @@ class PatternDirective {
3074
3062
  else {
3075
3063
  data = pastedInput;
3076
3064
  }
3077
- console.log('dataaaaa', data);
3078
3065
  document.execCommand('insertText', false, data);
3079
3066
  }
3080
3067
  onDrop(event) {
@@ -3123,7 +3110,6 @@ class FormatInputDirective {
3123
3110
  this.format(value);
3124
3111
  }
3125
3112
  input(value) {
3126
- // console.log(value)
3127
3113
  // If decimal separator is last character don't update
3128
3114
  // because it will delete . || ,
3129
3115
  /*
@@ -3138,7 +3124,6 @@ class FormatInputDirective {
3138
3124
  // this.format(this._value);
3139
3125
  }
3140
3126
  focusout(value) {
3141
- console.log(value);
3142
3127
  // If decimal separator is last character don't update
3143
3128
  // because it will delete . || ,
3144
3129
  if (this.isLastCharacterDecimalSeparator(value)) {
@@ -3179,7 +3164,6 @@ class FormatInputDirective {
3179
3164
  return isNaN(value[value.length - 1]);
3180
3165
  }
3181
3166
  format(value) {
3182
- // console.log('at hereeeeeeeeeee', value, this._value)
3183
3167
  if (value === null) {
3184
3168
  this.element.nativeElement.value = '';
3185
3169
  return;
@@ -3192,11 +3176,9 @@ class FormatInputDirective {
3192
3176
  const tmp = this.inputDirective.formatValue(value);
3193
3177
  value = tmp === null || tmp === undefined ? value : tmp;
3194
3178
  }
3195
- // console.log('at hereeeeeeeeeee', value, this._value)
3196
3179
  this.element.nativeElement.value = value ? value : '';
3197
3180
  }
3198
3181
  unformatValue(value) {
3199
- // console.log('at hereeeeeeeeeee1111', value, this._value)
3200
3182
  if (this.inputDirective && this.inputDirective.unformatValue) {
3201
3183
  value = this.inputDirective.unformatValue(value);
3202
3184
  }
@@ -3688,7 +3670,6 @@ class CvaDatePickerComponent {
3688
3670
  }
3689
3671
  callValidator() {
3690
3672
  const ngControl = this.injector.get(NgControl);
3691
- // console.log('CvaCounterInputComponent - callValidator - ngControl: ', ngControl);
3692
3673
  // Nếu parent FormControl khởi tạo xong và formControl chưa có giá trị lưu
3693
3674
  if (ngControl && !this.formControl) {
3694
3675
  // Nếu là NsSmartTable thì phải tự new FormControl còn không thì cứ hóng parent FormControl về ^^
@@ -3698,7 +3679,6 @@ class CvaDatePickerComponent {
3698
3679
  else {
3699
3680
  this.formControl = new FormControl();
3700
3681
  }
3701
- // console.log('CvaCounterInputComponent - callValidator - this.formControl: ', this.formControl);
3702
3682
  // Hành động này gắn validator vào this.formControl
3703
3683
  // - Nếu this.formControl là parent FormControl thì sẽ show error lên FormGroup
3704
3684
  // - Nếu this.formControl là new FormControl thì sẽ quét QueryList để check {errors}
@@ -4023,10 +4003,8 @@ class CvaMultiSelectAutocomplete {
4023
4003
  /*NON-EMPTY FOR COMPILE*/
4024
4004
  };
4025
4005
  writeValue(obj) {
4026
- // console.log('CvaMultiSelectAutocomplete - writeValue: ', this.value, obj);
4027
4006
  if (obj != null && obj != undefined && this.value !== obj) {
4028
4007
  this.value = obj;
4029
- // console.log('CvaMultiSelectAutocomplete - writeValue: ', this.value);
4030
4008
  this.updateSelectAll();
4031
4009
  // this.formControl.setValue(this.value);
4032
4010
  this.propagateChange(this.value);
@@ -4144,7 +4122,6 @@ class CvaMultiSelectAutocomplete {
4144
4122
  * Khi đó khi chọn lại thì những mat-option không còn trong khung nhìn sẽ bị lỗi tick chọn nên ko dùng hàm này nữa
4145
4123
  */
4146
4124
  matSelectionChange(val) {
4147
- // console.log('CvaMultiSelectAutocomplete - onSelectionChange: ', val.value);
4148
4125
  // this.writeValue(val.value);
4149
4126
  // this.emitSelectedData(val);
4150
4127
  }
@@ -4817,7 +4794,6 @@ class CvaSmartTableComponent {
4817
4794
  };
4818
4795
  writeValue(obj) {
4819
4796
  if (obj) {
4820
- // console.log(obj);
4821
4797
  this.value = obj;
4822
4798
  if (this.isExpandRowTable && this.datasource.data !== this.value) {
4823
4799
  this.datasource = new MatTableDataSource(this.value);
@@ -4834,7 +4810,6 @@ class CvaSmartTableComponent {
4834
4810
  this.datasource = new MatTableDataSource(this.value);
4835
4811
  }
4836
4812
  this.toggleSelect(null);
4837
- // console.log('NsSmartTable - writeValue', this.value);
4838
4813
  this.callValidator();
4839
4814
  this.propagateChange(this.isExpandRowTable ? this.getParentRowData() : this.value);
4840
4815
  this.onChange.emit();
@@ -4855,7 +4830,6 @@ class CvaSmartTableComponent {
4855
4830
  this.writeValue(this.value);
4856
4831
  }
4857
4832
  ngOnInit() {
4858
- // console.log('NsSmartTable - ngOnInit');
4859
4833
  this.callValidator();
4860
4834
  }
4861
4835
  ngAfterContentChecked() {
@@ -5638,7 +5612,6 @@ class CvaRangeDatePickerComponent {
5638
5612
  }
5639
5613
  callValidator() {
5640
5614
  const ngControl = this.injector.get(NgControl);
5641
- // console.log('CvaCounterInputComponent - callValidator - ngControl: ', ngControl);
5642
5615
  // Nếu parent FormControl khởi tạo xong và formControl chưa có giá trị lưu
5643
5616
  if (ngControl && !this.formControl) {
5644
5617
  // Nếu là NsSmartTable thì phải tự new FormControl còn không thì cứ hóng parent FormControl về ^^
@@ -6257,7 +6230,6 @@ class CvaUploadFileComponent {
6257
6230
  const blob = new Blob([arrayBuffer]);
6258
6231
  // onload needed since Google Chrome doesn't support addEventListener for FileReader
6259
6232
  const fileReader = new FileReader();
6260
- // console.log('reader', file);
6261
6233
  const file = new File([blob], fileInfo.name, { type: fileInfo.type });
6262
6234
  fileReader.onload = (event) => {
6263
6235
  this.writeValue(new UploadModel(fileInfo.name, file, event.target.result));
@@ -7417,6 +7389,8 @@ class CvaFlatTreeNodeLeftComponent {
7417
7389
  onLeafNodeClick = new EventEmitter();
7418
7390
  ngModelParentChange = new EventEmitter();
7419
7391
  ngModelLeafChange = new EventEmitter();
7392
+ nodeClicked;
7393
+ menubar = menubar;
7420
7394
  hasChild = (node) => !!node.children && Array.isArray(node.children) && node.children.length > 0;
7421
7395
  checkDisabledNode(node) {
7422
7396
  return node.disabled || this.getDisabledInputFunc(node);
@@ -7454,12 +7428,13 @@ class CvaFlatTreeNodeLeftComponent {
7454
7428
  }
7455
7429
  }
7456
7430
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaFlatTreeNodeLeftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
7457
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaFlatTreeNodeLeftComponent, isStandalone: false, selector: "cva-flat-tree-node-left", inputs: { treeControl: "treeControl", isHideCheckbox: "isHideCheckbox", node: "node" }, outputs: { toggle: "toggle", onParentNodeClick: "onParentNodeClick", onLeafNodeClick: "onLeafNodeClick", ngModelParentChange: "ngModelParentChange", ngModelLeafChange: "ngModelLeafChange" }, ngImport: i0, template: `
7431
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaFlatTreeNodeLeftComponent, isStandalone: false, selector: "cva-flat-tree-node-left", inputs: { treeControl: "treeControl", isHideCheckbox: "isHideCheckbox", node: "node", nodeClicked: "nodeClicked" }, outputs: { toggle: "toggle", onParentNodeClick: "onParentNodeClick", onLeafNodeClick: "onLeafNodeClick", ngModelParentChange: "ngModelParentChange", ngModelLeafChange: "ngModelLeafChange" }, ngImport: i0, template: `
7458
7432
  <ng-container [ngSwitch]="hasChild(node)">
7459
7433
  <ng-container *ngSwitchCase="false">
7460
- <div class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}}"
7461
- (click)="onLeafNodeClick.emit()"
7462
- fxLayoutAlign="space-between center">
7434
+ <div
7435
+ class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}} {{isHideCheckbox && nodeClicked?.value === node.value ? 'nodeSelected': ''}}"
7436
+ (click)="onLeafNodeClick.emit()"
7437
+ fxLayoutAlign="space-between center">
7463
7438
  <button *ngIf="node.level > 0" type="button" mat-icon-button disabled></button>
7464
7439
  {{ node.displayValue }}
7465
7440
  </div>
@@ -7471,8 +7446,9 @@ class CvaFlatTreeNodeLeftComponent {
7471
7446
  </mat-checkbox>
7472
7447
  </ng-container>
7473
7448
  <ng-container *ngSwitchCase="true">
7474
- <div class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}}"
7475
- fxLayoutAlign="space-between center">
7449
+ <div
7450
+ class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}} {{isHideCheckbox && nodeClicked?.value === node.value ? 'nodeSelected': ''}}"
7451
+ fxLayoutAlign="space-between center">
7476
7452
  <button type="button" mat-icon-button (click)="toggle.emit()"
7477
7453
  [attr.aria-label]="'toggle ' + node.displayValue">
7478
7454
  <i class="fas {{treeControl?.isExpanded(node) ? 'fa-chevron-up' : 'fa-chevron-down'}}"></i>
@@ -7498,9 +7474,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
7498
7474
  template: `
7499
7475
  <ng-container [ngSwitch]="hasChild(node)">
7500
7476
  <ng-container *ngSwitchCase="false">
7501
- <div class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}}"
7502
- (click)="onLeafNodeClick.emit()"
7503
- fxLayoutAlign="space-between center">
7477
+ <div
7478
+ class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}} {{isHideCheckbox && nodeClicked?.value === node.value ? 'nodeSelected': ''}}"
7479
+ (click)="onLeafNodeClick.emit()"
7480
+ fxLayoutAlign="space-between center">
7504
7481
  <button *ngIf="node.level > 0" type="button" mat-icon-button disabled></button>
7505
7482
  {{ node.displayValue }}
7506
7483
  </div>
@@ -7512,8 +7489,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
7512
7489
  </mat-checkbox>
7513
7490
  </ng-container>
7514
7491
  <ng-container *ngSwitchCase="true">
7515
- <div class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}}"
7516
- fxLayoutAlign="space-between center">
7492
+ <div
7493
+ class="label-area {{isHideCheckbox ? 'isClickDiv' : ''}} {{isHideCheckbox && nodeClicked?.value === node.value ? 'nodeSelected': ''}}"
7494
+ fxLayoutAlign="space-between center">
7517
7495
  <button type="button" mat-icon-button (click)="toggle.emit()"
7518
7496
  [attr.aria-label]="'toggle ' + node.displayValue">
7519
7497
  <i class="fas {{treeControl?.isExpanded(node) ? 'fa-chevron-up' : 'fa-chevron-down'}}"></i>
@@ -7547,6 +7525,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
7547
7525
  type: Output
7548
7526
  }], ngModelLeafChange: [{
7549
7527
  type: Output
7528
+ }], nodeClicked: [{
7529
+ type: Input
7550
7530
  }] } });
7551
7531
 
7552
7532
  class CvaFlatTreeNodeRightComponent {
@@ -7711,6 +7691,8 @@ class CvaFlatTreeComponent {
7711
7691
  selectedFullDataSource = [];
7712
7692
  selectedFullValues = new Map();
7713
7693
  selectionChange = new EventEmitter();
7694
+ onNodeClick = new EventEmitter();
7695
+ nodeClicked;
7714
7696
  // Chỉ bằng false khi trong NsSmartTable thôi nhé @@
7715
7697
  isFormControl = true;
7716
7698
  // Cái này là để gắn khi nó là FormControl trong 1 FormGroup
@@ -7889,24 +7871,17 @@ class CvaFlatTreeComponent {
7889
7871
  // if (this.multiple) {
7890
7872
  this.value = obj;
7891
7873
  // }
7892
- console.log('writeValue_0: ', new Date());
7893
7874
  this.mapIndexes = new Map();
7894
7875
  for (let i = 0; i < this.fullDataTreeControl.dataNodes.length; i++) {
7895
7876
  this.mapIndexes.set(this.fullDataTreeControl.dataNodes[i].value, i);
7896
7877
  }
7897
- console.log('writeValue_1: ', new Date());
7898
7878
  this.checkedDefaultValue();
7899
- console.log('writeValue_2: ', new Date());
7900
7879
  this.updateSelectAll();
7901
- console.log('writeValue_3: ', new Date());
7902
7880
  this.updateSelectedTree();
7903
- console.log('writeValue_4: ', new Date());
7904
- this.propagateChange(this.value);
7905
7881
  this.callValidator();
7906
7882
  if (this.isView) {
7907
7883
  this.selectedTreeControl.expandAll();
7908
7884
  }
7909
- console.log('writeValue_5: ', new Date());
7910
7885
  this.selectionChange.emit(Array.from(this.valueObjRef.values()));
7911
7886
  }
7912
7887
  }
@@ -8196,6 +8171,8 @@ class CvaFlatTreeComponent {
8196
8171
  });
8197
8172
  }
8198
8173
  onLeafNodeClick(node) {
8174
+ this.nodeClicked = node;
8175
+ this.onNodeClick.emit(node);
8199
8176
  if (this.isHideCheckbox) {
8200
8177
  this.value = [];
8201
8178
  this.valueObjRef.clear();
@@ -8203,6 +8180,8 @@ class CvaFlatTreeComponent {
8203
8180
  }
8204
8181
  }
8205
8182
  onParentNodeClick(node) {
8183
+ this.nodeClicked = node;
8184
+ this.onNodeClick.emit(node);
8206
8185
  if (this.isHideCheckbox) {
8207
8186
  this.value = [];
8208
8187
  this.valueObjRef.clear();
@@ -8211,11 +8190,9 @@ class CvaFlatTreeComponent {
8211
8190
  }
8212
8191
  toggleNodeCheck(node, checked) {
8213
8192
  const isLeaf = !FlatTreeService.hasChild(node);
8214
- console.log('1: ', new Date());
8215
8193
  // Gọi 1 lần duy nhất nếu là parent
8216
8194
  const descendants = isLeaf ? [] : this.fullDataTreeControl.getDescendants(node);
8217
8195
  const affectedNodes = isLeaf ? [node] : descendants.filter(n => !FlatTreeService.hasChild(n));
8218
- console.log('2: ', new Date());
8219
8196
  for (const leaf of affectedNodes) {
8220
8197
  if (!leaf.display || this.checkDisabledNode(leaf))
8221
8198
  continue;
@@ -8235,7 +8212,6 @@ class CvaFlatTreeComponent {
8235
8212
  this.fullDataTreeControl.dataNodes[orgNodeIndex].checked = leaf.checked;
8236
8213
  }
8237
8214
  }
8238
- console.log('3: ', new Date());
8239
8215
  // Nếu node là cha → cập nhật isExpanded
8240
8216
  if (!isLeaf) {
8241
8217
  node.checked = checked;
@@ -8248,16 +8224,14 @@ class CvaFlatTreeComponent {
8248
8224
  else {
8249
8225
  node.checked = checked;
8250
8226
  }
8251
- console.log('4: ', new Date());
8252
8227
  this.writeValue(this.value);
8253
- console.log('5: ', new Date());
8254
8228
  this.cdr.detectChanges();
8255
8229
  }
8256
8230
  _getLevel = (node) => node.level;
8257
8231
  _isExpandable = (node) => FlatTreeService.hasChild(node);
8258
8232
  _getChildren = (node) => of(node.children ? node.children : []);
8259
8233
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaFlatTreeComponent, deps: [{ token: i1.TranslateService }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }, { token: i1$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
8260
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaFlatTreeComponent, isStandalone: false, selector: "cva-flat-tree", inputs: { label: "label", required: "required", value: "value", multiple: "multiple", disabled: "disabled", isView: "isView", isDisplayChooseTreeOnly: "isDisplayChooseTreeOnly", isHideCheckbox: "isHideCheckbox", isCollapseSelected: "isCollapseSelected", selectedLabelTitle: "selectedLabelTitle", viewHeight: "viewHeight", itemSize: "itemSize", percentOfLabelOutside: "percentOfLabelOutside", treeConfig: "treeConfig", isSearchOutSide: "isSearchOutSide", searchTextOutSide: "searchTextOutSide", errorMessages: "errorMessages", fullDatasource: "fullDatasource", isFormControl: "isFormControl" }, outputs: { selectionChange: "selectionChange" }, viewQueries: [{ propertyName: "chooseVirtualScroll", first: true, predicate: ["chooseAreaScrollViewport"], descendants: true }, { propertyName: "selectedVirtualScroll", first: true, predicate: ["selectedScrollViewport"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
8234
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaFlatTreeComponent, isStandalone: false, selector: "cva-flat-tree", inputs: { label: "label", required: "required", value: "value", multiple: "multiple", disabled: "disabled", isView: "isView", isDisplayChooseTreeOnly: "isDisplayChooseTreeOnly", isHideCheckbox: "isHideCheckbox", isCollapseSelected: "isCollapseSelected", selectedLabelTitle: "selectedLabelTitle", viewHeight: "viewHeight", itemSize: "itemSize", percentOfLabelOutside: "percentOfLabelOutside", treeConfig: "treeConfig", isSearchOutSide: "isSearchOutSide", searchTextOutSide: "searchTextOutSide", errorMessages: "errorMessages", fullDatasource: "fullDatasource", isFormControl: "isFormControl" }, outputs: { selectionChange: "selectionChange", onNodeClick: "onNodeClick" }, viewQueries: [{ propertyName: "chooseVirtualScroll", first: true, predicate: ["chooseAreaScrollViewport"], descendants: true }, { propertyName: "selectedVirtualScroll", first: true, predicate: ["selectedScrollViewport"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
8261
8235
  <div class="cva-flat-tree labelOutside"
8262
8236
  fxLayout="row" fxLayout.lt-sm="row wrap">
8263
8237
  <mat-label *ngIf="label && !isSearchOutSide" class="label_width"
@@ -8300,6 +8274,7 @@ class CvaFlatTreeComponent {
8300
8274
  [attr.aria-level]="node.level"
8301
8275
  [treeControl]="treeControl"
8302
8276
  [isHideCheckbox]="isHideCheckbox"
8277
+ [nodeClicked]="nodeClicked"
8303
8278
  [node]="node"
8304
8279
  (toggle)="toggleTreeControl(treeControl, node)"
8305
8280
  (onParentNodeClick)="onParentNodeClick(node)"
@@ -8342,7 +8317,7 @@ class CvaFlatTreeComponent {
8342
8317
  </mat-hint>
8343
8318
  </div>
8344
8319
  </div>
8345
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i6$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i10.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i10.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i10.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i8.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i8.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i9.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { kind: "component", type: CvaFlatTreeNodeLeftComponent, selector: "cva-flat-tree-node-left", inputs: ["treeControl", "isHideCheckbox", "node"], outputs: ["toggle", "onParentNodeClick", "onLeafNodeClick", "ngModelParentChange", "ngModelLeafChange"] }, { kind: "component", type: CvaFlatTreeNodeRightComponent, selector: "cva-flat-tree-node-right", inputs: ["treeControl", "node", "isView"], outputs: ["toggle", "deSelectLeafNode", "deSelectParentNode"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
8320
+ `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i6$2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i10.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i10.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i10.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i8.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i8.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i9.DefaultStyleDirective, selector: " [ngStyle], [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl], [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl], [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { kind: "component", type: CvaFlatTreeNodeLeftComponent, selector: "cva-flat-tree-node-left", inputs: ["treeControl", "isHideCheckbox", "node", "nodeClicked"], outputs: ["toggle", "onParentNodeClick", "onLeafNodeClick", "ngModelParentChange", "ngModelLeafChange"] }, { kind: "component", type: CvaFlatTreeNodeRightComponent, selector: "cva-flat-tree-node-right", inputs: ["treeControl", "node", "isView"], outputs: ["toggle", "deSelectLeafNode", "deSelectParentNode"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
8346
8321
  }
8347
8322
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaFlatTreeComponent, decorators: [{
8348
8323
  type: Component,
@@ -8392,6 +8367,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
8392
8367
  [attr.aria-level]="node.level"
8393
8368
  [treeControl]="treeControl"
8394
8369
  [isHideCheckbox]="isHideCheckbox"
8370
+ [nodeClicked]="nodeClicked"
8395
8371
  [node]="node"
8396
8372
  (toggle)="toggleTreeControl(treeControl, node)"
8397
8373
  (onParentNodeClick)="onParentNodeClick(node)"
@@ -8478,6 +8454,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
8478
8454
  type: Input
8479
8455
  }], selectionChange: [{
8480
8456
  type: Output
8457
+ }], onNodeClick: [{
8458
+ type: Output
8481
8459
  }], isFormControl: [{
8482
8460
  type: Input
8483
8461
  }], chooseVirtualScroll: [{
@@ -8990,15 +8968,11 @@ class JsogHttpInterceptor {
8990
8968
  request = request.clone({ body: this.jSog.serialize(request.body) });
8991
8969
  }
8992
8970
  return next.handle(request).pipe(map((event) => {
8993
- // console.log(Object.getPrototypeOf(event));
8994
8971
  if (!(event instanceof HttpResponse || HttpResponseBase.prototype.isPrototypeOf(event))) {
8995
- // console.log('event instanceof HttpResponse', event instanceof HttpResponse, HttpResponseBase.prototype.isPrototypeOf(event), event);
8996
8972
  return event;
8997
8973
  }
8998
8974
  let response = event;
8999
8975
  if (!response.body || typeof (response.body) !== 'object' || (response.body instanceof Blob)) {
9000
- // console.log('typeof(event.body !== \'object\')', typeof(response.body) !== 'object',
9001
- // 'event.body instanceof Blob', response.body instanceof Blob, response.body);
9002
8976
  return response;
9003
8977
  }
9004
8978
  response = response.clone({ body: this.jSog.deserializeArray(response.body, BaseModel) });
@@ -9029,7 +9003,6 @@ class LoaderInterceptor {
9029
9003
  intercept(request, next) {
9030
9004
  if (!request.headers.get('is_image') && !request.headers.get('is_live_searching')) {
9031
9005
  this.requests.push(request);
9032
- // console.log('LoaderInterceptor: wait for ' + this.requests.length + 'requests');
9033
9006
  this.loaderService.isLoading.next(true);
9034
9007
  }
9035
9008
  else {
@@ -9038,7 +9011,6 @@ class LoaderInterceptor {
9038
9011
  });
9039
9012
  }
9040
9013
  return next.handle(request).pipe(map((event) => {
9041
- // console.log(event, (event instanceof HttpResponse));
9042
9014
  if (event instanceof HttpResponse) {
9043
9015
  this.removeRequest(request);
9044
9016
  }
@@ -9048,7 +9020,6 @@ class LoaderInterceptor {
9048
9020
  this.removeRequest(request);
9049
9021
  return throwError(err);
9050
9022
  }), finalize(() => {
9051
- // console.log('OMG!!!');
9052
9023
  this.removeRequest(request);
9053
9024
  }));
9054
9025
  }