@design-system-rte/angular 1.0.1 → 1.2.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/esm2022/lib/components/assistive-text/assistive-text.component.mjs +34 -0
- package/esm2022/lib/components/badge/badge.component.mjs +7 -4
- package/esm2022/lib/components/banner/banner.component.mjs +3 -3
- package/esm2022/lib/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +18 -3
- package/esm2022/lib/components/breadcrumbs/breadcrumbs.component.mjs +19 -3
- package/esm2022/lib/components/dropdown/dropdown-item/dropdown-item.component.mjs +23 -6
- package/esm2022/lib/components/dropdown/dropdown-menu/dropdown-menu-footer.directive.mjs +17 -0
- package/esm2022/lib/components/dropdown/dropdown-menu/dropdown-menu-header.directive.mjs +17 -0
- package/esm2022/lib/components/dropdown/dropdown-menu/dropdown-menu.component.mjs +35 -5
- package/esm2022/lib/components/dropdown/dropdown-trigger/dropdown-trigger.directive.mjs +23 -2
- package/esm2022/lib/components/dropdown/dropdown.directive.mjs +93 -14
- package/esm2022/lib/components/dropdown/dropdown.module.mjs +32 -5
- package/esm2022/lib/components/icon-button/icon-button.component.mjs +6 -6
- package/esm2022/lib/components/icon-button-toggle/icon-button-toggle.component.mjs +3 -3
- package/esm2022/lib/components/modal/modal.component.mjs +3 -3
- package/esm2022/lib/components/searchbar/searchbar.component.mjs +86 -0
- package/esm2022/lib/components/segmented-control/segmented-control.component.mjs +13 -3
- package/esm2022/lib/components/select/select.component.mjs +168 -0
- package/esm2022/lib/components/split-button/split-button.component.mjs +17 -3
- package/esm2022/lib/components/tab/tab-item/tab-item.component.mjs +112 -0
- package/esm2022/lib/components/tab/tab.component.mjs +242 -0
- package/esm2022/lib/components/text-input/base-text-input/base-text-input.component.mjs +109 -0
- package/esm2022/lib/components/text-input/text-input.component.mjs +8 -103
- package/esm2022/lib/components/textarea/textarea.component.mjs +6 -5
- package/esm2022/lib/components/toast/toast.component.mjs +44 -5
- package/esm2022/lib/services/dropdown.service.mjs +2 -3
- package/esm2022/public-api.mjs +4 -1
- package/fesm2022/design-system-rte-angular.mjs +1047 -156
- package/fesm2022/design-system-rte-angular.mjs.map +1 -1
- package/lib/components/assistive-text/assistive-text.component.d.ts +14 -0
- package/lib/components/badge/badge.directive.d.ts +1 -1
- package/lib/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +3 -2
- package/lib/components/breadcrumbs/breadcrumbs.component.d.ts +10 -3
- package/lib/components/dropdown/dropdown-item/dropdown-item.component.d.ts +4 -1
- package/lib/components/dropdown/dropdown-menu/dropdown-menu-footer.directive.d.ts +7 -0
- package/lib/components/dropdown/dropdown-menu/dropdown-menu-header.directive.d.ts +7 -0
- package/lib/components/dropdown/dropdown-menu/dropdown-menu.component.d.ts +23 -1
- package/lib/components/dropdown/dropdown-trigger/dropdown-trigger.directive.d.ts +7 -1
- package/lib/components/dropdown/dropdown.directive.d.ts +17 -3
- package/lib/components/dropdown/dropdown.module.d.ts +3 -1
- package/lib/components/icon-button/icon-button.component.d.ts +5 -4
- package/lib/components/icon-button-toggle/icon-button-toggle.component.d.ts +2 -2
- package/lib/components/popover/popover.component.d.ts +1 -1
- package/lib/components/searchbar/searchbar.component.d.ts +31 -0
- package/lib/components/segmented-control/segmented-control.component.d.ts +1 -0
- package/lib/components/select/select.component.d.ts +56 -0
- package/lib/components/split-button/split-button.component.d.ts +10 -2
- package/lib/components/tab/tab-item/tab-item.component.d.ts +35 -0
- package/lib/components/tab/tab.component.d.ts +70 -0
- package/lib/components/tag/tag.component.d.ts +2 -2
- package/lib/components/text-input/base-text-input/base-text-input.component.d.ts +47 -0
- package/lib/components/text-input/text-input.component.d.ts +3 -39
- package/lib/components/toast/toast.component.d.ts +9 -1
- package/lib/components/tooltip/tooltip.component.d.ts +1 -1
- package/package.json +2 -2
- package/public-api.d.ts +3 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, Component, ChangeDetectionStrategy, HostBinding, Directive, inject, Injectable, DestroyRef, ChangeDetectorRef, effect, ElementRef, ViewContainerRef, Renderer2, HostListener, output, contentChild,
|
|
2
|
+
import { input, computed, Component, ChangeDetectionStrategy, HostBinding, Directive, inject, Injectable, DestroyRef, ChangeDetectorRef, effect, ElementRef, ViewContainerRef, Renderer2, HostListener, output, TemplateRef, contentChild, viewChild, signal, NgModule, viewChildren, RendererFactory2 } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -11,16 +11,19 @@ import { TOOLTIP_GAP, TOOLTIP_FADE_OUT_DURATION } from '@design-system-rte/core/
|
|
|
11
11
|
import { getTooltipGap } from '@design-system-rte/core/components/tooltip/tooltip.utils';
|
|
12
12
|
import { getAutoPlacement, getCoordinates, getAutoPlacementDropdown, getAutoAlignment } from '@design-system-rte/core/components/utils/auto-placement';
|
|
13
13
|
import { FOCUSABLE_ELEMENTS_QUERY } from '@design-system-rte/core/constants/dom/dom.constants';
|
|
14
|
+
import { getShowIcon, getShowText, getDisplayCount, getBadgeIconSize, getShowBadge, shouldDisplayBadge } from '@design-system-rte/core/components/badge/badge.utils';
|
|
14
15
|
import { splitButtonLeftIconSize, splitButtonRightIconSize } from '@design-system-rte/core/components/split-button/split-button.constants';
|
|
15
16
|
import { SPACE_KEY, ENTER_KEY, ARROW_DOWN_KEY, ARROW_UP_KEY, ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ESCAPE_KEY, TAB_KEY, BACKSPACE_KEY, DELETE_KEY } from '@design-system-rte/core/constants/keyboard/keyboard.constants';
|
|
16
17
|
import { BehaviorSubject } from 'rxjs';
|
|
17
18
|
import { map } from 'rxjs/operators';
|
|
19
|
+
import { waitForNextFrame } from '@design-system-rte/core/common/animation';
|
|
20
|
+
import { DROPDOWN_ANIMATION_DURATION } from '@design-system-rte/core/components/dropdown/dropdown.constants';
|
|
18
21
|
import { DropdownManager } from '@design-system-rte/core/components/dropdown/DropdownManager';
|
|
19
22
|
import { ButtonIconSize } from '@design-system-rte/core/components/button/common/common-button.constants';
|
|
20
|
-
import { getShowIcon, getShowText, getDisplayCount, getBadgeIconSize, getShowBadge } from '@design-system-rte/core/components/badge/badge.utils';
|
|
21
23
|
import { CHIP_TYPE_TO_ARIA_ROLE_MAP } from '@design-system-rte/core/components/chip/chip.constants';
|
|
22
24
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
23
|
-
import {
|
|
25
|
+
import { REQUIREMENT_INDICATOR_VALUE } from '@design-system-rte/core/components/required-indicator/required-indicator.constant';
|
|
26
|
+
import { TEXTAREA_ICON_SIZE } from '@design-system-rte/core/components/textarea/textarea.constants';
|
|
24
27
|
import { switchHeight, switchWidth } from '@design-system-rte/core/components/switch/switch.constants';
|
|
25
28
|
import { isValidSegmentedControlOptions, focusNextSegmentElement, focusPreviousSegmentElement, focusPreviousNotSegmentElement, focusNextNotSegmentElement, getSegmentPosition } from '@design-system-rte/core/components/segmented-control/segmented-control-utils';
|
|
26
29
|
import { BREADCRUMBS_DEFAULT_ARIA_LABEL } from '@design-system-rte/core/components/breadcrumbs/breadcrumbs.constants';
|
|
@@ -28,10 +31,16 @@ import { shouldTruncateBreadcrumbs, getBreadcrumbsTruncatedItems } from '@design
|
|
|
28
31
|
import { cardSize } from '@design-system-rte/core/components/card/card.constats';
|
|
29
32
|
import { POPOVER_GAP_ARROW, POPOVER_GAP } from '@design-system-rte/core/components/popover/popover.constants';
|
|
30
33
|
import { IconSize, IconTypeMap } from '@design-system-rte/core/components/icon/icon.constants';
|
|
34
|
+
import { APPEARANCE_CONFIG, SEARCHBAR_BORDER_RADIUS, SEARCHBAR_PADDING_LEFT, SEARCHBAR_BUTTON_WIDTH, SEARCHBAR_BUTTON_HEIGHT_COMPACT } from '@design-system-rte/core/components/searchbar/searchbar.constants';
|
|
31
35
|
import { sideNavCollapsedSize, sideNavPanelSize, dividerAppearanceBySideNavAppearance } from '@design-system-rte/core/components/side-nav/side-nav.constants';
|
|
32
36
|
import { getNavItemLabelIconSize } from '@design-system-rte/core/components/side-nav/nav-item/nav-item.utils';
|
|
37
|
+
import { ToastDurationMap } from '@design-system-rte/core/components/toast/toast.constants';
|
|
33
38
|
import { getToastPriority } from '@design-system-rte/core/components/toast/toast.utils';
|
|
34
39
|
import { v4 } from 'uuid';
|
|
40
|
+
import { MIN_SELECT_WIDTH, SELECT_DROPDOWN_OFFSET, THRESHOLD_BOTTOM_POSITION } from '@design-system-rte/core/components/select/select.constants';
|
|
41
|
+
import { ASSISTIVE_TEXT_ICON_SIZE } from '@design-system-rte/core/components/assistive-text/assistive-text.constants';
|
|
42
|
+
import { getIconNameFromAppearance } from '@design-system-rte/core/components/assistive-text/assistive-text.utils';
|
|
43
|
+
import { scrollToSelectedTab } from '@design-system-rte/core/components/tab/tab.utils';
|
|
35
44
|
|
|
36
45
|
class ButtonComponent {
|
|
37
46
|
constructor() {
|
|
@@ -799,6 +808,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
799
808
|
args: ["blur"]
|
|
800
809
|
}] } });
|
|
801
810
|
|
|
811
|
+
class BadgeComponent {
|
|
812
|
+
constructor() {
|
|
813
|
+
this.badgeType = input("brand");
|
|
814
|
+
this.badgeSize = input("m");
|
|
815
|
+
this.badgeContent = input("number");
|
|
816
|
+
this.count = input();
|
|
817
|
+
this.icon = input("notification");
|
|
818
|
+
this.simpleBadge = input(false);
|
|
819
|
+
this.isValidIconName = computed(() => {
|
|
820
|
+
const icon = this.icon();
|
|
821
|
+
return isValidIconName(icon);
|
|
822
|
+
});
|
|
823
|
+
this.showIcon = computed(() => getShowIcon({
|
|
824
|
+
size: this.badgeSize(),
|
|
825
|
+
content: this.badgeContent(),
|
|
826
|
+
iconSize: this.iconSize(),
|
|
827
|
+
}));
|
|
828
|
+
this.showText = computed(() => getShowText({
|
|
829
|
+
size: this.badgeSize(),
|
|
830
|
+
content: this.badgeContent(),
|
|
831
|
+
count: this.count(),
|
|
832
|
+
}));
|
|
833
|
+
this.displayCount = computed(() => getDisplayCount(this.count()));
|
|
834
|
+
this.countOverflow = computed(() => this.showText() && this.displayCount().length > 2);
|
|
835
|
+
this.iconSize = computed(() => getBadgeIconSize(this.badgeSize()));
|
|
836
|
+
this.showBadge = computed(() => getShowBadge({
|
|
837
|
+
size: this.badgeSize(),
|
|
838
|
+
content: this.badgeContent(),
|
|
839
|
+
count: this.count(),
|
|
840
|
+
iconSize: this.iconSize(),
|
|
841
|
+
}));
|
|
842
|
+
}
|
|
843
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
844
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: BadgeComponent, isStandalone: true, selector: "rte-badge", inputs: { badgeType: { classPropertyName: "badgeType", publicName: "badgeType", isSignal: true, isRequired: false, transformFunction: null }, badgeSize: { classPropertyName: "badgeSize", publicName: "badgeSize", isSignal: true, isRequired: false, transformFunction: null }, badgeContent: { classPropertyName: "badgeContent", publicName: "badgeContent", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, simpleBadge: { classPropertyName: "simpleBadge", publicName: "simpleBadge", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"badge size-{{ badgeSize() }} type-{{ badgeType() }}\"\n data-testid=\"badge\"\n [attr.data-simple-badge]=\"simpleBadge()\"\n [ngClass]=\"{ hidden: !showBadge(), 'count-overflow': countOverflow() }\"\n>\n <rte-icon *ngIf=\"showIcon()\" class=\"badge-icon\" [name]=\"icon()!\" [size]=\"iconSize()!\" />\n <span *ngIf=\"showText()\" class=\"badge-text\">\n {{ displayCount() }}\n </span>\n</div>\n", styles: [".badge{position:absolute;border-radius:999px;display:flex;align-items:center;justify-content:center;transition:opacity .15s ease-in-out;box-sizing:border-box}.badge.hidden{opacity:0}.badge.type-brand{box-shadow:0 2px 4px 0 var(--elevation-shadow-key-brand),0 0 2px 0 var(--elevation-shadow-ambient-brand);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.badge.type-neutral{box-shadow:0 2px 4px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-neutral-regular-default);color:var(--content-secondary)}.badge.type-indicator{box-shadow:0 2px 4px 0 var(--elevation-shadow-key-brand),0 0 2px 0 var(--elevation-shadow-ambient-brand);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-danger-default);color:var(--content-primary-inverse)}.badge.size-xs{width:6px;height:6px;box-shadow:none;top:-3px;right:-3px}.badge.size-s{width:12px;height:12px;top:-6px;right:-6px}.badge.size-m{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;min-width:16px;width:fit-content;height:16px;top:-8px;right:-8px;padding:0 2px}.badge.size-m.count-overflow{padding:0 4px}.badge.size-l{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:16px;line-height:24px;letter-spacing:0px;min-width:24px;width:fit-content;height:24px;top:-12px;right:-12px;padding:0 4px}.badge.size-l.count-overflow{padding:0 6px}.badge[data-simple-badge=true]{position:static;box-shadow:none}.badge .badge-text{margin:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
845
|
+
}
|
|
846
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
847
|
+
type: Component,
|
|
848
|
+
args: [{ selector: "rte-badge", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"badge size-{{ badgeSize() }} type-{{ badgeType() }}\"\n data-testid=\"badge\"\n [attr.data-simple-badge]=\"simpleBadge()\"\n [ngClass]=\"{ hidden: !showBadge(), 'count-overflow': countOverflow() }\"\n>\n <rte-icon *ngIf=\"showIcon()\" class=\"badge-icon\" [name]=\"icon()!\" [size]=\"iconSize()!\" />\n <span *ngIf=\"showText()\" class=\"badge-text\">\n {{ displayCount() }}\n </span>\n</div>\n", styles: [".badge{position:absolute;border-radius:999px;display:flex;align-items:center;justify-content:center;transition:opacity .15s ease-in-out;box-sizing:border-box}.badge.hidden{opacity:0}.badge.type-brand{box-shadow:0 2px 4px 0 var(--elevation-shadow-key-brand),0 0 2px 0 var(--elevation-shadow-ambient-brand);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.badge.type-neutral{box-shadow:0 2px 4px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-neutral-regular-default);color:var(--content-secondary)}.badge.type-indicator{box-shadow:0 2px 4px 0 var(--elevation-shadow-key-brand),0 0 2px 0 var(--elevation-shadow-ambient-brand);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-danger-default);color:var(--content-primary-inverse)}.badge.size-xs{width:6px;height:6px;box-shadow:none;top:-3px;right:-3px}.badge.size-s{width:12px;height:12px;top:-6px;right:-6px}.badge.size-m{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;min-width:16px;width:fit-content;height:16px;top:-8px;right:-8px;padding:0 2px}.badge.size-m.count-overflow{padding:0 4px}.badge.size-l{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:16px;line-height:24px;letter-spacing:0px;min-width:24px;width:fit-content;height:24px;top:-12px;right:-12px;padding:0 4px}.badge.size-l.count-overflow{padding:0 6px}.badge[data-simple-badge=true]{position:static;box-shadow:none}.badge .badge-text{margin:0}\n"] }]
|
|
849
|
+
}] });
|
|
850
|
+
|
|
851
|
+
class BadgeDirective {
|
|
852
|
+
constructor() {
|
|
853
|
+
this.rteBadgeType = input("brand");
|
|
854
|
+
this.rteBadgeSize = input("m");
|
|
855
|
+
this.rteBadgeContent = input("number");
|
|
856
|
+
this.rteBadgeCount = input();
|
|
857
|
+
this.rteBadgeIcon = input("settings");
|
|
858
|
+
this.badgeComponentRef = null;
|
|
859
|
+
this.viewContainer = inject(ViewContainerRef);
|
|
860
|
+
this.elementRef = inject(ElementRef);
|
|
861
|
+
this.renderer = inject(Renderer2);
|
|
862
|
+
this.hostElement = this.elementRef.nativeElement;
|
|
863
|
+
}
|
|
864
|
+
ngOnInit() {
|
|
865
|
+
this.badgeComponentRef = this.viewContainer.createComponent(BadgeComponent);
|
|
866
|
+
this.assignDirectiveToComponent();
|
|
867
|
+
this.appendComponentToHost();
|
|
868
|
+
this.renderer.setStyle(this.hostElement, "position", "relative");
|
|
869
|
+
}
|
|
870
|
+
ngOnChanges() {
|
|
871
|
+
this.assignDirectiveToComponent();
|
|
872
|
+
}
|
|
873
|
+
ngOnDestroy() {
|
|
874
|
+
if (this.badgeComponentRef) {
|
|
875
|
+
this.badgeComponentRef.destroy();
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
assignDirectiveToComponent() {
|
|
879
|
+
if (this.badgeComponentRef) {
|
|
880
|
+
this.badgeComponentRef.setInput("badgeType", this.rteBadgeType());
|
|
881
|
+
this.badgeComponentRef.setInput("badgeSize", this.rteBadgeSize());
|
|
882
|
+
this.badgeComponentRef.setInput("badgeContent", this.rteBadgeContent());
|
|
883
|
+
this.badgeComponentRef.setInput("count", this.rteBadgeCount());
|
|
884
|
+
this.badgeComponentRef.setInput("icon", this.rteBadgeIcon());
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
appendComponentToHost() {
|
|
888
|
+
if (this.badgeComponentRef) {
|
|
889
|
+
this.renderer.appendChild(this.elementRef.nativeElement, this.badgeComponentRef.location.nativeElement);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
893
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: BadgeDirective, isStandalone: true, selector: "[rteBadge]", inputs: { rteBadgeType: { classPropertyName: "rteBadgeType", publicName: "rteBadgeType", isSignal: true, isRequired: false, transformFunction: null }, rteBadgeSize: { classPropertyName: "rteBadgeSize", publicName: "rteBadgeSize", isSignal: true, isRequired: false, transformFunction: null }, rteBadgeContent: { classPropertyName: "rteBadgeContent", publicName: "rteBadgeContent", isSignal: true, isRequired: false, transformFunction: null }, rteBadgeCount: { classPropertyName: "rteBadgeCount", publicName: "rteBadgeCount", isSignal: true, isRequired: false, transformFunction: null }, rteBadgeIcon: { classPropertyName: "rteBadgeIcon", publicName: "rteBadgeIcon", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0 }); }
|
|
894
|
+
}
|
|
895
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeDirective, decorators: [{
|
|
896
|
+
type: Directive,
|
|
897
|
+
args: [{
|
|
898
|
+
selector: "[rteBadge]",
|
|
899
|
+
standalone: true,
|
|
900
|
+
}]
|
|
901
|
+
}], ctorParameters: () => [] });
|
|
902
|
+
|
|
802
903
|
class DividerComponent {
|
|
803
904
|
constructor() {
|
|
804
905
|
this.orientation = input("horizontal");
|
|
@@ -820,6 +921,15 @@ class DropdownItemComponent {
|
|
|
820
921
|
this.item = input();
|
|
821
922
|
this.menuId = input();
|
|
822
923
|
this.itemEvent = output();
|
|
924
|
+
this.shouldDisplayBadge = computed(() => {
|
|
925
|
+
const item = this.item();
|
|
926
|
+
return shouldDisplayBadge({
|
|
927
|
+
showBadge: !!item?.showBadge,
|
|
928
|
+
badgeContent: item?.badgeContent,
|
|
929
|
+
badgeCount: item?.badgeCount,
|
|
930
|
+
badgeIcon: item?.badgeIcon,
|
|
931
|
+
});
|
|
932
|
+
});
|
|
823
933
|
}
|
|
824
934
|
handleClick(event) {
|
|
825
935
|
if (this.item()?.disabled) {
|
|
@@ -827,7 +937,10 @@ class DropdownItemComponent {
|
|
|
827
937
|
event.stopPropagation();
|
|
828
938
|
return;
|
|
829
939
|
}
|
|
830
|
-
this.itemEvent.emit({
|
|
940
|
+
this.itemEvent.emit({
|
|
941
|
+
event,
|
|
942
|
+
id: this.item()?.id || this.item()?.label || "",
|
|
943
|
+
});
|
|
831
944
|
}
|
|
832
945
|
handleKeyDown(event) {
|
|
833
946
|
event.preventDefault();
|
|
@@ -837,16 +950,49 @@ class DropdownItemComponent {
|
|
|
837
950
|
link?.click();
|
|
838
951
|
}
|
|
839
952
|
else {
|
|
840
|
-
this.itemEvent.emit({
|
|
953
|
+
this.itemEvent.emit({
|
|
954
|
+
event,
|
|
955
|
+
id: this.item()?.id || this.item()?.label || "",
|
|
956
|
+
});
|
|
841
957
|
}
|
|
842
958
|
}
|
|
843
959
|
}
|
|
844
960
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
845
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: DropdownItemComponent, isStandalone: true, selector: "rte-dropdown-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null }, menuId: { classPropertyName: "menuId", publicName: "menuId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemEvent: "itemEvent" }, ngImport: i0, template: "<ng-container>\n <li\n #itemRef\n class=\"rte-dropdown-item\"\n role=\"menuitem\"\n tabindex=\"0\"\n [attr.data-disabled]=\"item()?.disabled\"\n [attr.
|
|
961
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: DropdownItemComponent, isStandalone: true, selector: "rte-dropdown-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null }, menuId: { classPropertyName: "menuId", publicName: "menuId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemEvent: "itemEvent" }, ngImport: i0, template: "<ng-container>\n <li\n #itemRef\n class=\"rte-dropdown-item\"\n role=\"menuitem\"\n tabindex=\"0\"\n [attr.data-disabled]=\"item()?.disabled\"\n [attr.data-active]=\"item()?.selected\"\n (click)=\"handleClick($event)\"\n (keydown)=\"handleKeyDown($event)\"\n >\n <span *ngIf=\"item()?.hasIndent && !item()?.leftIcon\" style=\"width: 20px\"></span>\n <rte-icon *ngIf=\"item()?.leftIcon\" [name]=\"item()?.leftIcon ?? ''\" />\n <ng-container [ngSwitch]=\"!!item()?.link\">\n <a *ngSwitchCase=\"true\" style=\"flex: 2; text-decoration: none; color: inherit\" [href]=\"item()?.link\"\n >{{ item()?.label }}\n </a>\n <span *ngSwitchDefault style=\"flex: 2\">{{ item()?.label }}</span>\n </ng-container>\n <div *ngIf=\"item()?.trailingText\">{{ item()?.trailingText }}</div>\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [badgeType]=\"item()?.badgeType!\"\n [badgeContent]=\"item()?.badgeContent!\"\n [count]=\"item()?.badgeCount\"\n [simpleBadge]=\"true\"\n [icon]=\"item()?.badgeIcon ?? ''\"\n [badgeSize]=\"item()?.badgeSize!\"\n ></rte-badge>\n </li>\n <div *ngIf=\"item()?.hasSeparator\" class=\"dropdown-divider\">\n <rte-divider />\n </div>\n</ng-container>\n", styles: [".rte-dropdown-item{font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;color:var(--content-secondary);display:flex;height:40px;padding:8px 12px;align-items:center;gap:12px;align-self:stretch;cursor:pointer;box-sizing:border-box}.rte-dropdown-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-dropdown-item:hover{background-color:var(--background-hover)}.rte-dropdown-item[data-disabled=true]{cursor:not-allowed;color:var(--content-disabled);background:var(--background-disabled)}.rte-dropdown-item[data-active=true]{background-color:var(--background-brand-inverse-pressed)}.rte-dropdown-item:focus-visible{outline:none;background-color:var(--background-hover)}.dropdown-divider{width:100%;padding:8px 0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: DividerComponent, selector: "rte-divider", inputs: ["orientation", "thickness", "appearance", "endPoint"] }, { kind: "component", type: BadgeComponent, selector: "rte-badge", inputs: ["badgeType", "badgeSize", "badgeContent", "count", "icon", "simpleBadge"] }] }); }
|
|
846
962
|
}
|
|
847
963
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownItemComponent, decorators: [{
|
|
848
964
|
type: Component,
|
|
849
|
-
args: [{ selector: "rte-dropdown-item", imports: [CommonModule, IconComponent, DividerComponent], standalone: true, template: "<ng-container>\n <li\n #itemRef\n class=\"rte-dropdown-item\"\n role=\"menuitem\"\n tabindex=\"0\"\n [attr.data-disabled]=\"item()?.disabled\"\n [attr.
|
|
965
|
+
args: [{ selector: "rte-dropdown-item", imports: [CommonModule, IconComponent, DividerComponent, BadgeComponent], standalone: true, template: "<ng-container>\n <li\n #itemRef\n class=\"rte-dropdown-item\"\n role=\"menuitem\"\n tabindex=\"0\"\n [attr.data-disabled]=\"item()?.disabled\"\n [attr.data-active]=\"item()?.selected\"\n (click)=\"handleClick($event)\"\n (keydown)=\"handleKeyDown($event)\"\n >\n <span *ngIf=\"item()?.hasIndent && !item()?.leftIcon\" style=\"width: 20px\"></span>\n <rte-icon *ngIf=\"item()?.leftIcon\" [name]=\"item()?.leftIcon ?? ''\" />\n <ng-container [ngSwitch]=\"!!item()?.link\">\n <a *ngSwitchCase=\"true\" style=\"flex: 2; text-decoration: none; color: inherit\" [href]=\"item()?.link\"\n >{{ item()?.label }}\n </a>\n <span *ngSwitchDefault style=\"flex: 2\">{{ item()?.label }}</span>\n </ng-container>\n <div *ngIf=\"item()?.trailingText\">{{ item()?.trailingText }}</div>\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [badgeType]=\"item()?.badgeType!\"\n [badgeContent]=\"item()?.badgeContent!\"\n [count]=\"item()?.badgeCount\"\n [simpleBadge]=\"true\"\n [icon]=\"item()?.badgeIcon ?? ''\"\n [badgeSize]=\"item()?.badgeSize!\"\n ></rte-badge>\n </li>\n <div *ngIf=\"item()?.hasSeparator\" class=\"dropdown-divider\">\n <rte-divider />\n </div>\n</ng-container>\n", styles: [".rte-dropdown-item{font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;color:var(--content-secondary);display:flex;height:40px;padding:8px 12px;align-items:center;gap:12px;align-self:stretch;cursor:pointer;box-sizing:border-box}.rte-dropdown-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-dropdown-item:hover{background-color:var(--background-hover)}.rte-dropdown-item[data-disabled=true]{cursor:not-allowed;color:var(--content-disabled);background:var(--background-disabled)}.rte-dropdown-item[data-active=true]{background-color:var(--background-brand-inverse-pressed)}.rte-dropdown-item:focus-visible{outline:none;background-color:var(--background-hover)}.dropdown-divider{width:100%;padding:8px 0}\n"] }]
|
|
966
|
+
}] });
|
|
967
|
+
|
|
968
|
+
class DropdownMenuFooterDirective {
|
|
969
|
+
constructor() {
|
|
970
|
+
this.templateRef = inject((TemplateRef), { optional: true });
|
|
971
|
+
}
|
|
972
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownMenuFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
973
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: DropdownMenuFooterDirective, isStandalone: true, selector: "[rteDropdownMenuFooter]", ngImport: i0 }); }
|
|
974
|
+
}
|
|
975
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownMenuFooterDirective, decorators: [{
|
|
976
|
+
type: Directive,
|
|
977
|
+
args: [{
|
|
978
|
+
selector: "[rteDropdownMenuFooter]",
|
|
979
|
+
standalone: true,
|
|
980
|
+
}]
|
|
981
|
+
}] });
|
|
982
|
+
|
|
983
|
+
class DropdownMenuHeaderDirective {
|
|
984
|
+
constructor() {
|
|
985
|
+
this.templateRef = inject((TemplateRef), { optional: true });
|
|
986
|
+
}
|
|
987
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownMenuHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
988
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: DropdownMenuHeaderDirective, isStandalone: true, selector: "[rteDropdownMenuHeader]", ngImport: i0 }); }
|
|
989
|
+
}
|
|
990
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownMenuHeaderDirective, decorators: [{
|
|
991
|
+
type: Directive,
|
|
992
|
+
args: [{
|
|
993
|
+
selector: "[rteDropdownMenuHeader]",
|
|
994
|
+
standalone: true,
|
|
995
|
+
}]
|
|
850
996
|
}] });
|
|
851
997
|
|
|
852
998
|
class DropdownService {
|
|
@@ -870,7 +1016,6 @@ class DropdownService {
|
|
|
870
1016
|
}
|
|
871
1017
|
reset() {
|
|
872
1018
|
this.state$.next(this.initialState);
|
|
873
|
-
console.log("🔵 Dropdown Service - State Reset");
|
|
874
1019
|
}
|
|
875
1020
|
handleKeyboardInput(key, options) {
|
|
876
1021
|
if ([ARROW_DOWN_KEY, ARROW_UP_KEY, ARROW_LEFT_KEY, ARROW_RIGHT_KEY].includes(key)) {
|
|
@@ -921,7 +1066,7 @@ class DropdownService {
|
|
|
921
1066
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownService, decorators: [{
|
|
922
1067
|
type: Injectable,
|
|
923
1068
|
args: [{
|
|
924
|
-
providedIn: "root",
|
|
1069
|
+
providedIn: "root",
|
|
925
1070
|
}]
|
|
926
1071
|
}] });
|
|
927
1072
|
|
|
@@ -932,6 +1077,29 @@ class DropdownMenuComponent {
|
|
|
932
1077
|
this.items = input([]);
|
|
933
1078
|
this.menuId = input();
|
|
934
1079
|
this.itemEvent = output();
|
|
1080
|
+
this.widthStyle = computed(() => (this.width() !== undefined ? `${this.width()}px` : undefined));
|
|
1081
|
+
this.isOpen = input(false);
|
|
1082
|
+
this.width = input(null);
|
|
1083
|
+
this.closingMenu = output();
|
|
1084
|
+
this.menuStyle = computed(() => {
|
|
1085
|
+
return this.width() ? { width: this.width() + "px", "max-width": this.width() + "px" } : {};
|
|
1086
|
+
});
|
|
1087
|
+
this.headerDirective = contentChild(DropdownMenuHeaderDirective);
|
|
1088
|
+
this.footerDirective = contentChild(DropdownMenuFooterDirective);
|
|
1089
|
+
this.headerTemplate = input(undefined);
|
|
1090
|
+
this.footerTemplate = input(undefined);
|
|
1091
|
+
this.headerContentRef = viewChild("headerContent");
|
|
1092
|
+
this.footerContentRef = viewChild("footerContent");
|
|
1093
|
+
this.hasHeaderContent = computed(() => {
|
|
1094
|
+
const hasTemplate = !!this.headerTemplate();
|
|
1095
|
+
const hasProjectedContent = !!this.headerContentRef()?.nativeElement?.children.length;
|
|
1096
|
+
return hasTemplate || hasProjectedContent;
|
|
1097
|
+
});
|
|
1098
|
+
this.hasFooterContent = computed(() => {
|
|
1099
|
+
const hasTemplate = !!this.footerTemplate();
|
|
1100
|
+
const hasProjectedContent = !!this.footerContentRef()?.nativeElement?.children.length;
|
|
1101
|
+
return hasTemplate || hasProjectedContent;
|
|
1102
|
+
});
|
|
935
1103
|
}
|
|
936
1104
|
getChildMenuId(itemIndex) {
|
|
937
1105
|
return `${this.menuId()}:${itemIndex + 1}`;
|
|
@@ -946,6 +1114,9 @@ class DropdownMenuComponent {
|
|
|
946
1114
|
if ([ARROW_UP_KEY, ARROW_DOWN_KEY, ARROW_LEFT_KEY, ARROW_RIGHT_KEY, TAB_KEY].includes(event.key)) {
|
|
947
1115
|
event.preventDefault();
|
|
948
1116
|
}
|
|
1117
|
+
if (event.key === ESCAPE_KEY) {
|
|
1118
|
+
this.closingMenu.emit();
|
|
1119
|
+
}
|
|
949
1120
|
const menuId = this.menuId();
|
|
950
1121
|
this.dropdownService.handleKeyboardInput(event.key, {
|
|
951
1122
|
menuElement: this.elementRef,
|
|
@@ -953,11 +1124,11 @@ class DropdownMenuComponent {
|
|
|
953
1124
|
});
|
|
954
1125
|
}
|
|
955
1126
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
956
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DropdownMenuComponent, isStandalone: true, selector: "rte-dropdown-menu", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, menuId: { classPropertyName: "menuId", publicName: "menuId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemEvent: "itemEvent" }, host: { listeners: { "keydown": "onKeyDown($event)" }, properties: { "attr.data-menu-id": "menuId()" } }, ngImport: i0, template: "<div class=\"rte-dropdown-menu\">\n <ul class=\"rte-dropdown-items\" role=\"menu\" [attr.aria-activedescendant]=\"menuId()\">\n
|
|
1127
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DropdownMenuComponent, isStandalone: true, selector: "rte-dropdown-menu", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, menuId: { classPropertyName: "menuId", publicName: "menuId", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: false, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemEvent: "itemEvent", closingMenu: "closingMenu" }, host: { listeners: { "keydown": "onKeyDown($event)" }, properties: { "attr.data-menu-id": "menuId()" } }, queries: [{ propertyName: "headerDirective", first: true, predicate: DropdownMenuHeaderDirective, descendants: true, isSignal: true }, { propertyName: "footerDirective", first: true, predicate: DropdownMenuFooterDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "headerContentRef", first: true, predicate: ["headerContent"], descendants: true, isSignal: true }, { propertyName: "footerContentRef", first: true, predicate: ["footerContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"rte-dropdown-menu {{ isOpen() ? 'open' : 'closed' }}\" [ngStyle]=\"menuStyle()\">\n @if (hasHeaderContent()) {\n <div class=\"rte-dropdown-menu-header\">\n @if (headerTemplate() || headerDirective()?.templateRef) {\n <ng-container [ngTemplateOutlet]=\"(headerTemplate() || headerDirective()?.templateRef) ?? null\"></ng-container>\n } @else {\n <div #headerContent>\n <ng-content select=\"[dropdown-menu-header]\"></ng-content>\n </div>\n }\n <rte-divider />\n </div>\n }\n <div class=\"rte-dropdown-menu-content\">\n <ul class=\"rte-dropdown-items\" role=\"menu\" [attr.aria-activedescendant]=\"menuId()\">\n @for (item of items(); track item.label; let i = $index) {\n <rte-dropdown-item [item]=\"item\" (itemEvent)=\"handleItemEvent($event)\" />\n }\n </ul>\n </div>\n @if (hasFooterContent()) {\n <div class=\"rte-dropdown-menu-footer\">\n <rte-divider />\n @if (footerTemplate() || footerDirective()?.templateRef) {\n <ng-container [ngTemplateOutlet]=\"(footerTemplate() || footerDirective()?.templateRef) ?? null\"></ng-container>\n } @else {\n <div #footerContent>\n <ng-content select=\"[dropdown-menu-footer]\"></ng-content>\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{display:none;position:absolute}.rte-dropdown-menu{opacity:0;box-shadow:0 8px 16px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-4) 0%,var(--elevation-surface-shadow-4) 100%);background-color:var(--background-default);position:absolute;top:0;left:0;display:flex;min-width:112px;max-width:280px;padding:8px 0;flex-direction:column;align-items:flex-start;gap:0px;border-radius:4px;transition:opacity .1s ease-in-out;pointer-events:auto;overflow-x:hidden;overflow-y:auto}.rte-dropdown-menu-header,.rte-dropdown-menu-content,.rte-dropdown-menu-footer{width:100%}.rte-dropdown-menu.open{opacity:1}.rte-dropdown-menu .rte-dropdown-items{width:100%;padding:0;margin:0}.rte-dropdown-menu .rte-dropdown-items li{list-style:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: DropdownItemComponent, selector: "rte-dropdown-item", inputs: ["item", "menuId"], outputs: ["itemEvent"] }, { kind: "component", type: DividerComponent, selector: "rte-divider", inputs: ["orientation", "thickness", "appearance", "endPoint"] }] }); }
|
|
957
1128
|
}
|
|
958
1129
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownMenuComponent, decorators: [{
|
|
959
1130
|
type: Component,
|
|
960
|
-
args: [{ selector: "rte-dropdown-menu", imports: [CommonModule, DropdownItemComponent], standalone: true, host: { "[attr.data-menu-id]": "menuId()" }, template: "<div class=\"rte-dropdown-menu\">\n <ul class=\"rte-dropdown-items\" role=\"menu\" [attr.aria-activedescendant]=\"menuId()\">\n
|
|
1131
|
+
args: [{ selector: "rte-dropdown-menu", imports: [CommonModule, DropdownItemComponent, DividerComponent], standalone: true, host: { "[attr.data-menu-id]": "menuId()" }, template: "<div class=\"rte-dropdown-menu {{ isOpen() ? 'open' : 'closed' }}\" [ngStyle]=\"menuStyle()\">\n @if (hasHeaderContent()) {\n <div class=\"rte-dropdown-menu-header\">\n @if (headerTemplate() || headerDirective()?.templateRef) {\n <ng-container [ngTemplateOutlet]=\"(headerTemplate() || headerDirective()?.templateRef) ?? null\"></ng-container>\n } @else {\n <div #headerContent>\n <ng-content select=\"[dropdown-menu-header]\"></ng-content>\n </div>\n }\n <rte-divider />\n </div>\n }\n <div class=\"rte-dropdown-menu-content\">\n <ul class=\"rte-dropdown-items\" role=\"menu\" [attr.aria-activedescendant]=\"menuId()\">\n @for (item of items(); track item.label; let i = $index) {\n <rte-dropdown-item [item]=\"item\" (itemEvent)=\"handleItemEvent($event)\" />\n }\n </ul>\n </div>\n @if (hasFooterContent()) {\n <div class=\"rte-dropdown-menu-footer\">\n <rte-divider />\n @if (footerTemplate() || footerDirective()?.templateRef) {\n <ng-container [ngTemplateOutlet]=\"(footerTemplate() || footerDirective()?.templateRef) ?? null\"></ng-container>\n } @else {\n <div #footerContent>\n <ng-content select=\"[dropdown-menu-footer]\"></ng-content>\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{display:none;position:absolute}.rte-dropdown-menu{opacity:0;box-shadow:0 8px 16px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-4) 0%,var(--elevation-surface-shadow-4) 100%);background-color:var(--background-default);position:absolute;top:0;left:0;display:flex;min-width:112px;max-width:280px;padding:8px 0;flex-direction:column;align-items:flex-start;gap:0px;border-radius:4px;transition:opacity .1s ease-in-out;pointer-events:auto;overflow-x:hidden;overflow-y:auto}.rte-dropdown-menu-header,.rte-dropdown-menu-content,.rte-dropdown-menu-footer{width:100%}.rte-dropdown-menu.open{opacity:1}.rte-dropdown-menu .rte-dropdown-items{width:100%;padding:0;margin:0}.rte-dropdown-menu .rte-dropdown-items li{list-style:none}\n"] }]
|
|
961
1132
|
}], propDecorators: { onKeyDown: [{
|
|
962
1133
|
type: HostListener,
|
|
963
1134
|
args: ["keydown", ["$event"]]
|
|
@@ -970,6 +1141,9 @@ class DropdownTriggerDirective {
|
|
|
970
1141
|
this.dropdownKeyDown = output();
|
|
971
1142
|
this.dropdownTriggered = output();
|
|
972
1143
|
this.dropdownTriggerFocus = output();
|
|
1144
|
+
this.dropdownTriggerClearContent = output();
|
|
1145
|
+
this.dropdownTriggerOpenDropdown = output();
|
|
1146
|
+
this.dropdownTriggerCloseDropdown = output();
|
|
973
1147
|
}
|
|
974
1148
|
onDropdownTriggered(event) {
|
|
975
1149
|
this.dropdownTriggered.emit(event);
|
|
@@ -980,8 +1154,17 @@ class DropdownTriggerDirective {
|
|
|
980
1154
|
onKeyDown(event) {
|
|
981
1155
|
this.dropdownKeyDown.emit(event);
|
|
982
1156
|
}
|
|
1157
|
+
onDropdownTriggerClearContent(event) {
|
|
1158
|
+
this.dropdownTriggerClearContent.emit(event);
|
|
1159
|
+
}
|
|
1160
|
+
onDropdownTriggerOpenDropdown(event) {
|
|
1161
|
+
this.dropdownTriggerOpenDropdown.emit(event);
|
|
1162
|
+
}
|
|
1163
|
+
onDropdownTriggerCloseDropdown(event) {
|
|
1164
|
+
this.dropdownTriggerCloseDropdown.emit(event);
|
|
1165
|
+
}
|
|
983
1166
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
984
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: DropdownTriggerDirective, isStandalone: true, selector: "[rteDropdownTrigger]", inputs: { rteDropdownTriggerActivateWithArrowDown: { classPropertyName: "rteDropdownTriggerActivateWithArrowDown", publicName: "rteDropdownTriggerActivateWithArrowDown", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dropdownKeyDown: "dropdownKeyDown", dropdownTriggered: "dropdownTriggered", dropdownTriggerFocus: "dropdownTriggerFocus" }, host: { listeners: { "click": "onDropdownTriggered($event)", "focus": "onDropdownTriggerFocus($event)", "keydown": "onKeyDown($event)" } }, ngImport: i0 }); }
|
|
1167
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: DropdownTriggerDirective, isStandalone: true, selector: "[rteDropdownTrigger]", inputs: { rteDropdownTriggerActivateWithArrowDown: { classPropertyName: "rteDropdownTriggerActivateWithArrowDown", publicName: "rteDropdownTriggerActivateWithArrowDown", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dropdownKeyDown: "dropdownKeyDown", dropdownTriggered: "dropdownTriggered", dropdownTriggerFocus: "dropdownTriggerFocus", dropdownTriggerClearContent: "dropdownTriggerClearContent", dropdownTriggerOpenDropdown: "dropdownTriggerOpenDropdown", dropdownTriggerCloseDropdown: "dropdownTriggerCloseDropdown" }, host: { listeners: { "click": "onDropdownTriggered($event)", "focus": "onDropdownTriggerFocus($event)", "keydown": "onKeyDown($event)", "clearContent": "onDropdownTriggerClearContent($event)", "openDropdown": "onDropdownTriggerOpenDropdown($event)", "closeDropdown": "onDropdownTriggerCloseDropdown($event)" } }, ngImport: i0 }); }
|
|
985
1168
|
}
|
|
986
1169
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownTriggerDirective, decorators: [{
|
|
987
1170
|
type: Directive,
|
|
@@ -998,6 +1181,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
998
1181
|
}], onKeyDown: [{
|
|
999
1182
|
type: HostListener,
|
|
1000
1183
|
args: ["keydown", ["$event"]]
|
|
1184
|
+
}], onDropdownTriggerClearContent: [{
|
|
1185
|
+
type: HostListener,
|
|
1186
|
+
args: ["clearContent", ["$event"]]
|
|
1187
|
+
}], onDropdownTriggerOpenDropdown: [{
|
|
1188
|
+
type: HostListener,
|
|
1189
|
+
args: ["openDropdown", ["$event"]]
|
|
1190
|
+
}], onDropdownTriggerCloseDropdown: [{
|
|
1191
|
+
type: HostListener,
|
|
1192
|
+
args: ["closeDropdown", ["$event"]]
|
|
1001
1193
|
}] } });
|
|
1002
1194
|
|
|
1003
1195
|
const focusNextElement = (dropdown) => {
|
|
@@ -1044,12 +1236,16 @@ class DropdownDirective {
|
|
|
1044
1236
|
constructor() {
|
|
1045
1237
|
this.trigger = contentChild(DropdownTriggerDirective);
|
|
1046
1238
|
this.menu = contentChild(DropdownMenuComponent);
|
|
1239
|
+
this.rteDropdownId = input(undefined);
|
|
1047
1240
|
this.rteDropdownPosition = input("bottom");
|
|
1048
1241
|
this.rteDropdownAlignment = input("start");
|
|
1049
1242
|
this.rteDropdownIsOpen = input(false);
|
|
1050
1243
|
this.rteDropdownOffset = input(0);
|
|
1051
|
-
this.
|
|
1244
|
+
this.rteDropdownAutofocus = input(true);
|
|
1245
|
+
this.rteDropdownAutoOpen = input(true);
|
|
1246
|
+
this.rteDropdownWidth = input(null);
|
|
1052
1247
|
this.menuEvent = output();
|
|
1248
|
+
this.dropdownId = `dropdown_${++DropdownDirective.idCounter}`;
|
|
1053
1249
|
this.overlayService = inject(OverlayService);
|
|
1054
1250
|
this.dropdownService = inject(DropdownService);
|
|
1055
1251
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
@@ -1057,6 +1253,21 @@ class DropdownDirective {
|
|
|
1057
1253
|
this.renderer = inject(Renderer2);
|
|
1058
1254
|
this.destroyRef = inject(DestroyRef);
|
|
1059
1255
|
this.cdr = inject(ChangeDetectorRef);
|
|
1256
|
+
this.clickedOutside = output();
|
|
1257
|
+
this.closedDropdown = output();
|
|
1258
|
+
this.isActive = signal(false);
|
|
1259
|
+
this.menuInputs = computed(() => {
|
|
1260
|
+
const menu = this.menu();
|
|
1261
|
+
if (!menu) {
|
|
1262
|
+
return null;
|
|
1263
|
+
}
|
|
1264
|
+
return {
|
|
1265
|
+
items: menu.items(),
|
|
1266
|
+
headerTemplate: menu.headerDirective()?.templateRef,
|
|
1267
|
+
footerTemplate: menu.footerDirective()?.templateRef,
|
|
1268
|
+
width: menu.width(),
|
|
1269
|
+
};
|
|
1270
|
+
});
|
|
1060
1271
|
this.dropdownMenuRef = null;
|
|
1061
1272
|
this.handleClickOutside = (event) => {
|
|
1062
1273
|
const target = event.target;
|
|
@@ -1065,27 +1276,55 @@ class DropdownDirective {
|
|
|
1065
1276
|
return;
|
|
1066
1277
|
}
|
|
1067
1278
|
const clickedInTrigger = this.hostElement.contains(target);
|
|
1068
|
-
|
|
1279
|
+
const clickedInMenu = this.dropdownMenuRef?.location.nativeElement.contains(target);
|
|
1280
|
+
if (!clickedInTrigger && !clickedInMenu) {
|
|
1069
1281
|
this.closeDropdown();
|
|
1282
|
+
this.clickedOutside.emit();
|
|
1070
1283
|
}
|
|
1071
1284
|
};
|
|
1072
1285
|
this.hostElement = this.elementRef.nativeElement;
|
|
1286
|
+
effect(() => {
|
|
1287
|
+
const isOpen = this.rteDropdownIsOpen();
|
|
1288
|
+
if (isOpen) {
|
|
1289
|
+
if (!this.dropdownMenuRef) {
|
|
1290
|
+
this.showDropdownMenu();
|
|
1291
|
+
if (this.rteDropdownAutofocus()) {
|
|
1292
|
+
waitForNextFrame(() => focusDropdownFirstElement(this.dropdownId));
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
else if (this.dropdownMenuRef) {
|
|
1297
|
+
this.dropdownService.closeAllMenus();
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
effect(() => {
|
|
1301
|
+
const inputs = this.menuInputs();
|
|
1302
|
+
if (this.dropdownMenuRef && inputs) {
|
|
1303
|
+
this.assignInputs();
|
|
1304
|
+
}
|
|
1305
|
+
});
|
|
1073
1306
|
}
|
|
1074
1307
|
onTrigger() {
|
|
1075
|
-
this.
|
|
1308
|
+
if (this.rteDropdownAutoOpen()) {
|
|
1309
|
+
this.showDropdownMenu();
|
|
1310
|
+
}
|
|
1311
|
+
if (this.rteDropdownAutofocus()) {
|
|
1312
|
+
waitForNextFrame(() => focusDropdownFirstElement(this.dropdownId));
|
|
1313
|
+
}
|
|
1076
1314
|
}
|
|
1077
1315
|
onTriggerKeyEvent(event) {
|
|
1078
1316
|
if (event.key === SPACE_KEY ||
|
|
1079
1317
|
event.key === ENTER_KEY ||
|
|
1080
1318
|
(event.key === ARROW_DOWN_KEY && this.trigger()?.rteDropdownTriggerActivateWithArrowDown())) {
|
|
1081
1319
|
this.showDropdownMenu();
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
}
|
|
1320
|
+
if (this.rteDropdownAutofocus()) {
|
|
1321
|
+
waitForNextFrame(() => focusDropdownFirstElement(this.dropdownId));
|
|
1322
|
+
}
|
|
1085
1323
|
}
|
|
1086
1324
|
}
|
|
1087
1325
|
onMenuEvent(event) {
|
|
1088
1326
|
this.menuEvent.emit(event);
|
|
1327
|
+
this.isActive.set(false);
|
|
1089
1328
|
this.dropdownService.closeAllMenus();
|
|
1090
1329
|
}
|
|
1091
1330
|
ngAfterContentInit() {
|
|
@@ -1096,6 +1335,15 @@ class DropdownDirective {
|
|
|
1096
1335
|
this.trigger()?.dropdownKeyDown.subscribe((event) => {
|
|
1097
1336
|
this.onTriggerKeyEvent(event);
|
|
1098
1337
|
});
|
|
1338
|
+
this.trigger()?.dropdownTriggerClearContent.subscribe(() => {
|
|
1339
|
+
this.closeDropdown();
|
|
1340
|
+
});
|
|
1341
|
+
this.trigger()?.dropdownTriggerOpenDropdown.subscribe(() => {
|
|
1342
|
+
this.showDropdownMenu();
|
|
1343
|
+
});
|
|
1344
|
+
this.trigger()?.dropdownTriggerCloseDropdown.subscribe(() => {
|
|
1345
|
+
this.closeDropdown();
|
|
1346
|
+
});
|
|
1099
1347
|
}
|
|
1100
1348
|
}
|
|
1101
1349
|
showDropdownMenu() {
|
|
@@ -1103,10 +1351,10 @@ class DropdownDirective {
|
|
|
1103
1351
|
this.dropdownMenuRef.destroy();
|
|
1104
1352
|
}
|
|
1105
1353
|
this.dropdownMenuRef = this.overlayService.create(DropdownMenuComponent, this.viewContainerRef);
|
|
1106
|
-
const menuId = this.dropdownId;
|
|
1354
|
+
const menuId = this.rteDropdownId() || this.dropdownId;
|
|
1107
1355
|
this.dropdownMenuRef.setInput("menuId", menuId);
|
|
1108
1356
|
this.dropdownService.openMenu(menuId);
|
|
1109
|
-
this.
|
|
1357
|
+
this.assignInputs();
|
|
1110
1358
|
this.positionDropdownMenu(this.rteDropdownPosition());
|
|
1111
1359
|
this.addClickOutsideListener();
|
|
1112
1360
|
this.dropdownMenuRef.instance.itemEvent.subscribe((event) => {
|
|
@@ -1124,9 +1372,26 @@ class DropdownDirective {
|
|
|
1124
1372
|
});
|
|
1125
1373
|
this.destroyRef.onDestroy(() => dropdownStateSubscription.unsubscribe());
|
|
1126
1374
|
}
|
|
1127
|
-
|
|
1375
|
+
assignInputs() {
|
|
1128
1376
|
if (this.dropdownMenuRef) {
|
|
1129
|
-
|
|
1377
|
+
const items = this.menu()?.items() ?? [];
|
|
1378
|
+
this.dropdownMenuRef.setInput("items", items);
|
|
1379
|
+
this.dropdownMenuRef.setInput("headerTemplate", this.menu()?.headerDirective()?.templateRef);
|
|
1380
|
+
this.dropdownMenuRef.setInput("footerTemplate", this.menu()?.footerDirective()?.templateRef);
|
|
1381
|
+
}
|
|
1382
|
+
this.assignWidth();
|
|
1383
|
+
}
|
|
1384
|
+
assignWidth() {
|
|
1385
|
+
if (!this.dropdownMenuRef) {
|
|
1386
|
+
return;
|
|
1387
|
+
}
|
|
1388
|
+
const width = this.menuInputs()?.width ?? this.rteDropdownWidth();
|
|
1389
|
+
if (width !== undefined && width !== null) {
|
|
1390
|
+
this.dropdownMenuRef.setInput("width", width);
|
|
1391
|
+
waitForNextFrame(() => this.dropdownMenuRef?.setInput("isOpen", true));
|
|
1392
|
+
}
|
|
1393
|
+
else {
|
|
1394
|
+
this.dropdownMenuRef.setInput("isOpen", true);
|
|
1130
1395
|
}
|
|
1131
1396
|
}
|
|
1132
1397
|
positionDropdownMenu(position = "bottom") {
|
|
@@ -1158,10 +1423,14 @@ class DropdownDirective {
|
|
|
1158
1423
|
document.removeEventListener("mousedown", this.handleClickOutside);
|
|
1159
1424
|
}
|
|
1160
1425
|
closeDropdown() {
|
|
1161
|
-
this.
|
|
1426
|
+
this.dropdownMenuRef?.setInput("isOpen", false);
|
|
1427
|
+
this.isActive.set(false);
|
|
1428
|
+
setTimeout(() => {
|
|
1429
|
+
this.dropdownService.closeAllMenus();
|
|
1430
|
+
}, DROPDOWN_ANIMATION_DURATION);
|
|
1162
1431
|
}
|
|
1163
1432
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1164
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.2.14", type: DropdownDirective, isStandalone: true, selector: "[rteDropdown]", inputs: { rteDropdownPosition: { classPropertyName: "rteDropdownPosition", publicName: "rteDropdownPosition", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownAlignment: { classPropertyName: "rteDropdownAlignment", publicName: "rteDropdownAlignment", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownIsOpen: { classPropertyName: "rteDropdownIsOpen", publicName: "rteDropdownIsOpen", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownOffset: { classPropertyName: "rteDropdownOffset", publicName: "rteDropdownOffset", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuEvent: "menuEvent" }, host: { properties: { "class.dropdown": "true", "attr.data-dropdown-id": "dropdownId" } }, queries: [{ propertyName: "trigger", first: true, predicate: DropdownTriggerDirective, descendants: true, isSignal: true }, { propertyName: "menu", first: true, predicate: DropdownMenuComponent, descendants: true, isSignal: true }], ngImport: i0 }); }
|
|
1433
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.2.14", type: DropdownDirective, isStandalone: true, selector: "[rteDropdown]", inputs: { rteDropdownId: { classPropertyName: "rteDropdownId", publicName: "rteDropdownId", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownPosition: { classPropertyName: "rteDropdownPosition", publicName: "rteDropdownPosition", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownAlignment: { classPropertyName: "rteDropdownAlignment", publicName: "rteDropdownAlignment", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownIsOpen: { classPropertyName: "rteDropdownIsOpen", publicName: "rteDropdownIsOpen", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownOffset: { classPropertyName: "rteDropdownOffset", publicName: "rteDropdownOffset", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownAutofocus: { classPropertyName: "rteDropdownAutofocus", publicName: "rteDropdownAutofocus", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownAutoOpen: { classPropertyName: "rteDropdownAutoOpen", publicName: "rteDropdownAutoOpen", isSignal: true, isRequired: false, transformFunction: null }, rteDropdownWidth: { classPropertyName: "rteDropdownWidth", publicName: "rteDropdownWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuEvent: "menuEvent", clickedOutside: "clickedOutside", closedDropdown: "closedDropdown" }, host: { properties: { "class.dropdown": "true", "attr.data-dropdown-id": "dropdownId" } }, queries: [{ propertyName: "trigger", first: true, predicate: DropdownTriggerDirective, descendants: true, isSignal: true }, { propertyName: "menu", first: true, predicate: DropdownMenuComponent, descendants: true, isSignal: true }], ngImport: i0 }); }
|
|
1165
1434
|
}
|
|
1166
1435
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownDirective, decorators: [{
|
|
1167
1436
|
type: Directive,
|
|
@@ -1177,14 +1446,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1177
1446
|
|
|
1178
1447
|
class DropdownModule {
|
|
1179
1448
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1180
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: DropdownModule, imports: [DropdownDirective,
|
|
1181
|
-
|
|
1449
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: DropdownModule, imports: [DropdownDirective,
|
|
1450
|
+
DropdownTriggerDirective,
|
|
1451
|
+
DropdownMenuComponent,
|
|
1452
|
+
DropdownItemComponent,
|
|
1453
|
+
DropdownMenuHeaderDirective,
|
|
1454
|
+
DropdownMenuFooterDirective], exports: [DropdownDirective,
|
|
1455
|
+
DropdownTriggerDirective,
|
|
1456
|
+
DropdownMenuComponent,
|
|
1457
|
+
DropdownItemComponent,
|
|
1458
|
+
DropdownMenuHeaderDirective,
|
|
1459
|
+
DropdownMenuFooterDirective] }); }
|
|
1460
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownModule, imports: [DropdownMenuComponent,
|
|
1461
|
+
DropdownItemComponent] }); }
|
|
1182
1462
|
}
|
|
1183
1463
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownModule, decorators: [{
|
|
1184
1464
|
type: NgModule,
|
|
1185
1465
|
args: [{
|
|
1186
|
-
imports: [
|
|
1187
|
-
|
|
1466
|
+
imports: [
|
|
1467
|
+
DropdownDirective,
|
|
1468
|
+
DropdownTriggerDirective,
|
|
1469
|
+
DropdownMenuComponent,
|
|
1470
|
+
DropdownItemComponent,
|
|
1471
|
+
DropdownMenuHeaderDirective,
|
|
1472
|
+
DropdownMenuFooterDirective,
|
|
1473
|
+
],
|
|
1474
|
+
exports: [
|
|
1475
|
+
DropdownDirective,
|
|
1476
|
+
DropdownTriggerDirective,
|
|
1477
|
+
DropdownMenuComponent,
|
|
1478
|
+
DropdownItemComponent,
|
|
1479
|
+
DropdownMenuHeaderDirective,
|
|
1480
|
+
DropdownMenuFooterDirective,
|
|
1481
|
+
],
|
|
1188
1482
|
}]
|
|
1189
1483
|
}] });
|
|
1190
1484
|
|
|
@@ -1201,6 +1495,12 @@ class SplitButtonComponent {
|
|
|
1201
1495
|
this.disabled = input(false);
|
|
1202
1496
|
this.ariaLabelRight = input();
|
|
1203
1497
|
this.options = input([]);
|
|
1498
|
+
this.badgeType = input();
|
|
1499
|
+
this.showBadge = input(false);
|
|
1500
|
+
this.badgeContent = input();
|
|
1501
|
+
this.badgeCount = input(undefined);
|
|
1502
|
+
this.badgeIcon = input("notification");
|
|
1503
|
+
this.badgeSize = input("m");
|
|
1204
1504
|
this.splitButtonLeftIconSize = computed(() => splitButtonLeftIconSize[this.size()]);
|
|
1205
1505
|
this.splitButtonRightIconSize = computed(() => splitButtonRightIconSize[this.size()]);
|
|
1206
1506
|
this.isOpen = signal(false);
|
|
@@ -1210,6 +1510,12 @@ class SplitButtonComponent {
|
|
|
1210
1510
|
this.internalAlignment = computed(() => {
|
|
1211
1511
|
return this.position().split("-")[1];
|
|
1212
1512
|
});
|
|
1513
|
+
this.hasBadge = computed(() => shouldDisplayBadge({
|
|
1514
|
+
showBadge: !!this.showBadge(),
|
|
1515
|
+
badgeContent: this.badgeContent(),
|
|
1516
|
+
badgeCount: this.badgeCount(),
|
|
1517
|
+
badgeIcon: this.badgeIcon(),
|
|
1518
|
+
}));
|
|
1213
1519
|
}
|
|
1214
1520
|
handleClickOutside(event) {
|
|
1215
1521
|
const target = event.target;
|
|
@@ -1240,102 +1546,13 @@ class SplitButtonComponent {
|
|
|
1240
1546
|
}
|
|
1241
1547
|
}
|
|
1242
1548
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1243
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: SplitButtonComponent, isStandalone: true, selector: "rte-split-button", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelRight: { classPropertyName: "ariaLabelRight", publicName: "ariaLabelRight", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"split-button-container size-{{ size() }} {{ appearance() }}\"\n [ngClass]=\"{ 'compact-spacing': compactSpacing() }\"\n>\n <button\n class=\"split-button-left size-{{ size() }}\"\n data-testid=\"Main action button\"\n type=\"button\"\n [disabled]=\"disabled()\"\n >\n <rte-icon *ngIf=\"icon()\" [name]=\"icon()!\" [size]=\"splitButtonLeftIconSize()\" />\n <p class=\"split-button-label size-{{ size() }}\">\n {{ label() }}\n </p>\n </button>\n\n <div class=\"split-button-divider\" [ngClass]=\"{ disabled: disabled() }\"></div>\n\n <div\n rteDropdown\n style=\"height: 100%\"\n [rteDropdownPosition]=\"internalPosition()\"\n [rteDropdownAlignment]=\"internalAlignment()\"\n [attr.data-testid]=\"'Menu container'\"\n >\n <button\n class=\"split-button-right size-{{ size() }}\"\n rteDropdownTrigger\n data-testid=\"Menu button\"\n type=\"button\"\n aria-haspopup=\"menu\"\n [rteDropdownTriggerActivateWithArrowDown]=\"true\"\n [attr.data-expanded]=\"isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-label]=\"ariaLabelRight()\"\n [disabled]=\"disabled()\"\n (click)=\"isOpen.set(true)\"\n (keydown)=\"handleKeyDownOnRightButton($event)\"\n >\n <div class=\"split-button-right-icon-container\">\n <rte-icon name=\"arrow-chevron-down\" [size]=\"splitButtonRightIconSize()\" />\n </div>\n </button>\n <rte-dropdown-menu [items]=\"options()\" />\n </div>\n</div>\n", styles: [".split-button-container{display:inline-flex;padding:0;align-items:center;gap:0px;align-self:stretch}.split-button-container.size-s{height:24px}.split-button-container.size-s.compact-spacing{height:20px}.split-button-container.size-m{height:32px}.split-button-container.size-m.compact-spacing{height:24px}.split-button-container.size-l{height:40px}.split-button-container.size-l.compact-spacing{height:28px}.split-button-container .split-button-left{display:flex;border:none;padding:4px 12px;align-items:center;gap:0px;align-self:stretch;border-radius:4px 0 0 4px;border-color:var(--border-brand-default);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.split-button-container .split-button-left.size-s{padding:0 8px}.split-button-container .split-button-left.size-l{padding:8px 12px}.split-button-container .split-button-left .split-button-label{margin:0}.split-button-container .split-button-left .split-button-label.size-s{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:14px;line-height:20px;letter-spacing:-.5px}.split-button-container .split-button-left .split-button-label.size-m{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:16px;line-height:24px;letter-spacing:-.5px}.split-button-container .split-button-left .split-button-label.size-l{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:20px;line-height:28px;letter-spacing:-.5px}.split-button-container .split-button-left:hover{cursor:pointer;background-color:var(--background-brand-hover)}.split-button-container .split-button-left:active{background-color:var(--background-brand-pressed)}.split-button-container .split-button-left:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-left:1px solid var(--border-disabled);cursor:not-allowed}.split-button-container .split-button-left:focus-visible{outline:none;position:relative;z-index:1}.split-button-container .split-button-left:focus-visible:after{content:\"\";position:absolute;inset:-8px -1px -8px -8px;border:1px solid var(--border-brand-focused);pointer-events:none;border-radius:4px;z-index:2}.split-button-container .split-button-divider{width:1px;height:100%;background-color:var(--content-primary-inverse)}.split-button-container .split-button-divider.disabled{background-color:var(--border-disabled)}.split-button-container .split-button-right{display:flex;border:none;padding:4px 12px;align-items:center;justify-content:center;align-self:stretch;width:34px;height:100%;border-radius:0 4px 4px 0;border-color:var(--border-brand-default);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.split-button-container .split-button-right.size-s{width:24px;padding:2px 8px}.split-button-container .split-button-right.size-l{width:44px;padding:6px 16px}.split-button-container .split-button-right:hover{cursor:pointer;background-color:var(--background-brand-hover)}.split-button-container .split-button-right:active,.split-button-container .split-button-right[data-expanded=true]{background-color:var(--background-brand-pressed)}.split-button-container .split-button-right:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-right:1px solid var(--border-disabled);cursor:not-allowed}.split-button-container .split-button-right:focus-visible{outline:none;position:relative;z-index:1}.split-button-container .split-button-right:focus-visible:after{content:\"\";position:absolute;inset:-8px -8px -8px -1px;border:1px solid var(--border-brand-focused);pointer-events:none;border-radius:4px;z-index:2}.split-button-container .split-button-right .split-button-right-icon-container{display:flex;pointer-events:none}.split-button-container .split-button-dropdown{position:absolute}.split-button-container .split-button-dropdown.position-bottom-start{top:100%;left:0}.split-button-container .split-button-dropdown.position-bottom-end{top:100%;right:0}.split-button-container .split-button-dropdown.position-top-start{bottom:100%;left:0}.split-button-container .split-button-dropdown.position-top-end{bottom:100%;right:0}.split-button-container.secondary .split-button-left{border-top:1px solid var(--border-brand-default);border-bottom:1px solid var(--border-brand-default);border-left:1px solid var(--border-brand-default);background-color:var(--background-default);color:var(--content-brand-default)}.split-button-container.secondary .split-button-left:hover{cursor:pointer;background-color:var(--background-brand-inverse-hover)}.split-button-container.secondary .split-button-left:active{background-color:var(--background-brand-inverse-pressed)}.split-button-container.secondary .split-button-left:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-left:1px solid var(--border-disabled);cursor:not-allowed}.split-button-container.secondary .split-button-divider{background-color:var(--border-brand-default)}.split-button-container.secondary .split-button-right{border-top:1px solid var(--border-brand-default);border-bottom:1px solid var(--border-brand-default);border-right:1px solid var(--border-brand-default);background-color:var(--background-default);color:var(--content-brand-default)}.split-button-container.secondary .split-button-right:hover{cursor:pointer;background-color:var(--background-brand-inverse-hover)}.split-button-container.secondary .split-button-right:active{background-color:var(--background-brand-inverse-pressed)}.split-button-container.secondary .split-button-right:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-right:1px solid var(--border-disabled);cursor:not-allowed}.animation-slide-from-top{animation:slide-from-top .2s ease-in-out}@keyframes slide-from-top{0%{transform:translateY(-10px);pointer-events:none;opacity:0}to{transform:translateY(0);opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: DropdownDirective, selector: "[rteDropdown]", inputs: ["rteDropdownPosition", "rteDropdownAlignment", "rteDropdownIsOpen", "rteDropdownOffset"], outputs: ["menuEvent"] }, { kind: "directive", type: DropdownTriggerDirective, selector: "[rteDropdownTrigger]", inputs: ["rteDropdownTriggerActivateWithArrowDown"], outputs: ["dropdownKeyDown", "dropdownTriggered", "dropdownTriggerFocus"] }, { kind: "component", type: DropdownMenuComponent, selector: "rte-dropdown-menu", inputs: ["items", "menuId"], outputs: ["itemEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1549
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SplitButtonComponent, isStandalone: true, selector: "rte-split-button", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelRight: { classPropertyName: "ariaLabelRight", publicName: "ariaLabelRight", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, badgeType: { classPropertyName: "badgeType", publicName: "badgeType", isSignal: true, isRequired: false, transformFunction: null }, showBadge: { classPropertyName: "showBadge", publicName: "showBadge", isSignal: true, isRequired: false, transformFunction: null }, badgeContent: { classPropertyName: "badgeContent", publicName: "badgeContent", isSignal: true, isRequired: false, transformFunction: null }, badgeCount: { classPropertyName: "badgeCount", publicName: "badgeCount", isSignal: true, isRequired: false, transformFunction: null }, badgeIcon: { classPropertyName: "badgeIcon", publicName: "badgeIcon", isSignal: true, isRequired: false, transformFunction: null }, badgeSize: { classPropertyName: "badgeSize", publicName: "badgeSize", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"split-button-container size-{{ size() }} {{ appearance() }}\"\n [ngClass]=\"{ 'compact-spacing': compactSpacing() }\"\n>\n <button\n class=\"split-button-left size-{{ size() }}\"\n data-testid=\"Main action button\"\n type=\"button\"\n [disabled]=\"disabled()\"\n >\n <rte-icon *ngIf=\"icon()\" [name]=\"icon()!\" [size]=\"splitButtonLeftIconSize()\" />\n <p class=\"split-button-label size-{{ size() }}\">\n {{ label() }}\n </p>\n </button>\n\n <div class=\"split-button-divider\" [ngClass]=\"{ disabled: disabled() }\"></div>\n\n <div\n rteDropdown\n style=\"height: 100%\"\n [rteDropdownPosition]=\"internalPosition()\"\n [rteDropdownAlignment]=\"internalAlignment()\"\n [attr.data-testid]=\"'Menu container'\"\n >\n @if (hasBadge()) {\n <button\n class=\"split-button-right size-{{ size() }}\"\n rteBadge\n rteDropdownTrigger\n data-testid=\"Menu button\"\n type=\"button\"\n aria-haspopup=\"menu\"\n [rteBadgeType]=\"badgeType()!\"\n [rteBadgeContent]=\"badgeContent()!\"\n [rteBadgeCount]=\"badgeCount()\"\n [rteDropdownTriggerActivateWithArrowDown]=\"true\"\n [attr.data-expanded]=\"isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-label]=\"ariaLabelRight()\"\n [disabled]=\"disabled()\"\n (click)=\"isOpen.set(true)\"\n (keydown)=\"handleKeyDownOnRightButton($event)\"\n >\n <div class=\"split-button-right-icon-container\">\n <rte-icon name=\"arrow-chevron-down\" [size]=\"splitButtonRightIconSize()\" />\n </div>\n </button>\n } @else {\n <button\n class=\"split-button-right size-{{ size() }}\"\n rteDropdownTrigger\n data-testid=\"Menu button\"\n type=\"button\"\n aria-haspopup=\"menu\"\n [rteDropdownTriggerActivateWithArrowDown]=\"true\"\n [attr.data-expanded]=\"isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-label]=\"ariaLabelRight()\"\n [disabled]=\"disabled()\"\n (click)=\"isOpen.set(true)\"\n (keydown)=\"handleKeyDownOnRightButton($event)\"\n >\n <div class=\"split-button-right-icon-container\">\n <rte-icon name=\"arrow-chevron-down\" [size]=\"splitButtonRightIconSize()\" />\n </div>\n </button>\n }\n <rte-dropdown-menu [items]=\"options()\" />\n </div>\n</div>\n", styles: [".split-button-container{display:inline-flex;padding:0;align-items:center;gap:0px;align-self:stretch}.split-button-container.size-s{height:24px}.split-button-container.size-s.compact-spacing{height:20px}.split-button-container.size-m{height:32px}.split-button-container.size-m.compact-spacing{height:24px}.split-button-container.size-l{height:40px}.split-button-container.size-l.compact-spacing{height:28px}.split-button-container .split-button-left{display:flex;border:none;padding:4px 12px;align-items:center;gap:0px;align-self:stretch;border-radius:4px 0 0 4px;border-color:var(--border-brand-default);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.split-button-container .split-button-left.size-s{padding:0 8px}.split-button-container .split-button-left.size-l{padding:8px 12px}.split-button-container .split-button-left .split-button-label{margin:0}.split-button-container .split-button-left .split-button-label.size-s{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:14px;line-height:20px;letter-spacing:-.5px}.split-button-container .split-button-left .split-button-label.size-m{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:16px;line-height:24px;letter-spacing:-.5px}.split-button-container .split-button-left .split-button-label.size-l{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:20px;line-height:28px;letter-spacing:-.5px}.split-button-container .split-button-left:hover{cursor:pointer;background-color:var(--background-brand-hover)}.split-button-container .split-button-left:active{background-color:var(--background-brand-pressed)}.split-button-container .split-button-left:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-left:1px solid var(--border-disabled);cursor:not-allowed}.split-button-container .split-button-left:focus-visible{outline:none;position:relative;z-index:1}.split-button-container .split-button-left:focus-visible:after{content:\"\";position:absolute;inset:-8px -1px -8px -8px;border:1px solid var(--border-brand-focused);pointer-events:none;border-radius:4px;z-index:2}.split-button-container .split-button-divider{width:1px;height:100%;background-color:var(--content-primary-inverse)}.split-button-container .split-button-divider.disabled{background-color:var(--border-disabled)}.split-button-container .split-button-right{display:flex;border:none;padding:4px 12px;align-items:center;justify-content:center;align-self:stretch;width:34px;height:100%;border-radius:0 4px 4px 0;border-color:var(--border-brand-default);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.split-button-container .split-button-right.size-s{width:24px;padding:2px 8px}.split-button-container .split-button-right.size-l{width:44px;padding:6px 16px}.split-button-container .split-button-right:hover{cursor:pointer;background-color:var(--background-brand-hover)}.split-button-container .split-button-right:active,.split-button-container .split-button-right[data-expanded=true]{background-color:var(--background-brand-pressed)}.split-button-container .split-button-right:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-right:1px solid var(--border-disabled);cursor:not-allowed}.split-button-container .split-button-right:focus-visible{outline:none;position:relative;z-index:1}.split-button-container .split-button-right:focus-visible:after{content:\"\";position:absolute;inset:-8px -8px -8px -1px;border:1px solid var(--border-brand-focused);pointer-events:none;border-radius:4px;z-index:2}.split-button-container .split-button-right .split-button-right-icon-container{display:flex;pointer-events:none}.split-button-container .split-button-dropdown{position:absolute}.split-button-container .split-button-dropdown.position-bottom-start{top:100%;left:0}.split-button-container .split-button-dropdown.position-bottom-end{top:100%;right:0}.split-button-container .split-button-dropdown.position-top-start{bottom:100%;left:0}.split-button-container .split-button-dropdown.position-top-end{bottom:100%;right:0}.split-button-container.secondary .split-button-left{border-top:1px solid var(--border-brand-default);border-bottom:1px solid var(--border-brand-default);border-left:1px solid var(--border-brand-default);background-color:var(--background-default);color:var(--content-brand-default)}.split-button-container.secondary .split-button-left:hover{cursor:pointer;background-color:var(--background-brand-inverse-hover)}.split-button-container.secondary .split-button-left:active{background-color:var(--background-brand-inverse-pressed)}.split-button-container.secondary .split-button-left:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-left:1px solid var(--border-disabled);cursor:not-allowed}.split-button-container.secondary .split-button-divider{background-color:var(--border-brand-default)}.split-button-container.secondary .split-button-right{border-top:1px solid var(--border-brand-default);border-bottom:1px solid var(--border-brand-default);border-right:1px solid var(--border-brand-default);background-color:var(--background-default);color:var(--content-brand-default)}.split-button-container.secondary .split-button-right:hover{cursor:pointer;background-color:var(--background-brand-inverse-hover)}.split-button-container.secondary .split-button-right:active{background-color:var(--background-brand-inverse-pressed)}.split-button-container.secondary .split-button-right:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-right:1px solid var(--border-disabled);cursor:not-allowed}.animation-slide-from-top{animation:slide-from-top .2s ease-in-out}@keyframes slide-from-top{0%{transform:translateY(-10px);pointer-events:none;opacity:0}to{transform:translateY(0);opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: DropdownDirective, selector: "[rteDropdown]", inputs: ["rteDropdownId", "rteDropdownPosition", "rteDropdownAlignment", "rteDropdownIsOpen", "rteDropdownOffset", "rteDropdownAutofocus", "rteDropdownAutoOpen", "rteDropdownWidth"], outputs: ["menuEvent", "clickedOutside", "closedDropdown"] }, { kind: "directive", type: DropdownTriggerDirective, selector: "[rteDropdownTrigger]", inputs: ["rteDropdownTriggerActivateWithArrowDown"], outputs: ["dropdownKeyDown", "dropdownTriggered", "dropdownTriggerFocus", "dropdownTriggerClearContent", "dropdownTriggerOpenDropdown", "dropdownTriggerCloseDropdown"] }, { kind: "component", type: DropdownMenuComponent, selector: "rte-dropdown-menu", inputs: ["items", "menuId", "isOpen", "width", "headerTemplate", "footerTemplate"], outputs: ["itemEvent", "closingMenu"] }, { kind: "directive", type: BadgeDirective, selector: "[rteBadge]", inputs: ["rteBadgeType", "rteBadgeSize", "rteBadgeContent", "rteBadgeCount", "rteBadgeIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1244
1550
|
}
|
|
1245
1551
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SplitButtonComponent, decorators: [{
|
|
1246
1552
|
type: Component,
|
|
1247
|
-
args: [{ selector: "rte-split-button", imports: [CommonModule, IconComponent, DropdownModule], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"split-button-container size-{{ size() }} {{ appearance() }}\"\n [ngClass]=\"{ 'compact-spacing': compactSpacing() }\"\n>\n <button\n class=\"split-button-left size-{{ size() }}\"\n data-testid=\"Main action button\"\n type=\"button\"\n [disabled]=\"disabled()\"\n >\n <rte-icon *ngIf=\"icon()\" [name]=\"icon()!\" [size]=\"splitButtonLeftIconSize()\" />\n <p class=\"split-button-label size-{{ size() }}\">\n {{ label() }}\n </p>\n </button>\n\n <div class=\"split-button-divider\" [ngClass]=\"{ disabled: disabled() }\"></div>\n\n <div\n rteDropdown\n style=\"height: 100%\"\n [rteDropdownPosition]=\"internalPosition()\"\n [rteDropdownAlignment]=\"internalAlignment()\"\n [attr.data-testid]=\"'Menu container'\"\n >\n <button\n
|
|
1248
|
-
}] });
|
|
1249
|
-
|
|
1250
|
-
class BadgeComponent {
|
|
1251
|
-
constructor() {
|
|
1252
|
-
this.badgeType = input("brand");
|
|
1253
|
-
this.badgeSize = input("m");
|
|
1254
|
-
this.badgeContent = input("number");
|
|
1255
|
-
this.count = input();
|
|
1256
|
-
this.icon = input("notification");
|
|
1257
|
-
this.simpleBadge = input(false);
|
|
1258
|
-
this.isValidIconName = computed(() => isValidIconName(this.icon()));
|
|
1259
|
-
this.showIcon = computed(() => getShowIcon({
|
|
1260
|
-
size: this.badgeSize(),
|
|
1261
|
-
content: this.badgeContent(),
|
|
1262
|
-
iconSize: this.iconSize(),
|
|
1263
|
-
}));
|
|
1264
|
-
this.showText = computed(() => getShowText({
|
|
1265
|
-
size: this.badgeSize(),
|
|
1266
|
-
content: this.badgeContent(),
|
|
1267
|
-
count: this.count(),
|
|
1268
|
-
}));
|
|
1269
|
-
this.displayCount = computed(() => getDisplayCount(this.count()));
|
|
1270
|
-
this.countOverflow = computed(() => this.showText() && this.displayCount().length > 2);
|
|
1271
|
-
this.iconSize = computed(() => getBadgeIconSize(this.badgeSize()));
|
|
1272
|
-
this.showBadge = computed(() => getShowBadge({
|
|
1273
|
-
size: this.badgeSize(),
|
|
1274
|
-
content: this.badgeContent(),
|
|
1275
|
-
count: this.count(),
|
|
1276
|
-
iconSize: this.iconSize(),
|
|
1277
|
-
}));
|
|
1278
|
-
}
|
|
1279
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1280
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: BadgeComponent, isStandalone: true, selector: "rte-badge", inputs: { badgeType: { classPropertyName: "badgeType", publicName: "badgeType", isSignal: true, isRequired: false, transformFunction: null }, badgeSize: { classPropertyName: "badgeSize", publicName: "badgeSize", isSignal: true, isRequired: false, transformFunction: null }, badgeContent: { classPropertyName: "badgeContent", publicName: "badgeContent", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, simpleBadge: { classPropertyName: "simpleBadge", publicName: "simpleBadge", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"badge size-{{ badgeSize() }} type-{{ badgeType() }}\"\n data-testid=\"badge\"\n [attr.data-simple-badge]=\"simpleBadge()\"\n [ngClass]=\"{ hidden: !showBadge(), 'count-overflow': countOverflow() }\"\n>\n <rte-icon *ngIf=\"showIcon()\" class=\"badge-icon\" [name]=\"icon()\" [size]=\"iconSize()!\" />\n <span *ngIf=\"showText()\" class=\"badge-text\">\n {{ displayCount() }}\n </span>\n</div>\n", styles: [".badge{position:absolute;border-radius:999px;display:flex;align-items:center;justify-content:center;transition:opacity .15s ease-in-out;box-sizing:border-box}.badge.hidden{opacity:0}.badge.type-brand{box-shadow:0 2px 4px 0 var(--elevation-shadow-key-brand),0 0 2px 0 var(--elevation-shadow-ambient-brand);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.badge.type-neutral{box-shadow:0 2px 4px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-neutral-regular-default);color:var(--content-secondary)}.badge.type-indicator{box-shadow:0 2px 4px 0 var(--elevation-shadow-key-brand),0 0 2px 0 var(--elevation-shadow-ambient-brand);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-danger-default);color:var(--content-primary-inverse)}.badge.size-xs{width:6px;height:6px;box-shadow:none;top:-3;right:-3}.badge.size-s{width:12px;height:12px;top:-6px;right:-6px}.badge.size-m{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;min-width:16px;width:fit-content;height:16px;top:-8px;right:-8px;padding:0 2px}.badge.size-m.count-overflow{padding:0 4px}.badge.size-l{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:16px;line-height:24px;letter-spacing:0px;min-width:24px;width:fit-content;height:24px;top:-12px;right:-12px;padding:0 4px}.badge.size-l.count-overflow{padding:0 6px}.badge[data-simple-badge=true]{position:static;box-shadow:none}.badge .badge-text{margin:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1281
|
-
}
|
|
1282
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
1283
|
-
type: Component,
|
|
1284
|
-
args: [{ selector: "rte-badge", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"badge size-{{ badgeSize() }} type-{{ badgeType() }}\"\n data-testid=\"badge\"\n [attr.data-simple-badge]=\"simpleBadge()\"\n [ngClass]=\"{ hidden: !showBadge(), 'count-overflow': countOverflow() }\"\n>\n <rte-icon *ngIf=\"showIcon()\" class=\"badge-icon\" [name]=\"icon()\" [size]=\"iconSize()!\" />\n <span *ngIf=\"showText()\" class=\"badge-text\">\n {{ displayCount() }}\n </span>\n</div>\n", styles: [".badge{position:absolute;border-radius:999px;display:flex;align-items:center;justify-content:center;transition:opacity .15s ease-in-out;box-sizing:border-box}.badge.hidden{opacity:0}.badge.type-brand{box-shadow:0 2px 4px 0 var(--elevation-shadow-key-brand),0 0 2px 0 var(--elevation-shadow-ambient-brand);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.badge.type-neutral{box-shadow:0 2px 4px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-neutral-regular-default);color:var(--content-secondary)}.badge.type-indicator{box-shadow:0 2px 4px 0 var(--elevation-shadow-key-brand),0 0 2px 0 var(--elevation-shadow-ambient-brand);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);background-color:var(--background-danger-default);color:var(--content-primary-inverse)}.badge.size-xs{width:6px;height:6px;box-shadow:none;top:-3;right:-3}.badge.size-s{width:12px;height:12px;top:-6px;right:-6px}.badge.size-m{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;min-width:16px;width:fit-content;height:16px;top:-8px;right:-8px;padding:0 2px}.badge.size-m.count-overflow{padding:0 4px}.badge.size-l{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:16px;line-height:24px;letter-spacing:0px;min-width:24px;width:fit-content;height:24px;top:-12px;right:-12px;padding:0 4px}.badge.size-l.count-overflow{padding:0 6px}.badge[data-simple-badge=true]{position:static;box-shadow:none}.badge .badge-text{margin:0}\n"] }]
|
|
1553
|
+
args: [{ selector: "rte-split-button", imports: [CommonModule, IconComponent, DropdownModule, BadgeDirective], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"split-button-container size-{{ size() }} {{ appearance() }}\"\n [ngClass]=\"{ 'compact-spacing': compactSpacing() }\"\n>\n <button\n class=\"split-button-left size-{{ size() }}\"\n data-testid=\"Main action button\"\n type=\"button\"\n [disabled]=\"disabled()\"\n >\n <rte-icon *ngIf=\"icon()\" [name]=\"icon()!\" [size]=\"splitButtonLeftIconSize()\" />\n <p class=\"split-button-label size-{{ size() }}\">\n {{ label() }}\n </p>\n </button>\n\n <div class=\"split-button-divider\" [ngClass]=\"{ disabled: disabled() }\"></div>\n\n <div\n rteDropdown\n style=\"height: 100%\"\n [rteDropdownPosition]=\"internalPosition()\"\n [rteDropdownAlignment]=\"internalAlignment()\"\n [attr.data-testid]=\"'Menu container'\"\n >\n @if (hasBadge()) {\n <button\n class=\"split-button-right size-{{ size() }}\"\n rteBadge\n rteDropdownTrigger\n data-testid=\"Menu button\"\n type=\"button\"\n aria-haspopup=\"menu\"\n [rteBadgeType]=\"badgeType()!\"\n [rteBadgeContent]=\"badgeContent()!\"\n [rteBadgeCount]=\"badgeCount()\"\n [rteDropdownTriggerActivateWithArrowDown]=\"true\"\n [attr.data-expanded]=\"isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-label]=\"ariaLabelRight()\"\n [disabled]=\"disabled()\"\n (click)=\"isOpen.set(true)\"\n (keydown)=\"handleKeyDownOnRightButton($event)\"\n >\n <div class=\"split-button-right-icon-container\">\n <rte-icon name=\"arrow-chevron-down\" [size]=\"splitButtonRightIconSize()\" />\n </div>\n </button>\n } @else {\n <button\n class=\"split-button-right size-{{ size() }}\"\n rteDropdownTrigger\n data-testid=\"Menu button\"\n type=\"button\"\n aria-haspopup=\"menu\"\n [rteDropdownTriggerActivateWithArrowDown]=\"true\"\n [attr.data-expanded]=\"isOpen()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-label]=\"ariaLabelRight()\"\n [disabled]=\"disabled()\"\n (click)=\"isOpen.set(true)\"\n (keydown)=\"handleKeyDownOnRightButton($event)\"\n >\n <div class=\"split-button-right-icon-container\">\n <rte-icon name=\"arrow-chevron-down\" [size]=\"splitButtonRightIconSize()\" />\n </div>\n </button>\n }\n <rte-dropdown-menu [items]=\"options()\" />\n </div>\n</div>\n", styles: [".split-button-container{display:inline-flex;padding:0;align-items:center;gap:0px;align-self:stretch}.split-button-container.size-s{height:24px}.split-button-container.size-s.compact-spacing{height:20px}.split-button-container.size-m{height:32px}.split-button-container.size-m.compact-spacing{height:24px}.split-button-container.size-l{height:40px}.split-button-container.size-l.compact-spacing{height:28px}.split-button-container .split-button-left{display:flex;border:none;padding:4px 12px;align-items:center;gap:0px;align-self:stretch;border-radius:4px 0 0 4px;border-color:var(--border-brand-default);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.split-button-container .split-button-left.size-s{padding:0 8px}.split-button-container .split-button-left.size-l{padding:8px 12px}.split-button-container .split-button-left .split-button-label{margin:0}.split-button-container .split-button-left .split-button-label.size-s{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:14px;line-height:20px;letter-spacing:-.5px}.split-button-container .split-button-left .split-button-label.size-m{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:16px;line-height:24px;letter-spacing:-.5px}.split-button-container .split-button-left .split-button-label.size-l{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:20px;line-height:28px;letter-spacing:-.5px}.split-button-container .split-button-left:hover{cursor:pointer;background-color:var(--background-brand-hover)}.split-button-container .split-button-left:active{background-color:var(--background-brand-pressed)}.split-button-container .split-button-left:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-left:1px solid var(--border-disabled);cursor:not-allowed}.split-button-container .split-button-left:focus-visible{outline:none;position:relative;z-index:1}.split-button-container .split-button-left:focus-visible:after{content:\"\";position:absolute;inset:-8px -1px -8px -8px;border:1px solid var(--border-brand-focused);pointer-events:none;border-radius:4px;z-index:2}.split-button-container .split-button-divider{width:1px;height:100%;background-color:var(--content-primary-inverse)}.split-button-container .split-button-divider.disabled{background-color:var(--border-disabled)}.split-button-container .split-button-right{display:flex;border:none;padding:4px 12px;align-items:center;justify-content:center;align-self:stretch;width:34px;height:100%;border-radius:0 4px 4px 0;border-color:var(--border-brand-default);background-color:var(--background-brand-default);color:var(--content-primary-inverse)}.split-button-container .split-button-right.size-s{width:24px;padding:2px 8px}.split-button-container .split-button-right.size-l{width:44px;padding:6px 16px}.split-button-container .split-button-right:hover{cursor:pointer;background-color:var(--background-brand-hover)}.split-button-container .split-button-right:active,.split-button-container .split-button-right[data-expanded=true]{background-color:var(--background-brand-pressed)}.split-button-container .split-button-right:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-right:1px solid var(--border-disabled);cursor:not-allowed}.split-button-container .split-button-right:focus-visible{outline:none;position:relative;z-index:1}.split-button-container .split-button-right:focus-visible:after{content:\"\";position:absolute;inset:-8px -8px -8px -1px;border:1px solid var(--border-brand-focused);pointer-events:none;border-radius:4px;z-index:2}.split-button-container .split-button-right .split-button-right-icon-container{display:flex;pointer-events:none}.split-button-container .split-button-dropdown{position:absolute}.split-button-container .split-button-dropdown.position-bottom-start{top:100%;left:0}.split-button-container .split-button-dropdown.position-bottom-end{top:100%;right:0}.split-button-container .split-button-dropdown.position-top-start{bottom:100%;left:0}.split-button-container .split-button-dropdown.position-top-end{bottom:100%;right:0}.split-button-container.secondary .split-button-left{border-top:1px solid var(--border-brand-default);border-bottom:1px solid var(--border-brand-default);border-left:1px solid var(--border-brand-default);background-color:var(--background-default);color:var(--content-brand-default)}.split-button-container.secondary .split-button-left:hover{cursor:pointer;background-color:var(--background-brand-inverse-hover)}.split-button-container.secondary .split-button-left:active{background-color:var(--background-brand-inverse-pressed)}.split-button-container.secondary .split-button-left:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-left:1px solid var(--border-disabled);cursor:not-allowed}.split-button-container.secondary .split-button-divider{background-color:var(--border-brand-default)}.split-button-container.secondary .split-button-right{border-top:1px solid var(--border-brand-default);border-bottom:1px solid var(--border-brand-default);border-right:1px solid var(--border-brand-default);background-color:var(--background-default);color:var(--content-brand-default)}.split-button-container.secondary .split-button-right:hover{cursor:pointer;background-color:var(--background-brand-inverse-hover)}.split-button-container.secondary .split-button-right:active{background-color:var(--background-brand-inverse-pressed)}.split-button-container.secondary .split-button-right:disabled{background-color:var(--background-disabled);color:var(--content-disabled);border-top:1px solid var(--border-disabled);border-bottom:1px solid var(--border-disabled);border-right:1px solid var(--border-disabled);cursor:not-allowed}.animation-slide-from-top{animation:slide-from-top .2s ease-in-out}@keyframes slide-from-top{0%{transform:translateY(-10px);pointer-events:none;opacity:0}to{transform:translateY(0);opacity:1}}\n"] }]
|
|
1285
1554
|
}] });
|
|
1286
1555
|
|
|
1287
|
-
class BadgeDirective {
|
|
1288
|
-
constructor() {
|
|
1289
|
-
this.rteBadgeType = input("brand");
|
|
1290
|
-
this.rteBadgeSize = input("m");
|
|
1291
|
-
this.rteBadgeContent = input("number");
|
|
1292
|
-
this.rteBadgeCount = input();
|
|
1293
|
-
this.rteBadgeIcon = input("settings");
|
|
1294
|
-
this.badgeComponentRef = null;
|
|
1295
|
-
this.viewContainer = inject(ViewContainerRef);
|
|
1296
|
-
this.elementRef = inject(ElementRef);
|
|
1297
|
-
this.renderer = inject(Renderer2);
|
|
1298
|
-
this.hostElement = this.elementRef.nativeElement;
|
|
1299
|
-
}
|
|
1300
|
-
ngOnInit() {
|
|
1301
|
-
this.badgeComponentRef = this.viewContainer.createComponent(BadgeComponent);
|
|
1302
|
-
this.assignDirectiveToComponent();
|
|
1303
|
-
this.appendComponentToHost();
|
|
1304
|
-
this.renderer.setStyle(this.hostElement, "position", "relative");
|
|
1305
|
-
}
|
|
1306
|
-
ngOnChanges() {
|
|
1307
|
-
this.assignDirectiveToComponent();
|
|
1308
|
-
}
|
|
1309
|
-
ngOnDestroy() {
|
|
1310
|
-
if (this.badgeComponentRef) {
|
|
1311
|
-
this.badgeComponentRef.destroy();
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
assignDirectiveToComponent() {
|
|
1315
|
-
if (this.badgeComponentRef) {
|
|
1316
|
-
this.badgeComponentRef.setInput("badgeType", this.rteBadgeType());
|
|
1317
|
-
this.badgeComponentRef.setInput("badgeSize", this.rteBadgeSize());
|
|
1318
|
-
this.badgeComponentRef.setInput("badgeContent", this.rteBadgeContent());
|
|
1319
|
-
this.badgeComponentRef.setInput("count", this.rteBadgeCount());
|
|
1320
|
-
this.badgeComponentRef.setInput("icon", this.rteBadgeIcon());
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
appendComponentToHost() {
|
|
1324
|
-
if (this.badgeComponentRef) {
|
|
1325
|
-
this.renderer.appendChild(this.elementRef.nativeElement, this.badgeComponentRef.location.nativeElement);
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1329
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: BadgeDirective, isStandalone: true, selector: "[rteBadge]", inputs: { rteBadgeType: { classPropertyName: "rteBadgeType", publicName: "rteBadgeType", isSignal: true, isRequired: false, transformFunction: null }, rteBadgeSize: { classPropertyName: "rteBadgeSize", publicName: "rteBadgeSize", isSignal: true, isRequired: false, transformFunction: null }, rteBadgeContent: { classPropertyName: "rteBadgeContent", publicName: "rteBadgeContent", isSignal: true, isRequired: false, transformFunction: null }, rteBadgeCount: { classPropertyName: "rteBadgeCount", publicName: "rteBadgeCount", isSignal: true, isRequired: false, transformFunction: null }, rteBadgeIcon: { classPropertyName: "rteBadgeIcon", publicName: "rteBadgeIcon", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0 }); }
|
|
1330
|
-
}
|
|
1331
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeDirective, decorators: [{
|
|
1332
|
-
type: Directive,
|
|
1333
|
-
args: [{
|
|
1334
|
-
selector: "[rteBadge]",
|
|
1335
|
-
standalone: true,
|
|
1336
|
-
}]
|
|
1337
|
-
}], ctorParameters: () => [] });
|
|
1338
|
-
|
|
1339
1556
|
class IconButtonComponent {
|
|
1340
1557
|
constructor() {
|
|
1341
1558
|
this.disabled = input(false);
|
|
@@ -1351,9 +1568,10 @@ class IconButtonComponent {
|
|
|
1351
1568
|
this.badgeContent = input();
|
|
1352
1569
|
this.badgeType = input();
|
|
1353
1570
|
this.badgeIcon = input("settings");
|
|
1571
|
+
this.customStyle = input();
|
|
1354
1572
|
this.buttonIconSize = computed(() => ButtonIconSize[this.size()]);
|
|
1355
1573
|
this.isValidIconName = computed(() => isValidIconName(this.name()));
|
|
1356
|
-
this.
|
|
1574
|
+
this.clickEvent = output();
|
|
1357
1575
|
this.shouldDisplayBadge = computed(() => {
|
|
1358
1576
|
const count = this.badgeCount();
|
|
1359
1577
|
const content = this.badgeContent();
|
|
@@ -1361,15 +1579,14 @@ class IconButtonComponent {
|
|
|
1361
1579
|
});
|
|
1362
1580
|
}
|
|
1363
1581
|
onClick(event) {
|
|
1364
|
-
|
|
1365
|
-
this.click.emit(event);
|
|
1582
|
+
this.clickEvent.emit(event);
|
|
1366
1583
|
}
|
|
1367
1584
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1368
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: IconButtonComponent, isStandalone: true, selector: "rte-icon-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, badgeCount: { classPropertyName: "badgeCount", publicName: "badgeCount", isSignal: true, isRequired: false, transformFunction: null }, badgeContent: { classPropertyName: "badgeContent", publicName: "badgeContent", isSignal: true, isRequired: false, transformFunction: null }, badgeType: { classPropertyName: "badgeType", publicName: "badgeType", isSignal: true, isRequired: false, transformFunction: null }, badgeIcon: { classPropertyName: "badgeIcon", publicName: "badgeIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: {
|
|
1585
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: IconButtonComponent, isStandalone: true, selector: "rte-icon-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, badgeCount: { classPropertyName: "badgeCount", publicName: "badgeCount", isSignal: true, isRequired: false, transformFunction: null }, badgeContent: { classPropertyName: "badgeContent", publicName: "badgeContent", isSignal: true, isRequired: false, transformFunction: null }, badgeType: { classPropertyName: "badgeType", publicName: "badgeType", isSignal: true, isRequired: false, transformFunction: null }, badgeIcon: { classPropertyName: "badgeIcon", publicName: "badgeIcon", isSignal: true, isRequired: false, transformFunction: null }, customStyle: { classPropertyName: "customStyle", publicName: "customStyle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickEvent: "clickEvent" }, ngImport: i0, template: "@if (shouldDisplayBadge()) {\n <button\n *ngIf=\"isValidIconName\"\n class=\"rte-icon-button {{ variant() }} size-{{ size() }}\"\n rteBadge\n [class.compact-spacing]=\"compactSpacing()\"\n [ngStyle]=\"customStyle()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n [rteBadgeType]=\"badgeType()!\"\n [rteBadgeSize]=\"size()\"\n [rteBadgeContent]=\"size() === 's' ? 'empty' : badgeContent()!\"\n [rteBadgeCount]=\"badgeCount()!\"\n [rteBadgeIcon]=\"badgeIcon()!\"\n (click)=\"onClick($event)\"\n >\n <rte-icon [name]=\"name()\" [appearance]=\"appearance()\" [size]=\"buttonIconSize()\" />\n </button>\n} @else {\n <button\n *ngIf=\"isValidIconName\"\n class=\"rte-icon-button {{ variant() }} size-{{ size() }}\"\n [class.compact-spacing]=\"compactSpacing()\"\n [ngStyle]=\"customStyle()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n (click)=\"onClick($event)\"\n >\n <rte-icon [name]=\"name()\" [appearance]=\"appearance()\" [size]=\"buttonIconSize()\" />\n </button>\n}\n", styles: [".rte-icon-button{display:flex;cursor:pointer;height:24px;align-items:center;gap:0px;flex-shrink:0}.rte-icon-button:focus-visible{outline:none;position:relative;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-icon-button.size-s{border-radius:4px;height:24px;padding:2px 4px}.rte-icon-button.size-s.compact-spacing{height:16px}.rte-icon-button.size-m{border-radius:4px;height:32px;padding:4px 6px}.rte-icon-button.size-m.compact-spacing{height:20px}.rte-icon-button.size-l{border-radius:8px;height:40px;padding:6px 8px}.rte-icon-button.size-l.compact-spacing{height:24px}.rte-icon-button.primary{background:var(--background-brand-default);border:var(--border-brand-default)}.rte-icon-button.primary ::ng-deep .rte-icon-container{color:var(--content-primary-inverse)}.rte-icon-button.primary:hover{background:var(--background-brand-hover);border:var(--background-brand-hover)}.rte-icon-button.primary:active{background:var(--background-brand-pressed)}.rte-icon-button.primary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}.rte-icon-button.primary:disabled ::ng-deep .rte-icon-container{color:var(--content-disabled)}.rte-icon-button.secondary{background:var(--background-default);border:solid 1px var(--border-brand-default);color:var(--content-brand-default)}.rte-icon-button.secondary:hover{background:var(--background-brand-inverse-hover);border:solid 1px var(--border-brand-default)}.rte-icon-button.secondary:active{background:var(--background-brand-inverse-pressed)}.rte-icon-button.secondary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.text{background:transparent;border:none;color:var(--content-brand-default)}.rte-icon-button.text:hover{background:var(--background-brand-inverse-hover)}.rte-icon-button.text:active{background:var(--background-brand-inverse-pressed)}.rte-icon-button.text:disabled{background:var(--background-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.transparent{background:transparent;border:none;color:var(--content-brand-default)}.rte-icon-button.transparent:hover{color:var(--content-brand-hover)}.rte-icon-button.transparent:active{color:var(--content-brand-pressed)}.rte-icon-button.transparent:disabled{box-shadow:none;background-color:var(--background-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.danger{background:var(--background-danger-default);border:none}.rte-icon-button.danger ::ng-deep .rte-icon-container{color:var(--content-primary-inverse)}.rte-icon-button.danger:hover{background:var(--background-danger-hover)}.rte-icon-button.danger:active{background:var(--background-danger-pressed)}.rte-icon-button.danger:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.danger:disabled ::ng-deep .rte-icon-container{color:var(--content-disabled)}.rte-icon-button.neutral{background:none;border:none;color:var(--content-primary)}.rte-icon-button.neutral:hover{color:var(--content-secondary)}.rte-icon-button.neutral:active{color:var(--content-tertiary)}.rte-icon-button.neutral:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}.rte-icon-button.reverse{background:none;border:none;color:var(--content-primary-inverse)}.rte-icon-button.reverse:hover{color:var(--background-hover)}.rte-icon-button.reverse:active{color:var(--content-primary-inverse)}.rte-icon-button.reverse:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}.rte-icon-button.compact-spacing{padding:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "directive", type: BadgeDirective, selector: "[rteBadge]", inputs: ["rteBadgeType", "rteBadgeSize", "rteBadgeContent", "rteBadgeCount", "rteBadgeIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1369
1586
|
}
|
|
1370
1587
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
1371
1588
|
type: Component,
|
|
1372
|
-
args: [{ selector: "rte-icon-button", imports: [CommonModule, IconComponent, BadgeDirective], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (shouldDisplayBadge()) {\n <button\n *ngIf=\"isValidIconName\"\n class=\"rte-icon-button {{ variant() }} size-{{ size() }}\"\n rteBadge\n [class.compact-spacing]=\"compactSpacing()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n [rteBadgeType]=\"badgeType()!\"\n [rteBadgeSize]=\"size()\"\n [rteBadgeContent]=\"size() === 's' ? 'empty' : badgeContent()!\"\n [rteBadgeCount]=\"badgeCount()!\"\n [rteBadgeIcon]=\"badgeIcon()!\"\n (click)=\"onClick($event)\"\n >\n <rte-icon [name]=\"name()\" [appearance]=\"appearance()\" [size]=\"buttonIconSize()\" />\n </button>\n} @else {\n <button\n *ngIf=\"isValidIconName\"\n class=\"rte-icon-button {{ variant() }} size-{{ size() }}\"\n [class.compact-spacing]=\"compactSpacing()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n (click)=\"onClick($event)\"\n >\n <rte-icon [name]=\"name()\" [appearance]=\"appearance()\" [size]=\"buttonIconSize()\" />\n </button>\n}\n", styles: [".rte-icon-button{display:flex;cursor:pointer;height:24px;align-items:center;gap:0px;flex-shrink:0}.rte-icon-button:focus-visible{outline:none;position:relative;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-icon-button.size-s{border-radius:4px;height:24px;padding:2px 4px}.rte-icon-button.size-s.compact-spacing{height:16px}.rte-icon-button.size-m{border-radius:4px;height:32px;padding:4px 6px}.rte-icon-button.size-m.compact-spacing{height:20px}.rte-icon-button.size-l{border-radius:8px;height:40px;padding:6px 8px}.rte-icon-button.size-l.compact-spacing{height:24px}.rte-icon-button.primary{background:var(--background-brand-default);border:var(--border-brand-default)}.rte-icon-button.primary ::ng-deep .rte-icon-container{color:var(--content-primary-inverse)}.rte-icon-button.primary:hover{background:var(--background-brand-hover);border:var(--background-brand-hover)}.rte-icon-button.primary:active{background:var(--background-brand-pressed)}.rte-icon-button.primary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}.rte-icon-button.secondary{background:var(--background-default);border:solid 1px var(--border-brand-default);color:var(--content-brand-default)}.rte-icon-button.secondary:hover{background:var(--background-brand-inverse-hover);border:solid 1px var(--border-brand-default)}.rte-icon-button.secondary:active{background:var(--background-brand-inverse-pressed)}.rte-icon-button.secondary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.text{background:transparent;border:none;color:var(--content-brand-default)}.rte-icon-button.text:hover{background:var(--background-brand-inverse-hover)}.rte-icon-button.text:active{background:var(--background-brand-inverse-pressed)}.rte-icon-button.text:disabled{background:var(--background-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.transparent{background:transparent;border:none;color:var(--content-brand-default)}.rte-icon-button.transparent:hover{color:var(--content-brand-hover)}.rte-icon-button.transparent:active{color:var(--content-brand-pressed)}.rte-icon-button.transparent:disabled{box-shadow:none;background-color:var(--background-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.danger{background:var(--background-danger-default);border:none}.rte-icon-button.danger ::ng-deep .rte-icon-container{color:var(--content-primary-inverse)}.rte-icon-button.danger:hover{background:var(--background-danger-hover)}.rte-icon-button.danger:active{background:var(--background-danger-pressed)}.rte-icon-button.danger:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.neutral{background:none;border:none;color:var(--content-primary)}.rte-icon-button.neutral:hover{color:var(--content-secondary)}.rte-icon-button.neutral:active{color:var(--content-tertiary)}.rte-icon-button.neutral:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}.rte-icon-button.reverse{background:none;border:none;color:var(--content-primary-inverse)}.rte-icon-button.reverse:hover{color:var(--background-hover)}.rte-icon-button.reverse:active{color:var(--content-primary-inverse)}.rte-icon-button.reverse:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}.rte-icon-button.compact-spacing{padding:0}\n"] }]
|
|
1589
|
+
args: [{ selector: "rte-icon-button", imports: [CommonModule, IconComponent, BadgeDirective], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (shouldDisplayBadge()) {\n <button\n *ngIf=\"isValidIconName\"\n class=\"rte-icon-button {{ variant() }} size-{{ size() }}\"\n rteBadge\n [class.compact-spacing]=\"compactSpacing()\"\n [ngStyle]=\"customStyle()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n [rteBadgeType]=\"badgeType()!\"\n [rteBadgeSize]=\"size()\"\n [rteBadgeContent]=\"size() === 's' ? 'empty' : badgeContent()!\"\n [rteBadgeCount]=\"badgeCount()!\"\n [rteBadgeIcon]=\"badgeIcon()!\"\n (click)=\"onClick($event)\"\n >\n <rte-icon [name]=\"name()\" [appearance]=\"appearance()\" [size]=\"buttonIconSize()\" />\n </button>\n} @else {\n <button\n *ngIf=\"isValidIconName\"\n class=\"rte-icon-button {{ variant() }} size-{{ size() }}\"\n [class.compact-spacing]=\"compactSpacing()\"\n [ngStyle]=\"customStyle()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n (click)=\"onClick($event)\"\n >\n <rte-icon [name]=\"name()\" [appearance]=\"appearance()\" [size]=\"buttonIconSize()\" />\n </button>\n}\n", styles: [".rte-icon-button{display:flex;cursor:pointer;height:24px;align-items:center;gap:0px;flex-shrink:0}.rte-icon-button:focus-visible{outline:none;position:relative;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-icon-button.size-s{border-radius:4px;height:24px;padding:2px 4px}.rte-icon-button.size-s.compact-spacing{height:16px}.rte-icon-button.size-m{border-radius:4px;height:32px;padding:4px 6px}.rte-icon-button.size-m.compact-spacing{height:20px}.rte-icon-button.size-l{border-radius:8px;height:40px;padding:6px 8px}.rte-icon-button.size-l.compact-spacing{height:24px}.rte-icon-button.primary{background:var(--background-brand-default);border:var(--border-brand-default)}.rte-icon-button.primary ::ng-deep .rte-icon-container{color:var(--content-primary-inverse)}.rte-icon-button.primary:hover{background:var(--background-brand-hover);border:var(--background-brand-hover)}.rte-icon-button.primary:active{background:var(--background-brand-pressed)}.rte-icon-button.primary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}.rte-icon-button.primary:disabled ::ng-deep .rte-icon-container{color:var(--content-disabled)}.rte-icon-button.secondary{background:var(--background-default);border:solid 1px var(--border-brand-default);color:var(--content-brand-default)}.rte-icon-button.secondary:hover{background:var(--background-brand-inverse-hover);border:solid 1px var(--border-brand-default)}.rte-icon-button.secondary:active{background:var(--background-brand-inverse-pressed)}.rte-icon-button.secondary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.text{background:transparent;border:none;color:var(--content-brand-default)}.rte-icon-button.text:hover{background:var(--background-brand-inverse-hover)}.rte-icon-button.text:active{background:var(--background-brand-inverse-pressed)}.rte-icon-button.text:disabled{background:var(--background-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.transparent{background:transparent;border:none;color:var(--content-brand-default)}.rte-icon-button.transparent:hover{color:var(--content-brand-hover)}.rte-icon-button.transparent:active{color:var(--content-brand-pressed)}.rte-icon-button.transparent:disabled{box-shadow:none;background-color:var(--background-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.danger{background:var(--background-danger-default);border:none}.rte-icon-button.danger ::ng-deep .rte-icon-container{color:var(--content-primary-inverse)}.rte-icon-button.danger:hover{background:var(--background-danger-hover)}.rte-icon-button.danger:active{background:var(--background-danger-pressed)}.rte-icon-button.danger:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);cursor:default}.rte-icon-button.danger:disabled ::ng-deep .rte-icon-container{color:var(--content-disabled)}.rte-icon-button.neutral{background:none;border:none;color:var(--content-primary)}.rte-icon-button.neutral:hover{color:var(--content-secondary)}.rte-icon-button.neutral:active{color:var(--content-tertiary)}.rte-icon-button.neutral:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}.rte-icon-button.reverse{background:none;border:none;color:var(--content-primary-inverse)}.rte-icon-button.reverse:hover{color:var(--background-hover)}.rte-icon-button.reverse:active{color:var(--content-primary-inverse)}.rte-icon-button.reverse:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}.rte-icon-button.compact-spacing{padding:0}\n"] }]
|
|
1373
1590
|
}] });
|
|
1374
1591
|
|
|
1375
1592
|
class IconButtonToggleComponent {
|
|
@@ -1403,18 +1620,19 @@ class IconButtonToggleComponent {
|
|
|
1403
1620
|
}
|
|
1404
1621
|
}
|
|
1405
1622
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconButtonToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1406
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: IconButtonToggleComponent, isStandalone: true, selector: "rte-icon-button-toggle", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, defaultSelected: { classPropertyName: "defaultSelected", publicName: "defaultSelected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click" }, ngImport: i0, template: "<rte-icon-button\n [size]=\"size()\"\n [name]=\"name()\"\n [compactSpacing]=\"compactSpacing()\"\n [disabled]=\"disabled()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n [variant]=\"variant()\"\n [appearance]=\"isSelected() ? 'filled' : 'outlined'\"\n (
|
|
1623
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: IconButtonToggleComponent, isStandalone: true, selector: "rte-icon-button-toggle", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, defaultSelected: { classPropertyName: "defaultSelected", publicName: "defaultSelected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click" }, ngImport: i0, template: "<rte-icon-button\n [size]=\"size()\"\n [name]=\"name()\"\n [compactSpacing]=\"compactSpacing()\"\n [disabled]=\"disabled()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n [variant]=\"variant()\"\n [appearance]=\"isSelected() ? 'filled' : 'outlined'\"\n (clickEvent)=\"onClick($event)\"\n/>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon", "customStyle"], outputs: ["clickEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1407
1624
|
}
|
|
1408
1625
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconButtonToggleComponent, decorators: [{
|
|
1409
1626
|
type: Component,
|
|
1410
|
-
args: [{ selector: "rte-icon-button-toggle", imports: [CommonModule, IconButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<rte-icon-button\n [size]=\"size()\"\n [name]=\"name()\"\n [compactSpacing]=\"compactSpacing()\"\n [disabled]=\"disabled()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n [variant]=\"variant()\"\n [appearance]=\"isSelected() ? 'filled' : 'outlined'\"\n (
|
|
1627
|
+
args: [{ selector: "rte-icon-button-toggle", imports: [CommonModule, IconButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<rte-icon-button\n [size]=\"size()\"\n [name]=\"name()\"\n [compactSpacing]=\"compactSpacing()\"\n [disabled]=\"disabled()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaLabelledBy]=\"ariaLabelledBy()\"\n [type]=\"type()\"\n [variant]=\"variant()\"\n [appearance]=\"isSelected() ? 'filled' : 'outlined'\"\n (clickEvent)=\"onClick($event)\"\n/>\n" }]
|
|
1411
1628
|
}] });
|
|
1412
1629
|
|
|
1413
|
-
class
|
|
1630
|
+
class BaseTextInputComponent {
|
|
1414
1631
|
constructor() {
|
|
1415
1632
|
this.id = input();
|
|
1416
1633
|
this.label = input("");
|
|
1417
1634
|
this.labelPosition = input("top");
|
|
1635
|
+
this.placeholder = input("");
|
|
1418
1636
|
this.required = input(false);
|
|
1419
1637
|
this.showCounter = input(false);
|
|
1420
1638
|
this.value = input("");
|
|
@@ -1434,6 +1652,10 @@ class TextInputComponent {
|
|
|
1434
1652
|
this.ariaLabel = input("");
|
|
1435
1653
|
this.ariaRequired = input(false);
|
|
1436
1654
|
this.ariaLabelledby = input("");
|
|
1655
|
+
this.compactSpacing = input(false);
|
|
1656
|
+
this.customStyle = input();
|
|
1657
|
+
this.autocomplete = input("");
|
|
1658
|
+
this.highlighted = input(false);
|
|
1437
1659
|
this.valueChange = output();
|
|
1438
1660
|
this.rightIconClick = output();
|
|
1439
1661
|
this.characterCount = signal(this.internalValue().length);
|
|
@@ -1444,10 +1666,7 @@ class TextInputComponent {
|
|
|
1444
1666
|
if (["visibilityOn", "visibilityOff"].includes(this.rightIconAction())) {
|
|
1445
1667
|
return this.isHiddenInput() ? "visibility-show" : "visibility-hide";
|
|
1446
1668
|
}
|
|
1447
|
-
|
|
1448
|
-
return "close";
|
|
1449
|
-
}
|
|
1450
|
-
return "";
|
|
1669
|
+
return "cancel";
|
|
1451
1670
|
});
|
|
1452
1671
|
this.rightIconAriaLabel = computed(() => {
|
|
1453
1672
|
if (["visibilityOn", "visibilityOff"].includes(this.rightIconAction())) {
|
|
@@ -1478,12 +1697,12 @@ class TextInputComponent {
|
|
|
1478
1697
|
}
|
|
1479
1698
|
handleChange(event) {
|
|
1480
1699
|
const input = event.target;
|
|
1481
|
-
|
|
1482
|
-
this.
|
|
1700
|
+
const newValue = input.value;
|
|
1701
|
+
this.internalValue.set(newValue);
|
|
1483
1702
|
if (this.maxLength()) {
|
|
1484
|
-
this.characterCount.set(
|
|
1703
|
+
this.characterCount.set(newValue.length);
|
|
1485
1704
|
}
|
|
1486
|
-
this.valueChange.emit(
|
|
1705
|
+
this.valueChange.emit(newValue);
|
|
1487
1706
|
}
|
|
1488
1707
|
onRightIconClickHandler() {
|
|
1489
1708
|
this.rightIconClick.emit();
|
|
@@ -1502,14 +1721,23 @@ class TextInputComponent {
|
|
|
1502
1721
|
this.toggleInputVisibility();
|
|
1503
1722
|
}
|
|
1504
1723
|
}
|
|
1505
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1506
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: TextInputComponent, isStandalone: true, selector: "rte-text-input", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, showCounter: { classPropertyName: "showCounter", publicName: "showCounter", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, leftIcon: { classPropertyName: "leftIcon", publicName: "leftIcon", isSignal: true, isRequired: false, transformFunction: null }, showRightIcon: { classPropertyName: "showRightIcon", publicName: "showRightIcon", isSignal: true, isRequired: false, transformFunction: null }, rightIconAction: { classPropertyName: "rightIconAction", publicName: "rightIconAction", isSignal: true, isRequired: false, transformFunction: null }, showLabelRequirement: { classPropertyName: "showLabelRequirement", publicName: "showLabelRequirement", isSignal: true, isRequired: false, transformFunction: null }, assistiveAppearance: { classPropertyName: "assistiveAppearance", publicName: "assistiveAppearance", isSignal: true, isRequired: false, transformFunction: null }, showAssistiveIcon: { classPropertyName: "showAssistiveIcon", publicName: "showAssistiveIcon", isSignal: true, isRequired: false, transformFunction: null }, assistiveTextLabel: { classPropertyName: "assistiveTextLabel", publicName: "assistiveTextLabel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaRequired: { classPropertyName: "ariaRequired", publicName: "ariaRequired", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", rightIconClick: "rightIconClick" }, ngImport: i0, template: "<div class=\"container {{ labelPosition() }}\" [ngClass]=\"{ error: error() }\" [style.width]=\"width()\">\n <ng-container *ngIf=\"label()\">\n <div class=\"text\">\n <div class=\"label-container\">\n <label class=\"input-label\" [id]=\"'input-label-' + id\" [for]=\"id()\">\n {{ label() }}\n </label>\n <ng-container *ngIf=\"required()\">\n <ng-container *ngIf=\"showLabelRequirement(); else requiredIcon\">\n <span class=\"required-text\">(obligatoire)</span>\n </ng-container>\n <ng-template #requiredIcon>\n <span class=\"required-icon-container\">\n <rte-icon name=\"asterisk\" [size]=\"8\" />\n </span>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!required() && showLabelRequirement()\">\n <span class=\"required-text\">(optionnel)</span>\n </ng-container>\n </div>\n <ng-container *ngIf=\"displayCounter() && labelPosition() === 'top'\">\n <p class=\"input-counter\" data-testid=\"input-counter\">{{ characterCount() }}/{{ maxLength() }}</p>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"input-container\">\n <div class=\"input {{ labelPosition() }}\" [ngClass]=\"{ disabled: disabled(), 'read-only': readOnly() }\">\n <div\n class=\"input-bar\"\n [ngClass]=\"{ 'with-left-icon': displayedLeftIcon(), 'with-right-icon': rightIconAction() }\"\n >\n <ng-container *ngIf=\"displayedLeftIcon()\">\n <rte-icon appearance=\"outlined\" class=\"left-icon\" aria-hidden=\"true\" [name]=\"displayedLeftIcon()!\" />\n </ng-container>\n\n <input\n #inputRef\n class=\"input-field\"\n [id]=\"id()\"\n [ngClass]=\"{ error: error() }\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-required]=\"ariaRequired()\"\n [type]=\"isHiddenInput() ? 'password' : 'text'\"\n [maxLength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readOnly()\"\n [value]=\"internalValue()\"\n (input)=\"handleChange($event)\"\n />\n\n <ng-container *ngIf=\"shouldShowRightIcon()\">\n <rte-icon-button\n appearance=\"outlined\"\n variant=\"transparent\"\n class=\"right-icon\"\n data-testid=\"right-icon\"\n [name]=\"rightIconName() || 'close'\"\n [ariaLabel]=\"rightIconAriaLabel()\"\n (click)=\"onRightIconClickHandler()\"\n />\n </ng-container>\n </div>\n </div>\n\n <ng-container *ngIf=\"assistiveTextLabel()\">\n <div class=\"assistive-text\">\n <ng-container *ngIf=\"showAssistiveIcon() && assistiveAppearance() === 'error'\">\n <rte-icon name=\"error\" appearance=\"outlined\" class=\"assistive-icon-error\" [size]=\"12\" />\n </ng-container>\n <ng-container *ngIf=\"showAssistiveIcon() && assistiveAppearance() === 'success'\">\n <rte-icon name=\"check\" appearance=\"outlined\" class=\"assistive-icon-success\" [size]=\"12\" />\n </ng-container>\n <ng-container *ngIf=\"assistiveAppearance() === 'link'; else assistiveLabel\">\n <rte-link [label]=\"assistiveTextLabel()\" />\n </ng-container>\n <ng-template #assistiveLabel>\n <p class=\"assistive-label\" [ngClass]=\"assistiveAppearance()\">\n {{ assistiveTextLabel() }}\n </p>\n </ng-template>\n </div>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"displayCounter() && labelPosition() === 'side'\">\n <p class=\"input-counter\" data-testid=\"input-counter\">{{ characterCount() }}/{{ maxLength() }}</p>\n </ng-container>\n</div>\n", styles: [".container{display:flex;width:300px;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:0px}.container.side{align-items:center;flex-direction:row}.container.side .text{width:auto;align-items:center}.container.side .input-counter{padding:0 8px}.container.error .input-container .input .input-bar .left-icon{color:var(--content-danger-default)}.container .text{width:100%;display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;padding:2px 8px;box-sizing:border-box}.container .text .label-container{display:flex;align-items:flex-start}.container .text .label-container .input-label{color:var(--content-secondary);font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px}.container .text .label-container .required-text{color:var(--content-tertiary);align-self:center;font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;margin-block:0px;margin-inline:4px}.container .text .label-container .required-icon-container{color:var(--content-danger-default);display:flex;align-items:center;justify-content:center;margin-inline:4px}.container .input-container{display:flex;flex-direction:column;height:32px;width:100%;min-width:48px;min-height:32px;max-height:32px;align-self:stretch}.container .input-container .input .input-bar{position:relative;display:flex;align-items:center}.container .input-container .input .input-bar.with-left-icon .input-field{padding-left:32px}.container .input-container .input .input-bar.with-right-icon .input-field{padding-right:32px}.container .input-container .input .input-bar .left-icon{position:absolute;left:8px;color:var(--content-secondary)}.container .input-container .input .input-bar .right-icon{position:absolute;right:8px;display:flex;align-items:center;justify-content:center;color:var(--content-secondary)}.container .input-container .input .input-bar .right-icon ::ng-deep .rte-icon-button{color:var(--content-secondary);height:24px;width:24px;padding:0 2px}.container .input-container .input .input-bar .right-icon ::ng-deep .rte-icon-button:focus{outline:none}.container .input-container .input .input-bar .right-icon ::ng-deep .rte-icon-button:focus-visible{outline:1px solid var(--border-brand-focused);border-radius:8px}.container .input-container .input .input-bar .right-icon ::ng-deep .rte-icon-button:focus-visible:after{display:none}.container .input-container .input .input-bar .input-field{box-sizing:border-box;appearance:none;width:100%;height:32px;min-width:48px;max-height:32px;border-radius:4px;border:1px solid var(--border-secondary);padding:4px 16px;background:linear-gradient(0deg,var(--elevation-surface-inner-shadow) 0%,var(--elevation-surface-inner-shadow) 100%),var(--background-default);transition:border .2s,outline .2s;color:var(--content-primary);box-shadow:inset 0 1px 4px 0 var(--elevation-shadow-key)}.container .input-container .input .input-bar .input-field:hover{outline:1px solid var(--border-primary);border-color:var(--border-primary)}.container .input-container .input .input-bar .input-field:focus{outline:1px solid var(--border-brand-default);border-color:var(--border-brand-default)}.container .input-container .input .input-bar .input-field:active{outline:1px solid var(--border-brand-default);border-color:var(--border-brand-default)}.container .input-container .input .input-bar .input-field:disabled,.container .input-container .input .input-bar .input-field:read-only{outline:1px solid var(--border-brand-disabled);border-color:var(--border-disabled);background:linear-gradient(0deg,var(--elevation-surface-inner-shadow) 0%,var(--elevation-surface-inner-shadow) 100%),var(--background-disabled);cursor:not-allowed}.container .input-container .input .input-bar .input-field.error{outline:1px solid var(--border-danger);border-color:var(--border-danger)}.container .input-container .assistive-text{display:flex;align-items:center;gap:4px;padding:4px 8px}.container .input-container .assistive-text .assistive-icon-error{color:var(--content-danger-default)}.container .input-container .assistive-text .assistive-icon-success{color:var(--content-success-default)}.container .input-container .assistive-text .assistive-label{transition:color .2s}.container .input-container .assistive-text .assistive-label.error{color:var(--content-danger-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.container .input-container .assistive-text .assistive-label.success{color:var(--content-success-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.container .input-container .assistive-text .assistive-label.description{color:var(--content-tertiary);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.input-counter{color:var(--content-tertiary);font-family:Arial;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px;margin-block:0px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon"], outputs: ["click"] }, { kind: "component", type: LinkComponent, selector: "rte-link", inputs: ["label", "href", "subtle", "externalLink", "reverse", "maxWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1724
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BaseTextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1725
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: BaseTextInputComponent, isStandalone: true, selector: "rte-base-text-input", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, showCounter: { classPropertyName: "showCounter", publicName: "showCounter", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, leftIcon: { classPropertyName: "leftIcon", publicName: "leftIcon", isSignal: true, isRequired: false, transformFunction: null }, showRightIcon: { classPropertyName: "showRightIcon", publicName: "showRightIcon", isSignal: true, isRequired: false, transformFunction: null }, rightIconAction: { classPropertyName: "rightIconAction", publicName: "rightIconAction", isSignal: true, isRequired: false, transformFunction: null }, showLabelRequirement: { classPropertyName: "showLabelRequirement", publicName: "showLabelRequirement", isSignal: true, isRequired: false, transformFunction: null }, assistiveAppearance: { classPropertyName: "assistiveAppearance", publicName: "assistiveAppearance", isSignal: true, isRequired: false, transformFunction: null }, showAssistiveIcon: { classPropertyName: "showAssistiveIcon", publicName: "showAssistiveIcon", isSignal: true, isRequired: false, transformFunction: null }, assistiveTextLabel: { classPropertyName: "assistiveTextLabel", publicName: "assistiveTextLabel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaRequired: { classPropertyName: "ariaRequired", publicName: "ariaRequired", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, customStyle: { classPropertyName: "customStyle", publicName: "customStyle", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", rightIconClick: "rightIconClick" }, ngImport: i0, template: "<div\n class=\"container {{ labelPosition() }}\"\n [ngClass]=\"{ error: error(), 'compact-spacing': compactSpacing() }\"\n [style.width]=\"width()\"\n>\n <ng-container *ngIf=\"label()\">\n <div class=\"text\">\n <div class=\"label-container\">\n <label class=\"input-label\" [id]=\"'input-label-' + id\" [for]=\"id()\">\n {{ label() }}\n </label>\n <ng-container *ngIf=\"required()\">\n <ng-container *ngIf=\"showLabelRequirement(); else requiredIcon\">\n <span class=\"required-text\">(obligatoire)</span>\n </ng-container>\n <ng-template #requiredIcon>\n <span class=\"required-icon-container\">\n <rte-icon name=\"asterisk\" [size]=\"8\" />\n </span>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!required() && showLabelRequirement()\">\n <span class=\"required-text\">(optionnel)</span>\n </ng-container>\n </div>\n <ng-container *ngIf=\"displayCounter() && labelPosition() === 'top'\">\n <p class=\"input-counter\" data-testid=\"input-counter\">{{ characterCount() }}/{{ maxLength() }}</p>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"input-container\">\n <div class=\"input {{ labelPosition() }}\" [ngClass]=\"{ disabled: disabled(), 'read-only': readOnly() }\">\n <div\n class=\"input-bar\"\n [ngClass]=\"{ 'with-left-icon': displayedLeftIcon(), 'with-right-icon': rightIconAction() }\"\n >\n <ng-container *ngIf=\"displayedLeftIcon()\">\n <rte-icon appearance=\"outlined\" class=\"left-icon\" aria-hidden=\"true\" [name]=\"displayedLeftIcon()!\" />\n </ng-container>\n\n <input\n #inputRef\n class=\"input-field\"\n [id]=\"id()\"\n [ngClass]=\"{ error: error(), highlighted: highlighted() }\"\n [ngStyle]=\"customStyle()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-required]=\"ariaRequired()\"\n [type]=\"isHiddenInput() ? 'password' : 'text'\"\n [maxLength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readOnly()\"\n [value]=\"internalValue()\"\n [placeholder]=\"placeholder()\"\n [attr.autocomplete]=\"autocomplete()\"\n (input)=\"handleChange($event)\"\n />\n\n <ng-container *ngIf=\"shouldShowRightIcon()\">\n <rte-icon-button\n appearance=\"outlined\"\n variant=\"neutral\"\n size=\"s\"\n class=\"right-icon\"\n data-testid=\"right-icon\"\n [compactSpacing]=\"true\"\n [name]=\"rightIconName()\"\n [ariaLabel]=\"rightIconAriaLabel()\"\n (clickEvent)=\"onRightIconClickHandler()\"\n />\n </ng-container>\n </div>\n <div class=\"right-slot\">\n <ng-content select=\"[baseTextInputRightSlot]\"></ng-content>\n </div>\n </div>\n\n <ng-container *ngIf=\"assistiveTextLabel()\">\n <div class=\"assistive-text\">\n <ng-container *ngIf=\"showAssistiveIcon() && assistiveAppearance() === 'error'\">\n <rte-icon name=\"error\" appearance=\"outlined\" class=\"assistive-icon-error\" [size]=\"12\" />\n </ng-container>\n <ng-container *ngIf=\"showAssistiveIcon() && assistiveAppearance() === 'success'\">\n <rte-icon name=\"check\" appearance=\"outlined\" class=\"assistive-icon-success\" [size]=\"12\" />\n </ng-container>\n <ng-container *ngIf=\"assistiveAppearance() === 'link'; else assistiveLabel\">\n <rte-link [label]=\"assistiveTextLabel()\" />\n </ng-container>\n <ng-template #assistiveLabel>\n <p class=\"assistive-label\" [ngClass]=\"assistiveAppearance()\">\n {{ assistiveTextLabel() }}\n </p>\n </ng-template>\n </div>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"displayCounter() && labelPosition() === 'side'\">\n <p class=\"input-counter\" data-testid=\"input-counter\">{{ characterCount() }}/{{ maxLength() }}</p>\n </ng-container>\n</div>\n", styles: [".container{display:flex;width:300px;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:0px}.container.compact-spacing .input-container,.container.compact-spacing .input-container .input .input-bar .input-field{height:24px;min-height:24px}.container.compact-spacing .rte-icon-button ::ng-deep button{height:24px;width:24px;padding:0 2px}.container.side{align-items:center;flex-direction:row}.container.side .text{width:auto;align-items:center}.container.side .input-counter{padding:0 8px}.container.error .input-container .input .input-bar .left-icon{color:var(--content-danger-default)}.container .text{width:100%;display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;padding:2px 8px;box-sizing:border-box}.container .text .label-container{display:flex;align-items:flex-start}.container .text .label-container .input-label{color:var(--content-secondary);font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px}.container .text .label-container .required-text{color:var(--content-tertiary);align-self:center;font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;margin-block:0px;margin-inline:4px}.container .text .label-container .required-icon-container{color:var(--content-danger-default);display:flex;align-items:center;justify-content:center;margin-inline:4px}.container .input-container{display:flex;flex-direction:column;height:32px;width:100%;min-width:48px;min-height:32px;max-height:32px;align-self:stretch}.container .input-container .input{display:flex;align-items:center;gap:0;width:100%;height:100%}.container .input-container .input .input-bar{position:relative;display:flex;align-items:center;flex:1}.container .input-container .input .input-bar.with-left-icon .input-field{padding-left:32px}.container .input-container .input .input-bar.with-right-icon .input-field{padding-right:32px}.container .input-container .input .input-bar .left-icon{position:absolute;left:8px;color:var(--content-secondary)}.container .input-container .input .input-bar .right-icon{position:absolute;right:8px;color:var(--content-secondary)}.container .input-container .input .input-bar .right-icon:focus{outline:none}.container .input-container .input .input-bar .right-icon:focus-visible{outline:1px solid var(--border-brand-focused);border-radius:8px}.container .input-container .input .input-bar .right-icon:focus-visible:after{display:none}.container .input-container .input .input-bar .input-field{box-sizing:border-box;appearance:none;width:100%;height:32px;min-width:48px;max-height:32px;border-radius:4px;border:1px solid var(--border-secondary);padding:4px 16px;background:linear-gradient(0deg,var(--elevation-surface-inner-shadow) 0%,var(--elevation-surface-inner-shadow) 100%),var(--background-default);transition:border .2s,outline .2s;color:var(--content-primary);box-shadow:inset 0 1px 4px 0 var(--elevation-shadow-key)}.container .input-container .input .input-bar .input-field:hover{border-color:var(--border-primary)}.container .input-container .input .input-bar .input-field:focus,.container .input-container .input .input-bar .input-field.highlighted{outline:1px solid var(--border-brand-default);border-color:var(--border-brand-default)}.container .input-container .input .input-bar .input-field:active{outline:1px solid var(--border-brand-default);border-color:var(--border-brand-default)}.container .input-container .input .input-bar .input-field:disabled,.container .input-container .input .input-bar .input-field:read-only{border-color:var(--border-disabled);background:linear-gradient(0deg,var(--elevation-surface-inner-shadow) 0%,var(--elevation-surface-inner-shadow) 100%),var(--background-disabled);cursor:not-allowed;box-shadow:none}.container .input-container .input .input-bar .input-field.error{outline:1px solid var(--border-danger);border-color:var(--border-danger)}.container .input-container .input .input-bar .input-field::placeholder{color:var(--content-tertiary)}.container .input-container .input .right-slot{display:flex;align-items:center;flex-shrink:0;position:relative}.container .input-container .assistive-text{display:flex;align-items:center;gap:4px;padding:4px 8px}.container .input-container .assistive-text .assistive-icon-error{color:var(--content-danger-default)}.container .input-container .assistive-text .assistive-icon-success{color:var(--content-success-default)}.container .input-container .assistive-text .assistive-label{transition:color .2s}.container .input-container .assistive-text .assistive-label.error{color:var(--content-danger-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.container .input-container .assistive-text .assistive-label.success{color:var(--content-success-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.container .input-container .assistive-text .assistive-label.description{color:var(--content-tertiary);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.input-counter{color:var(--content-tertiary);font-family:Arial;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px;margin-block:0px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon", "customStyle"], outputs: ["clickEvent"] }, { kind: "component", type: LinkComponent, selector: "rte-link", inputs: ["label", "href", "subtle", "externalLink", "reverse", "maxWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1507
1726
|
}
|
|
1508
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1727
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BaseTextInputComponent, decorators: [{
|
|
1509
1728
|
type: Component,
|
|
1510
|
-
args: [{ selector: "rte-text-input", imports: [CommonModule, IconComponent, IconButtonComponent, LinkComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div
|
|
1729
|
+
args: [{ selector: "rte-base-text-input", imports: [CommonModule, IconComponent, IconButtonComponent, LinkComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"container {{ labelPosition() }}\"\n [ngClass]=\"{ error: error(), 'compact-spacing': compactSpacing() }\"\n [style.width]=\"width()\"\n>\n <ng-container *ngIf=\"label()\">\n <div class=\"text\">\n <div class=\"label-container\">\n <label class=\"input-label\" [id]=\"'input-label-' + id\" [for]=\"id()\">\n {{ label() }}\n </label>\n <ng-container *ngIf=\"required()\">\n <ng-container *ngIf=\"showLabelRequirement(); else requiredIcon\">\n <span class=\"required-text\">(obligatoire)</span>\n </ng-container>\n <ng-template #requiredIcon>\n <span class=\"required-icon-container\">\n <rte-icon name=\"asterisk\" [size]=\"8\" />\n </span>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!required() && showLabelRequirement()\">\n <span class=\"required-text\">(optionnel)</span>\n </ng-container>\n </div>\n <ng-container *ngIf=\"displayCounter() && labelPosition() === 'top'\">\n <p class=\"input-counter\" data-testid=\"input-counter\">{{ characterCount() }}/{{ maxLength() }}</p>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"input-container\">\n <div class=\"input {{ labelPosition() }}\" [ngClass]=\"{ disabled: disabled(), 'read-only': readOnly() }\">\n <div\n class=\"input-bar\"\n [ngClass]=\"{ 'with-left-icon': displayedLeftIcon(), 'with-right-icon': rightIconAction() }\"\n >\n <ng-container *ngIf=\"displayedLeftIcon()\">\n <rte-icon appearance=\"outlined\" class=\"left-icon\" aria-hidden=\"true\" [name]=\"displayedLeftIcon()!\" />\n </ng-container>\n\n <input\n #inputRef\n class=\"input-field\"\n [id]=\"id()\"\n [ngClass]=\"{ error: error(), highlighted: highlighted() }\"\n [ngStyle]=\"customStyle()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-required]=\"ariaRequired()\"\n [type]=\"isHiddenInput() ? 'password' : 'text'\"\n [maxLength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readOnly()\"\n [value]=\"internalValue()\"\n [placeholder]=\"placeholder()\"\n [attr.autocomplete]=\"autocomplete()\"\n (input)=\"handleChange($event)\"\n />\n\n <ng-container *ngIf=\"shouldShowRightIcon()\">\n <rte-icon-button\n appearance=\"outlined\"\n variant=\"neutral\"\n size=\"s\"\n class=\"right-icon\"\n data-testid=\"right-icon\"\n [compactSpacing]=\"true\"\n [name]=\"rightIconName()\"\n [ariaLabel]=\"rightIconAriaLabel()\"\n (clickEvent)=\"onRightIconClickHandler()\"\n />\n </ng-container>\n </div>\n <div class=\"right-slot\">\n <ng-content select=\"[baseTextInputRightSlot]\"></ng-content>\n </div>\n </div>\n\n <ng-container *ngIf=\"assistiveTextLabel()\">\n <div class=\"assistive-text\">\n <ng-container *ngIf=\"showAssistiveIcon() && assistiveAppearance() === 'error'\">\n <rte-icon name=\"error\" appearance=\"outlined\" class=\"assistive-icon-error\" [size]=\"12\" />\n </ng-container>\n <ng-container *ngIf=\"showAssistiveIcon() && assistiveAppearance() === 'success'\">\n <rte-icon name=\"check\" appearance=\"outlined\" class=\"assistive-icon-success\" [size]=\"12\" />\n </ng-container>\n <ng-container *ngIf=\"assistiveAppearance() === 'link'; else assistiveLabel\">\n <rte-link [label]=\"assistiveTextLabel()\" />\n </ng-container>\n <ng-template #assistiveLabel>\n <p class=\"assistive-label\" [ngClass]=\"assistiveAppearance()\">\n {{ assistiveTextLabel() }}\n </p>\n </ng-template>\n </div>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"displayCounter() && labelPosition() === 'side'\">\n <p class=\"input-counter\" data-testid=\"input-counter\">{{ characterCount() }}/{{ maxLength() }}</p>\n </ng-container>\n</div>\n", styles: [".container{display:flex;width:300px;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:0px}.container.compact-spacing .input-container,.container.compact-spacing .input-container .input .input-bar .input-field{height:24px;min-height:24px}.container.compact-spacing .rte-icon-button ::ng-deep button{height:24px;width:24px;padding:0 2px}.container.side{align-items:center;flex-direction:row}.container.side .text{width:auto;align-items:center}.container.side .input-counter{padding:0 8px}.container.error .input-container .input .input-bar .left-icon{color:var(--content-danger-default)}.container .text{width:100%;display:flex;flex-direction:row;align-items:flex-end;justify-content:space-between;padding:2px 8px;box-sizing:border-box}.container .text .label-container{display:flex;align-items:flex-start}.container .text .label-container .input-label{color:var(--content-secondary);font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px}.container .text .label-container .required-text{color:var(--content-tertiary);align-self:center;font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;margin-block:0px;margin-inline:4px}.container .text .label-container .required-icon-container{color:var(--content-danger-default);display:flex;align-items:center;justify-content:center;margin-inline:4px}.container .input-container{display:flex;flex-direction:column;height:32px;width:100%;min-width:48px;min-height:32px;max-height:32px;align-self:stretch}.container .input-container .input{display:flex;align-items:center;gap:0;width:100%;height:100%}.container .input-container .input .input-bar{position:relative;display:flex;align-items:center;flex:1}.container .input-container .input .input-bar.with-left-icon .input-field{padding-left:32px}.container .input-container .input .input-bar.with-right-icon .input-field{padding-right:32px}.container .input-container .input .input-bar .left-icon{position:absolute;left:8px;color:var(--content-secondary)}.container .input-container .input .input-bar .right-icon{position:absolute;right:8px;color:var(--content-secondary)}.container .input-container .input .input-bar .right-icon:focus{outline:none}.container .input-container .input .input-bar .right-icon:focus-visible{outline:1px solid var(--border-brand-focused);border-radius:8px}.container .input-container .input .input-bar .right-icon:focus-visible:after{display:none}.container .input-container .input .input-bar .input-field{box-sizing:border-box;appearance:none;width:100%;height:32px;min-width:48px;max-height:32px;border-radius:4px;border:1px solid var(--border-secondary);padding:4px 16px;background:linear-gradient(0deg,var(--elevation-surface-inner-shadow) 0%,var(--elevation-surface-inner-shadow) 100%),var(--background-default);transition:border .2s,outline .2s;color:var(--content-primary);box-shadow:inset 0 1px 4px 0 var(--elevation-shadow-key)}.container .input-container .input .input-bar .input-field:hover{border-color:var(--border-primary)}.container .input-container .input .input-bar .input-field:focus,.container .input-container .input .input-bar .input-field.highlighted{outline:1px solid var(--border-brand-default);border-color:var(--border-brand-default)}.container .input-container .input .input-bar .input-field:active{outline:1px solid var(--border-brand-default);border-color:var(--border-brand-default)}.container .input-container .input .input-bar .input-field:disabled,.container .input-container .input .input-bar .input-field:read-only{border-color:var(--border-disabled);background:linear-gradient(0deg,var(--elevation-surface-inner-shadow) 0%,var(--elevation-surface-inner-shadow) 100%),var(--background-disabled);cursor:not-allowed;box-shadow:none}.container .input-container .input .input-bar .input-field.error{outline:1px solid var(--border-danger);border-color:var(--border-danger)}.container .input-container .input .input-bar .input-field::placeholder{color:var(--content-tertiary)}.container .input-container .input .right-slot{display:flex;align-items:center;flex-shrink:0;position:relative}.container .input-container .assistive-text{display:flex;align-items:center;gap:4px;padding:4px 8px}.container .input-container .assistive-text .assistive-icon-error{color:var(--content-danger-default)}.container .input-container .assistive-text .assistive-icon-success{color:var(--content-success-default)}.container .input-container .assistive-text .assistive-label{transition:color .2s}.container .input-container .assistive-text .assistive-label.error{color:var(--content-danger-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.container .input-container .assistive-text .assistive-label.success{color:var(--content-success-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.container .input-container .assistive-text .assistive-label.description{color:var(--content-tertiary);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.input-counter{color:var(--content-tertiary);font-family:Arial;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px;margin-block:0px}\n"] }]
|
|
1511
1730
|
}], ctorParameters: () => [] });
|
|
1512
1731
|
|
|
1732
|
+
class TextInputComponent extends BaseTextInputComponent {
|
|
1733
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1734
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: TextInputComponent, isStandalone: true, selector: "rte-text-input", usesInheritance: true, ngImport: i0, template: "<rte-base-text-input\n [id]=\"id()\"\n [label]=\"label()\"\n [labelPosition]=\"labelPosition()\"\n [required]=\"required()\"\n [showCounter]=\"showCounter()\"\n [value]=\"value()\"\n [leftIcon]=\"leftIcon()\"\n [showRightIcon]=\"showRightIcon()\"\n [rightIconAction]=\"rightIconAction()\"\n [showLabelRequirement]=\"showLabelRequirement()\"\n [assistiveAppearance]=\"assistiveAppearance()\"\n [showAssistiveIcon]=\"showAssistiveIcon()\"\n [assistiveTextLabel]=\"assistiveTextLabel()\"\n [error]=\"error()\"\n [maxLength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readOnly()\"\n [width]=\"width()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaRequired]=\"ariaRequired()\"\n [ariaLabelledby]=\"ariaLabelledby()\"\n [customStyle]=\"customStyle()\"\n [autocomplete]=\"autocomplete()\"\n (valueChange)=\"valueChange.emit($event)\"\n (rightIconClick)=\"rightIconClick.emit()\"\n/>\n", dependencies: [{ kind: "component", type: BaseTextInputComponent, selector: "rte-base-text-input", inputs: ["id", "label", "labelPosition", "placeholder", "required", "showCounter", "value", "leftIcon", "showRightIcon", "rightIconAction", "showLabelRequirement", "assistiveAppearance", "showAssistiveIcon", "assistiveTextLabel", "error", "maxLength", "disabled", "readOnly", "width", "ariaLabel", "ariaRequired", "ariaLabelledby", "compactSpacing", "customStyle", "autocomplete", "highlighted"], outputs: ["valueChange", "rightIconClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1735
|
+
}
|
|
1736
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextInputComponent, decorators: [{
|
|
1737
|
+
type: Component,
|
|
1738
|
+
args: [{ selector: "rte-text-input", imports: [BaseTextInputComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<rte-base-text-input\n [id]=\"id()\"\n [label]=\"label()\"\n [labelPosition]=\"labelPosition()\"\n [required]=\"required()\"\n [showCounter]=\"showCounter()\"\n [value]=\"value()\"\n [leftIcon]=\"leftIcon()\"\n [showRightIcon]=\"showRightIcon()\"\n [rightIconAction]=\"rightIconAction()\"\n [showLabelRequirement]=\"showLabelRequirement()\"\n [assistiveAppearance]=\"assistiveAppearance()\"\n [showAssistiveIcon]=\"showAssistiveIcon()\"\n [assistiveTextLabel]=\"assistiveTextLabel()\"\n [error]=\"error()\"\n [maxLength]=\"maxLength()\"\n [disabled]=\"disabled()\"\n [readOnly]=\"readOnly()\"\n [width]=\"width()\"\n [ariaLabel]=\"ariaLabel()\"\n [ariaRequired]=\"ariaRequired()\"\n [ariaLabelledby]=\"ariaLabelledby()\"\n [customStyle]=\"customStyle()\"\n [autocomplete]=\"autocomplete()\"\n (valueChange)=\"valueChange.emit($event)\"\n (rightIconClick)=\"rightIconClick.emit()\"\n/>\n" }]
|
|
1739
|
+
}] });
|
|
1740
|
+
|
|
1513
1741
|
class ChipComponent {
|
|
1514
1742
|
constructor() {
|
|
1515
1743
|
this.id = input();
|
|
@@ -1591,9 +1819,9 @@ class TextareaComponent {
|
|
|
1591
1819
|
this.assistiveTextIconSize = TEXTAREA_ICON_SIZE;
|
|
1592
1820
|
this.requirementIndicatorValue = computed(() => this.required()
|
|
1593
1821
|
? this.showLabelRequirement()
|
|
1594
|
-
?
|
|
1595
|
-
:
|
|
1596
|
-
:
|
|
1822
|
+
? REQUIREMENT_INDICATOR_VALUE.required
|
|
1823
|
+
: REQUIREMENT_INDICATOR_VALUE.requiredIcon
|
|
1824
|
+
: REQUIREMENT_INDICATOR_VALUE.optional);
|
|
1597
1825
|
this.change = output();
|
|
1598
1826
|
this.blur = output();
|
|
1599
1827
|
this.textareaRef = viewChild("textarea");
|
|
@@ -1723,6 +1951,14 @@ class SegmentedControlComponent {
|
|
|
1723
1951
|
segmentElement.nativeElement.addEventListener("focus", this.focusCurrentSegmentElement.bind(this));
|
|
1724
1952
|
});
|
|
1725
1953
|
}
|
|
1954
|
+
shouldDisplayBadge(option) {
|
|
1955
|
+
return shouldDisplayBadge({
|
|
1956
|
+
showBadge: !!option.showBadge,
|
|
1957
|
+
badgeContent: option.badgeContent,
|
|
1958
|
+
badgeCount: option.badgeCount,
|
|
1959
|
+
badgeIcon: option.badgeIcon,
|
|
1960
|
+
});
|
|
1961
|
+
}
|
|
1726
1962
|
selectSegment(id) {
|
|
1727
1963
|
this.change.emit(id);
|
|
1728
1964
|
}
|
|
@@ -1787,11 +2023,11 @@ class SegmentedControlComponent {
|
|
|
1787
2023
|
}
|
|
1788
2024
|
}
|
|
1789
2025
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1790
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: SegmentedControlComponent, isStandalone: true, selector: "rte-segmented-control", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, selectedSegment: { classPropertyName: "selectedSegment", publicName: "selectedSegment", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, viewQueries: [{ propertyName: "segmentRefs", predicate: ["segment"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"isValidOptions()\" class=\"rte-segmented-control\" role=\"radiogroup\" [attr.aria-label]=\"ariaLabel()\">\n <span class=\"rte-segment-selected-indicator\" [ngStyle]=\"segmentSelectedIndicatorStyle()\"></span>\n <ng-container *ngFor=\"let option of options(); let idx = index\">\n <div class=\"rte-segment-container\" [attr.data-position]=\"getSegmentPosition(idx)\">\n <div\n #segment\n role=\"radio\"\n class=\"rte-segment\"\n tabindex=\"0\"\n [attr.data-id]=\"option.id\"\n [attr.data-segment-type]=\"option.icon ? 'icon' : 'label'\"\n [class.selected]=\"isSegmentSelected(option.id)\"\n [attr.aria-checked]=\"isSegmentSelected(option.id)\"\n [attr.aria-label]=\"option.label\"\n (click)=\"selectSegment(option.id)\"\n (keydown)=\"handleKeyDown($event)\"\n (keyup)=\"handleKeyUp($event)\"\n >\n <rte-icon *ngIf=\"isSegmentSelected(option.id)\" name=\"check-small\" class=\"rte-selected-icon\" [size]=\"24\" />\n <div class=\"rte-segment-content\">\n <ng-container *ngIf=\"option.icon; else label\">\n <rte-icon\n [name]=\"option.icon\"\n [size]=\"24\"\n [appearance]=\"isSegmentSelected(option.id) ? 'filled' : 'outlined'\"\n ></rte-icon>\n </ng-container>\n <ng-template #label>\n <span class=\"rte-segment-label\">{{ option.label }}</span>\n </ng-template>\n </div>\n </div>\n </div>\n </ng-container>\n</div>\n", styles: [".rte-segmented-control{display:flex;min-width:168px;max-width:720px;height:48px}.rte-segmented-control[data-number-of-segments=\"3\"]{min-width:256px}.rte-segment-selected-indicator{position:absolute;top:4px;height:40px;background:var(--background-default);border-radius:999px;transition:left .2s ease-out,width .2s ease-out}.rte-segment-container{display:flex;border-top:1px solid var(--border-inverse);border-bottom:1px solid var(--border-inverse);background:var(--background-brand-default);padding:4px 2px;align-items:center;flex:1 0 0;overflow:hidden}.rte-segment-container[data-position=left]{border-radius:999px 0 0 999px;border-left:1px solid var(--border-inverse);background:var(--background-brand-default);padding-left:4px}.rte-segment-container[data-position=right]{border-radius:0 999px 999px 0;border-right:1px solid var(--border-inverse);background:var(--background-brand-default);padding-right:4px}.rte-segment{display:flex;padding:6px 8px;align-items:center;border-radius:999px;color:var(--content-primary-inverse);flex:1 1 auto;overflow:hidden;width:100%;z-index:0}.rte-segment:focus-visible{outline:1px solid var(--border-inverse);outline-offset:-2px}.rte-segment.selected{transition:color .2s ease-out;color:var(--content-brand-default)}.rte-segment.selected:focus-visible{outline:1px solid var(--border-brand-focused)}.rte-segment:hover:not(.selected){background:var(--background-brand-hover);cursor:pointer}.rte-segment[data-segment-type=icon]{padding:8px}.rte-segment .rte-segment-content{display:flex;align-items:center;justify-content:center;width:100%;overflow:hidden}.rte-segment .rte-segment-content .rte-segment-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:20px;line-height:28px;letter-spacing:-.5px;padding:0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-segment .rte-selected-icon{min-width:24px;min-height:24px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2026
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: SegmentedControlComponent, isStandalone: true, selector: "rte-segmented-control", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, selectedSegment: { classPropertyName: "selectedSegment", publicName: "selectedSegment", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, viewQueries: [{ propertyName: "segmentRefs", predicate: ["segment"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"isValidOptions()\" class=\"rte-segmented-control\" role=\"radiogroup\" [attr.aria-label]=\"ariaLabel()\">\n <span class=\"rte-segment-selected-indicator\" [ngStyle]=\"segmentSelectedIndicatorStyle()\"></span>\n <ng-container *ngFor=\"let option of options(); let idx = index\">\n <div class=\"rte-segment-container\" [attr.data-position]=\"getSegmentPosition(idx)\">\n <div\n #segment\n role=\"radio\"\n class=\"rte-segment\"\n tabindex=\"0\"\n [attr.data-id]=\"option.id\"\n [attr.data-segment-type]=\"option.icon ? 'icon' : 'label'\"\n [class.selected]=\"isSegmentSelected(option.id)\"\n [attr.aria-checked]=\"isSegmentSelected(option.id)\"\n [attr.aria-label]=\"option.label\"\n (click)=\"selectSegment(option.id)\"\n (keydown)=\"handleKeyDown($event)\"\n (keyup)=\"handleKeyUp($event)\"\n >\n <rte-icon *ngIf=\"isSegmentSelected(option.id)\" name=\"check-small\" class=\"rte-selected-icon\" [size]=\"24\" />\n <div class=\"rte-segment-content\">\n <ng-container *ngIf=\"option.icon; else label\">\n <rte-icon\n [name]=\"option.icon\"\n [size]=\"24\"\n [appearance]=\"isSegmentSelected(option.id) ? 'filled' : 'outlined'\"\n ></rte-icon>\n </ng-container>\n <ng-template #label>\n <span class=\"rte-segment-label\">{{ option.label }}</span>\n </ng-template>\n </div>\n <rte-badge\n *ngIf=\"shouldDisplayBadge(option)\"\n [count]=\"option.badgeCount\"\n [badgeContent]=\"option.badgeContent!\"\n [icon]=\"option.badgeIcon!\"\n [badgeType]=\"option.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"option.badgeSize!\"\n ></rte-badge>\n </div>\n </div>\n </ng-container>\n</div>\n", styles: [".rte-segmented-control{display:flex;min-width:168px;max-width:720px;height:48px}.rte-segmented-control[data-number-of-segments=\"3\"]{min-width:256px}.rte-segment-selected-indicator{position:absolute;top:4px;height:40px;background:var(--background-default);border-radius:999px;transition:left .2s ease-out,width .2s ease-out}.rte-segment-container{display:flex;border-top:1px solid var(--border-inverse);border-bottom:1px solid var(--border-inverse);background:var(--background-brand-default);padding:4px 2px;align-items:center;flex:1 0 0;overflow:hidden}.rte-segment-container[data-position=left]{border-radius:999px 0 0 999px;border-left:1px solid var(--border-inverse);background:var(--background-brand-default);padding-left:4px}.rte-segment-container[data-position=right]{border-radius:0 999px 999px 0;border-right:1px solid var(--border-inverse);background:var(--background-brand-default);padding-right:4px}.rte-segment{display:flex;padding:6px 8px;align-items:center;border-radius:999px;color:var(--content-primary-inverse);flex:1 1 auto;overflow:hidden;width:100%;z-index:0}.rte-segment:focus-visible{outline:1px solid var(--border-inverse);outline-offset:-2px}.rte-segment.selected{transition:color .2s ease-out;color:var(--content-brand-default)}.rte-segment.selected:focus-visible{outline:1px solid var(--border-brand-focused)}.rte-segment:hover:not(.selected){background:var(--background-brand-hover);cursor:pointer}.rte-segment[data-segment-type=icon]{padding:8px}.rte-segment .rte-segment-content{display:flex;align-items:center;justify-content:center;width:100%;overflow:hidden}.rte-segment .rte-segment-content .rte-segment-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:20px;line-height:28px;letter-spacing:-.5px;padding:0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-segment .rte-selected-icon{min-width:24px;min-height:24px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: BadgeComponent, selector: "rte-badge", inputs: ["badgeType", "badgeSize", "badgeContent", "count", "icon", "simpleBadge"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1791
2027
|
}
|
|
1792
2028
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SegmentedControlComponent, decorators: [{
|
|
1793
2029
|
type: Component,
|
|
1794
|
-
args: [{ selector: "rte-segmented-control", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"isValidOptions()\" class=\"rte-segmented-control\" role=\"radiogroup\" [attr.aria-label]=\"ariaLabel()\">\n <span class=\"rte-segment-selected-indicator\" [ngStyle]=\"segmentSelectedIndicatorStyle()\"></span>\n <ng-container *ngFor=\"let option of options(); let idx = index\">\n <div class=\"rte-segment-container\" [attr.data-position]=\"getSegmentPosition(idx)\">\n <div\n #segment\n role=\"radio\"\n class=\"rte-segment\"\n tabindex=\"0\"\n [attr.data-id]=\"option.id\"\n [attr.data-segment-type]=\"option.icon ? 'icon' : 'label'\"\n [class.selected]=\"isSegmentSelected(option.id)\"\n [attr.aria-checked]=\"isSegmentSelected(option.id)\"\n [attr.aria-label]=\"option.label\"\n (click)=\"selectSegment(option.id)\"\n (keydown)=\"handleKeyDown($event)\"\n (keyup)=\"handleKeyUp($event)\"\n >\n <rte-icon *ngIf=\"isSegmentSelected(option.id)\" name=\"check-small\" class=\"rte-selected-icon\" [size]=\"24\" />\n <div class=\"rte-segment-content\">\n <ng-container *ngIf=\"option.icon; else label\">\n <rte-icon\n [name]=\"option.icon\"\n [size]=\"24\"\n [appearance]=\"isSegmentSelected(option.id) ? 'filled' : 'outlined'\"\n ></rte-icon>\n </ng-container>\n <ng-template #label>\n <span class=\"rte-segment-label\">{{ option.label }}</span>\n </ng-template>\n </div>\n </div>\n </div>\n </ng-container>\n</div>\n", styles: [".rte-segmented-control{display:flex;min-width:168px;max-width:720px;height:48px}.rte-segmented-control[data-number-of-segments=\"3\"]{min-width:256px}.rte-segment-selected-indicator{position:absolute;top:4px;height:40px;background:var(--background-default);border-radius:999px;transition:left .2s ease-out,width .2s ease-out}.rte-segment-container{display:flex;border-top:1px solid var(--border-inverse);border-bottom:1px solid var(--border-inverse);background:var(--background-brand-default);padding:4px 2px;align-items:center;flex:1 0 0;overflow:hidden}.rte-segment-container[data-position=left]{border-radius:999px 0 0 999px;border-left:1px solid var(--border-inverse);background:var(--background-brand-default);padding-left:4px}.rte-segment-container[data-position=right]{border-radius:0 999px 999px 0;border-right:1px solid var(--border-inverse);background:var(--background-brand-default);padding-right:4px}.rte-segment{display:flex;padding:6px 8px;align-items:center;border-radius:999px;color:var(--content-primary-inverse);flex:1 1 auto;overflow:hidden;width:100%;z-index:0}.rte-segment:focus-visible{outline:1px solid var(--border-inverse);outline-offset:-2px}.rte-segment.selected{transition:color .2s ease-out;color:var(--content-brand-default)}.rte-segment.selected:focus-visible{outline:1px solid var(--border-brand-focused)}.rte-segment:hover:not(.selected){background:var(--background-brand-hover);cursor:pointer}.rte-segment[data-segment-type=icon]{padding:8px}.rte-segment .rte-segment-content{display:flex;align-items:center;justify-content:center;width:100%;overflow:hidden}.rte-segment .rte-segment-content .rte-segment-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:20px;line-height:28px;letter-spacing:-.5px;padding:0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-segment .rte-selected-icon{min-width:24px;min-height:24px}\n"] }]
|
|
2030
|
+
args: [{ selector: "rte-segmented-control", imports: [CommonModule, IconComponent, BadgeComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"isValidOptions()\" class=\"rte-segmented-control\" role=\"radiogroup\" [attr.aria-label]=\"ariaLabel()\">\n <span class=\"rte-segment-selected-indicator\" [ngStyle]=\"segmentSelectedIndicatorStyle()\"></span>\n <ng-container *ngFor=\"let option of options(); let idx = index\">\n <div class=\"rte-segment-container\" [attr.data-position]=\"getSegmentPosition(idx)\">\n <div\n #segment\n role=\"radio\"\n class=\"rte-segment\"\n tabindex=\"0\"\n [attr.data-id]=\"option.id\"\n [attr.data-segment-type]=\"option.icon ? 'icon' : 'label'\"\n [class.selected]=\"isSegmentSelected(option.id)\"\n [attr.aria-checked]=\"isSegmentSelected(option.id)\"\n [attr.aria-label]=\"option.label\"\n (click)=\"selectSegment(option.id)\"\n (keydown)=\"handleKeyDown($event)\"\n (keyup)=\"handleKeyUp($event)\"\n >\n <rte-icon *ngIf=\"isSegmentSelected(option.id)\" name=\"check-small\" class=\"rte-selected-icon\" [size]=\"24\" />\n <div class=\"rte-segment-content\">\n <ng-container *ngIf=\"option.icon; else label\">\n <rte-icon\n [name]=\"option.icon\"\n [size]=\"24\"\n [appearance]=\"isSegmentSelected(option.id) ? 'filled' : 'outlined'\"\n ></rte-icon>\n </ng-container>\n <ng-template #label>\n <span class=\"rte-segment-label\">{{ option.label }}</span>\n </ng-template>\n </div>\n <rte-badge\n *ngIf=\"shouldDisplayBadge(option)\"\n [count]=\"option.badgeCount\"\n [badgeContent]=\"option.badgeContent!\"\n [icon]=\"option.badgeIcon!\"\n [badgeType]=\"option.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"option.badgeSize!\"\n ></rte-badge>\n </div>\n </div>\n </ng-container>\n</div>\n", styles: [".rte-segmented-control{display:flex;min-width:168px;max-width:720px;height:48px}.rte-segmented-control[data-number-of-segments=\"3\"]{min-width:256px}.rte-segment-selected-indicator{position:absolute;top:4px;height:40px;background:var(--background-default);border-radius:999px;transition:left .2s ease-out,width .2s ease-out}.rte-segment-container{display:flex;border-top:1px solid var(--border-inverse);border-bottom:1px solid var(--border-inverse);background:var(--background-brand-default);padding:4px 2px;align-items:center;flex:1 0 0;overflow:hidden}.rte-segment-container[data-position=left]{border-radius:999px 0 0 999px;border-left:1px solid var(--border-inverse);background:var(--background-brand-default);padding-left:4px}.rte-segment-container[data-position=right]{border-radius:0 999px 999px 0;border-right:1px solid var(--border-inverse);background:var(--background-brand-default);padding-right:4px}.rte-segment{display:flex;padding:6px 8px;align-items:center;border-radius:999px;color:var(--content-primary-inverse);flex:1 1 auto;overflow:hidden;width:100%;z-index:0}.rte-segment:focus-visible{outline:1px solid var(--border-inverse);outline-offset:-2px}.rte-segment.selected{transition:color .2s ease-out;color:var(--content-brand-default)}.rte-segment.selected:focus-visible{outline:1px solid var(--border-brand-focused)}.rte-segment:hover:not(.selected){background:var(--background-brand-hover);cursor:pointer}.rte-segment[data-segment-type=icon]{padding:8px}.rte-segment .rte-segment-content{display:flex;align-items:center;justify-content:center;width:100%;overflow:hidden}.rte-segment .rte-segment-content .rte-segment-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:20px;line-height:28px;letter-spacing:-.5px;padding:0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-segment .rte-selected-icon{min-width:24px;min-height:24px}\n"] }]
|
|
1795
2031
|
}] });
|
|
1796
2032
|
|
|
1797
2033
|
class BreadcrumbItemComponent {
|
|
@@ -1808,6 +2044,18 @@ class BreadcrumbItemComponent {
|
|
|
1808
2044
|
}
|
|
1809
2045
|
return false;
|
|
1810
2046
|
});
|
|
2047
|
+
this.shouldDisplayBadge = computed(() => {
|
|
2048
|
+
const item = this.item();
|
|
2049
|
+
if (!item)
|
|
2050
|
+
return false;
|
|
2051
|
+
const { showBadge, badgeContent, badgeCount, badgeIcon } = item;
|
|
2052
|
+
return shouldDisplayBadge({
|
|
2053
|
+
showBadge: !!showBadge,
|
|
2054
|
+
badgeContent,
|
|
2055
|
+
badgeCount,
|
|
2056
|
+
badgeIcon,
|
|
2057
|
+
});
|
|
2058
|
+
});
|
|
1811
2059
|
this.tooltipTriggerStyle = computed(() => {
|
|
1812
2060
|
return `overflow: hidden; text-overflow: ellipsis; white-space: nowrap; ${this.breadcrumbItemMaxWidth() ? "max-width:" + this.breadcrumbItemMaxWidth() + "px" : ""}`;
|
|
1813
2061
|
});
|
|
@@ -1820,11 +2068,11 @@ class BreadcrumbItemComponent {
|
|
|
1820
2068
|
this.initialScrollWidth.set(el.scrollWidth);
|
|
1821
2069
|
}
|
|
1822
2070
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BreadcrumbItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1823
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: BreadcrumbItemComponent, isStandalone: true, selector: "rte-breadcrumb-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null }, isLast: { classPropertyName: "isLast", publicName: "isLast", isSignal: true, isRequired: false, transformFunction: null }, breadcrumbItemMaxWidth: { classPropertyName: "breadcrumbItemMaxWidth", publicName: "breadcrumbItemMaxWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"rte-breadcrumb-item\">\n @if (isLast()) {\n @if (isEllipsisActive()) {\n <div [rteTooltip]=\"item()!.label\" [rteTooltipPosition]=\"'bottom'\" [style]=\"tooltipTriggerStyle()\">\n <a role=\"link\" aria-current=\"page\" tabindex=\"-1\" [attr.aria-label]=\"item()!.label\" [style]=\"linkStyle()\">\n {{ item()!.label }}\n </a>\n </div>\n } @else {\n <a role=\"link\" aria-current=\"page\" tabindex=\"0\" [attr.aria-label]=\"item()!.label\" [style]=\"linkStyle()\">\n {{ item()!.label }}\n </a>\n }\n } @else {\n @if (isEllipsisActive()) {\n <div\n [rteTooltip]=\"item()!.label\"\n [rteTooltipPosition]=\"'bottom'\"\n [style]=\"tooltipTriggerStyle()\"\n [style.overflow]=\"'unset'\"\n [rteTooltipShouldFocusTrigger]=\"false\"\n >\n <rte-link [href]=\"item()!.link\" [label]=\"item()!.label\" [subtle]=\"true\" [maxWidth]=\"breadcrumbItemMaxWidth()\" />\n </div>\n } @else {\n <rte-link [href]=\"item()!.link\" [label]=\"item()!.label\" [subtle]=\"true\" [maxWidth]=\"breadcrumbItemMaxWidth()\" />\n }\n }\n</div>\n", styles: [".rte-breadcrumb-item{display:inline-flex;align-items:center;opacity:0;animation:fadeIn .15s forwards;font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px}.rte-breadcrumb-item rte-link ::ng-deep a,.rte-breadcrumb-item rte-link ::ng-deep a.subtle{color:var(--content-tertiary)!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-breadcrumb-item a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-breadcrumb-item:last-child{cursor:default;color:var(--content-primary)}.rte-breadcrumb-item :focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}@keyframes fadeIn{to{opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: LinkComponent, selector: "rte-link", inputs: ["label", "href", "subtle", "externalLink", "reverse", "maxWidth"] }, { kind: "directive", type: TooltipDirective, selector: "[rteTooltip]", inputs: ["rteTooltip", "rteTooltipPosition", "rteTooltipAlignment", "rteTooltipArrow", "rteTooltipShouldFocusTrigger", "rteTooltipGap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2071
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: BreadcrumbItemComponent, isStandalone: true, selector: "rte-breadcrumb-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null }, isLast: { classPropertyName: "isLast", publicName: "isLast", isSignal: true, isRequired: false, transformFunction: null }, breadcrumbItemMaxWidth: { classPropertyName: "breadcrumbItemMaxWidth", publicName: "breadcrumbItemMaxWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"rte-breadcrumb-item\">\n @if (isLast()) {\n @if (isEllipsisActive()) {\n <div [rteTooltip]=\"item()!.label\" [rteTooltipPosition]=\"'bottom'\" [style]=\"tooltipTriggerStyle()\">\n <a role=\"link\" aria-current=\"page\" tabindex=\"-1\" [attr.aria-label]=\"item()!.label\" [style]=\"linkStyle()\">\n {{ item()!.label }}\n </a>\n </div>\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"item()!.badgeCount\"\n [badgeContent]=\"item()!.badgeContent!\"\n [icon]=\"item()!.badgeIcon!\"\n [badgeType]=\"item()!.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"item()!.badgeSize!\"\n />\n } @else {\n <a role=\"link\" aria-current=\"page\" tabindex=\"0\" [attr.aria-label]=\"item()!.label\" [style]=\"linkStyle()\">\n {{ item()!.label }}\n </a>\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"item()!.badgeCount\"\n [badgeContent]=\"item()!.badgeContent!\"\n [icon]=\"item()!.badgeIcon!\"\n [badgeType]=\"item()!.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"item()!.badgeSize!\"\n />\n }\n } @else {\n @if (isEllipsisActive()) {\n <div\n [rteTooltip]=\"item()!.label\"\n [rteTooltipPosition]=\"'bottom'\"\n [style]=\"tooltipTriggerStyle()\"\n [style.overflow]=\"'unset'\"\n [rteTooltipShouldFocusTrigger]=\"false\"\n >\n <rte-link [href]=\"item()!.link\" [label]=\"item()!.label\" [subtle]=\"true\" [maxWidth]=\"breadcrumbItemMaxWidth()\" />\n </div>\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"item()!.badgeCount\"\n [badgeContent]=\"item()!.badgeContent!\"\n [icon]=\"item()!.badgeIcon!\"\n [badgeType]=\"item()!.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"item()!.badgeSize!\"\n />\n } @else {\n <rte-link [href]=\"item()!.link\" [label]=\"item()!.label\" [subtle]=\"true\" [maxWidth]=\"breadcrumbItemMaxWidth()\" />\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"item()!.badgeCount\"\n [badgeContent]=\"item()!.badgeContent!\"\n [icon]=\"item()!.badgeIcon!\"\n [badgeType]=\"item()!.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"item()!.badgeSize!\"\n />\n }\n }\n</div>\n", styles: [".rte-breadcrumb-item{display:inline-flex;align-items:center;opacity:0;animation:fadeIn .15s forwards;gap:4px;font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px}.rte-breadcrumb-item rte-link ::ng-deep a,.rte-breadcrumb-item rte-link ::ng-deep a.subtle{color:var(--content-tertiary)!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-breadcrumb-item a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-breadcrumb-item:last-child{cursor:default;color:var(--content-primary)}.rte-breadcrumb-item :focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}@keyframes fadeIn{to{opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LinkComponent, selector: "rte-link", inputs: ["label", "href", "subtle", "externalLink", "reverse", "maxWidth"] }, { kind: "directive", type: TooltipDirective, selector: "[rteTooltip]", inputs: ["rteTooltip", "rteTooltipPosition", "rteTooltipAlignment", "rteTooltipArrow", "rteTooltipShouldFocusTrigger", "rteTooltipGap"] }, { kind: "component", type: BadgeComponent, selector: "rte-badge", inputs: ["badgeType", "badgeSize", "badgeContent", "count", "icon", "simpleBadge"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1824
2072
|
}
|
|
1825
2073
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BreadcrumbItemComponent, decorators: [{
|
|
1826
2074
|
type: Component,
|
|
1827
|
-
args: [{ selector: "rte-breadcrumb-item", imports: [CommonModule, LinkComponent, TooltipDirective], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"rte-breadcrumb-item\">\n @if (isLast()) {\n @if (isEllipsisActive()) {\n <div [rteTooltip]=\"item()!.label\" [rteTooltipPosition]=\"'bottom'\" [style]=\"tooltipTriggerStyle()\">\n <a role=\"link\" aria-current=\"page\" tabindex=\"-1\" [attr.aria-label]=\"item()!.label\" [style]=\"linkStyle()\">\n {{ item()!.label }}\n </a>\n </div>\n } @else {\n <a role=\"link\" aria-current=\"page\" tabindex=\"0\" [attr.aria-label]=\"item()!.label\" [style]=\"linkStyle()\">\n {{ item()!.label }}\n </a>\n }\n } @else {\n @if (isEllipsisActive()) {\n <div\n [rteTooltip]=\"item()!.label\"\n [rteTooltipPosition]=\"'bottom'\"\n [style]=\"tooltipTriggerStyle()\"\n [style.overflow]=\"'unset'\"\n [rteTooltipShouldFocusTrigger]=\"false\"\n >\n <rte-link [href]=\"item()!.link\" [label]=\"item()!.label\" [subtle]=\"true\" [maxWidth]=\"breadcrumbItemMaxWidth()\" />\n </div>\n } @else {\n <rte-link [href]=\"item()!.link\" [label]=\"item()!.label\" [subtle]=\"true\" [maxWidth]=\"breadcrumbItemMaxWidth()\" />\n }\n }\n</div>\n", styles: [".rte-breadcrumb-item{display:inline-flex;align-items:center;opacity:0;animation:fadeIn .15s forwards;font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px}.rte-breadcrumb-item rte-link ::ng-deep a,.rte-breadcrumb-item rte-link ::ng-deep a.subtle{color:var(--content-tertiary)!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-breadcrumb-item a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-breadcrumb-item:last-child{cursor:default;color:var(--content-primary)}.rte-breadcrumb-item :focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}@keyframes fadeIn{to{opacity:1}}\n"] }]
|
|
2075
|
+
args: [{ selector: "rte-breadcrumb-item", imports: [CommonModule, LinkComponent, TooltipDirective, BadgeComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"rte-breadcrumb-item\">\n @if (isLast()) {\n @if (isEllipsisActive()) {\n <div [rteTooltip]=\"item()!.label\" [rteTooltipPosition]=\"'bottom'\" [style]=\"tooltipTriggerStyle()\">\n <a role=\"link\" aria-current=\"page\" tabindex=\"-1\" [attr.aria-label]=\"item()!.label\" [style]=\"linkStyle()\">\n {{ item()!.label }}\n </a>\n </div>\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"item()!.badgeCount\"\n [badgeContent]=\"item()!.badgeContent!\"\n [icon]=\"item()!.badgeIcon!\"\n [badgeType]=\"item()!.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"item()!.badgeSize!\"\n />\n } @else {\n <a role=\"link\" aria-current=\"page\" tabindex=\"0\" [attr.aria-label]=\"item()!.label\" [style]=\"linkStyle()\">\n {{ item()!.label }}\n </a>\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"item()!.badgeCount\"\n [badgeContent]=\"item()!.badgeContent!\"\n [icon]=\"item()!.badgeIcon!\"\n [badgeType]=\"item()!.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"item()!.badgeSize!\"\n />\n }\n } @else {\n @if (isEllipsisActive()) {\n <div\n [rteTooltip]=\"item()!.label\"\n [rteTooltipPosition]=\"'bottom'\"\n [style]=\"tooltipTriggerStyle()\"\n [style.overflow]=\"'unset'\"\n [rteTooltipShouldFocusTrigger]=\"false\"\n >\n <rte-link [href]=\"item()!.link\" [label]=\"item()!.label\" [subtle]=\"true\" [maxWidth]=\"breadcrumbItemMaxWidth()\" />\n </div>\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"item()!.badgeCount\"\n [badgeContent]=\"item()!.badgeContent!\"\n [icon]=\"item()!.badgeIcon!\"\n [badgeType]=\"item()!.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"item()!.badgeSize!\"\n />\n } @else {\n <rte-link [href]=\"item()!.link\" [label]=\"item()!.label\" [subtle]=\"true\" [maxWidth]=\"breadcrumbItemMaxWidth()\" />\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"item()!.badgeCount\"\n [badgeContent]=\"item()!.badgeContent!\"\n [icon]=\"item()!.badgeIcon!\"\n [badgeType]=\"item()!.badgeType!\"\n [simpleBadge]=\"true\"\n [badgeSize]=\"item()!.badgeSize!\"\n />\n }\n }\n</div>\n", styles: [".rte-breadcrumb-item{display:inline-flex;align-items:center;opacity:0;animation:fadeIn .15s forwards;gap:4px;font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px}.rte-breadcrumb-item rte-link ::ng-deep a,.rte-breadcrumb-item rte-link ::ng-deep a.subtle{color:var(--content-tertiary)!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-breadcrumb-item a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rte-breadcrumb-item:last-child{cursor:default;color:var(--content-primary)}.rte-breadcrumb-item :focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}@keyframes fadeIn{to{opacity:1}}\n"] }]
|
|
1828
2076
|
}] });
|
|
1829
2077
|
|
|
1830
2078
|
class BreadcrumbsComponent {
|
|
@@ -1832,19 +2080,33 @@ class BreadcrumbsComponent {
|
|
|
1832
2080
|
this.items = input([]);
|
|
1833
2081
|
this.ariaLabel = input(BREADCRUMBS_DEFAULT_ARIA_LABEL);
|
|
1834
2082
|
this.breadcrumbItemMaxWidth = input(150);
|
|
2083
|
+
this.badgeContent = input();
|
|
2084
|
+
this.badgeCount = input();
|
|
2085
|
+
this.badgeIcon = input();
|
|
2086
|
+
this.badgeType = input();
|
|
2087
|
+
this.showBadge = input(false);
|
|
2088
|
+
this.badgeSize = input("s");
|
|
1835
2089
|
this.truncatedItems = computed(() => {
|
|
1836
2090
|
if (shouldTruncateBreadcrumbs(this.items())) {
|
|
1837
2091
|
return getBreadcrumbsTruncatedItems(this.items());
|
|
1838
2092
|
}
|
|
1839
2093
|
return null;
|
|
1840
2094
|
});
|
|
2095
|
+
this.shouldDisplayBadge = computed(() => {
|
|
2096
|
+
return shouldDisplayBadge({
|
|
2097
|
+
showBadge: !!this.showBadge(),
|
|
2098
|
+
badgeContent: this.badgeContent(),
|
|
2099
|
+
badgeCount: this.badgeCount(),
|
|
2100
|
+
badgeIcon: this.badgeIcon(),
|
|
2101
|
+
});
|
|
2102
|
+
});
|
|
1841
2103
|
}
|
|
1842
2104
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BreadcrumbsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1843
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: BreadcrumbsComponent, isStandalone: true, selector: "rte-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, breadcrumbItemMaxWidth: { classPropertyName: "breadcrumbItemMaxWidth", publicName: "breadcrumbItemMaxWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<nav\n class=\"breadcrumbs-container\"\n role=\"navigation\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"{ truncated: truncatedItems()?.truncated?.length }\"\n>\n @if (truncatedItems()?.truncated?.length) {\n <rte-breadcrumb-item [item]=\"truncatedItems()!.root\" [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\" />\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n <span class=\"breadcrumb-item\" rteDropdown [rteDropdownOffset]=\"8\">\n <rte-icon-button\n rteDropdownTrigger\n name=\"more-horiz\"\n role=\"menu\"\n variant=\"neutral\"\n aria-label=\"More items\"\n data-testid=\"show-more\"\n
|
|
2105
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: BreadcrumbsComponent, isStandalone: true, selector: "rte-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, breadcrumbItemMaxWidth: { classPropertyName: "breadcrumbItemMaxWidth", publicName: "breadcrumbItemMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, badgeContent: { classPropertyName: "badgeContent", publicName: "badgeContent", isSignal: true, isRequired: false, transformFunction: null }, badgeCount: { classPropertyName: "badgeCount", publicName: "badgeCount", isSignal: true, isRequired: false, transformFunction: null }, badgeIcon: { classPropertyName: "badgeIcon", publicName: "badgeIcon", isSignal: true, isRequired: false, transformFunction: null }, badgeType: { classPropertyName: "badgeType", publicName: "badgeType", isSignal: true, isRequired: false, transformFunction: null }, showBadge: { classPropertyName: "showBadge", publicName: "showBadge", isSignal: true, isRequired: false, transformFunction: null }, badgeSize: { classPropertyName: "badgeSize", publicName: "badgeSize", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<nav\n class=\"breadcrumbs-container\"\n role=\"navigation\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"{ truncated: truncatedItems()?.truncated?.length }\"\n>\n @if (truncatedItems()?.truncated?.length) {\n <rte-breadcrumb-item [item]=\"truncatedItems()!.root\" [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\" />\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n <span class=\"breadcrumb-item\" rteDropdown [rteDropdownOffset]=\"8\">\n <rte-icon-button\n rteDropdownTrigger\n name=\"more-horiz\"\n role=\"menu\"\n variant=\"neutral\"\n aria-label=\"More items\"\n data-testid=\"show-more\"\n tabindex=\"-1\"\n [compactSpacing]=\"true\"\n />\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"badgeCount()\"\n [simpleBadge]=\"true\"\n [badgeContent]=\"badgeContent()!\"\n [icon]=\"badgeIcon()!\"\n [badgeType]=\"badgeType()!\"\n [badgeSize]=\"badgeSize()!\"\n />\n <rte-dropdown-menu [items]=\"truncatedItems()?.truncated ?? []\" />\n </span>\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n @for (item of truncatedItems()!.remaining; track item.link; let i = $index) {\n <rte-breadcrumb-item\n [item]=\"item\"\n [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\"\n [isLast]=\"i === truncatedItems()!.remaining.length - 1\"\n />\n @if (i < truncatedItems()!.remaining.length - 1) {\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n }\n }\n } @else {\n @for (item of items(); track item.link; let i = $index) {\n <rte-breadcrumb-item\n [item]=\"item\"\n [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\"\n [isLast]=\"i === items().length - 1\"\n />\n @if (i < items().length - 1) {\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n }\n }\n }\n</nav>\n", styles: [".breadcrumbs-container{display:flex;align-items:center;gap:2px}.breadcrumbs-container .breadcrumb-item{display:inline-flex;align-items:center;opacity:0;animation:fadeIn .15s forwards;font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px}.breadcrumbs-container .breadcrumb-item rte-link ::ng-deep a,.breadcrumbs-container .breadcrumb-item rte-link ::ng-deep a.subtle{color:var(--content-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.breadcrumbs-container .breadcrumb-item a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.breadcrumbs-container .breadcrumb-item:last-child{cursor:default;color:var(--content-primary)}.breadcrumbs-container .breadcrumb-item :focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.separator{color:var(--content-secondary);padding:0 8px;-webkit-user-select:none;user-select:none;opacity:0;animation:fadeIn .15s forwards}@keyframes fadeIn{to{opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: DropdownDirective, selector: "[rteDropdown]", inputs: ["rteDropdownId", "rteDropdownPosition", "rteDropdownAlignment", "rteDropdownIsOpen", "rteDropdownOffset", "rteDropdownAutofocus", "rteDropdownAutoOpen", "rteDropdownWidth"], outputs: ["menuEvent", "clickedOutside", "closedDropdown"] }, { kind: "directive", type: DropdownTriggerDirective, selector: "[rteDropdownTrigger]", inputs: ["rteDropdownTriggerActivateWithArrowDown"], outputs: ["dropdownKeyDown", "dropdownTriggered", "dropdownTriggerFocus", "dropdownTriggerClearContent", "dropdownTriggerOpenDropdown", "dropdownTriggerCloseDropdown"] }, { kind: "component", type: DropdownMenuComponent, selector: "rte-dropdown-menu", inputs: ["items", "menuId", "isOpen", "width", "headerTemplate", "footerTemplate"], outputs: ["itemEvent", "closingMenu"] }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon", "customStyle"], outputs: ["clickEvent"] }, { kind: "component", type: BreadcrumbItemComponent, selector: "rte-breadcrumb-item", inputs: ["item", "isLast", "breadcrumbItemMaxWidth"] }, { kind: "component", type: BadgeComponent, selector: "rte-badge", inputs: ["badgeType", "badgeSize", "badgeContent", "count", "icon", "simpleBadge"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1844
2106
|
}
|
|
1845
2107
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BreadcrumbsComponent, decorators: [{
|
|
1846
2108
|
type: Component,
|
|
1847
|
-
args: [{ selector: "rte-breadcrumbs", imports: [CommonModule, DropdownModule, IconButtonComponent, BreadcrumbItemComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav\n class=\"breadcrumbs-container\"\n role=\"navigation\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"{ truncated: truncatedItems()?.truncated?.length }\"\n>\n @if (truncatedItems()?.truncated?.length) {\n <rte-breadcrumb-item [item]=\"truncatedItems()!.root\" [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\" />\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n <span class=\"breadcrumb-item\" rteDropdown [rteDropdownOffset]=\"8\">\n <rte-icon-button\n rteDropdownTrigger\n name=\"more-horiz\"\n role=\"menu\"\n variant=\"neutral\"\n aria-label=\"More items\"\n data-testid=\"show-more\"\n
|
|
2109
|
+
args: [{ selector: "rte-breadcrumbs", imports: [CommonModule, DropdownModule, IconButtonComponent, BreadcrumbItemComponent, BadgeComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav\n class=\"breadcrumbs-container\"\n role=\"navigation\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"{ truncated: truncatedItems()?.truncated?.length }\"\n>\n @if (truncatedItems()?.truncated?.length) {\n <rte-breadcrumb-item [item]=\"truncatedItems()!.root\" [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\" />\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n <span class=\"breadcrumb-item\" rteDropdown [rteDropdownOffset]=\"8\">\n <rte-icon-button\n rteDropdownTrigger\n name=\"more-horiz\"\n role=\"menu\"\n variant=\"neutral\"\n aria-label=\"More items\"\n data-testid=\"show-more\"\n tabindex=\"-1\"\n [compactSpacing]=\"true\"\n />\n <rte-badge\n *ngIf=\"shouldDisplayBadge()\"\n [count]=\"badgeCount()\"\n [simpleBadge]=\"true\"\n [badgeContent]=\"badgeContent()!\"\n [icon]=\"badgeIcon()!\"\n [badgeType]=\"badgeType()!\"\n [badgeSize]=\"badgeSize()!\"\n />\n <rte-dropdown-menu [items]=\"truncatedItems()?.truncated ?? []\" />\n </span>\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n @for (item of truncatedItems()!.remaining; track item.link; let i = $index) {\n <rte-breadcrumb-item\n [item]=\"item\"\n [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\"\n [isLast]=\"i === truncatedItems()!.remaining.length - 1\"\n />\n @if (i < truncatedItems()!.remaining.length - 1) {\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n }\n }\n } @else {\n @for (item of items(); track item.link; let i = $index) {\n <rte-breadcrumb-item\n [item]=\"item\"\n [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\"\n [isLast]=\"i === items().length - 1\"\n />\n @if (i < items().length - 1) {\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n }\n }\n }\n</nav>\n", styles: [".breadcrumbs-container{display:flex;align-items:center;gap:2px}.breadcrumbs-container .breadcrumb-item{display:inline-flex;align-items:center;opacity:0;animation:fadeIn .15s forwards;font-family:Arial;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px}.breadcrumbs-container .breadcrumb-item rte-link ::ng-deep a,.breadcrumbs-container .breadcrumb-item rte-link ::ng-deep a.subtle{color:var(--content-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.breadcrumbs-container .breadcrumb-item a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.breadcrumbs-container .breadcrumb-item:last-child{cursor:default;color:var(--content-primary)}.breadcrumbs-container .breadcrumb-item :focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.separator{color:var(--content-secondary);padding:0 8px;-webkit-user-select:none;user-select:none;opacity:0;animation:fadeIn .15s forwards}@keyframes fadeIn{to{opacity:1}}\n"] }]
|
|
1848
2110
|
}] });
|
|
1849
2111
|
|
|
1850
2112
|
class BannerComponent {
|
|
@@ -1906,11 +2168,11 @@ class BannerComponent {
|
|
|
1906
2168
|
});
|
|
1907
2169
|
}
|
|
1908
2170
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BannerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1909
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: BannerComponent, isStandalone: true, selector: "rte-banner", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click", close: "close" }, usesOnChanges: true, ngImport: i0, template: "<section\n *ngIf=\"rendering()\"\n class=\"rte-banner-container {{ type() }} {{ position() }}\"\n class=\"rte-banner\"\n [ngClass]=\"{ open: visible(), close: !visible() }\"\n [attr.role]=\"type() === 'error' ? 'alert' : 'status'\"\n>\n <div class=\"rte-banner-icon\">\n <rte-icon [name]=\"iconName()\" [size]=\"32\" />\n </div>\n <div class=\"rte-banner-content\">\n <span *ngIf=\"title()\" class=\"rte-banner-title\">{{ title() }}</span>\n <div *ngIf=\"message()\" class=\"rte-banner-message\">\n <span>{{ message() }}</span>\n </div>\n </div>\n <button\n *ngIf=\"actionLabel()\"\n rteButton\n rteButtonVariant=\"text\"\n rteButtonSize=\"s\"\n [attr.aria-label]=\"actionLabel()!\"\n (click)=\"clickAction()\"\n >\n {{ actionLabel() }}\n </button>\n <div *ngIf=\"closable()\" class=\"rte-banner-close-icon\">\n <rte-icon-button name=\"close\" variant=\"neutral\" ariaLabel=\"close banner\" (
|
|
2171
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: BannerComponent, isStandalone: true, selector: "rte-banner", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click", close: "close" }, usesOnChanges: true, ngImport: i0, template: "<section\n *ngIf=\"rendering()\"\n class=\"rte-banner-container {{ type() }} {{ position() }}\"\n class=\"rte-banner\"\n [ngClass]=\"{ open: visible(), close: !visible() }\"\n [attr.role]=\"type() === 'error' ? 'alert' : 'status'\"\n>\n <div class=\"rte-banner-icon\">\n <rte-icon [name]=\"iconName()\" [size]=\"32\" />\n </div>\n <div class=\"rte-banner-content\">\n <span *ngIf=\"title()\" class=\"rte-banner-title\">{{ title() }}</span>\n <div *ngIf=\"message()\" class=\"rte-banner-message\">\n <span>{{ message() }}</span>\n </div>\n </div>\n <button\n *ngIf=\"actionLabel()\"\n rteButton\n rteButtonVariant=\"text\"\n rteButtonSize=\"s\"\n [attr.aria-label]=\"actionLabel()!\"\n (click)=\"clickAction()\"\n >\n {{ actionLabel() }}\n </button>\n <div *ngIf=\"closable()\" class=\"rte-banner-close-icon\">\n <rte-icon-button name=\"close\" variant=\"neutral\" ariaLabel=\"close banner\" (clickEvent)=\"closeBanner()\" />\n </div>\n</section>\n", styles: [".rte-banner{box-shadow:0 2px 4px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);padding:16px;gap:16px;align-self:stretch;border-radius:0 0 4px 4px;display:flex;box-sizing:border-box;width:100%;min-width:320px;justify-content:center;align-items:center;color:var(--content-info-default);top:0;left:0;opacity:0;transition:opacity .2s ease,transform .2s ease;z-index:10;border-bottom:8px solid var(--border-info);background-color:var(--background-default)}.rte-banner.error{color:var(--content-danger-default);border-bottom-color:var(--border-danger)}.rte-banner.success{color:var(--content-success-default);border-bottom-color:var(--border-success)}.rte-banner.warning{color:var(--content-primary);border-bottom-color:var(--border-warning)}.rte-banner.overlay{position:fixed}.rte-banner.open{opacity:1;transform:translateY(0)}.rte-banner.close{opacity:0;transform:translateY(-10px)}.rte-banner .rte-banner-icon{display:flex;padding:0 0 0 16px;justify-content:center;align-items:center;gap:var(--positive-spacing_0, 0);align-self:stretch}.rte-banner .banner-close-icon{color:var(--content-secondary)}.rte-banner .rte-banner-content{display:flex;padding:0 16px;flex-direction:column;align-items:flex-start;gap:8px;flex:1 0 0;border-radius:0;opacity:100%}.rte-banner .rte-banner-content .rte-banner-title{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:20px;line-height:28px;letter-spacing:-.5px}.rte-banner .rte-banner-content .rte-banner-action-button{width:max-content}.rte-banner .rte-banner-content .rte-banner-message{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;color:var(--content-secondary);display:flex;align-items:center;gap:24px;padding:8px 0;justify-content:space-between;width:100%}.rte-banner .rte-banner-close-icon{color:var(--content-secondary)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon", "customStyle"], outputs: ["clickEvent"] }, { kind: "component", type: ButtonComponent, selector: "button[rteButton]", inputs: ["rteButtonVariant", "rteButtonSize", "rteBadgeCount", "rteBadgeContent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1910
2172
|
}
|
|
1911
2173
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BannerComponent, decorators: [{
|
|
1912
2174
|
type: Component,
|
|
1913
|
-
args: [{ selector: "rte-banner", imports: [CommonModule, IconComponent, IconButtonComponent, ButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<section\n *ngIf=\"rendering()\"\n class=\"rte-banner-container {{ type() }} {{ position() }}\"\n class=\"rte-banner\"\n [ngClass]=\"{ open: visible(), close: !visible() }\"\n [attr.role]=\"type() === 'error' ? 'alert' : 'status'\"\n>\n <div class=\"rte-banner-icon\">\n <rte-icon [name]=\"iconName()\" [size]=\"32\" />\n </div>\n <div class=\"rte-banner-content\">\n <span *ngIf=\"title()\" class=\"rte-banner-title\">{{ title() }}</span>\n <div *ngIf=\"message()\" class=\"rte-banner-message\">\n <span>{{ message() }}</span>\n </div>\n </div>\n <button\n *ngIf=\"actionLabel()\"\n rteButton\n rteButtonVariant=\"text\"\n rteButtonSize=\"s\"\n [attr.aria-label]=\"actionLabel()!\"\n (click)=\"clickAction()\"\n >\n {{ actionLabel() }}\n </button>\n <div *ngIf=\"closable()\" class=\"rte-banner-close-icon\">\n <rte-icon-button name=\"close\" variant=\"neutral\" ariaLabel=\"close banner\" (
|
|
2175
|
+
args: [{ selector: "rte-banner", imports: [CommonModule, IconComponent, IconButtonComponent, ButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<section\n *ngIf=\"rendering()\"\n class=\"rte-banner-container {{ type() }} {{ position() }}\"\n class=\"rte-banner\"\n [ngClass]=\"{ open: visible(), close: !visible() }\"\n [attr.role]=\"type() === 'error' ? 'alert' : 'status'\"\n>\n <div class=\"rte-banner-icon\">\n <rte-icon [name]=\"iconName()\" [size]=\"32\" />\n </div>\n <div class=\"rte-banner-content\">\n <span *ngIf=\"title()\" class=\"rte-banner-title\">{{ title() }}</span>\n <div *ngIf=\"message()\" class=\"rte-banner-message\">\n <span>{{ message() }}</span>\n </div>\n </div>\n <button\n *ngIf=\"actionLabel()\"\n rteButton\n rteButtonVariant=\"text\"\n rteButtonSize=\"s\"\n [attr.aria-label]=\"actionLabel()!\"\n (click)=\"clickAction()\"\n >\n {{ actionLabel() }}\n </button>\n <div *ngIf=\"closable()\" class=\"rte-banner-close-icon\">\n <rte-icon-button name=\"close\" variant=\"neutral\" ariaLabel=\"close banner\" (clickEvent)=\"closeBanner()\" />\n </div>\n</section>\n", styles: [".rte-banner{box-shadow:0 2px 4px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);padding:16px;gap:16px;align-self:stretch;border-radius:0 0 4px 4px;display:flex;box-sizing:border-box;width:100%;min-width:320px;justify-content:center;align-items:center;color:var(--content-info-default);top:0;left:0;opacity:0;transition:opacity .2s ease,transform .2s ease;z-index:10;border-bottom:8px solid var(--border-info);background-color:var(--background-default)}.rte-banner.error{color:var(--content-danger-default);border-bottom-color:var(--border-danger)}.rte-banner.success{color:var(--content-success-default);border-bottom-color:var(--border-success)}.rte-banner.warning{color:var(--content-primary);border-bottom-color:var(--border-warning)}.rte-banner.overlay{position:fixed}.rte-banner.open{opacity:1;transform:translateY(0)}.rte-banner.close{opacity:0;transform:translateY(-10px)}.rte-banner .rte-banner-icon{display:flex;padding:0 0 0 16px;justify-content:center;align-items:center;gap:var(--positive-spacing_0, 0);align-self:stretch}.rte-banner .banner-close-icon{color:var(--content-secondary)}.rte-banner .rte-banner-content{display:flex;padding:0 16px;flex-direction:column;align-items:flex-start;gap:8px;flex:1 0 0;border-radius:0;opacity:100%}.rte-banner .rte-banner-content .rte-banner-title{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:20px;line-height:28px;letter-spacing:-.5px}.rte-banner .rte-banner-content .rte-banner-action-button{width:max-content}.rte-banner .rte-banner-content .rte-banner-message{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;color:var(--content-secondary);display:flex;align-items:center;gap:24px;padding:8px 0;justify-content:space-between;width:100%}.rte-banner .rte-banner-close-icon{color:var(--content-secondary)}\n"] }]
|
|
1914
2176
|
}] });
|
|
1915
2177
|
|
|
1916
2178
|
class CardComponent {
|
|
@@ -2248,11 +2510,11 @@ class ModalComponent {
|
|
|
2248
2510
|
this.closeModal.emit();
|
|
2249
2511
|
}
|
|
2250
2512
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2251
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: ModalComponent, isStandalone: true, selector: "rte-modal", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconAppearance: { classPropertyName: "iconAppearance", publicName: "iconAppearance", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, secondaryButtonLabel: { classPropertyName: "secondaryButtonLabel", publicName: "secondaryButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, primaryButton: { classPropertyName: "primaryButton", publicName: "primaryButton", isSignal: true, isRequired: false, transformFunction: null }, secondaryButton: { classPropertyName: "secondaryButton", publicName: "secondaryButton", isSignal: true, isRequired: false, transformFunction: null }, customContent: { classPropertyName: "customContent", publicName: "customContent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeModal: "closeModal" }, viewQueries: [{ propertyName: "elementRef", first: true, predicate: ["modal"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"rte-modal-wrapper\">\n <div class=\"rte-modal-backdrop\" [attr.data-open]=\"isOpen()\"></div>\n <dialog\n #modal\n class=\"rte-modal-container\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"id() + '-modal-title'\"\n [attr.aria-describedby]=\"description() ? id() + '-modal-desc' : ariaDescribedby()\"\n [attr.data-size]=\"size()\"\n [attr.data-open]=\"isOpen()\"\n >\n <div class=\"rte-modal-header\">\n <div class=\"rte-modal-header-text\">\n <rte-icon *ngIf=\"icon()\" [name]=\"icon() ?? ''\" [size]=\"iconSize()\" [appearance]=\"iconAppearance()\" />\n <h2 class=\"rte-modal-title\" [id]=\"id() + '-modal-title'\">\n {{ title() }}\n </h2>\n <rte-icon-button\n data-testid=\"modal-close-button\"\n name=\"close\"\n size=\"l\"\n class=\"close-icon\"\n variant=\"neutral\"\n [ariaLabel]=\"'Close modal ' + id()\"\n (
|
|
2513
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: ModalComponent, isStandalone: true, selector: "rte-modal", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconAppearance: { classPropertyName: "iconAppearance", publicName: "iconAppearance", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, secondaryButtonLabel: { classPropertyName: "secondaryButtonLabel", publicName: "secondaryButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, primaryButton: { classPropertyName: "primaryButton", publicName: "primaryButton", isSignal: true, isRequired: false, transformFunction: null }, secondaryButton: { classPropertyName: "secondaryButton", publicName: "secondaryButton", isSignal: true, isRequired: false, transformFunction: null }, customContent: { classPropertyName: "customContent", publicName: "customContent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeModal: "closeModal" }, viewQueries: [{ propertyName: "elementRef", first: true, predicate: ["modal"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"rte-modal-wrapper\">\n <div class=\"rte-modal-backdrop\" [attr.data-open]=\"isOpen()\"></div>\n <dialog\n #modal\n class=\"rte-modal-container\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"id() + '-modal-title'\"\n [attr.aria-describedby]=\"description() ? id() + '-modal-desc' : ariaDescribedby()\"\n [attr.data-size]=\"size()\"\n [attr.data-open]=\"isOpen()\"\n >\n <div class=\"rte-modal-header\">\n <div class=\"rte-modal-header-text\">\n <rte-icon *ngIf=\"icon()\" [name]=\"icon() ?? ''\" [size]=\"iconSize()\" [appearance]=\"iconAppearance()\" />\n <h2 class=\"rte-modal-title\" [id]=\"id() + '-modal-title'\">\n {{ title() }}\n </h2>\n <rte-icon-button\n data-testid=\"modal-close-button\"\n name=\"close\"\n size=\"l\"\n class=\"close-icon\"\n variant=\"neutral\"\n [ariaLabel]=\"'Close modal ' + id()\"\n (clickEvent)=\"onClose()\"\n />\n </div>\n <rte-divider />\n </div>\n <div *ngIf=\"description()\" class=\"rte-modal-content\">\n <p class=\"rte-modal-content-description\" [id]=\"id() + '-modal-desc'\">\n {{ description() }}\n </p>\n <ng-container [ngTemplateOutlet]=\"customContent()\"></ng-container>\n </div>\n <div class=\"rte-modal-footer\">\n <ng-container [ngTemplateOutlet]=\"secondaryButton()\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"primaryButton()\"></ng-container>\n </div>\n </dialog>\n</div>\n", styles: [".rte-modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;opacity:0;background-color:#201f1f80;transition:opacity .15s ease-out}.rte-modal-backdrop[data-open=true]{opacity:1}.rte-modal-container{box-shadow:0 4px 8px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-3) 0%,var(--elevation-surface-shadow-3) 100%);border:none;box-sizing:border-box;position:absolute;max-height:90vh;top:50%;transform:translateY(-50%) scale(.98);display:flex;width:496px;padding:24px;flex-direction:column;align-items:flex-start;gap:24px;background-color:var(--background-default);border-radius:8px;opacity:0;transition:opacity .15s ease-in,transform .15s ease-in}.rte-modal-container[data-open=true]{opacity:1;transform:translateY(-50%) scale(1)}.rte-modal-container[data-size=s]{width:656px}.rte-modal-container[data-size=m]{width:936px}.rte-modal-container[data-size=l]{width:1168px;border-radius:12px}.rte-modal-container[data-size=xl]{width:1328px;border-radius:16px}.rte-modal-container .rte-modal-header{display:flex;flex-direction:column;gap:8px;width:100%;flex:0 0 auto}.rte-modal-container .rte-modal-header .rte-modal-header-text{display:flex;flex-direction:row;align-items:center;gap:8px}.rte-modal-container .rte-modal-header .rte-modal-header-text .rte-modal-title{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:24px;line-height:32px;letter-spacing:-.5px;margin:0;overflow:hidden;color:var(--content-primary);text-overflow:ellipsis;flex:1 1 0}.rte-modal-container .rte-modal-content{display:flex;padding:1px;flex-direction:column;align-items:flex-start;gap:16px;color:var(--content-secondary);width:100%;overflow:auto}.rte-modal-container .rte-modal-content .rte-modal-content-description{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;margin:0;color:var(--content-secondary)}.rte-modal-container .rte-modal-footer{display:flex;padding:0;justify-content:flex-end;align-items:center;gap:24px;align-self:stretch;flex:0 0 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon", "customStyle"], outputs: ["clickEvent"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: DividerComponent, selector: "rte-divider", inputs: ["orientation", "thickness", "appearance", "endPoint"] }] }); }
|
|
2252
2514
|
}
|
|
2253
2515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalComponent, decorators: [{
|
|
2254
2516
|
type: Component,
|
|
2255
|
-
args: [{ selector: "rte-modal", imports: [CommonModule, IconButtonComponent, IconComponent, DividerComponent], standalone: true, template: "<div class=\"rte-modal-wrapper\">\n <div class=\"rte-modal-backdrop\" [attr.data-open]=\"isOpen()\"></div>\n <dialog\n #modal\n class=\"rte-modal-container\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"id() + '-modal-title'\"\n [attr.aria-describedby]=\"description() ? id() + '-modal-desc' : ariaDescribedby()\"\n [attr.data-size]=\"size()\"\n [attr.data-open]=\"isOpen()\"\n >\n <div class=\"rte-modal-header\">\n <div class=\"rte-modal-header-text\">\n <rte-icon *ngIf=\"icon()\" [name]=\"icon() ?? ''\" [size]=\"iconSize()\" [appearance]=\"iconAppearance()\" />\n <h2 class=\"rte-modal-title\" [id]=\"id() + '-modal-title'\">\n {{ title() }}\n </h2>\n <rte-icon-button\n data-testid=\"modal-close-button\"\n name=\"close\"\n size=\"l\"\n class=\"close-icon\"\n variant=\"neutral\"\n [ariaLabel]=\"'Close modal ' + id()\"\n (
|
|
2517
|
+
args: [{ selector: "rte-modal", imports: [CommonModule, IconButtonComponent, IconComponent, DividerComponent], standalone: true, template: "<div class=\"rte-modal-wrapper\">\n <div class=\"rte-modal-backdrop\" [attr.data-open]=\"isOpen()\"></div>\n <dialog\n #modal\n class=\"rte-modal-container\"\n [attr.aria-modal]=\"true\"\n [attr.aria-labelledby]=\"id() + '-modal-title'\"\n [attr.aria-describedby]=\"description() ? id() + '-modal-desc' : ariaDescribedby()\"\n [attr.data-size]=\"size()\"\n [attr.data-open]=\"isOpen()\"\n >\n <div class=\"rte-modal-header\">\n <div class=\"rte-modal-header-text\">\n <rte-icon *ngIf=\"icon()\" [name]=\"icon() ?? ''\" [size]=\"iconSize()\" [appearance]=\"iconAppearance()\" />\n <h2 class=\"rte-modal-title\" [id]=\"id() + '-modal-title'\">\n {{ title() }}\n </h2>\n <rte-icon-button\n data-testid=\"modal-close-button\"\n name=\"close\"\n size=\"l\"\n class=\"close-icon\"\n variant=\"neutral\"\n [ariaLabel]=\"'Close modal ' + id()\"\n (clickEvent)=\"onClose()\"\n />\n </div>\n <rte-divider />\n </div>\n <div *ngIf=\"description()\" class=\"rte-modal-content\">\n <p class=\"rte-modal-content-description\" [id]=\"id() + '-modal-desc'\">\n {{ description() }}\n </p>\n <ng-container [ngTemplateOutlet]=\"customContent()\"></ng-container>\n </div>\n <div class=\"rte-modal-footer\">\n <ng-container [ngTemplateOutlet]=\"secondaryButton()\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"primaryButton()\"></ng-container>\n </div>\n </dialog>\n</div>\n", styles: [".rte-modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;opacity:0;background-color:#201f1f80;transition:opacity .15s ease-out}.rte-modal-backdrop[data-open=true]{opacity:1}.rte-modal-container{box-shadow:0 4px 8px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-3) 0%,var(--elevation-surface-shadow-3) 100%);border:none;box-sizing:border-box;position:absolute;max-height:90vh;top:50%;transform:translateY(-50%) scale(.98);display:flex;width:496px;padding:24px;flex-direction:column;align-items:flex-start;gap:24px;background-color:var(--background-default);border-radius:8px;opacity:0;transition:opacity .15s ease-in,transform .15s ease-in}.rte-modal-container[data-open=true]{opacity:1;transform:translateY(-50%) scale(1)}.rte-modal-container[data-size=s]{width:656px}.rte-modal-container[data-size=m]{width:936px}.rte-modal-container[data-size=l]{width:1168px;border-radius:12px}.rte-modal-container[data-size=xl]{width:1328px;border-radius:16px}.rte-modal-container .rte-modal-header{display:flex;flex-direction:column;gap:8px;width:100%;flex:0 0 auto}.rte-modal-container .rte-modal-header .rte-modal-header-text{display:flex;flex-direction:row;align-items:center;gap:8px}.rte-modal-container .rte-modal-header .rte-modal-header-text .rte-modal-title{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-weight:600;font-size:24px;line-height:32px;letter-spacing:-.5px;margin:0;overflow:hidden;color:var(--content-primary);text-overflow:ellipsis;flex:1 1 0}.rte-modal-container .rte-modal-content{display:flex;padding:1px;flex-direction:column;align-items:flex-start;gap:16px;color:var(--content-secondary);width:100%;overflow:auto}.rte-modal-container .rte-modal-content .rte-modal-content-description{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;margin:0;color:var(--content-secondary)}.rte-modal-container .rte-modal-footer{display:flex;padding:0;justify-content:flex-end;align-items:center;gap:24px;align-self:stretch;flex:0 0 auto}\n"] }]
|
|
2256
2518
|
}], ctorParameters: () => [] });
|
|
2257
2519
|
|
|
2258
2520
|
class ModalDirective {
|
|
@@ -2380,6 +2642,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2380
2642
|
}]
|
|
2381
2643
|
}] });
|
|
2382
2644
|
|
|
2645
|
+
class SearchbarComponent {
|
|
2646
|
+
constructor() {
|
|
2647
|
+
this.id = input();
|
|
2648
|
+
this.label = input("Rechercher");
|
|
2649
|
+
this.disabled = input(false);
|
|
2650
|
+
this.showResetButton = input(true);
|
|
2651
|
+
this.appearance = input("primary");
|
|
2652
|
+
this.compactSpacing = input(false);
|
|
2653
|
+
this.value = input("");
|
|
2654
|
+
this.assistiveText = input("");
|
|
2655
|
+
this.valueChange = output();
|
|
2656
|
+
this.searchEvent = output();
|
|
2657
|
+
this.clear = output();
|
|
2658
|
+
this.hasFocusWithin = signal(false);
|
|
2659
|
+
this.appearanceConfig = computed(() => APPEARANCE_CONFIG[this.appearance()]);
|
|
2660
|
+
this.placeholder = computed(() => (this.disabled() ? "Recherche indisponible" : this.label()));
|
|
2661
|
+
this.textInputStyles = computed(() => {
|
|
2662
|
+
const styles = {};
|
|
2663
|
+
const hasLeftIcon = this.appearanceConfig().showLeftIcon;
|
|
2664
|
+
if (this.appearance() === "primary") {
|
|
2665
|
+
styles["border-right"] = "none";
|
|
2666
|
+
styles["border-radius"] = `${SEARCHBAR_BORDER_RADIUS} 0 0 ${SEARCHBAR_BORDER_RADIUS}`;
|
|
2667
|
+
if (!hasLeftIcon) {
|
|
2668
|
+
styles["padding-left"] = SEARCHBAR_PADDING_LEFT;
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
else if (this.appearance() === "secondary") {
|
|
2672
|
+
styles["border-radius"] = SEARCHBAR_BORDER_RADIUS;
|
|
2673
|
+
}
|
|
2674
|
+
return styles;
|
|
2675
|
+
});
|
|
2676
|
+
this.searchButtonStyles = computed(() => {
|
|
2677
|
+
const styles = {
|
|
2678
|
+
width: SEARCHBAR_BUTTON_WIDTH,
|
|
2679
|
+
"border-radius": `0 ${SEARCHBAR_BORDER_RADIUS} ${SEARCHBAR_BORDER_RADIUS} 0`,
|
|
2680
|
+
display: "flex",
|
|
2681
|
+
"justify-content": "center",
|
|
2682
|
+
};
|
|
2683
|
+
if (this.compactSpacing()) {
|
|
2684
|
+
styles["height"] = SEARCHBAR_BUTTON_HEIGHT_COMPACT;
|
|
2685
|
+
}
|
|
2686
|
+
return styles;
|
|
2687
|
+
});
|
|
2688
|
+
}
|
|
2689
|
+
handleChange(value) {
|
|
2690
|
+
this.valueChange.emit(value);
|
|
2691
|
+
}
|
|
2692
|
+
handleSearch() {
|
|
2693
|
+
this.searchEvent.emit(this.value());
|
|
2694
|
+
}
|
|
2695
|
+
handleEnter(event) {
|
|
2696
|
+
if (event.key === ENTER_KEY) {
|
|
2697
|
+
this.handleSearch();
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
handleClear() {
|
|
2701
|
+
this.valueChange.emit("");
|
|
2702
|
+
this.clear.emit();
|
|
2703
|
+
}
|
|
2704
|
+
handleFocusIn() {
|
|
2705
|
+
this.hasFocusWithin.set(true);
|
|
2706
|
+
}
|
|
2707
|
+
handleFocusOut(event) {
|
|
2708
|
+
const next = event.relatedTarget;
|
|
2709
|
+
const currentTarget = event.currentTarget;
|
|
2710
|
+
if (next && currentTarget.contains(next)) {
|
|
2711
|
+
return;
|
|
2712
|
+
}
|
|
2713
|
+
this.hasFocusWithin.set(false);
|
|
2714
|
+
}
|
|
2715
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SearchbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2716
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SearchbarComponent, isStandalone: true, selector: "rte-searchbar", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showResetButton: { classPropertyName: "showResetButton", publicName: "showResetButton", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, assistiveText: { classPropertyName: "assistiveText", publicName: "assistiveText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", searchEvent: "searchEvent", clear: "clear" }, ngImport: i0, template: "<div class=\"searchbar-container\" role=\"search\" [ngClass]=\"appearance()\">\n <div\n class=\"text-input-wrapper\"\n [attr.data-disabled]=\"disabled()\"\n (focusin)=\"handleFocusIn()\"\n (focusout)=\"handleFocusOut($event)\"\n >\n <rte-base-text-input\n rightIconAction=\"clean\"\n autocomplete=\"off\"\n [id]=\"id() ?? ''\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [value]=\"value()\"\n [showRightIcon]=\"showResetButton()\"\n [assistiveTextLabel]=\"assistiveText()\"\n [compactSpacing]=\"compactSpacing()\"\n [leftIcon]=\"appearanceConfig().showLeftIcon ? 'search' : null\"\n [customStyle]=\"textInputStyles()\"\n [highlighted]=\"hasFocusWithin()\"\n (valueChange)=\"handleChange($event)\"\n (rightIconClick)=\"handleClear()\"\n >\n @if (appearanceConfig().showSearchButton) {\n <rte-icon-button\n baseTextInputRightSlot\n name=\"search\"\n size=\"m\"\n variant=\"primary\"\n appearance=\"filled\"\n class=\"search-button\"\n [ariaLabel]=\"label()\"\n [disabled]=\"disabled()\"\n [compactSpacing]=\"compactSpacing()\"\n [customStyle]=\"searchButtonStyles()\"\n (clickEvent)=\"handleSearch()\"\n />\n }\n </rte-base-text-input>\n </div>\n</div>\n", styles: [".searchbar-container{display:flex;flex-direction:column;width:fit-content}.text-input-wrapper{min-width:0;display:flex;align-items:stretch;border-radius:8px;transition:outline .2s,border .2s}.text-input-wrapper:focus-within{outline:1px solid var(--border-brand-default);outline-offset:0}.search-button{flex-shrink:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: BaseTextInputComponent, selector: "rte-base-text-input", inputs: ["id", "label", "labelPosition", "placeholder", "required", "showCounter", "value", "leftIcon", "showRightIcon", "rightIconAction", "showLabelRequirement", "assistiveAppearance", "showAssistiveIcon", "assistiveTextLabel", "error", "maxLength", "disabled", "readOnly", "width", "ariaLabel", "ariaRequired", "ariaLabelledby", "compactSpacing", "customStyle", "autocomplete", "highlighted"], outputs: ["valueChange", "rightIconClick"] }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon", "customStyle"], outputs: ["clickEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2717
|
+
}
|
|
2718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SearchbarComponent, decorators: [{
|
|
2719
|
+
type: Component,
|
|
2720
|
+
args: [{ selector: "rte-searchbar", imports: [CommonModule, BaseTextInputComponent, IconButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"searchbar-container\" role=\"search\" [ngClass]=\"appearance()\">\n <div\n class=\"text-input-wrapper\"\n [attr.data-disabled]=\"disabled()\"\n (focusin)=\"handleFocusIn()\"\n (focusout)=\"handleFocusOut($event)\"\n >\n <rte-base-text-input\n rightIconAction=\"clean\"\n autocomplete=\"off\"\n [id]=\"id() ?? ''\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [value]=\"value()\"\n [showRightIcon]=\"showResetButton()\"\n [assistiveTextLabel]=\"assistiveText()\"\n [compactSpacing]=\"compactSpacing()\"\n [leftIcon]=\"appearanceConfig().showLeftIcon ? 'search' : null\"\n [customStyle]=\"textInputStyles()\"\n [highlighted]=\"hasFocusWithin()\"\n (valueChange)=\"handleChange($event)\"\n (rightIconClick)=\"handleClear()\"\n >\n @if (appearanceConfig().showSearchButton) {\n <rte-icon-button\n baseTextInputRightSlot\n name=\"search\"\n size=\"m\"\n variant=\"primary\"\n appearance=\"filled\"\n class=\"search-button\"\n [ariaLabel]=\"label()\"\n [disabled]=\"disabled()\"\n [compactSpacing]=\"compactSpacing()\"\n [customStyle]=\"searchButtonStyles()\"\n (clickEvent)=\"handleSearch()\"\n />\n }\n </rte-base-text-input>\n </div>\n</div>\n", styles: [".searchbar-container{display:flex;flex-direction:column;width:fit-content}.text-input-wrapper{min-width:0;display:flex;align-items:stretch;border-radius:8px;transition:outline .2s,border .2s}.text-input-wrapper:focus-within{outline:1px solid var(--border-brand-default);outline-offset:0}.search-button{flex-shrink:0}\n"] }]
|
|
2721
|
+
}] });
|
|
2722
|
+
|
|
2383
2723
|
class BaseSideNavComponent {
|
|
2384
2724
|
constructor() {
|
|
2385
2725
|
this.cdr = inject(ChangeDetectorRef);
|
|
@@ -2668,7 +3008,6 @@ class ToastComponent {
|
|
|
2668
3008
|
this.onActionButtonClick = input(() => { });
|
|
2669
3009
|
this.close = output();
|
|
2670
3010
|
this.displayCustomIcon = computed(() => {
|
|
2671
|
-
console.log("iconName", this.iconName());
|
|
2672
3011
|
return this.showLeftIcon() && !!this.iconName();
|
|
2673
3012
|
});
|
|
2674
3013
|
this.displayLeftIcon = computed(() => {
|
|
@@ -2677,27 +3016,66 @@ class ToastComponent {
|
|
|
2677
3016
|
this.displayActionButton = computed(() => {
|
|
2678
3017
|
return this.showActionButton() && this.actionButtonLabel() && !!this.onActionButtonClick();
|
|
2679
3018
|
});
|
|
3019
|
+
this.shouldAutoDismiss = computed(() => {
|
|
3020
|
+
return this.isOpen() && this.autoDismiss() && (!this.actionButtonLabel() || !this.showActionButton());
|
|
3021
|
+
});
|
|
3022
|
+
this.timer = signal(null);
|
|
2680
3023
|
this.position = computed(() => this.placement()?.split("-")[0]);
|
|
2681
3024
|
this.alignment = computed(() => this.placement()?.split("-")[1]);
|
|
2682
3025
|
this.visible = signal(false);
|
|
2683
3026
|
this.defaultIconName = computed(() => IconTypeMap[this.type()]);
|
|
2684
3027
|
this.iconSize = IconSize["xl"];
|
|
2685
3028
|
}
|
|
3029
|
+
ngOnChanges(changes) {
|
|
3030
|
+
if (changes["isOpen"]) {
|
|
3031
|
+
if (this.shouldAutoDismiss()) {
|
|
3032
|
+
this.startTimer();
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
2686
3036
|
onClickActionButton() {
|
|
2687
3037
|
const action = this.onActionButtonClick();
|
|
2688
3038
|
if (action) {
|
|
2689
3039
|
action();
|
|
2690
3040
|
}
|
|
2691
3041
|
}
|
|
3042
|
+
handleMouseEnter() {
|
|
3043
|
+
if (this.timer()) {
|
|
3044
|
+
this.stopTimer();
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
handleMouseLeave() {
|
|
3048
|
+
if (this.shouldAutoDismiss()) {
|
|
3049
|
+
this.startTimer();
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
2692
3052
|
clickCloseButton() {
|
|
2693
3053
|
this.close.emit();
|
|
2694
3054
|
}
|
|
3055
|
+
startTimer() {
|
|
3056
|
+
this.stopTimer();
|
|
3057
|
+
const duration = this.duration();
|
|
3058
|
+
if (duration) {
|
|
3059
|
+
const timerId = setTimeout(() => {
|
|
3060
|
+
this.close.emit();
|
|
3061
|
+
this.stopTimer();
|
|
3062
|
+
}, ToastDurationMap[duration]);
|
|
3063
|
+
this.timer.set(timerId);
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
stopTimer() {
|
|
3067
|
+
const timer = this.timer();
|
|
3068
|
+
if (timer) {
|
|
3069
|
+
clearTimeout(timer);
|
|
3070
|
+
this.timer.set(null);
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
2695
3073
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2696
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ToastComponent, isStandalone: true, selector: "rte-toast", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, autoDismiss: { classPropertyName: "autoDismiss", publicName: "autoDismiss", isSignal: true, isRequired: false, transformFunction: null }, showActionButton: { classPropertyName: "showActionButton", publicName: "showActionButton", isSignal: true, isRequired: false, transformFunction: null }, iconName: { classPropertyName: "iconName", publicName: "iconName", isSignal: true, isRequired: false, transformFunction: null }, showLeftIcon: { classPropertyName: "showLeftIcon", publicName: "showLeftIcon", isSignal: true, isRequired: false, transformFunction: null }, actionButtonLabel: { classPropertyName: "actionButtonLabel", publicName: "actionButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, onActionButtonClick: { classPropertyName: "onActionButtonClick", publicName: "onActionButtonClick", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close" }, ngImport: i0, template: "<div\n class=\"rte-toast {{ type() }} {{ position() }} {{ alignment() }}\"\n role=\"status\"\n
|
|
3074
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ToastComponent, isStandalone: true, selector: "rte-toast", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, autoDismiss: { classPropertyName: "autoDismiss", publicName: "autoDismiss", isSignal: true, isRequired: false, transformFunction: null }, showActionButton: { classPropertyName: "showActionButton", publicName: "showActionButton", isSignal: true, isRequired: false, transformFunction: null }, iconName: { classPropertyName: "iconName", publicName: "iconName", isSignal: true, isRequired: false, transformFunction: null }, showLeftIcon: { classPropertyName: "showLeftIcon", publicName: "showLeftIcon", isSignal: true, isRequired: false, transformFunction: null }, actionButtonLabel: { classPropertyName: "actionButtonLabel", publicName: "actionButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, onActionButtonClick: { classPropertyName: "onActionButtonClick", publicName: "onActionButtonClick", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"rte-toast {{ type() }} {{ position() }} {{ alignment() }}\"\n role=\"status\"\n [ngClass]=\"{ open: isOpen() }\"\n (mouseenter)=\"handleMouseEnter()\"\n (mouseleave)=\"handleMouseLeave()\"\n>\n <div class=\"rte-toast-content\">\n @if (displayLeftIcon()) {\n <rte-icon class=\"rte-toast-icon\" aria-hidden=\"true\" [name]=\"defaultIconName()\" [size]=\"iconSize\" />\n } @else {\n @if (displayCustomIcon()) {\n <rte-icon class=\"rte-toast-icon\" aria-hidden=\"true\" [name]=\"iconName()!\" [size]=\"iconSize\" />\n }\n }\n <span class=\"rte-toast-message\">{{ message() }}</span>\n </div>\n @if (displayActionButton()) {\n <button rteButton rteButtonVariant=\"text\" class=\"rte-toast-action-button\" (click)=\"onClickActionButton()\">\n {{ actionButtonLabel() }}\n </button>\n }\n @if (closable()) {\n <rte-icon-button\n name=\"close\"\n [attr.data-testid]=\"'toast-close-button'\"\n [variant]=\"type() === 'neutral' ? 'reverse' : 'neutral'\"\n (clickEvent)=\"clickCloseButton()\"\n />\n }\n</div>\n", styles: [".rte-toast{box-shadow:0 2px 4px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);display:flex;width:400px;min-width:240px;max-width:336px;padding:8px 4px 8px 16px;align-items:center;border-radius:4px;border-bottom:4px solid var(--border-info);color:var(--content-primary);background-color:var(--background-default);z-index:10;position:fixed;inset:auto;opacity:0;transition:opacity .3s ease,transform .2s ease}.rte-toast.top{top:12px}.rte-toast.bottom{bottom:12px}.rte-toast.bottom.center{left:50%;transform:translate(-50%,10px)}.rte-toast.bottom.center.open{opacity:1;transform:translate(-50%)}.rte-toast.left{left:12px;transform:translate(-10px)}.rte-toast.left.open{opacity:1;transform:translate(0)}.rte-toast.right{right:12px;transform:translate(10px)}.rte-toast.right.open{opacity:1;transform:translate(0)}.rte-toast .rte-toast-message{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;width:100%;-webkit-line-clamp:2;line-clamp:2}.rte-toast .rte-toast-icon{flex:1 0 auto}.rte-toast .rte-toast-content{display:flex;align-items:center;gap:12px;flex-grow:1;overflow:hidden;width:100%}.rte-toast.info{border-bottom-color:var(--border-info)}.rte-toast.info .rte-toast-icon{color:var(--content-info-default)}.rte-toast.error{border-bottom-color:var(--border-danger)}.rte-toast.error .rte-toast-icon{color:var(--content-danger-default)}.rte-toast.success{border-bottom-color:var(--border-success)}.rte-toast.success .rte-toast-icon{color:var(--content-success-default)}.rte-toast.warning{border-bottom-color:var(--border-warning)}.rte-toast.warning .rte-toast-icon{color:var(--content-warning-default)}.rte-toast.neutral{background-color:var(--background-inverse);color:var(--content-primary-inverse);border-bottom-color:var(--border-primary)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon", "customStyle"], outputs: ["clickEvent"] }, { kind: "component", type: ButtonComponent, selector: "button[rteButton]", inputs: ["rteButtonVariant", "rteButtonSize", "rteBadgeCount", "rteBadgeContent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2697
3075
|
}
|
|
2698
3076
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToastComponent, decorators: [{
|
|
2699
3077
|
type: Component,
|
|
2700
|
-
args: [{ selector: "rte-toast", imports: [CommonModule, IconComponent, IconButtonComponent, ButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"rte-toast {{ type() }} {{ position() }} {{ alignment() }}\"\n role=\"status\"\n
|
|
3078
|
+
args: [{ selector: "rte-toast", imports: [CommonModule, IconComponent, IconButtonComponent, ButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"rte-toast {{ type() }} {{ position() }} {{ alignment() }}\"\n role=\"status\"\n [ngClass]=\"{ open: isOpen() }\"\n (mouseenter)=\"handleMouseEnter()\"\n (mouseleave)=\"handleMouseLeave()\"\n>\n <div class=\"rte-toast-content\">\n @if (displayLeftIcon()) {\n <rte-icon class=\"rte-toast-icon\" aria-hidden=\"true\" [name]=\"defaultIconName()\" [size]=\"iconSize\" />\n } @else {\n @if (displayCustomIcon()) {\n <rte-icon class=\"rte-toast-icon\" aria-hidden=\"true\" [name]=\"iconName()!\" [size]=\"iconSize\" />\n }\n }\n <span class=\"rte-toast-message\">{{ message() }}</span>\n </div>\n @if (displayActionButton()) {\n <button rteButton rteButtonVariant=\"text\" class=\"rte-toast-action-button\" (click)=\"onClickActionButton()\">\n {{ actionButtonLabel() }}\n </button>\n }\n @if (closable()) {\n <rte-icon-button\n name=\"close\"\n [attr.data-testid]=\"'toast-close-button'\"\n [variant]=\"type() === 'neutral' ? 'reverse' : 'neutral'\"\n (clickEvent)=\"clickCloseButton()\"\n />\n }\n</div>\n", styles: [".rte-toast{box-shadow:0 2px 4px 0 var(--elevation-shadow-key),0 0 2px 0 var(--elevation-shadow-ambient);background:linear-gradient(0deg,var(--elevation-surface-shadow-2) 0%,var(--elevation-surface-shadow-2) 100%);display:flex;width:400px;min-width:240px;max-width:336px;padding:8px 4px 8px 16px;align-items:center;border-radius:4px;border-bottom:4px solid var(--border-info);color:var(--content-primary);background-color:var(--background-default);z-index:10;position:fixed;inset:auto;opacity:0;transition:opacity .3s ease,transform .2s ease}.rte-toast.top{top:12px}.rte-toast.bottom{bottom:12px}.rte-toast.bottom.center{left:50%;transform:translate(-50%,10px)}.rte-toast.bottom.center.open{opacity:1;transform:translate(-50%)}.rte-toast.left{left:12px;transform:translate(-10px)}.rte-toast.left.open{opacity:1;transform:translate(0)}.rte-toast.right{right:12px;transform:translate(10px)}.rte-toast.right.open{opacity:1;transform:translate(0)}.rte-toast .rte-toast-message{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;width:100%;-webkit-line-clamp:2;line-clamp:2}.rte-toast .rte-toast-icon{flex:1 0 auto}.rte-toast .rte-toast-content{display:flex;align-items:center;gap:12px;flex-grow:1;overflow:hidden;width:100%}.rte-toast.info{border-bottom-color:var(--border-info)}.rte-toast.info .rte-toast-icon{color:var(--content-info-default)}.rte-toast.error{border-bottom-color:var(--border-danger)}.rte-toast.error .rte-toast-icon{color:var(--content-danger-default)}.rte-toast.success{border-bottom-color:var(--border-success)}.rte-toast.success .rte-toast-icon{color:var(--content-success-default)}.rte-toast.warning{border-bottom-color:var(--border-warning)}.rte-toast.warning .rte-toast-icon{color:var(--content-warning-default)}.rte-toast.neutral{background-color:var(--background-inverse);color:var(--content-primary-inverse);border-bottom-color:var(--border-primary)}\n"] }]
|
|
2701
3079
|
}] });
|
|
2702
3080
|
|
|
2703
3081
|
class ToastService {
|
|
@@ -2845,9 +3223,522 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2845
3223
|
args: [{ selector: "rte-tag", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"rte-tag\"\n [attr.data-tag-type]=\"tagType()\"\n [attr.data-status]=\"status()\"\n [attr.data-color]=\"color()\"\n [attr.data-compact-spacing]=\"compactSpacing()\"\n>\n <ng-container *ngIf=\"isValidIconName() && (tagType() === 'status' || showLeftIcon())\">\n <rte-icon [name]=\"computedIconName()\" [size]=\"16\"></rte-icon>\n </ng-container>\n <ng-container *ngIf=\"label\">\n <label class=\"tag-label\" [attr.data-compact-spacing]=\"compactSpacing()\">{{ label() }}</label>\n </ng-container>\n</div>\n", styles: [".rte-tag{height:32px;display:inline-flex;padding:4px 6px;justify-content:center;align-items:center;gap:0px;border-radius:4px;text-wrap:nowrap}.rte-tag[data-compact-spacing=true]{padding:0 6px;height:24px}.rte-tag .tag-label{padding:0 6px;font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:16px;line-height:24px;letter-spacing:0px;color:var(--content-status)}.rte-tag .tag-label[data-compact-spacing=true]{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px}.rte-tag[data-tag-type=status][data-status=success],.rte-tag[data-tag-type=status][data-status=information],.rte-tag[data-tag-type=status][data-status=alert]{color:var(--content-primary-inverse)}.rte-tag[data-tag-type=status][data-status=success]{background-color:var(--background-success-default)}.rte-tag[data-tag-type=status][data-status=information]{background-color:var(--background-info-default)}.rte-tag[data-tag-type=status][data-status=warning]{background-color:var(--background-warning-default)}.rte-tag[data-tag-type=status][data-status=alert]{background-color:var(--background-danger-default)}.rte-tag[data-tag-type=decorative][data-color=brand]{background-color:var(--background-brand-default)}.rte-tag[data-tag-type=decorative][data-color=neutral]{background-color:var(--decorative-neutral)}.rte-tag[data-tag-type=decorative][data-color=azur]{background-color:var(--decorative-bleu-iceberg)}.rte-tag[data-tag-type=decorative][data-color=jade]{background-color:var(--decorative-vert-foret)}.rte-tag[data-tag-type=decorative][data-color=lavande]{background-color:var(--decorative-violet)}.rte-tag[data-tag-type=decorative][data-color=ciel]{background-color:var(--decorative-bleu-rte)}.rte-tag[data-tag-type=decorative][data-color=nuage]{background-color:var(--decorative-bleu-digital)}.rte-tag[data-tag-type=decorative][data-color=givre]{background-color:var(--decorative-marine)}.rte-tag[data-tag-type=decorative][data-color=brume]{background-color:var(--decorative-bleu-petrole)}.rte-tag[data-tag-type=decorative][data-color=glacier]{background-color:var(--decorative-bleu-cyan)}.rte-tag[data-tag-type=decorative][data-color=turquoise]{background-color:var(--decorative-vert)}.rte-tag[data-tag-type=decorative][data-color=anis]{background-color:var(--decorative-vert-indications)}.rte-tag[data-tag-type=decorative][data-color=menthe]{background-color:var(--decorative-vert-digital)}.rte-tag[data-tag-type=decorative][data-color=citronnelle]{background-color:var(--decorative-jaune)}.rte-tag[data-tag-type=decorative][data-color=sable]{background-color:var(--decorative-jaune-ocre)}.rte-tag[data-tag-type=decorative][data-color=abricot]{background-color:var(--decorative-jaune-indications)}.rte-tag[data-tag-type=decorative][data-color=coral]{background-color:var(--decorative-saumon)}.rte-tag[data-tag-type=decorative][data-color=rose]{background-color:var(--decorative-rose-digital)}.rte-tag[data-tag-type=decorative][data-color=petale]{background-color:var(--decorative-fuschia)}.rte-tag[data-tag-type=decorative][data-color=quartz]{background-color:var(--decorative-rouge-indication)}.rte-tag[data-tag-type=decorative][data-color=cendre]{background-color:var(--decorative-taupe)}.rte-tag[data-tag-type=decorative][data-color=brand],.rte-tag[data-tag-type=decorative][data-color=brand] .tag-label{color:var(--content-primary-inverse)}\n"] }]
|
|
2846
3224
|
}] });
|
|
2847
3225
|
|
|
3226
|
+
class AssistiveTextComponent {
|
|
3227
|
+
constructor() {
|
|
3228
|
+
this.label = input();
|
|
3229
|
+
this.appearance = input("description");
|
|
3230
|
+
this.showIcon = input(false);
|
|
3231
|
+
this.href = input();
|
|
3232
|
+
this.width = input();
|
|
3233
|
+
this.isLink = computed(() => {
|
|
3234
|
+
return this.appearance() === "link" && this.href() !== undefined;
|
|
3235
|
+
});
|
|
3236
|
+
this.widthStyle = computed(() => {
|
|
3237
|
+
return `${this.width()}px`;
|
|
3238
|
+
});
|
|
3239
|
+
this.assistiveTextIconSize = ASSISTIVE_TEXT_ICON_SIZE;
|
|
3240
|
+
this.iconName = computed(() => {
|
|
3241
|
+
return getIconNameFromAppearance(this.appearance());
|
|
3242
|
+
});
|
|
3243
|
+
}
|
|
3244
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AssistiveTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3245
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: AssistiveTextComponent, isStandalone: true, selector: "rte-assistive-text", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"rte-assistive-text {{ appearance() }}\" [ngStyle]=\"{ width: widthStyle() }\">\n <rte-icon\n *ngIf=\"showIcon() && iconName()\"\n class=\"assistive-icon-{{ appearance() }}\"\n [name]=\"iconName()!\"\n [size]=\"assistiveTextIconSize\"\n ></rte-icon>\n @if (isLink()) {\n <rte-link class=\"assistive-text-link\" [externalLink]=\"true\" [href]=\"href() || ''\" [label]=\"label() || ''\">\n </rte-link>\n } @else {\n <span>{{ label() }}</span>\n }\n</div>\n", styles: [".rte-assistive-text{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;display:flex;align-items:center;gap:4px;padding:4px 8px;color:var(--content-secondary)}.rte-assistive-text.error{color:var(--content-danger-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.rte-assistive-text.success{color:var(--content-success-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.rte-assistive-text.description{color:var(--content-tertiary);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: LinkComponent, selector: "rte-link", inputs: ["label", "href", "subtle", "externalLink", "reverse", "maxWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3246
|
+
}
|
|
3247
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AssistiveTextComponent, decorators: [{
|
|
3248
|
+
type: Component,
|
|
3249
|
+
args: [{ selector: "rte-assistive-text", imports: [CommonModule, IconComponent, LinkComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"rte-assistive-text {{ appearance() }}\" [ngStyle]=\"{ width: widthStyle() }\">\n <rte-icon\n *ngIf=\"showIcon() && iconName()\"\n class=\"assistive-icon-{{ appearance() }}\"\n [name]=\"iconName()!\"\n [size]=\"assistiveTextIconSize\"\n ></rte-icon>\n @if (isLink()) {\n <rte-link class=\"assistive-text-link\" [externalLink]=\"true\" [href]=\"href() || ''\" [label]=\"label() || ''\">\n </rte-link>\n } @else {\n <span>{{ label() }}</span>\n }\n</div>\n", styles: [".rte-assistive-text{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;display:flex;align-items:center;gap:4px;padding:4px 8px;color:var(--content-secondary)}.rte-assistive-text.error{color:var(--content-danger-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.rte-assistive-text.success{color:var(--content-success-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.rte-assistive-text.description{color:var(--content-tertiary);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}\n"] }]
|
|
3250
|
+
}] });
|
|
3251
|
+
|
|
3252
|
+
class SelectComponent {
|
|
3253
|
+
constructor() {
|
|
3254
|
+
this.id = input();
|
|
3255
|
+
this.name = input();
|
|
3256
|
+
this.ariaLabelledby = input();
|
|
3257
|
+
this.label = input();
|
|
3258
|
+
this.labelId = input();
|
|
3259
|
+
this.labelPosition = input("top");
|
|
3260
|
+
this.assistiveTextLabel = input();
|
|
3261
|
+
this.assistiveTextAppearance = input("description");
|
|
3262
|
+
this.assistiveTextLink = input();
|
|
3263
|
+
this.required = input(false);
|
|
3264
|
+
this.showLabelRequirement = input(false);
|
|
3265
|
+
this.disabled = input(false);
|
|
3266
|
+
this.readOnly = input(false);
|
|
3267
|
+
this.value = input();
|
|
3268
|
+
this.options = input([]);
|
|
3269
|
+
this.isError = input(false);
|
|
3270
|
+
this.showAssistiveIcon = input(false);
|
|
3271
|
+
this.showResetButton = input(false);
|
|
3272
|
+
this.width = input(MIN_SELECT_WIDTH);
|
|
3273
|
+
this.selectRef = viewChild("selectRef");
|
|
3274
|
+
this.buttonsContainerRef = viewChild("buttonsContainerRef");
|
|
3275
|
+
this.selectDropdownOffset = SELECT_DROPDOWN_OFFSET;
|
|
3276
|
+
this.computedWidth = computed(() => {
|
|
3277
|
+
return `${this.width()}px`;
|
|
3278
|
+
});
|
|
3279
|
+
this.clearButton = computed(() => {
|
|
3280
|
+
return this.buttonsContainerRef()?.nativeElement.querySelector(".rte-icon-button.clear-button");
|
|
3281
|
+
});
|
|
3282
|
+
this.dropdownPosition = computed(() => {
|
|
3283
|
+
const selectElement = this.selectRef()?.nativeElement;
|
|
3284
|
+
if (selectElement) {
|
|
3285
|
+
const rect = selectElement.getBoundingClientRect();
|
|
3286
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
3287
|
+
return spaceBelow >= THRESHOLD_BOTTOM_POSITION ? "bottom" : "top";
|
|
3288
|
+
}
|
|
3289
|
+
return "bottom";
|
|
3290
|
+
});
|
|
3291
|
+
this.internalValue = signal(this.value());
|
|
3292
|
+
this.requirementIndicatorValue = computed(() => this.required()
|
|
3293
|
+
? this.showLabelRequirement()
|
|
3294
|
+
? REQUIREMENT_INDICATOR_VALUE.required
|
|
3295
|
+
: REQUIREMENT_INDICATOR_VALUE.requiredIcon
|
|
3296
|
+
: REQUIREMENT_INDICATOR_VALUE.optional);
|
|
3297
|
+
this.valueChange = output();
|
|
3298
|
+
this.currentOptionLabel = computed(() => {
|
|
3299
|
+
return this.options().find((option) => option.value === this.internalValue())?.label;
|
|
3300
|
+
});
|
|
3301
|
+
this.isAssistiveTextLinkVisible = computed(() => {
|
|
3302
|
+
return this.assistiveTextAppearance() === "link" && this.assistiveTextLink() !== undefined;
|
|
3303
|
+
});
|
|
3304
|
+
this.formattedOptions = computed(() => {
|
|
3305
|
+
return this.options().map(({ value, label }) => ({
|
|
3306
|
+
id: value,
|
|
3307
|
+
label: label,
|
|
3308
|
+
selected: value === this.internalValue(),
|
|
3309
|
+
}));
|
|
3310
|
+
});
|
|
3311
|
+
this.shouldDisplayClearButton = computed(() => this.showResetButton() && !!this.internalValue() && !this.disabled());
|
|
3312
|
+
this.shouldDisplayErrorIcon = computed(() => this.isError() && !this.disabled() && !this.readOnly());
|
|
3313
|
+
this.isActive = signal(false);
|
|
3314
|
+
this.selectWidth = computed(() => {
|
|
3315
|
+
const nativeElement = this.selectRef()?.nativeElement;
|
|
3316
|
+
if (nativeElement) {
|
|
3317
|
+
return nativeElement.getBoundingClientRect().width;
|
|
3318
|
+
}
|
|
3319
|
+
return null;
|
|
3320
|
+
});
|
|
3321
|
+
}
|
|
3322
|
+
handleOnClickTrigger() {
|
|
3323
|
+
if (this.readOnly() || this.disabled()) {
|
|
3324
|
+
return;
|
|
3325
|
+
}
|
|
3326
|
+
this.toggleDropdown();
|
|
3327
|
+
}
|
|
3328
|
+
handleOnKeyDownTrigger(event) {
|
|
3329
|
+
if (this.readOnly() || this.disabled()) {
|
|
3330
|
+
return;
|
|
3331
|
+
}
|
|
3332
|
+
if (this.shouldDisplayClearButton()) {
|
|
3333
|
+
const clearButton = this.buttonsContainerRef()?.nativeElement.children[0].children[0];
|
|
3334
|
+
const isClearButtonFocused = document.activeElement === clearButton;
|
|
3335
|
+
if (isClearButtonFocused && (event.key === SPACE_KEY || event.key === ENTER_KEY)) {
|
|
3336
|
+
this.clearSelection(event);
|
|
3337
|
+
return;
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
if (event.key === SPACE_KEY || event.key === ENTER_KEY) {
|
|
3341
|
+
this.toggleDropdown();
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
handleOnClickClearButton(event) {
|
|
3345
|
+
if (this.readOnly() || this.disabled()) {
|
|
3346
|
+
return;
|
|
3347
|
+
}
|
|
3348
|
+
event.preventDefault();
|
|
3349
|
+
this.clearSelection(event);
|
|
3350
|
+
}
|
|
3351
|
+
handleOnClickItem(id) {
|
|
3352
|
+
if (this.readOnly() || this.disabled()) {
|
|
3353
|
+
return;
|
|
3354
|
+
}
|
|
3355
|
+
this.internalValue.set(id);
|
|
3356
|
+
const event = new CustomEvent("change", {
|
|
3357
|
+
bubbles: true,
|
|
3358
|
+
detail: { target: { value: id } },
|
|
3359
|
+
});
|
|
3360
|
+
this.valueChange.emit(event);
|
|
3361
|
+
this.isActive.set(!this.isActive());
|
|
3362
|
+
this.selectRef()?.nativeElement.focus();
|
|
3363
|
+
}
|
|
3364
|
+
handleOnClosingDropdown() {
|
|
3365
|
+
this.isActive.set(false);
|
|
3366
|
+
}
|
|
3367
|
+
handleOnClickOutside() {
|
|
3368
|
+
this.isActive.set(false);
|
|
3369
|
+
}
|
|
3370
|
+
toggleDropdown() {
|
|
3371
|
+
this.isActive.set(!this.isActive());
|
|
3372
|
+
if (this.isActive()) {
|
|
3373
|
+
this.selectRef()?.nativeElement.dispatchEvent(new Event("openDropdown"));
|
|
3374
|
+
}
|
|
3375
|
+
else {
|
|
3376
|
+
this.selectRef()?.nativeElement.dispatchEvent(new Event("closeDropdown"));
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
clearSelection(event) {
|
|
3380
|
+
this.internalValue.set(undefined);
|
|
3381
|
+
this.isActive.set(false);
|
|
3382
|
+
this.valueChange.emit(event);
|
|
3383
|
+
this.selectRef()?.nativeElement.dispatchEvent(new Event("clearContent"));
|
|
3384
|
+
}
|
|
3385
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3386
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: SelectComponent, isStandalone: true, selector: "rte-select", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelId: { classPropertyName: "labelId", publicName: "labelId", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, assistiveTextLabel: { classPropertyName: "assistiveTextLabel", publicName: "assistiveTextLabel", isSignal: true, isRequired: false, transformFunction: null }, assistiveTextAppearance: { classPropertyName: "assistiveTextAppearance", publicName: "assistiveTextAppearance", isSignal: true, isRequired: false, transformFunction: null }, assistiveTextLink: { classPropertyName: "assistiveTextLink", publicName: "assistiveTextLink", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, showLabelRequirement: { classPropertyName: "showLabelRequirement", publicName: "showLabelRequirement", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, isError: { classPropertyName: "isError", publicName: "isError", isSignal: true, isRequired: false, transformFunction: null }, showAssistiveIcon: { classPropertyName: "showAssistiveIcon", publicName: "showAssistiveIcon", isSignal: true, isRequired: false, transformFunction: null }, showResetButton: { classPropertyName: "showResetButton", publicName: "showResetButton", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, providers: [
|
|
3387
|
+
{
|
|
3388
|
+
provide: NG_VALUE_ACCESSOR,
|
|
3389
|
+
useExisting: SelectComponent,
|
|
3390
|
+
multi: true,
|
|
3391
|
+
},
|
|
3392
|
+
], viewQueries: [{ propertyName: "selectRef", first: true, predicate: ["selectRef"], descendants: true, isSignal: true }, { propertyName: "buttonsContainerRef", first: true, predicate: ["buttonsContainerRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"rte-select-container\" [attr.data-label-position]=\"labelPosition()\">\n <label\n *ngIf=\"label() && labelPosition() === 'side'\"\n class=\"rte-select-label\"\n [attr.data-label-position]=\"labelPosition()\"\n [attr.id]=\"labelId()\"\n [attr.for]=\"id()\"\n >{{ label()\n }}<span\n *ngIf=\"required() || showLabelRequirement()\"\n class=\"requirement-indicator\"\n aria-hidden=\"true\"\n [ngClass]=\"{\n required: required(),\n 'show-label-requirement': showLabelRequirement(),\n }\"\n >{{ requirementIndicatorValue() }}</span\n ></label\n >\n\n <div class=\"rte-select-header\" [attr.data-label-position]=\"labelPosition()\">\n <label *ngIf=\"label() && labelPosition() === 'top'\" class=\"rte-select-label\" [attr.id]=\"labelId()\" [attr.for]=\"id()\"\n >{{ label()\n }}<span\n *ngIf=\"required() || showLabelRequirement()\"\n class=\"requirement-indicator\"\n aria-hidden=\"true\"\n [ngClass]=\"{\n required: required(),\n 'show-label-requirement': showLabelRequirement(),\n }\"\n >{{ requirementIndicatorValue() }}</span\n ></label\n >\n </div>\n <div\n rteDropdown\n [rteDropdownId]=\"'dropdown_select_' + id()\"\n [rteDropdownPosition]=\"dropdownPosition()\"\n [rteDropdownOffset]=\"selectDropdownOffset\"\n [rteDropdownWidth]=\"selectWidth()\"\n (menuEvent)=\"handleOnClickItem($event.id)\"\n (clickedOutside)=\"handleOnClickOutside()\"\n (closedDropdown)=\"handleOnClosingDropdown()\"\n >\n <div\n #selectRef\n rteDropdownTrigger\n class=\"rte-select-wrapper\"\n [attr.tabIndex]=\"disabled() || readOnly() ? -1 : 0\"\n [attr.role]=\"'combobox'\"\n [attr.data-error]=\"isError()\"\n [attr.data-disabled]=\"disabled()\"\n [attr.data-read-only]=\"readOnly()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-readonly]=\"readOnly()\"\n [attr.aria-labelledby]=\"labelId()\"\n [attr.aria-expanded]=\"isActive()\"\n [attr.data-active]=\"isActive()\"\n [ngStyle]=\"{ width: computedWidth() }\"\n (dropdownTriggered)=\"handleOnClickTrigger()\"\n (dropdownKeyDown)=\"handleOnKeyDownTrigger($event)\"\n >\n <div class=\"rte-select-content\">\n <rte-icon *ngIf=\"shouldDisplayErrorIcon()\" name=\"error\" class=\"error-icon\" />\n <div class=\"rte-select-value\">\n <span>{{ currentOptionLabel() }}</span>\n </div>\n <div #buttonsContainerRef class=\"rte-select-right-icons\">\n <rte-icon-button\n *ngIf=\"shouldDisplayClearButton()\"\n name=\"cancel\"\n variant=\"neutral\"\n class=\"rte-select-icon-button clear-icon\"\n [disabled]=\"disabled()\"\n (clickEvent)=\"handleOnClickClearButton($event)\"\n />\n <rte-icon\n class=\"trigger-icon trigger-icon-{{ isActive() ? 'up' : 'down' }}\"\n variant=\"neutral\"\n [name]=\"isActive() ? 'arrow-chevron-up' : 'arrow-chevron-down'\"\n />\n </div>\n </div>\n </div>\n <rte-dropdown-menu [items]=\"formattedOptions()\" />\n <rte-assistive-text\n *ngIf=\"assistiveTextLabel()\"\n [label]=\"assistiveTextLabel()\"\n [appearance]=\"isError() ? 'error' : assistiveTextAppearance()!\"\n [showIcon]=\"showAssistiveIcon()\"\n [href]=\"assistiveTextLink()\"\n [width]=\"width()\"\n />\n </div>\n</div>\n", styles: [".rte-select-container{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;display:flex;flex-direction:column}.rte-select-container[data-label-position=side]{flex-direction:row;align-self:start}.rte-select-container[data-label-position=side] .rte-select-header{display:flex;flex-direction:column}.rte-select-container[data-label-position=side] .rte-select-label{height:32px;padding:0 8px}.rte-select-container .rte-select-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;display:flex;padding:2px 8px;color:var(--content-secondary);justify-content:space-between;white-space:normal;overflow-wrap:normal;word-break:normal}.rte-select-container .rte-select-label .requirement-indicator{margin-left:2px}.rte-select-container .rte-select-label .requirement-indicator.show-label-requirement{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;color:var(--content-tertiary)}.rte-select-container .rte-select-label .requirement-indicator.show-label-requirement:not(.required){font-style:italic}.rte-select-container .rte-select-label .requirement-indicator:not(.show-label-requirement).required{color:var(--content-danger-default)}.rte-select-container .rte-select-wrapper{box-shadow:inset 0 1px 4px 0 var(--elevation-shadow-key);background:linear-gradient(0deg,var(--elevation-surface-inner-shadow) 0%,var(--elevation-surface-inner-shadow) 100%);display:flex;min-width:112px;min-height:32px;max-height:32px;align-items:center;align-self:stretch;border-radius:4px;border:1px solid var(--border-secondary);box-sizing:border-box}.rte-select-container .rte-select-wrapper .trigger-icon{color:var(--content-tertiary)}.rte-select-container .rte-select-wrapper:hover{border-color:var(--border-primary);cursor:pointer}.rte-select-container .rte-select-wrapper:focus-visible,.rte-select-container .rte-select-wrapper[data-active=true]{border-color:var(--border-brand-default);outline:1px solid var(--border-brand-default)}.rte-select-container .rte-select-wrapper[data-error=true]{border-color:var(--border-danger);outline:1px solid var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-disabled=true]{color:var(--content-disabled);border-color:var(--border-danger);outline:1px solid var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-disabled=true]:hover{border-color:var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-read-only=true]{color:var(--content-tertiary);border-color:var(--border-danger);outline:1px solid var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-read-only=true]:hover{cursor:default;border-color:var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-read-only=true] .rte-select-content .rte-select-value{color:var(--content-tertiary)}.rte-select-container .rte-select-wrapper[data-error=true]:hover{border-color:var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true]:focus-visible{border-color:var(--border-danger);outline:1px solid var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true] .rte-select-content .rte-select-value{color:var(--content-secondary)}.rte-select-container .rte-select-wrapper[data-disabled=true]{color:var(--content-disabled);background-color:var(--background-disabled);border-color:var(--border-disabled)}.rte-select-container .rte-select-wrapper[data-disabled=true]:hover{cursor:not-allowed}.rte-select-container .rte-select-wrapper[data-disabled=true] .trigger-icon,.rte-select-container .rte-select-wrapper[data-disabled=true] .rte-select-content .rte-select-value{color:var(--content-disabled)}.rte-select-container .rte-select-wrapper[data-read-only=true]{color:var(--content-tertiary);background-color:var(--background-disabled);border-color:var(--border-tertiary)}.rte-select-container .rte-select-wrapper[data-read-only=true]:hover{cursor:default}.rte-select-container .rte-select-wrapper[data-read-only=true] .trigger-icon{color:var(--content-tertiary)}.rte-select-container .rte-select-wrapper .rte-select-content{display:flex;min-width:96px;padding:4px 8px;align-items:center;flex:1 0 0}.rte-select-container .rte-select-wrapper .rte-select-content .error-icon{padding:0;color:var(--content-danger-default)}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-value{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;display:flex;padding:0 8px;align-items:center;flex:1 0 0;text-overflow:ellipsis;overflow:hidden;color:var(--content-primary)}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-value span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-right-icons{display:flex;align-items:center;gap:8px}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-right-icons ::ng-deep .rte-icon-button{padding:0;height:20px;width:20px}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-right-icons ::ng-deep .rte-icon-button:focus-visible{outline:1px solid var(--border-brand-focused);border-radius:2px;outline-offset:3px}.rte-select-container .assistive-text{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;display:flex;align-items:center;gap:4px;padding:4px 8px;color:var(--content-secondary)}.rte-select-container .assistive-text .assistive-icon-error{color:var(--content-danger-default)}.rte-select-container .assistive-text .assistive-icon-success{color:var(--content-success-default)}.rte-select-container .assistive-text.error{color:var(--content-danger-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.rte-select-container .assistive-text.success{color:var(--content-success-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: DropdownDirective, selector: "[rteDropdown]", inputs: ["rteDropdownId", "rteDropdownPosition", "rteDropdownAlignment", "rteDropdownIsOpen", "rteDropdownOffset", "rteDropdownAutofocus", "rteDropdownAutoOpen", "rteDropdownWidth"], outputs: ["menuEvent", "clickedOutside", "closedDropdown"] }, { kind: "directive", type: DropdownTriggerDirective, selector: "[rteDropdownTrigger]", inputs: ["rteDropdownTriggerActivateWithArrowDown"], outputs: ["dropdownKeyDown", "dropdownTriggered", "dropdownTriggerFocus", "dropdownTriggerClearContent", "dropdownTriggerOpenDropdown", "dropdownTriggerCloseDropdown"] }, { kind: "component", type: DropdownMenuComponent, selector: "rte-dropdown-menu", inputs: ["items", "menuId", "isOpen", "width", "headerTemplate", "footerTemplate"], outputs: ["itemEvent", "closingMenu"] }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon", "customStyle"], outputs: ["clickEvent"] }, { kind: "component", type: AssistiveTextComponent, selector: "rte-assistive-text", inputs: ["label", "appearance", "showIcon", "href", "width"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3393
|
+
}
|
|
3394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectComponent, decorators: [{
|
|
3395
|
+
type: Component,
|
|
3396
|
+
args: [{ selector: "rte-select", imports: [CommonModule, IconComponent, DropdownModule, IconButtonComponent, AssistiveTextComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
3397
|
+
{
|
|
3398
|
+
provide: NG_VALUE_ACCESSOR,
|
|
3399
|
+
useExisting: SelectComponent,
|
|
3400
|
+
multi: true,
|
|
3401
|
+
},
|
|
3402
|
+
], template: "<div class=\"rte-select-container\" [attr.data-label-position]=\"labelPosition()\">\n <label\n *ngIf=\"label() && labelPosition() === 'side'\"\n class=\"rte-select-label\"\n [attr.data-label-position]=\"labelPosition()\"\n [attr.id]=\"labelId()\"\n [attr.for]=\"id()\"\n >{{ label()\n }}<span\n *ngIf=\"required() || showLabelRequirement()\"\n class=\"requirement-indicator\"\n aria-hidden=\"true\"\n [ngClass]=\"{\n required: required(),\n 'show-label-requirement': showLabelRequirement(),\n }\"\n >{{ requirementIndicatorValue() }}</span\n ></label\n >\n\n <div class=\"rte-select-header\" [attr.data-label-position]=\"labelPosition()\">\n <label *ngIf=\"label() && labelPosition() === 'top'\" class=\"rte-select-label\" [attr.id]=\"labelId()\" [attr.for]=\"id()\"\n >{{ label()\n }}<span\n *ngIf=\"required() || showLabelRequirement()\"\n class=\"requirement-indicator\"\n aria-hidden=\"true\"\n [ngClass]=\"{\n required: required(),\n 'show-label-requirement': showLabelRequirement(),\n }\"\n >{{ requirementIndicatorValue() }}</span\n ></label\n >\n </div>\n <div\n rteDropdown\n [rteDropdownId]=\"'dropdown_select_' + id()\"\n [rteDropdownPosition]=\"dropdownPosition()\"\n [rteDropdownOffset]=\"selectDropdownOffset\"\n [rteDropdownWidth]=\"selectWidth()\"\n (menuEvent)=\"handleOnClickItem($event.id)\"\n (clickedOutside)=\"handleOnClickOutside()\"\n (closedDropdown)=\"handleOnClosingDropdown()\"\n >\n <div\n #selectRef\n rteDropdownTrigger\n class=\"rte-select-wrapper\"\n [attr.tabIndex]=\"disabled() || readOnly() ? -1 : 0\"\n [attr.role]=\"'combobox'\"\n [attr.data-error]=\"isError()\"\n [attr.data-disabled]=\"disabled()\"\n [attr.data-read-only]=\"readOnly()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-readonly]=\"readOnly()\"\n [attr.aria-labelledby]=\"labelId()\"\n [attr.aria-expanded]=\"isActive()\"\n [attr.data-active]=\"isActive()\"\n [ngStyle]=\"{ width: computedWidth() }\"\n (dropdownTriggered)=\"handleOnClickTrigger()\"\n (dropdownKeyDown)=\"handleOnKeyDownTrigger($event)\"\n >\n <div class=\"rte-select-content\">\n <rte-icon *ngIf=\"shouldDisplayErrorIcon()\" name=\"error\" class=\"error-icon\" />\n <div class=\"rte-select-value\">\n <span>{{ currentOptionLabel() }}</span>\n </div>\n <div #buttonsContainerRef class=\"rte-select-right-icons\">\n <rte-icon-button\n *ngIf=\"shouldDisplayClearButton()\"\n name=\"cancel\"\n variant=\"neutral\"\n class=\"rte-select-icon-button clear-icon\"\n [disabled]=\"disabled()\"\n (clickEvent)=\"handleOnClickClearButton($event)\"\n />\n <rte-icon\n class=\"trigger-icon trigger-icon-{{ isActive() ? 'up' : 'down' }}\"\n variant=\"neutral\"\n [name]=\"isActive() ? 'arrow-chevron-up' : 'arrow-chevron-down'\"\n />\n </div>\n </div>\n </div>\n <rte-dropdown-menu [items]=\"formattedOptions()\" />\n <rte-assistive-text\n *ngIf=\"assistiveTextLabel()\"\n [label]=\"assistiveTextLabel()\"\n [appearance]=\"isError() ? 'error' : assistiveTextAppearance()!\"\n [showIcon]=\"showAssistiveIcon()\"\n [href]=\"assistiveTextLink()\"\n [width]=\"width()\"\n />\n </div>\n</div>\n", styles: [".rte-select-container{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;display:flex;flex-direction:column}.rte-select-container[data-label-position=side]{flex-direction:row;align-self:start}.rte-select-container[data-label-position=side] .rte-select-header{display:flex;flex-direction:column}.rte-select-container[data-label-position=side] .rte-select-label{height:32px;padding:0 8px}.rte-select-container .rte-select-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;display:flex;padding:2px 8px;color:var(--content-secondary);justify-content:space-between;white-space:normal;overflow-wrap:normal;word-break:normal}.rte-select-container .rte-select-label .requirement-indicator{margin-left:2px}.rte-select-container .rte-select-label .requirement-indicator.show-label-requirement{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;color:var(--content-tertiary)}.rte-select-container .rte-select-label .requirement-indicator.show-label-requirement:not(.required){font-style:italic}.rte-select-container .rte-select-label .requirement-indicator:not(.show-label-requirement).required{color:var(--content-danger-default)}.rte-select-container .rte-select-wrapper{box-shadow:inset 0 1px 4px 0 var(--elevation-shadow-key);background:linear-gradient(0deg,var(--elevation-surface-inner-shadow) 0%,var(--elevation-surface-inner-shadow) 100%);display:flex;min-width:112px;min-height:32px;max-height:32px;align-items:center;align-self:stretch;border-radius:4px;border:1px solid var(--border-secondary);box-sizing:border-box}.rte-select-container .rte-select-wrapper .trigger-icon{color:var(--content-tertiary)}.rte-select-container .rte-select-wrapper:hover{border-color:var(--border-primary);cursor:pointer}.rte-select-container .rte-select-wrapper:focus-visible,.rte-select-container .rte-select-wrapper[data-active=true]{border-color:var(--border-brand-default);outline:1px solid var(--border-brand-default)}.rte-select-container .rte-select-wrapper[data-error=true]{border-color:var(--border-danger);outline:1px solid var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-disabled=true]{color:var(--content-disabled);border-color:var(--border-danger);outline:1px solid var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-disabled=true]:hover{border-color:var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-read-only=true]{color:var(--content-tertiary);border-color:var(--border-danger);outline:1px solid var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-read-only=true]:hover{cursor:default;border-color:var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true][data-read-only=true] .rte-select-content .rte-select-value{color:var(--content-tertiary)}.rte-select-container .rte-select-wrapper[data-error=true]:hover{border-color:var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true]:focus-visible{border-color:var(--border-danger);outline:1px solid var(--border-danger)}.rte-select-container .rte-select-wrapper[data-error=true] .rte-select-content .rte-select-value{color:var(--content-secondary)}.rte-select-container .rte-select-wrapper[data-disabled=true]{color:var(--content-disabled);background-color:var(--background-disabled);border-color:var(--border-disabled)}.rte-select-container .rte-select-wrapper[data-disabled=true]:hover{cursor:not-allowed}.rte-select-container .rte-select-wrapper[data-disabled=true] .trigger-icon,.rte-select-container .rte-select-wrapper[data-disabled=true] .rte-select-content .rte-select-value{color:var(--content-disabled)}.rte-select-container .rte-select-wrapper[data-read-only=true]{color:var(--content-tertiary);background-color:var(--background-disabled);border-color:var(--border-tertiary)}.rte-select-container .rte-select-wrapper[data-read-only=true]:hover{cursor:default}.rte-select-container .rte-select-wrapper[data-read-only=true] .trigger-icon{color:var(--content-tertiary)}.rte-select-container .rte-select-wrapper .rte-select-content{display:flex;min-width:96px;padding:4px 8px;align-items:center;flex:1 0 0}.rte-select-container .rte-select-wrapper .rte-select-content .error-icon{padding:0;color:var(--content-danger-default)}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-value{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;display:flex;padding:0 8px;align-items:center;flex:1 0 0;text-overflow:ellipsis;overflow:hidden;color:var(--content-primary)}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-value span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-right-icons{display:flex;align-items:center;gap:8px}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-right-icons ::ng-deep .rte-icon-button{padding:0;height:20px;width:20px}.rte-select-container .rte-select-wrapper .rte-select-content .rte-select-right-icons ::ng-deep .rte-icon-button:focus-visible{outline:1px solid var(--border-brand-focused);border-radius:2px;outline-offset:3px}.rte-select-container .assistive-text{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:12px;line-height:16px;letter-spacing:0px;display:flex;align-items:center;gap:4px;padding:4px 8px;color:var(--content-secondary)}.rte-select-container .assistive-text .assistive-icon-error{color:var(--content-danger-default)}.rte-select-container .assistive-text .assistive-icon-success{color:var(--content-success-default)}.rte-select-container .assistive-text.error{color:var(--content-danger-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}.rte-select-container .assistive-text.success{color:var(--content-success-default);font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:12px;line-height:16px;letter-spacing:0px;margin:0}\n"] }]
|
|
3403
|
+
}] });
|
|
3404
|
+
|
|
3405
|
+
class TabItemComponent {
|
|
3406
|
+
constructor() {
|
|
3407
|
+
this.direction = input("horizontal");
|
|
3408
|
+
this.option = input();
|
|
3409
|
+
this.compactSpacing = input();
|
|
3410
|
+
this.isSelected = input(false);
|
|
3411
|
+
this.click = output();
|
|
3412
|
+
this.handleKeydown = input();
|
|
3413
|
+
this.inverted = input(false);
|
|
3414
|
+
this.isHidden = input(false);
|
|
3415
|
+
this.tabItemRef = viewChild("tabItem");
|
|
3416
|
+
this.hoverIndicatorStyle = signal(null);
|
|
3417
|
+
this.displayBadge = (option) => {
|
|
3418
|
+
return !!(option.badgeContent || option.badgeType || option.badgeIcon || option.badgeCount);
|
|
3419
|
+
};
|
|
3420
|
+
this.hoverIndicatorWidth = computed(() => {
|
|
3421
|
+
return `${this.hoverIndicatorStyle()?.width}px`;
|
|
3422
|
+
});
|
|
3423
|
+
this.hoverIndicatorHeight = computed(() => {
|
|
3424
|
+
return `${this.hoverIndicatorStyle()?.height}px`;
|
|
3425
|
+
});
|
|
3426
|
+
this.hoverIndicatorLeft = computed(() => {
|
|
3427
|
+
return `${this.hoverIndicatorStyle()?.left}px`;
|
|
3428
|
+
});
|
|
3429
|
+
this.hoverIndicatorTop = computed(() => {
|
|
3430
|
+
return `${this.hoverIndicatorStyle()?.top}px`;
|
|
3431
|
+
});
|
|
3432
|
+
this.hoverIndicatorOpacity = computed(() => {
|
|
3433
|
+
return this.hoverIndicatorStyle()?.opacity ?? 0;
|
|
3434
|
+
});
|
|
3435
|
+
this.computeHoverIndicatorStyle = () => {
|
|
3436
|
+
if (this.direction() === "horizontal") {
|
|
3437
|
+
this.hoverIndicatorStyle.set({
|
|
3438
|
+
width: this.tabItemRef()?.nativeElement.offsetWidth,
|
|
3439
|
+
height: 2,
|
|
3440
|
+
left: this.tabItemRef()?.nativeElement.offsetLeft,
|
|
3441
|
+
top: this.tabItemRef()
|
|
3442
|
+
? this.tabItemRef().nativeElement.offsetTop + this.tabItemRef().nativeElement.offsetHeight
|
|
3443
|
+
: 0,
|
|
3444
|
+
opacity: 0,
|
|
3445
|
+
});
|
|
3446
|
+
}
|
|
3447
|
+
else {
|
|
3448
|
+
this.hoverIndicatorStyle.set({
|
|
3449
|
+
width: 2,
|
|
3450
|
+
height: this.tabItemRef()?.nativeElement.offsetHeight,
|
|
3451
|
+
left: this.tabItemRef()?.nativeElement.offsetLeft && this.tabItemRef().nativeElement.offsetLeft - 4,
|
|
3452
|
+
top: this.tabItemRef().nativeElement.offsetTop,
|
|
3453
|
+
opacity: 0,
|
|
3454
|
+
});
|
|
3455
|
+
}
|
|
3456
|
+
};
|
|
3457
|
+
}
|
|
3458
|
+
ngAfterViewInit() {
|
|
3459
|
+
this.computeHoverIndicatorStyle();
|
|
3460
|
+
if (this.tabItemRef && this.tabItemRef()?.nativeElement) {
|
|
3461
|
+
if (this.option()?.disabled)
|
|
3462
|
+
return;
|
|
3463
|
+
window.addEventListener("resize", this.computeHoverIndicatorStyle);
|
|
3464
|
+
const parent = this.tabItemRef()?.nativeElement.parentElement?.parentElement;
|
|
3465
|
+
if (parent) {
|
|
3466
|
+
parent.addEventListener("scroll", this.computeHoverIndicatorStyle);
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
ngOnDestroy() {
|
|
3471
|
+
const parent = this.tabItemRef()?.nativeElement.parentElement?.parentElement;
|
|
3472
|
+
window.removeEventListener("resize", this.computeHoverIndicatorStyle);
|
|
3473
|
+
if (parent) {
|
|
3474
|
+
parent.removeEventListener("scroll", this.computeHoverIndicatorStyle);
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
onClickTabItem(event, id) {
|
|
3478
|
+
this.hoverIndicatorStyle.set({
|
|
3479
|
+
...this.hoverIndicatorStyle(),
|
|
3480
|
+
opacity: 0,
|
|
3481
|
+
});
|
|
3482
|
+
if (!this.option()?.disabled) {
|
|
3483
|
+
this.click.emit(id);
|
|
3484
|
+
}
|
|
3485
|
+
else {
|
|
3486
|
+
event.stopPropagation();
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3489
|
+
handleMouseHover() {
|
|
3490
|
+
if (!this.isSelected()) {
|
|
3491
|
+
this.hoverIndicatorStyle.set({
|
|
3492
|
+
...this.hoverIndicatorStyle(),
|
|
3493
|
+
opacity: 1,
|
|
3494
|
+
});
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
handleMouseOut() {
|
|
3498
|
+
this.hoverIndicatorStyle.set({
|
|
3499
|
+
...this.hoverIndicatorStyle(),
|
|
3500
|
+
opacity: 0,
|
|
3501
|
+
});
|
|
3502
|
+
}
|
|
3503
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TabItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3504
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: TabItemComponent, isStandalone: true, selector: "rte-tab-item", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: false, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, isSelected: { classPropertyName: "isSelected", publicName: "isSelected", isSignal: true, isRequired: false, transformFunction: null }, handleKeydown: { classPropertyName: "handleKeydown", publicName: "handleKeydown", isSignal: true, isRequired: false, transformFunction: null }, inverted: { classPropertyName: "inverted", publicName: "inverted", isSignal: true, isRequired: false, transformFunction: null }, isHidden: { classPropertyName: "isHidden", publicName: "isHidden", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click" }, viewQueries: [{ propertyName: "tabItemRef", first: true, predicate: ["tabItem"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #tabItem\n class=\"rte-tabitem\"\n role=\"tab\"\n [id]=\"option()?.id\"\n [attr.aria-selected]=\"isSelected()\"\n [attr.aria-controls]=\"option()?.panelId\"\n [tabIndex]=\"isSelected() ? 0 : -1\"\n [attr.data-selected]=\"isSelected()\"\n [attr.data-inverted]=\"inverted()\"\n [attr.data-compact-spacing]=\"compactSpacing()\"\n [attr.data-disabled]=\"option()?.disabled\"\n [attr.data-hidden]=\"isHidden()\"\n (click)=\"onClickTabItem($event, option()?.id || '')\"\n (mouseover)=\"handleMouseHover()\"\n (mouseout)=\"handleMouseOut()\"\n (keydown)=\"handleKeydown()\"\n>\n <rte-icon *ngIf=\"option()?.icon\" [name]=\"option()?.icon || ''\" [appearance]=\"isSelected() ? 'filled' : 'outlined'\" />\n <span *ngIf=\"option()?.label\">{{ option()?.label }}</span>\n <rte-badge\n *ngIf=\"displayBadge(option()!)\"\n [simpleBadge]=\"true\"\n [badgeContent]=\"option()?.badgeContent || 'empty'\"\n [badgeType]=\"option()?.badgeType || 'neutral'\"\n [icon]=\"option()?.badgeIcon || ''\"\n [count]=\"option()?.badgeCount\"\n />\n</button>\n<span\n #hoverIndicator\n class=\"rte-tab-hover-indicator\"\n [attr.data-disabled]=\"option()?.disabled\"\n [id]=\"'tab-hover-indicator' + option()?.id\"\n [ngStyle]=\"{\n width: hoverIndicatorWidth(),\n height: hoverIndicatorHeight(),\n left: hoverIndicatorLeft(),\n top: hoverIndicatorTop(),\n opacity: hoverIndicatorOpacity(),\n }\"\n></span>\n", styles: [":host{pointer-events:none;display:flex}.rte-tabitem{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;display:flex;padding:12px;justify-content:center;align-items:center;gap:12px;background:transparent;color:var(--content-secondary);cursor:pointer;border:none;text-align:left;flex-shrink:0;margin-left:2px;height:100%;pointer-events:auto}.rte-tabitem[data-inverted=true]{color:var(--content-primary-inverse)}.rte-tabitem[data-direction=vertical]{flex-shrink:1;margin-left:0}.rte-tabitem[data-hidden=true]{visibility:hidden}.rte-tabitem[data-selected=true]:not([data-disabled=true]),.rte-tabitem:hover:not([data-disabled=true]){font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:14px;line-height:20px;letter-spacing:0px}.rte-tabitem[data-disabled=true]{color:var(--content-disabled);cursor:not-allowed}.rte-tabitem[data-compact-spacing=true]{padding:4px 12px}.rte-tabitem:focus-visible{z-index:1;outline:2px solid var(--border-brand-focused)}.rte-tab-hover-indicator{position:absolute;top:4px;height:2px;width:2px;background:var(--background-neutral-regular-hover);opacity:0;transition:left .2s ease,width .2s ease;z-index:10}.rte-tab-hover-indicator[data-disabled=true]{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: BadgeComponent, selector: "rte-badge", inputs: ["badgeType", "badgeSize", "badgeContent", "count", "icon", "simpleBadge"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3505
|
+
}
|
|
3506
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TabItemComponent, decorators: [{
|
|
3507
|
+
type: Component,
|
|
3508
|
+
args: [{ selector: "rte-tab-item", imports: [CommonModule, IconComponent, BadgeComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n #tabItem\n class=\"rte-tabitem\"\n role=\"tab\"\n [id]=\"option()?.id\"\n [attr.aria-selected]=\"isSelected()\"\n [attr.aria-controls]=\"option()?.panelId\"\n [tabIndex]=\"isSelected() ? 0 : -1\"\n [attr.data-selected]=\"isSelected()\"\n [attr.data-inverted]=\"inverted()\"\n [attr.data-compact-spacing]=\"compactSpacing()\"\n [attr.data-disabled]=\"option()?.disabled\"\n [attr.data-hidden]=\"isHidden()\"\n (click)=\"onClickTabItem($event, option()?.id || '')\"\n (mouseover)=\"handleMouseHover()\"\n (mouseout)=\"handleMouseOut()\"\n (keydown)=\"handleKeydown()\"\n>\n <rte-icon *ngIf=\"option()?.icon\" [name]=\"option()?.icon || ''\" [appearance]=\"isSelected() ? 'filled' : 'outlined'\" />\n <span *ngIf=\"option()?.label\">{{ option()?.label }}</span>\n <rte-badge\n *ngIf=\"displayBadge(option()!)\"\n [simpleBadge]=\"true\"\n [badgeContent]=\"option()?.badgeContent || 'empty'\"\n [badgeType]=\"option()?.badgeType || 'neutral'\"\n [icon]=\"option()?.badgeIcon || ''\"\n [count]=\"option()?.badgeCount\"\n />\n</button>\n<span\n #hoverIndicator\n class=\"rte-tab-hover-indicator\"\n [attr.data-disabled]=\"option()?.disabled\"\n [id]=\"'tab-hover-indicator' + option()?.id\"\n [ngStyle]=\"{\n width: hoverIndicatorWidth(),\n height: hoverIndicatorHeight(),\n left: hoverIndicatorLeft(),\n top: hoverIndicatorTop(),\n opacity: hoverIndicatorOpacity(),\n }\"\n></span>\n", styles: [":host{pointer-events:none;display:flex}.rte-tabitem{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0px;display:flex;padding:12px;justify-content:center;align-items:center;gap:12px;background:transparent;color:var(--content-secondary);cursor:pointer;border:none;text-align:left;flex-shrink:0;margin-left:2px;height:100%;pointer-events:auto}.rte-tabitem[data-inverted=true]{color:var(--content-primary-inverse)}.rte-tabitem[data-direction=vertical]{flex-shrink:1;margin-left:0}.rte-tabitem[data-hidden=true]{visibility:hidden}.rte-tabitem[data-selected=true]:not([data-disabled=true]),.rte-tabitem:hover:not([data-disabled=true]){font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:14px;line-height:20px;letter-spacing:0px}.rte-tabitem[data-disabled=true]{color:var(--content-disabled);cursor:not-allowed}.rte-tabitem[data-compact-spacing=true]{padding:4px 12px}.rte-tabitem:focus-visible{z-index:1;outline:2px solid var(--border-brand-focused)}.rte-tab-hover-indicator{position:absolute;top:4px;height:2px;width:2px;background:var(--background-neutral-regular-hover);opacity:0;transition:left .2s ease,width .2s ease;z-index:10}.rte-tab-hover-indicator[data-disabled=true]{display:none}\n"] }]
|
|
3509
|
+
}] });
|
|
3510
|
+
|
|
3511
|
+
class TabComponent {
|
|
3512
|
+
constructor() {
|
|
3513
|
+
this.alignment = input("start");
|
|
3514
|
+
this.direction = input("horizontal");
|
|
3515
|
+
this.options = input([]);
|
|
3516
|
+
this.selectedTabId = input();
|
|
3517
|
+
this.compactSpacing = input(false);
|
|
3518
|
+
this.overflowType = input("scrollable");
|
|
3519
|
+
this.inverted = input(false);
|
|
3520
|
+
this.sliderLeft = signal(0);
|
|
3521
|
+
this.sliderWidth = signal(0);
|
|
3522
|
+
this.sliderTop = signal(0);
|
|
3523
|
+
this.sliderHeight = signal(0);
|
|
3524
|
+
this.tabItemRefs = viewChildren("tabItem");
|
|
3525
|
+
this.containerRef = viewChild("tabList");
|
|
3526
|
+
this.hoverIndicatorRefs = viewChildren("hoverIndicator");
|
|
3527
|
+
this.selectedTabRef = computed(() => {
|
|
3528
|
+
const idx = this.options().findIndex((opt) => opt.id === this.selectedTabId());
|
|
3529
|
+
const tabItem = this.tabItemRefs()[idx];
|
|
3530
|
+
return tabItem;
|
|
3531
|
+
});
|
|
3532
|
+
this.hoverIndicatorStyle = signal(null);
|
|
3533
|
+
this.change = output();
|
|
3534
|
+
this.isScrollable = signal(false);
|
|
3535
|
+
this.isOverflowingLeft = signal(false);
|
|
3536
|
+
this.isOverflowingRight = signal(false);
|
|
3537
|
+
this.isOverflowingTop = signal(false);
|
|
3538
|
+
this.isOverflowingBottom = signal(false);
|
|
3539
|
+
this.canScrollBackward = computed(() => {
|
|
3540
|
+
return this.isOverflowingLeft() || this.isOverflowingTop();
|
|
3541
|
+
});
|
|
3542
|
+
this.canScrollForward = computed(() => {
|
|
3543
|
+
return this.isOverflowingRight() || this.isOverflowingBottom();
|
|
3544
|
+
});
|
|
3545
|
+
this.isHorizontal = computed(() => this.direction() === "horizontal" && (this.isOverflowingRight() || this.isOverflowingLeft()));
|
|
3546
|
+
this.shouldDisplayDropdown = computed(() => this.overflowType() === "dropdown" && this.isHorizontal());
|
|
3547
|
+
this.selectedTab = computed(() => {
|
|
3548
|
+
return this.options().find((option) => option.id === this.selectedTabId());
|
|
3549
|
+
});
|
|
3550
|
+
this.dropdownFilteredOptions = computed(() => {
|
|
3551
|
+
return this.options().filter((option) => option.id !== this.selectedTabId());
|
|
3552
|
+
});
|
|
3553
|
+
this.displayBadge = (option) => {
|
|
3554
|
+
return (!!option.showBadge ||
|
|
3555
|
+
(option.badgeCount !== undefined && option.badgeCount > 0 && option.badgeContent === "number") ||
|
|
3556
|
+
(option.badgeContent === "icon" && !!option.badgeIcon));
|
|
3557
|
+
};
|
|
3558
|
+
this.tabItemSelectedIndicatorStyle = computed(() => ({
|
|
3559
|
+
left: `${this.shouldDisplayDropdown() ? 0 : this.sliderLeft()}px`,
|
|
3560
|
+
top: `${this.sliderTop()}px`,
|
|
3561
|
+
width: `${this.sliderWidth() + (this.shouldDisplayDropdown() ? 32 : 0)}px`,
|
|
3562
|
+
height: `${this.sliderHeight()}px`,
|
|
3563
|
+
}));
|
|
3564
|
+
this.onKeydownTabItem = (event) => {
|
|
3565
|
+
const isVertical = this.direction() === "vertical";
|
|
3566
|
+
const isDownKeyPressed = isVertical && event.key === ARROW_DOWN_KEY;
|
|
3567
|
+
const isUpKeyPressed = isVertical && event.key === ARROW_UP_KEY;
|
|
3568
|
+
const isRightKeyPressed = !isVertical && event.key === ARROW_RIGHT_KEY;
|
|
3569
|
+
const isLeftKeyPressed = !isVertical && event.key === ARROW_LEFT_KEY;
|
|
3570
|
+
const isArrowNext = isDownKeyPressed || isRightKeyPressed;
|
|
3571
|
+
const isArrowPrev = isUpKeyPressed || isLeftKeyPressed;
|
|
3572
|
+
if (isArrowNext || isArrowPrev) {
|
|
3573
|
+
event.preventDefault();
|
|
3574
|
+
this.focusItem(isArrowNext ? "next" : "previous");
|
|
3575
|
+
}
|
|
3576
|
+
};
|
|
3577
|
+
this.onClickTabItem = (id) => {
|
|
3578
|
+
if (id !== this.selectedTabId()) {
|
|
3579
|
+
this.change.emit(id);
|
|
3580
|
+
if (!this.shouldDisplayDropdown()) {
|
|
3581
|
+
const newTab = this.getTabItem(id)?.tabItemRef()?.nativeElement;
|
|
3582
|
+
if (newTab) {
|
|
3583
|
+
const container = this.containerRef()?.nativeElement;
|
|
3584
|
+
if (container) {
|
|
3585
|
+
scrollToSelectedTab(newTab, container, this.direction());
|
|
3586
|
+
}
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
};
|
|
3591
|
+
this.getTabItem = (id) => {
|
|
3592
|
+
return this.tabItemRefs().find((tab) => tab.option()?.id === id);
|
|
3593
|
+
};
|
|
3594
|
+
this.focusItem = (direction) => {
|
|
3595
|
+
const currentIndex = this.tabItemRefs().findIndex((tab) => tab === this.selectedTabRef());
|
|
3596
|
+
const maxIterations = this.tabItemRefs().length;
|
|
3597
|
+
let newIndex = this.computeNextItemIndex(currentIndex, maxIterations, direction);
|
|
3598
|
+
let counter = 0;
|
|
3599
|
+
while (this.tabItemRefs()[newIndex].tabItemRef()?.nativeElement.getAttribute("data-disabled") === "true" &&
|
|
3600
|
+
counter < maxIterations) {
|
|
3601
|
+
newIndex = this.computeNextItemIndex(newIndex, maxIterations, direction);
|
|
3602
|
+
counter++;
|
|
3603
|
+
}
|
|
3604
|
+
this.tabItemRefs()[newIndex].tabItemRef()?.nativeElement.focus();
|
|
3605
|
+
this.tabItemRefs()[newIndex].tabItemRef()?.nativeElement.click();
|
|
3606
|
+
};
|
|
3607
|
+
this.computeScrollableSignals = () => {
|
|
3608
|
+
this.computeIsScrollable();
|
|
3609
|
+
this.computeIsOverflowingLeft();
|
|
3610
|
+
this.computeIsOverflowingRight();
|
|
3611
|
+
this.computeIsOverflowingTop();
|
|
3612
|
+
this.computeIsOverflowingBottom();
|
|
3613
|
+
};
|
|
3614
|
+
}
|
|
3615
|
+
isSelected(id) {
|
|
3616
|
+
return this.selectedTabId() === id;
|
|
3617
|
+
}
|
|
3618
|
+
ngAfterViewInit() {
|
|
3619
|
+
this.updateSelectedTabItemIndicator();
|
|
3620
|
+
this.computeScrollableSignals();
|
|
3621
|
+
window.addEventListener("resize", this.updateSelectedTabItemIndicator.bind(this));
|
|
3622
|
+
window.addEventListener("resize", this.computeScrollableSignals.bind(this));
|
|
3623
|
+
if (this.containerRef()) {
|
|
3624
|
+
this.containerRef()?.nativeElement.addEventListener("scroll", this.computeScrollableSignals.bind(this));
|
|
3625
|
+
}
|
|
3626
|
+
this.hoverIndicatorRefs().forEach((hoverIndicator) => {
|
|
3627
|
+
hoverIndicator.nativeElement.style.opacity = "0";
|
|
3628
|
+
});
|
|
3629
|
+
}
|
|
3630
|
+
ngOnDestroy() {
|
|
3631
|
+
window.removeEventListener("resize", this.updateSelectedTabItemIndicator.bind(this));
|
|
3632
|
+
window.removeEventListener("resize", this.computeScrollableSignals.bind(this));
|
|
3633
|
+
if (this.containerRef()) {
|
|
3634
|
+
this.containerRef()?.nativeElement.removeEventListener("scroll", this.computeScrollableSignals.bind(this));
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3637
|
+
ngOnChanges(changes) {
|
|
3638
|
+
if (changes["selectedTabId"]) {
|
|
3639
|
+
this.updateSelectedTabItemIndicator();
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
scrollBackward() {
|
|
3643
|
+
if (this.containerRef()?.nativeElement) {
|
|
3644
|
+
const scrollObject = this.direction() === "horizontal" ? { left: -300 } : { top: -300 };
|
|
3645
|
+
this.containerRef()?.nativeElement.scrollBy({ ...scrollObject, behavior: "smooth" });
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
scrollForward() {
|
|
3649
|
+
if (this.containerRef() && this.containerRef()?.nativeElement) {
|
|
3650
|
+
const scrollObject = this.direction() === "horizontal" ? { left: 300 } : { top: 300 };
|
|
3651
|
+
this.containerRef()?.nativeElement.scrollBy({ ...scrollObject, behavior: "smooth" });
|
|
3652
|
+
}
|
|
3653
|
+
}
|
|
3654
|
+
computeNextItemIndex(currentIndex, totalItems, direction) {
|
|
3655
|
+
return direction === "next" ? (currentIndex + 1) % totalItems : (currentIndex - 1 + totalItems) % totalItems;
|
|
3656
|
+
}
|
|
3657
|
+
computeIndicatorStyle(tabItem) {
|
|
3658
|
+
if (this.direction() === "horizontal") {
|
|
3659
|
+
return {
|
|
3660
|
+
width: tabItem.offsetWidth,
|
|
3661
|
+
left: tabItem.offsetLeft,
|
|
3662
|
+
top: tabItem.offsetTop + tabItem.offsetHeight,
|
|
3663
|
+
};
|
|
3664
|
+
}
|
|
3665
|
+
else {
|
|
3666
|
+
return {
|
|
3667
|
+
left: 0,
|
|
3668
|
+
top: tabItem.offsetTop,
|
|
3669
|
+
height: tabItem.offsetHeight,
|
|
3670
|
+
width: 2,
|
|
3671
|
+
};
|
|
3672
|
+
}
|
|
3673
|
+
}
|
|
3674
|
+
updateSelectedTabItemIndicator() {
|
|
3675
|
+
const idx = this.options().findIndex((opt) => opt.id === this.selectedTabId());
|
|
3676
|
+
const tabItem = this.tabItemRefs()[idx];
|
|
3677
|
+
if (tabItem?.tabItemRef) {
|
|
3678
|
+
if (tabItem.option()?.disabled) {
|
|
3679
|
+
return;
|
|
3680
|
+
}
|
|
3681
|
+
const tabItemRef = tabItem.tabItemRef?.();
|
|
3682
|
+
if (tabItemRef && tabItemRef.nativeElement) {
|
|
3683
|
+
const tabItemElement = tabItemRef.nativeElement;
|
|
3684
|
+
const indicatorStyle = this.computeIndicatorStyle(tabItemElement);
|
|
3685
|
+
this.sliderHeight.set(indicatorStyle.height ?? 2);
|
|
3686
|
+
this.sliderTop.set(indicatorStyle.top);
|
|
3687
|
+
this.sliderWidth.set(indicatorStyle.width ?? 2);
|
|
3688
|
+
this.sliderLeft.set(indicatorStyle.left);
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3692
|
+
computeIsScrollable() {
|
|
3693
|
+
if (this.containerRef()?.nativeElement) {
|
|
3694
|
+
const containerNativeElement = this.containerRef()?.nativeElement;
|
|
3695
|
+
if (containerNativeElement) {
|
|
3696
|
+
this.isScrollable.set(containerNativeElement.offsetWidth < containerNativeElement.scrollWidth ||
|
|
3697
|
+
containerNativeElement.offsetHeight < containerNativeElement.scrollHeight);
|
|
3698
|
+
}
|
|
3699
|
+
}
|
|
3700
|
+
return false;
|
|
3701
|
+
}
|
|
3702
|
+
computeIsOverflowingLeft() {
|
|
3703
|
+
const containerNativeElement = this.containerRef()?.nativeElement;
|
|
3704
|
+
if (containerNativeElement) {
|
|
3705
|
+
const isOverFlowingLeft = containerNativeElement.scrollLeft > 0;
|
|
3706
|
+
this.isOverflowingLeft.set(this.isScrollable() && isOverFlowingLeft);
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
computeIsOverflowingRight() {
|
|
3710
|
+
const containerNativeElement = this.containerRef()?.nativeElement;
|
|
3711
|
+
if (containerNativeElement) {
|
|
3712
|
+
const isOverflowingRight = containerNativeElement.scrollWidth - containerNativeElement.clientWidth - containerNativeElement.scrollLeft > 0;
|
|
3713
|
+
this.isOverflowingRight.set(this.isScrollable() && isOverflowingRight);
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
computeIsOverflowingTop() {
|
|
3717
|
+
const containerNativeElement = this.containerRef()?.nativeElement;
|
|
3718
|
+
if (containerNativeElement) {
|
|
3719
|
+
const isOverFlowingTop = containerNativeElement.scrollTop > 0;
|
|
3720
|
+
this.isOverflowingTop.set(this.isScrollable() && isOverFlowingTop);
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
computeIsOverflowingBottom() {
|
|
3724
|
+
const containerNativeElement = this.containerRef()?.nativeElement;
|
|
3725
|
+
if (containerNativeElement) {
|
|
3726
|
+
const isOverflowingBottom = containerNativeElement.scrollHeight - containerNativeElement.clientHeight - containerNativeElement.scrollTop >
|
|
3727
|
+
0;
|
|
3728
|
+
this.isOverflowingBottom.set(this.isScrollable() && isOverflowingBottom);
|
|
3729
|
+
}
|
|
3730
|
+
}
|
|
3731
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3732
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: TabComponent, isStandalone: true, selector: "rte-tab", inputs: { alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, selectedTabId: { classPropertyName: "selectedTabId", publicName: "selectedTabId", isSignal: true, isRequired: false, transformFunction: null }, compactSpacing: { classPropertyName: "compactSpacing", publicName: "compactSpacing", isSignal: true, isRequired: false, transformFunction: null }, overflowType: { classPropertyName: "overflowType", publicName: "overflowType", isSignal: true, isRequired: false, transformFunction: null }, inverted: { classPropertyName: "inverted", publicName: "inverted", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, viewQueries: [{ propertyName: "tabItemRefs", predicate: ["tabItem"], descendants: true, isSignal: true }, { propertyName: "containerRef", first: true, predicate: ["tabList"], descendants: true, isSignal: true }, { propertyName: "hoverIndicatorRefs", predicate: ["hoverIndicator"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"rte-tab-container\" [attr.data-direction]=\"direction()\">\n <div class=\"rte-tab-border-vertical\" aria-hidden=\"true\" role=\"presentation\" [attr.data-direction]=\"direction()\"></div>\n <div\n [ngStyle]=\"{\n position: 'relative',\n display: 'flex',\n 'align-items': 'center',\n 'flex-direction': direction() === 'horizontal' ? 'row' : 'column',\n }\"\n >\n <rte-icon-button\n *ngIf=\"isScrollable() && !shouldDisplayDropdown()\"\n aria-label=\"Previous tabs\"\n variant=\"transparent\"\n [name]=\"direction() === 'horizontal' ? 'arrow-chevron-left' : 'arrow-chevron-up'\"\n [ngStyle]=\"{\n opacity: canScrollBackward() ? '1' : '0',\n 'pointer-events': canScrollBackward() ? 'auto' : 'none',\n }\"\n (clickEvent)=\"scrollBackward()\"\n />\n <div\n #tabList\n role=\"tablist\"\n aria-label=\"Sample Tabs\"\n class=\"rte-tab\"\n [attr.data-alignment]=\"shouldDisplayDropdown() ? 'start' : alignment()\"\n [attr.data-direction]=\"direction()\"\n [attr.data-overflow-type]=\"overflowType()\"\n >\n <span class=\"rte-tab-selected-indicator\" [ngStyle]=\"tabItemSelectedIndicatorStyle()\"></span>\n <div\n *ngIf=\"shouldDisplayDropdown() && options().length\"\n rteDropdown\n [rteDropdownOffset]=\"10\"\n (menuEvent)=\"onClickTabItem($event.id)\"\n >\n <button\n rteDropdownTrigger\n class=\"rte-tab-dropdown-button\"\n [attr.data-inverted]=\"inverted()\"\n [attr.data-overflow-type]=\"overflowType()\"\n >\n <rte-icon *ngIf=\"selectedTab()?.icon\" appearance=\"filled\" [name]=\"selectedTab()?.icon!\"></rte-icon>\n <span *ngIf=\"selectedTab()?.label\">{{ selectedTab()?.label }}</span>\n <rte-badge\n *ngIf=\"selectedTab()?.badgeCount && selectedTab()?.badgeContent === 'number'\"\n [badgeType]=\"selectedTab()?.badgeType!\"\n [badgeContent]=\"selectedTab()?.badgeContent!\"\n [count]=\"selectedTab()?.badgeCount\"\n [simpleBadge]=\"true\"\n ></rte-badge>\n <rte-icon name=\"arrow-chevron-down\" appearance=\"outlined\"></rte-icon>\n </button>\n <rte-dropdown-menu [items]=\"dropdownFilteredOptions()\" />\n </div>\n <ng-container *ngFor=\"let option of options(); let idx = index\">\n <rte-tab-item\n #tabItem\n [option]=\"option\"\n [direction]=\"direction()\"\n [compactSpacing]=\"compactSpacing()\"\n [isSelected]=\"isSelected(option.id)\"\n [inverted]=\"inverted()\"\n [attr.data-hidden]=\"shouldDisplayDropdown()\"\n [isHidden]=\"shouldDisplayDropdown()\"\n (keydown)=\"onKeydownTabItem($event)\"\n (click)=\"onClickTabItem(option.id)\"\n ></rte-tab-item>\n </ng-container>\n </div>\n <rte-icon-button\n *ngIf=\"isScrollable() && !shouldDisplayDropdown()\"\n aria-label=\"Next tabs\"\n variant=\"transparent\"\n [name]=\"direction() === 'horizontal' ? 'arrow-chevron-right' : 'arrow-chevron-down'\"\n [ngStyle]=\"{\n opacity: canScrollForward() ? '1' : '0',\n 'pointer-events': canScrollForward() ? 'auto' : 'none',\n }\"\n (clickEvent)=\"scrollForward()\"\n />\n </div>\n <div\n class=\"rte-tab-border-horizontal\"\n aria-hidden=\"true\"\n role=\"presentation\"\n [attr.data-direction]=\"direction()\"\n [attr.data-compact-spacing]=\"compactSpacing()\"\n [attr.data-scrollable]=\"isScrollable() && overflowType() === 'scrollable'\"\n ></div>\n</div>\n", styles: [".rte-tab-container{position:relative;display:flex;flex-direction:column}.rte-tab-container[data-direction=vertical]{flex-direction:row;height:100%}.rte-tab{position:relative;display:flex;height:100%;gap:24px;justify-content:flex-start;padding-bottom:2px;margin-bottom:-2px;margin-left:-2px;scrollbar-width:none;width:100%;padding-top:2px;padding-left:2px;align-items:center}.rte-tab[data-direction=horizontal]{overflow-x:scroll}.rte-tab[data-direction=horizontal][data-overflow-type=dropdown]{overflow:hidden;margin-left:0}.rte-tab[data-direction=vertical]{flex-direction:column;border-bottom:none;gap:4px;height:100%;padding-right:2px;margin-left:-2px;width:max-content;align-items:start;margin-bottom:0}.rte-tab[data-direction=vertical] .rte-tab-selected-indicator{width:2px;transition:top .2s ease,height .2s ease}.rte-tab[data-alignment=center]{justify-content:center}.rte-tab .rte-tab-selected-indicator{position:absolute;bottom:0;height:2px;background:var(--background-brand-selected-default);transition:left .2s ease,width .2s ease;pointer-events:none;z-index:1}.rte-tab .rte-tab-separator{width:24px;flex-shrink:0}.rte-tab-border-horizontal{background-color:var(--background-neutral-regular-default);position:relative;height:2px}.rte-tab-border-horizontal[data-compact-spacing=true][data-scrollable=true]{bottom:5px}.rte-tab-border-horizontal[data-direction=vertical]{display:none}.rte-tab-border-vertical{background-color:var(--background-neutral-regular-default);position:relative;width:2px}.rte-tab-border-vertical[data-direction=horizontal]{display:none}.rte-tab-dropdown-button{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:14px;line-height:20px;letter-spacing:0px;color:var(--content-secondary);width:max-content;display:flex;align-items:center;gap:12px;background-color:transparent;border:none;cursor:pointer;padding:0;margin:12px}.rte-tab-dropdown-button:focus-visible{outline:2px solid var(--border-brand-focused);outline-offset:12px;z-index:1}.rte-tab-dropdown-button[data-inverted=true]{color:var(--content-primary-inverse)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: TabItemComponent, selector: "rte-tab-item", inputs: ["direction", "option", "compactSpacing", "isSelected", "handleKeydown", "inverted", "isHidden"], outputs: ["click"] }, { kind: "component", type: IconButtonComponent, selector: "rte-icon-button", inputs: ["disabled", "name", "size", "variant", "type", "appearance", "compactSpacing", "ariaLabel", "ariaLabelledBy", "badgeCount", "badgeContent", "badgeType", "badgeIcon", "customStyle"], outputs: ["clickEvent"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "directive", type: DropdownDirective, selector: "[rteDropdown]", inputs: ["rteDropdownId", "rteDropdownPosition", "rteDropdownAlignment", "rteDropdownIsOpen", "rteDropdownOffset", "rteDropdownAutofocus", "rteDropdownAutoOpen", "rteDropdownWidth"], outputs: ["menuEvent", "clickedOutside", "closedDropdown"] }, { kind: "directive", type: DropdownTriggerDirective, selector: "[rteDropdownTrigger]", inputs: ["rteDropdownTriggerActivateWithArrowDown"], outputs: ["dropdownKeyDown", "dropdownTriggered", "dropdownTriggerFocus", "dropdownTriggerClearContent", "dropdownTriggerOpenDropdown", "dropdownTriggerCloseDropdown"] }, { kind: "component", type: DropdownMenuComponent, selector: "rte-dropdown-menu", inputs: ["items", "menuId", "isOpen", "width", "headerTemplate", "footerTemplate"], outputs: ["itemEvent", "closingMenu"] }, { kind: "component", type: IconComponent, selector: "rte-icon", inputs: ["name", "size", "color", "classes", "appearance"] }, { kind: "component", type: BadgeComponent, selector: "rte-badge", inputs: ["badgeType", "badgeSize", "badgeContent", "count", "icon", "simpleBadge"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3733
|
+
}
|
|
3734
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TabComponent, decorators: [{
|
|
3735
|
+
type: Component,
|
|
3736
|
+
args: [{ selector: "rte-tab", imports: [CommonModule, TabItemComponent, IconButtonComponent, DropdownModule, IconComponent, BadgeComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"rte-tab-container\" [attr.data-direction]=\"direction()\">\n <div class=\"rte-tab-border-vertical\" aria-hidden=\"true\" role=\"presentation\" [attr.data-direction]=\"direction()\"></div>\n <div\n [ngStyle]=\"{\n position: 'relative',\n display: 'flex',\n 'align-items': 'center',\n 'flex-direction': direction() === 'horizontal' ? 'row' : 'column',\n }\"\n >\n <rte-icon-button\n *ngIf=\"isScrollable() && !shouldDisplayDropdown()\"\n aria-label=\"Previous tabs\"\n variant=\"transparent\"\n [name]=\"direction() === 'horizontal' ? 'arrow-chevron-left' : 'arrow-chevron-up'\"\n [ngStyle]=\"{\n opacity: canScrollBackward() ? '1' : '0',\n 'pointer-events': canScrollBackward() ? 'auto' : 'none',\n }\"\n (clickEvent)=\"scrollBackward()\"\n />\n <div\n #tabList\n role=\"tablist\"\n aria-label=\"Sample Tabs\"\n class=\"rte-tab\"\n [attr.data-alignment]=\"shouldDisplayDropdown() ? 'start' : alignment()\"\n [attr.data-direction]=\"direction()\"\n [attr.data-overflow-type]=\"overflowType()\"\n >\n <span class=\"rte-tab-selected-indicator\" [ngStyle]=\"tabItemSelectedIndicatorStyle()\"></span>\n <div\n *ngIf=\"shouldDisplayDropdown() && options().length\"\n rteDropdown\n [rteDropdownOffset]=\"10\"\n (menuEvent)=\"onClickTabItem($event.id)\"\n >\n <button\n rteDropdownTrigger\n class=\"rte-tab-dropdown-button\"\n [attr.data-inverted]=\"inverted()\"\n [attr.data-overflow-type]=\"overflowType()\"\n >\n <rte-icon *ngIf=\"selectedTab()?.icon\" appearance=\"filled\" [name]=\"selectedTab()?.icon!\"></rte-icon>\n <span *ngIf=\"selectedTab()?.label\">{{ selectedTab()?.label }}</span>\n <rte-badge\n *ngIf=\"selectedTab()?.badgeCount && selectedTab()?.badgeContent === 'number'\"\n [badgeType]=\"selectedTab()?.badgeType!\"\n [badgeContent]=\"selectedTab()?.badgeContent!\"\n [count]=\"selectedTab()?.badgeCount\"\n [simpleBadge]=\"true\"\n ></rte-badge>\n <rte-icon name=\"arrow-chevron-down\" appearance=\"outlined\"></rte-icon>\n </button>\n <rte-dropdown-menu [items]=\"dropdownFilteredOptions()\" />\n </div>\n <ng-container *ngFor=\"let option of options(); let idx = index\">\n <rte-tab-item\n #tabItem\n [option]=\"option\"\n [direction]=\"direction()\"\n [compactSpacing]=\"compactSpacing()\"\n [isSelected]=\"isSelected(option.id)\"\n [inverted]=\"inverted()\"\n [attr.data-hidden]=\"shouldDisplayDropdown()\"\n [isHidden]=\"shouldDisplayDropdown()\"\n (keydown)=\"onKeydownTabItem($event)\"\n (click)=\"onClickTabItem(option.id)\"\n ></rte-tab-item>\n </ng-container>\n </div>\n <rte-icon-button\n *ngIf=\"isScrollable() && !shouldDisplayDropdown()\"\n aria-label=\"Next tabs\"\n variant=\"transparent\"\n [name]=\"direction() === 'horizontal' ? 'arrow-chevron-right' : 'arrow-chevron-down'\"\n [ngStyle]=\"{\n opacity: canScrollForward() ? '1' : '0',\n 'pointer-events': canScrollForward() ? 'auto' : 'none',\n }\"\n (clickEvent)=\"scrollForward()\"\n />\n </div>\n <div\n class=\"rte-tab-border-horizontal\"\n aria-hidden=\"true\"\n role=\"presentation\"\n [attr.data-direction]=\"direction()\"\n [attr.data-compact-spacing]=\"compactSpacing()\"\n [attr.data-scrollable]=\"isScrollable() && overflowType() === 'scrollable'\"\n ></div>\n</div>\n", styles: [".rte-tab-container{position:relative;display:flex;flex-direction:column}.rte-tab-container[data-direction=vertical]{flex-direction:row;height:100%}.rte-tab{position:relative;display:flex;height:100%;gap:24px;justify-content:flex-start;padding-bottom:2px;margin-bottom:-2px;margin-left:-2px;scrollbar-width:none;width:100%;padding-top:2px;padding-left:2px;align-items:center}.rte-tab[data-direction=horizontal]{overflow-x:scroll}.rte-tab[data-direction=horizontal][data-overflow-type=dropdown]{overflow:hidden;margin-left:0}.rte-tab[data-direction=vertical]{flex-direction:column;border-bottom:none;gap:4px;height:100%;padding-right:2px;margin-left:-2px;width:max-content;align-items:start;margin-bottom:0}.rte-tab[data-direction=vertical] .rte-tab-selected-indicator{width:2px;transition:top .2s ease,height .2s ease}.rte-tab[data-alignment=center]{justify-content:center}.rte-tab .rte-tab-selected-indicator{position:absolute;bottom:0;height:2px;background:var(--background-brand-selected-default);transition:left .2s ease,width .2s ease;pointer-events:none;z-index:1}.rte-tab .rte-tab-separator{width:24px;flex-shrink:0}.rte-tab-border-horizontal{background-color:var(--background-neutral-regular-default);position:relative;height:2px}.rte-tab-border-horizontal[data-compact-spacing=true][data-scrollable=true]{bottom:5px}.rte-tab-border-horizontal[data-direction=vertical]{display:none}.rte-tab-border-vertical{background-color:var(--background-neutral-regular-default);position:relative;width:2px}.rte-tab-border-vertical[data-direction=horizontal]{display:none}.rte-tab-dropdown-button{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-weight:700;font-size:14px;line-height:20px;letter-spacing:0px;color:var(--content-secondary);width:max-content;display:flex;align-items:center;gap:12px;background-color:transparent;border:none;cursor:pointer;padding:0;margin:12px}.rte-tab-dropdown-button:focus-visible{outline:2px solid var(--border-brand-focused);outline-offset:12px;z-index:1}.rte-tab-dropdown-button[data-inverted=true]{color:var(--content-primary-inverse)}\n"] }]
|
|
3737
|
+
}] });
|
|
3738
|
+
|
|
2848
3739
|
/**
|
|
2849
3740
|
* Generated bundle index. Do not edit.
|
|
2850
3741
|
*/
|
|
2851
3742
|
|
|
2852
|
-
export { BadgeDirective, BannerComponent, BreadcrumbsComponent, ButtonComponent, CardComponent, CheckboxComponent, CheckboxGroupComponent, ChipComponent, ColDirective, DividerComponent, GridDirective, IconButtonComponent, IconButtonToggleComponent, IconComponent, LinkComponent, ModalDirective, ModalModule, ModalTriggerDirective, PopoverDirective, RadioButtonComponent, RadioButtonGroupComponent, SegmentedControlComponent, SideNavComponent, SplitButtonComponent, SwitchComponent, TagComponent, TextInputComponent, TextareaComponent, ToastComponent, ToastService, TooltipDirective };
|
|
3743
|
+
export { BadgeDirective, BannerComponent, BreadcrumbsComponent, ButtonComponent, CardComponent, CheckboxComponent, CheckboxGroupComponent, ChipComponent, ColDirective, DividerComponent, GridDirective, IconButtonComponent, IconButtonToggleComponent, IconComponent, LinkComponent, ModalDirective, ModalModule, ModalTriggerDirective, PopoverDirective, RadioButtonComponent, RadioButtonGroupComponent, SearchbarComponent, SegmentedControlComponent, SelectComponent, SideNavComponent, SplitButtonComponent, SwitchComponent, TabComponent, TagComponent, TextInputComponent, TextareaComponent, ToastComponent, ToastService, TooltipDirective };
|
|
2853
3744
|
//# sourceMappingURL=design-system-rte-angular.mjs.map
|