@colijnit/corecomponents_v12 12.2.0 → 12.2.1

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.
@@ -2263,6 +2263,7 @@
2263
2263
  this.customWidth = false;
2264
2264
  this.customHeight = false;
2265
2265
  this.noTriangleGraphic = false;
2266
+ this.keepFocussed = false;
2266
2267
  this.halfWidth = false;
2267
2268
  this.fullWidth = false;
2268
2269
  this.excludeUserModelChange = false;
@@ -2755,7 +2756,7 @@
2755
2756
  BaseInputComponent.prototype.doBlur = function (event) {
2756
2757
  var _this = this;
2757
2758
  setTimeout(function () {
2758
- if (_this.keepFocus) {
2759
+ if (_this.keepFocus || _this.keepFocussed) {
2759
2760
  if (event) {
2760
2761
  event.preventDefault;
2761
2762
  }
@@ -3125,6 +3126,7 @@
3125
3126
  customWidth: [{ type: i0.Input }, { type: i0.HostBinding, args: ["class.custom-width",] }],
3126
3127
  customHeight: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.custom-height',] }],
3127
3128
  noTriangleGraphic: [{ type: i0.Input }],
3129
+ keepFocussed: [{ type: i0.Input }],
3128
3130
  halfWidth: [{ type: i0.Input }, { type: i0.HostBinding, args: ["class.half-width",] }],
3129
3131
  fullWidth: [{ type: i0.Input }, { type: i0.HostBinding, args: ["class.full-width-important",] }],
3130
3132
  excludeUserModelChange: [{ type: i0.Input }],
@@ -3164,6 +3166,9 @@
3164
3166
  __decorate([
3165
3167
  InputBoolean()
3166
3168
  ], BaseInputComponent.prototype, "noTriangleGraphic", void 0);
3169
+ __decorate([
3170
+ InputBoolean()
3171
+ ], BaseInputComponent.prototype, "keepFocussed", void 0);
3167
3172
  __decorate([
3168
3173
  InputBoolean()
3169
3174
  ], BaseInputComponent.prototype, "halfWidth", void 0);
@@ -6256,7 +6261,7 @@
6256
6261
  InputTextComponent.decorators = [
6257
6262
  { type: i0.Component, args: [{
6258
6263
  selector: 'co-input-text',
6259
- template: "\n <div class=\"input-text-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-icon *ngIf=\"leftIcon || leftIconData\" class=\"input-text-left-icon\" [icon]=\"leftIcon\" [iconData]=\"leftIconData\"\n (click)=\"handleLeftIconClick($event)\" (mousedown)=\"handleLeftIconMouseDown($event)\"\n (mouseup)=\"handleLeftIconMouseUp($event)\"></co-icon>\n <div *ngIf=\"leftIcon || leftIconData\" class=\"spacer left-icon\"></div>\n <div class=\"input-wrapper\">\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\"\n [textContent]=\"placeholder\"></label>\n <input #input\n [ngClass]=\"align\"\n [hidden]=\"useContent\"\n [type]=\"digitsOnly ? 'number' : type\"\n [pattern]=\"type === 'date' ? pattern : undefined\"\n [ngModel]=\"model\"\n [min]=\"(type === 'number' || type === 'date') && this.min ? this.min : undefined\"\n [max]=\"(type === 'number' || type === 'date') && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (keydown)=\"digitsOnly ? excludeNonDigitChars($event) : true\"\n >\n <co-icon [class.show]=\"showClearButton && hasValue && focused && !readonly\" class=\"input-text-clear-button\" [icon]=\"icons.CrossSkinny\" (click)=\"clearInput($event)\"></co-icon>\n <div class=\"required-indicator\"></div>\n </div>\n <div *ngIf=\"rightIcon || rightIconData\" class=\"spacer right-icon\"></div>\n <co-icon *ngIf=\"rightIcon || rightIconData\" class=\"input-text-right-icon\" [icon]=\"rightIcon\" [iconData]=\"rightIconData\"\n (click)=\"handleRightIconClick($event)\" (mousedown)=\"handleRightIconMouseDown($event)\" (mouseup)=\"handleRightIconMouseUp($event)\"></co-icon>\n </div>\n <!--\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n -->\n ",
6264
+ template: "\n <div class=\"input-text-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-icon *ngIf=\"leftIcon || leftIconData\" class=\"input-text-left-icon\" [icon]=\"leftIcon\" [iconData]=\"leftIconData\"\n (click)=\"handleLeftIconClick($event)\" (mousedown)=\"handleLeftIconMouseDown($event)\"\n (mouseup)=\"handleLeftIconMouseUp($event)\"></co-icon>\n <div *ngIf=\"leftIcon || leftIconData\" class=\"spacer left-icon\"></div>\n <div class=\"input-wrapper\">\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\"\n [textContent]=\"placeholder\"></label>\n <input #input\n [class.input-input-hidden]=\"useContent\"\n [ngClass]=\"align\"\n [type]=\"digitsOnly ? 'number' : type\"\n [pattern]=\"type === 'date' ? pattern : undefined\"\n [ngModel]=\"model\"\n [min]=\"(type === 'number' || type === 'date') && this.min ? this.min : undefined\"\n [max]=\"(type === 'number' || type === 'date') && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (keydown)=\"digitsOnly ? excludeNonDigitChars($event) : true\"\n >\n <ng-container *ngIf=\"useContent\">\n <div class=\"input-content-wrapper\">\n <ng-content></ng-content>\n </div>\n </ng-container>\n <co-icon [class.show]=\"showClearButton && hasValue && focused && !readonly\" class=\"input-text-clear-button\" [icon]=\"icons.CrossSkinny\" (click)=\"clearInput($event)\"></co-icon>\n <div class=\"required-indicator\"></div>\n </div>\n <div *ngIf=\"rightIcon || rightIconData\" class=\"spacer right-icon\"></div>\n <co-icon *ngIf=\"rightIcon || rightIconData\" class=\"input-text-right-icon\" [icon]=\"rightIcon\" [iconData]=\"rightIconData\"\n (click)=\"handleRightIconClick($event)\" (mousedown)=\"handleRightIconMouseDown($event)\" (mouseup)=\"handleRightIconMouseUp($event)\"></co-icon>\n </div>\n <!--\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n -->\n ",
6260
6265
  providers: [
6261
6266
  OverlayService, {
6262
6267
  provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
@@ -10882,12 +10887,14 @@
10882
10887
  ];
10883
10888
 
10884
10889
  var ListOfValuesPopupComponent = /** @class */ (function () {
10885
- function ListOfValuesPopupComponent() {
10890
+ function ListOfValuesPopupComponent(_elementRef) {
10891
+ this._elementRef = _elementRef;
10886
10892
  this.multiselect = false;
10887
10893
  this.displayField = 'description';
10888
10894
  this.searchDisabled = false;
10889
10895
  this.modelChange = new i0.EventEmitter();
10890
10896
  this.closePopup = new i0.EventEmitter();
10897
+ this.keyDown = new i0.EventEmitter();
10891
10898
  this.viewModels = [];
10892
10899
  this.viewModelsMain = [];
10893
10900
  this._collection = [];
@@ -10973,8 +10980,14 @@
10973
10980
  case KeyboardKey.SpaceBar:
10974
10981
  if (this.highLightModel) {
10975
10982
  this.selectViewModel(this.highLightModel, false);
10976
- return false;
10977
10983
  }
10984
+ else {
10985
+ this.keyDown.next(event);
10986
+ }
10987
+ return false;
10988
+ default:
10989
+ this.keyDown.next(event);
10990
+ return true;
10978
10991
  }
10979
10992
  }
10980
10993
  };
@@ -11047,6 +11060,9 @@
11047
11060
  if (!this.multiselect) {
11048
11061
  this.selectViewModel(nextModel, false);
11049
11062
  }
11063
+ else {
11064
+ this._scrollIntoView();
11065
+ }
11050
11066
  };
11051
11067
  ListOfValuesPopupComponent.prototype._prepareViewModelsMain = function () {
11052
11068
  var _this = this;
@@ -11075,7 +11091,8 @@
11075
11091
  return;
11076
11092
  }
11077
11093
  var offsetHeight = activeItem.offsetHeight, offsetTop = activeItem.offsetTop;
11078
- var parentOffsetHeight = scrollParent.offsetHeight, scrollTop = scrollParent.scrollTop;
11094
+ var parentOffsetHeight = scrollParent.offsetHeight, scrollTop = scrollParent.scrollTop, parentOffsetTop = scrollParent.offsetTop;
11095
+ offsetTop = offsetTop - parentOffsetTop;
11079
11096
  var isAbove = offsetTop < scrollTop;
11080
11097
  var isBelow = offsetTop + offsetHeight > scrollTop + parentOffsetHeight;
11081
11098
  if (isAbove) {
@@ -11090,10 +11107,13 @@
11090
11107
  ListOfValuesPopupComponent.decorators = [
11091
11108
  { type: i0.Component, args: [{
11092
11109
  selector: 'co-list-of-values-popup',
11093
- template: "\n <div class=\"lov-options\" [overlay]=\"parentForOverlay\" [inheritWidth]=\"true\" [ngClass]=\"customCssClass\" id=\"lov-popup\"\n [tabIndex]=\"-1\" role=\"listbox\"\n (clickOutside)=\"closePopup.emit($event)\">\n <co-input-search *ngIf=\"multiselect\" \n [(model)]=\"searchTerm\"\n [placeholder]=\"searchPlaceholder\"\n (keydown)=\"handleInputKeyDown($event)\"\n (modelChange)=\"filterViewModels()\"></co-input-search>\n <ul class=\"dropdown-list\" #dropDownList>\n <li #lovItem *ngFor=\"let viewModel of viewModels; let index = index\" [class.selected]=\"viewModel === highLightModel\"\n (click)=\"selectViewModel(viewModel, false)\" role=\"option\">\n <ng-container *ngIf=\"!multiselect\">\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n <ng-container *ngIf=\"multiselect\">\n <co-input-checkbox [model]=\"viewModel.checked\" (modelChange)=\"selectViewModel(viewModel, false)\"></co-input-checkbox>\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n </li>\n </ul>\n </div>\n ",
11110
+ template: "\n <div class=\"lov-options\" [overlay]=\"parentForOverlay\" [inheritWidth]=\"true\" [ngClass]=\"customCssClass\" id=\"lov-popup\"\n role=\"listbox\" [tabindex]=\"-1\"\n (clickOutside)=\"closePopup.emit($event)\">\n <co-input-search *ngIf=\"multiselect\"\n tabindex=\"-1\"\n [(model)]=\"searchTerm\"\n [placeholder]=\"searchPlaceholder\"\n (keydown)=\"handleInputKeyDown($event)\"\n (modelChange)=\"filterViewModels()\"></co-input-search>\n <ul class=\"dropdown-list\" #dropDownList>\n <li #lovItem *ngFor=\"let viewModel of viewModels; let index = index\" [class.selected]=\"viewModel === highLightModel\"\n (click)=\"selectViewModel(viewModel, !multiselect)\" role=\"option\">\n <ng-container *ngIf=\"!multiselect\">\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n <ng-container *ngIf=\"multiselect\">\n <co-input-checkbox [model]=\"viewModel.checked\" (modelChange)=\"selectViewModel(viewModel, false)\"></co-input-checkbox>\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n </li>\n </ul>\n </div>\n ",
11094
11111
  encapsulation: i0.ViewEncapsulation.None
11095
11112
  },] }
11096
11113
  ];
11114
+ ListOfValuesPopupComponent.ctorParameters = function () { return [
11115
+ { type: i0.ElementRef }
11116
+ ]; };
11097
11117
  ListOfValuesPopupComponent.propDecorators = {
11098
11118
  lovItems: [{ type: i0.ViewChildren, args: ['lovItem', { read: i0.ElementRef },] }],
11099
11119
  dropDownList: [{ type: i0.ViewChild, args: ['dropDownList', { read: i0.ElementRef },] }],
@@ -11108,6 +11128,7 @@
11108
11128
  collection: [{ type: i0.Input }],
11109
11129
  modelChange: [{ type: i0.Output }],
11110
11130
  closePopup: [{ type: i0.Output }],
11131
+ keyDown: [{ type: i0.Output }],
11111
11132
  showClass: [{ type: i0.HostBinding, args: ['class.co-list-of-values-popup',] }]
11112
11133
  };
11113
11134
 
@@ -11119,7 +11140,6 @@
11119
11140
  _this.multiselect = false;
11120
11141
  _this.displayField = 'description';
11121
11142
  _this.searchDisabled = false;
11122
- _this.closeAfterOptionChosen = true;
11123
11143
  _this.isSelectOpen = false;
11124
11144
  _this.state = 'default';
11125
11145
  _this.selectedModels = [];
@@ -11158,6 +11178,9 @@
11158
11178
  if (this._lovPopupComponentRef) {
11159
11179
  this._lovPopupComponentRef.instance.searchTerm = model;
11160
11180
  }
11181
+ if (!this.selectedModel && model) {
11182
+ this.openPopup();
11183
+ }
11161
11184
  this.selectedModel = model;
11162
11185
  };
11163
11186
  ListOfValuesComponent.prototype.handleInputKeyDown = function (event) {
@@ -11216,8 +11239,10 @@
11216
11239
  collection: this.collection
11217
11240
  }, {
11218
11241
  modelChange: function (value) { return _this.optionChosen(value); },
11219
- closePopup: function () { return _this.closePopup(); }
11242
+ closePopup: function () { return _this.closePopup(); },
11243
+ keyDown: function (event) { return _this.handleInputKeyDown(event); }
11220
11244
  });
11245
+ this.keepFocussed = true;
11221
11246
  };
11222
11247
  ListOfValuesComponent.prototype.removeOptionFromModel = function (chip) {
11223
11248
  if (this.multiselect) {
@@ -11234,15 +11259,13 @@
11234
11259
  }
11235
11260
  else {
11236
11261
  this.selectedModel = option[this.displayField];
11237
- if (this.closeAfterOptionChosen) {
11238
- this.toggleSelect();
11239
- }
11240
11262
  }
11241
11263
  }
11242
11264
  this.model = option;
11243
11265
  this.modelChange.emit(this.model);
11244
11266
  };
11245
11267
  ListOfValuesComponent.prototype.closePopup = function () {
11268
+ this.keepFocussed = false;
11246
11269
  this.isSelectOpen = false;
11247
11270
  this.overlayService.removeComponent(this._lovPopupComponentRef);
11248
11271
  this._lovPopupComponentRef = undefined;
@@ -11288,7 +11311,7 @@
11288
11311
  ListOfValuesComponent.decorators = [
11289
11312
  { type: i0.Component, args: [{
11290
11313
  selector: 'co-list-of-values',
11291
- template: "\n <co-input-text aria-haspopup=\"listbox\" [attr.aria-expanded]=\"isSelectOpen\" aria-controls=\"lov-popup\" role=\"combobox\"\n class=\"no-focus-line\"\n overlayParent\n #parentForOverlay=\"overlayParent\" type=\"text\" [id]=\"label\"\n [model]=\"multiselect ? selectedModels : selectedModel\"\n [placeholder]=\"label\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [noClickFocus]=\"false\"\n [leftIconData]=\"leftIconData\"\n [rightIcon]=\"isSelectOpen ? icons.ChevronUpRegular : icons.ChevronDownRegular\"\n [showClearButton]=\"true\"\n [useContent]=\"multiselect\"\n (modelChange)=\"handleInputModelChange($event)\"\n (click)=\"openPopup()\"\n (rightIconClick)=\"toggleSelect()\"\n (keydown)=\"handleInputKeyDown($event)\"\n (clearIconClick)=\"clearModel($event)\"\n (blur)=\"checkModel()\"\n >\n </co-input-text>\n <ng-container *ngIf=\"multiselect\">\n <div class=\"multiselect-chips-wrapper\">\n <div class=\"chips\" *ngFor=\"let chip of model\">\n <span class=\"chips-description\" [textContent]=\"chip[displayField]\"></span>\n <co-icon class=\"remove-chip-icon\" [icon]=\"icons.CrossSkinny\" (click)=\"removeOptionFromModel(chip)\"></co-icon>\n </div>\n </div>\n </ng-container>\n ",
11314
+ template: "\n <co-input-text aria-haspopup=\"listbox\" [attr.aria-expanded]=\"isSelectOpen\" aria-controls=\"lov-popup\" role=\"combobox\"\n class=\"no-focus-line\"\n overlayParent\n #parentForOverlay=\"overlayParent\" type=\"text\" [id]=\"label\"\n [model]=\"multiselect ? selectedModels : selectedModel\"\n [placeholder]=\"label\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [noClickFocus]=\"false\"\n [leftIconData]=\"leftIconData\"\n [rightIcon]=\"isSelectOpen ? icons.ChevronUpRegular : icons.ChevronDownRegular\"\n [showClearButton]=\"true\"\n [useContent]=\"multiselect\"\n [customHeight]=\"multiselect\"\n [keepFocussed]=\"keepFocussed\"\n (modelChange)=\"handleInputModelChange($event)\"\n (click)=\"openPopup()\"\n (rightIconClick)=\"toggleSelect()\"\n (keydown)=\"handleInputKeyDown($event)\"\n (clearIconClick)=\"clearModel($event)\"\n (blur)=\"checkModel()\"\n >\n <ng-container *ngIf=\"multiselect\">\n <div class=\"multiselect-chips-wrapper\">\n <div class=\"chips\" *ngFor=\"let chip of model\">\n <span class=\"chips-description\" [textContent]=\"chip[displayField]\"></span>\n <co-icon class=\"remove-chip-icon\" [icon]=\"icons.CrossSkinny\" (click)=\"removeOptionFromModel(chip)\"></co-icon>\n </div>\n </div>\n </ng-container>\n </co-input-text>\n ",
11292
11315
  providers: [
11293
11316
  OverlayService
11294
11317
  ],
@@ -11306,7 +11329,6 @@
11306
11329
  label: [{ type: i0.Input }],
11307
11330
  customCssClass: [{ type: i0.Input }],
11308
11331
  searchDisabled: [{ type: i0.Input }],
11309
- closeAfterOptionChosen: [{ type: i0.Input }],
11310
11332
  showClass: [{ type: i0.HostBinding, args: ['class.co-list-of-values',] }]
11311
11333
  };
11312
11334