@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: [{
@@ -1060,14 +1060,14 @@ class FieldComponent {
1060
1060
  * @type {Boolean}
1061
1061
  * @memberof FieldComponent
1062
1062
  */
1063
- this.updateOnBlur = true;
1063
+ this.updateOnBlur = false;
1064
1064
  /**
1065
1065
  * allow only digits in input
1066
1066
  *
1067
1067
  * @type {Boolean}
1068
1068
  * @memberof FieldComponent
1069
1069
  */
1070
- this.allowOnlyDigits = true;
1070
+ this.allowOnlyDigits = false;
1071
1071
  /**
1072
1072
  * @ignore
1073
1073
  */
@@ -3309,40 +3309,147 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3309
3309
  class TagComponent {
3310
3310
  constructor() {
3311
3311
  /**
3312
- * Color
3312
+ * Icon
3313
+ *
3314
+ * @type {string}
3315
+ * @memberof TagComponent
3316
+ */
3317
+ this.icon = '';
3318
+ /**
3319
+ * Whether to allow the tag to be closed.
3320
+ *
3321
+ * @type {boolean}
3322
+ * @default false
3323
+ * @memberof TagComponent
3324
+ */
3325
+ this.allowClose = false;
3326
+ /**
3327
+ * Whether the tag is in read-only mode.
3328
+ *
3329
+ * @type {boolean}
3330
+ * @default false
3331
+ * @memberof TagComponent
3332
+ */
3333
+ this.readOnly = false;
3334
+ /**
3335
+ * Whether the tag is selected.
3336
+ *
3337
+ * @type {boolean}
3338
+ * @default false
3339
+ * @memberof TagComponent
3340
+ */
3341
+ this.isSelected = false;
3342
+ /**
3343
+ * Display icon when is selected
3344
+ *
3345
+ * @type {boolean}
3346
+ * @default false
3347
+ * @memberof TagComponent
3348
+ */
3349
+ this.showIconWhenSelected = false;
3350
+ /**
3351
+ * Specifies whether the element is disabled.
3352
+ *
3353
+ * @type {boolean}
3354
+ * @default false
3355
+ * @memberof TagComponent
3356
+ */
3357
+ this.isDisabled = false;
3358
+ /**
3359
+ * Event triggered when the tag should be closed.
3360
+ *
3361
+ * @event
3362
+ * @memberof TagComponent
3363
+ */
3364
+ this.close = new EventEmitter();
3365
+ /**
3366
+ * Event triggered when a press action occurs.
3313
3367
  *
3314
- * @type {TagColor}
3368
+ * @event
3315
3369
  * @memberof TagComponent
3316
3370
  */
3317
- this.color = 'teal';
3371
+ this.press = new EventEmitter();
3372
+ /**
3373
+ * Subject that needs to be triggered when Label input changes, to check if it's truncated
3374
+ * @private
3375
+ * @type {void}
3376
+ * @memberof TagComponent
3377
+ */
3378
+ this.checkLabelEllipsis$ = new ReplaySubject(1);
3379
+ /**
3380
+ * Observable that indicates if the Label is truncated
3381
+ * debounceTime is used to wait for view to be initialized after receiving a new Label input
3382
+ * @protected
3383
+ * @type {boolean}
3384
+ * @memberof TagComponent
3385
+ */
3386
+ this.isEllipseActiveObs$ = this.checkLabelEllipsis$.pipe(debounceTime(100), map(() => {
3387
+ const el = this.labelElement.nativeElement;
3388
+ return el.offsetWidth < el.scrollWidth;
3389
+ }));
3390
+ this.labelText = '';
3391
+ }
3392
+ /**
3393
+ * Tag's label
3394
+ *
3395
+ * @memberof TagComponent
3396
+ */
3397
+ set label(value) {
3398
+ this.labelText = value;
3399
+ if (this.labelElement) {
3400
+ this.isLabelEllipseActive();
3401
+ }
3402
+ }
3403
+ ngAfterViewInit() {
3404
+ this.isLabelEllipseActive();
3405
+ }
3406
+ onPress() {
3407
+ if (!this.readOnly && !this.allowClose) {
3408
+ this.isSelected = this.showIconWhenSelected ? !this.isSelected : false;
3409
+ this.press.emit(this.isSelected);
3410
+ }
3411
+ }
3412
+ onClose() {
3413
+ this.close.emit();
3414
+ }
3415
+ isLabelEllipseActive() {
3416
+ this.checkLabelEllipsis$.next();
3417
+ }
3418
+ get tabIndex() {
3419
+ return this.isDisabled || this.readOnly ? -1 : 0;
3420
+ }
3421
+ get filled() {
3422
+ return this.readOnly || this.allowClose || this.isSelected;
3318
3423
  }
3319
3424
  }
3320
3425
  TagComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3321
- 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"] });
3426
+ 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" }] });
3322
3427
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponent, decorators: [{
3323
3428
  type: Component,
3324
- 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"] }]
3325
- }], ctorParameters: function () { return []; }, propDecorators: { text: [{
3429
+ 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"] }]
3430
+ }], propDecorators: { label: [{
3326
3431
  type: Input
3327
- }], color: [{
3432
+ }], icon: [{
3433
+ type: Input
3434
+ }], allowClose: [{
3435
+ type: Input
3436
+ }], readOnly: [{
3437
+ type: Input
3438
+ }], isSelected: [{
3439
+ type: Input
3440
+ }], showIconWhenSelected: [{
3328
3441
  type: Input
3442
+ }], isDisabled: [{
3443
+ type: Input
3444
+ }], close: [{
3445
+ type: Output
3446
+ }], press: [{
3447
+ type: Output
3448
+ }], labelElement: [{
3449
+ type: ViewChild,
3450
+ args: ['labelElement']
3329
3451
  }] } });
3330
3452
 
3331
- class TagComponentModule {
3332
- }
3333
- TagComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3334
- TagComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, declarations: [TagComponent], imports: [CommonModule], exports: [TagComponent] });
3335
- TagComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, imports: [CommonModule] });
3336
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, decorators: [{
3337
- type: NgModule,
3338
- args: [{
3339
- declarations: [TagComponent],
3340
- imports: [CommonModule],
3341
- exports: [TagComponent],
3342
- providers: [],
3343
- }]
3344
- }] });
3345
-
3346
3453
  var TooltipPositionType;
3347
3454
  (function (TooltipPositionType) {
3348
3455
  TooltipPositionType["TOP"] = "top";
@@ -3411,6 +3518,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3411
3518
  }]
3412
3519
  }] });
3413
3520
 
3521
+ class TagComponentModule {
3522
+ }
3523
+ TagComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3524
+ 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] });
3525
+ TagComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, imports: [CommonModule, IconComponentModule, TooltipComponentModule, MatTooltipModule] });
3526
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagComponentModule, decorators: [{
3527
+ type: NgModule,
3528
+ args: [{
3529
+ declarations: [TagComponent],
3530
+ imports: [CommonModule, IconComponentModule, TooltipComponentModule, MatTooltipModule],
3531
+ exports: [TagComponent],
3532
+ providers: [],
3533
+ }]
3534
+ }] });
3535
+
3414
3536
  class DropdownComponent {
3415
3537
  constructor() {
3416
3538
  this.class = 'ui-dropdown';
@@ -3930,6 +4052,208 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3930
4052
  }]
3931
4053
  }] });
3932
4054
 
4055
+ class ToggleComponent {
4056
+ constructor() {
4057
+ /**
4058
+ * The `selected` property determines the current state of the toggle switch.
4059
+ *
4060
+ * @type {boolean}
4061
+ * @default false
4062
+ * @memberof ToggleComponent
4063
+ */
4064
+ this.selected = false;
4065
+ /**
4066
+ * The `disabled` property determines whether the toggle switch is disabled.
4067
+ *
4068
+ * @type {boolean}
4069
+ * @default false
4070
+ * @memberof ToggleComponent
4071
+ */
4072
+ this.disabled = false;
4073
+ /**
4074
+ * The `toggle` event is triggered when the state of the toggle switch changes. It returns the new state.
4075
+ *
4076
+ * @type {event}
4077
+ * @memberof ToggleComponent
4078
+ */
4079
+ this.toggle = new EventEmitter();
4080
+ this.onChange = () => { };
4081
+ this.onTouched = () => { };
4082
+ }
4083
+ onToggle() {
4084
+ if (!this.disabled) {
4085
+ this.selected = !this.selected;
4086
+ this.toggle.emit(this.selected);
4087
+ }
4088
+ }
4089
+ writeValue(state) {
4090
+ if (state) {
4091
+ this.selected = state;
4092
+ }
4093
+ }
4094
+ registerOnChange(fn) {
4095
+ this.onChange = fn;
4096
+ }
4097
+ registerOnTouched(fn) {
4098
+ this.onTouched = fn;
4099
+ }
4100
+ setDisabledState(isDisabled) {
4101
+ this.disabled = isDisabled;
4102
+ }
4103
+ }
4104
+ ToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4105
+ 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: [
4106
+ {
4107
+ provide: NG_VALUE_ACCESSOR,
4108
+ useExisting: forwardRef(() => ToggleComponent),
4109
+ multi: true,
4110
+ },
4111
+ ], 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"] }] });
4112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponent, decorators: [{
4113
+ type: Component,
4114
+ args: [{ selector: 'ui-toggle', providers: [
4115
+ {
4116
+ provide: NG_VALUE_ACCESSOR,
4117
+ useExisting: forwardRef(() => ToggleComponent),
4118
+ multi: true,
4119
+ },
4120
+ ], 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"] }]
4121
+ }], propDecorators: { selected: [{
4122
+ type: Input
4123
+ }], disabled: [{
4124
+ type: Input
4125
+ }], toggle: [{
4126
+ type: Output
4127
+ }] } });
4128
+
4129
+ class ToggleComponentModule {
4130
+ }
4131
+ ToggleComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4132
+ ToggleComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponentModule, declarations: [ToggleComponent], imports: [CommonModule] });
4133
+ ToggleComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponentModule, imports: [CommonModule] });
4134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToggleComponentModule, decorators: [{
4135
+ type: NgModule,
4136
+ args: [{
4137
+ declarations: [ToggleComponent],
4138
+ imports: [CommonModule],
4139
+ }]
4140
+ }] });
4141
+
4142
+ var AvatarSize;
4143
+ (function (AvatarSize) {
4144
+ AvatarSize["SMALL"] = "small";
4145
+ AvatarSize["MEDIUM"] = "medium";
4146
+ AvatarSize["LARGE"] = "large";
4147
+ })(AvatarSize || (AvatarSize = {}));
4148
+ const iconSize = {
4149
+ small: '16',
4150
+ medium: '24',
4151
+ large: '80',
4152
+ };
4153
+
4154
+ class NameInitialsPipe {
4155
+ transform(value) {
4156
+ const initials = value.split(' ').filter(Boolean);
4157
+ if (initials.length > 1) {
4158
+ return initials.map(initial => initial[0].toUpperCase()).join('');
4159
+ }
4160
+ else {
4161
+ const firstLetters = value.substring(0, 2);
4162
+ return `${firstLetters[0]?.toUpperCase() ?? ''}${firstLetters[1]?.toLowerCase() ?? ''}`;
4163
+ }
4164
+ }
4165
+ }
4166
+ NameInitialsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NameInitialsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
4167
+ NameInitialsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NameInitialsPipe, name: "nameInitials" });
4168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NameInitialsPipe, decorators: [{
4169
+ type: Pipe,
4170
+ args: [{
4171
+ name: 'nameInitials',
4172
+ }]
4173
+ }] });
4174
+
4175
+ class AvatarComponent {
4176
+ constructor() {
4177
+ /**
4178
+ * Input property for specifying the size of the avatar.
4179
+ * @type {AvatarSize}
4180
+ * @default AvatarSize.SMALL
4181
+ * @memberof AvatarComponent
4182
+ */
4183
+ this.size = AvatarSize.SMALL;
4184
+ /**
4185
+ * Input property for specifying the URL of the image to display in the avatar.
4186
+ * @type {string}
4187
+ * @memberof AvatarComponent
4188
+ */
4189
+ this.imageUrl = '';
4190
+ /**
4191
+ * Input property for specifying the initials to display in the avatar.
4192
+ * @type {string}
4193
+ * @memberof AvatarComponent
4194
+ */
4195
+ this.name = '';
4196
+ /**
4197
+ * Input property for specifying the tooltip text for edit.
4198
+ * @type {string}
4199
+ * @memberof AvatarComponent
4200
+ */
4201
+ this.tooltipText = '';
4202
+ /**
4203
+ * Input property that makes avatar clickable.
4204
+ * @type {boolean}
4205
+ * @memberof AvatarComponent
4206
+ */
4207
+ this.allowClick = false;
4208
+ /**
4209
+ * Event emitted when the avatar is clicked.
4210
+ * @type {void}
4211
+ * @memberof AvatarComponent
4212
+ */
4213
+ this.avatarClick = new EventEmitter();
4214
+ this.iconSize = iconSize;
4215
+ this.avatarSize = AvatarSize;
4216
+ }
4217
+ onAvatarClick() {
4218
+ this.avatarClick.emit();
4219
+ }
4220
+ get clickAllowance() {
4221
+ return this.allowClick ? 'clickable' : 'non-clickable';
4222
+ }
4223
+ }
4224
+ AvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4225
+ 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" }] });
4226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponent, decorators: [{
4227
+ type: Component,
4228
+ 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"] }]
4229
+ }], propDecorators: { size: [{
4230
+ type: Input
4231
+ }], imageUrl: [{
4232
+ type: Input
4233
+ }], name: [{
4234
+ type: Input
4235
+ }], tooltipText: [{
4236
+ type: Input
4237
+ }], allowClick: [{
4238
+ type: Input
4239
+ }], avatarClick: [{
4240
+ type: Output
4241
+ }] } });
4242
+
4243
+ class AvatarComponentModule {
4244
+ }
4245
+ AvatarComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4246
+ 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] });
4247
+ AvatarComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponentModule, imports: [CommonModule, IconComponentModule, MatTooltipModule] });
4248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AvatarComponentModule, decorators: [{
4249
+ type: NgModule,
4250
+ args: [{
4251
+ declarations: [AvatarComponent, NameInitialsPipe],
4252
+ imports: [CommonModule, IconComponentModule, MatTooltipModule],
4253
+ exports: [AvatarComponent],
4254
+ }]
4255
+ }] });
4256
+
3933
4257
  /* eslint-disable */
3934
4258
  /* Components */
3935
4259
  // Alert Banner
@@ -3938,5 +4262,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3938
4262
  * Generated bundle index. Do not edit.
3939
4263
  */
3940
4264
 
3941
- 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 };
4265
+ 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 };
3942
4266
  //# sourceMappingURL=testgorilla-tgo-ui.mjs.map