@festo-ui/angular 5.0.0-dev.80 → 5.0.0-dev.86

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.
@@ -4982,45 +4982,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
4982
4982
  type: Output
4983
4983
  }] } });
4984
4984
 
4985
- class FngValueAccessorBaseDirective {
4986
- constructor() {
4987
- this.disabled = false;
4988
- this.changed = new Array();
4989
- this.touched = new Array();
4990
- }
4991
- get value() {
4992
- return this.innerValue;
4993
- }
4994
- set value(value) {
4995
- if (value && this.innerValue !== value) {
4996
- this.innerValue = value;
4997
- this.changed.forEach(f => f(value));
4998
- }
4999
- }
5000
- touch() {
5001
- this.touched.forEach(f => f());
5002
- }
5003
- writeValue(value) {
5004
- this.innerValue = value;
5005
- }
5006
- registerOnChange(fn) {
5007
- this.changed.push(fn);
5008
- }
5009
- registerOnTouched(fn) {
5010
- this.touched.push(fn);
5011
- }
5012
- setDisabledState(isDisabled) {
5013
- this.disabled = isDisabled;
5014
- }
5015
- }
5016
- FngValueAccessorBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: FngValueAccessorBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5017
- FngValueAccessorBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.1", type: FngValueAccessorBaseDirective, inputs: { disabled: "disabled" }, ngImport: i0 });
5018
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: FngValueAccessorBaseDirective, decorators: [{
5019
- type: Directive
5020
- }], propDecorators: { disabled: [{
5021
- type: Input
5022
- }] } });
5023
-
5024
4985
  class FngSegmentControlComponent {
5025
4986
  constructor() {
5026
4987
  this.viewMode = 'text';
@@ -5046,16 +5007,21 @@ class FngSegmentControlComponent {
5046
5007
  ngAfterViewInit() {
5047
5008
  this.view = this.tpl?.createEmbeddedView(null);
5048
5009
  }
5049
- onChange(event) {
5010
+ onInputChange(event) {
5011
+ event.stopPropagation();
5012
+ this.checked = true;
5050
5013
  const target = event.target;
5051
5014
  this.change.emit(target.value);
5052
5015
  }
5016
+ onInputClick(event) {
5017
+ event.stopPropagation();
5018
+ }
5053
5019
  }
5054
5020
  FngSegmentControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: FngSegmentControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5055
- FngSegmentControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.1", type: FngSegmentControlComponent, isStandalone: true, selector: "fng-segment-control", inputs: { name: "name", value: "value", label: "label", icon: "icon", iconOnly: "iconOnly", checked: "checked", disabled: "disabled" }, outputs: { change: "change" }, viewQueries: [{ propertyName: "tpl", first: true, predicate: ["tpl"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template #tpl>\n <input\n (change)=\"onChange($event)\"\n class=\"fwe-segment-input\"\n type=\"radio\"\n [id]=\"id\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n />\n <label class=\"fwe-segment-label\" [for]=\"id\">\n <ng-container [ngSwitch]=\"viewMode\">\n <ng-container *ngSwitchCase=\"'icon'\">\n <span class=\"fwe-sr-only\">{{ label }}</span>\n <i aria-hidden=\"true\" class=\"fwe-icon\" [ngClass]=\"icon\"></i>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n {{ label }}\n </ng-container>\n <ng-container *ngSwitchCase=\"'icon-text'\"> <i aria-hidden=\"true\" class=\"fwe-icon\" [ngClass]=\"icon\"></i>{{ label }} </ng-container>\n </ng-container>\n </label>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5021
+ FngSegmentControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.1", type: FngSegmentControlComponent, isStandalone: true, selector: "fng-segment-control", inputs: { name: "name", value: "value", label: "label", icon: "icon", iconOnly: "iconOnly", checked: "checked", disabled: "disabled" }, outputs: { change: "change" }, viewQueries: [{ propertyName: "tpl", first: true, predicate: ["tpl"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template #tpl>\n <input\n (change)=\"onInputChange($event)\"\n (click)=\"onInputClick($event)\"\n class=\"fwe-segment-input\"\n type=\"radio\"\n [id]=\"id\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n />\n <label class=\"fwe-segment-label\" [for]=\"id\">\n <ng-container [ngSwitch]=\"viewMode\">\n <ng-container *ngSwitchCase=\"'icon'\">\n <span class=\"fwe-sr-only\">{{ label }}</span>\n <i aria-hidden=\"true\" class=\"fwe-icon\" [ngClass]=\"icon\"></i>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n {{ label }}\n </ng-container>\n <ng-container *ngSwitchCase=\"'icon-text'\"> <i aria-hidden=\"true\" class=\"fwe-icon\" [ngClass]=\"icon\"></i>{{ label }} </ng-container>\n </ng-container>\n </label>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], encapsulation: i0.ViewEncapsulation.None });
5056
5022
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: FngSegmentControlComponent, decorators: [{
5057
5023
  type: Component,
5058
- args: [{ standalone: true, imports: [CommonModule], selector: 'fng-segment-control', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-template #tpl>\n <input\n (change)=\"onChange($event)\"\n class=\"fwe-segment-input\"\n type=\"radio\"\n [id]=\"id\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n />\n <label class=\"fwe-segment-label\" [for]=\"id\">\n <ng-container [ngSwitch]=\"viewMode\">\n <ng-container *ngSwitchCase=\"'icon'\">\n <span class=\"fwe-sr-only\">{{ label }}</span>\n <i aria-hidden=\"true\" class=\"fwe-icon\" [ngClass]=\"icon\"></i>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n {{ label }}\n </ng-container>\n <ng-container *ngSwitchCase=\"'icon-text'\"> <i aria-hidden=\"true\" class=\"fwe-icon\" [ngClass]=\"icon\"></i>{{ label }} </ng-container>\n </ng-container>\n </label>\n</ng-template>\n" }]
5024
+ args: [{ standalone: true, imports: [CommonModule], selector: 'fng-segment-control', encapsulation: ViewEncapsulation.None, template: "<ng-template #tpl>\n <input\n (change)=\"onInputChange($event)\"\n (click)=\"onInputClick($event)\"\n class=\"fwe-segment-input\"\n type=\"radio\"\n [id]=\"id\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n />\n <label class=\"fwe-segment-label\" [for]=\"id\">\n <ng-container [ngSwitch]=\"viewMode\">\n <ng-container *ngSwitchCase=\"'icon'\">\n <span class=\"fwe-sr-only\">{{ label }}</span>\n <i aria-hidden=\"true\" class=\"fwe-icon\" [ngClass]=\"icon\"></i>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n {{ label }}\n </ng-container>\n <ng-container *ngSwitchCase=\"'icon-text'\"> <i aria-hidden=\"true\" class=\"fwe-icon\" [ngClass]=\"icon\"></i>{{ label }} </ng-container>\n </ng-container>\n </label>\n</ng-template>\n" }]
5059
5025
  }], propDecorators: { name: [{
5060
5026
  type: Input
5061
5027
  }], value: [{
@@ -5077,7 +5043,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
5077
5043
  args: ['tpl']
5078
5044
  }] } });
5079
5045
 
5080
- class FngSegmentComponent extends FngValueAccessorBaseDirective {
5046
+ class FngSegmentComponent {
5047
+ writeValue(value) {
5048
+ this.innerValue = value;
5049
+ this.updateCheckState();
5050
+ }
5051
+ updateCheckState() {
5052
+ if (this.controls) {
5053
+ this.controls.forEach(component => {
5054
+ component.checked = component.value === this.value;
5055
+ });
5056
+ }
5057
+ }
5058
+ registerOnChange(fn) {
5059
+ this.changed.push(fn);
5060
+ }
5061
+ registerOnTouched(fn) {
5062
+ this.touched.push(fn);
5063
+ }
5081
5064
  set value(value) {
5082
5065
  if (this.innerValue !== value) {
5083
5066
  this.innerValue = value;
@@ -5088,9 +5071,13 @@ class FngSegmentComponent extends FngValueAccessorBaseDirective {
5088
5071
  });
5089
5072
  }
5090
5073
  }
5074
+ get value() {
5075
+ return this.innerValue;
5076
+ }
5091
5077
  constructor(cd) {
5092
- super();
5093
5078
  this.cd = cd;
5079
+ this.changed = new Array();
5080
+ this.touched = new Array();
5094
5081
  this.complete = new Subject();
5095
5082
  this.defaultConfig = {
5096
5083
  outline: true,
@@ -5102,6 +5089,7 @@ class FngSegmentComponent extends FngValueAccessorBaseDirective {
5102
5089
  this.config = this.defaultConfig;
5103
5090
  this.fngChange = new EventEmitter();
5104
5091
  this.change = new EventEmitter();
5092
+ this.id = (Math.random() * Date.now()).toString().replace('.', '-');
5105
5093
  }
5106
5094
  ngOnChanges(changes) {
5107
5095
  if (changes['config']?.currentValue) {
@@ -5113,6 +5101,7 @@ class FngSegmentComponent extends FngValueAccessorBaseDirective {
5113
5101
  this.controls.forEach(component => {
5114
5102
  component.change.pipe(takeUntil(this.complete)).subscribe(val => {
5115
5103
  this.value = val;
5104
+ this.updateCheckState();
5116
5105
  });
5117
5106
  if (component.icon != null && this.config.iconOnly === true) {
5118
5107
  this.useIcon = true;
@@ -5141,6 +5130,9 @@ class FngSegmentComponent extends FngValueAccessorBaseDirective {
5141
5130
  if (this.controls) {
5142
5131
  this.controls.forEach(component => {
5143
5132
  if (component.view) {
5133
+ if (!component.name) {
5134
+ component.name = this.id;
5135
+ }
5144
5136
  this.vc?.insert(component.view);
5145
5137
  }
5146
5138
  });
@@ -5154,10 +5146,10 @@ FngSegmentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
5154
5146
  useExisting: forwardRef(() => FngSegmentComponent),
5155
5147
  multi: true
5156
5148
  }
5157
- ], queries: [{ propertyName: "controls", predicate: FngSegmentControlComponent, descendants: true }], viewQueries: [{ propertyName: "vc", first: true, predicate: ["vc"], descendants: true, read: ViewContainerRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<fieldset\n class=\"fwe-segment\"\n [ngClass]=\"{\n 'fwe-segment-outline': config.outline,\n 'fwe-segment-icon': useIcon,\n 'fwe-segment-icon-text': useIconAndText\n }\"\n>\n <legend class=\"fwe-sr-only fwe-d-inline-block\">{{ legend }}</legend>\n <div class=\"fwe-segment-group\">\n <ng-container #vc></ng-container>\n </div>\n</fieldset>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5149
+ ], queries: [{ propertyName: "controls", predicate: FngSegmentControlComponent, descendants: true }], viewQueries: [{ propertyName: "vc", first: true, predicate: ["vc"], descendants: true, read: ViewContainerRef }], usesOnChanges: true, ngImport: i0, template: "<fieldset\n class=\"fwe-segment\"\n [ngClass]=\"{\n 'fwe-segment-outline': config.outline,\n 'fwe-segment-icon': useIcon,\n 'fwe-segment-icon-text': useIconAndText\n }\"\n>\n <legend class=\"fwe-sr-only fwe-d-inline-block\">{{ legend }}</legend>\n <div class=\"fwe-segment-group\">\n <ng-container #vc></ng-container>\n </div>\n</fieldset>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None });
5158
5150
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: FngSegmentComponent, decorators: [{
5159
5151
  type: Component,
5160
- args: [{ standalone: true, imports: [CommonModule], selector: 'fng-segment', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
5152
+ args: [{ standalone: true, imports: [CommonModule], selector: 'fng-segment', encapsulation: ViewEncapsulation.None, providers: [
5161
5153
  {
5162
5154
  provide: NG_VALUE_ACCESSOR,
5163
5155
  useExisting: forwardRef(() => FngSegmentComponent),
@@ -5895,6 +5887,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
5895
5887
  args: ['inputElement']
5896
5888
  }] } });
5897
5889
 
5890
+ class FngValueAccessorBaseDirective {
5891
+ constructor() {
5892
+ this.disabled = false;
5893
+ this.changed = new Array();
5894
+ this.touched = new Array();
5895
+ }
5896
+ get value() {
5897
+ return this.innerValue;
5898
+ }
5899
+ set value(value) {
5900
+ if (value && this.innerValue !== value) {
5901
+ this.innerValue = value;
5902
+ this.changed.forEach(f => f(value));
5903
+ }
5904
+ }
5905
+ touch() {
5906
+ this.touched.forEach(f => f());
5907
+ }
5908
+ writeValue(value) {
5909
+ this.innerValue = value;
5910
+ }
5911
+ registerOnChange(fn) {
5912
+ this.changed.push(fn);
5913
+ }
5914
+ registerOnTouched(fn) {
5915
+ this.touched.push(fn);
5916
+ }
5917
+ setDisabledState(isDisabled) {
5918
+ this.disabled = isDisabled;
5919
+ }
5920
+ }
5921
+ FngValueAccessorBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: FngValueAccessorBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5922
+ FngValueAccessorBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.1", type: FngValueAccessorBaseDirective, inputs: { disabled: "disabled" }, ngImport: i0 });
5923
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: FngValueAccessorBaseDirective, decorators: [{
5924
+ type: Directive
5925
+ }], propDecorators: { disabled: [{
5926
+ type: Input
5927
+ }] } });
5928
+
5898
5929
  class FngTextEditorComponent extends FngValueAccessorBaseDirective {
5899
5930
  set value(value) {
5900
5931
  if (this.innerValue !== value) {