@colijnit/corecomponents_v12 260.1.15 → 260.1.16

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.
@@ -1835,7 +1835,7 @@ CommitButtonsComponent.decorators = [
1835
1835
  <svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52" *ngIf="firstShow || commitFinished">
1836
1836
  <path class="checkmark-check" [class.first-show]="firstShow" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/></svg>
1837
1837
  </div>
1838
- <div class="commit-buttons-button cancel" (click)="cancelClick.emit($event)">
1838
+ <div class="commit-buttons-button cancel" (mousedown)="$event.preventDefault()" (click)="cancelClick.emit($event)">
1839
1839
  <div class="cancel-button"></div>
1840
1840
  </div>
1841
1841
  </div>
@@ -1907,8 +1907,8 @@ class BaseInputComponent {
1907
1907
  this.excludeUserModelChange = false;
1908
1908
  this.noFormGroupControl = false;
1909
1909
  this.keepFocus = false;
1910
- this.canceled = false;
1911
1910
  this.validationError = '';
1911
+ this.shouldCommit = true;
1912
1912
  this._markedAsUserTouched = false;
1913
1913
  this._destroyed = false;
1914
1914
  this._hasOnPushCdStrategy = false;
@@ -2207,8 +2207,7 @@ class BaseInputComponent {
2207
2207
  this.input = undefined;
2208
2208
  }
2209
2209
  cancelClick(event) {
2210
- this.canceled = true;
2211
- this.conditionResolver(this.canceled);
2210
+ this.shouldCommit = false;
2212
2211
  this.keepFocus = true;
2213
2212
  if (this._initialModelSet) {
2214
2213
  this.model = this._initialModel;
@@ -2262,20 +2261,9 @@ class BaseInputComponent {
2262
2261
  }
2263
2262
  this.focus.next();
2264
2263
  }
2265
- waitForCancelCondition() {
2266
- return new Promise((resolve) => {
2267
- this.conditionResolver = resolve; // Save the resolver to be called later
2268
- });
2269
- }
2270
2264
  doBlur(event, handleCommit = true) {
2271
2265
  return __awaiter(this, void 0, void 0, function* () {
2272
- const cancelTimeout = new Promise(resolve => setTimeout(resolve, 300));
2273
- const result = yield Promise.race([this.waitForCancelCondition(), cancelTimeout]);
2274
- // If canceled
2275
- if (result) {
2276
- return;
2277
- }
2278
- if (this.showSaveCancel && handleCommit && this._modelDirtyForCommit) {
2266
+ if (this.showSaveCancel && handleCommit && this._modelDirtyForCommit && this.shouldCommit) {
2279
2267
  yield this._handleCommit(event, false);
2280
2268
  }
2281
2269
  setTimeout(() => {
@@ -2411,6 +2399,7 @@ class BaseInputComponent {
2411
2399
  return true;
2412
2400
  }
2413
2401
  this.keepFocus = true;
2402
+ this.shouldCommit = true;
2414
2403
  if (this._commitButtonsComponentRef) {
2415
2404
  this._commitButtonsComponentRef.instance.commitFinished = false;
2416
2405
  this._commitButtonsComponentRef.instance.committing = true;
@@ -5909,6 +5898,8 @@ class InputTextComponent extends BaseInputComponent {
5909
5898
  }
5910
5899
  clearInput(event) {
5911
5900
  this.setModel(null);
5901
+ this.keepFocus = true;
5902
+ this.shouldCommit = false;
5912
5903
  this.clearIconClick.emit(event);
5913
5904
  }
5914
5905
  handleKeyDownInput(event) {
@@ -11755,58 +11746,58 @@ class ListOfValuesComponent extends BaseInputComponent {
11755
11746
  ListOfValuesComponent.decorators = [
11756
11747
  { type: Component, args: [{
11757
11748
  selector: 'co-list-of-values',
11758
- template: `
11759
- <co-input-text
11760
- *ngIf="!largeCollection"
11761
- aria-haspopup="listbox"
11762
- [attr.aria-expanded]="isSelectOpen"
11763
- aria-controls="lov-popup"
11764
- role="combobox"
11765
- class="no-focus-line"
11766
- overlayParent
11767
- #parentForOverlay="overlayParent"
11768
- type="text"
11769
- [id]="label"
11770
- [model]="multiselect ? selectedModels : selectedModel"
11771
- [placeholder]="label"
11772
- [myFormInputInstance]="this"
11773
- [readonly]="readonly"
11774
- [disabled]="disabled"
11775
- [required]="required"
11776
- [noClickFocus]="false"
11777
- [leftIconData]=" model && model[optionIcon] ? iconCacheService.getIcon(model[optionIcon]) : leftIconData"
11778
- [rightIcon]="isSelectOpen ? icons.ChevronUpRegular : icons.ChevronDownRegular"
11779
- [showClearButton]="true"
11780
- [useContent]="multiselect"
11781
- [customHeight]="multiselect"
11782
- [keepFocussed]="keepFocussed"
11783
- (modelChange)="handleInputModelChange($event)"
11784
- (click)="openPopup()"
11785
- (rightIconClick)="toggleSelect()"
11786
- (keydown)="handleInputKeyDown($event)"
11787
- (clearIconClick)="clearModel($event)"
11788
- (blur)="checkModel()">
11789
- <ng-container *ngIf="multiselect && showChips">
11790
- <div class="multiselect-chips-wrapper">
11791
- <div class="chips" *ngFor="let chip of model">
11792
- <span class="chips-description" [textContent]="chip[displayField]"></span>
11793
- <co-icon class="remove-chip-icon" [icon]="icons.CrossSkinny" (click)="removeOptionFromModel(chip)"></co-icon>
11794
- </div>
11795
- </div>
11796
- </ng-container>
11797
- </co-input-text>
11798
-
11799
- <co-input-text
11800
- *ngIf="largeCollection"
11801
- [model]="filterText"
11802
- [placeholder]="label"
11803
- [required]="required"
11804
- [disabled]="disabled"
11805
- [readonly]="readonly"
11806
- (modelChange)="onModelChange($event)">
11807
- </co-input-text>
11808
- <div *ngIf="isLoading" class="filter-loader"><span></span></div>
11809
- <input type="hidden" [ngModel]="model">
11749
+ template: `
11750
+ <co-input-text
11751
+ *ngIf="!largeCollection"
11752
+ aria-haspopup="listbox"
11753
+ [attr.aria-expanded]="isSelectOpen"
11754
+ aria-controls="lov-popup"
11755
+ role="combobox"
11756
+ class="no-focus-line"
11757
+ overlayParent
11758
+ #parentForOverlay="overlayParent"
11759
+ type="text"
11760
+ [id]="label"
11761
+ [model]="multiselect ? ((!selectedModels || selectedModels.length === 0) ? null : selectedModels ) : selectedModel"
11762
+ [placeholder]="label"
11763
+ [myFormInputInstance]="this"
11764
+ [readonly]="readonly"
11765
+ [disabled]="disabled"
11766
+ [required]="required"
11767
+ [noClickFocus]="false"
11768
+ [leftIconData]=" model && model[optionIcon] ? iconCacheService.getIcon(model[optionIcon]) : leftIconData"
11769
+ [rightIcon]="isSelectOpen ? icons.ChevronUpRegular : icons.ChevronDownRegular"
11770
+ [showClearButton]="true"
11771
+ [useContent]="multiselect"
11772
+ [customHeight]="multiselect"
11773
+ [keepFocussed]="keepFocussed"
11774
+ (modelChange)="handleInputModelChange($event)"
11775
+ (click)="openPopup()"
11776
+ (rightIconClick)="toggleSelect()"
11777
+ (keydown)="handleInputKeyDown($event)"
11778
+ (clearIconClick)="clearModel($event)"
11779
+ (blur)="checkModel()">
11780
+ <ng-container *ngIf="multiselect && showChips">
11781
+ <div class="multiselect-chips-wrapper">
11782
+ <div class="chips" *ngFor="let chip of model">
11783
+ <span class="chips-description" [textContent]="chip[displayField]"></span>
11784
+ <co-icon class="remove-chip-icon" [icon]="icons.CrossSkinny" (click)="removeOptionFromModel(chip)"></co-icon>
11785
+ </div>
11786
+ </div>
11787
+ </ng-container>
11788
+ </co-input-text>
11789
+
11790
+ <co-input-text
11791
+ *ngIf="largeCollection"
11792
+ [model]="filterText"
11793
+ [placeholder]="label"
11794
+ [required]="required"
11795
+ [disabled]="disabled"
11796
+ [readonly]="readonly"
11797
+ (modelChange)="onModelChange($event)">
11798
+ </co-input-text>
11799
+ <div *ngIf="isLoading" class="filter-loader"><span></span></div>
11800
+ <input type="hidden" [ngModel]="(selectedModels && selectedModels.length) || selectedModel ? model : null">
11810
11801
  `,
11811
11802
  providers: [
11812
11803
  OverlayService,
@@ -14509,7 +14500,7 @@ class ScreenConfigurationDirective {
14509
14500
  if (myCfgObj) {
14510
14501
  this._setHostVisible(myCfgObj.immediatelyVisible());
14511
14502
  if (!this.screenConfigNativeElement) {
14512
- this.hostComponent.required = myCfgObj.isRequired();
14503
+ this.hostComponent.required = this.hostComponent.required || myCfgObj.isRequired();
14513
14504
  this.hostComponent.readonly = this.hostComponent.forceReadonly || this._moduleInReadonlyMode() || myCfgObj.isReadonly();
14514
14505
  this.hostComponent.decimals = myCfgObj.scale;
14515
14506
  this.hostComponent.maxLength = myCfgObj.maxLength;