@porscheinformatik/clr-addons 11.1.0 → 11.2.0

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.
@@ -2826,7 +2826,7 @@
2826
2826
  var CLR_BLANK_OPTION = { id: '-BLANK-', label: '- Select an option -', value: null };
2827
2827
 
2828
2828
  /*
2829
- * Copyright (c) 2018-2020 Porsche Informatik. All Rights Reserved.
2829
+ * Copyright (c) 2018-2022 Porsche Informatik. All Rights Reserved.
2830
2830
  * This software is released under MIT license.
2831
2831
  * The full license information can be found in LICENSE in the root directory of this project.
2832
2832
  */
@@ -2835,6 +2835,7 @@
2835
2835
  this.mandatory = false;
2836
2836
  this.allValues = [];
2837
2837
  this.excludedValues = [];
2838
+ this.disabled = false;
2838
2839
  this.valueChanged = new i0.EventEmitter();
2839
2840
  this.remove = new i0.EventEmitter();
2840
2841
  }
@@ -2865,7 +2866,7 @@
2865
2866
  ClrAddOption.decorators = [
2866
2867
  { type: i0.Component, args: [{
2867
2868
  selector: 'clr-add-option',
2868
- template: "<div *ngIf=\"!(readonly || readonly === ''); else readonlyView\" class=\"clr-select-wrapper quick-list-input\">\n <select #select clr-select class=\"quick-list-select\" name=\"options\" [(ngModel)]=\"selectedValue\">\n <option *ngIf=\"blankOption.id === selectedValue\" [selected]=\"true\" [disabled]=\"true\" [ngValue]=\"blankOption.id\">\n {{blankOption.label}}\n </option>\n <option *ngFor=\"let val of getValues()\" [selected]=\"val.id === selectedValue\" [ngValue]=\"val.id\">\n {{val.label}}\n </option>\n </select>\n</div>\n\n<ng-template #readonlyView>\n <span>{{value.label}}</span>\n</ng-template>\n\n<button\n *ngIf=\"!(readonly || readonly === '')\"\n type=\"button\"\n class=\"btn btn-icon btn-link quick-list-trash\"\n [disabled]=\"trashDisabled()\"\n (click)=\"remove.emit()\"\n>\n <clr-icon shape=\"trash\"></clr-icon>\n</button>\n",
2869
+ template: "<div *ngIf=\"!(readonly || readonly === ''); else readonlyView\" class=\"clr-select-wrapper quick-list-input\">\n <select #select clr-select class=\"quick-list-select\" name=\"options\" [(ngModel)]=\"selectedValue\" [disabled]=\"disabled\">\n <option *ngIf=\"blankOption.id === selectedValue\" [selected]=\"true\" [disabled]=\"true\" [ngValue]=\"blankOption.id\">\n {{blankOption.label}}\n </option>\n <option *ngFor=\"let val of getValues()\" [selected]=\"val.id === selectedValue\" [ngValue]=\"val.id\">\n {{val.label}}\n </option>\n </select>\n</div>\n\n<ng-template #readonlyView>\n <span>{{value.label}}</span>\n</ng-template>\n\n<button\n *ngIf=\"!(readonly || readonly === '')\"\n type=\"button\"\n class=\"btn btn-icon btn-link quick-list-trash\"\n [disabled]=\"trashDisabled() || disabled\"\n (click)=\"remove.emit()\"\n>\n <clr-icon shape=\"trash\"></clr-icon>\n</button>\n",
2869
2870
  host: { '[class.quick-list-option]': 'true' }
2870
2871
  },] }
2871
2872
  ];
@@ -2876,51 +2877,61 @@
2876
2877
  allValues: [{ type: i0.Input }],
2877
2878
  excludedValues: [{ type: i0.Input }],
2878
2879
  readonly: [{ type: i0.Input }],
2880
+ disabled: [{ type: i0.Input }],
2879
2881
  valueChanged: [{ type: i0.Output }],
2880
2882
  remove: [{ type: i0.Output }],
2881
2883
  select: [{ type: i0.ViewChild, args: ['select', { static: false },] }]
2882
2884
  };
2883
2885
 
2884
- /*
2885
- * Copyright (c) 2018-2020 Porsche Informatik. All Rights Reserved.
2886
- * This software is released under MIT license.
2887
- * The full license information can be found in LICENSE in the root directory of this project.
2888
- */
2889
- var ClrQuickList = /** @class */ (function () {
2886
+ var ClrQuickList = /** @class */ (function (_super) {
2887
+ __extends(ClrQuickList, _super);
2890
2888
  function ClrQuickList() {
2891
- this.blankOption = CLR_BLANK_OPTION;
2892
- this.allValues = [this.blankOption];
2893
- this.mandatory = false;
2894
- this.values = [];
2895
- this.addLabel = 'ADD';
2896
- this.controlClasses = 'clr-col-md-10';
2897
- this.valuesChanged = new i0.EventEmitter();
2898
- this.emptyOptionAdded = new i0.EventEmitter();
2889
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
2890
+ _this.blankOption = CLR_BLANK_OPTION;
2891
+ _this.allValues = [_this.blankOption];
2892
+ _this.mandatory = false;
2893
+ _this.values = [];
2894
+ _this.addLabel = 'ADD';
2895
+ _this.controlClasses = 'clr-col-md-10';
2896
+ _this.valuesChanged = new i0.EventEmitter();
2897
+ _this.emptyOptionAdded = new i0.EventEmitter();
2898
+ return _this;
2899
2899
  }
2900
2900
  ClrQuickList.prototype.ngOnInit = function () {
2901
- if (this.values.length === 0 && this.mandatory) {
2902
- this.values.push(this.blankOption);
2901
+ var _a;
2902
+ if (this.values.length === 0) {
2903
+ (_a = this.values).push.apply(_a, __spreadArray([], __read(this.getEmptyValues())));
2903
2904
  }
2904
2905
  };
2906
+ ClrQuickList.prototype.writeValue = function (value) {
2907
+ this.values = (value === null || value === void 0 ? void 0 : value.length) ? __spreadArray([], __read(value)) : this.getEmptyValues();
2908
+ };
2909
+ ClrQuickList.prototype.getEmptyValues = function () {
2910
+ return this.mandatory ? [this.blankOption] : [];
2911
+ };
2905
2912
  ClrQuickList.prototype.onValueChanged = function (value, i) {
2906
2913
  if (value) {
2907
2914
  this.values[i] = value;
2908
- this.valuesChanged.emit(this.values);
2915
+ this.emitValueChanged();
2909
2916
  this.focusOption(value);
2910
2917
  }
2911
2918
  };
2912
2919
  ClrQuickList.prototype.onRemoveValue = function (i) {
2913
2920
  this.values.splice(i, 1);
2914
- this.valuesChanged.emit(this.values);
2921
+ this.emitValueChanged();
2915
2922
  };
2916
2923
  ClrQuickList.prototype.addBlankOption = function () {
2917
2924
  if (!this.hasBlankOption()) {
2918
2925
  this.values.push(this.blankOption);
2919
- this.valuesChanged.emit(this.values);
2926
+ this.emitValueChanged();
2920
2927
  this.emptyOptionAdded.emit();
2921
2928
  this.focusOption(this.blankOption);
2922
2929
  }
2923
2930
  };
2931
+ ClrQuickList.prototype.emitValueChanged = function () {
2932
+ this.valuesChanged.emit(this.values);
2933
+ this.onChange(this.values);
2934
+ };
2924
2935
  ClrQuickList.prototype.focusOption = function (option) {
2925
2936
  var _this = this;
2926
2937
  setTimeout(function () {
@@ -2937,12 +2948,19 @@
2937
2948
  return this.hasBlankOption() || this.values.length === this.allValues.length;
2938
2949
  };
2939
2950
  return ClrQuickList;
2940
- }());
2951
+ }(ClrAbstractFormComponent));
2941
2952
  ClrQuickList.decorators = [
2942
2953
  { type: i0.Component, args: [{
2943
2954
  selector: 'clr-quick-list',
2944
2955
  host: { '[class.quick-list]': 'true' },
2945
- template: "<ng-content select=\"label\"></ng-content>\n<div class=\"clr-control-container\" [ngClass]=\"controlClasses\">\n <ng-container *ngFor=\"let value of values; index as i\">\n <clr-add-option\n [allValues]=\"allValues\"\n [excludedValues]=\"values\"\n (remove)=\"onRemoveValue(i)\"\n [value]=\"value\"\n (valueChanged)=\"onValueChanged($event, i)\"\n [blankOption]=\"blankOption\"\n [mandatory]=\"mandatory\"\n [readonly]=\"readonly\"\n >\n </clr-add-option>\n </ng-container>\n <button\n *ngIf=\"!(readonly || readonly === '')\"\n type=\"button\"\n class=\"btn btn-link btn-sm quick-list-add\"\n (click)=\"addBlankOption()\"\n [disabled]=\"addNotPossible()\"\n >\n {{addLabel}}\n </button>\n</div>\n"
2956
+ template: "<ng-content select=\"label\"></ng-content>\n<div class=\"clr-control-container\" [ngClass]=\"controlClasses\">\n <ng-container *ngFor=\"let value of values; index as i\">\n <clr-add-option\n [allValues]=\"allValues\"\n [excludedValues]=\"values\"\n (remove)=\"onRemoveValue(i)\"\n [value]=\"value\"\n (valueChanged)=\"onValueChanged($event, i)\"\n [blankOption]=\"blankOption\"\n [mandatory]=\"mandatory\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n >\n </clr-add-option>\n </ng-container>\n <button\n *ngIf=\"!(readonly || readonly === '')\"\n type=\"button\"\n class=\"btn btn-link btn-sm quick-list-add\"\n (click)=\"addBlankOption()\"\n [disabled]=\"addNotPossible() || disabled\"\n >\n {{addLabel}}\n </button>\n</div>\n",
2957
+ providers: [
2958
+ {
2959
+ provide: forms.NG_VALUE_ACCESSOR,
2960
+ useExisting: i0.forwardRef(function () { return ClrQuickList; }),
2961
+ multi: true,
2962
+ },
2963
+ ]
2946
2964
  },] }
2947
2965
  ];
2948
2966
  ClrQuickList.propDecorators = {
@@ -4189,10 +4207,10 @@
4189
4207
  },] }
4190
4208
  ];
4191
4209
  LocationBarComponent.propDecorators = {
4192
- iconShape: [{ type: i0.Input }],
4193
- iconTitle: [{ type: i0.Input }],
4194
- roots: [{ type: i0.Input }],
4195
- selectionChanged: [{ type: i0.Output }]
4210
+ iconShape: [{ type: i0.Input, args: ['clrIconShape',] }],
4211
+ iconTitle: [{ type: i0.Input, args: ['clrIconTitle',] }],
4212
+ roots: [{ type: i0.Input, args: ['clrRoots',] }],
4213
+ selectionChanged: [{ type: i0.Output, args: ['clrSelectionChanged',] }]
4196
4214
  };
4197
4215
 
4198
4216
  var CONTENT_PROVIDER = new i0.InjectionToken('CONTENT_PROVIDER');
@@ -5089,9 +5107,9 @@
5089
5107
  exports["ɵb"] = TreetableHeaderRenderer;
5090
5108
  exports["ɵc"] = TreetableRowRenderer;
5091
5109
  exports["ɵd"] = TreetableCellRenderer;
5092
- exports["ɵe"] = ClrAddOption;
5093
- exports["ɵf"] = ClrMultilingualAbstract;
5094
- exports["ɵg"] = ClrAbstractFormComponent;
5110
+ exports["ɵe"] = ClrAbstractFormComponent;
5111
+ exports["ɵf"] = ClrAddOption;
5112
+ exports["ɵg"] = ClrMultilingualAbstract;
5095
5113
  exports["ɵh"] = ClrAutocompleteOffModule;
5096
5114
  exports["ɵi"] = ClrAutocompleteOff;
5097
5115
  exports["ɵj"] = LocationBarComponent;