@tectra-ng/ui 0.4.3 → 0.4.5
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/amount/README.md +19 -1
- package/analog-clock/README.md +1 -1
- package/autocomplete/README.md +1 -1
- package/avatar/README.md +24 -4
- package/cascade-select/README.md +1 -1
- package/chips-input/README.md +10 -5
- package/color-picker/README.md +5 -0
- package/countdown/README.md +7 -1
- package/country/README.md +14 -1
- package/country-select/README.md +2 -1
- package/export/README.md +27 -2
- package/export-font/README.md +1 -1
- package/fesm2022/tectra-ng-ui-accordion.mjs +21 -21
- package/fesm2022/tectra-ng-ui-amount.mjs +99 -17
- package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-analog-clock.mjs +12 -25
- package/fesm2022/tectra-ng-ui-analog-clock.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +8 -7
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-avatar.mjs +68 -26
- package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-badge.mjs +3 -3
- package/fesm2022/tectra-ng-ui-breadcrumb.mjs +9 -9
- package/fesm2022/tectra-ng-ui-button-group.mjs +3 -3
- package/fesm2022/tectra-ng-ui-button.mjs +11 -11
- package/fesm2022/tectra-ng-ui-button.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-card.mjs +5 -5
- package/fesm2022/tectra-ng-ui-card.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-carousel.mjs +15 -15
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +10 -7
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-checkbox.mjs +9 -9
- package/fesm2022/tectra-ng-ui-chip.mjs +3 -3
- package/fesm2022/tectra-ng-ui-chips-input.mjs +120 -21
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-picker.mjs +96 -9
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-swatches.mjs +3 -3
- package/fesm2022/tectra-ng-ui-confirm.mjs +9 -9
- package/fesm2022/tectra-ng-ui-countdown.mjs +48 -19
- package/fesm2022/tectra-ng-ui-countdown.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-country-select.mjs +31 -8
- package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-country.mjs +18 -9
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-data-view.mjs +30 -30
- package/fesm2022/tectra-ng-ui-datepicker.mjs +53 -40
- package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-dialog.mjs +30 -30
- package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-divider.mjs +3 -3
- package/fesm2022/tectra-ng-ui-drawer.mjs +9 -9
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs +3 -3
- package/fesm2022/tectra-ng-ui-export.mjs +1264 -111
- package/fesm2022/tectra-ng-ui-export.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-field.mjs +4 -3
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-fieldset.mjs +5 -5
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-file-upload.mjs +12 -12
- package/fesm2022/tectra-ng-ui-galleria.mjs +21 -21
- package/fesm2022/tectra-ng-ui-highlight-text.mjs +3 -3
- package/fesm2022/tectra-ng-ui-icon-field.mjs +63 -35
- package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-image.mjs +9 -9
- package/fesm2022/tectra-ng-ui-input-group.mjs +6 -6
- package/fesm2022/tectra-ng-ui-input-mask.mjs +3 -3
- package/fesm2022/tectra-ng-ui-input-number.mjs +5 -5
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input-otp.mjs +3 -3
- package/fesm2022/tectra-ng-ui-input.mjs +11 -10
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-key-filter.mjs +87 -22
- package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-knob.mjs +30 -8
- package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-label.mjs +77 -18
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-link.mjs +44 -20
- package/fesm2022/tectra-ng-ui-link.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-list-input.mjs +3 -3
- package/fesm2022/tectra-ng-ui-listbox.mjs +3 -3
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs +19 -8
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-menu.mjs +15 -15
- package/fesm2022/tectra-ng-ui-menubar.mjs +6 -6
- package/fesm2022/tectra-ng-ui-message.mjs +23 -19
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-month-calendar.mjs +32 -15
- package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-multiselect.mjs +6 -5
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs +3 -3
- package/fesm2022/tectra-ng-ui-paginator.mjs +9 -9
- package/fesm2022/tectra-ng-ui-panel-menu.mjs +51 -20
- package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-panel.mjs +7 -5
- package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-password-generator.mjs +24 -7
- package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-password.mjs +14 -14
- package/fesm2022/tectra-ng-ui-password.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-pill.mjs +39 -19
- package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-popover.mjs +15 -15
- package/fesm2022/tectra-ng-ui-progress-bar.mjs +6 -6
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs +3 -3
- package/fesm2022/tectra-ng-ui-radio-button.mjs +6 -6
- package/fesm2022/tectra-ng-ui-rating.mjs +11 -11
- package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-scroll-panel.mjs +3 -3
- package/fesm2022/tectra-ng-ui-select-button.mjs +6 -6
- package/fesm2022/tectra-ng-ui-select.mjs +66 -43
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-skeleton.mjs +6 -6
- package/fesm2022/tectra-ng-ui-slider.mjs +3 -3
- package/fesm2022/tectra-ng-ui-sparkline.mjs +3 -3
- package/fesm2022/tectra-ng-ui-speed-dial.mjs +3 -3
- package/fesm2022/tectra-ng-ui-split-button.mjs +3 -3
- package/fesm2022/tectra-ng-ui-splitter.mjs +6 -6
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs +99 -14
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-status-icon.mjs +43 -6
- package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-stepper.mjs +41 -35
- package/fesm2022/tectra-ng-ui-stepper.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-table.mjs +74 -60
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tabs.mjs +18 -18
- package/fesm2022/tectra-ng-ui-tag.mjs +8 -8
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-textarea.mjs +9 -9
- package/fesm2022/tectra-ng-ui-timeline.mjs +15 -15
- package/fesm2022/tectra-ng-ui-toast.mjs +11 -11
- package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-toggle-button.mjs +3 -3
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs +6 -6
- package/fesm2022/tectra-ng-ui-toolbar.mjs +12 -12
- package/fesm2022/tectra-ng-ui-tooltip.mjs +9 -9
- package/fesm2022/tectra-ng-ui-tree-select.mjs +13 -11
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-table.mjs +7 -7
- package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree.mjs +30 -30
- package/fesm2022/tectra-ng-ui-truncate-text.mjs +36 -12
- package/fesm2022/tectra-ng-ui-truncate-text.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-virtual-scroller.mjs +15 -15
- package/fesm2022/tectra-ng-ui.mjs +1 -1
- package/icon-field/README.md +2 -1
- package/input/README.md +1 -1
- package/key-filter/README.md +3 -2
- package/knob/README.md +3 -1
- package/label/README.md +4 -1
- package/link/README.md +4 -1
- package/message/README.md +2 -2
- package/month-calendar/README.md +2 -1
- package/multiselect/README.md +1 -1
- package/package.json +4 -4
- package/panel/README.md +3 -1
- package/panel-menu/README.md +3 -2
- package/password-generator/README.md +2 -0
- package/pill/README.md +4 -4
- package/select/README.md +1 -1
- package/stat-tiles/README.md +17 -1
- package/status-icon/README.md +3 -1
- package/table/README.md +1 -1
- package/tag/README.md +2 -0
- package/tree-select/README.md +1 -1
- package/truncate-text/README.md +2 -1
- package/types/tectra-ng-ui-amount.d.ts +41 -1
- package/types/tectra-ng-ui-amount.d.ts.map +1 -1
- package/types/tectra-ng-ui-analog-clock.d.ts +1 -4
- package/types/tectra-ng-ui-analog-clock.d.ts.map +1 -1
- package/types/tectra-ng-ui-autocomplete.d.ts +1 -1
- package/types/tectra-ng-ui-avatar.d.ts +45 -12
- package/types/tectra-ng-ui-avatar.d.ts.map +1 -1
- package/types/tectra-ng-ui-cascade-select.d.ts +3 -2
- package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-chips-input.d.ts +54 -6
- package/types/tectra-ng-ui-chips-input.d.ts.map +1 -1
- package/types/tectra-ng-ui-color-picker.d.ts +38 -1
- package/types/tectra-ng-ui-color-picker.d.ts.map +1 -1
- package/types/tectra-ng-ui-countdown.d.ts +12 -1
- package/types/tectra-ng-ui-countdown.d.ts.map +1 -1
- package/types/tectra-ng-ui-country-select.d.ts +17 -4
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-country.d.ts +7 -1
- package/types/tectra-ng-ui-country.d.ts.map +1 -1
- package/types/tectra-ng-ui-datepicker.d.ts +4 -2
- package/types/tectra-ng-ui-datepicker.d.ts.map +1 -1
- package/types/tectra-ng-ui-export.d.ts +68 -8
- package/types/tectra-ng-ui-export.d.ts.map +1 -1
- package/types/tectra-ng-ui-icon-field.d.ts +9 -2
- package/types/tectra-ng-ui-icon-field.d.ts.map +1 -1
- package/types/tectra-ng-ui-input.d.ts +1 -1
- package/types/tectra-ng-ui-key-filter.d.ts +19 -4
- package/types/tectra-ng-ui-key-filter.d.ts.map +1 -1
- package/types/tectra-ng-ui-knob.d.ts +10 -2
- package/types/tectra-ng-ui-knob.d.ts.map +1 -1
- package/types/tectra-ng-ui-label.d.ts +8 -1
- package/types/tectra-ng-ui-label.d.ts.map +1 -1
- package/types/tectra-ng-ui-link.d.ts +8 -2
- package/types/tectra-ng-ui-link.d.ts.map +1 -1
- package/types/tectra-ng-ui-mention-textarea.d.ts +5 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -1
- package/types/tectra-ng-ui-message.d.ts +1 -1
- package/types/tectra-ng-ui-message.d.ts.map +1 -1
- package/types/tectra-ng-ui-month-calendar.d.ts +14 -4
- package/types/tectra-ng-ui-month-calendar.d.ts.map +1 -1
- package/types/tectra-ng-ui-multiselect.d.ts +1 -1
- package/types/tectra-ng-ui-panel-menu.d.ts +34 -6
- package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -1
- package/types/tectra-ng-ui-panel.d.ts +1 -1
- package/types/tectra-ng-ui-panel.d.ts.map +1 -1
- package/types/tectra-ng-ui-password-generator.d.ts +10 -3
- package/types/tectra-ng-ui-password-generator.d.ts.map +1 -1
- package/types/tectra-ng-ui-pill.d.ts +9 -5
- package/types/tectra-ng-ui-pill.d.ts.map +1 -1
- package/types/tectra-ng-ui-select.d.ts +5 -2
- package/types/tectra-ng-ui-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-stat-tiles.d.ts +49 -5
- package/types/tectra-ng-ui-stat-tiles.d.ts.map +1 -1
- package/types/tectra-ng-ui-status-icon.d.ts +20 -2
- package/types/tectra-ng-ui-status-icon.d.ts.map +1 -1
- package/types/tectra-ng-ui-stepper.d.ts +1 -0
- package/types/tectra-ng-ui-stepper.d.ts.map +1 -1
- package/types/tectra-ng-ui-table.d.ts +2 -1
- package/types/tectra-ng-ui-table.d.ts.map +1 -1
- package/types/tectra-ng-ui-tree-select.d.ts +3 -3
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-truncate-text.d.ts +7 -2
- package/types/tectra-ng-ui-truncate-text.d.ts.map +1 -1
- package/types/tectra-ng-ui.d.ts +1 -1
|
@@ -4,7 +4,7 @@ import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, booleanAttrib
|
|
|
4
4
|
import { RouterLink, RouterLinkActive } from "@angular/router";
|
|
5
5
|
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
6
6
|
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
7
|
-
import { optionalBoolean, optionalNumber } from "@tectra-ng/core/utils";
|
|
7
|
+
import { optionalBoolean, optionalNumber, writeToClipboard } from "@tectra-ng/core/utils";
|
|
8
8
|
import { TxIcon, injectTxIcons, provideTxIconDefaults, txIconArrowUpRight, txIconCheck, txIconCopy, txIconLink, txIconPhone, txIconText } from "@tectra-ng/icons";
|
|
9
9
|
import { iconLinkTokens, linkTokens, toStyleObject } from "@tectra-ng/themes";
|
|
10
10
|
import { TxHighlightText } from "@tectra-ng/ui/highlight-text";
|
|
@@ -54,7 +54,7 @@ var TxIconLink = class TxIconLink {
|
|
|
54
54
|
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
55
55
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
56
56
|
minVersion: "12.0.0",
|
|
57
|
-
version: "22.2.
|
|
57
|
+
version: "22.2.6",
|
|
58
58
|
ngImport: i0,
|
|
59
59
|
type: TxIconLink,
|
|
60
60
|
deps: [],
|
|
@@ -62,7 +62,7 @@ var TxIconLink = class TxIconLink {
|
|
|
62
62
|
});
|
|
63
63
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
64
64
|
minVersion: "17.0.0",
|
|
65
|
-
version: "22.2.
|
|
65
|
+
version: "22.2.6",
|
|
66
66
|
type: TxIconLink,
|
|
67
67
|
isStandalone: true,
|
|
68
68
|
selector: "tx-icon-link",
|
|
@@ -148,7 +148,7 @@ var TxIconLink = class TxIconLink {
|
|
|
148
148
|
},
|
|
149
149
|
ngImport: i0,
|
|
150
150
|
template: "<ng-template #content>\n @if (icon(); as icon) {\n @if (iconName(); as name) {\n <tx-icon class=\"tx-icon-link__icon\" [name]=\"name\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\" />\n } @else {\n <span class=\"tx-icon-link__icon\" aria-hidden=\"true\" [class]=\"icon\" [ngClass]=\"passThrough().icon?.class ?? null\" [style]=\"passThrough().icon?.style\"></span>\n }\n }\n <span class=\"tx-icon-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text() }}<ng-content /></span>\n @if (opensNewTab()) {\n <span class=\"tx-icon-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a\n class=\"tx-icon-link__anchor\"\n [routerLink]=\"$any(commands)\"\n routerLinkActive=\"tx-icon-link__anchor--active\"\n ariaCurrentWhenActive=\"page\"\n [routerLinkActiveOptions]=\"{ exact: exact() }\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else if (href()) {\n <a\n class=\"tx-icon-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <button type=\"button\" class=\"tx-icon-link__anchor\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </button>\n}\n",
|
|
151
|
-
styles: [":host{display:inline-flex;min-width:0}.tx-icon-link__anchor{display:inline-flex;align-items:center;min-width:0}.tx-icon-link__text{min-width:0}.tx-icon-link__hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host([data-styled]) .tx-icon-link__anchor{gap:var(--tx-icon-link-gap);padding:var(--tx-icon-link-padding-y) var(--tx-icon-link-padding-x);border:none;border-radius:var(--tx-icon-link-border-radius);background:transparent;color:var(--tx-icon-link-color);font-family:inherit;font-size:var(--tx-icon-link-font-size);font-weight:var(--tx-icon-link-font-weight);text-decoration:none;cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host([data-styled]) .tx-icon-link__anchor:hover{background:var(--tx-icon-link-hover-background);color:var(--tx-icon-link-hover-color)}:host([data-styled]) .tx-icon-link__anchor:focus-visible{outline:2px solid var(--tx-icon-link-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-icon-link__anchor--active
|
|
151
|
+
styles: [":host{display:inline-flex;min-width:0}:host :where(.tx-icon-link__anchor){display:inline-flex;align-items:center;min-width:0}:host :where(.tx-icon-link__text){min-width:0}.tx-icon-link__hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host(:where([data-styled])) :where(.tx-icon-link__anchor){gap:var(--tx-icon-link-gap);padding:var(--tx-icon-link-padding-y) var(--tx-icon-link-padding-x);border:none;border-radius:var(--tx-icon-link-border-radius);background:transparent;color:var(--tx-icon-link-color);font-family:inherit;font-size:var(--tx-icon-link-font-size);font-weight:var(--tx-icon-link-font-weight);text-decoration:none;cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host(:where([data-styled])) :where(.tx-icon-link__anchor:hover){background:var(--tx-icon-link-hover-background);color:var(--tx-icon-link-hover-color)}:host(:where([data-styled])) :where(.tx-icon-link__anchor:focus-visible){outline:2px solid var(--tx-icon-link-focus-ring-color);outline-offset:1px}:host(:where([data-styled])) :where(.tx-icon-link__anchor--active,.tx-icon-link__anchor--active:hover){background:var(--tx-icon-link-active-background);color:var(--tx-icon-link-active-color)}:host(:where([data-styled])) :where(.tx-icon-link__icon){flex-shrink:0;font-size:var(--tx-icon-link-icon-size)}@media(prefers-reduced-motion:reduce){:host(:where([data-styled])) :where(.tx-icon-link__anchor){transition:none}}\n"],
|
|
152
152
|
dependencies: [
|
|
153
153
|
{
|
|
154
154
|
kind: "directive",
|
|
@@ -210,7 +210,7 @@ var TxIconLink = class TxIconLink {
|
|
|
210
210
|
};
|
|
211
211
|
i0.ɵɵngDeclareClassMetadata({
|
|
212
212
|
minVersion: "12.0.0",
|
|
213
|
-
version: "22.2.
|
|
213
|
+
version: "22.2.6",
|
|
214
214
|
ngImport: i0,
|
|
215
215
|
type: TxIconLink,
|
|
216
216
|
decorators: [{
|
|
@@ -233,7 +233,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
233
233
|
},
|
|
234
234
|
viewProviders: [provideTxIconDefaults(LINK_ICON_DEFAULTS)],
|
|
235
235
|
template: "<ng-template #content>\n @if (icon(); as icon) {\n @if (iconName(); as name) {\n <tx-icon class=\"tx-icon-link__icon\" [name]=\"name\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\" />\n } @else {\n <span class=\"tx-icon-link__icon\" aria-hidden=\"true\" [class]=\"icon\" [ngClass]=\"passThrough().icon?.class ?? null\" [style]=\"passThrough().icon?.style\"></span>\n }\n }\n <span class=\"tx-icon-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text() }}<ng-content /></span>\n @if (opensNewTab()) {\n <span class=\"tx-icon-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a\n class=\"tx-icon-link__anchor\"\n [routerLink]=\"$any(commands)\"\n routerLinkActive=\"tx-icon-link__anchor--active\"\n ariaCurrentWhenActive=\"page\"\n [routerLinkActiveOptions]=\"{ exact: exact() }\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else if (href()) {\n <a\n class=\"tx-icon-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <button type=\"button\" class=\"tx-icon-link__anchor\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </button>\n}\n",
|
|
236
|
-
styles: [":host{display:inline-flex;min-width:0}.tx-icon-link__anchor{display:inline-flex;align-items:center;min-width:0}.tx-icon-link__text{min-width:0}.tx-icon-link__hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host([data-styled]) .tx-icon-link__anchor{gap:var(--tx-icon-link-gap);padding:var(--tx-icon-link-padding-y) var(--tx-icon-link-padding-x);border:none;border-radius:var(--tx-icon-link-border-radius);background:transparent;color:var(--tx-icon-link-color);font-family:inherit;font-size:var(--tx-icon-link-font-size);font-weight:var(--tx-icon-link-font-weight);text-decoration:none;cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host([data-styled]) .tx-icon-link__anchor:hover{background:var(--tx-icon-link-hover-background);color:var(--tx-icon-link-hover-color)}:host([data-styled]) .tx-icon-link__anchor:focus-visible{outline:2px solid var(--tx-icon-link-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-icon-link__anchor--active
|
|
236
|
+
styles: [":host{display:inline-flex;min-width:0}:host :where(.tx-icon-link__anchor){display:inline-flex;align-items:center;min-width:0}:host :where(.tx-icon-link__text){min-width:0}.tx-icon-link__hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host(:where([data-styled])) :where(.tx-icon-link__anchor){gap:var(--tx-icon-link-gap);padding:var(--tx-icon-link-padding-y) var(--tx-icon-link-padding-x);border:none;border-radius:var(--tx-icon-link-border-radius);background:transparent;color:var(--tx-icon-link-color);font-family:inherit;font-size:var(--tx-icon-link-font-size);font-weight:var(--tx-icon-link-font-weight);text-decoration:none;cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host(:where([data-styled])) :where(.tx-icon-link__anchor:hover){background:var(--tx-icon-link-hover-background);color:var(--tx-icon-link-hover-color)}:host(:where([data-styled])) :where(.tx-icon-link__anchor:focus-visible){outline:2px solid var(--tx-icon-link-focus-ring-color);outline-offset:1px}:host(:where([data-styled])) :where(.tx-icon-link__anchor--active,.tx-icon-link__anchor--active:hover){background:var(--tx-icon-link-active-background);color:var(--tx-icon-link-active-color)}:host(:where([data-styled])) :where(.tx-icon-link__icon){flex-shrink:0;font-size:var(--tx-icon-link-icon-size)}@media(prefers-reduced-motion:reduce){:host(:where([data-styled])) :where(.tx-icon-link__anchor){transition:none}}\n"]
|
|
237
237
|
}]
|
|
238
238
|
}],
|
|
239
239
|
propDecorators: {
|
|
@@ -325,6 +325,7 @@ var TxLink = class TxLink {
|
|
|
325
325
|
linkTheme = injectTokens(LINK_THEME);
|
|
326
326
|
document = inject(DOCUMENT);
|
|
327
327
|
timer = null;
|
|
328
|
+
destroyed = false;
|
|
328
329
|
link = input("", ...ngDevMode ? [{ debugName: "link" }] : /* istanbul ignore next */ []);
|
|
329
330
|
type = input("url", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
330
331
|
linkText = input(void 0, ...ngDevMode ? [{ debugName: "linkText" }] : /* istanbul ignore next */ []);
|
|
@@ -351,10 +352,12 @@ var TxLink = class TxLink {
|
|
|
351
352
|
transform: optionalBoolean
|
|
352
353
|
});
|
|
353
354
|
copied = output();
|
|
355
|
+
copyFailed = output();
|
|
354
356
|
translations = injectTranslations();
|
|
355
357
|
isUnstyled = injectUnstyled(this.unstyled);
|
|
356
358
|
passThrough = injectPassThrough("link", this, this.pt, this.ptOptions);
|
|
357
359
|
isCopied = signal(false, ...ngDevMode ? [{ debugName: "isCopied" }] : /* istanbul ignore next */ []);
|
|
360
|
+
isCopyFailed = signal(false, ...ngDevMode ? [{ debugName: "isCopyFailed" }] : /* istanbul ignore next */ []);
|
|
358
361
|
value = computed(() => (this.link() ?? "").trim(), ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
359
362
|
fullText = computed(() => this.linkText() || this.value(), ...ngDevMode ? [{ debugName: "fullText" }] : /* istanbul ignore next */ []);
|
|
360
363
|
isTruncated = computed(() => {
|
|
@@ -382,24 +385,38 @@ var TxLink = class TxLink {
|
|
|
382
385
|
phone: translations.copyPhone
|
|
383
386
|
}[this.type()];
|
|
384
387
|
}, ...ngDevMode ? [{ debugName: "copyLabel" }] : /* istanbul ignore next */ []);
|
|
388
|
+
copyStateLabel = computed(() => {
|
|
389
|
+
if (this.isCopied()) return this.translations().copied;
|
|
390
|
+
return this.isCopyFailed() ? this.translations().copyToClipboardFailed : this.copyLabel();
|
|
391
|
+
}, ...ngDevMode ? [{ debugName: "copyStateLabel" }] : /* istanbul ignore next */ []);
|
|
385
392
|
hostStyle = computed(() => ({
|
|
386
393
|
...toStyleObject(this.dt(), "--tx-link"),
|
|
387
394
|
...this.passThrough().root?.style
|
|
388
395
|
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
389
396
|
constructor() {
|
|
390
|
-
inject(DestroyRef).onDestroy(() =>
|
|
397
|
+
inject(DestroyRef).onDestroy(() => {
|
|
398
|
+
this.destroyed = true;
|
|
399
|
+
if (this.timer) clearTimeout(this.timer);
|
|
400
|
+
});
|
|
391
401
|
}
|
|
392
|
-
copy() {
|
|
402
|
+
async copy() {
|
|
393
403
|
const text = this.value();
|
|
394
|
-
this.document
|
|
395
|
-
this.
|
|
396
|
-
this.isCopied.set(
|
|
404
|
+
const done = await writeToClipboard(text, this.document);
|
|
405
|
+
if (this.destroyed) return done;
|
|
406
|
+
this.isCopied.set(done);
|
|
407
|
+
this.isCopyFailed.set(!done);
|
|
408
|
+
if (done) this.copied.emit(text);
|
|
409
|
+
else this.copyFailed.emit(text);
|
|
397
410
|
if (this.timer) clearTimeout(this.timer);
|
|
398
|
-
this.timer = setTimeout(() =>
|
|
411
|
+
this.timer = setTimeout(() => {
|
|
412
|
+
this.isCopied.set(false);
|
|
413
|
+
this.isCopyFailed.set(false);
|
|
414
|
+
}, COPIED_FOR);
|
|
415
|
+
return done;
|
|
399
416
|
}
|
|
400
417
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
401
418
|
minVersion: "12.0.0",
|
|
402
|
-
version: "22.2.
|
|
419
|
+
version: "22.2.6",
|
|
403
420
|
ngImport: i0,
|
|
404
421
|
type: TxLink,
|
|
405
422
|
deps: [],
|
|
@@ -407,7 +424,7 @@ var TxLink = class TxLink {
|
|
|
407
424
|
});
|
|
408
425
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
409
426
|
minVersion: "17.0.0",
|
|
410
|
-
version: "22.2.
|
|
427
|
+
version: "22.2.6",
|
|
411
428
|
type: TxLink,
|
|
412
429
|
isStandalone: true,
|
|
413
430
|
selector: "tx-link",
|
|
@@ -504,7 +521,10 @@ var TxLink = class TxLink {
|
|
|
504
521
|
transformFunction: null
|
|
505
522
|
}
|
|
506
523
|
},
|
|
507
|
-
outputs: {
|
|
524
|
+
outputs: {
|
|
525
|
+
copied: "copied",
|
|
526
|
+
copyFailed: "copyFailed"
|
|
527
|
+
},
|
|
508
528
|
host: {
|
|
509
529
|
properties: {
|
|
510
530
|
"class": "passThrough().root?.class",
|
|
@@ -515,8 +535,8 @@ var TxLink = class TxLink {
|
|
|
515
535
|
classAttribute: "tx-link"
|
|
516
536
|
},
|
|
517
537
|
ngImport: i0,
|
|
518
|
-
template: "<ng-template #content>\n <span class=\"tx-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">\n <tx-highlight-text [text]=\"displayText()\" [highlight]=\"highlight()\" />\n </span>\n @if (showExternal()) {\n <tx-icon class=\"tx-link__external\" name=\"arrow-up-right\" [class]=\"passThrough().external?.class\" [style]=\"passThrough().external?.style\" />\n }\n @if (opensNewTab()) {\n <span class=\"tx-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a class=\"tx-link__anchor\" [routerLink]=\"$any(commands)\" [attr.title]=\"fullTitle()\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <a\n class=\"tx-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [attr.title]=\"fullTitle()\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n}\n@if (copyable() && link()) {\n <button\n type=\"button\"\n class=\"tx-link__copy\"\n [class.tx-link__copy--done]=\"isCopied()\"\n [class]=\"passThrough().copy?.class\"\n [style]=\"passThrough().copy?.style\"\n [attr.aria-label]=\"
|
|
519
|
-
styles: [":host{display:inline-flex;align-items:center;max-width:100%;min-width:0;vertical-align:bottom}.tx-link__anchor{min-width:0;overflow-wrap:anywhere}.tx-link__hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host([data-styled]){gap:var(--tx-link-gap);font-family:inherit}:host([data-styled]) .tx-link__anchor{border-radius:2px;color:var(--tx-link-color);text-decoration:underline;text-decoration-color:transparent;text-underline-offset:var(--tx-link-underline-offset);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing),text-decoration-color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-link__anchor:hover{color:var(--tx-link-hover-color);text-decoration-color:currentColor}:host([data-styled]) .tx-link__anchor:focus-visible{outline:2px solid var(--tx-link-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-link__external{margin-inline-start:.25em;vertical-align:-.05em;font-size:var(--tx-link-external-icon-size);opacity:.7}:host([data-styled]) .tx-link__copy{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--tx-link-copy-size);height:var(--tx-link-copy-size);padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-link-copy-color);font-size:var(--tx-link-copy-icon-size);cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host([data-styled]) .tx-link__copy:hover{background:var(--tx-link-copy-hover-background);color:var(--tx-link-copy-hover-color)}:host([data-styled]) .tx-link__copy:focus-visible{outline:2px solid var(--tx-link-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-link__copy--done
|
|
538
|
+
template: "<ng-template #content>\n <span class=\"tx-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">\n <tx-highlight-text [text]=\"displayText()\" [highlight]=\"highlight()\" />\n </span>\n @if (showExternal()) {\n <tx-icon class=\"tx-link__external\" name=\"arrow-up-right\" [class]=\"passThrough().external?.class\" [style]=\"passThrough().external?.style\" />\n }\n @if (opensNewTab()) {\n <span class=\"tx-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a class=\"tx-link__anchor\" [routerLink]=\"$any(commands)\" [attr.title]=\"fullTitle()\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <a\n class=\"tx-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [attr.title]=\"fullTitle()\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n}\n@if (copyable() && link()) {\n <button\n type=\"button\"\n class=\"tx-link__copy\"\n [class.tx-link__copy--done]=\"isCopied()\"\n [class]=\"passThrough().copy?.class\"\n [style]=\"passThrough().copy?.style\"\n [attr.aria-label]=\"copyStateLabel()\"\n [title]=\"copyStateLabel()\"\n (click)=\"copy()\"\n >\n <span class=\"tx-copy-swap\" [class.tx-copy-swap--done]=\"isCopied()\"><tx-icon class=\"tx-copy-swap__icon tx-copy-swap__icon--idle\" name=\"copy\" /><tx-icon class=\"tx-copy-swap__icon tx-copy-swap__icon--done\" name=\"check\" /></span>\n </button>\n}\n",
|
|
539
|
+
styles: [":host{display:inline-flex;align-items:center;max-width:100%;min-width:0;vertical-align:bottom}:host :where(.tx-link__anchor){min-width:0;overflow-wrap:anywhere}.tx-link__hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host(:where([data-styled])){gap:var(--tx-link-gap);font-family:inherit}:host(:where([data-styled])) :where(.tx-link__anchor){border-radius:2px;color:var(--tx-link-color);text-decoration:underline;text-decoration-color:transparent;text-underline-offset:var(--tx-link-underline-offset);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing),text-decoration-color var(--tx-motion-duration) var(--tx-motion-easing)}:host(:where([data-styled])) :where(.tx-link__anchor:hover){color:var(--tx-link-hover-color);text-decoration-color:currentColor}:host(:where([data-styled])) :where(.tx-link__anchor:focus-visible){outline:2px solid var(--tx-link-focus-ring-color);outline-offset:2px}:host(:where([data-styled])) :where(.tx-link__external){margin-inline-start:.25em;vertical-align:-.05em;font-size:var(--tx-link-external-icon-size);opacity:.7}:host(:where([data-styled])) :where(.tx-link__copy){display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--tx-link-copy-size);height:var(--tx-link-copy-size);padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-link-copy-color);font-size:var(--tx-link-copy-icon-size);cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host(:where([data-styled])) :where(.tx-link__copy:hover){background:var(--tx-link-copy-hover-background);color:var(--tx-link-copy-hover-color)}:host(:where([data-styled])) :where(.tx-link__copy:focus-visible){outline:2px solid var(--tx-link-focus-ring-color);outline-offset:1px}:host(:where([data-styled])) :where(.tx-link__copy--done,.tx-link__copy--done:hover){color:var(--tx-link-copied-color)}@media(prefers-reduced-motion:reduce){:host(:where([data-styled])) :where(.tx-link__copy){transition:none}}.tx-copy-swap{display:inline-grid;place-items:center}.tx-copy-swap__icon{grid-area:1/1;transition:opacity var(--tx-motion-duration) ease,transform var(--tx-motion-duration) cubic-bezier(.34,1.56,.64,1)}.tx-copy-swap__icon--done{opacity:0;transform:scale(.4) rotate(-45deg)}.tx-copy-swap--done .tx-copy-swap__icon--idle{opacity:0;transform:scale(.4) rotate(45deg)}.tx-copy-swap--done .tx-copy-swap__icon--done{opacity:1;transform:none}@media(prefers-reduced-motion:reduce){.tx-copy-swap__icon{transition:none}}\n"],
|
|
520
540
|
dependencies: [
|
|
521
541
|
{
|
|
522
542
|
kind: "directive",
|
|
@@ -574,7 +594,7 @@ var TxLink = class TxLink {
|
|
|
574
594
|
};
|
|
575
595
|
i0.ɵɵngDeclareClassMetadata({
|
|
576
596
|
minVersion: "12.0.0",
|
|
577
|
-
version: "22.2.
|
|
597
|
+
version: "22.2.6",
|
|
578
598
|
ngImport: i0,
|
|
579
599
|
type: TxLink,
|
|
580
600
|
decorators: [{
|
|
@@ -596,8 +616,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
596
616
|
"[attr.data-type]": "type()"
|
|
597
617
|
},
|
|
598
618
|
viewProviders: [provideTxIconDefaults(LINK_ICON_DEFAULTS)],
|
|
599
|
-
template: "<ng-template #content>\n <span class=\"tx-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">\n <tx-highlight-text [text]=\"displayText()\" [highlight]=\"highlight()\" />\n </span>\n @if (showExternal()) {\n <tx-icon class=\"tx-link__external\" name=\"arrow-up-right\" [class]=\"passThrough().external?.class\" [style]=\"passThrough().external?.style\" />\n }\n @if (opensNewTab()) {\n <span class=\"tx-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a class=\"tx-link__anchor\" [routerLink]=\"$any(commands)\" [attr.title]=\"fullTitle()\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <a\n class=\"tx-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [attr.title]=\"fullTitle()\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n}\n@if (copyable() && link()) {\n <button\n type=\"button\"\n class=\"tx-link__copy\"\n [class.tx-link__copy--done]=\"isCopied()\"\n [class]=\"passThrough().copy?.class\"\n [style]=\"passThrough().copy?.style\"\n [attr.aria-label]=\"
|
|
600
|
-
styles: [":host{display:inline-flex;align-items:center;max-width:100%;min-width:0;vertical-align:bottom}.tx-link__anchor{min-width:0;overflow-wrap:anywhere}.tx-link__hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host([data-styled]){gap:var(--tx-link-gap);font-family:inherit}:host([data-styled]) .tx-link__anchor{border-radius:2px;color:var(--tx-link-color);text-decoration:underline;text-decoration-color:transparent;text-underline-offset:var(--tx-link-underline-offset);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing),text-decoration-color var(--tx-motion-duration) var(--tx-motion-easing)}:host([data-styled]) .tx-link__anchor:hover{color:var(--tx-link-hover-color);text-decoration-color:currentColor}:host([data-styled]) .tx-link__anchor:focus-visible{outline:2px solid var(--tx-link-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-link__external{margin-inline-start:.25em;vertical-align:-.05em;font-size:var(--tx-link-external-icon-size);opacity:.7}:host([data-styled]) .tx-link__copy{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--tx-link-copy-size);height:var(--tx-link-copy-size);padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-link-copy-color);font-size:var(--tx-link-copy-icon-size);cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host([data-styled]) .tx-link__copy:hover{background:var(--tx-link-copy-hover-background);color:var(--tx-link-copy-hover-color)}:host([data-styled]) .tx-link__copy:focus-visible{outline:2px solid var(--tx-link-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-link__copy--done
|
|
619
|
+
template: "<ng-template #content>\n <span class=\"tx-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">\n <tx-highlight-text [text]=\"displayText()\" [highlight]=\"highlight()\" />\n </span>\n @if (showExternal()) {\n <tx-icon class=\"tx-link__external\" name=\"arrow-up-right\" [class]=\"passThrough().external?.class\" [style]=\"passThrough().external?.style\" />\n }\n @if (opensNewTab()) {\n <span class=\"tx-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a class=\"tx-link__anchor\" [routerLink]=\"$any(commands)\" [attr.title]=\"fullTitle()\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <a\n class=\"tx-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [attr.title]=\"fullTitle()\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n}\n@if (copyable() && link()) {\n <button\n type=\"button\"\n class=\"tx-link__copy\"\n [class.tx-link__copy--done]=\"isCopied()\"\n [class]=\"passThrough().copy?.class\"\n [style]=\"passThrough().copy?.style\"\n [attr.aria-label]=\"copyStateLabel()\"\n [title]=\"copyStateLabel()\"\n (click)=\"copy()\"\n >\n <span class=\"tx-copy-swap\" [class.tx-copy-swap--done]=\"isCopied()\"><tx-icon class=\"tx-copy-swap__icon tx-copy-swap__icon--idle\" name=\"copy\" /><tx-icon class=\"tx-copy-swap__icon tx-copy-swap__icon--done\" name=\"check\" /></span>\n </button>\n}\n",
|
|
620
|
+
styles: [":host{display:inline-flex;align-items:center;max-width:100%;min-width:0;vertical-align:bottom}:host :where(.tx-link__anchor){min-width:0;overflow-wrap:anywhere}.tx-link__hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host(:where([data-styled])){gap:var(--tx-link-gap);font-family:inherit}:host(:where([data-styled])) :where(.tx-link__anchor){border-radius:2px;color:var(--tx-link-color);text-decoration:underline;text-decoration-color:transparent;text-underline-offset:var(--tx-link-underline-offset);cursor:pointer;transition:color var(--tx-motion-duration) var(--tx-motion-easing),text-decoration-color var(--tx-motion-duration) var(--tx-motion-easing)}:host(:where([data-styled])) :where(.tx-link__anchor:hover){color:var(--tx-link-hover-color);text-decoration-color:currentColor}:host(:where([data-styled])) :where(.tx-link__anchor:focus-visible){outline:2px solid var(--tx-link-focus-ring-color);outline-offset:2px}:host(:where([data-styled])) :where(.tx-link__external){margin-inline-start:.25em;vertical-align:-.05em;font-size:var(--tx-link-external-icon-size);opacity:.7}:host(:where([data-styled])) :where(.tx-link__copy){display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--tx-link-copy-size);height:var(--tx-link-copy-size);padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-link-copy-color);font-size:var(--tx-link-copy-icon-size);cursor:pointer;transition:color var(--tx-motion-duration),background-color var(--tx-motion-duration)}:host(:where([data-styled])) :where(.tx-link__copy:hover){background:var(--tx-link-copy-hover-background);color:var(--tx-link-copy-hover-color)}:host(:where([data-styled])) :where(.tx-link__copy:focus-visible){outline:2px solid var(--tx-link-focus-ring-color);outline-offset:1px}:host(:where([data-styled])) :where(.tx-link__copy--done,.tx-link__copy--done:hover){color:var(--tx-link-copied-color)}@media(prefers-reduced-motion:reduce){:host(:where([data-styled])) :where(.tx-link__copy){transition:none}}.tx-copy-swap{display:inline-grid;place-items:center}.tx-copy-swap__icon{grid-area:1/1;transition:opacity var(--tx-motion-duration) ease,transform var(--tx-motion-duration) cubic-bezier(.34,1.56,.64,1)}.tx-copy-swap__icon--done{opacity:0;transform:scale(.4) rotate(-45deg)}.tx-copy-swap--done .tx-copy-swap__icon--idle{opacity:0;transform:scale(.4) rotate(45deg)}.tx-copy-swap--done .tx-copy-swap__icon--done{opacity:1;transform:none}@media(prefers-reduced-motion:reduce){.tx-copy-swap__icon{transition:none}}\n"]
|
|
601
621
|
}]
|
|
602
622
|
}],
|
|
603
623
|
ctorParameters: () => [],
|
|
@@ -709,6 +729,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
709
729
|
copied: [{
|
|
710
730
|
type: i0.Output,
|
|
711
731
|
args: ["copied"]
|
|
732
|
+
}],
|
|
733
|
+
copyFailed: [{
|
|
734
|
+
type: i0.Output,
|
|
735
|
+
args: ["copyFailed"]
|
|
712
736
|
}]
|
|
713
737
|
}
|
|
714
738
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-ui-link.mjs","names":[],"sources":["../../../../packages/ui/link/src/link.icons.ts","../../../../packages/ui/link/src/link.theme.ts","../../../../packages/ui/link/src/icon-link.component.ts","../../../../packages/ui/link/src/icon-link.component.html","../../../../packages/ui/link/src/link.component.ts","../../../../packages/ui/link/src/link.component.html"],"sourcesContent":["import { TxIconSet, txIconArrowUpRight, txIconCheck, txIconCopy, txIconLink, txIconPhone, txIconText } from '@tectra-ng/icons';\n\nexport const LINK_ICON_DEFAULTS: TxIconSet = {\n 'arrow-up-right': txIconArrowUpRight,\n check: txIconCheck,\n copy: txIconCopy,\n link: txIconLink,\n phone: txIconPhone,\n text: txIconText,\n};\n","import { iconLinkTokens, linkTokens } from '@tectra-ng/themes';\n\nexport const LINK_THEME = {\n iconLink: iconLinkTokens,\n link: linkTokens,\n};\n","import { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, booleanAttribute, computed, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraIconLinkTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxIconLinkPart, TxLinkCommands } from './link.types';\nimport { LINK_ICON_DEFAULTS } from './link.icons';\nimport { LINK_THEME } from './link.theme';\n\n@Component({\n selector: 'tx-icon-link',\n imports: [NgClass, NgTemplateOutlet, RouterLink, RouterLinkActive, TxIcon],\n templateUrl: './icon-link.component.html',\n styleUrl: './icon-link.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-icon-link',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n viewProviders: [provideTxIconDefaults(LINK_ICON_DEFAULTS)],\n})\nexport class TxIconLink {\n private readonly linkTheme = injectTokens(LINK_THEME);\n\n private txIconRegistry = injectTxIcons();\n\n readonly icon = input<TxIconName | (string & {}) | undefined>(undefined);\n readonly text = input<string>('');\n readonly routerLink = input<TxLinkCommands>(undefined);\n readonly href = input<string | null | undefined>(undefined);\n readonly target = input<string | undefined>(undefined);\n readonly exact = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraIconLinkTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxIconLinkPart, TxIconLink> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('iconLink', this, this.pt, this.ptOptions);\n readonly iconName = computed(() => {\n const icon = this.icon();\n return icon && this.txIconRegistry.has(icon) ? icon : null;\n });\n readonly resolvedTarget = computed(() => this.target() ?? '_blank');\n readonly opensNewTab = computed(() => !this.routerLink() && !!this.href() && this.resolvedTarget() === '_blank');\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-icon-link'), ...this.passThrough().root?.style }));\n}\n","<ng-template #content>\n @if (icon(); as icon) {\n @if (iconName(); as name) {\n <tx-icon class=\"tx-icon-link__icon\" [name]=\"name\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\" />\n } @else {\n <span class=\"tx-icon-link__icon\" aria-hidden=\"true\" [class]=\"icon\" [ngClass]=\"passThrough().icon?.class ?? null\" [style]=\"passThrough().icon?.style\"></span>\n }\n }\n <span class=\"tx-icon-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text() }}<ng-content /></span>\n @if (opensNewTab()) {\n <span class=\"tx-icon-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a\n class=\"tx-icon-link__anchor\"\n [routerLink]=\"$any(commands)\"\n routerLinkActive=\"tx-icon-link__anchor--active\"\n ariaCurrentWhenActive=\"page\"\n [routerLinkActiveOptions]=\"{ exact: exact() }\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else if (href()) {\n <a\n class=\"tx-icon-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <button type=\"button\" class=\"tx-icon-link__anchor\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </button>\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, booleanAttribute, computed, inject, input, output, signal } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean, optionalNumber } from '@tectra-ng/core/utils';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraLinkTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxHighlightTerms, TxHighlightText } from '@tectra-ng/ui/highlight-text';\nimport { TxLinkCommands, TxLinkPart, TxLinkType } from './link.types';\nimport { LINK_ICON_DEFAULTS } from './link.icons';\nimport { LINK_THEME } from './link.theme';\n\nconst COPIED_FOR = 1600;\nconst PROTOCOL = /^[a-z][a-z\\d+.-]*:/i;\n\n@Component({\n selector: 'tx-link',\n imports: [NgTemplateOutlet, RouterLink, TxIcon, TxHighlightText],\n templateUrl: './link.component.html',\n styleUrl: './link.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-link',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-type]': 'type()',\n },\n viewProviders: [provideTxIconDefaults(LINK_ICON_DEFAULTS)],\n})\nexport class TxLink {\n private readonly linkTheme = injectTokens(LINK_THEME);\n\n private document = inject(DOCUMENT);\n private timer: ReturnType<typeof setTimeout> | null = null;\n\n readonly link = input<string | null | undefined>('');\n readonly type = input<TxLinkType>('url');\n readonly linkText = input<string | null | undefined>(undefined);\n readonly highlight = input<TxHighlightTerms>('');\n readonly maxLength = input<number | undefined, unknown>(undefined, { transform: optionalNumber });\n readonly routerLink = input<TxLinkCommands>(undefined);\n readonly target = input<string | undefined>(undefined);\n readonly external = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n readonly copyable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraLinkTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxLinkPart, TxLink> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly copied = output<string>();\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('link', this, this.pt, this.ptOptions);\n readonly isCopied = signal(false);\n\n readonly value = computed(() => (this.link() ?? '').trim());\n readonly fullText = computed(() => this.linkText() || this.value());\n readonly isTruncated = computed(() => {\n const max = this.maxLength();\n return max !== undefined && max > 0 && this.fullText().length > max;\n });\n readonly displayText = computed(() => (this.isTruncated() ? `${this.fullText().slice(0, this.maxLength()).trimEnd()}…` : this.fullText()));\n readonly fullTitle = computed(() => (this.isTruncated() ? this.fullText() : null));\n readonly href = computed(() => {\n const value = this.value();\n switch (this.type()) {\n case 'email':\n return `mailto:${value}`;\n case 'phone':\n return `tel:${value.replace(/[^\\d+]/g, '')}`;\n default:\n return PROTOCOL.test(value) || value.startsWith('/') ? value : `https://${value}`;\n }\n });\n readonly resolvedTarget = computed(() => this.target() ?? (this.type() === 'url' ? '_blank' : null));\n readonly opensNewTab = computed(() => !this.routerLink() && this.resolvedTarget() === '_blank');\n readonly showExternal = computed(() => this.external() ?? this.opensNewTab());\n readonly copyLabel = computed(() => {\n const translations = this.translations();\n return { url: translations.copyLink, email: translations.copyEmail, phone: translations.copyPhone }[this.type()];\n });\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-link'), ...this.passThrough().root?.style }));\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.timer && clearTimeout(this.timer));\n }\n\n copy(): void {\n const text = this.value();\n this.document.defaultView?.navigator.clipboard?.writeText(text);\n this.copied.emit(text);\n this.isCopied.set(true);\n if (this.timer) {\n clearTimeout(this.timer);\n }\n this.timer = setTimeout(() => this.isCopied.set(false), COPIED_FOR);\n }\n}\n","<ng-template #content>\n <span class=\"tx-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">\n <tx-highlight-text [text]=\"displayText()\" [highlight]=\"highlight()\" />\n </span>\n @if (showExternal()) {\n <tx-icon class=\"tx-link__external\" name=\"arrow-up-right\" [class]=\"passThrough().external?.class\" [style]=\"passThrough().external?.style\" />\n }\n @if (opensNewTab()) {\n <span class=\"tx-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a class=\"tx-link__anchor\" [routerLink]=\"$any(commands)\" [attr.title]=\"fullTitle()\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <a\n class=\"tx-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [attr.title]=\"fullTitle()\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n}\n@if (copyable() && link()) {\n <button\n type=\"button\"\n class=\"tx-link__copy\"\n [class.tx-link__copy--done]=\"isCopied()\"\n [class]=\"passThrough().copy?.class\"\n [style]=\"passThrough().copy?.style\"\n [attr.aria-label]=\"isCopied() ? translations().copied : copyLabel()\"\n [title]=\"isCopied() ? translations().copied : copyLabel()\"\n (click)=\"copy()\"\n >\n <span class=\"tx-copy-swap\" [class.tx-copy-swap--done]=\"isCopied()\"><tx-icon class=\"tx-copy-swap__icon tx-copy-swap__icon--idle\" name=\"copy\" /><tx-icon class=\"tx-copy-swap__icon tx-copy-swap__icon--done\" name=\"check\" /></span>\n </button>\n}\n"],"mappings":";;;;;;;;;;AAEA,MAAa,qBAAgC;CAC3C,kBAAkB;CAClB,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACP,MAAM;AACP;ACPD,MAAa,aAAa;CACxB,UAAU;CACV,MAAM;AACP;ACqBD,IAAa,aAAb,MAAa,WAAU;CACJ,YAAY,aAAa,UAAU;CAE5C,iBAAiB,cAAa;CAE7B,OAAO,MAA8C,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,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,sBAAsB,kBAAkB,CAAC;GAAC,UAAA;GAAA,QAAA,CAAA,i5EAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-ui-link.mjs","names":[],"sources":["../../../../packages/ui/link/src/link.icons.ts","../../../../packages/ui/link/src/link.theme.ts","../../../../packages/ui/link/src/icon-link.component.ts","../../../../packages/ui/link/src/icon-link.component.html","../../../../packages/ui/link/src/link.component.ts","../../../../packages/ui/link/src/link.component.html"],"sourcesContent":["import { TxIconSet, txIconArrowUpRight, txIconCheck, txIconCopy, txIconLink, txIconPhone, txIconText } from '@tectra-ng/icons';\n\nexport const LINK_ICON_DEFAULTS: TxIconSet = {\n 'arrow-up-right': txIconArrowUpRight,\n check: txIconCheck,\n copy: txIconCopy,\n link: txIconLink,\n phone: txIconPhone,\n text: txIconText,\n};\n","import { iconLinkTokens, linkTokens } from '@tectra-ng/themes';\n\nexport const LINK_THEME = {\n iconLink: iconLinkTokens,\n link: linkTokens,\n};\n","import { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, booleanAttribute, computed, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { injectTxIcons, provideTxIconDefaults, TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraIconLinkTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxIconLinkPart, TxLinkCommands } from './link.types';\nimport { LINK_ICON_DEFAULTS } from './link.icons';\nimport { LINK_THEME } from './link.theme';\n\n@Component({\n selector: 'tx-icon-link',\n imports: [NgClass, NgTemplateOutlet, RouterLink, RouterLinkActive, TxIcon],\n templateUrl: './icon-link.component.html',\n styleUrl: './icon-link.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-icon-link',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n viewProviders: [provideTxIconDefaults(LINK_ICON_DEFAULTS)],\n})\nexport class TxIconLink {\n private readonly linkTheme = injectTokens(LINK_THEME);\n\n private txIconRegistry = injectTxIcons();\n\n readonly icon = input<TxIconName | (string & {}) | undefined>(undefined);\n readonly text = input<string>('');\n readonly routerLink = input<TxLinkCommands>(undefined);\n readonly href = input<string | null | undefined>(undefined);\n readonly target = input<string | undefined>(undefined);\n readonly exact = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraIconLinkTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxIconLinkPart, TxIconLink> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('iconLink', this, this.pt, this.ptOptions);\n readonly iconName = computed(() => {\n const icon = this.icon();\n return icon && this.txIconRegistry.has(icon) ? icon : null;\n });\n readonly resolvedTarget = computed(() => this.target() ?? '_blank');\n readonly opensNewTab = computed(() => !this.routerLink() && !!this.href() && this.resolvedTarget() === '_blank');\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-icon-link'), ...this.passThrough().root?.style }));\n}\n","<ng-template #content>\n @if (icon(); as icon) {\n @if (iconName(); as name) {\n <tx-icon class=\"tx-icon-link__icon\" [name]=\"name\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\" />\n } @else {\n <span class=\"tx-icon-link__icon\" aria-hidden=\"true\" [class]=\"icon\" [ngClass]=\"passThrough().icon?.class ?? null\" [style]=\"passThrough().icon?.style\"></span>\n }\n }\n <span class=\"tx-icon-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text() }}<ng-content /></span>\n @if (opensNewTab()) {\n <span class=\"tx-icon-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a\n class=\"tx-icon-link__anchor\"\n [routerLink]=\"$any(commands)\"\n routerLinkActive=\"tx-icon-link__anchor--active\"\n ariaCurrentWhenActive=\"page\"\n [routerLinkActiveOptions]=\"{ exact: exact() }\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else if (href()) {\n <a\n class=\"tx-icon-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <button type=\"button\" class=\"tx-icon-link__anchor\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </button>\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, booleanAttribute, computed, inject, input, output, signal } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean, optionalNumber, writeToClipboard } from '@tectra-ng/core/utils';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraLinkTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxHighlightTerms, TxHighlightText } from '@tectra-ng/ui/highlight-text';\nimport { TxLinkCommands, TxLinkPart, TxLinkType } from './link.types';\nimport { LINK_ICON_DEFAULTS } from './link.icons';\nimport { LINK_THEME } from './link.theme';\n\nconst COPIED_FOR = 1600;\nconst PROTOCOL = /^[a-z][a-z\\d+.-]*:/i;\n\n@Component({\n selector: 'tx-link',\n imports: [NgTemplateOutlet, RouterLink, TxIcon, TxHighlightText],\n templateUrl: './link.component.html',\n styleUrl: './link.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-link',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-type]': 'type()',\n },\n viewProviders: [provideTxIconDefaults(LINK_ICON_DEFAULTS)],\n})\nexport class TxLink {\n private readonly linkTheme = injectTokens(LINK_THEME);\n\n private document = inject(DOCUMENT);\n private timer: ReturnType<typeof setTimeout> | null = null;\n private destroyed = false;\n\n readonly link = input<string | null | undefined>('');\n readonly type = input<TxLinkType>('url');\n readonly linkText = input<string | null | undefined>(undefined);\n readonly highlight = input<TxHighlightTerms>('');\n readonly maxLength = input<number | undefined, unknown>(undefined, { transform: optionalNumber });\n readonly routerLink = input<TxLinkCommands>(undefined);\n readonly target = input<string | undefined>(undefined);\n readonly external = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n readonly copyable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly dt = input<TectraDeepPartial<TectraLinkTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxLinkPart, TxLink> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly copied = output<string>();\n readonly copyFailed = output<string>();\n\n readonly translations = injectTranslations();\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('link', this, this.pt, this.ptOptions);\n readonly isCopied = signal(false);\n readonly isCopyFailed = signal(false);\n\n readonly value = computed(() => (this.link() ?? '').trim());\n readonly fullText = computed(() => this.linkText() || this.value());\n readonly isTruncated = computed(() => {\n const max = this.maxLength();\n return max !== undefined && max > 0 && this.fullText().length > max;\n });\n readonly displayText = computed(() => (this.isTruncated() ? `${this.fullText().slice(0, this.maxLength()).trimEnd()}…` : this.fullText()));\n readonly fullTitle = computed(() => (this.isTruncated() ? this.fullText() : null));\n readonly href = computed(() => {\n const value = this.value();\n switch (this.type()) {\n case 'email':\n return `mailto:${value}`;\n case 'phone':\n return `tel:${value.replace(/[^\\d+]/g, '')}`;\n default:\n return PROTOCOL.test(value) || value.startsWith('/') ? value : `https://${value}`;\n }\n });\n readonly resolvedTarget = computed(() => this.target() ?? (this.type() === 'url' ? '_blank' : null));\n readonly opensNewTab = computed(() => !this.routerLink() && this.resolvedTarget() === '_blank');\n readonly showExternal = computed(() => this.external() ?? this.opensNewTab());\n readonly copyLabel = computed(() => {\n const translations = this.translations();\n return { url: translations.copyLink, email: translations.copyEmail, phone: translations.copyPhone }[this.type()];\n });\n readonly copyStateLabel = computed(() => {\n if (this.isCopied()) return this.translations().copied;\n return this.isCopyFailed() ? this.translations().copyToClipboardFailed : this.copyLabel();\n });\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-link'), ...this.passThrough().root?.style }));\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n if (this.timer) clearTimeout(this.timer);\n });\n }\n\n async copy(): Promise<boolean> {\n const text = this.value();\n const done = await writeToClipboard(text, this.document);\n if (this.destroyed) {\n return done;\n }\n this.isCopied.set(done);\n this.isCopyFailed.set(!done);\n if (done) {\n this.copied.emit(text);\n } else {\n this.copyFailed.emit(text);\n }\n if (this.timer) {\n clearTimeout(this.timer);\n }\n this.timer = setTimeout(() => {\n this.isCopied.set(false);\n this.isCopyFailed.set(false);\n }, COPIED_FOR);\n return done;\n }\n}\n","<ng-template #content>\n <span class=\"tx-link__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">\n <tx-highlight-text [text]=\"displayText()\" [highlight]=\"highlight()\" />\n </span>\n @if (showExternal()) {\n <tx-icon class=\"tx-link__external\" name=\"arrow-up-right\" [class]=\"passThrough().external?.class\" [style]=\"passThrough().external?.style\" />\n }\n @if (opensNewTab()) {\n <span class=\"tx-link__hint\">({{ translations().opensInNewTab }})</span>\n }\n</ng-template>\n\n@if (routerLink(); as commands) {\n <a class=\"tx-link__anchor\" [routerLink]=\"$any(commands)\" [attr.title]=\"fullTitle()\" [class]=\"passThrough().anchor?.class\" [style]=\"passThrough().anchor?.style\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n} @else {\n <a\n class=\"tx-link__anchor\"\n [href]=\"href()\"\n [attr.target]=\"resolvedTarget()\"\n [attr.rel]=\"opensNewTab() ? 'noopener noreferrer' : null\"\n [attr.title]=\"fullTitle()\"\n [class]=\"passThrough().anchor?.class\"\n [style]=\"passThrough().anchor?.style\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </a>\n}\n@if (copyable() && link()) {\n <button\n type=\"button\"\n class=\"tx-link__copy\"\n [class.tx-link__copy--done]=\"isCopied()\"\n [class]=\"passThrough().copy?.class\"\n [style]=\"passThrough().copy?.style\"\n [attr.aria-label]=\"copyStateLabel()\"\n [title]=\"copyStateLabel()\"\n (click)=\"copy()\"\n >\n <span class=\"tx-copy-swap\" [class.tx-copy-swap--done]=\"isCopied()\"><tx-icon class=\"tx-copy-swap__icon tx-copy-swap__icon--idle\" name=\"copy\" /><tx-icon class=\"tx-copy-swap__icon tx-copy-swap__icon--done\" name=\"check\" /></span>\n </button>\n}\n"],"mappings":";;;;;;;;;;AAEA,MAAa,qBAAgC;CAC3C,kBAAkB;CAClB,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACP,MAAM;AACP;ACPD,MAAa,aAAa;CACxB,UAAU;CACV,MAAM;AACP;ACqBD,IAAa,aAAb,MAAa,WAAU;CACJ,YAAY,aAAa,UAAU;CAE5C,iBAAiB,cAAa;CAE7B,OAAO,MAA8C,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAA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AA,MAAE;IAAM,UAAA;IAAA,QAAA,CAAA,MAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAe,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;EAAA;EAAA,eAWhD,CAAC,sBAAsB,kBAAkB,CAAC;EAAC,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAE/C,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAM,YAAA,CAAA;EAflB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAS,SACV;IAAC;IAAkB;IAAY;IAAQ;GAAe;GAAC,iBAG/C,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,oBAAoB;GACrB;GAAA,eACc,CAAC,sBAAsB,kBAAkB,CAAC;GAAC,UAAA;GAAA,QAAA,CAAA,kiFAAA;EAAA,CAAA"}
|
|
@@ -211,7 +211,7 @@ var TxListInput = class TxListInput extends TxFormControlBase {
|
|
|
211
211
|
}
|
|
212
212
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
213
213
|
minVersion: "12.0.0",
|
|
214
|
-
version: "22.2.
|
|
214
|
+
version: "22.2.6",
|
|
215
215
|
ngImport: i0,
|
|
216
216
|
type: TxListInput,
|
|
217
217
|
deps: null,
|
|
@@ -219,7 +219,7 @@ var TxListInput = class TxListInput extends TxFormControlBase {
|
|
|
219
219
|
});
|
|
220
220
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
221
221
|
minVersion: "17.0.0",
|
|
222
|
-
version: "22.2.
|
|
222
|
+
version: "22.2.6",
|
|
223
223
|
type: TxListInput,
|
|
224
224
|
isStandalone: true,
|
|
225
225
|
selector: "tx-list-input",
|
|
@@ -487,7 +487,7 @@ var TxListInput = class TxListInput extends TxFormControlBase {
|
|
|
487
487
|
};
|
|
488
488
|
i0.ɵɵngDeclareClassMetadata({
|
|
489
489
|
minVersion: "12.0.0",
|
|
490
|
-
version: "22.2.
|
|
490
|
+
version: "22.2.6",
|
|
491
491
|
ngImport: i0,
|
|
492
492
|
type: TxListInput,
|
|
493
493
|
decorators: [{
|
|
@@ -156,7 +156,7 @@ var TxListbox = class TxListbox extends TxOptionsBase {
|
|
|
156
156
|
}
|
|
157
157
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
158
158
|
minVersion: "12.0.0",
|
|
159
|
-
version: "22.2.
|
|
159
|
+
version: "22.2.6",
|
|
160
160
|
ngImport: i0,
|
|
161
161
|
type: TxListbox,
|
|
162
162
|
deps: null,
|
|
@@ -164,7 +164,7 @@ var TxListbox = class TxListbox extends TxOptionsBase {
|
|
|
164
164
|
});
|
|
165
165
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
166
166
|
minVersion: "17.0.0",
|
|
167
|
-
version: "22.2.
|
|
167
|
+
version: "22.2.6",
|
|
168
168
|
type: TxListbox,
|
|
169
169
|
isStandalone: true,
|
|
170
170
|
selector: "tx-listbox",
|
|
@@ -348,7 +348,7 @@ var TxListbox = class TxListbox extends TxOptionsBase {
|
|
|
348
348
|
};
|
|
349
349
|
i0.ɵɵngDeclareClassMetadata({
|
|
350
350
|
minVersion: "12.0.0",
|
|
351
|
-
version: "22.2.
|
|
351
|
+
version: "22.2.6",
|
|
352
352
|
ngImport: i0,
|
|
353
353
|
type: TxListbox,
|
|
354
354
|
decorators: [{
|
|
@@ -4,7 +4,7 @@ import { ChangeDetectionStrategy, Component, Injector, booleanAttribute, compute
|
|
|
4
4
|
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
5
5
|
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
6
6
|
import { injectFieldInvalid } from "@tectra-ng/core/forms";
|
|
7
|
-
import { TxOverlayAnchor, TxOverlayInsets,
|
|
7
|
+
import { TxOverlayAnchor, TxOverlayInsets, TxPanelWidth, txFieldPositions, txScrollStrategy, watchOrigin } from "@tectra-ng/core/overlay";
|
|
8
8
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
9
9
|
import { formFieldTokens, mentionTokens, selectTokens, toStyleObject } from "@tectra-ng/themes";
|
|
10
10
|
import { TxAvatar } from "@tectra-ng/ui/avatar";
|
|
@@ -111,7 +111,11 @@ var TxMentionTextarea = class TxMentionTextarea extends TxOptionsBase {
|
|
|
111
111
|
isUnstyled = injectUnstyled(this.unstyled);
|
|
112
112
|
isInvalid = injectFieldInvalid(this.invalid);
|
|
113
113
|
passThrough = injectPassThrough("mentionTextarea", this, this.pt, this.ptOptions);
|
|
114
|
-
positions =
|
|
114
|
+
positions = txFieldPositions(4);
|
|
115
|
+
panelWidth = new TxPanelWidth({
|
|
116
|
+
matchOrigin: false,
|
|
117
|
+
fitContent: false
|
|
118
|
+
});
|
|
115
119
|
scrollStrategy = txScrollStrategy(this.injector);
|
|
116
120
|
source = this.suggestions;
|
|
117
121
|
localQuery = computed(() => this.localSearch() ? this.query().trim() : "", ...ngDevMode ? [{ debugName: "localQuery" }] : /* istanbul ignore next */ []);
|
|
@@ -140,6 +144,10 @@ var TxMentionTextarea = class TxMentionTextarea extends TxOptionsBase {
|
|
|
140
144
|
...toStyleObject(this.dt(), "--tx-mention"),
|
|
141
145
|
...this.passThrough().root?.style
|
|
142
146
|
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
147
|
+
panelStyle = computed(() => ({
|
|
148
|
+
...this.panelWidth.style(),
|
|
149
|
+
...this.passThrough().panel?.style
|
|
150
|
+
}), ...ngDevMode ? [{ debugName: "panelStyle" }] : /* istanbul ignore next */ []);
|
|
143
151
|
constructor() {
|
|
144
152
|
super();
|
|
145
153
|
effect(() => {
|
|
@@ -248,7 +256,10 @@ var TxMentionTextarea = class TxMentionTextarea extends TxOptionsBase {
|
|
|
248
256
|
left: element.offsetLeft + point.left,
|
|
249
257
|
height: point.height
|
|
250
258
|
});
|
|
251
|
-
if (!this.isOpen())
|
|
259
|
+
if (!this.isOpen()) {
|
|
260
|
+
this.panelWidth.open(element);
|
|
261
|
+
this.isOpen.set(true);
|
|
262
|
+
}
|
|
252
263
|
if (changed) {
|
|
253
264
|
this.activeIndex.set(this.rows().findIndex(isSelectableRow));
|
|
254
265
|
this.emitFilter();
|
|
@@ -260,7 +271,7 @@ var TxMentionTextarea = class TxMentionTextarea extends TxOptionsBase {
|
|
|
260
271
|
}
|
|
261
272
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
262
273
|
minVersion: "12.0.0",
|
|
263
|
-
version: "22.2.
|
|
274
|
+
version: "22.2.6",
|
|
264
275
|
ngImport: i0,
|
|
265
276
|
type: TxMentionTextarea,
|
|
266
277
|
deps: [],
|
|
@@ -268,7 +279,7 @@ var TxMentionTextarea = class TxMentionTextarea extends TxOptionsBase {
|
|
|
268
279
|
});
|
|
269
280
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
270
281
|
minVersion: "17.0.0",
|
|
271
|
-
version: "22.2.
|
|
282
|
+
version: "22.2.6",
|
|
272
283
|
type: TxMentionTextarea,
|
|
273
284
|
isStandalone: true,
|
|
274
285
|
selector: "tx-mention-textarea",
|
|
@@ -412,7 +423,7 @@ var TxMentionTextarea = class TxMentionTextarea extends TxOptionsBase {
|
|
|
412
423
|
}],
|
|
413
424
|
usesInheritance: true,
|
|
414
425
|
ngImport: i0,
|
|
415
|
-
template: "<textarea\n #textarea\n txTextarea\n class=\"tx-mention-textarea__textarea\"\n aria-autocomplete=\"list\"\n [class]=\"passThrough().textarea?.class\"\n [style]=\"passThrough().textarea?.style\"\n [autoResize]=\"autoResize()\"\n [rows]=\"lines()\"\n [placeholder]=\"placeholder()\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n [value]=\"text()\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-controls]=\"showPanel() ? listboxId : null\"\n [attr.aria-activedescendant]=\"showPanel() ? activeItemId() : null\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (keyup)=\"onCaretMove()\"\n (click)=\"onCaretMove()\"\n (blur)=\"onBlur()\"\n></textarea>\n<span\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-mention-textarea__caret\"\n aria-hidden=\"true\"\n [style.top.px]=\"caret().top\"\n [style.left.px]=\"caret().left\"\n [style.height.px]=\"caret().height\"\n></span>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"showPanel()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n>\n <div\n class=\"tx-select__panel tx-mention-textarea__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"
|
|
426
|
+
template: "<textarea\n #textarea\n txTextarea\n class=\"tx-mention-textarea__textarea\"\n aria-autocomplete=\"list\"\n [class]=\"passThrough().textarea?.class\"\n [style]=\"passThrough().textarea?.style\"\n [autoResize]=\"autoResize()\"\n [rows]=\"lines()\"\n [placeholder]=\"placeholder()\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n [value]=\"text()\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-controls]=\"showPanel() ? listboxId : null\"\n [attr.aria-activedescendant]=\"showPanel() ? activeItemId() : null\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (keyup)=\"onCaretMove()\"\n (click)=\"onCaretMove()\"\n (blur)=\"onBlur()\"\n></textarea>\n<span\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-mention-textarea__caret\"\n aria-hidden=\"true\"\n [style.top.px]=\"caret().top\"\n [style.left.px]=\"caret().left\"\n [style.height.px]=\"caret().height\"\n></span>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"showPanel()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n>\n <div\n class=\"tx-select__panel tx-mention-textarea__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (mousedown)=\"onPanelMousedown($event)\"\n >\n <tx-option-list\n [rows]=\"rows()\"\n [listboxId]=\"listboxId\"\n [activeIndex]=\"activeIndex()\"\n [checkmark]=\"false\"\n [loading]=\"loading()\"\n [query]=\"query()\"\n [emptyText]=\"emptyText()\"\n [loadingText]=\"translations().loading\"\n [optionTemplate]=\"optionTemplate()?.templateRef ?? person\"\n [passThrough]=\"passThrough()\"\n [unstyled]=\"isUnstyled()\"\n (optionClick)=\"onOptionClick($event)\"\n (optionHover)=\"activeIndex.set($event)\"\n />\n </div>\n</ng-template>\n\n<ng-template #person let-item>\n <span class=\"tx-mention-textarea__person\" [class.tx-mention-textarea__person--styled]=\"!isUnstyled()\">\n <span class=\"tx-mention-textarea__avatar\" aria-hidden=\"true\"><tx-avatar [image]=\"item.image\" [name]=\"item.label\" [size]=\"'small'\" /></span>\n <span class=\"tx-mention-textarea__label\">{{ item.label }}</span>\n @if (item.description) {\n <span class=\"tx-mention-textarea__description\">{{ item.description }}</span>\n }\n </span>\n</ng-template>\n",
|
|
416
427
|
styles: [":host{position:relative;display:block}.tx-mention-textarea__textarea{display:block;box-sizing:border-box;width:100%}.tx-mention-textarea__caret{position:absolute;width:0;pointer-events:none}.tx-mention-textarea__person{display:flex;align-items:center;min-width:0}.tx-mention-textarea__person--styled{gap:var(--tx-mention-option-gap)}.tx-mention-textarea__person--styled .tx-mention-textarea__description{overflow:hidden;color:var(--tx-mention-description-color);font-size:var(--tx-mention-description-font-size);text-overflow:ellipsis}.tx-mention-textarea__panel[data-styled]{box-sizing:border-box;width:var(--tx-mention-panel-width);overflow:hidden;border:1px solid var(--tx-select-overlay-border-color);border-radius:var(--tx-select-overlay-border-radius);background:var(--tx-select-overlay-background);box-shadow:var(--tx-select-overlay-shadow);color:var(--tx-select-option-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height)}\n"],
|
|
417
428
|
dependencies: [
|
|
418
429
|
{
|
|
@@ -550,7 +561,7 @@ var TxMentionTextarea = class TxMentionTextarea extends TxOptionsBase {
|
|
|
550
561
|
};
|
|
551
562
|
i0.ɵɵngDeclareClassMetadata({
|
|
552
563
|
minVersion: "12.0.0",
|
|
553
|
-
version: "22.2.
|
|
564
|
+
version: "22.2.6",
|
|
554
565
|
ngImport: i0,
|
|
555
566
|
type: TxMentionTextarea,
|
|
556
567
|
decorators: [{
|
|
@@ -579,7 +590,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
579
590
|
"[class.tx-mention-textarea--open]": "isOpen()"
|
|
580
591
|
},
|
|
581
592
|
viewProviders: [provideTxIconDefaults(MENTION_TEXTAREA_ICON_DEFAULTS)],
|
|
582
|
-
template: "<textarea\n #textarea\n txTextarea\n class=\"tx-mention-textarea__textarea\"\n aria-autocomplete=\"list\"\n [class]=\"passThrough().textarea?.class\"\n [style]=\"passThrough().textarea?.style\"\n [autoResize]=\"autoResize()\"\n [rows]=\"lines()\"\n [placeholder]=\"placeholder()\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n [value]=\"text()\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-controls]=\"showPanel() ? listboxId : null\"\n [attr.aria-activedescendant]=\"showPanel() ? activeItemId() : null\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (keyup)=\"onCaretMove()\"\n (click)=\"onCaretMove()\"\n (blur)=\"onBlur()\"\n></textarea>\n<span\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-mention-textarea__caret\"\n aria-hidden=\"true\"\n [style.top.px]=\"caret().top\"\n [style.left.px]=\"caret().left\"\n [style.height.px]=\"caret().height\"\n></span>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"showPanel()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n>\n <div\n class=\"tx-select__panel tx-mention-textarea__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"
|
|
593
|
+
template: "<textarea\n #textarea\n txTextarea\n class=\"tx-mention-textarea__textarea\"\n aria-autocomplete=\"list\"\n [class]=\"passThrough().textarea?.class\"\n [style]=\"passThrough().textarea?.style\"\n [autoResize]=\"autoResize()\"\n [rows]=\"lines()\"\n [placeholder]=\"placeholder()\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [readOnly]=\"readonly()\"\n [disabled]=\"disabled()\"\n [value]=\"text()\"\n [attr.id]=\"inputId() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-controls]=\"showPanel() ? listboxId : null\"\n [attr.aria-activedescendant]=\"showPanel() ? activeItemId() : null\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (keyup)=\"onCaretMove()\"\n (click)=\"onCaretMove()\"\n (blur)=\"onBlur()\"\n></textarea>\n<span\n #origin=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"tx-mention-textarea__caret\"\n aria-hidden=\"true\"\n [style.top.px]=\"caret().top\"\n [style.left.px]=\"caret().left\"\n [style.height.px]=\"caret().height\"\n></span>\n\n<ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"showPanel()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n>\n <div\n class=\"tx-select__panel tx-mention-textarea__panel\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (mousedown)=\"onPanelMousedown($event)\"\n >\n <tx-option-list\n [rows]=\"rows()\"\n [listboxId]=\"listboxId\"\n [activeIndex]=\"activeIndex()\"\n [checkmark]=\"false\"\n [loading]=\"loading()\"\n [query]=\"query()\"\n [emptyText]=\"emptyText()\"\n [loadingText]=\"translations().loading\"\n [optionTemplate]=\"optionTemplate()?.templateRef ?? person\"\n [passThrough]=\"passThrough()\"\n [unstyled]=\"isUnstyled()\"\n (optionClick)=\"onOptionClick($event)\"\n (optionHover)=\"activeIndex.set($event)\"\n />\n </div>\n</ng-template>\n\n<ng-template #person let-item>\n <span class=\"tx-mention-textarea__person\" [class.tx-mention-textarea__person--styled]=\"!isUnstyled()\">\n <span class=\"tx-mention-textarea__avatar\" aria-hidden=\"true\"><tx-avatar [image]=\"item.image\" [name]=\"item.label\" [size]=\"'small'\" /></span>\n <span class=\"tx-mention-textarea__label\">{{ item.label }}</span>\n @if (item.description) {\n <span class=\"tx-mention-textarea__description\">{{ item.description }}</span>\n }\n </span>\n</ng-template>\n",
|
|
583
594
|
styles: [":host{position:relative;display:block}.tx-mention-textarea__textarea{display:block;box-sizing:border-box;width:100%}.tx-mention-textarea__caret{position:absolute;width:0;pointer-events:none}.tx-mention-textarea__person{display:flex;align-items:center;min-width:0}.tx-mention-textarea__person--styled{gap:var(--tx-mention-option-gap)}.tx-mention-textarea__person--styled .tx-mention-textarea__description{overflow:hidden;color:var(--tx-mention-description-color);font-size:var(--tx-mention-description-font-size);text-overflow:ellipsis}.tx-mention-textarea__panel[data-styled]{box-sizing:border-box;width:var(--tx-mention-panel-width);overflow:hidden;border:1px solid var(--tx-select-overlay-border-color);border-radius:var(--tx-select-overlay-border-radius);background:var(--tx-select-overlay-background);box-shadow:var(--tx-select-overlay-shadow);color:var(--tx-select-option-color);font-family:var(--tx-font-family);font-size:var(--tx-form-field-font-size);line-height:var(--tx-form-field-line-height)}\n"]
|
|
584
595
|
}]
|
|
585
596
|
}],
|