@testgorilla/tgo-ui 1.0.13 → 1.1.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.
Files changed (30) hide show
  1. package/components/avatar/avatar.component.d.ts +48 -0
  2. package/components/avatar/avatar.component.module.d.ts +11 -0
  3. package/components/avatar/avatar.model.d.ts +7 -0
  4. package/components/icon/icon.model.d.ts +2 -2
  5. package/components/tag/tag.component.d.ts +86 -9
  6. package/components/tag/tag.component.module.d.ts +4 -1
  7. package/components/toggle/toggle.component.d.ts +38 -0
  8. package/components/toggle/toggle.component.module.d.ts +8 -0
  9. package/components/toggle/toggle.model.d.ts +1 -0
  10. package/esm2020/components/avatar/avatar.component.mjs +74 -0
  11. package/esm2020/components/avatar/avatar.component.module.mjs +21 -0
  12. package/esm2020/components/avatar/avatar.model.mjs +12 -0
  13. package/esm2020/components/field/field.component.mjs +3 -3
  14. package/esm2020/components/icon/icon.component.mjs +2 -2
  15. package/esm2020/components/icon/icon.model.mjs +1 -1
  16. package/esm2020/components/tag/tag.component.mjs +135 -9
  17. package/esm2020/components/tag/tag.component.module.mjs +7 -4
  18. package/esm2020/components/toggle/toggle.component.mjs +78 -0
  19. package/esm2020/components/toggle/toggle.component.module.mjs +17 -0
  20. package/esm2020/components/toggle/toggle.model.mjs +2 -0
  21. package/esm2020/pipes/name-initials.pipe.mjs +23 -0
  22. package/esm2020/public-api.mjs +10 -1
  23. package/fesm2015/testgorilla-tgo-ui.mjs +353 -28
  24. package/fesm2015/testgorilla-tgo-ui.mjs.map +1 -1
  25. package/fesm2020/testgorilla-tgo-ui.mjs +352 -28
  26. package/fesm2020/testgorilla-tgo-ui.mjs.map +1 -1
  27. package/package.json +1 -1
  28. package/pipes/name-initials.pipe.d.ts +7 -0
  29. package/public-api.d.ts +6 -0
  30. package/src/assets/images/Avatar.png +0 -0
@@ -43,7 +43,7 @@ import { __decorate } from 'tslib';
43
43
  import { UntilDestroy } from '@ngneat/until-destroy';
44
44
  import * as i1$7 from '@ngneat/transloco';
45
45
  import { TranslocoModule, TranslocoService } from '@ngneat/transloco';
46
- import { lastValueFrom, Subscription } from 'rxjs';
46
+ import { lastValueFrom, Subscription, ReplaySubject, debounceTime, map } from 'rxjs';
47
47
  import * as i4$1 from '@angular/material/sort';
48
48
  import { MatSort, MatSortModule } from '@angular/material/sort';
49
49
  import * as i3$1 from '@angular/material/table';
@@ -284,10 +284,10 @@ class IconComponent {
284
284
  }
285
285
  }
286
286
  IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: IconComponent, deps: [{ token: i1.MatIconRegistry }, { token: i2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
287
- IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: IconComponent, selector: "ui-icon", inputs: { size: "size", cssClass: "cssClass", name: "name", color: "color" }, usesOnChanges: true, ngImport: i0, template: "<mat-icon [svgIcon]=\"name\" [attr.class]=\"customCssClass\"></mat-icon>\n", styles: ["mat-icon{display:flex}mat-icon.size-16 svg{width:16px;height:16px}mat-icon.size-24 svg{width:24px;height:24px}mat-icon.dark svg{color:#888}mat-icon.white svg{color:#fff}mat-icon.teal svg{color:#46a997}mat-icon.petrol svg{color:#276678}mat-icon.black svg{color:#000}\n"], dependencies: [{ kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None });
287
+ IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: IconComponent, selector: "ui-icon", inputs: { size: "size", cssClass: "cssClass", name: "name", color: "color" }, usesOnChanges: true, ngImport: i0, template: "<mat-icon [svgIcon]=\"name\" [attr.class]=\"customCssClass\"></mat-icon>\n", styles: ["mat-icon{display:flex}mat-icon.size-16 svg{width:16px;height:16px}mat-icon.size-24 svg{width:24px;height:24px}mat-icon.size-80 svg{width:80px;height:80px}mat-icon.dark svg{color:#888}mat-icon.white svg{color:#fff}mat-icon.teal svg{color:#46a997}mat-icon.petrol svg{color:#276678}mat-icon.black svg{color:#000}\n"], dependencies: [{ kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None });
288
288
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: IconComponent, decorators: [{
289
289
  type: Component,
290
- args: [{ selector: 'ui-icon', encapsulation: ViewEncapsulation.None, template: "<mat-icon [svgIcon]=\"name\" [attr.class]=\"customCssClass\"></mat-icon>\n", styles: ["mat-icon{display:flex}mat-icon.size-16 svg{width:16px;height:16px}mat-icon.size-24 svg{width:24px;height:24px}mat-icon.dark svg{color:#888}mat-icon.white svg{color:#fff}mat-icon.teal svg{color:#46a997}mat-icon.petrol svg{color:#276678}mat-icon.black svg{color:#000}\n"] }]
290
+ args: [{ selector: 'ui-icon', encapsulation: ViewEncapsulation.None, template: "<mat-icon [svgIcon]=\"name\" [attr.class]=\"customCssClass\"></mat-icon>\n", styles: ["mat-icon{display:flex}mat-icon.size-16 svg{width:16px;height:16px}mat-icon.size-24 svg{width:24px;height:24px}mat-icon.size-80 svg{width:80px;height:80px}mat-icon.dark svg{color:#888}mat-icon.white svg{color:#fff}mat-icon.teal svg{color:#46a997}mat-icon.petrol svg{color:#276678}mat-icon.black svg{color:#000}\n"] }]
291
291
  }], ctorParameters: function () { return [{ type: i1.MatIconRegistry }, { type: i2.DomSanitizer }]; }, propDecorators: { size: [{
292
292
  type: Input
293
293
  }], cssClass: [{
@@ -1061,14 +1061,14 @@ class FieldComponent {
1061
1061
  * @type {Boolean}
1062
1062
  * @memberof FieldComponent
1063
1063
  */
1064
- this.updateOnBlur = true;
1064
+ this.updateOnBlur = false;
1065
1065
  /**
1066
1066
  * allow only digits in input
1067
1067
  *
1068
1068
  * @type {Boolean}
1069
1069
  * @memberof FieldComponent
1070
1070
  */
1071
- this.allowOnlyDigits = true;
1071
+ this.allowOnlyDigits = false;
1072
1072
  /**
1073
1073
  * @ignore
1074
1074
  */
@@ -3320,40 +3320,147 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3320
3320
  class TagComponent {
3321
3321
  constructor() {
3322
3322
  /**
3323
- * Color
3323
+ * Icon
3324
+ *
3325
+ * @type {string}
3326
+ * @memberof TagComponent
3327
+ */
3328
+ this.icon = '';
3329
+ /**
3330
+ * Whether to allow the tag to be closed.
3331
+ *
3332
+ * @type {boolean}
3333
+ * @default false
3334
+ * @memberof TagComponent
3335
+ */
3336
+ this.allowClose = false;
3337
+ /**
3338
+ * Whether the tag is in read-only mode.
3339
+ *
3340
+ * @type {boolean}
3341
+ * @default false
3342
+ * @memberof TagComponent
3343
+ */
3344
+ this.readOnly = false;
3345
+ /**
3346
+ * Whether the tag is selected.
3347
+ *
3348
+ * @type {boolean}
3349
+ * @default false
3350
+ * @memberof TagComponent
3351
+ */
3352
+ this.isSelected = false;
3353
+ /**
3354
+ * Display icon when is selected
3355
+ *
3356
+ * @type {boolean}
3357
+ * @default false
3358
+ * @memberof TagComponent
3359
+ */
3360
+ this.showIconWhenSelected = false;
3361
+ /**
3362
+ * Specifies whether the element is disabled.
3363
+ *
3364
+ * @type {boolean}
3365
+ * @default false
3366
+ * @memberof TagComponent
3367
+ */
3368
+ this.isDisabled = false;
3369
+ /**
3370
+ * Event triggered when the tag should be closed.
3371
+ *
3372
+ * @event
3373
+ * @memberof TagComponent
3374
+ */
3375
+ this.close = new EventEmitter();
3376
+ /**
3377
+ * Event triggered when a press action occurs.
3324
3378
  *
3325
- * @type {TagColor}
3379
+ * @event
3326
3380
  * @memberof TagComponent
3327
3381
  */
3328
- this.color = 'teal';
3382
+ this.press = new EventEmitter();
3383
+ /**
3384
+ * Subject that needs to be triggered when Label input changes, to check if it's truncated
3385
+ * @private
3386
+ * @type {void}
3387
+ * @memberof TagComponent
3388
+ */
3389
+ this.checkLabelEllipsis$ = new ReplaySubject(1);
3390
+ /**
3391
+ * Observable that indicates if the Label is truncated
3392
+ * debounceTime is used to wait for view to be initialized after receiving a new Label input
3393
+ * @protected
3394
+ * @type {boolean}
3395
+ * @memberof TagComponent
3396
+ */
3397
+ this.isEllipseActiveObs$ = this.checkLabelEllipsis$.pipe(debounceTime(100), map(() => {
3398
+ const el = this.labelElement.nativeElement;
3399
+ return el.offsetWidth < el.scrollWidth;
3400
+ }));
3401
+ this.labelText = '';
3402
+ }
3403
+ /**
3404
+ * Tag's label
3405
+ *
3406
+ * @memberof TagComponent
3407
+ */
3408
+ set label(value) {
3409
+ this.labelText = value;
3410
+ if (this.labelElement) {
3411
+ this.isLabelEllipseActive();
3412
+ }
3413
+ }
3414
+ ngAfterViewInit() {
3415
+ this.isLabelEllipseActive();
3416
+ }
3417
+ onPress() {
3418
+ if (!this.readOnly && !this.allowClose) {
3419
+ this.isSelected = this.showIconWhenSelected ? !this.isSelected : false;
3420
+ this.press.emit(this.isSelected);
3421
+ }
3422
+ }
3423
+ onClose() {
3424
+ this.close.emit();
3425
+ }
3426
+ isLabelEllipseActive() {
3427
+ this.checkLabelEllipsis$.next();
3428
+ }
3429
+ get tabIndex() {
3430
+ return this.isDisabled || this.readOnly ? -1 : 0;
3431
+ }
3432
+ get filled() {
3433
+ return this.readOnly || this.allowClose || this.isSelected;
3329
3434
  }
3330
3435
  }
3331
3436
  TagComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3332
- TagComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TagComponent, selector: "ui-tag", inputs: { text: "text", color: "color" }, ngImport: i0, template: "<span [class]=\"color\">{{ text }}</span>\n", styles: [":host span{display:inline-flex;color:#fff;font-size:12px;line-height:16px;padding:3px 8px;border-radius:4px;text-transform:uppercase;margin-right:8px}:host span.teal{background-color:#46a997}:host span.petrol{background-color:#276678}:host span.grey{background-color:#e0e0e0;color:#000}:host span.red{background-color:#cb7b7a}:host span.gold{background-color:#cca45f}\n"] });
3437
+ TagComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TagComponent, selector: "ui-tag", inputs: { label: "label", icon: "icon", allowClose: "allowClose", readOnly: "readOnly", isSelected: "isSelected", showIconWhenSelected: "showIconWhenSelected", isDisabled: "isDisabled" }, outputs: { close: "close", press: "press" }, viewQueries: [{ propertyName: "labelElement", first: true, predicate: ["labelElement"], descendants: true }], ngImport: i0, template: "<div class=\"tag-wrapper\" [matTooltip]=\"(isEllipseActiveObs$ | async) ? labelText : ''\">\n <div\n [tabindex]=\"tabIndex\"\n class=\"tag-container\"\n [attr.data-testid]=\"'tag--container'\"\n [ngClass]=\"{\n filled: filled,\n readonly: readOnly,\n disabled: isDisabled,\n outlined: !isSelected,\n }\"\n (click)=\"onPress()\"\n >\n <ui-icon *ngIf=\"icon\" class=\"icon\" [name]=\"icon\"></ui-icon>\n <ui-icon *ngIf=\"isSelected && showIconWhenSelected\" class=\"icon\" [name]=\"'Check'\"></ui-icon>\n <span class=\"tag-label\" #labelElement>{{ labelText }}</span>\n <ui-icon [tabindex]=\"tabIndex\" *ngIf=\"allowClose\" class=\"delete-icon\" (click)=\"onClose()\" [name]=\"'Close'\"></ui-icon>\n </div>\n</div>\n", styles: [":host .tag-wrapper{max-width:264px}:host .tag-container{height:32px;max-width:264px;border-radius:4px;display:flex;align-items:center;justify-content:center;padding:0 8px;width:-moz-fit-content;width:fit-content;cursor:pointer;margin:4px}:host .tag-container.outlined{border:1px solid #6894A0}:host .tag-container:focus{outline:1px dashed #888888;outline-offset:4px;background:#F6F6F6;border:1px solid #6894A0}:host .tag-container:focus.filled{background-color:#e9f0f1;border:1px solid #276678}:host .tag-container.filled{background:#E9F0F1;border:1px solid #E9F0F1}:host .tag-container.filled:hover{background-color:#e9f0f1;border:1px solid #276678}:host .tag-container.filled:active{background:#A9C2C9;border:1px solid #1B4754}:host .tag-container:hover{background:#F6F6F6;border:1px solid #6894A0}:host .tag-container:active{background:#E9F0F1}:host .tag-container.readonly{pointer-events:none}:host .tag-container.disabled{opacity:.5;border:1px solid #276678;background:#E9F0F1;pointer-events:none}:host .tag-container .tag-label{-webkit-user-select:none;user-select:none;font-size:14px;line-height:20px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .tag-container .icon{height:16px;width:16px;min-width:16px;margin-right:8px}:host .tag-container .delete-icon{display:flex;align-items:center;justify-content:center;margin-left:8px;text-align:center;border:1px solid transparent}:host .tag-container .delete-icon:focus{border:1px dashed #1B4754;border-radius:4px}:host .tag-container .delete-icon:focus-visible{outline:none}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] });
3333
3438
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponent, decorators: [{
3334
3439
  type: Component,
3335
- args: [{ selector: 'ui-tag', template: "<span [class]=\"color\">{{ text }}</span>\n", styles: [":host span{display:inline-flex;color:#fff;font-size:12px;line-height:16px;padding:3px 8px;border-radius:4px;text-transform:uppercase;margin-right:8px}:host span.teal{background-color:#46a997}:host span.petrol{background-color:#276678}:host span.grey{background-color:#e0e0e0;color:#000}:host span.red{background-color:#cb7b7a}:host span.gold{background-color:#cca45f}\n"] }]
3336
- }], ctorParameters: function () { return []; }, propDecorators: { text: [{
3440
+ args: [{ selector: 'ui-tag', template: "<div class=\"tag-wrapper\" [matTooltip]=\"(isEllipseActiveObs$ | async) ? labelText : ''\">\n <div\n [tabindex]=\"tabIndex\"\n class=\"tag-container\"\n [attr.data-testid]=\"'tag--container'\"\n [ngClass]=\"{\n filled: filled,\n readonly: readOnly,\n disabled: isDisabled,\n outlined: !isSelected,\n }\"\n (click)=\"onPress()\"\n >\n <ui-icon *ngIf=\"icon\" class=\"icon\" [name]=\"icon\"></ui-icon>\n <ui-icon *ngIf=\"isSelected && showIconWhenSelected\" class=\"icon\" [name]=\"'Check'\"></ui-icon>\n <span class=\"tag-label\" #labelElement>{{ labelText }}</span>\n <ui-icon [tabindex]=\"tabIndex\" *ngIf=\"allowClose\" class=\"delete-icon\" (click)=\"onClose()\" [name]=\"'Close'\"></ui-icon>\n </div>\n</div>\n", styles: [":host .tag-wrapper{max-width:264px}:host .tag-container{height:32px;max-width:264px;border-radius:4px;display:flex;align-items:center;justify-content:center;padding:0 8px;width:-moz-fit-content;width:fit-content;cursor:pointer;margin:4px}:host .tag-container.outlined{border:1px solid #6894A0}:host .tag-container:focus{outline:1px dashed #888888;outline-offset:4px;background:#F6F6F6;border:1px solid #6894A0}:host .tag-container:focus.filled{background-color:#e9f0f1;border:1px solid #276678}:host .tag-container.filled{background:#E9F0F1;border:1px solid #E9F0F1}:host .tag-container.filled:hover{background-color:#e9f0f1;border:1px solid #276678}:host .tag-container.filled:active{background:#A9C2C9;border:1px solid #1B4754}:host .tag-container:hover{background:#F6F6F6;border:1px solid #6894A0}:host .tag-container:active{background:#E9F0F1}:host .tag-container.readonly{pointer-events:none}:host .tag-container.disabled{opacity:.5;border:1px solid #276678;background:#E9F0F1;pointer-events:none}:host .tag-container .tag-label{-webkit-user-select:none;user-select:none;font-size:14px;line-height:20px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .tag-container .icon{height:16px;width:16px;min-width:16px;margin-right:8px}:host .tag-container .delete-icon{display:flex;align-items:center;justify-content:center;margin-left:8px;text-align:center;border:1px solid transparent}:host .tag-container .delete-icon:focus{border:1px dashed #1B4754;border-radius:4px}:host .tag-container .delete-icon:focus-visible{outline:none}\n"] }]
3441
+ }], propDecorators: { label: [{
3337
3442
  type: Input
3338
- }], color: [{
3443
+ }], icon: [{
3444
+ type: Input
3445
+ }], allowClose: [{
3446
+ type: Input
3447
+ }], readOnly: [{
3448
+ type: Input
3449
+ }], isSelected: [{
3450
+ type: Input
3451
+ }], showIconWhenSelected: [{
3339
3452
  type: Input
3453
+ }], isDisabled: [{
3454
+ type: Input
3455
+ }], close: [{
3456
+ type: Output
3457
+ }], press: [{
3458
+ type: Output
3459
+ }], labelElement: [{
3460
+ type: ViewChild,
3461
+ args: ['labelElement']
3340
3462
  }] } });
3341
3463
 
3342
- class TagComponentModule {
3343
- }
3344
- TagComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3345
- TagComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, declarations: [TagComponent], imports: [CommonModule], exports: [TagComponent] });
3346
- TagComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, imports: [CommonModule] });
3347
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, decorators: [{
3348
- type: NgModule,
3349
- args: [{
3350
- declarations: [TagComponent],
3351
- imports: [CommonModule],
3352
- exports: [TagComponent],
3353
- providers: [],
3354
- }]
3355
- }] });
3356
-
3357
3464
  var TooltipPositionType;
3358
3465
  (function (TooltipPositionType) {
3359
3466
  TooltipPositionType["TOP"] = "top";
@@ -3422,6 +3529,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3422
3529
  }]
3423
3530
  }] });
3424
3531
 
3532
+ class TagComponentModule {
3533
+ }
3534
+ TagComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3535
+ TagComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, declarations: [TagComponent], imports: [CommonModule, IconComponentModule, TooltipComponentModule, MatTooltipModule], exports: [TagComponent] });
3536
+ TagComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, imports: [CommonModule, IconComponentModule, TooltipComponentModule, MatTooltipModule] });
3537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, decorators: [{
3538
+ type: NgModule,
3539
+ args: [{
3540
+ declarations: [TagComponent],
3541
+ imports: [CommonModule, IconComponentModule, TooltipComponentModule, MatTooltipModule],
3542
+ exports: [TagComponent],
3543
+ providers: [],
3544
+ }]
3545
+ }] });
3546
+
3425
3547
  class DropdownComponent {
3426
3548
  constructor() {
3427
3549
  this.class = 'ui-dropdown';
@@ -3945,6 +4067,209 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3945
4067
  }]
3946
4068
  }] });
3947
4069
 
4070
+ class ToggleComponent {
4071
+ constructor() {
4072
+ /**
4073
+ * The `selected` property determines the current state of the toggle switch.
4074
+ *
4075
+ * @type {boolean}
4076
+ * @default false
4077
+ * @memberof ToggleComponent
4078
+ */
4079
+ this.selected = false;
4080
+ /**
4081
+ * The `disabled` property determines whether the toggle switch is disabled.
4082
+ *
4083
+ * @type {boolean}
4084
+ * @default false
4085
+ * @memberof ToggleComponent
4086
+ */
4087
+ this.disabled = false;
4088
+ /**
4089
+ * The `toggle` event is triggered when the state of the toggle switch changes. It returns the new state.
4090
+ *
4091
+ * @type {event}
4092
+ * @memberof ToggleComponent
4093
+ */
4094
+ this.toggle = new EventEmitter();
4095
+ this.onChange = () => { };
4096
+ this.onTouched = () => { };
4097
+ }
4098
+ onToggle() {
4099
+ if (!this.disabled) {
4100
+ this.selected = !this.selected;
4101
+ this.toggle.emit(this.selected);
4102
+ }
4103
+ }
4104
+ writeValue(state) {
4105
+ if (state) {
4106
+ this.selected = state;
4107
+ }
4108
+ }
4109
+ registerOnChange(fn) {
4110
+ this.onChange = fn;
4111
+ }
4112
+ registerOnTouched(fn) {
4113
+ this.onTouched = fn;
4114
+ }
4115
+ setDisabledState(isDisabled) {
4116
+ this.disabled = isDisabled;
4117
+ }
4118
+ }
4119
+ ToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4120
+ ToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ToggleComponent, selector: "ui-toggle", inputs: { selected: "selected", disabled: "disabled" }, outputs: { toggle: "toggle" }, providers: [
4121
+ {
4122
+ provide: NG_VALUE_ACCESSOR,
4123
+ useExisting: forwardRef(() => ToggleComponent),
4124
+ multi: true,
4125
+ },
4126
+ ], ngImport: i0, template: "<div\n [tabIndex]=\"0\"\n class=\"toggle-container\"\n [ngClass]=\"{ 'active': selected, 'disabled': disabled }\"\n (click)=\"onToggle()\"\n>\n <div class=\"knob\"></div>\n</div>\n", styles: [":host .toggle-container{width:32px;height:16px;border-radius:16px;background:#888888;display:flex;align-items:center;padding:0 2px;cursor:pointer}:host .toggle-container:focus{outline:1px dashed #888888;outline-offset:4px}:host .toggle-container .knob{height:12px;width:12px;border-radius:16px;background:#F6F6F6;transition:transform .3s}:host .toggle-container.disabled{background:#E0E0E0;pointer-events:none}:host .toggle-container.disabled:focus{outline:none}:host .toggle-container.active{background:#46A997}:host .toggle-container.active.disabled{opacity:.5}:host .toggle-container.active .knob{transform:translate(16px)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
4127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponent, decorators: [{
4128
+ type: Component,
4129
+ args: [{ selector: 'ui-toggle', providers: [
4130
+ {
4131
+ provide: NG_VALUE_ACCESSOR,
4132
+ useExisting: forwardRef(() => ToggleComponent),
4133
+ multi: true,
4134
+ },
4135
+ ], template: "<div\n [tabIndex]=\"0\"\n class=\"toggle-container\"\n [ngClass]=\"{ 'active': selected, 'disabled': disabled }\"\n (click)=\"onToggle()\"\n>\n <div class=\"knob\"></div>\n</div>\n", styles: [":host .toggle-container{width:32px;height:16px;border-radius:16px;background:#888888;display:flex;align-items:center;padding:0 2px;cursor:pointer}:host .toggle-container:focus{outline:1px dashed #888888;outline-offset:4px}:host .toggle-container .knob{height:12px;width:12px;border-radius:16px;background:#F6F6F6;transition:transform .3s}:host .toggle-container.disabled{background:#E0E0E0;pointer-events:none}:host .toggle-container.disabled:focus{outline:none}:host .toggle-container.active{background:#46A997}:host .toggle-container.active.disabled{opacity:.5}:host .toggle-container.active .knob{transform:translate(16px)}\n"] }]
4136
+ }], propDecorators: { selected: [{
4137
+ type: Input
4138
+ }], disabled: [{
4139
+ type: Input
4140
+ }], toggle: [{
4141
+ type: Output
4142
+ }] } });
4143
+
4144
+ class ToggleComponentModule {
4145
+ }
4146
+ ToggleComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4147
+ ToggleComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponentModule, declarations: [ToggleComponent], imports: [CommonModule] });
4148
+ ToggleComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponentModule, imports: [CommonModule] });
4149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponentModule, decorators: [{
4150
+ type: NgModule,
4151
+ args: [{
4152
+ declarations: [ToggleComponent],
4153
+ imports: [CommonModule],
4154
+ }]
4155
+ }] });
4156
+
4157
+ var AvatarSize;
4158
+ (function (AvatarSize) {
4159
+ AvatarSize["SMALL"] = "small";
4160
+ AvatarSize["MEDIUM"] = "medium";
4161
+ AvatarSize["LARGE"] = "large";
4162
+ })(AvatarSize || (AvatarSize = {}));
4163
+ const iconSize = {
4164
+ small: '16',
4165
+ medium: '24',
4166
+ large: '80',
4167
+ };
4168
+
4169
+ class NameInitialsPipe {
4170
+ transform(value) {
4171
+ var _a, _b, _c, _d;
4172
+ const initials = value.split(' ').filter(Boolean);
4173
+ if (initials.length > 1) {
4174
+ return initials.map(initial => initial[0].toUpperCase()).join('');
4175
+ }
4176
+ else {
4177
+ const firstLetters = value.substring(0, 2);
4178
+ return `${(_b = (_a = firstLetters[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = firstLetters[1]) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : ''}`;
4179
+ }
4180
+ }
4181
+ }
4182
+ NameInitialsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NameInitialsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
4183
+ NameInitialsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NameInitialsPipe, name: "nameInitials" });
4184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NameInitialsPipe, decorators: [{
4185
+ type: Pipe,
4186
+ args: [{
4187
+ name: 'nameInitials',
4188
+ }]
4189
+ }] });
4190
+
4191
+ class AvatarComponent {
4192
+ constructor() {
4193
+ /**
4194
+ * Input property for specifying the size of the avatar.
4195
+ * @type {AvatarSize}
4196
+ * @default AvatarSize.SMALL
4197
+ * @memberof AvatarComponent
4198
+ */
4199
+ this.size = AvatarSize.SMALL;
4200
+ /**
4201
+ * Input property for specifying the URL of the image to display in the avatar.
4202
+ * @type {string}
4203
+ * @memberof AvatarComponent
4204
+ */
4205
+ this.imageUrl = '';
4206
+ /**
4207
+ * Input property for specifying the initials to display in the avatar.
4208
+ * @type {string}
4209
+ * @memberof AvatarComponent
4210
+ */
4211
+ this.name = '';
4212
+ /**
4213
+ * Input property for specifying the tooltip text for edit.
4214
+ * @type {string}
4215
+ * @memberof AvatarComponent
4216
+ */
4217
+ this.tooltipText = '';
4218
+ /**
4219
+ * Input property that makes avatar clickable.
4220
+ * @type {boolean}
4221
+ * @memberof AvatarComponent
4222
+ */
4223
+ this.allowClick = false;
4224
+ /**
4225
+ * Event emitted when the avatar is clicked.
4226
+ * @type {void}
4227
+ * @memberof AvatarComponent
4228
+ */
4229
+ this.avatarClick = new EventEmitter();
4230
+ this.iconSize = iconSize;
4231
+ this.avatarSize = AvatarSize;
4232
+ }
4233
+ onAvatarClick() {
4234
+ this.avatarClick.emit();
4235
+ }
4236
+ get clickAllowance() {
4237
+ return this.allowClick ? 'clickable' : 'non-clickable';
4238
+ }
4239
+ }
4240
+ AvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4241
+ AvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: AvatarComponent, selector: "ui-avatar", inputs: { size: "size", imageUrl: "imageUrl", name: "name", tooltipText: "tooltipText", allowClick: "allowClick" }, outputs: { avatarClick: "avatarClick" }, ngImport: i0, template: "<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size, clickAllowance]\"\n (click)=\"onAvatarClick()\"\n>\n <span *ngIf=\"name && !imageUrl\">\n {{ name | nameInitials }}\n </span>\n <img *ngIf=\"imageUrl\" [attr.src]=\"imageUrl\" [alt]=\"'profile-image'\">\n <ui-icon color=\"dark\" [size]=\"iconSize[size]\" *ngIf=\"!imageUrl && !name\" [name]=\"'User-profile'\"></ui-icon>\n</div>\n\n", styles: [":host .clickable{cursor:pointer}:host .non-clickable{pointer-events:none}:host .avatar-container{font-family:Open Sans,sans-serif;font-weight:400;display:flex;justify-content:center;align-items:center;border-radius:100%;background:#CBD6CB;position:relative;-webkit-user-select:none;user-select:none}:host .avatar-container[type=icon]{background:#E0E0E0}:host .avatar-container img{width:100%;height:100%;object-fit:cover;border-radius:100%}:host .avatar-container.small{width:24px;height:24px;font-size:10px}:host .avatar-container.medium{width:48px;height:48px;font-size:20px}:host .avatar-container.large{width:120px;height:120px;font-size:50px;letter-spacing:-2}:host .avatar-container .edit-avatar{display:flex;justify-content:center;align-items:center;position:absolute;right:0;bottom:0;background:#F6F6F6;width:32px;height:32px;border-radius:100%;cursor:pointer;-webkit-backdrop-filter:drop-shadow(0px 8px 24px 4px #000000,8%);backdrop-filter:drop-shadow(0px 8px 24px 4px #000000,8%)}:host .avatar-container .edit-avatar:hover{background:#EDEDED}:host .avatar-container .edit-avatar:active{background:#E0E0E0}:host .avatar-container .edit-avatar:focus{outline:1px dashed #888888;outline-offset:4px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color"] }, { kind: "pipe", type: NameInitialsPipe, name: "nameInitials" }] });
4242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponent, decorators: [{
4243
+ type: Component,
4244
+ args: [{ selector: 'ui-avatar', template: "<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size, clickAllowance]\"\n (click)=\"onAvatarClick()\"\n>\n <span *ngIf=\"name && !imageUrl\">\n {{ name | nameInitials }}\n </span>\n <img *ngIf=\"imageUrl\" [attr.src]=\"imageUrl\" [alt]=\"'profile-image'\">\n <ui-icon color=\"dark\" [size]=\"iconSize[size]\" *ngIf=\"!imageUrl && !name\" [name]=\"'User-profile'\"></ui-icon>\n</div>\n\n", styles: [":host .clickable{cursor:pointer}:host .non-clickable{pointer-events:none}:host .avatar-container{font-family:Open Sans,sans-serif;font-weight:400;display:flex;justify-content:center;align-items:center;border-radius:100%;background:#CBD6CB;position:relative;-webkit-user-select:none;user-select:none}:host .avatar-container[type=icon]{background:#E0E0E0}:host .avatar-container img{width:100%;height:100%;object-fit:cover;border-radius:100%}:host .avatar-container.small{width:24px;height:24px;font-size:10px}:host .avatar-container.medium{width:48px;height:48px;font-size:20px}:host .avatar-container.large{width:120px;height:120px;font-size:50px;letter-spacing:-2}:host .avatar-container .edit-avatar{display:flex;justify-content:center;align-items:center;position:absolute;right:0;bottom:0;background:#F6F6F6;width:32px;height:32px;border-radius:100%;cursor:pointer;-webkit-backdrop-filter:drop-shadow(0px 8px 24px 4px #000000,8%);backdrop-filter:drop-shadow(0px 8px 24px 4px #000000,8%)}:host .avatar-container .edit-avatar:hover{background:#EDEDED}:host .avatar-container .edit-avatar:active{background:#E0E0E0}:host .avatar-container .edit-avatar:focus{outline:1px dashed #888888;outline-offset:4px}\n"] }]
4245
+ }], propDecorators: { size: [{
4246
+ type: Input
4247
+ }], imageUrl: [{
4248
+ type: Input
4249
+ }], name: [{
4250
+ type: Input
4251
+ }], tooltipText: [{
4252
+ type: Input
4253
+ }], allowClick: [{
4254
+ type: Input
4255
+ }], avatarClick: [{
4256
+ type: Output
4257
+ }] } });
4258
+
4259
+ class AvatarComponentModule {
4260
+ }
4261
+ AvatarComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4262
+ AvatarComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponentModule, declarations: [AvatarComponent, NameInitialsPipe], imports: [CommonModule, IconComponentModule, MatTooltipModule], exports: [AvatarComponent] });
4263
+ AvatarComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponentModule, imports: [CommonModule, IconComponentModule, MatTooltipModule] });
4264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponentModule, decorators: [{
4265
+ type: NgModule,
4266
+ args: [{
4267
+ declarations: [AvatarComponent, NameInitialsPipe],
4268
+ imports: [CommonModule, IconComponentModule, MatTooltipModule],
4269
+ exports: [AvatarComponent],
4270
+ }]
4271
+ }] });
4272
+
3948
4273
  /* eslint-disable */
3949
4274
  /* Components */
3950
4275
  // Alert Banner
@@ -3953,5 +4278,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3953
4278
  * Generated bundle index. Do not edit.
3954
4279
  */
3955
4280
 
3956
- export { AlertBannerComponent, AlertBannerComponentModule, BannerActionComponent, BannerActionComponentModule, ButtonComponent, ButtonComponentModule, CardComponent, CardComponentModule, CheckboxComponent, CheckboxComponentModule, ColumnAlignmentEnum, ColumnTypeEnum, ConfirmDialogComponent, ConfirmDialogComponentModule, CreateAccountComponent, CreateAccountComponentModule, CreatePasswordComponent, CreatePasswordComponentModule, DataPropertyGetterPipe, DatepickerComponent, DatepickerComponentModule, DialogComponent, DialogComponentModule, DialogService, DropdownComponent, DropdownComponentModule, ElevationShadowComponent, ElevationShadowComponentModule, ElevationType, FieldComponent, FieldComponentModule, FileUploadComponent, FileUploadComponentModule, ForgotPasswordComponent, ForgotPasswordComponentModule, IconComponent, IconComponentModule, IconLabelComponent, IconLabelComponentModule, LabelComponent, LabelComponentModule, LabelSizeEnum, LoginComponent, LoginComponentModule, LogoComponent, LogoComponentModule, LogoPathEnum, LogoTypeEnum, NavbarComponent, NavbarComponentModule, NavigationComponent, NavigationComponentModule, PaginatorComponent, PaginatorComponentModule, ProgressBarComponent, ProgressBarComponentModule, RadioButtonComponent, RadioButtonComponentModule, RatingComponent, RatingComponentModule, SnackbarComponent, SnackbarComponentModule, SnackbarService, SpinnerComponent, SpinnerComponentModule, TableComponent, TableComponentModule, TagComponent, TagComponentModule, TooltipComponent, TooltipComponentModule, TooltipPositionType, preloadLang };
4281
+ export { AlertBannerComponent, AlertBannerComponentModule, AvatarComponent, AvatarComponentModule, BannerActionComponent, BannerActionComponentModule, ButtonComponent, ButtonComponentModule, CardComponent, CardComponentModule, CheckboxComponent, CheckboxComponentModule, ColumnAlignmentEnum, ColumnTypeEnum, ConfirmDialogComponent, ConfirmDialogComponentModule, CreateAccountComponent, CreateAccountComponentModule, CreatePasswordComponent, CreatePasswordComponentModule, DataPropertyGetterPipe, DatepickerComponent, DatepickerComponentModule, DialogComponent, DialogComponentModule, DialogService, DropdownComponent, DropdownComponentModule, ElevationShadowComponent, ElevationShadowComponentModule, ElevationType, FieldComponent, FieldComponentModule, FileUploadComponent, FileUploadComponentModule, ForgotPasswordComponent, ForgotPasswordComponentModule, IconComponent, IconComponentModule, IconLabelComponent, IconLabelComponentModule, LabelComponent, LabelComponentModule, LabelSizeEnum, LoginComponent, LoginComponentModule, LogoComponent, LogoComponentModule, LogoPathEnum, LogoTypeEnum, NavbarComponent, NavbarComponentModule, NavigationComponent, NavigationComponentModule, PaginatorComponent, PaginatorComponentModule, ProgressBarComponent, ProgressBarComponentModule, RadioButtonComponent, RadioButtonComponentModule, RatingComponent, RatingComponentModule, SnackbarComponent, SnackbarComponentModule, SnackbarService, SpinnerComponent, SpinnerComponentModule, TableComponent, TableComponentModule, TagComponent, TagComponentModule, ToggleComponent, ToggleComponentModule, TooltipComponent, TooltipComponentModule, TooltipPositionType, preloadLang };
3957
4282
  //# sourceMappingURL=testgorilla-tgo-ui.mjs.map