@colijnit/corecomponents_v12 12.0.95 → 12.0.96

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.
@@ -1293,13 +1293,24 @@
1293
1293
  }
1294
1294
  Object.defineProperty(IconComponent.prototype, "icon", {
1295
1295
  set: function (value) {
1296
- this._setIconFromEnum(value);
1296
+ this._icon = value;
1297
1297
  },
1298
1298
  enumerable: false,
1299
1299
  configurable: true
1300
1300
  });
1301
+ IconComponent.prototype.ngOnInit = function () {
1302
+ this._prepareIcon();
1303
+ };
1304
+ IconComponent.prototype._prepareIcon = function () {
1305
+ if (this.iconData) {
1306
+ this.innerIconData = this.iconData;
1307
+ }
1308
+ else if (this._icon) {
1309
+ this._setIconFromEnum(this._icon);
1310
+ }
1311
+ };
1301
1312
  IconComponent.prototype._setIconFromEnum = function (icon) {
1302
- this.iconData = this._iconCache.getIcon(icon);
1313
+ this.innerIconData = this._iconCache.getIcon(icon);
1303
1314
  };
1304
1315
  return IconComponent;
1305
1316
  }());
@@ -1315,8 +1326,9 @@
1315
1326
  ]; };
1316
1327
  IconComponent.propDecorators = {
1317
1328
  icon: [{ type: i0.Input }],
1318
- iconData: [{ type: i0.Input }, { type: i0.HostBinding, args: ["innerHtml",] }],
1319
- showClass: [{ type: i0.HostBinding, args: ["class.co-icon",] }]
1329
+ iconData: [{ type: i0.Input }],
1330
+ showClass: [{ type: i0.HostBinding, args: ['class.co-icon',] }],
1331
+ innerIconData: [{ type: i0.HostBinding, args: ['innerHtml',] }]
1320
1332
  };
1321
1333
 
1322
1334
  var IconModule = /** @class */ (function () {
@@ -7596,12 +7608,31 @@
7596
7608
  _this.showClearButton = undefined;
7597
7609
  _this.showPlaceholderOnFocus = true;
7598
7610
  _this.noStyle = false;
7599
- _this.hasOwnLabel = true;
7600
7611
  _this.hideArrowButtons = false;
7601
7612
  _this.isSmall = false;
7613
+ _this.leftIconClick = new i0.EventEmitter();
7614
+ _this.rightIconClick = new i0.EventEmitter();
7615
+ _this.hasOwnLabel = true;
7602
7616
  _super.prototype._markAsOnPush.call(_this);
7603
7617
  return _this;
7604
7618
  }
7619
+ InputTextComponent.prototype.showClass = function () {
7620
+ return true;
7621
+ };
7622
+ Object.defineProperty(InputTextComponent.prototype, "hasLeftIcon", {
7623
+ get: function () {
7624
+ return this.leftIcon !== undefined && this.leftIcon !== null;
7625
+ },
7626
+ enumerable: false,
7627
+ configurable: true
7628
+ });
7629
+ Object.defineProperty(InputTextComponent.prototype, "hasRightIcon", {
7630
+ get: function () {
7631
+ return this.rightIcon !== undefined && this.rightIcon !== null;
7632
+ },
7633
+ enumerable: false,
7634
+ configurable: true
7635
+ });
7605
7636
  Object.defineProperty(InputTextComponent.prototype, "model", {
7606
7637
  get: function () {
7607
7638
  return _super.prototype.model;
@@ -7622,34 +7653,27 @@
7622
7653
  enumerable: false,
7623
7654
  configurable: true
7624
7655
  });
7625
- InputTextComponent.prototype.showClass = function () {
7626
- return true;
7627
- };
7628
- Object.defineProperty(InputTextComponent.prototype, "hasLeftIcon", {
7629
- get: function () {
7630
- return this.leftIcon !== undefined && this.leftIcon !== null;
7631
- },
7632
- enumerable: false,
7633
- configurable: true
7634
- });
7635
- Object.defineProperty(InputTextComponent.prototype, "hasRightIcon", {
7636
- get: function () {
7637
- return this.rightIcon !== undefined && this.rightIcon !== null;
7638
- },
7639
- enumerable: false,
7640
- configurable: true
7641
- });
7642
7656
  // exclude some non-digit characters, since input type 'number' still allows the characters -, + and e
7643
7657
  InputTextComponent.prototype.excludeNonDigitChars = function (event) {
7644
7658
  var excludedKeys = this.excludePlusMinus ? ['e', '-', '+'] : ['e'];
7645
7659
  return !excludedKeys.includes(event.key);
7646
7660
  };
7661
+ InputTextComponent.prototype.handleLeftIconClick = function (event) {
7662
+ event.preventDefault();
7663
+ event.stopPropagation();
7664
+ this.leftIconClick.emit(event);
7665
+ };
7666
+ InputTextComponent.prototype.handleRightIconClick = function (event) {
7667
+ event.preventDefault();
7668
+ event.stopPropagation();
7669
+ this.rightIconClick.emit(event);
7670
+ };
7647
7671
  return InputTextComponent;
7648
7672
  }(BaseInputComponent));
7649
7673
  InputTextComponent.decorators = [
7650
7674
  { type: i0.Component, args: [{
7651
7675
  selector: "co-input-text",
7652
- template: "\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\"\n [textContent]=\"placeholder\"></label>\n <co-icon *ngIf=\"leftIcon\" class=\"input-text-left-icon\" [icon]=\"leftIcon\"></co-icon>\n <co-icon *ngIf=\"rightIcon\" class=\"input-text-right-icon\" [icon]=\"rightIcon\"></co-icon>\n <input #input\n [type]=\"digitsOnly ? 'number' : type\"\n [ngModel]=\"model\"\n [min]=\"type === 'number' && this.min ? this.min : undefined\"\n [max]=\"type === 'number' && 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-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 <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
7676
+ template: "\n <co-icon *ngIf=\"leftIcon\" class=\"input-text-left-icon\" [icon]=\"leftIcon\" [iconData]=\"leftIconData\" (click)=\"handleLeftIconClick($event)\"></co-icon>\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\"\n [textContent]=\"placeholder\"></label>\n <input #input\n [type]=\"digitsOnly ? 'number' : type\"\n [ngModel]=\"model\"\n [min]=\"type === 'number' && this.min ? this.min : undefined\"\n [max]=\"type === 'number' && 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 *ngIf=\"rightIcon\" class=\"input-text-right-icon\" [icon]=\"rightIcon\" [iconData]=\"rightIconData\" (click)=\"handleRightIconClick($event)\"></co-icon>\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 <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
7653
7677
  providers: [{
7654
7678
  provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
7655
7679
  useExisting: i0.forwardRef(function () { return InputTextComponent; })
@@ -7680,13 +7704,17 @@
7680
7704
  showPlaceholderOnFocus: [{ type: i0.Input }],
7681
7705
  leftIcon: [{ type: i0.Input }],
7682
7706
  rightIcon: [{ type: i0.Input }],
7707
+ leftIconData: [{ type: i0.Input }],
7708
+ rightIconData: [{ type: i0.Input }],
7683
7709
  noStyle: [{ type: i0.HostBinding, args: ['class.no-style',] }, { type: i0.Input }],
7710
+ hideArrowButtons: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.hide-arrows',] }],
7711
+ isSmall: [{ type: i0.HostBinding, args: ['class.is-small',] }, { type: i0.Input }],
7712
+ leftIconClick: [{ type: i0.Output }],
7713
+ rightIconClick: [{ type: i0.Output }],
7684
7714
  showClass: [{ type: i0.HostBinding, args: ["class.co-input-text",] }],
7685
7715
  hasLeftIcon: [{ type: i0.HostBinding, args: ['class.has-left-icon',] }],
7686
7716
  hasRightIcon: [{ type: i0.HostBinding, args: ['class.has-right-icon',] }],
7687
- hasOwnLabel: [{ type: i0.HostBinding, args: ["class.has-own-label",] }],
7688
- hideArrowButtons: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.hide-arrows',] }],
7689
- isSmall: [{ type: i0.HostBinding, args: ['class.is-small',] }, { type: i0.Input }]
7717
+ hasOwnLabel: [{ type: i0.HostBinding, args: ["class.has-own-label",] }]
7690
7718
  };
7691
7719
 
7692
7720
  var ValidationErrorModule = /** @class */ (function () {
@@ -7846,6 +7874,8 @@
7846
7874
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
7847
7875
  _this.searchIcon = exports.CoreComponentsIcon.Magnifier;
7848
7876
  _this.search = new i0.EventEmitter();
7877
+ _this.leftIconClick = new i0.EventEmitter();
7878
+ _this.rightIconClick = new i0.EventEmitter();
7849
7879
  _this.useLeftIcon = false;
7850
7880
  _this.useRightIcon = false;
7851
7881
  _this.centerLabel = false;
@@ -7868,7 +7898,7 @@
7868
7898
  InputSearchComponent.decorators = [
7869
7899
  { type: i0.Component, args: [{
7870
7900
  selector: 'co-input-search',
7871
- template: "\n <co-input-text\n [model]=\"model\"\n [leftIcon]=\"useLeftIcon ? searchIcon : null\"\n [rightIcon]=\"useRightIcon ? searchIcon : null\"\n [placeholder]=\"placeholder\"\n [customHeight]=\"true\"\n [showPlaceholderOnFocus]=\"false\"\n (modelChange)=\"modelChange.emit($event)\"\n ></co-input-text>\n ",
7901
+ template: "\n <co-input-text\n [model]=\"model\"\n [leftIcon]=\"useLeftIcon ? searchIcon : null\"\n [rightIcon]=\"useRightIcon ? searchIcon : null\"\n [leftIconData]=\"useLeftIcon && leftIconData ? leftIconData : undefined\"\n [rightIconData]=\"useRightIcon && rightIconData ? rightIconData : undefined\"\n [placeholder]=\"placeholder\"\n [customHeight]=\"true\"\n [showPlaceholderOnFocus]=\"false\"\n (modelChange)=\"modelChange.emit($event)\"\n (leftIconClick)=\"leftIconClick.emit($event)\"\n (rightIconClick)=\"rightIconClick.emit($event)\"\n ></co-input-text>\n ",
7872
7902
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
7873
7903
  encapsulation: i0.ViewEncapsulation.None
7874
7904
  },] }
@@ -7876,8 +7906,12 @@
7876
7906
  InputSearchComponent.propDecorators = {
7877
7907
  placeholder: [{ type: i0.Input }],
7878
7908
  search: [{ type: i0.Output }],
7909
+ leftIconClick: [{ type: i0.Output }],
7910
+ rightIconClick: [{ type: i0.Output }],
7879
7911
  useLeftIcon: [{ type: i0.Input }],
7880
7912
  useRightIcon: [{ type: i0.Input }],
7913
+ leftIconData: [{ type: i0.Input }],
7914
+ rightIconData: [{ type: i0.Input }],
7881
7915
  centerLabel: [{ type: i0.HostBinding, args: ['class.center-label',] }, { type: i0.Input }],
7882
7916
  showClass: [{ type: i0.HostBinding, args: ['class.co-input-search',] }]
7883
7917
  };