@tectra-ng/ui 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +26 -2
- package/amount/README.md +28 -0
- package/autocomplete/README.md +82 -0
- package/avatar/README.md +43 -0
- package/badge/README.md +19 -0
- package/button/README.md +46 -0
- package/button-group/README.md +8 -0
- package/card/README.md +30 -0
- package/cascade-select/README.md +49 -0
- package/checkbox/README.md +64 -0
- package/chip/README.md +38 -0
- package/chips-input/README.md +47 -0
- package/color-picker/README.md +43 -0
- package/confirm/README.md +46 -0
- package/country/README.md +23 -0
- package/country-select/README.md +39 -0
- package/dialog/README.md +84 -0
- package/divider/README.md +24 -0
- package/drawer/README.md +54 -0
- package/email-suggestion/README.md +20 -0
- package/fesm2022/tectra-ng-ui-amount.mjs +415 -0
- package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +730 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-avatar.mjs +670 -0
- package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-badge.mjs +191 -0
- package/fesm2022/tectra-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-button-group.mjs +50 -0
- package/fesm2022/tectra-ng-ui-button-group.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-button.mjs +725 -0
- package/fesm2022/tectra-ng-ui-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-card.mjs +210 -0
- package/fesm2022/tectra-ng-ui-card.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +887 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-checkbox.mjs +1150 -0
- package/fesm2022/tectra-ng-ui-checkbox.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-chip.mjs +344 -0
- package/fesm2022/tectra-ng-ui-chip.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-chips-input.mjs +649 -0
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-color-picker.mjs +828 -0
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-confirm.mjs +489 -0
- package/fesm2022/tectra-ng-ui-confirm.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-country-select.mjs +545 -0
- package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-country.mjs +313 -0
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-dialog.mjs +1539 -0
- package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-divider.mjs +194 -0
- package/fesm2022/tectra-ng-ui-divider.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-drawer.mjs +540 -0
- package/fesm2022/tectra-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs +341 -0
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-field.mjs +492 -0
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs +258 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-highlight-text.mjs +246 -0
- package/fesm2022/tectra-ng-ui-highlight-text.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-icon-field.mjs +478 -0
- package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs +113 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-mask.mjs +413 -0
- package/fesm2022/tectra-ng-ui-input-mask.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-number.mjs +1045 -0
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-otp.mjs +553 -0
- package/fesm2022/tectra-ng-ui-input-otp.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input.mjs +260 -0
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-key-filter.mjs +185 -0
- package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-knob.mjs +630 -0
- package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-label.mjs +271 -0
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-link.mjs +699 -0
- package/fesm2022/tectra-ng-ui-link.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-listbox.mjs +484 -0
- package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs +717 -0
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-menu.mjs +1484 -0
- package/fesm2022/tectra-ng-ui-menu.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-message.mjs +975 -0
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs +569 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs +345 -0
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-paginator.mjs +849 -0
- package/fesm2022/tectra-ng-ui-paginator.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-panel.mjs +317 -0
- package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-password-generator.mjs +292 -0
- package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-password.mjs +871 -0
- package/fesm2022/tectra-ng-ui-password.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-pill.mjs +361 -0
- package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-popover.mjs +742 -0
- package/fesm2022/tectra-ng-ui-popover.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-progress-bar.mjs +440 -0
- package/fesm2022/tectra-ng-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs +265 -0
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-radio-button.mjs +817 -0
- package/fesm2022/tectra-ng-ui-radio-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-rating.mjs +584 -0
- package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-select.mjs +2478 -0
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-skeleton.mjs +548 -0
- package/fesm2022/tectra-ng-ui-skeleton.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-slider.mjs +630 -0
- package/fesm2022/tectra-ng-ui-slider.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-speed-dial.mjs +669 -0
- package/fesm2022/tectra-ng-ui-speed-dial.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-split-button.mjs +614 -0
- package/fesm2022/tectra-ng-ui-split-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-status-icon.mjs +295 -0
- package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-table.mjs +5997 -0
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tag.mjs +422 -0
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs +482 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toast.mjs +668 -0
- package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toggle-button.mjs +416 -0
- package/fesm2022/tectra-ng-ui-toggle-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs +560 -0
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tooltip.mjs +835 -0
- package/fesm2022/tectra-ng-ui-tooltip.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs +986 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui.mjs +4 -0
- package/fesm2022/tectra-ng-ui.mjs.map +1 -0
- package/field/README.md +43 -0
- package/fieldset/README.md +36 -0
- package/highlight-text/README.md +20 -0
- package/icon-field/README.md +30 -0
- package/input/README.md +22 -0
- package/input-group/README.md +21 -0
- package/input-mask/README.md +30 -0
- package/input-number/README.md +61 -0
- package/input-otp/README.md +44 -0
- package/key-filter/README.md +31 -0
- package/knob/README.md +50 -0
- package/label/README.md +29 -0
- package/link/README.md +47 -0
- package/listbox/README.md +68 -0
- package/mention-textarea/README.md +47 -0
- package/menu/README.md +65 -0
- package/message/README.md +58 -0
- package/multiselect/README.md +85 -0
- package/overlay-badge/README.md +30 -0
- package/package.json +301 -3
- package/paginator/README.md +60 -0
- package/panel/README.md +45 -0
- package/password/README.md +60 -0
- package/password-generator/README.md +34 -0
- package/pill/README.md +42 -0
- package/popover/README.md +67 -0
- package/progress-bar/README.md +32 -0
- package/progress-spinner/README.md +22 -0
- package/radio-button/README.md +54 -0
- package/rating/README.md +49 -0
- package/select/README.md +78 -0
- package/skeleton/README.md +27 -0
- package/slider/README.md +48 -0
- package/speed-dial/README.md +49 -0
- package/split-button/README.md +45 -0
- package/status-icon/README.md +22 -0
- package/table/README.md +178 -0
- package/tag/README.md +42 -0
- package/textarea/README.md +37 -0
- package/toast/README.md +52 -0
- package/toggle-button/README.md +34 -0
- package/toggle-switch/README.md +49 -0
- package/tooltip/README.md +60 -0
- package/tree-select/README.md +49 -0
- package/types/tectra-ng-ui-amount.d.ts +135 -0
- package/types/tectra-ng-ui-amount.d.ts.map +1 -0
- package/types/tectra-ng-ui-autocomplete.d.ts +250 -0
- package/types/tectra-ng-ui-autocomplete.d.ts.map +1 -0
- package/types/tectra-ng-ui-avatar.d.ts +289 -0
- package/types/tectra-ng-ui-avatar.d.ts.map +1 -0
- package/types/tectra-ng-ui-badge.d.ts +119 -0
- package/types/tectra-ng-ui-badge.d.ts.map +1 -0
- package/types/tectra-ng-ui-button-group.d.ts +6 -0
- package/types/tectra-ng-ui-button-group.d.ts.map +1 -0
- package/types/tectra-ng-ui-button.d.ts +466 -0
- package/types/tectra-ng-ui-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-card.d.ts +71 -0
- package/types/tectra-ng-ui-card.d.ts.map +1 -0
- package/types/tectra-ng-ui-cascade-select.d.ts +244 -0
- package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-checkbox.d.ts +450 -0
- package/types/tectra-ng-ui-checkbox.d.ts.map +1 -0
- package/types/tectra-ng-ui-chip.d.ts +106 -0
- package/types/tectra-ng-ui-chip.d.ts.map +1 -0
- package/types/tectra-ng-ui-chips-input.d.ts +187 -0
- package/types/tectra-ng-ui-chips-input.d.ts.map +1 -0
- package/types/tectra-ng-ui-color-picker.d.ts +237 -0
- package/types/tectra-ng-ui-color-picker.d.ts.map +1 -0
- package/types/tectra-ng-ui-confirm.d.ts +80 -0
- package/types/tectra-ng-ui-confirm.d.ts.map +1 -0
- package/types/tectra-ng-ui-country-select.d.ts +235 -0
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-country.d.ts +105 -0
- package/types/tectra-ng-ui-country.d.ts.map +1 -0
- package/types/tectra-ng-ui-dialog.d.ts +453 -0
- package/types/tectra-ng-ui-dialog.d.ts.map +1 -0
- package/types/tectra-ng-ui-divider.d.ts +70 -0
- package/types/tectra-ng-ui-divider.d.ts.map +1 -0
- package/types/tectra-ng-ui-drawer.d.ts +188 -0
- package/types/tectra-ng-ui-drawer.d.ts.map +1 -0
- package/types/tectra-ng-ui-email-suggestion.d.ts +84 -0
- package/types/tectra-ng-ui-email-suggestion.d.ts.map +1 -0
- package/types/tectra-ng-ui-field.d.ts +139 -0
- package/types/tectra-ng-ui-field.d.ts.map +1 -0
- package/types/tectra-ng-ui-fieldset.d.ts +74 -0
- package/types/tectra-ng-ui-fieldset.d.ts.map +1 -0
- package/types/tectra-ng-ui-highlight-text.d.ts +75 -0
- package/types/tectra-ng-ui-highlight-text.d.ts.map +1 -0
- package/types/tectra-ng-ui-icon-field.d.ts +77 -0
- package/types/tectra-ng-ui-icon-field.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-group.d.ts +18 -0
- package/types/tectra-ng-ui-input-group.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-mask.d.ts +91 -0
- package/types/tectra-ng-ui-input-mask.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-number.d.ts +326 -0
- package/types/tectra-ng-ui-input-number.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-otp.d.ts +173 -0
- package/types/tectra-ng-ui-input-otp.d.ts.map +1 -0
- package/types/tectra-ng-ui-input.d.ts +113 -0
- package/types/tectra-ng-ui-input.d.ts.map +1 -0
- package/types/tectra-ng-ui-key-filter.d.ts +43 -0
- package/types/tectra-ng-ui-key-filter.d.ts.map +1 -0
- package/types/tectra-ng-ui-knob.d.ts +207 -0
- package/types/tectra-ng-ui-knob.d.ts.map +1 -0
- package/types/tectra-ng-ui-label.d.ts +53 -0
- package/types/tectra-ng-ui-label.d.ts.map +1 -0
- package/types/tectra-ng-ui-link.d.ts +223 -0
- package/types/tectra-ng-ui-link.d.ts.map +1 -0
- package/types/tectra-ng-ui-listbox.d.ts +131 -0
- package/types/tectra-ng-ui-listbox.d.ts.map +1 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts +169 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -0
- package/types/tectra-ng-ui-menu.d.ts +512 -0
- package/types/tectra-ng-ui-menu.d.ts.map +1 -0
- package/types/tectra-ng-ui-message.d.ts +390 -0
- package/types/tectra-ng-ui-message.d.ts.map +1 -0
- package/types/tectra-ng-ui-multiselect.d.ts +216 -0
- package/types/tectra-ng-ui-multiselect.d.ts.map +1 -0
- package/types/tectra-ng-ui-overlay-badge.d.ts +104 -0
- package/types/tectra-ng-ui-overlay-badge.d.ts.map +1 -0
- package/types/tectra-ng-ui-paginator.d.ts +293 -0
- package/types/tectra-ng-ui-paginator.d.ts.map +1 -0
- package/types/tectra-ng-ui-panel.d.ts +133 -0
- package/types/tectra-ng-ui-panel.d.ts.map +1 -0
- package/types/tectra-ng-ui-password-generator.d.ts +80 -0
- package/types/tectra-ng-ui-password-generator.d.ts.map +1 -0
- package/types/tectra-ng-ui-password.d.ts +271 -0
- package/types/tectra-ng-ui-password.d.ts.map +1 -0
- package/types/tectra-ng-ui-pill.d.ts +167 -0
- package/types/tectra-ng-ui-pill.d.ts.map +1 -0
- package/types/tectra-ng-ui-popover.d.ts +244 -0
- package/types/tectra-ng-ui-popover.d.ts.map +1 -0
- package/types/tectra-ng-ui-progress-bar.d.ts +151 -0
- package/types/tectra-ng-ui-progress-bar.d.ts.map +1 -0
- package/types/tectra-ng-ui-progress-spinner.d.ts +95 -0
- package/types/tectra-ng-ui-progress-spinner.d.ts.map +1 -0
- package/types/tectra-ng-ui-radio-button.d.ts +380 -0
- package/types/tectra-ng-ui-radio-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-rating.d.ts +195 -0
- package/types/tectra-ng-ui-rating.d.ts.map +1 -0
- package/types/tectra-ng-ui-select.d.ts +761 -0
- package/types/tectra-ng-ui-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-skeleton.d.ts +182 -0
- package/types/tectra-ng-ui-skeleton.d.ts.map +1 -0
- package/types/tectra-ng-ui-slider.d.ts +220 -0
- package/types/tectra-ng-ui-slider.d.ts.map +1 -0
- package/types/tectra-ng-ui-speed-dial.d.ts +175 -0
- package/types/tectra-ng-ui-speed-dial.d.ts.map +1 -0
- package/types/tectra-ng-ui-split-button.d.ts +139 -0
- package/types/tectra-ng-ui-split-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-status-icon.d.ts +105 -0
- package/types/tectra-ng-ui-status-icon.d.ts.map +1 -0
- package/types/tectra-ng-ui-table.d.ts +1301 -0
- package/types/tectra-ng-ui-table.d.ts.map +1 -0
- package/types/tectra-ng-ui-tag.d.ts +157 -0
- package/types/tectra-ng-ui-tag.d.ts.map +1 -0
- package/types/tectra-ng-ui-textarea.d.ts +146 -0
- package/types/tectra-ng-ui-textarea.d.ts.map +1 -0
- package/types/tectra-ng-ui-toast.d.ts +268 -0
- package/types/tectra-ng-ui-toast.d.ts.map +1 -0
- package/types/tectra-ng-ui-toggle-button.d.ts +184 -0
- package/types/tectra-ng-ui-toggle-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts +226 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts.map +1 -0
- package/types/tectra-ng-ui-tooltip.d.ts +275 -0
- package/types/tectra-ng-ui-tooltip.d.ts.map +1 -0
- package/types/tectra-ng-ui-tree-select.d.ts +339 -0
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -0
- package/types/tectra-ng-ui.d.ts +2 -0
- package/types/tectra-ng-ui.d.ts.map +1 -0
|
@@ -0,0 +1,670 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, InjectionToken, computed, contentChildren, effect, inject, input, output, signal } from "@angular/core";
|
|
3
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
|
+
import { optionalBoolean, optionalNumber } from "@tectra-ng/core/utils";
|
|
5
|
+
import { TxIcon, TxIconRegistry } from "@tectra-ng/icons";
|
|
6
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
7
|
+
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
8
|
+
const TX_AVATAR_GROUP = new InjectionToken("TX_AVATAR_GROUP");
|
|
9
|
+
const TONES = [
|
|
10
|
+
"blue",
|
|
11
|
+
"green",
|
|
12
|
+
"sky",
|
|
13
|
+
"orange",
|
|
14
|
+
"purple",
|
|
15
|
+
"red"
|
|
16
|
+
];
|
|
17
|
+
var TxAvatar = class TxAvatar {
|
|
18
|
+
txIconRegistry = inject(TxIconRegistry);
|
|
19
|
+
group = inject(TX_AVATAR_GROUP, { optional: true });
|
|
20
|
+
image = input(void 0, ...ngDevMode ? [{ debugName: "image" }] : /* istanbul ignore next */ []);
|
|
21
|
+
name = input(void 0, ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
22
|
+
label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
23
|
+
icon = input("user", ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
24
|
+
size = input(void 0, ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
25
|
+
shape = input(void 0, ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
|
|
26
|
+
tone = input(void 0, ...ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []);
|
|
27
|
+
ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
28
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
29
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
30
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
31
|
+
unstyled = input(void 0, {
|
|
32
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
33
|
+
transform: optionalBoolean
|
|
34
|
+
});
|
|
35
|
+
imageError = output();
|
|
36
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
37
|
+
passThrough = injectPassThrough("avatar", this, this.pt, this.ptOptions);
|
|
38
|
+
failed = signal(false, ...ngDevMode ? [{ debugName: "failed" }] : /* istanbul ignore next */ []);
|
|
39
|
+
showImage = computed(() => !!this.image() && !this.failed(), ...ngDevMode ? [{ debugName: "showImage" }] : /* istanbul ignore next */ []);
|
|
40
|
+
initials = computed(() => this.label() ?? initialsOf(this.name()), ...ngDevMode ? [{ debugName: "initials" }] : /* istanbul ignore next */ []);
|
|
41
|
+
resolvedSize = computed(() => this.size() ?? this.group?.size() ?? "medium", ...ngDevMode ? [{ debugName: "resolvedSize" }] : /* istanbul ignore next */ []);
|
|
42
|
+
presetSize = computed(() => typeof this.resolvedSize() === "number" ? null : this.resolvedSize(), ...ngDevMode ? [{ debugName: "presetSize" }] : /* istanbul ignore next */ []);
|
|
43
|
+
resolvedShape = computed(() => this.shape() ?? this.group?.shape() ?? "circle", ...ngDevMode ? [{ debugName: "resolvedShape" }] : /* istanbul ignore next */ []);
|
|
44
|
+
resolvedTone = computed(() => this.tone() ?? (this.name() || this.label() ? TONES[hash(this.name() ?? this.label() ?? "") % TONES.length] : null), ...ngDevMode ? [{ debugName: "resolvedTone" }] : /* istanbul ignore next */ []);
|
|
45
|
+
accessibleName = computed(() => this.ariaLabel() ?? this.name() ?? null, ...ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []);
|
|
46
|
+
isHidden = computed(() => !!this.group?.isHidden(this), ...ngDevMode ? [{ debugName: "isHidden" }] : /* istanbul ignore next */ []);
|
|
47
|
+
iconName = computed(() => this.txIconRegistry.has(this.icon()) ? this.icon() : null, ...ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []);
|
|
48
|
+
hostStyle = computed(() => {
|
|
49
|
+
const size = this.resolvedSize();
|
|
50
|
+
return {
|
|
51
|
+
...toStyleObject(this.dt(), "--tx-avatar"),
|
|
52
|
+
...typeof size === "number" ? { "--tx-avatar-size": `${size}px` } : {},
|
|
53
|
+
...this.passThrough().root?.style
|
|
54
|
+
};
|
|
55
|
+
}, ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
56
|
+
constructor() {
|
|
57
|
+
effect(() => {
|
|
58
|
+
this.image();
|
|
59
|
+
this.failed.set(false);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
onImageError(event) {
|
|
63
|
+
this.failed.set(true);
|
|
64
|
+
this.imageError.emit(event);
|
|
65
|
+
}
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
67
|
+
minVersion: "12.0.0",
|
|
68
|
+
version: "22.2.3",
|
|
69
|
+
ngImport: i0,
|
|
70
|
+
type: TxAvatar,
|
|
71
|
+
deps: [],
|
|
72
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
73
|
+
});
|
|
74
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
75
|
+
minVersion: "17.0.0",
|
|
76
|
+
version: "22.2.3",
|
|
77
|
+
type: TxAvatar,
|
|
78
|
+
isStandalone: true,
|
|
79
|
+
selector: "tx-avatar",
|
|
80
|
+
inputs: {
|
|
81
|
+
image: {
|
|
82
|
+
classPropertyName: "image",
|
|
83
|
+
publicName: "image",
|
|
84
|
+
isSignal: true,
|
|
85
|
+
isRequired: false,
|
|
86
|
+
transformFunction: null
|
|
87
|
+
},
|
|
88
|
+
name: {
|
|
89
|
+
classPropertyName: "name",
|
|
90
|
+
publicName: "name",
|
|
91
|
+
isSignal: true,
|
|
92
|
+
isRequired: false,
|
|
93
|
+
transformFunction: null
|
|
94
|
+
},
|
|
95
|
+
label: {
|
|
96
|
+
classPropertyName: "label",
|
|
97
|
+
publicName: "label",
|
|
98
|
+
isSignal: true,
|
|
99
|
+
isRequired: false,
|
|
100
|
+
transformFunction: null
|
|
101
|
+
},
|
|
102
|
+
icon: {
|
|
103
|
+
classPropertyName: "icon",
|
|
104
|
+
publicName: "icon",
|
|
105
|
+
isSignal: true,
|
|
106
|
+
isRequired: false,
|
|
107
|
+
transformFunction: null
|
|
108
|
+
},
|
|
109
|
+
size: {
|
|
110
|
+
classPropertyName: "size",
|
|
111
|
+
publicName: "size",
|
|
112
|
+
isSignal: true,
|
|
113
|
+
isRequired: false,
|
|
114
|
+
transformFunction: null
|
|
115
|
+
},
|
|
116
|
+
shape: {
|
|
117
|
+
classPropertyName: "shape",
|
|
118
|
+
publicName: "shape",
|
|
119
|
+
isSignal: true,
|
|
120
|
+
isRequired: false,
|
|
121
|
+
transformFunction: null
|
|
122
|
+
},
|
|
123
|
+
tone: {
|
|
124
|
+
classPropertyName: "tone",
|
|
125
|
+
publicName: "tone",
|
|
126
|
+
isSignal: true,
|
|
127
|
+
isRequired: false,
|
|
128
|
+
transformFunction: null
|
|
129
|
+
},
|
|
130
|
+
ariaLabel: {
|
|
131
|
+
classPropertyName: "ariaLabel",
|
|
132
|
+
publicName: "ariaLabel",
|
|
133
|
+
isSignal: true,
|
|
134
|
+
isRequired: false,
|
|
135
|
+
transformFunction: null
|
|
136
|
+
},
|
|
137
|
+
dt: {
|
|
138
|
+
classPropertyName: "dt",
|
|
139
|
+
publicName: "dt",
|
|
140
|
+
isSignal: true,
|
|
141
|
+
isRequired: false,
|
|
142
|
+
transformFunction: null
|
|
143
|
+
},
|
|
144
|
+
pt: {
|
|
145
|
+
classPropertyName: "pt",
|
|
146
|
+
publicName: "pt",
|
|
147
|
+
isSignal: true,
|
|
148
|
+
isRequired: false,
|
|
149
|
+
transformFunction: null
|
|
150
|
+
},
|
|
151
|
+
ptOptions: {
|
|
152
|
+
classPropertyName: "ptOptions",
|
|
153
|
+
publicName: "ptOptions",
|
|
154
|
+
isSignal: true,
|
|
155
|
+
isRequired: false,
|
|
156
|
+
transformFunction: null
|
|
157
|
+
},
|
|
158
|
+
unstyled: {
|
|
159
|
+
classPropertyName: "unstyled",
|
|
160
|
+
publicName: "unstyled",
|
|
161
|
+
isSignal: true,
|
|
162
|
+
isRequired: false,
|
|
163
|
+
transformFunction: null
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
outputs: { imageError: "imageError" },
|
|
167
|
+
host: {
|
|
168
|
+
properties: {
|
|
169
|
+
"class": "passThrough().root?.class",
|
|
170
|
+
"style": "hostStyle()",
|
|
171
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
172
|
+
"attr.data-size": "presetSize()",
|
|
173
|
+
"attr.data-shape": "resolvedShape()",
|
|
174
|
+
"attr.data-tone": "showImage() ? null : resolvedTone()",
|
|
175
|
+
"attr.role": "accessibleName() ? \"img\" : null",
|
|
176
|
+
"attr.aria-label": "accessibleName()",
|
|
177
|
+
"attr.aria-hidden": "accessibleName() ? null : true",
|
|
178
|
+
"attr.title": "name() ?? null",
|
|
179
|
+
"hidden": "isHidden()"
|
|
180
|
+
},
|
|
181
|
+
classAttribute: "tx-avatar"
|
|
182
|
+
},
|
|
183
|
+
ngImport: i0,
|
|
184
|
+
template: `
|
|
185
|
+
@if (showImage()) {
|
|
186
|
+
<img class="tx-avatar__image" alt="" [src]="image()" [class]="passThrough().image?.class" [style]="passThrough().image?.style" (error)="onImageError($event)" />
|
|
187
|
+
} @else if (initials(); as text) {
|
|
188
|
+
<span class="tx-avatar__label" aria-hidden="true" [class]="passThrough().label?.class" [style]="passThrough().label?.style">{{ text }}</span>
|
|
189
|
+
} @else {
|
|
190
|
+
<span class="tx-avatar__icon" aria-hidden="true" [class]="passThrough().icon?.class" [style]="passThrough().icon?.style">
|
|
191
|
+
@if (iconName(); as name) {
|
|
192
|
+
<tx-icon [name]="name" />
|
|
193
|
+
} @else {
|
|
194
|
+
<span [class]="icon()"></span>
|
|
195
|
+
}
|
|
196
|
+
</span>
|
|
197
|
+
}
|
|
198
|
+
<ng-content />
|
|
199
|
+
`,
|
|
200
|
+
isInline: true,
|
|
201
|
+
styles: [":host{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;vertical-align:middle}:host([hidden]){display:none}.tx-avatar__image{width:100%;height:100%;border-radius:inherit;object-fit:cover}.tx-avatar__icon{display:inline-flex}:host([data-styled]){--_size: var(--tx-avatar-size);width:var(--_size);height:var(--_size);border-radius:50%;background:var(--tx-avatar-background);color:var(--tx-avatar-color);font-family:var(--tx-font-family);font-size:calc(var(--_size) * var(--tx-avatar-font-scale));font-weight:var(--tx-avatar-font-weight);line-height:1;-webkit-user-select:none;user-select:none}:host([data-styled][data-size=small]){--_size: var(--tx-avatar-sm-size)}:host([data-styled][data-size=large]){--_size: var(--tx-avatar-lg-size)}:host([data-styled][data-size=xlarge]){--_size: var(--tx-avatar-xl-size)}:host([data-styled][data-shape=square]){border-radius:var(--tx-avatar-square-border-radius)}:host([data-styled][data-tone=blue]){background:var(--tx-avatar-tones-blue-background);color:var(--tx-avatar-tones-blue-color)}:host([data-styled][data-tone=green]){background:var(--tx-avatar-tones-green-background);color:var(--tx-avatar-tones-green-color)}:host([data-styled][data-tone=sky]){background:var(--tx-avatar-tones-sky-background);color:var(--tx-avatar-tones-sky-color)}:host([data-styled][data-tone=orange]){background:var(--tx-avatar-tones-orange-background);color:var(--tx-avatar-tones-orange-color)}:host([data-styled][data-tone=purple]){background:var(--tx-avatar-tones-purple-background);color:var(--tx-avatar-tones-purple-color)}:host([data-styled][data-tone=red]){background:var(--tx-avatar-tones-red-background);color:var(--tx-avatar-tones-red-color)}:host([data-styled]) .tx-avatar__icon{font-size:calc(var(--_size) * var(--tx-avatar-icon-scale))}\n"],
|
|
202
|
+
dependencies: [{
|
|
203
|
+
kind: "component",
|
|
204
|
+
type: TxIcon,
|
|
205
|
+
selector: "tx-icon",
|
|
206
|
+
inputs: ["name"]
|
|
207
|
+
}],
|
|
208
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
212
|
+
minVersion: "12.0.0",
|
|
213
|
+
version: "22.2.3",
|
|
214
|
+
ngImport: i0,
|
|
215
|
+
type: TxAvatar,
|
|
216
|
+
decorators: [{
|
|
217
|
+
type: Component,
|
|
218
|
+
args: [{
|
|
219
|
+
selector: "tx-avatar",
|
|
220
|
+
imports: [TxIcon],
|
|
221
|
+
template: `
|
|
222
|
+
@if (showImage()) {
|
|
223
|
+
<img class="tx-avatar__image" alt="" [src]="image()" [class]="passThrough().image?.class" [style]="passThrough().image?.style" (error)="onImageError($event)" />
|
|
224
|
+
} @else if (initials(); as text) {
|
|
225
|
+
<span class="tx-avatar__label" aria-hidden="true" [class]="passThrough().label?.class" [style]="passThrough().label?.style">{{ text }}</span>
|
|
226
|
+
} @else {
|
|
227
|
+
<span class="tx-avatar__icon" aria-hidden="true" [class]="passThrough().icon?.class" [style]="passThrough().icon?.style">
|
|
228
|
+
@if (iconName(); as name) {
|
|
229
|
+
<tx-icon [name]="name" />
|
|
230
|
+
} @else {
|
|
231
|
+
<span [class]="icon()"></span>
|
|
232
|
+
}
|
|
233
|
+
</span>
|
|
234
|
+
}
|
|
235
|
+
<ng-content />
|
|
236
|
+
`,
|
|
237
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
238
|
+
host: {
|
|
239
|
+
class: "tx-avatar",
|
|
240
|
+
"[class]": "passThrough().root?.class",
|
|
241
|
+
"[style]": "hostStyle()",
|
|
242
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
243
|
+
"[attr.data-size]": "presetSize()",
|
|
244
|
+
"[attr.data-shape]": "resolvedShape()",
|
|
245
|
+
"[attr.data-tone]": "showImage() ? null : resolvedTone()",
|
|
246
|
+
"[attr.role]": "accessibleName() ? \"img\" : null",
|
|
247
|
+
"[attr.aria-label]": "accessibleName()",
|
|
248
|
+
"[attr.aria-hidden]": "accessibleName() ? null : true",
|
|
249
|
+
"[attr.title]": "name() ?? null",
|
|
250
|
+
"[hidden]": "isHidden()"
|
|
251
|
+
},
|
|
252
|
+
styles: [":host{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;vertical-align:middle}:host([hidden]){display:none}.tx-avatar__image{width:100%;height:100%;border-radius:inherit;object-fit:cover}.tx-avatar__icon{display:inline-flex}:host([data-styled]){--_size: var(--tx-avatar-size);width:var(--_size);height:var(--_size);border-radius:50%;background:var(--tx-avatar-background);color:var(--tx-avatar-color);font-family:var(--tx-font-family);font-size:calc(var(--_size) * var(--tx-avatar-font-scale));font-weight:var(--tx-avatar-font-weight);line-height:1;-webkit-user-select:none;user-select:none}:host([data-styled][data-size=small]){--_size: var(--tx-avatar-sm-size)}:host([data-styled][data-size=large]){--_size: var(--tx-avatar-lg-size)}:host([data-styled][data-size=xlarge]){--_size: var(--tx-avatar-xl-size)}:host([data-styled][data-shape=square]){border-radius:var(--tx-avatar-square-border-radius)}:host([data-styled][data-tone=blue]){background:var(--tx-avatar-tones-blue-background);color:var(--tx-avatar-tones-blue-color)}:host([data-styled][data-tone=green]){background:var(--tx-avatar-tones-green-background);color:var(--tx-avatar-tones-green-color)}:host([data-styled][data-tone=sky]){background:var(--tx-avatar-tones-sky-background);color:var(--tx-avatar-tones-sky-color)}:host([data-styled][data-tone=orange]){background:var(--tx-avatar-tones-orange-background);color:var(--tx-avatar-tones-orange-color)}:host([data-styled][data-tone=purple]){background:var(--tx-avatar-tones-purple-background);color:var(--tx-avatar-tones-purple-color)}:host([data-styled][data-tone=red]){background:var(--tx-avatar-tones-red-background);color:var(--tx-avatar-tones-red-color)}:host([data-styled]) .tx-avatar__icon{font-size:calc(var(--_size) * var(--tx-avatar-icon-scale))}\n"]
|
|
253
|
+
}]
|
|
254
|
+
}],
|
|
255
|
+
ctorParameters: () => [],
|
|
256
|
+
propDecorators: {
|
|
257
|
+
image: [{
|
|
258
|
+
type: i0.Input,
|
|
259
|
+
args: [{
|
|
260
|
+
isSignal: true,
|
|
261
|
+
alias: "image",
|
|
262
|
+
required: false
|
|
263
|
+
}]
|
|
264
|
+
}],
|
|
265
|
+
name: [{
|
|
266
|
+
type: i0.Input,
|
|
267
|
+
args: [{
|
|
268
|
+
isSignal: true,
|
|
269
|
+
alias: "name",
|
|
270
|
+
required: false
|
|
271
|
+
}]
|
|
272
|
+
}],
|
|
273
|
+
label: [{
|
|
274
|
+
type: i0.Input,
|
|
275
|
+
args: [{
|
|
276
|
+
isSignal: true,
|
|
277
|
+
alias: "label",
|
|
278
|
+
required: false
|
|
279
|
+
}]
|
|
280
|
+
}],
|
|
281
|
+
icon: [{
|
|
282
|
+
type: i0.Input,
|
|
283
|
+
args: [{
|
|
284
|
+
isSignal: true,
|
|
285
|
+
alias: "icon",
|
|
286
|
+
required: false
|
|
287
|
+
}]
|
|
288
|
+
}],
|
|
289
|
+
size: [{
|
|
290
|
+
type: i0.Input,
|
|
291
|
+
args: [{
|
|
292
|
+
isSignal: true,
|
|
293
|
+
alias: "size",
|
|
294
|
+
required: false
|
|
295
|
+
}]
|
|
296
|
+
}],
|
|
297
|
+
shape: [{
|
|
298
|
+
type: i0.Input,
|
|
299
|
+
args: [{
|
|
300
|
+
isSignal: true,
|
|
301
|
+
alias: "shape",
|
|
302
|
+
required: false
|
|
303
|
+
}]
|
|
304
|
+
}],
|
|
305
|
+
tone: [{
|
|
306
|
+
type: i0.Input,
|
|
307
|
+
args: [{
|
|
308
|
+
isSignal: true,
|
|
309
|
+
alias: "tone",
|
|
310
|
+
required: false
|
|
311
|
+
}]
|
|
312
|
+
}],
|
|
313
|
+
ariaLabel: [{
|
|
314
|
+
type: i0.Input,
|
|
315
|
+
args: [{
|
|
316
|
+
isSignal: true,
|
|
317
|
+
alias: "ariaLabel",
|
|
318
|
+
required: false
|
|
319
|
+
}]
|
|
320
|
+
}],
|
|
321
|
+
dt: [{
|
|
322
|
+
type: i0.Input,
|
|
323
|
+
args: [{
|
|
324
|
+
isSignal: true,
|
|
325
|
+
alias: "dt",
|
|
326
|
+
required: false
|
|
327
|
+
}]
|
|
328
|
+
}],
|
|
329
|
+
pt: [{
|
|
330
|
+
type: i0.Input,
|
|
331
|
+
args: [{
|
|
332
|
+
isSignal: true,
|
|
333
|
+
alias: "pt",
|
|
334
|
+
required: false
|
|
335
|
+
}]
|
|
336
|
+
}],
|
|
337
|
+
ptOptions: [{
|
|
338
|
+
type: i0.Input,
|
|
339
|
+
args: [{
|
|
340
|
+
isSignal: true,
|
|
341
|
+
alias: "ptOptions",
|
|
342
|
+
required: false
|
|
343
|
+
}]
|
|
344
|
+
}],
|
|
345
|
+
unstyled: [{
|
|
346
|
+
type: i0.Input,
|
|
347
|
+
args: [{
|
|
348
|
+
isSignal: true,
|
|
349
|
+
alias: "unstyled",
|
|
350
|
+
required: false
|
|
351
|
+
}]
|
|
352
|
+
}],
|
|
353
|
+
imageError: [{
|
|
354
|
+
type: i0.Output,
|
|
355
|
+
args: ["imageError"]
|
|
356
|
+
}]
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
function initialsOf(name) {
|
|
360
|
+
const words = (name ?? "").trim().split(/[\s._@-]+/).filter(Boolean);
|
|
361
|
+
if (!words.length) return "";
|
|
362
|
+
return ((Array.from(words[0])[0] ?? "") + (words.length > 1 ? Array.from(words[words.length - 1])[0] ?? "" : "")).toUpperCase();
|
|
363
|
+
}
|
|
364
|
+
function hash(text) {
|
|
365
|
+
let value = 0;
|
|
366
|
+
for (const char of text) value = value * 31 + (char.codePointAt(0) ?? 0) >>> 0;
|
|
367
|
+
return value;
|
|
368
|
+
}
|
|
369
|
+
var TxAvatarGroup = class TxAvatarGroup {
|
|
370
|
+
max = input(void 0, {
|
|
371
|
+
...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
|
|
372
|
+
transform: optionalNumber
|
|
373
|
+
});
|
|
374
|
+
size = input(void 0, ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
375
|
+
shape = input(void 0, ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
|
|
376
|
+
ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
377
|
+
moreLabel = input(void 0, ...ngDevMode ? [{ debugName: "moreLabel" }] : /* istanbul ignore next */ []);
|
|
378
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
379
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
380
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
381
|
+
unstyled = input(void 0, {
|
|
382
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
383
|
+
transform: optionalBoolean
|
|
384
|
+
});
|
|
385
|
+
avatars = contentChildren(TxAvatar, ...ngDevMode ? [{ debugName: "avatars" }] : /* istanbul ignore next */ []);
|
|
386
|
+
translations = injectTranslations();
|
|
387
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
388
|
+
passThrough = injectPassThrough("avatarGroup", this, this.pt, this.ptOptions);
|
|
389
|
+
extra = computed(() => {
|
|
390
|
+
const max = this.max();
|
|
391
|
+
return max !== void 0 ? Math.max(0, this.avatars().length - max) : 0;
|
|
392
|
+
}, ...ngDevMode ? [{ debugName: "extra" }] : /* istanbul ignore next */ []);
|
|
393
|
+
hostStyle = computed(() => {
|
|
394
|
+
const size = this.size();
|
|
395
|
+
return {
|
|
396
|
+
...toStyleObject(this.dt(), "--tx-avatar"),
|
|
397
|
+
"--_overlap": `var(--tx-avatar-group-overlap)`,
|
|
398
|
+
...typeof size === "number" ? { "--tx-avatar-size": `${size}px` } : {},
|
|
399
|
+
...this.passThrough().root?.style
|
|
400
|
+
};
|
|
401
|
+
}, ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
402
|
+
context = {
|
|
403
|
+
size: this.size,
|
|
404
|
+
shape: this.shape,
|
|
405
|
+
isHidden: (avatar) => {
|
|
406
|
+
const max = this.max();
|
|
407
|
+
const index = this.avatars().indexOf(avatar);
|
|
408
|
+
return max !== void 0 && index >= max;
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
412
|
+
minVersion: "12.0.0",
|
|
413
|
+
version: "22.2.3",
|
|
414
|
+
ngImport: i0,
|
|
415
|
+
type: TxAvatarGroup,
|
|
416
|
+
deps: [],
|
|
417
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
418
|
+
});
|
|
419
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
420
|
+
minVersion: "17.0.0",
|
|
421
|
+
version: "22.2.3",
|
|
422
|
+
type: TxAvatarGroup,
|
|
423
|
+
isStandalone: true,
|
|
424
|
+
selector: "tx-avatar-group",
|
|
425
|
+
inputs: {
|
|
426
|
+
max: {
|
|
427
|
+
classPropertyName: "max",
|
|
428
|
+
publicName: "max",
|
|
429
|
+
isSignal: true,
|
|
430
|
+
isRequired: false,
|
|
431
|
+
transformFunction: null
|
|
432
|
+
},
|
|
433
|
+
size: {
|
|
434
|
+
classPropertyName: "size",
|
|
435
|
+
publicName: "size",
|
|
436
|
+
isSignal: true,
|
|
437
|
+
isRequired: false,
|
|
438
|
+
transformFunction: null
|
|
439
|
+
},
|
|
440
|
+
shape: {
|
|
441
|
+
classPropertyName: "shape",
|
|
442
|
+
publicName: "shape",
|
|
443
|
+
isSignal: true,
|
|
444
|
+
isRequired: false,
|
|
445
|
+
transformFunction: null
|
|
446
|
+
},
|
|
447
|
+
ariaLabel: {
|
|
448
|
+
classPropertyName: "ariaLabel",
|
|
449
|
+
publicName: "ariaLabel",
|
|
450
|
+
isSignal: true,
|
|
451
|
+
isRequired: false,
|
|
452
|
+
transformFunction: null
|
|
453
|
+
},
|
|
454
|
+
moreLabel: {
|
|
455
|
+
classPropertyName: "moreLabel",
|
|
456
|
+
publicName: "moreLabel",
|
|
457
|
+
isSignal: true,
|
|
458
|
+
isRequired: false,
|
|
459
|
+
transformFunction: null
|
|
460
|
+
},
|
|
461
|
+
dt: {
|
|
462
|
+
classPropertyName: "dt",
|
|
463
|
+
publicName: "dt",
|
|
464
|
+
isSignal: true,
|
|
465
|
+
isRequired: false,
|
|
466
|
+
transformFunction: null
|
|
467
|
+
},
|
|
468
|
+
pt: {
|
|
469
|
+
classPropertyName: "pt",
|
|
470
|
+
publicName: "pt",
|
|
471
|
+
isSignal: true,
|
|
472
|
+
isRequired: false,
|
|
473
|
+
transformFunction: null
|
|
474
|
+
},
|
|
475
|
+
ptOptions: {
|
|
476
|
+
classPropertyName: "ptOptions",
|
|
477
|
+
publicName: "ptOptions",
|
|
478
|
+
isSignal: true,
|
|
479
|
+
isRequired: false,
|
|
480
|
+
transformFunction: null
|
|
481
|
+
},
|
|
482
|
+
unstyled: {
|
|
483
|
+
classPropertyName: "unstyled",
|
|
484
|
+
publicName: "unstyled",
|
|
485
|
+
isSignal: true,
|
|
486
|
+
isRequired: false,
|
|
487
|
+
transformFunction: null
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
host: {
|
|
491
|
+
attributes: { "role": "group" },
|
|
492
|
+
properties: {
|
|
493
|
+
"class": "passThrough().root?.class",
|
|
494
|
+
"style": "hostStyle()",
|
|
495
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
496
|
+
"attr.aria-label": "ariaLabel() ?? null"
|
|
497
|
+
},
|
|
498
|
+
classAttribute: "tx-avatar-group"
|
|
499
|
+
},
|
|
500
|
+
providers: [{
|
|
501
|
+
provide: TX_AVATAR_GROUP,
|
|
502
|
+
useFactory: () => inject(TxAvatarGroup).context
|
|
503
|
+
}],
|
|
504
|
+
queries: [{
|
|
505
|
+
propertyName: "avatars",
|
|
506
|
+
predicate: TxAvatar,
|
|
507
|
+
isSignal: true
|
|
508
|
+
}],
|
|
509
|
+
ngImport: i0,
|
|
510
|
+
template: `
|
|
511
|
+
<ng-content />
|
|
512
|
+
@if (extra() > 0) {
|
|
513
|
+
<tx-avatar
|
|
514
|
+
class="tx-avatar-group__more"
|
|
515
|
+
[class]="passThrough().more?.class"
|
|
516
|
+
[style]="passThrough().more?.style"
|
|
517
|
+
[label]="'+' + extra()"
|
|
518
|
+
[ariaLabel]="moreLabel() ?? translations().moreItems.replace('{count}', '' + extra())"
|
|
519
|
+
[unstyled]="isUnstyled()"
|
|
520
|
+
/>
|
|
521
|
+
}
|
|
522
|
+
<ng-content select="[txAvatarGroupEnd]" />
|
|
523
|
+
`,
|
|
524
|
+
isInline: true,
|
|
525
|
+
styles: [":host{display:inline-flex;align-items:center}:host([data-styled]) ::ng-deep>tx-avatar{box-shadow:0 0 0 var(--tx-avatar-group-ring-width) var(--tx-avatar-group-ring-color)}:host([data-styled]) ::ng-deep>tx-avatar+tx-avatar{margin-inline-start:calc(var(--_size, var(--tx-avatar-size)) * var(--_overlap) * -1)}:host([data-styled]) ::ng-deep>[txAvatarGroupEnd]{margin-inline-start:6px}:host([data-styled]) .tx-avatar-group__more{background:var(--tx-avatar-group-more-background);color:var(--tx-avatar-group-more-color)}\n"],
|
|
526
|
+
dependencies: [{
|
|
527
|
+
kind: "component",
|
|
528
|
+
type: TxAvatar,
|
|
529
|
+
selector: "tx-avatar",
|
|
530
|
+
inputs: [
|
|
531
|
+
"image",
|
|
532
|
+
"name",
|
|
533
|
+
"label",
|
|
534
|
+
"icon",
|
|
535
|
+
"size",
|
|
536
|
+
"shape",
|
|
537
|
+
"tone",
|
|
538
|
+
"ariaLabel",
|
|
539
|
+
"dt",
|
|
540
|
+
"pt",
|
|
541
|
+
"ptOptions",
|
|
542
|
+
"unstyled"
|
|
543
|
+
],
|
|
544
|
+
outputs: ["imageError"]
|
|
545
|
+
}],
|
|
546
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
547
|
+
});
|
|
548
|
+
};
|
|
549
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
550
|
+
minVersion: "12.0.0",
|
|
551
|
+
version: "22.2.3",
|
|
552
|
+
ngImport: i0,
|
|
553
|
+
type: TxAvatarGroup,
|
|
554
|
+
decorators: [{
|
|
555
|
+
type: Component,
|
|
556
|
+
args: [{
|
|
557
|
+
selector: "tx-avatar-group",
|
|
558
|
+
imports: [TxAvatar],
|
|
559
|
+
template: `
|
|
560
|
+
<ng-content />
|
|
561
|
+
@if (extra() > 0) {
|
|
562
|
+
<tx-avatar
|
|
563
|
+
class="tx-avatar-group__more"
|
|
564
|
+
[class]="passThrough().more?.class"
|
|
565
|
+
[style]="passThrough().more?.style"
|
|
566
|
+
[label]="'+' + extra()"
|
|
567
|
+
[ariaLabel]="moreLabel() ?? translations().moreItems.replace('{count}', '' + extra())"
|
|
568
|
+
[unstyled]="isUnstyled()"
|
|
569
|
+
/>
|
|
570
|
+
}
|
|
571
|
+
<ng-content select="[txAvatarGroupEnd]" />
|
|
572
|
+
`,
|
|
573
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
574
|
+
providers: [{
|
|
575
|
+
provide: TX_AVATAR_GROUP,
|
|
576
|
+
useFactory: () => inject(TxAvatarGroup).context
|
|
577
|
+
}],
|
|
578
|
+
host: {
|
|
579
|
+
class: "tx-avatar-group",
|
|
580
|
+
role: "group",
|
|
581
|
+
"[class]": "passThrough().root?.class",
|
|
582
|
+
"[style]": "hostStyle()",
|
|
583
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
584
|
+
"[attr.aria-label]": "ariaLabel() ?? null"
|
|
585
|
+
},
|
|
586
|
+
styles: [":host{display:inline-flex;align-items:center}:host([data-styled]) ::ng-deep>tx-avatar{box-shadow:0 0 0 var(--tx-avatar-group-ring-width) var(--tx-avatar-group-ring-color)}:host([data-styled]) ::ng-deep>tx-avatar+tx-avatar{margin-inline-start:calc(var(--_size, var(--tx-avatar-size)) * var(--_overlap) * -1)}:host([data-styled]) ::ng-deep>[txAvatarGroupEnd]{margin-inline-start:6px}:host([data-styled]) .tx-avatar-group__more{background:var(--tx-avatar-group-more-background);color:var(--tx-avatar-group-more-color)}\n"]
|
|
587
|
+
}]
|
|
588
|
+
}],
|
|
589
|
+
propDecorators: {
|
|
590
|
+
max: [{
|
|
591
|
+
type: i0.Input,
|
|
592
|
+
args: [{
|
|
593
|
+
isSignal: true,
|
|
594
|
+
alias: "max",
|
|
595
|
+
required: false
|
|
596
|
+
}]
|
|
597
|
+
}],
|
|
598
|
+
size: [{
|
|
599
|
+
type: i0.Input,
|
|
600
|
+
args: [{
|
|
601
|
+
isSignal: true,
|
|
602
|
+
alias: "size",
|
|
603
|
+
required: false
|
|
604
|
+
}]
|
|
605
|
+
}],
|
|
606
|
+
shape: [{
|
|
607
|
+
type: i0.Input,
|
|
608
|
+
args: [{
|
|
609
|
+
isSignal: true,
|
|
610
|
+
alias: "shape",
|
|
611
|
+
required: false
|
|
612
|
+
}]
|
|
613
|
+
}],
|
|
614
|
+
ariaLabel: [{
|
|
615
|
+
type: i0.Input,
|
|
616
|
+
args: [{
|
|
617
|
+
isSignal: true,
|
|
618
|
+
alias: "ariaLabel",
|
|
619
|
+
required: false
|
|
620
|
+
}]
|
|
621
|
+
}],
|
|
622
|
+
moreLabel: [{
|
|
623
|
+
type: i0.Input,
|
|
624
|
+
args: [{
|
|
625
|
+
isSignal: true,
|
|
626
|
+
alias: "moreLabel",
|
|
627
|
+
required: false
|
|
628
|
+
}]
|
|
629
|
+
}],
|
|
630
|
+
dt: [{
|
|
631
|
+
type: i0.Input,
|
|
632
|
+
args: [{
|
|
633
|
+
isSignal: true,
|
|
634
|
+
alias: "dt",
|
|
635
|
+
required: false
|
|
636
|
+
}]
|
|
637
|
+
}],
|
|
638
|
+
pt: [{
|
|
639
|
+
type: i0.Input,
|
|
640
|
+
args: [{
|
|
641
|
+
isSignal: true,
|
|
642
|
+
alias: "pt",
|
|
643
|
+
required: false
|
|
644
|
+
}]
|
|
645
|
+
}],
|
|
646
|
+
ptOptions: [{
|
|
647
|
+
type: i0.Input,
|
|
648
|
+
args: [{
|
|
649
|
+
isSignal: true,
|
|
650
|
+
alias: "ptOptions",
|
|
651
|
+
required: false
|
|
652
|
+
}]
|
|
653
|
+
}],
|
|
654
|
+
unstyled: [{
|
|
655
|
+
type: i0.Input,
|
|
656
|
+
args: [{
|
|
657
|
+
isSignal: true,
|
|
658
|
+
alias: "unstyled",
|
|
659
|
+
required: false
|
|
660
|
+
}]
|
|
661
|
+
}],
|
|
662
|
+
avatars: [{
|
|
663
|
+
type: i0.ContentChildren,
|
|
664
|
+
args: [i0.forwardRef(() => TxAvatar), { isSignal: true }]
|
|
665
|
+
}]
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
export { TX_AVATAR_GROUP, TxAvatar, TxAvatarGroup };
|
|
669
|
+
|
|
670
|
+
//# sourceMappingURL=tectra-ng-ui-avatar.mjs.map
|