@tectra-ng/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,975 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, TemplateRef, booleanAttribute, computed, contentChild, effect, inject, input, output, signal } from "@angular/core";
|
|
3
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
|
+
import { TECTRA_CONFIG, injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
|
+
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
6
|
+
import { optionalBoolean, optionalNumber } from "@tectra-ng/core/utils";
|
|
7
|
+
import { TxIcon, TxIconRegistry } from "@tectra-ng/icons";
|
|
8
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
9
|
+
import { injectDescribedBy, uniqueId } from "@tectra-ng/core/a11y";
|
|
10
|
+
var TxMessageIconTemplate = class TxMessageIconTemplate {
|
|
11
|
+
templateRef = inject(TemplateRef);
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
13
|
+
minVersion: "12.0.0",
|
|
14
|
+
version: "22.2.3",
|
|
15
|
+
ngImport: i0,
|
|
16
|
+
type: TxMessageIconTemplate,
|
|
17
|
+
deps: [],
|
|
18
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
19
|
+
});
|
|
20
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
21
|
+
minVersion: "14.0.0",
|
|
22
|
+
version: "22.2.3",
|
|
23
|
+
type: TxMessageIconTemplate,
|
|
24
|
+
isStandalone: true,
|
|
25
|
+
selector: "ng-template[txMessageIcon]",
|
|
26
|
+
ngImport: i0
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
30
|
+
minVersion: "12.0.0",
|
|
31
|
+
version: "22.2.3",
|
|
32
|
+
ngImport: i0,
|
|
33
|
+
type: TxMessageIconTemplate,
|
|
34
|
+
decorators: [{
|
|
35
|
+
type: Directive,
|
|
36
|
+
args: [{ selector: "ng-template[txMessageIcon]" }]
|
|
37
|
+
}]
|
|
38
|
+
});
|
|
39
|
+
var TxMessageCloseIconTemplate = class TxMessageCloseIconTemplate {
|
|
40
|
+
templateRef = inject(TemplateRef);
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
42
|
+
minVersion: "12.0.0",
|
|
43
|
+
version: "22.2.3",
|
|
44
|
+
ngImport: i0,
|
|
45
|
+
type: TxMessageCloseIconTemplate,
|
|
46
|
+
deps: [],
|
|
47
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
48
|
+
});
|
|
49
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
50
|
+
minVersion: "14.0.0",
|
|
51
|
+
version: "22.2.3",
|
|
52
|
+
type: TxMessageCloseIconTemplate,
|
|
53
|
+
isStandalone: true,
|
|
54
|
+
selector: "ng-template[txMessageCloseIcon]",
|
|
55
|
+
ngImport: i0
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
59
|
+
minVersion: "12.0.0",
|
|
60
|
+
version: "22.2.3",
|
|
61
|
+
ngImport: i0,
|
|
62
|
+
type: TxMessageCloseIconTemplate,
|
|
63
|
+
decorators: [{
|
|
64
|
+
type: Directive,
|
|
65
|
+
args: [{ selector: "ng-template[txMessageCloseIcon]" }]
|
|
66
|
+
}]
|
|
67
|
+
});
|
|
68
|
+
var TxMessage = class TxMessage {
|
|
69
|
+
txIconRegistry = inject(TxIconRegistry);
|
|
70
|
+
severity = input("info", ...ngDevMode ? [{ debugName: "severity" }] : /* istanbul ignore next */ []);
|
|
71
|
+
text = input(void 0, ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
72
|
+
icon = input(void 0, ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
73
|
+
size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
74
|
+
variant = input(void 0, ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
|
|
75
|
+
closable = input(false, {
|
|
76
|
+
...ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {},
|
|
77
|
+
transform: booleanAttribute
|
|
78
|
+
});
|
|
79
|
+
closeIcon = input("times", ...ngDevMode ? [{ debugName: "closeIcon" }] : /* istanbul ignore next */ []);
|
|
80
|
+
life = input(void 0, {
|
|
81
|
+
...ngDevMode ? { debugName: "life" } : /* istanbul ignore next */ {},
|
|
82
|
+
transform: optionalNumber
|
|
83
|
+
});
|
|
84
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
85
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
86
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
87
|
+
unstyled = input(void 0, {
|
|
88
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
89
|
+
transform: optionalBoolean
|
|
90
|
+
});
|
|
91
|
+
closed = output();
|
|
92
|
+
iconTemplate = contentChild(TxMessageIconTemplate, ...ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []);
|
|
93
|
+
closeIconTemplate = contentChild(TxMessageCloseIconTemplate, ...ngDevMode ? [{ debugName: "closeIconTemplate" }] : /* istanbul ignore next */ []);
|
|
94
|
+
translations = injectTranslations();
|
|
95
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
96
|
+
passThrough = injectPassThrough("message", this, this.pt, this.ptOptions);
|
|
97
|
+
isClosing = signal(false, ...ngDevMode ? [{ debugName: "isClosing" }] : /* istanbul ignore next */ []);
|
|
98
|
+
isClosed = signal(false, ...ngDevMode ? [{ debugName: "isClosed" }] : /* istanbul ignore next */ []);
|
|
99
|
+
role = computed(() => this.severity() === "danger" || this.severity() === "warn" ? "alert" : "status", ...ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []);
|
|
100
|
+
hasIcon = computed(() => !!this.icon() || !!this.iconTemplate(), ...ngDevMode ? [{ debugName: "hasIcon" }] : /* istanbul ignore next */ []);
|
|
101
|
+
iconName = computed(() => this.registered(this.icon()), ...ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []);
|
|
102
|
+
closeIconName = computed(() => this.registered(this.closeIcon()), ...ngDevMode ? [{ debugName: "closeIconName" }] : /* istanbul ignore next */ []);
|
|
103
|
+
hostStyle = computed(() => ({
|
|
104
|
+
...toStyleObject(this.dt(), "--tx-message"),
|
|
105
|
+
...this.passThrough().root?.style,
|
|
106
|
+
...this.isClosed() ? { display: "none" } : {}
|
|
107
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
108
|
+
constructor() {
|
|
109
|
+
effect((onCleanup) => {
|
|
110
|
+
const life = this.life();
|
|
111
|
+
if (life && life > 0) {
|
|
112
|
+
const timer = setTimeout(() => this.close(), life);
|
|
113
|
+
onCleanup(() => clearTimeout(timer));
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
close() {
|
|
118
|
+
if (this.isClosing() || this.isClosed()) return;
|
|
119
|
+
if (this.isUnstyled()) {
|
|
120
|
+
this.finishClose();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.isClosing.set(true);
|
|
124
|
+
}
|
|
125
|
+
onAnimationEnd(event) {
|
|
126
|
+
if (this.isClosing() && event.animationName.includes("tx-message-out")) this.finishClose();
|
|
127
|
+
}
|
|
128
|
+
finishClose() {
|
|
129
|
+
this.isClosing.set(false);
|
|
130
|
+
this.isClosed.set(true);
|
|
131
|
+
this.closed.emit();
|
|
132
|
+
}
|
|
133
|
+
registered(icon) {
|
|
134
|
+
return icon && this.txIconRegistry.has(icon) ? icon : null;
|
|
135
|
+
}
|
|
136
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
137
|
+
minVersion: "12.0.0",
|
|
138
|
+
version: "22.2.3",
|
|
139
|
+
ngImport: i0,
|
|
140
|
+
type: TxMessage,
|
|
141
|
+
deps: [],
|
|
142
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
143
|
+
});
|
|
144
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
145
|
+
minVersion: "17.0.0",
|
|
146
|
+
version: "22.2.3",
|
|
147
|
+
type: TxMessage,
|
|
148
|
+
isStandalone: true,
|
|
149
|
+
selector: "tx-message",
|
|
150
|
+
inputs: {
|
|
151
|
+
severity: {
|
|
152
|
+
classPropertyName: "severity",
|
|
153
|
+
publicName: "severity",
|
|
154
|
+
isSignal: true,
|
|
155
|
+
isRequired: false,
|
|
156
|
+
transformFunction: null
|
|
157
|
+
},
|
|
158
|
+
text: {
|
|
159
|
+
classPropertyName: "text",
|
|
160
|
+
publicName: "text",
|
|
161
|
+
isSignal: true,
|
|
162
|
+
isRequired: false,
|
|
163
|
+
transformFunction: null
|
|
164
|
+
},
|
|
165
|
+
icon: {
|
|
166
|
+
classPropertyName: "icon",
|
|
167
|
+
publicName: "icon",
|
|
168
|
+
isSignal: true,
|
|
169
|
+
isRequired: false,
|
|
170
|
+
transformFunction: null
|
|
171
|
+
},
|
|
172
|
+
size: {
|
|
173
|
+
classPropertyName: "size",
|
|
174
|
+
publicName: "size",
|
|
175
|
+
isSignal: true,
|
|
176
|
+
isRequired: false,
|
|
177
|
+
transformFunction: null
|
|
178
|
+
},
|
|
179
|
+
variant: {
|
|
180
|
+
classPropertyName: "variant",
|
|
181
|
+
publicName: "variant",
|
|
182
|
+
isSignal: true,
|
|
183
|
+
isRequired: false,
|
|
184
|
+
transformFunction: null
|
|
185
|
+
},
|
|
186
|
+
closable: {
|
|
187
|
+
classPropertyName: "closable",
|
|
188
|
+
publicName: "closable",
|
|
189
|
+
isSignal: true,
|
|
190
|
+
isRequired: false,
|
|
191
|
+
transformFunction: null
|
|
192
|
+
},
|
|
193
|
+
closeIcon: {
|
|
194
|
+
classPropertyName: "closeIcon",
|
|
195
|
+
publicName: "closeIcon",
|
|
196
|
+
isSignal: true,
|
|
197
|
+
isRequired: false,
|
|
198
|
+
transformFunction: null
|
|
199
|
+
},
|
|
200
|
+
life: {
|
|
201
|
+
classPropertyName: "life",
|
|
202
|
+
publicName: "life",
|
|
203
|
+
isSignal: true,
|
|
204
|
+
isRequired: false,
|
|
205
|
+
transformFunction: null
|
|
206
|
+
},
|
|
207
|
+
dt: {
|
|
208
|
+
classPropertyName: "dt",
|
|
209
|
+
publicName: "dt",
|
|
210
|
+
isSignal: true,
|
|
211
|
+
isRequired: false,
|
|
212
|
+
transformFunction: null
|
|
213
|
+
},
|
|
214
|
+
pt: {
|
|
215
|
+
classPropertyName: "pt",
|
|
216
|
+
publicName: "pt",
|
|
217
|
+
isSignal: true,
|
|
218
|
+
isRequired: false,
|
|
219
|
+
transformFunction: null
|
|
220
|
+
},
|
|
221
|
+
ptOptions: {
|
|
222
|
+
classPropertyName: "ptOptions",
|
|
223
|
+
publicName: "ptOptions",
|
|
224
|
+
isSignal: true,
|
|
225
|
+
isRequired: false,
|
|
226
|
+
transformFunction: null
|
|
227
|
+
},
|
|
228
|
+
unstyled: {
|
|
229
|
+
classPropertyName: "unstyled",
|
|
230
|
+
publicName: "unstyled",
|
|
231
|
+
isSignal: true,
|
|
232
|
+
isRequired: false,
|
|
233
|
+
transformFunction: null
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
outputs: { closed: "closed" },
|
|
237
|
+
host: {
|
|
238
|
+
listeners: { "animationend": "onAnimationEnd($event)" },
|
|
239
|
+
properties: {
|
|
240
|
+
"class": "passThrough().root?.class",
|
|
241
|
+
"style": "hostStyle()",
|
|
242
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
243
|
+
"attr.data-severity": "severity()",
|
|
244
|
+
"attr.data-size": "size()",
|
|
245
|
+
"attr.data-variant": "variant() ?? null",
|
|
246
|
+
"attr.role": "role()",
|
|
247
|
+
"class.tx-message--closing": "isClosing()"
|
|
248
|
+
},
|
|
249
|
+
classAttribute: "tx-message"
|
|
250
|
+
},
|
|
251
|
+
queries: [{
|
|
252
|
+
propertyName: "iconTemplate",
|
|
253
|
+
first: true,
|
|
254
|
+
predicate: TxMessageIconTemplate,
|
|
255
|
+
descendants: true,
|
|
256
|
+
isSignal: true
|
|
257
|
+
}, {
|
|
258
|
+
propertyName: "closeIconTemplate",
|
|
259
|
+
first: true,
|
|
260
|
+
predicate: TxMessageCloseIconTemplate,
|
|
261
|
+
descendants: true,
|
|
262
|
+
isSignal: true
|
|
263
|
+
}],
|
|
264
|
+
ngImport: i0,
|
|
265
|
+
template: "@if (hasIcon()) {\n <span class=\"tx-message__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else if (iconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon()\"></span>\n }\n </span>\n}\n<div class=\"tx-message__content\" [class]=\"passThrough().content?.class\" [style]=\"passThrough().content?.style\">\n @if (text()) {\n {{ text() }}\n } @else {\n <ng-content />\n }\n</div>\n@if (closable()) {\n <button\n type=\"button\"\n class=\"tx-message__close\"\n [class]=\"passThrough().closeButton?.class\"\n [style]=\"passThrough().closeButton?.style\"\n [attr.aria-label]=\"translations().close\"\n (click)=\"close()\"\n >\n @if (closeIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else if (closeIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"closeIcon()\" aria-hidden=\"true\"></span>\n }\n </button>\n}\n",
|
|
266
|
+
styles: [":host{display:block}:host([data-styled]){--_tone: var(--tx-message-info-tone);--_text: var(--tx-message-info-text);--_gap: var(--tx-message-gap);--_padding-y: var(--tx-message-padding-y);--_padding-start: var(--tx-message-padding-start);--_padding-end: var(--tx-message-padding-end);--_font-size: var(--tx-message-font-size);--_icon-size: var(--tx-message-icon-size);--_icon-font-size: var(--tx-message-icon-font-size);position:relative;display:flex;align-items:flex-start;gap:var(--_gap);box-sizing:border-box;overflow:hidden;padding:var(--_padding-y) var(--_padding-end) var(--_padding-y) var(--_padding-start);border-radius:var(--tx-message-border-radius);background:color-mix(in srgb,var(--_tone) var(--tx-message-background-tint),var(--tx-message-background));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--_tone) var(--tx-message-border-tint),var(--tx-message-border-color));color:var(--tx-message-color);font-family:var(--tx-font-family);font-size:var(--_font-size);font-weight:var(--tx-message-font-weight);line-height:var(--tx-message-line-height);animation:tx-message-in var(--tx-message-transition-duration) ease}:host([data-styled]):before{position:absolute;inset-block:0;inset-inline-start:0;width:var(--tx-message-accent-width);background:var(--_tone);content:\"\"}:host([data-styled][data-severity=primary]){--_tone: var(--tx-message-primary-tone);--_text: var(--tx-message-primary-text)}:host([data-styled][data-severity=secondary]){--_tone: var(--tx-message-secondary-tone);--_text: var(--tx-message-secondary-text)}:host([data-styled][data-severity=success]){--_tone: var(--tx-message-success-tone);--_text: var(--tx-message-success-text)}:host([data-styled][data-severity=warn]){--_tone: var(--tx-message-warn-tone);--_text: var(--tx-message-warn-text)}:host([data-styled][data-severity=danger]){--_tone: var(--tx-message-danger-tone);--_text: var(--tx-message-danger-text)}:host([data-styled][data-severity=help]){--_tone: var(--tx-message-help-tone);--_text: var(--tx-message-help-text)}:host([data-styled][data-severity=contrast]){--_tone: var(--tx-message-contrast-tone);--_text: var(--tx-message-contrast-text)}:host([data-styled][data-size=small]){--_gap: var(--tx-message-sm-gap);--_padding-y: var(--tx-message-sm-padding-y);--_padding-start: var(--tx-message-sm-padding-start);--_padding-end: var(--tx-message-sm-padding-end);--_font-size: var(--tx-message-sm-font-size);--_icon-size: var(--tx-message-sm-icon-size);--_icon-font-size: var(--tx-message-sm-icon-font-size)}:host([data-styled][data-size=large]){--_gap: var(--tx-message-lg-gap);--_padding-y: var(--tx-message-lg-padding-y);--_padding-start: var(--tx-message-lg-padding-start);--_padding-end: var(--tx-message-lg-padding-end);--_font-size: var(--tx-message-lg-font-size);--_icon-size: var(--tx-message-lg-icon-size);--_icon-font-size: var(--tx-message-lg-icon-font-size)}:host([data-styled]) .tx-message__icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--_icon-size);height:var(--_icon-size);border-radius:50%;background:color-mix(in srgb,var(--_tone) var(--tx-message-icon-tint),transparent);color:var(--_tone);font-size:var(--_icon-font-size)}:host([data-styled]) .tx-message__content{flex:1;min-width:0;align-self:center;overflow-wrap:anywhere}:host([data-styled]) .tx-message__close{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;align-self:center;width:var(--tx-message-close-button-size);height:var(--tx-message-close-button-size);margin-block:calc((var(--tx-message-close-button-size) - 1lh) / -2);padding:0;border:none;border-radius:var(--tx-message-close-button-border-radius);background:transparent;color:var(--tx-message-close-button-color);font-size:var(--tx-message-close-button-font-size);cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host([data-styled]) .tx-message__close:hover{background:var(--tx-message-close-button-hover-background);color:var(--tx-message-close-button-hover-color)}:host([data-styled]) .tx-message__close:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled][data-variant=outlined]){background:transparent}:host([data-styled][data-variant=text]),:host([data-styled][data-variant=simple]){background:transparent;box-shadow:none;color:var(--_text)}:host([data-styled][data-variant=text]):before,:host([data-styled][data-variant=simple]):before{display:none}:host([data-styled][data-variant=text]) .tx-message__icon,:host([data-styled][data-variant=simple]) .tx-message__icon{width:auto;height:1lh;background:transparent;color:inherit}:host([data-styled][data-variant=simple]){padding:0}:host([data-styled].tx-message--closing){animation:tx-message-out var(--tx-message-transition-duration) ease-in forwards}@keyframes tx-message-in{0%{opacity:0;transform:translateY(-2px)}}@keyframes tx-message-out{to{opacity:0;transform:translateY(-2px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]),:host([data-styled].tx-message--closing){animation-duration:1ms}}\n"],
|
|
267
|
+
dependencies: [{
|
|
268
|
+
kind: "directive",
|
|
269
|
+
type: NgTemplateOutlet,
|
|
270
|
+
selector: "[ngTemplateOutlet]",
|
|
271
|
+
inputs: [
|
|
272
|
+
"ngTemplateOutletContext",
|
|
273
|
+
"ngTemplateOutlet",
|
|
274
|
+
"ngTemplateOutletInjector"
|
|
275
|
+
]
|
|
276
|
+
}, {
|
|
277
|
+
kind: "component",
|
|
278
|
+
type: TxIcon,
|
|
279
|
+
selector: "tx-icon",
|
|
280
|
+
inputs: ["name"]
|
|
281
|
+
}],
|
|
282
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
286
|
+
minVersion: "12.0.0",
|
|
287
|
+
version: "22.2.3",
|
|
288
|
+
ngImport: i0,
|
|
289
|
+
type: TxMessage,
|
|
290
|
+
decorators: [{
|
|
291
|
+
type: Component,
|
|
292
|
+
args: [{
|
|
293
|
+
selector: "tx-message",
|
|
294
|
+
imports: [NgTemplateOutlet, TxIcon],
|
|
295
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
296
|
+
host: {
|
|
297
|
+
class: "tx-message",
|
|
298
|
+
"[class]": "passThrough().root?.class",
|
|
299
|
+
"[style]": "hostStyle()",
|
|
300
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
301
|
+
"[attr.data-severity]": "severity()",
|
|
302
|
+
"[attr.data-size]": "size()",
|
|
303
|
+
"[attr.data-variant]": "variant() ?? null",
|
|
304
|
+
"[attr.role]": "role()",
|
|
305
|
+
"[class.tx-message--closing]": "isClosing()",
|
|
306
|
+
"(animationend)": "onAnimationEnd($event)"
|
|
307
|
+
},
|
|
308
|
+
template: "@if (hasIcon()) {\n <span class=\"tx-message__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else if (iconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon()\"></span>\n }\n </span>\n}\n<div class=\"tx-message__content\" [class]=\"passThrough().content?.class\" [style]=\"passThrough().content?.style\">\n @if (text()) {\n {{ text() }}\n } @else {\n <ng-content />\n }\n</div>\n@if (closable()) {\n <button\n type=\"button\"\n class=\"tx-message__close\"\n [class]=\"passThrough().closeButton?.class\"\n [style]=\"passThrough().closeButton?.style\"\n [attr.aria-label]=\"translations().close\"\n (click)=\"close()\"\n >\n @if (closeIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else if (closeIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"closeIcon()\" aria-hidden=\"true\"></span>\n }\n </button>\n}\n",
|
|
309
|
+
styles: [":host{display:block}:host([data-styled]){--_tone: var(--tx-message-info-tone);--_text: var(--tx-message-info-text);--_gap: var(--tx-message-gap);--_padding-y: var(--tx-message-padding-y);--_padding-start: var(--tx-message-padding-start);--_padding-end: var(--tx-message-padding-end);--_font-size: var(--tx-message-font-size);--_icon-size: var(--tx-message-icon-size);--_icon-font-size: var(--tx-message-icon-font-size);position:relative;display:flex;align-items:flex-start;gap:var(--_gap);box-sizing:border-box;overflow:hidden;padding:var(--_padding-y) var(--_padding-end) var(--_padding-y) var(--_padding-start);border-radius:var(--tx-message-border-radius);background:color-mix(in srgb,var(--_tone) var(--tx-message-background-tint),var(--tx-message-background));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--_tone) var(--tx-message-border-tint),var(--tx-message-border-color));color:var(--tx-message-color);font-family:var(--tx-font-family);font-size:var(--_font-size);font-weight:var(--tx-message-font-weight);line-height:var(--tx-message-line-height);animation:tx-message-in var(--tx-message-transition-duration) ease}:host([data-styled]):before{position:absolute;inset-block:0;inset-inline-start:0;width:var(--tx-message-accent-width);background:var(--_tone);content:\"\"}:host([data-styled][data-severity=primary]){--_tone: var(--tx-message-primary-tone);--_text: var(--tx-message-primary-text)}:host([data-styled][data-severity=secondary]){--_tone: var(--tx-message-secondary-tone);--_text: var(--tx-message-secondary-text)}:host([data-styled][data-severity=success]){--_tone: var(--tx-message-success-tone);--_text: var(--tx-message-success-text)}:host([data-styled][data-severity=warn]){--_tone: var(--tx-message-warn-tone);--_text: var(--tx-message-warn-text)}:host([data-styled][data-severity=danger]){--_tone: var(--tx-message-danger-tone);--_text: var(--tx-message-danger-text)}:host([data-styled][data-severity=help]){--_tone: var(--tx-message-help-tone);--_text: var(--tx-message-help-text)}:host([data-styled][data-severity=contrast]){--_tone: var(--tx-message-contrast-tone);--_text: var(--tx-message-contrast-text)}:host([data-styled][data-size=small]){--_gap: var(--tx-message-sm-gap);--_padding-y: var(--tx-message-sm-padding-y);--_padding-start: var(--tx-message-sm-padding-start);--_padding-end: var(--tx-message-sm-padding-end);--_font-size: var(--tx-message-sm-font-size);--_icon-size: var(--tx-message-sm-icon-size);--_icon-font-size: var(--tx-message-sm-icon-font-size)}:host([data-styled][data-size=large]){--_gap: var(--tx-message-lg-gap);--_padding-y: var(--tx-message-lg-padding-y);--_padding-start: var(--tx-message-lg-padding-start);--_padding-end: var(--tx-message-lg-padding-end);--_font-size: var(--tx-message-lg-font-size);--_icon-size: var(--tx-message-lg-icon-size);--_icon-font-size: var(--tx-message-lg-icon-font-size)}:host([data-styled]) .tx-message__icon{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--_icon-size);height:var(--_icon-size);border-radius:50%;background:color-mix(in srgb,var(--_tone) var(--tx-message-icon-tint),transparent);color:var(--_tone);font-size:var(--_icon-font-size)}:host([data-styled]) .tx-message__content{flex:1;min-width:0;align-self:center;overflow-wrap:anywhere}:host([data-styled]) .tx-message__close{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;align-self:center;width:var(--tx-message-close-button-size);height:var(--tx-message-close-button-size);margin-block:calc((var(--tx-message-close-button-size) - 1lh) / -2);padding:0;border:none;border-radius:var(--tx-message-close-button-border-radius);background:transparent;color:var(--tx-message-close-button-color);font-size:var(--tx-message-close-button-font-size);cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host([data-styled]) .tx-message__close:hover{background:var(--tx-message-close-button-hover-background);color:var(--tx-message-close-button-hover-color)}:host([data-styled]) .tx-message__close:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled][data-variant=outlined]){background:transparent}:host([data-styled][data-variant=text]),:host([data-styled][data-variant=simple]){background:transparent;box-shadow:none;color:var(--_text)}:host([data-styled][data-variant=text]):before,:host([data-styled][data-variant=simple]):before{display:none}:host([data-styled][data-variant=text]) .tx-message__icon,:host([data-styled][data-variant=simple]) .tx-message__icon{width:auto;height:1lh;background:transparent;color:inherit}:host([data-styled][data-variant=simple]){padding:0}:host([data-styled].tx-message--closing){animation:tx-message-out var(--tx-message-transition-duration) ease-in forwards}@keyframes tx-message-in{0%{opacity:0;transform:translateY(-2px)}}@keyframes tx-message-out{to{opacity:0;transform:translateY(-2px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]),:host([data-styled].tx-message--closing){animation-duration:1ms}}\n"]
|
|
310
|
+
}]
|
|
311
|
+
}],
|
|
312
|
+
ctorParameters: () => [],
|
|
313
|
+
propDecorators: {
|
|
314
|
+
severity: [{
|
|
315
|
+
type: i0.Input,
|
|
316
|
+
args: [{
|
|
317
|
+
isSignal: true,
|
|
318
|
+
alias: "severity",
|
|
319
|
+
required: false
|
|
320
|
+
}]
|
|
321
|
+
}],
|
|
322
|
+
text: [{
|
|
323
|
+
type: i0.Input,
|
|
324
|
+
args: [{
|
|
325
|
+
isSignal: true,
|
|
326
|
+
alias: "text",
|
|
327
|
+
required: false
|
|
328
|
+
}]
|
|
329
|
+
}],
|
|
330
|
+
icon: [{
|
|
331
|
+
type: i0.Input,
|
|
332
|
+
args: [{
|
|
333
|
+
isSignal: true,
|
|
334
|
+
alias: "icon",
|
|
335
|
+
required: false
|
|
336
|
+
}]
|
|
337
|
+
}],
|
|
338
|
+
size: [{
|
|
339
|
+
type: i0.Input,
|
|
340
|
+
args: [{
|
|
341
|
+
isSignal: true,
|
|
342
|
+
alias: "size",
|
|
343
|
+
required: false
|
|
344
|
+
}]
|
|
345
|
+
}],
|
|
346
|
+
variant: [{
|
|
347
|
+
type: i0.Input,
|
|
348
|
+
args: [{
|
|
349
|
+
isSignal: true,
|
|
350
|
+
alias: "variant",
|
|
351
|
+
required: false
|
|
352
|
+
}]
|
|
353
|
+
}],
|
|
354
|
+
closable: [{
|
|
355
|
+
type: i0.Input,
|
|
356
|
+
args: [{
|
|
357
|
+
isSignal: true,
|
|
358
|
+
alias: "closable",
|
|
359
|
+
required: false
|
|
360
|
+
}]
|
|
361
|
+
}],
|
|
362
|
+
closeIcon: [{
|
|
363
|
+
type: i0.Input,
|
|
364
|
+
args: [{
|
|
365
|
+
isSignal: true,
|
|
366
|
+
alias: "closeIcon",
|
|
367
|
+
required: false
|
|
368
|
+
}]
|
|
369
|
+
}],
|
|
370
|
+
life: [{
|
|
371
|
+
type: i0.Input,
|
|
372
|
+
args: [{
|
|
373
|
+
isSignal: true,
|
|
374
|
+
alias: "life",
|
|
375
|
+
required: false
|
|
376
|
+
}]
|
|
377
|
+
}],
|
|
378
|
+
dt: [{
|
|
379
|
+
type: i0.Input,
|
|
380
|
+
args: [{
|
|
381
|
+
isSignal: true,
|
|
382
|
+
alias: "dt",
|
|
383
|
+
required: false
|
|
384
|
+
}]
|
|
385
|
+
}],
|
|
386
|
+
pt: [{
|
|
387
|
+
type: i0.Input,
|
|
388
|
+
args: [{
|
|
389
|
+
isSignal: true,
|
|
390
|
+
alias: "pt",
|
|
391
|
+
required: false
|
|
392
|
+
}]
|
|
393
|
+
}],
|
|
394
|
+
ptOptions: [{
|
|
395
|
+
type: i0.Input,
|
|
396
|
+
args: [{
|
|
397
|
+
isSignal: true,
|
|
398
|
+
alias: "ptOptions",
|
|
399
|
+
required: false
|
|
400
|
+
}]
|
|
401
|
+
}],
|
|
402
|
+
unstyled: [{
|
|
403
|
+
type: i0.Input,
|
|
404
|
+
args: [{
|
|
405
|
+
isSignal: true,
|
|
406
|
+
alias: "unstyled",
|
|
407
|
+
required: false
|
|
408
|
+
}]
|
|
409
|
+
}],
|
|
410
|
+
closed: [{
|
|
411
|
+
type: i0.Output,
|
|
412
|
+
args: ["closed"]
|
|
413
|
+
}],
|
|
414
|
+
iconTemplate: [{
|
|
415
|
+
type: i0.ContentChild,
|
|
416
|
+
args: [i0.forwardRef(() => TxMessageIconTemplate), { isSignal: true }]
|
|
417
|
+
}],
|
|
418
|
+
closeIconTemplate: [{
|
|
419
|
+
type: i0.ContentChild,
|
|
420
|
+
args: [i0.forwardRef(() => TxMessageCloseIconTemplate), { isSignal: true }]
|
|
421
|
+
}]
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
var TxFieldHint = class TxFieldHint {
|
|
425
|
+
txIconRegistry = inject(TxIconRegistry);
|
|
426
|
+
generatedId = uniqueId("tx-field-hint");
|
|
427
|
+
for = input(void 0, ...ngDevMode ? [{ debugName: "for" }] : /* istanbul ignore next */ []);
|
|
428
|
+
id = input(void 0, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
429
|
+
severity = input("secondary", ...ngDevMode ? [{ debugName: "severity" }] : /* istanbul ignore next */ []);
|
|
430
|
+
icon = input(void 0, ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
431
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
432
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
433
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
434
|
+
unstyled = input(void 0, {
|
|
435
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
436
|
+
transform: optionalBoolean
|
|
437
|
+
});
|
|
438
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
439
|
+
passThrough = injectPassThrough("fieldHint", this, this.pt, this.ptOptions);
|
|
440
|
+
resolvedId = computed(() => this.id() ?? this.generatedId, ...ngDevMode ? [{ debugName: "resolvedId" }] : /* istanbul ignore next */ []);
|
|
441
|
+
iconName = computed(() => {
|
|
442
|
+
const icon = this.icon();
|
|
443
|
+
return icon && this.txIconRegistry.has(icon) ? icon : null;
|
|
444
|
+
}, ...ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []);
|
|
445
|
+
hostStyle = computed(() => ({
|
|
446
|
+
...toStyleObject(this.dt(), "--tx-field-message"),
|
|
447
|
+
...this.passThrough().root?.style
|
|
448
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
449
|
+
constructor() {
|
|
450
|
+
injectDescribedBy(this.for, this.resolvedId);
|
|
451
|
+
}
|
|
452
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
453
|
+
minVersion: "12.0.0",
|
|
454
|
+
version: "22.2.3",
|
|
455
|
+
ngImport: i0,
|
|
456
|
+
type: TxFieldHint,
|
|
457
|
+
deps: [],
|
|
458
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
459
|
+
});
|
|
460
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
461
|
+
minVersion: "17.0.0",
|
|
462
|
+
version: "22.2.3",
|
|
463
|
+
type: TxFieldHint,
|
|
464
|
+
isStandalone: true,
|
|
465
|
+
selector: "tx-field-hint",
|
|
466
|
+
inputs: {
|
|
467
|
+
for: {
|
|
468
|
+
classPropertyName: "for",
|
|
469
|
+
publicName: "for",
|
|
470
|
+
isSignal: true,
|
|
471
|
+
isRequired: false,
|
|
472
|
+
transformFunction: null
|
|
473
|
+
},
|
|
474
|
+
id: {
|
|
475
|
+
classPropertyName: "id",
|
|
476
|
+
publicName: "id",
|
|
477
|
+
isSignal: true,
|
|
478
|
+
isRequired: false,
|
|
479
|
+
transformFunction: null
|
|
480
|
+
},
|
|
481
|
+
severity: {
|
|
482
|
+
classPropertyName: "severity",
|
|
483
|
+
publicName: "severity",
|
|
484
|
+
isSignal: true,
|
|
485
|
+
isRequired: false,
|
|
486
|
+
transformFunction: null
|
|
487
|
+
},
|
|
488
|
+
icon: {
|
|
489
|
+
classPropertyName: "icon",
|
|
490
|
+
publicName: "icon",
|
|
491
|
+
isSignal: true,
|
|
492
|
+
isRequired: false,
|
|
493
|
+
transformFunction: null
|
|
494
|
+
},
|
|
495
|
+
dt: {
|
|
496
|
+
classPropertyName: "dt",
|
|
497
|
+
publicName: "dt",
|
|
498
|
+
isSignal: true,
|
|
499
|
+
isRequired: false,
|
|
500
|
+
transformFunction: null
|
|
501
|
+
},
|
|
502
|
+
pt: {
|
|
503
|
+
classPropertyName: "pt",
|
|
504
|
+
publicName: "pt",
|
|
505
|
+
isSignal: true,
|
|
506
|
+
isRequired: false,
|
|
507
|
+
transformFunction: null
|
|
508
|
+
},
|
|
509
|
+
ptOptions: {
|
|
510
|
+
classPropertyName: "ptOptions",
|
|
511
|
+
publicName: "ptOptions",
|
|
512
|
+
isSignal: true,
|
|
513
|
+
isRequired: false,
|
|
514
|
+
transformFunction: null
|
|
515
|
+
},
|
|
516
|
+
unstyled: {
|
|
517
|
+
classPropertyName: "unstyled",
|
|
518
|
+
publicName: "unstyled",
|
|
519
|
+
isSignal: true,
|
|
520
|
+
isRequired: false,
|
|
521
|
+
transformFunction: null
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
host: {
|
|
525
|
+
properties: {
|
|
526
|
+
"class": "passThrough().root?.class",
|
|
527
|
+
"style": "hostStyle()",
|
|
528
|
+
"id": "resolvedId()",
|
|
529
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
530
|
+
"attr.data-severity": "severity()"
|
|
531
|
+
},
|
|
532
|
+
classAttribute: "tx-field-message tx-field-hint"
|
|
533
|
+
},
|
|
534
|
+
ngImport: i0,
|
|
535
|
+
template: `
|
|
536
|
+
@if (icon(); as icon) {
|
|
537
|
+
<span class="tx-field-message__icon" aria-hidden="true" [class]="passThrough().icon?.class" [style]="passThrough().icon?.style">
|
|
538
|
+
@if (iconName(); as name) {
|
|
539
|
+
<tx-icon [name]="name" />
|
|
540
|
+
} @else {
|
|
541
|
+
<span [class]="icon"></span>
|
|
542
|
+
}
|
|
543
|
+
</span>
|
|
544
|
+
}
|
|
545
|
+
<span class="tx-field-message__text" [class]="passThrough().text?.class" [style]="passThrough().text?.style"><ng-content /></span>
|
|
546
|
+
`,
|
|
547
|
+
isInline: true,
|
|
548
|
+
styles: [":host{display:block}:host([data-styled]){--_color: var(--tx-field-message-hint-color);color:var(--_color);font-family:var(--tx-font-family);font-size:var(--tx-field-message-font-size);line-height:var(--tx-field-message-line-height)}:host([data-styled].tx-field-hint){display:flex;align-items:flex-start;gap:var(--tx-field-message-gap);margin-top:var(--tx-field-message-margin-top)}:host([data-styled][data-severity=success]),:host([data-styled]) .tx-field-message__row--success{--_color: var(--tx-field-message-success-color);color:var(--_color)}:host([data-styled].tx-field-error){--_color: var(--tx-field-message-error-color)}:host([data-styled]) .tx-field-message__row{display:grid;grid-template-rows:1fr}:host([data-styled]) .tx-field-message__inner{display:flex;align-items:flex-start;gap:var(--tx-field-message-gap);min-height:0;padding-top:var(--tx-field-message-margin-top);overflow:hidden}:host([data-styled]) .tx-field-message__icon{display:inline-flex;flex-shrink:0;align-items:center;height:1lh;font-size:var(--tx-field-message-icon-size)}:host([data-styled]) .tx-field-message--enter{animation:tx-field-message-in var(--tx-field-message-transition-duration) cubic-bezier(.16,1,.3,1)}:host([data-styled]) .tx-field-message--leave{animation:tx-field-message-in calc(var(--tx-field-message-transition-duration) * .8) ease-in reverse forwards}@keyframes tx-field-message-in{0%{grid-template-rows:0fr;opacity:0;transform:translateY(-4px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-field-message--enter,:host([data-styled]) .tx-field-message--leave{animation-duration:1ms}}\n"],
|
|
549
|
+
dependencies: [{
|
|
550
|
+
kind: "component",
|
|
551
|
+
type: TxIcon,
|
|
552
|
+
selector: "tx-icon",
|
|
553
|
+
inputs: ["name"]
|
|
554
|
+
}],
|
|
555
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
556
|
+
});
|
|
557
|
+
};
|
|
558
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
559
|
+
minVersion: "12.0.0",
|
|
560
|
+
version: "22.2.3",
|
|
561
|
+
ngImport: i0,
|
|
562
|
+
type: TxFieldHint,
|
|
563
|
+
decorators: [{
|
|
564
|
+
type: Component,
|
|
565
|
+
args: [{
|
|
566
|
+
selector: "tx-field-hint",
|
|
567
|
+
imports: [TxIcon],
|
|
568
|
+
template: `
|
|
569
|
+
@if (icon(); as icon) {
|
|
570
|
+
<span class="tx-field-message__icon" aria-hidden="true" [class]="passThrough().icon?.class" [style]="passThrough().icon?.style">
|
|
571
|
+
@if (iconName(); as name) {
|
|
572
|
+
<tx-icon [name]="name" />
|
|
573
|
+
} @else {
|
|
574
|
+
<span [class]="icon"></span>
|
|
575
|
+
}
|
|
576
|
+
</span>
|
|
577
|
+
}
|
|
578
|
+
<span class="tx-field-message__text" [class]="passThrough().text?.class" [style]="passThrough().text?.style"><ng-content /></span>
|
|
579
|
+
`,
|
|
580
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
581
|
+
host: {
|
|
582
|
+
class: "tx-field-message tx-field-hint",
|
|
583
|
+
"[class]": "passThrough().root?.class",
|
|
584
|
+
"[style]": "hostStyle()",
|
|
585
|
+
"[id]": "resolvedId()",
|
|
586
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
587
|
+
"[attr.data-severity]": "severity()"
|
|
588
|
+
},
|
|
589
|
+
styles: [":host{display:block}:host([data-styled]){--_color: var(--tx-field-message-hint-color);color:var(--_color);font-family:var(--tx-font-family);font-size:var(--tx-field-message-font-size);line-height:var(--tx-field-message-line-height)}:host([data-styled].tx-field-hint){display:flex;align-items:flex-start;gap:var(--tx-field-message-gap);margin-top:var(--tx-field-message-margin-top)}:host([data-styled][data-severity=success]),:host([data-styled]) .tx-field-message__row--success{--_color: var(--tx-field-message-success-color);color:var(--_color)}:host([data-styled].tx-field-error){--_color: var(--tx-field-message-error-color)}:host([data-styled]) .tx-field-message__row{display:grid;grid-template-rows:1fr}:host([data-styled]) .tx-field-message__inner{display:flex;align-items:flex-start;gap:var(--tx-field-message-gap);min-height:0;padding-top:var(--tx-field-message-margin-top);overflow:hidden}:host([data-styled]) .tx-field-message__icon{display:inline-flex;flex-shrink:0;align-items:center;height:1lh;font-size:var(--tx-field-message-icon-size)}:host([data-styled]) .tx-field-message--enter{animation:tx-field-message-in var(--tx-field-message-transition-duration) cubic-bezier(.16,1,.3,1)}:host([data-styled]) .tx-field-message--leave{animation:tx-field-message-in calc(var(--tx-field-message-transition-duration) * .8) ease-in reverse forwards}@keyframes tx-field-message-in{0%{grid-template-rows:0fr;opacity:0;transform:translateY(-4px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-field-message--enter,:host([data-styled]) .tx-field-message--leave{animation-duration:1ms}}\n"]
|
|
590
|
+
}]
|
|
591
|
+
}],
|
|
592
|
+
ctorParameters: () => [],
|
|
593
|
+
propDecorators: {
|
|
594
|
+
for: [{
|
|
595
|
+
type: i0.Input,
|
|
596
|
+
args: [{
|
|
597
|
+
isSignal: true,
|
|
598
|
+
alias: "for",
|
|
599
|
+
required: false
|
|
600
|
+
}]
|
|
601
|
+
}],
|
|
602
|
+
id: [{
|
|
603
|
+
type: i0.Input,
|
|
604
|
+
args: [{
|
|
605
|
+
isSignal: true,
|
|
606
|
+
alias: "id",
|
|
607
|
+
required: false
|
|
608
|
+
}]
|
|
609
|
+
}],
|
|
610
|
+
severity: [{
|
|
611
|
+
type: i0.Input,
|
|
612
|
+
args: [{
|
|
613
|
+
isSignal: true,
|
|
614
|
+
alias: "severity",
|
|
615
|
+
required: false
|
|
616
|
+
}]
|
|
617
|
+
}],
|
|
618
|
+
icon: [{
|
|
619
|
+
type: i0.Input,
|
|
620
|
+
args: [{
|
|
621
|
+
isSignal: true,
|
|
622
|
+
alias: "icon",
|
|
623
|
+
required: false
|
|
624
|
+
}]
|
|
625
|
+
}],
|
|
626
|
+
dt: [{
|
|
627
|
+
type: i0.Input,
|
|
628
|
+
args: [{
|
|
629
|
+
isSignal: true,
|
|
630
|
+
alias: "dt",
|
|
631
|
+
required: false
|
|
632
|
+
}]
|
|
633
|
+
}],
|
|
634
|
+
pt: [{
|
|
635
|
+
type: i0.Input,
|
|
636
|
+
args: [{
|
|
637
|
+
isSignal: true,
|
|
638
|
+
alias: "pt",
|
|
639
|
+
required: false
|
|
640
|
+
}]
|
|
641
|
+
}],
|
|
642
|
+
ptOptions: [{
|
|
643
|
+
type: i0.Input,
|
|
644
|
+
args: [{
|
|
645
|
+
isSignal: true,
|
|
646
|
+
alias: "ptOptions",
|
|
647
|
+
required: false
|
|
648
|
+
}]
|
|
649
|
+
}],
|
|
650
|
+
unstyled: [{
|
|
651
|
+
type: i0.Input,
|
|
652
|
+
args: [{
|
|
653
|
+
isSignal: true,
|
|
654
|
+
alias: "unstyled",
|
|
655
|
+
required: false
|
|
656
|
+
}]
|
|
657
|
+
}]
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
const BUILT_IN_MESSAGES = {
|
|
661
|
+
required: "validationRequired",
|
|
662
|
+
email: "validationEmail",
|
|
663
|
+
minlength: "validationMinlength",
|
|
664
|
+
maxlength: "validationMaxlength",
|
|
665
|
+
min: "validationMin",
|
|
666
|
+
max: "validationMax",
|
|
667
|
+
pattern: "validationPattern"
|
|
668
|
+
};
|
|
669
|
+
var TxFieldError = class TxFieldError {
|
|
670
|
+
generatedId = uniqueId("tx-field-error");
|
|
671
|
+
globalMessages = inject(TECTRA_CONFIG, { optional: true })?.validationMessages;
|
|
672
|
+
translations = injectTranslations();
|
|
673
|
+
version = signal(0, ...ngDevMode ? [{ debugName: "version" }] : /* istanbul ignore next */ []);
|
|
674
|
+
control = input(void 0, ...ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []);
|
|
675
|
+
errorText = input(void 0, ...ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []);
|
|
676
|
+
showImmediately = input(false, {
|
|
677
|
+
...ngDevMode ? { debugName: "showImmediately" } : /* istanbul ignore next */ {},
|
|
678
|
+
transform: booleanAttribute
|
|
679
|
+
});
|
|
680
|
+
successText = input(void 0, ...ngDevMode ? [{ debugName: "successText" }] : /* istanbul ignore next */ []);
|
|
681
|
+
messages = input(void 0, ...ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []);
|
|
682
|
+
for = input(void 0, ...ngDevMode ? [{ debugName: "for" }] : /* istanbul ignore next */ []);
|
|
683
|
+
id = input(void 0, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
684
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
685
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
686
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
687
|
+
unstyled = input(void 0, {
|
|
688
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
689
|
+
transform: optionalBoolean
|
|
690
|
+
});
|
|
691
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
692
|
+
passThrough = injectPassThrough("fieldError", this, this.pt, this.ptOptions);
|
|
693
|
+
resolvedId = computed(() => this.id() ?? this.generatedId, ...ngDevMode ? [{ debugName: "resolvedId" }] : /* istanbul ignore next */ []);
|
|
694
|
+
hostStyle = computed(() => ({
|
|
695
|
+
...toStyleObject(this.dt(), "--tx-field-message"),
|
|
696
|
+
...this.passThrough().root?.style
|
|
697
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
698
|
+
errorKey = computed(() => {
|
|
699
|
+
this.version();
|
|
700
|
+
return Object.keys(this.control()?.errors ?? {})[0] ?? null;
|
|
701
|
+
}, ...ngDevMode ? [{ debugName: "errorKey" }] : /* istanbul ignore next */ []);
|
|
702
|
+
shownError = computed(() => {
|
|
703
|
+
this.version();
|
|
704
|
+
const external = this.errorText();
|
|
705
|
+
if (external) return external;
|
|
706
|
+
const control = this.control();
|
|
707
|
+
const key = this.errorKey();
|
|
708
|
+
if (!control || !key || !(this.showImmediately() || control.touched || control.dirty)) return null;
|
|
709
|
+
return this.describe(key, control.errors?.[key]);
|
|
710
|
+
}, ...ngDevMode ? [{ debugName: "shownError" }] : /* istanbul ignore next */ []);
|
|
711
|
+
successShown = computed(() => {
|
|
712
|
+
this.version();
|
|
713
|
+
const control = this.control();
|
|
714
|
+
return !!control && !!this.successText() && !this.shownError() && control.valid && hasValue(control.value) && (control.touched || control.dirty);
|
|
715
|
+
}, ...ngDevMode ? [{ debugName: "successShown" }] : /* istanbul ignore next */ []);
|
|
716
|
+
state = computed(() => this.shownError() ? "error" : this.successShown() ? "success" : null, ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
717
|
+
constructor() {
|
|
718
|
+
injectDescribedBy(this.for, this.resolvedId);
|
|
719
|
+
effect((onCleanup) => {
|
|
720
|
+
const subscription = this.control()?.events.subscribe(() => this.version.update((value) => value + 1));
|
|
721
|
+
onCleanup(() => subscription?.unsubscribe());
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
describe(key, error) {
|
|
725
|
+
const custom = this.messages()?.[key] ?? this.globalMessages?.[key];
|
|
726
|
+
if (custom) return interpolate(typeof custom === "function" ? custom(error) : custom, error);
|
|
727
|
+
if (isObject(error) && typeof error["message"] === "string") return error["message"];
|
|
728
|
+
return interpolate(this.translations()[BUILT_IN_MESSAGES[key] ?? "validationInvalid"], error);
|
|
729
|
+
}
|
|
730
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
731
|
+
minVersion: "12.0.0",
|
|
732
|
+
version: "22.2.3",
|
|
733
|
+
ngImport: i0,
|
|
734
|
+
type: TxFieldError,
|
|
735
|
+
deps: [],
|
|
736
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
737
|
+
});
|
|
738
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
739
|
+
minVersion: "17.0.0",
|
|
740
|
+
version: "22.2.3",
|
|
741
|
+
type: TxFieldError,
|
|
742
|
+
isStandalone: true,
|
|
743
|
+
selector: "tx-field-error",
|
|
744
|
+
inputs: {
|
|
745
|
+
control: {
|
|
746
|
+
classPropertyName: "control",
|
|
747
|
+
publicName: "control",
|
|
748
|
+
isSignal: true,
|
|
749
|
+
isRequired: false,
|
|
750
|
+
transformFunction: null
|
|
751
|
+
},
|
|
752
|
+
errorText: {
|
|
753
|
+
classPropertyName: "errorText",
|
|
754
|
+
publicName: "errorText",
|
|
755
|
+
isSignal: true,
|
|
756
|
+
isRequired: false,
|
|
757
|
+
transformFunction: null
|
|
758
|
+
},
|
|
759
|
+
showImmediately: {
|
|
760
|
+
classPropertyName: "showImmediately",
|
|
761
|
+
publicName: "showImmediately",
|
|
762
|
+
isSignal: true,
|
|
763
|
+
isRequired: false,
|
|
764
|
+
transformFunction: null
|
|
765
|
+
},
|
|
766
|
+
successText: {
|
|
767
|
+
classPropertyName: "successText",
|
|
768
|
+
publicName: "successText",
|
|
769
|
+
isSignal: true,
|
|
770
|
+
isRequired: false,
|
|
771
|
+
transformFunction: null
|
|
772
|
+
},
|
|
773
|
+
messages: {
|
|
774
|
+
classPropertyName: "messages",
|
|
775
|
+
publicName: "messages",
|
|
776
|
+
isSignal: true,
|
|
777
|
+
isRequired: false,
|
|
778
|
+
transformFunction: null
|
|
779
|
+
},
|
|
780
|
+
for: {
|
|
781
|
+
classPropertyName: "for",
|
|
782
|
+
publicName: "for",
|
|
783
|
+
isSignal: true,
|
|
784
|
+
isRequired: false,
|
|
785
|
+
transformFunction: null
|
|
786
|
+
},
|
|
787
|
+
id: {
|
|
788
|
+
classPropertyName: "id",
|
|
789
|
+
publicName: "id",
|
|
790
|
+
isSignal: true,
|
|
791
|
+
isRequired: false,
|
|
792
|
+
transformFunction: null
|
|
793
|
+
},
|
|
794
|
+
dt: {
|
|
795
|
+
classPropertyName: "dt",
|
|
796
|
+
publicName: "dt",
|
|
797
|
+
isSignal: true,
|
|
798
|
+
isRequired: false,
|
|
799
|
+
transformFunction: null
|
|
800
|
+
},
|
|
801
|
+
pt: {
|
|
802
|
+
classPropertyName: "pt",
|
|
803
|
+
publicName: "pt",
|
|
804
|
+
isSignal: true,
|
|
805
|
+
isRequired: false,
|
|
806
|
+
transformFunction: null
|
|
807
|
+
},
|
|
808
|
+
ptOptions: {
|
|
809
|
+
classPropertyName: "ptOptions",
|
|
810
|
+
publicName: "ptOptions",
|
|
811
|
+
isSignal: true,
|
|
812
|
+
isRequired: false,
|
|
813
|
+
transformFunction: null
|
|
814
|
+
},
|
|
815
|
+
unstyled: {
|
|
816
|
+
classPropertyName: "unstyled",
|
|
817
|
+
publicName: "unstyled",
|
|
818
|
+
isSignal: true,
|
|
819
|
+
isRequired: false,
|
|
820
|
+
transformFunction: null
|
|
821
|
+
}
|
|
822
|
+
},
|
|
823
|
+
host: {
|
|
824
|
+
attributes: { "aria-live": "polite" },
|
|
825
|
+
properties: {
|
|
826
|
+
"class": "passThrough().root?.class",
|
|
827
|
+
"style": "hostStyle()",
|
|
828
|
+
"id": "resolvedId()",
|
|
829
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
830
|
+
"attr.data-state": "state()"
|
|
831
|
+
},
|
|
832
|
+
classAttribute: "tx-field-message tx-field-error"
|
|
833
|
+
},
|
|
834
|
+
ngImport: i0,
|
|
835
|
+
template: "@if (shownError(); as text) {\n <div class=\"tx-field-message__row\" animate.enter=\"tx-field-message--enter\" animate.leave=\"tx-field-message--leave\">\n <span class=\"tx-field-message__inner\">\n <span class=\"tx-field-message__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"'exclamation-circle'\" />\n </span>\n <span class=\"tx-field-message__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text }}</span>\n </span>\n </div>\n} @else if (successShown()) {\n <div class=\"tx-field-message__row tx-field-message__row--success\" animate.enter=\"tx-field-message--enter\" animate.leave=\"tx-field-message--leave\">\n <span class=\"tx-field-message__inner\">\n <span class=\"tx-field-message__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"'check-circle'\" />\n </span>\n <span class=\"tx-field-message__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ successText() }}</span>\n </span>\n </div>\n}\n",
|
|
836
|
+
styles: [":host{display:block}:host([data-styled]){--_color: var(--tx-field-message-hint-color);color:var(--_color);font-family:var(--tx-font-family);font-size:var(--tx-field-message-font-size);line-height:var(--tx-field-message-line-height)}:host([data-styled].tx-field-hint){display:flex;align-items:flex-start;gap:var(--tx-field-message-gap);margin-top:var(--tx-field-message-margin-top)}:host([data-styled][data-severity=success]),:host([data-styled]) .tx-field-message__row--success{--_color: var(--tx-field-message-success-color);color:var(--_color)}:host([data-styled].tx-field-error){--_color: var(--tx-field-message-error-color)}:host([data-styled]) .tx-field-message__row{display:grid;grid-template-rows:1fr}:host([data-styled]) .tx-field-message__inner{display:flex;align-items:flex-start;gap:var(--tx-field-message-gap);min-height:0;padding-top:var(--tx-field-message-margin-top);overflow:hidden}:host([data-styled]) .tx-field-message__icon{display:inline-flex;flex-shrink:0;align-items:center;height:1lh;font-size:var(--tx-field-message-icon-size)}:host([data-styled]) .tx-field-message--enter{animation:tx-field-message-in var(--tx-field-message-transition-duration) cubic-bezier(.16,1,.3,1)}:host([data-styled]) .tx-field-message--leave{animation:tx-field-message-in calc(var(--tx-field-message-transition-duration) * .8) ease-in reverse forwards}@keyframes tx-field-message-in{0%{grid-template-rows:0fr;opacity:0;transform:translateY(-4px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-field-message--enter,:host([data-styled]) .tx-field-message--leave{animation-duration:1ms}}\n"],
|
|
837
|
+
dependencies: [{
|
|
838
|
+
kind: "component",
|
|
839
|
+
type: TxIcon,
|
|
840
|
+
selector: "tx-icon",
|
|
841
|
+
inputs: ["name"]
|
|
842
|
+
}],
|
|
843
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
844
|
+
});
|
|
845
|
+
};
|
|
846
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
847
|
+
minVersion: "12.0.0",
|
|
848
|
+
version: "22.2.3",
|
|
849
|
+
ngImport: i0,
|
|
850
|
+
type: TxFieldError,
|
|
851
|
+
decorators: [{
|
|
852
|
+
type: Component,
|
|
853
|
+
args: [{
|
|
854
|
+
selector: "tx-field-error",
|
|
855
|
+
imports: [TxIcon],
|
|
856
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
857
|
+
host: {
|
|
858
|
+
class: "tx-field-message tx-field-error",
|
|
859
|
+
"[class]": "passThrough().root?.class",
|
|
860
|
+
"[style]": "hostStyle()",
|
|
861
|
+
"[id]": "resolvedId()",
|
|
862
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
863
|
+
"[attr.data-state]": "state()",
|
|
864
|
+
"aria-live": "polite"
|
|
865
|
+
},
|
|
866
|
+
template: "@if (shownError(); as text) {\n <div class=\"tx-field-message__row\" animate.enter=\"tx-field-message--enter\" animate.leave=\"tx-field-message--leave\">\n <span class=\"tx-field-message__inner\">\n <span class=\"tx-field-message__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"'exclamation-circle'\" />\n </span>\n <span class=\"tx-field-message__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text }}</span>\n </span>\n </div>\n} @else if (successShown()) {\n <div class=\"tx-field-message__row tx-field-message__row--success\" animate.enter=\"tx-field-message--enter\" animate.leave=\"tx-field-message--leave\">\n <span class=\"tx-field-message__inner\">\n <span class=\"tx-field-message__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"'check-circle'\" />\n </span>\n <span class=\"tx-field-message__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ successText() }}</span>\n </span>\n </div>\n}\n",
|
|
867
|
+
styles: [":host{display:block}:host([data-styled]){--_color: var(--tx-field-message-hint-color);color:var(--_color);font-family:var(--tx-font-family);font-size:var(--tx-field-message-font-size);line-height:var(--tx-field-message-line-height)}:host([data-styled].tx-field-hint){display:flex;align-items:flex-start;gap:var(--tx-field-message-gap);margin-top:var(--tx-field-message-margin-top)}:host([data-styled][data-severity=success]),:host([data-styled]) .tx-field-message__row--success{--_color: var(--tx-field-message-success-color);color:var(--_color)}:host([data-styled].tx-field-error){--_color: var(--tx-field-message-error-color)}:host([data-styled]) .tx-field-message__row{display:grid;grid-template-rows:1fr}:host([data-styled]) .tx-field-message__inner{display:flex;align-items:flex-start;gap:var(--tx-field-message-gap);min-height:0;padding-top:var(--tx-field-message-margin-top);overflow:hidden}:host([data-styled]) .tx-field-message__icon{display:inline-flex;flex-shrink:0;align-items:center;height:1lh;font-size:var(--tx-field-message-icon-size)}:host([data-styled]) .tx-field-message--enter{animation:tx-field-message-in var(--tx-field-message-transition-duration) cubic-bezier(.16,1,.3,1)}:host([data-styled]) .tx-field-message--leave{animation:tx-field-message-in calc(var(--tx-field-message-transition-duration) * .8) ease-in reverse forwards}@keyframes tx-field-message-in{0%{grid-template-rows:0fr;opacity:0;transform:translateY(-4px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-field-message--enter,:host([data-styled]) .tx-field-message--leave{animation-duration:1ms}}\n"]
|
|
868
|
+
}]
|
|
869
|
+
}],
|
|
870
|
+
ctorParameters: () => [],
|
|
871
|
+
propDecorators: {
|
|
872
|
+
control: [{
|
|
873
|
+
type: i0.Input,
|
|
874
|
+
args: [{
|
|
875
|
+
isSignal: true,
|
|
876
|
+
alias: "control",
|
|
877
|
+
required: false
|
|
878
|
+
}]
|
|
879
|
+
}],
|
|
880
|
+
errorText: [{
|
|
881
|
+
type: i0.Input,
|
|
882
|
+
args: [{
|
|
883
|
+
isSignal: true,
|
|
884
|
+
alias: "errorText",
|
|
885
|
+
required: false
|
|
886
|
+
}]
|
|
887
|
+
}],
|
|
888
|
+
showImmediately: [{
|
|
889
|
+
type: i0.Input,
|
|
890
|
+
args: [{
|
|
891
|
+
isSignal: true,
|
|
892
|
+
alias: "showImmediately",
|
|
893
|
+
required: false
|
|
894
|
+
}]
|
|
895
|
+
}],
|
|
896
|
+
successText: [{
|
|
897
|
+
type: i0.Input,
|
|
898
|
+
args: [{
|
|
899
|
+
isSignal: true,
|
|
900
|
+
alias: "successText",
|
|
901
|
+
required: false
|
|
902
|
+
}]
|
|
903
|
+
}],
|
|
904
|
+
messages: [{
|
|
905
|
+
type: i0.Input,
|
|
906
|
+
args: [{
|
|
907
|
+
isSignal: true,
|
|
908
|
+
alias: "messages",
|
|
909
|
+
required: false
|
|
910
|
+
}]
|
|
911
|
+
}],
|
|
912
|
+
for: [{
|
|
913
|
+
type: i0.Input,
|
|
914
|
+
args: [{
|
|
915
|
+
isSignal: true,
|
|
916
|
+
alias: "for",
|
|
917
|
+
required: false
|
|
918
|
+
}]
|
|
919
|
+
}],
|
|
920
|
+
id: [{
|
|
921
|
+
type: i0.Input,
|
|
922
|
+
args: [{
|
|
923
|
+
isSignal: true,
|
|
924
|
+
alias: "id",
|
|
925
|
+
required: false
|
|
926
|
+
}]
|
|
927
|
+
}],
|
|
928
|
+
dt: [{
|
|
929
|
+
type: i0.Input,
|
|
930
|
+
args: [{
|
|
931
|
+
isSignal: true,
|
|
932
|
+
alias: "dt",
|
|
933
|
+
required: false
|
|
934
|
+
}]
|
|
935
|
+
}],
|
|
936
|
+
pt: [{
|
|
937
|
+
type: i0.Input,
|
|
938
|
+
args: [{
|
|
939
|
+
isSignal: true,
|
|
940
|
+
alias: "pt",
|
|
941
|
+
required: false
|
|
942
|
+
}]
|
|
943
|
+
}],
|
|
944
|
+
ptOptions: [{
|
|
945
|
+
type: i0.Input,
|
|
946
|
+
args: [{
|
|
947
|
+
isSignal: true,
|
|
948
|
+
alias: "ptOptions",
|
|
949
|
+
required: false
|
|
950
|
+
}]
|
|
951
|
+
}],
|
|
952
|
+
unstyled: [{
|
|
953
|
+
type: i0.Input,
|
|
954
|
+
args: [{
|
|
955
|
+
isSignal: true,
|
|
956
|
+
alias: "unstyled",
|
|
957
|
+
required: false
|
|
958
|
+
}]
|
|
959
|
+
}]
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
function isObject(value) {
|
|
963
|
+
return typeof value === "object" && value !== null;
|
|
964
|
+
}
|
|
965
|
+
function interpolate(template, error) {
|
|
966
|
+
const params = isObject(error) ? error : {};
|
|
967
|
+
return template.replace(/\{(\w+)\}/g, (match, name) => params[name] === void 0 ? match : String(params[name]));
|
|
968
|
+
}
|
|
969
|
+
function hasValue(value) {
|
|
970
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
971
|
+
return value !== null && value !== void 0 && String(value).trim() !== "";
|
|
972
|
+
}
|
|
973
|
+
export { TxFieldError, TxFieldHint, TxMessage, TxMessageCloseIconTemplate, TxMessageIconTemplate };
|
|
974
|
+
|
|
975
|
+
//# sourceMappingURL=tectra-ng-ui-message.mjs.map
|