@testgorilla/tgo-ui 11.22.2 → 12.0.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.
- package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs +335 -229
- package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs +547 -465
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs +160 -75
- package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +678 -278
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +337 -274
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs +351 -192
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +1950 -960
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +1206 -1044
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +328 -182
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +383 -203
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +553 -261
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs +709 -739
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs +219 -184
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +515 -458
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +423 -162
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs +10784 -10996
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs +810 -533
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs +473 -116
- package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +1149 -540
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +148 -84
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs +239 -142
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +599 -467
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +126 -70
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +324 -329
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs +969 -648
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs +553 -419
- package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +847 -452
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs +398 -302
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs +162 -95
- package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +1825 -1789
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs +1018 -672
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +758 -368
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +204 -212
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +183 -48
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +243 -79
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs +751 -361
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +1122 -385
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +689 -413
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +227 -92
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +174 -113
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs +367 -165
- package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs +253 -118
- package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs +730 -444
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +533 -221
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs +274 -76
- package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +184 -124
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +1223 -574
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +249 -160
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +447 -439
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +226 -150
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +255 -67
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +205 -162
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +245 -153
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +274 -140
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs +319 -147
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs +286 -84
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +660 -208
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +579 -320
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +419 -200
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +132 -80
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +741 -390
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +455 -329
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs +543 -514
- package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +193 -104
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs +760 -524
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs +714 -415
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs +847 -438
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +535 -275
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +316 -246
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +404 -284
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs +664 -383
- package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +201 -112
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +1014 -458
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui.mjs +147 -155
- package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
- package/mcp/catalog.json +1 -1
- package/package.json +16 -17
- package/projects/tgo-canopy-ui/assets/icons/rebrand/Sequences-filled.svg +3 -0
- package/projects/tgo-canopy-ui/assets/icons/rebrand/Sequences-in-line.svg +3 -0
- package/projects/tgo-canopy-ui/theme/_palette.scss +23 -18
- package/types/testgorilla-tgo-ui-components-accordion.d.ts +214 -158
- package/types/testgorilla-tgo-ui-components-ai-audio-circle.d.ts +93 -69
- package/types/testgorilla-tgo-ui-components-ai-caveat.d.ts +37 -34
- package/types/testgorilla-tgo-ui-components-ai-feedback.d.ts +126 -86
- package/types/testgorilla-tgo-ui-components-alert-banner.d.ts +260 -185
- package/types/testgorilla-tgo-ui-components-audio-waveform.d.ts +96 -67
- package/types/testgorilla-tgo-ui-components-autocomplete-v2.d.ts +455 -256
- package/types/testgorilla-tgo-ui-components-autocomplete.d.ts +545 -390
- package/types/testgorilla-tgo-ui-components-avatar.d.ts +128 -102
- package/types/testgorilla-tgo-ui-components-badge.d.ts +191 -139
- package/types/testgorilla-tgo-ui-components-breadcrumb.d.ts +100 -62
- package/types/testgorilla-tgo-ui-components-button.d.ts +479 -340
- package/types/testgorilla-tgo-ui-components-card.d.ts +153 -114
- package/types/testgorilla-tgo-ui-components-checkbox.d.ts +299 -223
- package/types/testgorilla-tgo-ui-components-checklist.d.ts +149 -97
- package/types/testgorilla-tgo-ui-components-core.d.ts +307 -295
- package/types/testgorilla-tgo-ui-components-datepicker.d.ts +404 -299
- package/types/testgorilla-tgo-ui-components-device-control.d.ts +151 -81
- package/types/testgorilla-tgo-ui-components-dialog.d.ts +442 -329
- package/types/testgorilla-tgo-ui-components-divider.d.ts +64 -51
- package/types/testgorilla-tgo-ui-components-donut-chart.d.ts +41 -37
- package/types/testgorilla-tgo-ui-components-dropdown.d.ts +335 -241
- package/types/testgorilla-tgo-ui-components-elevation-shadow.d.ts +48 -43
- package/types/testgorilla-tgo-ui-components-empty-state.d.ts +317 -215
- package/types/testgorilla-tgo-ui-components-field.d.ts +559 -388
- package/types/testgorilla-tgo-ui-components-file-upload.d.ts +230 -168
- package/types/testgorilla-tgo-ui-components-filter-button.d.ts +263 -206
- package/types/testgorilla-tgo-ui-components-gaussian-chart.d.ts +107 -94
- package/types/testgorilla-tgo-ui-components-icon-label.d.ts +84 -61
- package/types/testgorilla-tgo-ui-components-icon.d.ts +137 -110
- package/types/testgorilla-tgo-ui-components-infinite-scroll-table.d.ts +429 -303
- package/types/testgorilla-tgo-ui-components-inline-field.d.ts +338 -254
- package/types/testgorilla-tgo-ui-components-logo.d.ts +119 -101
- package/types/testgorilla-tgo-ui-components-media-card.d.ts +51 -35
- package/types/testgorilla-tgo-ui-components-media-dialog.d.ts +40 -45
- package/types/testgorilla-tgo-ui-components-multi-input.d.ts +283 -194
- package/types/testgorilla-tgo-ui-components-navbar.d.ts +326 -208
- package/types/testgorilla-tgo-ui-components-overflow-menu.d.ts +276 -204
- package/types/testgorilla-tgo-ui-components-page-header.d.ts +67 -50
- package/types/testgorilla-tgo-ui-components-paginator.d.ts +103 -70
- package/types/testgorilla-tgo-ui-components-password-criteria.d.ts +67 -58
- package/types/testgorilla-tgo-ui-components-password-strength.d.ts +66 -57
- package/types/testgorilla-tgo-ui-components-phone-input.d.ts +217 -175
- package/types/testgorilla-tgo-ui-components-popover.d.ts +94 -53
- package/types/testgorilla-tgo-ui-components-popup-tip.d.ts +81 -44
- package/types/testgorilla-tgo-ui-components-progress-bar.d.ts +115 -84
- package/types/testgorilla-tgo-ui-components-prompt.d.ts +315 -219
- package/types/testgorilla-tgo-ui-components-radial-progress.d.ts +146 -107
- package/types/testgorilla-tgo-ui-components-radio-button.d.ts +296 -219
- package/types/testgorilla-tgo-ui-components-rating.d.ts +134 -95
- package/types/testgorilla-tgo-ui-components-scale-table.d.ts +67 -47
- package/types/testgorilla-tgo-ui-components-scale.d.ts +91 -66
- package/types/testgorilla-tgo-ui-components-segmented-bar.d.ts +118 -89
- package/types/testgorilla-tgo-ui-components-segmented-button.d.ts +107 -80
- package/types/testgorilla-tgo-ui-components-segmented-toggle.d.ts +138 -105
- package/types/testgorilla-tgo-ui-components-selectable-card.d.ts +90 -56
- package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +183 -107
- package/types/testgorilla-tgo-ui-components-side-panel.d.ts +156 -145
- package/types/testgorilla-tgo-ui-components-side-sheet.d.ts +98 -89
- package/types/testgorilla-tgo-ui-components-skeleton.d.ts +50 -33
- package/types/testgorilla-tgo-ui-components-slider.d.ts +278 -198
- package/types/testgorilla-tgo-ui-components-snackbar.d.ts +211 -159
- package/types/testgorilla-tgo-ui-components-spider-chart.d.ts +140 -121
- package/types/testgorilla-tgo-ui-components-spinner.d.ts +93 -72
- package/types/testgorilla-tgo-ui-components-stepper.d.ts +480 -338
- package/types/testgorilla-tgo-ui-components-table.d.ts +280 -233
- package/types/testgorilla-tgo-ui-components-tabs.d.ts +282 -183
- package/types/testgorilla-tgo-ui-components-tag.d.ts +266 -193
- package/types/testgorilla-tgo-ui-components-toggle.d.ts +180 -132
- package/types/testgorilla-tgo-ui-components-tooltip.d.ts +142 -105
- package/types/testgorilla-tgo-ui-components-universal-skills.d.ts +165 -144
- package/types/testgorilla-tgo-ui-components-validation-error.d.ts +70 -51
- package/types/testgorilla-tgo-ui-components-write-with-ai.d.ts +210 -133
- package/types/testgorilla-tgo-ui.d.ts +52 -45
|
@@ -1,189 +1,335 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import * as i2 from
|
|
5
|
-
import { ButtonComponentModule } from
|
|
6
|
-
import { UiTranslatePipe } from
|
|
7
|
-
import * as i1 from
|
|
8
|
-
import { IconComponentModule } from
|
|
9
|
-
import { MatTooltipModule } from
|
|
10
|
-
|
|
1
|
+
import { AsyncPipe, CommonModule, NgClass, NgStyle } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, NgModule, Optional, Output, Pipe } from "@angular/core";
|
|
4
|
+
import * as i2 from "@testgorilla/tgo-ui/components/button";
|
|
5
|
+
import { ButtonComponentModule } from "@testgorilla/tgo-ui/components/button";
|
|
6
|
+
import { UiTranslatePipe } from "@testgorilla/tgo-ui/components/core";
|
|
7
|
+
import * as i1 from "@testgorilla/tgo-ui/components/icon";
|
|
8
|
+
import { IconComponentModule } from "@testgorilla/tgo-ui/components/icon";
|
|
9
|
+
import { MatTooltipModule } from "@angular/material/tooltip";
|
|
11
10
|
var AvatarSize;
|
|
12
|
-
(function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
(function(AvatarSize) {
|
|
12
|
+
AvatarSize["SMALL"] = "small";
|
|
13
|
+
AvatarSize["SMALL_MEDIUM"] = "smallMedium";
|
|
14
|
+
AvatarSize["MEDIUM"] = "medium";
|
|
15
|
+
AvatarSize["MEDIUM_LARGE"] = "mediumLarge";
|
|
16
|
+
AvatarSize["LARGE"] = "large";
|
|
18
17
|
})(AvatarSize || (AvatarSize = {}));
|
|
19
18
|
const iconSize = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
small: "16",
|
|
20
|
+
medium: "24",
|
|
21
|
+
large: "80"
|
|
23
22
|
};
|
|
24
23
|
var AvatarBackgroundColor;
|
|
25
|
-
(function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
(function(AvatarBackgroundColor) {
|
|
25
|
+
AvatarBackgroundColor["PINK"] = "#FFE6FA";
|
|
26
|
+
AvatarBackgroundColor["BLUE"] = "#D9E8FF";
|
|
27
|
+
AvatarBackgroundColor["GREEN"] = "#D4F2C3";
|
|
28
|
+
AvatarBackgroundColor["ORANGE"] = "#FFE1B3";
|
|
29
|
+
AvatarBackgroundColor["RED"] = "#FFAC9A";
|
|
31
30
|
})(AvatarBackgroundColor || (AvatarBackgroundColor = {}));
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
31
|
+
var NameInitialsPipe = class NameInitialsPipe {
|
|
32
|
+
transform(value) {
|
|
33
|
+
const initials = value.split(" ").filter(Boolean);
|
|
34
|
+
if (initials.length > 1) return initials.map((initial, i) => i === 0 || i === initials.length - 1 ? initial[0].toUpperCase() : "").join("");
|
|
35
|
+
else {
|
|
36
|
+
const firstLetters = value.substring(0, 2);
|
|
37
|
+
return `${firstLetters[0]?.toUpperCase() ?? ""}${firstLetters[1]?.toLowerCase() ?? ""}`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
static {
|
|
41
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
42
|
+
minVersion: "12.0.0",
|
|
43
|
+
version: "22.2.4",
|
|
44
|
+
ngImport: i0,
|
|
45
|
+
type: NameInitialsPipe,
|
|
46
|
+
deps: [],
|
|
47
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
static {
|
|
51
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
52
|
+
minVersion: "14.0.0",
|
|
53
|
+
version: "22.2.4",
|
|
54
|
+
ngImport: i0,
|
|
55
|
+
type: NameInitialsPipe,
|
|
56
|
+
isStandalone: true,
|
|
57
|
+
name: "nameInitials"
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
62
|
+
minVersion: "12.0.0",
|
|
63
|
+
version: "22.2.4",
|
|
64
|
+
ngImport: i0,
|
|
65
|
+
type: NameInitialsPipe,
|
|
66
|
+
decorators: [{
|
|
67
|
+
type: Pipe,
|
|
68
|
+
args: [{ name: "nameInitials" }]
|
|
69
|
+
}]
|
|
70
|
+
});
|
|
71
|
+
var AvatarComponent = class AvatarComponent {
|
|
72
|
+
set backgroundColor(colorName) {
|
|
73
|
+
this.backgroundAvatarColor = AvatarBackgroundColor[colorName.toUpperCase()];
|
|
74
|
+
}
|
|
75
|
+
constructor(defaultAppTheme) {
|
|
76
|
+
this.defaultAppTheme = defaultAppTheme;
|
|
77
|
+
this.size = AvatarSize.SMALL;
|
|
78
|
+
this.imageUrl = "";
|
|
79
|
+
this.name = "";
|
|
80
|
+
this.tooltipText = "";
|
|
81
|
+
this.allowEdit = false;
|
|
82
|
+
this.applicationTheme = "light";
|
|
83
|
+
this.editClick = new EventEmitter();
|
|
84
|
+
this.iconSize = iconSize;
|
|
85
|
+
this.avatarSize = AvatarSize;
|
|
86
|
+
if (defaultAppTheme) this.applicationTheme = defaultAppTheme;
|
|
87
|
+
}
|
|
88
|
+
handleImageError() {
|
|
89
|
+
this.imageUrl = "";
|
|
90
|
+
}
|
|
91
|
+
onEditClick(event) {
|
|
92
|
+
this.editClick.emit(event);
|
|
93
|
+
}
|
|
94
|
+
static {
|
|
95
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
96
|
+
minVersion: "12.0.0",
|
|
97
|
+
version: "22.2.4",
|
|
98
|
+
ngImport: i0,
|
|
99
|
+
type: AvatarComponent,
|
|
100
|
+
deps: [{
|
|
101
|
+
token: "CANOPYUI_DEFAULT_APPLICATION_THEME",
|
|
102
|
+
optional: true
|
|
103
|
+
}],
|
|
104
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
static {
|
|
108
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
109
|
+
minVersion: "17.0.0",
|
|
110
|
+
version: "22.2.4",
|
|
111
|
+
type: AvatarComponent,
|
|
112
|
+
isStandalone: true,
|
|
113
|
+
selector: "ui-avatar",
|
|
114
|
+
inputs: {
|
|
115
|
+
size: "size",
|
|
116
|
+
imageUrl: "imageUrl",
|
|
117
|
+
name: "name",
|
|
118
|
+
tooltipText: "tooltipText",
|
|
119
|
+
allowEdit: "allowEdit",
|
|
120
|
+
applicationTheme: "applicationTheme",
|
|
121
|
+
backgroundColor: "backgroundColor"
|
|
122
|
+
},
|
|
123
|
+
outputs: { editClick: "editClick" },
|
|
124
|
+
ngImport: i0,
|
|
125
|
+
template: "<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n @if (name && !imageUrl) {\n <span class=\"initials\">\n {{ name | nameInitials }}\n </span>\n }\n @if (imageUrl) {\n <img [attr.aria-hidden]=\"true\" [attr.src]=\"imageUrl\" [alt]=\"\" (error)=\"handleImageError()\" />\n }\n @if (!imageUrl && !name) {\n <ui-icon\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n }\n @if (allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)) {\n <div class=\"edit-avatar\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n }\n</div>\n",
|
|
126
|
+
styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}: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.smallMedium{width:36px;height:36px;font-size:14px}:host .avatar-container.medium{width:48px;height:48px;font-size:20px}:host .avatar-container.mediumLarge{width:64px;height:64px}:host .avatar-container.mediumLarge .initials{font-weight:700;font-size:20px;line-height:26px}: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%}:host .avatar-container.mediumLarge .edit-avatar{width:24px;height:24px;right:-2px;bottom:-2px}:host .avatar-container[theme=dark],:host .avatar-container[theme=light]{background:#e9e9e9;color:#242424}:host .avatar-container[theme=dark] .edit-avatar,:host .avatar-container[theme=light] .edit-avatar{box-shadow:0 4px 16px #24242414;background:#fff}\n"],
|
|
127
|
+
dependencies: [
|
|
128
|
+
{
|
|
129
|
+
kind: "directive",
|
|
130
|
+
type: NgClass,
|
|
131
|
+
selector: "[ngClass]",
|
|
132
|
+
inputs: ["class", "ngClass"]
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
kind: "directive",
|
|
136
|
+
type: NgStyle,
|
|
137
|
+
selector: "[ngStyle]",
|
|
138
|
+
inputs: ["ngStyle"]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
kind: "ngmodule",
|
|
142
|
+
type: IconComponentModule
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
kind: "component",
|
|
146
|
+
type: i1.IconComponent,
|
|
147
|
+
selector: "ui-icon",
|
|
148
|
+
inputs: [
|
|
149
|
+
"size",
|
|
150
|
+
"cssClass",
|
|
151
|
+
"name",
|
|
152
|
+
"color",
|
|
153
|
+
"filled",
|
|
154
|
+
"toggleIconStyle",
|
|
155
|
+
"applicationTheme",
|
|
156
|
+
"useFullIconName"
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
kind: "ngmodule",
|
|
161
|
+
type: ButtonComponentModule
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
kind: "component",
|
|
165
|
+
type: i2.ButtonComponent,
|
|
166
|
+
selector: "ui-button",
|
|
167
|
+
inputs: [
|
|
168
|
+
"size",
|
|
169
|
+
"variant",
|
|
170
|
+
"label",
|
|
171
|
+
"iconPosition",
|
|
172
|
+
"justIcon",
|
|
173
|
+
"iconName",
|
|
174
|
+
"trailingIconName",
|
|
175
|
+
"trailingIconFilled",
|
|
176
|
+
"disabled",
|
|
177
|
+
"loading",
|
|
178
|
+
"loadingWithLabel",
|
|
179
|
+
"fullWidth",
|
|
180
|
+
"url",
|
|
181
|
+
"urlTarget",
|
|
182
|
+
"value",
|
|
183
|
+
"tooltip",
|
|
184
|
+
"isPremium",
|
|
185
|
+
"type",
|
|
186
|
+
"companyColor",
|
|
187
|
+
"buttonBadgeConfig",
|
|
188
|
+
"applicationTheme",
|
|
189
|
+
"disabledScaleOnClick",
|
|
190
|
+
"ariaLabel",
|
|
191
|
+
"ariaExpanded",
|
|
192
|
+
"ariaControls",
|
|
193
|
+
"ariaPressed",
|
|
194
|
+
"ariaRequired",
|
|
195
|
+
"ariaLabelledby",
|
|
196
|
+
"ariaDescribedby",
|
|
197
|
+
"preventDefault",
|
|
198
|
+
"hasBackground",
|
|
199
|
+
"tooltipPosition",
|
|
200
|
+
"role",
|
|
201
|
+
"iconFilled",
|
|
202
|
+
"testId"
|
|
203
|
+
],
|
|
204
|
+
outputs: ["buttonClickEvent", "buttonHoverEvent"]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
kind: "pipe",
|
|
208
|
+
type: AsyncPipe,
|
|
209
|
+
name: "async"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
kind: "pipe",
|
|
213
|
+
type: UiTranslatePipe,
|
|
214
|
+
name: "uiTranslate"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
kind: "pipe",
|
|
218
|
+
type: NameInitialsPipe,
|
|
219
|
+
name: "nameInitials"
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
227
|
+
minVersion: "12.0.0",
|
|
228
|
+
version: "22.2.4",
|
|
229
|
+
ngImport: i0,
|
|
230
|
+
type: AvatarComponent,
|
|
231
|
+
decorators: [{
|
|
232
|
+
type: Component,
|
|
233
|
+
args: [{
|
|
234
|
+
selector: "ui-avatar",
|
|
235
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
236
|
+
imports: [
|
|
237
|
+
NgClass,
|
|
238
|
+
NgStyle,
|
|
239
|
+
IconComponentModule,
|
|
240
|
+
ButtonComponentModule,
|
|
241
|
+
AsyncPipe,
|
|
242
|
+
UiTranslatePipe,
|
|
243
|
+
NameInitialsPipe
|
|
244
|
+
],
|
|
245
|
+
template: "<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n @if (name && !imageUrl) {\n <span class=\"initials\">\n {{ name | nameInitials }}\n </span>\n }\n @if (imageUrl) {\n <img [attr.aria-hidden]=\"true\" [attr.src]=\"imageUrl\" [alt]=\"\" (error)=\"handleImageError()\" />\n }\n @if (!imageUrl && !name) {\n <ui-icon\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n }\n @if (allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)) {\n <div class=\"edit-avatar\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n }\n</div>\n",
|
|
246
|
+
styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}: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.smallMedium{width:36px;height:36px;font-size:14px}:host .avatar-container.medium{width:48px;height:48px;font-size:20px}:host .avatar-container.mediumLarge{width:64px;height:64px}:host .avatar-container.mediumLarge .initials{font-weight:700;font-size:20px;line-height:26px}: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%}:host .avatar-container.mediumLarge .edit-avatar{width:24px;height:24px;right:-2px;bottom:-2px}:host .avatar-container[theme=dark],:host .avatar-container[theme=light]{background:#e9e9e9;color:#242424}:host .avatar-container[theme=dark] .edit-avatar,:host .avatar-container[theme=light] .edit-avatar{box-shadow:0 4px 16px #24242414;background:#fff}\n"]
|
|
247
|
+
}]
|
|
248
|
+
}],
|
|
249
|
+
ctorParameters: () => [{
|
|
250
|
+
type: void 0,
|
|
251
|
+
decorators: [{ type: Optional }, {
|
|
252
|
+
type: Inject,
|
|
253
|
+
args: ["CANOPYUI_DEFAULT_APPLICATION_THEME"]
|
|
254
|
+
}]
|
|
255
|
+
}],
|
|
256
|
+
propDecorators: {
|
|
257
|
+
size: [{ type: Input }],
|
|
258
|
+
imageUrl: [{ type: Input }],
|
|
259
|
+
name: [{ type: Input }],
|
|
260
|
+
tooltipText: [{ type: Input }],
|
|
261
|
+
allowEdit: [{ type: Input }],
|
|
262
|
+
applicationTheme: [{ type: Input }],
|
|
263
|
+
backgroundColor: [{ type: Input }],
|
|
264
|
+
editClick: [{ type: Output }]
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
var AvatarComponentModule = class AvatarComponentModule {
|
|
268
|
+
static {
|
|
269
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
270
|
+
minVersion: "12.0.0",
|
|
271
|
+
version: "22.2.4",
|
|
272
|
+
ngImport: i0,
|
|
273
|
+
type: AvatarComponentModule,
|
|
274
|
+
deps: [],
|
|
275
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
static {
|
|
279
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
280
|
+
minVersion: "14.0.0",
|
|
281
|
+
version: "22.2.4",
|
|
282
|
+
ngImport: i0,
|
|
283
|
+
type: AvatarComponentModule,
|
|
284
|
+
imports: [
|
|
285
|
+
CommonModule,
|
|
286
|
+
IconComponentModule,
|
|
287
|
+
MatTooltipModule,
|
|
288
|
+
ButtonComponentModule,
|
|
289
|
+
UiTranslatePipe,
|
|
290
|
+
AvatarComponent,
|
|
291
|
+
NameInitialsPipe
|
|
292
|
+
],
|
|
293
|
+
exports: [AvatarComponent]
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
static {
|
|
297
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
298
|
+
minVersion: "12.0.0",
|
|
299
|
+
version: "22.2.4",
|
|
300
|
+
ngImport: i0,
|
|
301
|
+
type: AvatarComponentModule,
|
|
302
|
+
imports: [
|
|
303
|
+
CommonModule,
|
|
304
|
+
IconComponentModule,
|
|
305
|
+
MatTooltipModule,
|
|
306
|
+
ButtonComponentModule,
|
|
307
|
+
AvatarComponent
|
|
308
|
+
]
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
313
|
+
minVersion: "12.0.0",
|
|
314
|
+
version: "22.2.4",
|
|
315
|
+
ngImport: i0,
|
|
316
|
+
type: AvatarComponentModule,
|
|
317
|
+
decorators: [{
|
|
318
|
+
type: NgModule,
|
|
319
|
+
args: [{
|
|
320
|
+
imports: [
|
|
321
|
+
CommonModule,
|
|
322
|
+
IconComponentModule,
|
|
323
|
+
MatTooltipModule,
|
|
324
|
+
ButtonComponentModule,
|
|
325
|
+
UiTranslatePipe,
|
|
326
|
+
AvatarComponent,
|
|
327
|
+
NameInitialsPipe
|
|
328
|
+
],
|
|
329
|
+
exports: [AvatarComponent]
|
|
330
|
+
}]
|
|
331
|
+
}]
|
|
332
|
+
});
|
|
188
333
|
export { AvatarBackgroundColor, AvatarComponent, AvatarComponentModule, AvatarSize, iconSize };
|
|
189
|
-
|
|
334
|
+
|
|
335
|
+
//# sourceMappingURL=testgorilla-tgo-ui-components-avatar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-avatar.mjs","sources":["../../../components/avatar/avatar.model.ts","../../../components/avatar/name-initials.pipe.ts","../../../components/avatar/avatar.component.ts","../../../components/avatar/avatar.component.html","../../../components/avatar/avatar.component.module.ts","../../../components/avatar/testgorilla-tgo-ui-components-avatar.ts"],"sourcesContent":["import { IconSize } from '@testgorilla/tgo-ui/components/icon';\n\nexport enum AvatarSize {\n SMALL = 'small',\n SMALL_MEDIUM = 'smallMedium',\n MEDIUM = 'medium',\n MEDIUM_LARGE = 'mediumLarge',\n LARGE = 'large',\n}\n\nexport type AvatarSizeType = `${AvatarSize}`;\n\nexport const iconSize: Record<string, IconSize> = {\n small: '16',\n medium: '24',\n large: '80',\n};\n\nexport enum AvatarBackgroundColor {\n PINK = '#FFE6FA',\n BLUE = '#D9E8FF',\n GREEN = '#D4F2C3',\n ORANGE = '#FFE1B3',\n RED = '#FFAC9A',\n}\n\nexport type BackgroundAvatarColorType = 'red' | 'blue' | 'green' | 'orange' | 'pink';\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'nameInitials' })\nexport class NameInitialsPipe implements PipeTransform {\n transform(value: string): string {\n const initials = value.split(' ').filter(Boolean);\n if (initials.length > 1) {\n return initials\n .map((initial, i) => (i === 0 || i === initials.length - 1 ? initial[0].toUpperCase() : ''))\n .join('');\n } else {\n const firstLetters = value.substring(0, 2);\n return `${firstLetters[0]?.toUpperCase() ?? ''}${firstLetters[1]?.toLowerCase() ?? ''}`;\n }\n }\n}\n","import { NgClass, NgStyle, AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, Optional, Output } from '@angular/core';\n\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { ApplicationTheme, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\n\nimport { AvatarBackgroundColor, AvatarSize, AvatarSizeType, BackgroundAvatarColorType, iconSize } from './avatar.model';\nimport { NameInitialsPipe } from './name-initials.pipe';\n\n@Component({\n selector: 'ui-avatar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n imports: [NgClass, NgStyle, IconComponentModule, ButtonComponentModule, AsyncPipe, UiTranslatePipe, NameInitialsPipe],\n})\nexport class AvatarComponent {\n /**\n * Input property for specifying the size of the avatar.\n * @type {AvatarSize}\n * @default AvatarSize.SMALL\n * @memberof AvatarComponent\n */\n @Input() size: AvatarSizeType = AvatarSize.SMALL;\n /**\n * Input property for specifying the URL of the image to display in the avatar.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() imageUrl = '';\n\n /**\n * Input property for specifying the initials to display in the avatar.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() name = '';\n\n /**\n * Input property for specifying the tooltip text for edit.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() tooltipText = '';\n\n /**\n * Input property that makes avatar editable.\n * @type {boolean}\n * @memberof AvatarComponent\n */\n @Input() allowEdit = false;\n\n /**\n *\n * Defines the application theme where\n *\n * @type {ApplicationTheme}\n * @memberof AvatarComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n *\n * Defines the background color\n *\n * @type {BackgroundAvatarColorType}\n * @memberof AvatarComponent\n */\n @Input() set backgroundColor(colorName: BackgroundAvatarColorType) {\n this.backgroundAvatarColor = AvatarBackgroundColor[colorName.toUpperCase() as keyof typeof AvatarBackgroundColor];\n }\n\n /**\n * Event emitted when the edit button is clicked.\n * @type {Event}\n * @memberof AvatarComponent\n */\n @Output() editClick = new EventEmitter<Event>();\n\n protected backgroundAvatarColor: string;\n protected readonly iconSize = iconSize;\n protected readonly avatarSize = AvatarSize;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n protected handleImageError(): void {\n this.imageUrl = '';\n }\n\n protected onEditClick(event: Event): void {\n this.editClick.emit(event);\n }\n}\n","<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n @if (name && !imageUrl) {\n <span class=\"initials\">\n {{ name | nameInitials }}\n </span>\n }\n @if (imageUrl) {\n <img [attr.aria-hidden]=\"true\" [attr.src]=\"imageUrl\" [alt]=\"\" (error)=\"handleImageError()\" />\n }\n @if (!imageUrl && !name) {\n <ui-icon\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n }\n @if (allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)) {\n <div class=\"edit-avatar\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\n\nimport { AvatarComponent } from './avatar.component';\nimport { NameInitialsPipe } from './name-initials.pipe';\n\n@NgModule({\n imports: [\n CommonModule,\n IconComponentModule,\n MatTooltipModule,\n ButtonComponentModule,\n UiTranslatePipe,\n AvatarComponent,\n NameInitialsPipe,\n ],\n exports: [AvatarComponent],\n})\nexport class AvatarComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;IAEY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACpB,IAAA,U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AChB,qBAAqB;wBACrB,eAAe;wBACf,eAAe;wBACf,gBAAgB;AACjB,qBAAA;oBACD,OAAO,EAAE,CAAC,eAAe,CAAC;AAC3B,iBAAA;;;ACtBD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui-components-avatar.mjs","names":[],"sources":["../../../components/avatar/avatar.model.ts","../../../components/avatar/name-initials.pipe.ts","../../../components/avatar/avatar.component.ts","../../../components/avatar/avatar.component.html","../../../components/avatar/avatar.component.module.ts"],"sourcesContent":["import { IconSize } from '@testgorilla/tgo-ui/components/icon';\n\nexport enum AvatarSize {\n SMALL = 'small',\n SMALL_MEDIUM = 'smallMedium',\n MEDIUM = 'medium',\n MEDIUM_LARGE = 'mediumLarge',\n LARGE = 'large',\n}\n\nexport type AvatarSizeType = `${AvatarSize}`;\n\nexport const iconSize: Record<string, IconSize> = {\n small: '16',\n medium: '24',\n large: '80',\n};\n\nexport enum AvatarBackgroundColor {\n PINK = '#FFE6FA',\n BLUE = '#D9E8FF',\n GREEN = '#D4F2C3',\n ORANGE = '#FFE1B3',\n RED = '#FFAC9A',\n}\n\nexport type BackgroundAvatarColorType = 'red' | 'blue' | 'green' | 'orange' | 'pink';\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'nameInitials' })\nexport class NameInitialsPipe implements PipeTransform {\n transform(value: string): string {\n const initials = value.split(' ').filter(Boolean);\n if (initials.length > 1) {\n return initials\n .map((initial, i) => (i === 0 || i === initials.length - 1 ? initial[0].toUpperCase() : ''))\n .join('');\n } else {\n const firstLetters = value.substring(0, 2);\n return `${firstLetters[0]?.toUpperCase() ?? ''}${firstLetters[1]?.toLowerCase() ?? ''}`;\n }\n }\n}\n","import { NgClass, NgStyle, AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, Optional, Output } from '@angular/core';\n\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { ApplicationTheme, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\n\nimport { AvatarBackgroundColor, AvatarSize, AvatarSizeType, BackgroundAvatarColorType, iconSize } from './avatar.model';\nimport { NameInitialsPipe } from './name-initials.pipe';\n\n@Component({\n selector: 'ui-avatar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './avatar.component.html',\n styleUrls: ['./avatar.component.scss'],\n imports: [NgClass, NgStyle, IconComponentModule, ButtonComponentModule, AsyncPipe, UiTranslatePipe, NameInitialsPipe],\n})\nexport class AvatarComponent {\n /**\n * Input property for specifying the size of the avatar.\n * @type {AvatarSize}\n * @default AvatarSize.SMALL\n * @memberof AvatarComponent\n */\n @Input() size: AvatarSizeType = AvatarSize.SMALL;\n /**\n * Input property for specifying the URL of the image to display in the avatar.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() imageUrl = '';\n\n /**\n * Input property for specifying the initials to display in the avatar.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() name = '';\n\n /**\n * Input property for specifying the tooltip text for edit.\n * @type {string}\n * @memberof AvatarComponent\n */\n @Input() tooltipText = '';\n\n /**\n * Input property that makes avatar editable.\n * @type {boolean}\n * @memberof AvatarComponent\n */\n @Input() allowEdit = false;\n\n /**\n *\n * Defines the application theme where\n *\n * @type {ApplicationTheme}\n * @memberof AvatarComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n *\n * Defines the background color\n *\n * @type {BackgroundAvatarColorType}\n * @memberof AvatarComponent\n */\n @Input() set backgroundColor(colorName: BackgroundAvatarColorType) {\n this.backgroundAvatarColor = AvatarBackgroundColor[colorName.toUpperCase() as keyof typeof AvatarBackgroundColor];\n }\n\n /**\n * Event emitted when the edit button is clicked.\n * @type {Event}\n * @memberof AvatarComponent\n */\n @Output() editClick = new EventEmitter<Event>();\n\n protected backgroundAvatarColor: string;\n protected readonly iconSize = iconSize;\n protected readonly avatarSize = AvatarSize;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n protected handleImageError(): void {\n this.imageUrl = '';\n }\n\n protected onEditClick(event: Event): void {\n this.editClick.emit(event);\n }\n}\n","<div\n class=\"avatar-container\"\n [attr.type]=\"!imageUrl && !name ? 'icon' : 'initials'\"\n [ngClass]=\"[size]\"\n [attr.theme]=\"applicationTheme\"\n [ngStyle]=\"{ backgroundColor: backgroundAvatarColor }\"\n>\n @if (name && !imageUrl) {\n <span class=\"initials\">\n {{ name | nameInitials }}\n </span>\n }\n @if (imageUrl) {\n <img [attr.aria-hidden]=\"true\" [attr.src]=\"imageUrl\" [alt]=\"\" (error)=\"handleImageError()\" />\n }\n @if (!imageUrl && !name) {\n <ui-icon\n [attr.aria-hidden]=\"true\"\n [color]=\"applicationTheme === 'classic' ? 'dark' : 'rebrand-black'\"\n [applicationTheme]=\"applicationTheme\"\n [size]=\"iconSize[size]\"\n [name]=\"'User-profile'\"\n ></ui-icon>\n }\n @if (allowEdit && (size === avatarSize.LARGE || size === avatarSize.MEDIUM_LARGE)) {\n <div class=\"edit-avatar\">\n <ui-button\n [applicationTheme]=\"applicationTheme\"\n [companyColor]=\"'black'\"\n [size]=\"'small'\"\n [iconName]=\"'Edit'\"\n [variant]=\"'icon-button'\"\n [tooltip]=\"tooltipText\"\n [ariaLabel]=\"('AVATAR.EDIT_AVATAR' | uiTranslate | async)!\"\n (buttonClickEvent)=\"onEditClick($event)\"\n ></ui-button>\n </div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\n\nimport { AvatarComponent } from './avatar.component';\nimport { NameInitialsPipe } from './name-initials.pipe';\n\n@NgModule({\n imports: [\n CommonModule,\n IconComponentModule,\n MatTooltipModule,\n ButtonComponentModule,\n UiTranslatePipe,\n AvatarComponent,\n NameInitialsPipe,\n ],\n exports: [AvatarComponent],\n})\nexport class AvatarComponentModule {}\n"],"mappings":";;;;;;;;;AAEA,IAAY;CAAZ,SAAY,YAAU;CACpB,WAAA,WAAA;CACA,WAAA,kBAAA;CACA,WAAA,YAAA;CACA,WAAA,kBAAA;CACA,WAAA,WAAA;AACF,EAAA,CANY,eAAA,aAAU,CAAA,EAAA;AAUtB,MAAa,WAAqC;CAChD,OAAO;CACP,QAAQ;CACR,OAAO;AACR;AAED,IAAY;CAAZ,SAAY,uBAAqB;CAC/B,sBAAA,UAAA;CACA,sBAAA,UAAA;CACA,sBAAA,WAAA;CACA,sBAAA,YAAA;CACA,sBAAA,SAAA;AACF,EAAA,CANY,0BAAA,wBAAqB,CAAA,EAAA;ACfjC,IAAa,mBAAb,MAAa,iBAAgB;CAC3B,UAAU,OAAa;EACrB,MAAM,WAAW,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;EAChD,IAAI,SAAS,SAAS,GACpB,OAAO,SACJ,KAAK,SAAS,MAAO,MAAM,KAAK,MAAM,SAAS,SAAS,IAAI,QAAQ,EAAE,CAAC,YAAW,IAAK,EAAG,CAAC,CAC3F,KAAK,EAAE;OACL;GACL,MAAM,eAAe,MAAM,UAAU,GAAG,CAAC;GACzC,OAAO,GAAG,aAAa,EAAE,EAAE,YAAW,KAAM,KAAK,aAAa,EAAE,EAAE,YAAW,KAAM;EACrF;CACF;CAXW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAgB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAhB;EAAA,KAAA,QAAA,GAAA,gBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,U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