@kms-ngx-ui/presentational 20.0.2 → 20.0.4

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.
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Pipe, NgModule, EventEmitter, Output, Input, Directive, HostListener, PLATFORM_ID, DOCUMENT, Inject, Injectable, input, VERSION, forwardRef, ViewChild, effect, HostBinding, output, computed, model, signal, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+ import { Component, Pipe, NgModule, EventEmitter, Output, Input, Directive, HostListener, PLATFORM_ID, DOCUMENT, Inject, Injectable, input, VERSION, forwardRef, inject, Injector, ViewChild, effect, HostBinding, output, computed, model, signal, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, CurrencyPipe, isPlatformBrowser } from '@angular/common';
5
5
  import * as i2 from '@angular/forms';
6
- import { NG_VALUE_ACCESSOR, UntypedFormGroup, UntypedFormControl, NG_VALIDATORS, FormsModule, ReactiveFormsModule } from '@angular/forms';
6
+ import { NG_VALUE_ACCESSOR, NgControl, UntypedFormGroup, UntypedFormControl, NG_VALIDATORS, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
7
  import * as i1$2 from '@angular/material/checkbox';
8
8
  import { MatCheckboxModule } from '@angular/material/checkbox';
9
9
  import * as i1$6 from '@angular/material/radio';
@@ -1329,12 +1329,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
1329
1329
  }] } });
1330
1330
 
1331
1331
  class FormControlParentComponent extends FormParentComponent {
1332
+ get ngControl() {
1333
+ if (this._ngControl === undefined) {
1334
+ this._ngControl = this.injector.get(NgControl, null);
1335
+ }
1336
+ return this._ngControl;
1337
+ }
1332
1338
  constructor(renderer) {
1333
1339
  super();
1334
1340
  this.renderer = renderer;
1335
1341
  this.defaultDataOverride = ''; // when we have NO form around, get default via input to set it manually
1336
1342
  this.onSelectItemEmitter = new EventEmitter();
1337
1343
  this.internalValue = '';
1344
+ this.injector = inject(Injector);
1345
+ this._ngControl = undefined;
1338
1346
  // eslint-disable-next-line @typescript-eslint/no-empty-function
1339
1347
  this.onChange = () => { };
1340
1348
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -1345,6 +1353,11 @@ class FormControlParentComponent extends FormParentComponent {
1345
1353
  ngOnInit() {
1346
1354
  super.ngOnInit();
1347
1355
  }
1356
+ ngDoCheck() {
1357
+ if (this.ngControl?.control?.touched) {
1358
+ this.form?.markAllAsTouched();
1359
+ }
1360
+ }
1348
1361
  change(value) {
1349
1362
  this.onChange(value);
1350
1363
  this.onTouched();
@@ -1983,20 +1996,21 @@ class TooltipIconComponent {
1983
1996
  this.delay = input(1000, ...(ngDevMode ? [{ debugName: "delay" }] : []));
1984
1997
  this.iconSize = input(IconSizePx.XS, ...(ngDevMode ? [{ debugName: "iconSize" }] : []));
1985
1998
  this.tooltipAlwaysVisible = input(false, ...(ngDevMode ? [{ debugName: "tooltipAlwaysVisible" }] : []));
1999
+ this.icon = input('ic_info', ...(ngDevMode ? [{ debugName: "icon" }] : []));
1986
2000
  }
1987
2001
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TooltipIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1988
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: TooltipIconComponent, isStandalone: false, selector: "kms-tooltip-icon", inputs: { tooltipText: { classPropertyName: "tooltipText", publicName: "tooltipText", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, tooltipAlwaysVisible: { classPropertyName: "tooltipAlwaysVisible", publicName: "tooltipAlwaysVisible", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }, { propertyName: "tooltip", first: true, predicate: ["tooltip"], descendants: true }], ngImport: i0, template: "<div #tooltipContent>\n @if (tooltipText()) {\n {{ tooltipText() }}\n } @else {\n <ng-content></ng-content>\n }\n</div>\n\n<kms-icon\n icon=\"ic_info\"\n [size]=\"iconSize()\"\n [kmsTooltip]=\"tooltipContent\"\n [placement]=\"placement()\"\n [delay]=\"delay()\"\n [alwaysVisible]=\"tooltipAlwaysVisible()\"\n></kms-icon>\n", styles: [""], dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[kmsTooltip]", inputs: ["kmsTooltip", "placement", "delay", "alwaysVisible"] }, { kind: "component", type: IconComponent, selector: "kms-icon", inputs: ["icon", "iconClass", "size", "dontUseSprite", "color"] }] }); }
2002
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: TooltipIconComponent, isStandalone: false, selector: "kms-tooltip-icon", inputs: { tooltipText: { classPropertyName: "tooltipText", publicName: "tooltipText", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, tooltipAlwaysVisible: { classPropertyName: "tooltipAlwaysVisible", publicName: "tooltipAlwaysVisible", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }, { propertyName: "tooltip", first: true, predicate: ["tooltip"], descendants: true }], ngImport: i0, template: "<div #tooltipContent>\n @if (tooltipText()) {\n {{ tooltipText() }}\n } @else {\n <ng-content></ng-content>\n }\n</div>\n\n<kms-icon\n [icon]=\"icon()\"\n [size]=\"iconSize()\"\n [kmsTooltip]=\"tooltipContent\"\n [placement]=\"placement()\"\n [delay]=\"delay()\"\n [alwaysVisible]=\"tooltipAlwaysVisible()\"\n></kms-icon>\n", styles: [""], dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[kmsTooltip]", inputs: ["kmsTooltip", "placement", "delay", "alwaysVisible"] }, { kind: "component", type: IconComponent, selector: "kms-icon", inputs: ["icon", "iconClass", "size", "dontUseSprite", "color"] }] }); }
1989
2003
  }
1990
2004
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TooltipIconComponent, decorators: [{
1991
2005
  type: Component,
1992
- args: [{ standalone: false, selector: 'kms-tooltip-icon', template: "<div #tooltipContent>\n @if (tooltipText()) {\n {{ tooltipText() }}\n } @else {\n <ng-content></ng-content>\n }\n</div>\n\n<kms-icon\n icon=\"ic_info\"\n [size]=\"iconSize()\"\n [kmsTooltip]=\"tooltipContent\"\n [placement]=\"placement()\"\n [delay]=\"delay()\"\n [alwaysVisible]=\"tooltipAlwaysVisible()\"\n></kms-icon>\n" }]
2006
+ args: [{ standalone: false, selector: 'kms-tooltip-icon', template: "<div #tooltipContent>\n @if (tooltipText()) {\n {{ tooltipText() }}\n } @else {\n <ng-content></ng-content>\n }\n</div>\n\n<kms-icon\n [icon]=\"icon()\"\n [size]=\"iconSize()\"\n [kmsTooltip]=\"tooltipContent\"\n [placement]=\"placement()\"\n [delay]=\"delay()\"\n [alwaysVisible]=\"tooltipAlwaysVisible()\"\n></kms-icon>\n" }]
1993
2007
  }], propDecorators: { button: [{
1994
2008
  type: ViewChild,
1995
2009
  args: ['button']
1996
2010
  }], tooltip: [{
1997
2011
  type: ViewChild,
1998
2012
  args: ['tooltip']
1999
- }], tooltipText: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipText", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "delay", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], tooltipAlwaysVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAlwaysVisible", required: false }] }] } });
2013
+ }], tooltipText: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipText", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "delay", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], tooltipAlwaysVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipAlwaysVisible", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }] } });
2000
2014
 
2001
2015
  class ColorInputComponent extends FormControlParentComponent {
2002
2016
  constructor(renderer) {
@@ -2045,7 +2059,7 @@ class ColorInputComponent extends FormControlParentComponent {
2045
2059
  useExisting: forwardRef(() => ColorInputComponent),
2046
2060
  multi: true,
2047
2061
  },
2048
- ], usesInheritance: true, ngImport: i0, template: "\n@if (formInitialized) {\n <form [formGroup]=\"form\">\n <div>\n <mat-form-field class=\"colorInput\">\n @if (tooltipText) {\n <kms-tooltip-icon [tooltipText]=\"tooltipText\"></kms-tooltip-icon>\n }\n <mat-label>{{ label }}</mat-label>\n <input type=\"text\" [(ngModel)]=\"value\" matInput formControlName=\"color\" [placeholder]=\"placeholder\" [ngClass]=\"{'my-inValid': !matchesHex(value)}\" />\n <input type=\"color\" [value]=\"value && matchesHex(value) ? value : '#ffffff'\" (change)=\"updateSelectedColor($event)\" [ngClass]=\"{'my-inValid': !matchesHex(value)}\" />\n </mat-form-field>\n </div>\n </form>\n}", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: TooltipIconComponent, selector: "kms-tooltip-icon", inputs: ["tooltipText", "placement", "delay", "iconSize", "tooltipAlwaysVisible"] }] }); }
2062
+ ], usesInheritance: true, ngImport: i0, template: "\n@if (formInitialized) {\n <form [formGroup]=\"form\">\n <div>\n <mat-form-field class=\"colorInput\">\n @if (tooltipText) {\n <kms-tooltip-icon [tooltipText]=\"tooltipText\"></kms-tooltip-icon>\n }\n <mat-label>{{ label }}</mat-label>\n <input type=\"text\" [(ngModel)]=\"value\" matInput formControlName=\"color\" [placeholder]=\"placeholder\" [ngClass]=\"{'my-inValid': !matchesHex(value)}\" />\n <input type=\"color\" [value]=\"value && matchesHex(value) ? value : '#ffffff'\" (change)=\"updateSelectedColor($event)\" [ngClass]=\"{'my-inValid': !matchesHex(value)}\" />\n </mat-form-field>\n </div>\n </form>\n}", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: TooltipIconComponent, selector: "kms-tooltip-icon", inputs: ["tooltipText", "placement", "delay", "iconSize", "tooltipAlwaysVisible", "icon"] }] }); }
2049
2063
  }
2050
2064
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ColorInputComponent, decorators: [{
2051
2065
  type: Component,
@@ -2866,7 +2880,7 @@ class RadioGroupComponent {
2866
2880
  useExisting: forwardRef(() => RadioGroupComponent),
2867
2881
  multi: true,
2868
2882
  },
2869
- ], ngImport: i0, template: "@if (options && options.length > 0) {\n<mat-radio-group\n class=\"radiogroup\"\n [value]=\"value\"\n (change)=\"handleChange($event.value)\"\n [disabled]=\"disabled\"\n [ngStyle]=\"{ 'flex-direction': direction }\"\n>\n @if (infoText) {\n <kms-tooltip-icon\n [class.margin-left]=\"direction == 'column'\"\n [tooltipText]=\"infoText\"\n ></kms-tooltip-icon>\n } @for (option of options; track $index) {\n <div class=\"radiobutton-container\">\n <kms-radiobutton\n [label]=\"option.Text\"\n [value]=\"option.Value\"\n [checked]=\"value === option.Value\"\n [disabled]=\"disabled || option.Disabled\"\n [size]=\"size\"\n [color]=\"color\"\n ></kms-radiobutton>\n @if (option.InfoText) {\n <kms-tooltip-icon [tooltipText]=\"option.InfoText\"></kms-tooltip-icon>\n }\n </div>\n }\n</mat-radio-group>\n}\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$6.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: RadioButtonComponent, selector: "kms-radiobutton", inputs: ["label", "checked", "disabled", "value", "size", "color"], outputs: ["onChange"] }, { kind: "component", type: TooltipIconComponent, selector: "kms-tooltip-icon", inputs: ["tooltipText", "placement", "delay", "iconSize", "tooltipAlwaysVisible"] }] }); }
2883
+ ], ngImport: i0, template: "@if (options && options.length > 0) {\n<mat-radio-group\n class=\"radiogroup\"\n [value]=\"value\"\n (change)=\"handleChange($event.value)\"\n [disabled]=\"disabled\"\n [ngStyle]=\"{ 'flex-direction': direction }\"\n>\n @if (infoText) {\n <kms-tooltip-icon\n [class.margin-left]=\"direction == 'column'\"\n [tooltipText]=\"infoText\"\n ></kms-tooltip-icon>\n } @for (option of options; track $index) {\n <div class=\"radiobutton-container\">\n <kms-radiobutton\n [label]=\"option.Text\"\n [value]=\"option.Value\"\n [checked]=\"value === option.Value\"\n [disabled]=\"disabled || option.Disabled\"\n [size]=\"size\"\n [color]=\"color\"\n ></kms-radiobutton>\n @if (option.InfoText) {\n <kms-tooltip-icon [tooltipText]=\"option.InfoText\"></kms-tooltip-icon>\n }\n </div>\n }\n</mat-radio-group>\n}\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$6.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: RadioButtonComponent, selector: "kms-radiobutton", inputs: ["label", "checked", "disabled", "value", "size", "color"], outputs: ["onChange"] }, { kind: "component", type: TooltipIconComponent, selector: "kms-tooltip-icon", inputs: ["tooltipText", "placement", "delay", "iconSize", "tooltipAlwaysVisible", "icon"] }] }); }
2870
2884
  }
2871
2885
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RadioGroupComponent, decorators: [{
2872
2886
  type: Component,