@c10t/nice-component-library 0.0.12-a → 0.0.12-b

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.
@@ -30,20 +30,21 @@ export declare class CvaMultiSelectAutocomplete implements ControlValueAccessor,
30
30
  selectedOptionDataChange: EventEmitter<SelectModel[]>;
31
31
  valueOptionRef: SelectModel[];
32
32
  isFormControl: boolean;
33
+ searchInputRef: any;
33
34
  formControl: AbstractControl | undefined;
34
35
  filteredOptions: SelectModel[];
35
36
  selectAllChecked: boolean;
36
- _displayString: string;
37
- get displayString(): string;
38
37
  labelCount: number;
39
38
  cdkVirtualScrollViewPort: CdkVirtualScrollViewport | undefined;
40
- get NsValidator(): typeof ValidatorService;
41
39
  constructor(translateService: TranslateService, injector: Injector, ngControl: NgControl);
40
+ _displayString: string;
41
+ get displayString(): string;
42
+ get NsValidator(): typeof ValidatorService;
43
+ get selectedValue(): any[] | any;
44
+ set selectedValue(val: any[] | any);
42
45
  ngOnInit(): void;
43
46
  getRequired(): boolean;
44
47
  callValidator(): void;
45
- get selectedValue(): any[] | any;
46
- set selectedValue(val: any[] | any);
47
48
  propagateChange: (_: any) => void;
48
49
  writeValue(obj: any[] | any): void;
49
50
  registerOnChange(fn: any): void;
@@ -238,6 +238,15 @@ class OAuth2AuthenticationDto {
238
238
  userAuthentication = null;
239
239
  authorities = null;
240
240
  name = null;
241
+ orgId = null;
242
+ orgCode = null;
243
+ orgName = null;
244
+ orgType = null;
245
+ orgForm = null;
246
+ orgPath = null;
247
+ orgIsApproveVo = null;
248
+ sapId = null;
249
+ voAuthentication = null;
241
250
  }
242
251
 
243
252
  class Authority {
@@ -3939,19 +3948,13 @@ class CvaMultiSelectAutocomplete {
3939
3948
  valueOptionRef = [];
3940
3949
  // Chỉ bằng false khi trong NsSmartTable thôi nhé @@
3941
3950
  isFormControl = true;
3951
+ searchInputRef;
3942
3952
  // Cái này là để gắn khi nó là FormControl trong 1 FormGroup
3943
3953
  formControl;
3944
3954
  filteredOptions = [];
3945
3955
  selectAllChecked = false;
3946
- _displayString = '';
3947
- get displayString() {
3948
- return this._displayString;
3949
- }
3950
3956
  labelCount = 1;
3951
3957
  cdkVirtualScrollViewPort;
3952
- get NsValidator() {
3953
- return ValidatorService;
3954
- }
3955
3958
  constructor(translateService, injector, ngControl) {
3956
3959
  this.translateService = translateService;
3957
3960
  this.injector = injector;
@@ -3959,6 +3962,19 @@ class CvaMultiSelectAutocomplete {
3959
3962
  ngControl.valueAccessor = this;
3960
3963
  }
3961
3964
  }
3965
+ _displayString = '';
3966
+ get displayString() {
3967
+ return this._displayString;
3968
+ }
3969
+ get NsValidator() {
3970
+ return ValidatorService;
3971
+ }
3972
+ get selectedValue() {
3973
+ return this.value;
3974
+ }
3975
+ set selectedValue(val) {
3976
+ // this.writeValue(val); // Đọc comment bên dưới matSelectionChange
3977
+ }
3962
3978
  ngOnInit() {
3963
3979
  this.callValidator();
3964
3980
  }
@@ -3988,27 +4004,8 @@ class CvaMultiSelectAutocomplete {
3988
4004
  this.formControl.setValue(this.value);
3989
4005
  }
3990
4006
  this.formControl.updateValueAndValidity();
3991
- // const ngControl = this.injector.get(NgControl);
3992
- // if (ngControl && ngControl.control && this.formControl.errors) {
3993
- // ngControl.control.setErrors(this.formControl.errors);
3994
- // }
3995
- // if (this.formControl.valid) {
3996
- // if (this.getRequired()) {
3997
- // if (this.value === undefined || this.value === null || this.value === '' || (this.multiple && this.value.length === 0)){
3998
- // this.formControl.setErrors({required: true});
3999
- // }
4000
- // }
4001
- //
4002
- // this.formControl.markAllAsTouched();
4003
- // }
4004
4007
  }
4005
4008
  }
4006
- get selectedValue() {
4007
- return this.value;
4008
- }
4009
- set selectedValue(val) {
4010
- // this.writeValue(val); // Đọc comment bên dưới matSelectionChange
4011
- }
4012
4009
  propagateChange = (_) => {
4013
4010
  /*NON-EMPTY FOR COMPILE*/
4014
4011
  };
@@ -4034,16 +4031,7 @@ class CvaMultiSelectAutocomplete {
4034
4031
  this.selectedOptionDataChange.emit(this.valueOptionRef);
4035
4032
  }
4036
4033
  this._displayString = this.onDisplayString();
4037
- // console.log(this._displayString);
4038
- }
4039
- // private emitSelectedData(val: MatSelectChange) {
4040
- // if (val.value != null && val.value != undefined) {
4041
- // const dataArr: SelectModel[] = val.source._selectionModel.selected.map(matOption => {
4042
- // return this.options[Number(matOption._getHostElement().getAttribute('data-optionIndex'))];
4043
- // });
4044
- // this.selectedOptionDataChange.emit(dataArr);
4045
- // }
4046
- // }
4034
+ }
4047
4035
  registerOnChange(fn) {
4048
4036
  this.propagateChange = fn;
4049
4037
  }
@@ -4055,13 +4043,9 @@ class CvaMultiSelectAutocomplete {
4055
4043
  this.options = simpleChanges.options.currentValue;
4056
4044
  this.filteredOptions = this.options;
4057
4045
  }
4058
- // console.log('CvaMultiSelectAutocomplete - ngOnChanges: ', this.value, this.options);
4059
- if (this.value != null && this.value != undefined) {
4046
+ if (this.value != null) {
4060
4047
  this.writeValue(this.value);
4061
4048
  }
4062
- // else if (this.formControl.value) {
4063
- // this.writeValue(this.formControl.value);
4064
- // }
4065
4049
  }
4066
4050
  toggleSelectAll(val) {
4067
4051
  if (val.checked) {
@@ -4204,9 +4188,16 @@ class CvaMultiSelectAutocomplete {
4204
4188
  }
4205
4189
  }
4206
4190
  openChange($event) {
4207
- if ($event && this.cdkVirtualScrollViewPort) {
4208
- this.cdkVirtualScrollViewPort.scrollToIndex(0);
4209
- this.cdkVirtualScrollViewPort.checkViewportSize();
4191
+ if ($event) {
4192
+ if (this.cdkVirtualScrollViewPort) {
4193
+ this.cdkVirtualScrollViewPort.scrollToIndex(0);
4194
+ this.cdkVirtualScrollViewPort.checkViewportSize();
4195
+ }
4196
+ setTimeout(() => {
4197
+ if (this.searchInputRef?.nativeElement) {
4198
+ this.searchInputRef.nativeElement.focus();
4199
+ }
4200
+ }, 300);
4210
4201
  }
4211
4202
  }
4212
4203
  getItemSize() {
@@ -4218,7 +4209,7 @@ class CvaMultiSelectAutocomplete {
4218
4209
  return height > 200 ? 200 : height;
4219
4210
  }
4220
4211
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: CvaMultiSelectAutocomplete, deps: [{ token: i1.TranslateService }, { token: i0.Injector }, { token: i1$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
4221
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaMultiSelectAutocomplete, isStandalone: false, selector: "cva-multi-select-autocomplete", inputs: { placeholder: "placeholder", label: "label", hint: "hint", value: "value", options: "options", disabled: "disabled", errorMessages: "errorMessages", multiple: "multiple", required: "required", isTree: "isTree", treeSymbol: "treeSymbol", sizeOfItemsInListByPixels: "sizeOfItemsInListByPixels", isLabelOutside: "isLabelOutside", isFloatLabel: "isFloatLabel", percentOfLabelOutside: "percentOfLabelOutside", isFormControl: "isFormControl" }, outputs: { selectionChange: "selectionChange", selectedOptionDataChange: "selectedOptionDataChange" }, viewQueries: [{ propertyName: "cdkVirtualScrollViewPort", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
4212
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: CvaMultiSelectAutocomplete, isStandalone: false, selector: "cva-multi-select-autocomplete", inputs: { placeholder: "placeholder", label: "label", hint: "hint", value: "value", options: "options", disabled: "disabled", errorMessages: "errorMessages", multiple: "multiple", required: "required", isTree: "isTree", treeSymbol: "treeSymbol", sizeOfItemsInListByPixels: "sizeOfItemsInListByPixels", isLabelOutside: "isLabelOutside", isFloatLabel: "isFloatLabel", percentOfLabelOutside: "percentOfLabelOutside", isFormControl: "isFormControl" }, outputs: { selectionChange: "selectionChange", selectedOptionDataChange: "selectedOptionDataChange" }, viewQueries: [{ propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "cdkVirtualScrollViewPort", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
4222
4213
  <!-- css labelOutside trong base.theme-->
4223
4214
  <div class="cva-multi-select-autocomplete"
4224
4215
  [ngClass]="{'labelOutside': !!isLabelOutside, 'float_label': !!isFloatLabel && !isLabelOutside}"
@@ -4425,6 +4416,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
4425
4416
  type: Output
4426
4417
  }], isFormControl: [{
4427
4418
  type: Input
4419
+ }], searchInputRef: [{
4420
+ type: ViewChild,
4421
+ args: ['searchInput']
4428
4422
  }], cdkVirtualScrollViewPort: [{
4429
4423
  type: ViewChild,
4430
4424
  args: [CdkVirtualScrollViewport, { static: false }]