@design-system-rte/angular 0.14.0 → 0.16.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/banner/banner.component.mjs +3 -3
- package/esm2022/lib/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +38 -0
- package/esm2022/lib/components/breadcrumbs/breadcrumbs.component.mjs +5 -4
- package/esm2022/lib/components/button/button.component.mjs +12 -17
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +3 -3
- package/esm2022/lib/components/checkbox-group/checkbox-group.component.mjs +3 -3
- package/esm2022/lib/components/divider/divider.component.mjs +3 -3
- package/esm2022/lib/components/dropdown/dropdown-trigger/dropdown-trigger.directive.mjs +11 -3
- package/esm2022/lib/components/dropdown/dropdown.directive.mjs +12 -13
- package/esm2022/lib/components/dropdown/dropdown.utils.mjs +40 -0
- package/esm2022/lib/components/icon-button/icon-button.component.mjs +13 -3
- package/esm2022/lib/components/icon-button-toggle/icon-button-toggle.component.mjs +1 -1
- package/esm2022/lib/components/link/link.component.mjs +5 -3
- package/esm2022/lib/components/modal/modal-trigger/modal-trigger.directive.mjs +31 -0
- package/esm2022/lib/components/modal/modal.component.mjs +48 -0
- package/esm2022/lib/components/modal/modal.directive.mjs +118 -0
- package/esm2022/lib/components/modal/modal.module.mjs +17 -0
- package/esm2022/lib/components/popover/popover.component.mjs +11 -28
- package/esm2022/lib/components/radio-button/radio-button.component.mjs +3 -3
- package/esm2022/lib/components/radio-button-group/radio-button-group.component.mjs +3 -3
- package/esm2022/lib/components/split-button/split-button.component.mjs +31 -5
- package/esm2022/lib/components/text-input/text-input.component.mjs +3 -3
- package/esm2022/lib/components/textarea/textarea.component.mjs +3 -3
- package/esm2022/lib/components/tooltip/tooltip.directive.mjs +18 -3
- package/esm2022/lib/services/focus-trap.service.mjs +64 -0
- package/esm2022/lib/services/overlay.service.mjs +19 -4
- package/esm2022/public-api.mjs +4 -1
- package/fesm2022/design-system-rte-angular.mjs +1149 -774
- package/fesm2022/design-system-rte-angular.mjs.map +1 -1
- package/lib/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +16 -0
- package/lib/components/breadcrumbs/breadcrumbs.component.d.ts +2 -1
- package/lib/components/button/button.component.d.ts +4 -12
- package/lib/components/chip/chip.component.d.ts +1 -1
- package/lib/components/dropdown/dropdown-trigger/dropdown-trigger.directive.d.ts +4 -1
- package/lib/components/dropdown/dropdown.directive.d.ts +3 -1
- package/lib/components/dropdown/dropdown.utils.d.ts +4 -0
- package/lib/components/icon-button/icon-button.component.d.ts +8 -2
- package/lib/components/icon-button-toggle/icon-button-toggle.component.d.ts +1 -1
- package/lib/components/link/link.component.d.ts +3 -1
- package/lib/components/modal/modal-trigger/modal-trigger.directive.d.ts +11 -0
- package/lib/components/modal/modal.component.d.ts +28 -0
- package/lib/components/modal/modal.directive.d.ts +40 -0
- package/lib/components/modal/modal.module.d.ts +8 -0
- package/lib/components/popover/popover.component.d.ts +5 -6
- package/lib/components/split-button/split-button.component.d.ts +11 -4
- package/lib/components/text-input/text-input.component.d.ts +1 -1
- package/lib/components/tooltip/tooltip.component.d.ts +1 -1
- package/lib/components/tooltip/tooltip.directive.d.ts +2 -1
- package/lib/services/focus-trap.service.d.ts +17 -0
- package/lib/services/overlay.service.d.ts +2 -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,
|
|
2
|
+
import { input, Component, ChangeDetectionStrategy, HostBinding, Directive, inject, Injectable, DestroyRef, ChangeDetectorRef, effect, computed, ElementRef, ViewContainerRef, Renderer2, HostListener, output, contentChild, NgModule, signal, viewChild, 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';
|
|
@@ -9,45 +9,42 @@ import { isValidIconName as isValidIconName$1 } from '@design-system-rte/core/co
|
|
|
9
9
|
import { labelSize } from '@design-system-rte/core/components/radio-button/radio-button.constants';
|
|
10
10
|
import { TOOLTIP_GAP_ARROW, TOOLTIP_GAP } from '@design-system-rte/core/components/tooltip/tooltip.constants';
|
|
11
11
|
import { getAutoPlacement, getCoordinates, getAutoPlacementDropdown, getAutoAlignment } from '@design-system-rte/core/components/utils/auto-placement';
|
|
12
|
+
import { FOCUSABLE_ELEMENTS_QUERY } from '@design-system-rte/core/constants/dom/dom.constants';
|
|
12
13
|
import { splitButtonLeftIconSize, splitButtonRightIconSize } from '@design-system-rte/core/components/split-button/split-button.constants';
|
|
14
|
+
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';
|
|
15
|
+
import { BehaviorSubject } from 'rxjs';
|
|
16
|
+
import { map } from 'rxjs/operators';
|
|
17
|
+
import { DropdownManager } from '@design-system-rte/core/components/dropdown/DropdownManager';
|
|
13
18
|
import { buttonIconSize } from '@design-system-rte/core/components/button/common/common-button.constants';
|
|
14
|
-
import { CHIP_TYPE_TO_ARIA_ROLE_MAP } from '@design-system-rte/core/components/chip/chip.constants';
|
|
15
|
-
import { SPACE_KEY, ENTER_KEY, BACKSPACE_KEY, DELETE_KEY, ARROW_RIGHT_KEY, ARROW_LEFT_KEY, TAB_KEY, ARROW_DOWN_KEY, ARROW_UP_KEY, ESCAPE_KEY } from '@design-system-rte/core/constants/keyboard/keyboard.constants';
|
|
16
19
|
import { getShowIcon, getShowText, getDisplayCount, getBadgeIconSize, getShowBadge } from '@design-system-rte/core/components/badge/badge.utils';
|
|
20
|
+
import { CHIP_TYPE_TO_ARIA_ROLE_MAP } from '@design-system-rte/core/components/chip/chip.constants';
|
|
17
21
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
18
22
|
import { TEXTAREA_ICON_SIZE, TEXTAREA_REQUIREMENT_INDICATOR_VALUE } from '@design-system-rte/core/components/textarea/textarea.constants';
|
|
19
23
|
import { switchHeight, switchWidth } from '@design-system-rte/core/components/switch/switch.constants';
|
|
20
24
|
import { isValidSegmentedControlOptions, focusNextSegmentElement, focusPreviousSegmentElement, focusPreviousNotSegmentElement, focusNextNotSegmentElement, getSegmentPosition } from '@design-system-rte/core/components/segmented-control/segmented-control-utils';
|
|
21
|
-
import { FOCUSABLE_ELEMENTS_QUERY } from '@design-system-rte/core/constants/dom/dom.constants';
|
|
22
25
|
import { BREADCRUMBS_DEFAULT_ARIA_LABEL } from '@design-system-rte/core/components/breadcrumbs/breadcrumbs.constants';
|
|
23
26
|
import { shouldTruncateBreadcrumbs, getBreadcrumbsTruncatedItems } from '@design-system-rte/core/components/breadcrumbs/breadcrumbs.utils';
|
|
24
|
-
import { BehaviorSubject } from 'rxjs';
|
|
25
|
-
import { map } from 'rxjs/operators';
|
|
26
27
|
import { POPOVER_GAP_ARROW, POPOVER_GAP } from '@design-system-rte/core/components/popover/popover.constants';
|
|
28
|
+
import { IconSize } from '@design-system-rte/core/components/icon/icon.constants';
|
|
27
29
|
|
|
28
30
|
class ButtonComponent {
|
|
29
31
|
constructor() {
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.size = input("m");
|
|
33
|
-
this.disabled = input(false);
|
|
34
|
-
this.icon = input("");
|
|
35
|
-
this.ariaLabel = input("");
|
|
36
|
-
this.ariaLabelledBy = input("");
|
|
37
|
-
this.buttonType = input("button");
|
|
38
|
-
this.click = output();
|
|
32
|
+
this.rteButtonVariant = input("primary");
|
|
33
|
+
this.rteButtonSize = input("m");
|
|
39
34
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
this.click.emit();
|
|
35
|
+
get classes() {
|
|
36
|
+
return `rte-button ${this.rteButtonVariant()} size-${this.rteButtonSize()}`;
|
|
43
37
|
}
|
|
44
38
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
45
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: ButtonComponent, isStandalone: true, selector: "
|
|
39
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: ButtonComponent, isStandalone: true, selector: "button[rteButton]", inputs: { rteButtonVariant: { classPropertyName: "rteButtonVariant", publicName: "rteButtonVariant", isSignal: true, isRequired: false, transformFunction: null }, rteButtonSize: { classPropertyName: "rteButtonSize", publicName: "rteButtonSize", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.classes" } }, ngImport: i0, template: "<span class=\"rte-button-label\">\n <ng-content/>\n</span>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";:host{display:inline-flex;flex-shrink:0;align-items:center;cursor:pointer;justify-content:center;width:fit-content}:host:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}:host.size-s{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-size:14px;letter-spacing:-.5px;font-weight:600;line-height:20px;height:24px;border-radius:4px;padding:4px 8px}:host.size-s .rte-button-label{margin:0 4px}:host.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;height:32px;border-radius:4px;padding:4px 12px}:host.size-m .rte-button-label{margin:0 6px}:host.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;height:40px;border-radius:8px;padding:4px 16px}:host.size-l .rte-button-label{margin:0 8px}:host.primary{border:var(--border-brand-default);color:var(--content-primary-inverse);background:var(--background-brand-default)}:host.primary:hover{background:var(--background-brand-hover);border:var(--background-brand-hover)}:host.primary:active{background:var(--background-brand-pressed)}:host.primary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);box-shadow:none;cursor:default}:host.secondary{background:var(--background-default);border:solid 1px var(--border-brand-default);color:var(--content-brand-default)}:host.secondary:hover{background:var(--background-brand-inverse-hover)}:host.secondary:active{background:var(--background-brand-inverse-pressed)}:host.secondary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);cursor:default}:host.text{background:transparent;border:none;color:var(--content-brand-default)}:host.text:hover{background:var(--background-brand-inverse-hover)}:host.text:active{background:var(--background-brand-inverse-pressed)}:host.text:disabled{background:var(--background-disabled);color:var(--content-disabled);cursor:default}:host.transparent{background:transparent;border:none;color:var(--content-brand-default)}:host.transparent:hover{color:var(--content-brand-hover)}:host.transparent:active{color:var(--content-brand-pressed)}:host.transparent:disabled{color:var(--content-disabled);box-shadow:none;cursor:default}:host.danger{background:var(--background-danger-default);border:none;color:var(--content-primary-inverse);border-radius:8px}:host.danger:hover{background:var(--background-danger-hover)}:host.danger:active{background:var(--background-danger-pressed)}:host.danger:disabled{background:var(--background-disabled);border:var(--border-disabled);color:var(--content-disabled);box-shadow:none;cursor:default}:host.neutral{background:none;border:none;color:var(--content-primary)}:host.neutral:hover{color:var(--content-secondary)}:host.neutral:active{color:var(--content-tertiary)}:host.neutral:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}:host.reverse{background:none;border:none;color:var(--content-primary-inverse)}:host.reverse:hover{color:var(--background-hover)}:host.reverse:active{color:var(--content-primary-inverse)}:host.reverse:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
46
40
|
}
|
|
47
41
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
48
42
|
type: Component,
|
|
49
|
-
args: [{ selector: "
|
|
50
|
-
}]
|
|
43
|
+
args: [{ selector: "button[rteButton]", standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"rte-button-label\">\n <ng-content/>\n</span>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";:host{display:inline-flex;flex-shrink:0;align-items:center;cursor:pointer;justify-content:center;width:fit-content}:host:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}:host.size-s{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Nunito;font-size:14px;letter-spacing:-.5px;font-weight:600;line-height:20px;height:24px;border-radius:4px;padding:4px 8px}:host.size-s .rte-button-label{margin:0 4px}:host.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;height:32px;border-radius:4px;padding:4px 12px}:host.size-m .rte-button-label{margin:0 6px}:host.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;height:40px;border-radius:8px;padding:4px 16px}:host.size-l .rte-button-label{margin:0 8px}:host.primary{border:var(--border-brand-default);color:var(--content-primary-inverse);background:var(--background-brand-default)}:host.primary:hover{background:var(--background-brand-hover);border:var(--background-brand-hover)}:host.primary:active{background:var(--background-brand-pressed)}:host.primary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);box-shadow:none;cursor:default}:host.secondary{background:var(--background-default);border:solid 1px var(--border-brand-default);color:var(--content-brand-default)}:host.secondary:hover{background:var(--background-brand-inverse-hover)}:host.secondary:active{background:var(--background-brand-inverse-pressed)}:host.secondary:disabled{background:var(--background-disabled);border:solid 1px var(--border-disabled);color:var(--content-disabled);cursor:default}:host.text{background:transparent;border:none;color:var(--content-brand-default)}:host.text:hover{background:var(--background-brand-inverse-hover)}:host.text:active{background:var(--background-brand-inverse-pressed)}:host.text:disabled{background:var(--background-disabled);color:var(--content-disabled);cursor:default}:host.transparent{background:transparent;border:none;color:var(--content-brand-default)}:host.transparent:hover{color:var(--content-brand-hover)}:host.transparent:active{color:var(--content-brand-pressed)}:host.transparent:disabled{color:var(--content-disabled);box-shadow:none;cursor:default}:host.danger{background:var(--background-danger-default);border:none;color:var(--content-primary-inverse);border-radius:8px}:host.danger:hover{background:var(--background-danger-hover)}:host.danger:active{background:var(--background-danger-pressed)}:host.danger:disabled{background:var(--background-disabled);border:var(--border-disabled);color:var(--content-disabled);box-shadow:none;cursor:default}:host.neutral{background:none;border:none;color:var(--content-primary)}:host.neutral:hover{color:var(--content-secondary)}:host.neutral:active{color:var(--content-tertiary)}:host.neutral:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}:host.reverse{background:none;border:none;color:var(--content-primary-inverse)}:host.reverse:hover{color:var(--background-hover)}:host.reverse:active{color:var(--content-primary-inverse)}:host.reverse:disabled{background:var(--background-disabled);box-shadow:none;color:var(--content-disabled);cursor:default}\n"] }]
|
|
44
|
+
}], propDecorators: { classes: [{
|
|
45
|
+
type: HostBinding,
|
|
46
|
+
args: ["class"]
|
|
47
|
+
}] } });
|
|
51
48
|
|
|
52
49
|
class GridDirective {
|
|
53
50
|
get hostClasses() {
|
|
@@ -490,13 +487,15 @@ class LinkComponent {
|
|
|
490
487
|
this.href = input("#");
|
|
491
488
|
this.subtle = input(false);
|
|
492
489
|
this.externalLink = input(false);
|
|
490
|
+
this.reverse = input(false);
|
|
491
|
+
this.maxWidth = input();
|
|
493
492
|
}
|
|
494
493
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
495
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: LinkComponent, isStandalone: true, selector: "rte-link", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, subtle: { classPropertyName: "subtle", publicName: "subtle", isSignal: true, isRequired: false, transformFunction: null }, externalLink: { classPropertyName: "externalLink", publicName: "externalLink", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<a
|
|
494
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: LinkComponent, isStandalone: true, selector: "rte-link", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, subtle: { classPropertyName: "subtle", publicName: "subtle", isSignal: true, isRequired: false, transformFunction: null }, externalLink: { classPropertyName: "externalLink", publicName: "externalLink", isSignal: true, isRequired: false, transformFunction: null }, reverse: { classPropertyName: "reverse", publicName: "reverse", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<a\n href=\"{{ href() }}\"\n class=\"rte-link\"\n role=\"link\"\n [ngClass]=\"{ subtle: subtle(), reverse: reverse() }\"\n [target]=\"externalLink() ? '_blank' : undefined\"\n [rel]=\"externalLink() ? 'noopener noreferrer' : null\"\n [style.max-width]=\"maxWidth() + 'px'\"\n>\n <span class=\"rte-link-label\" [style.max-width]=\"maxWidth() + 'px'\">\n {{ label() }}\n </span>\n <rte-icon\n *ngIf=\"externalLink()\"\n name=\"external-link\"\n style=\"align-self: start; margin-left: 2px\"\n [size]=\"12\"\n ></rte-icon>\n</a>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-link{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;align-items:center;cursor:pointer;display:inline-flex;justify-content:center}.rte-link:visited{color:var(--content-link-visited-default);text-decoration:underline}.rte-link:visited:hover{color:var(--content-link-visited-hover);text-decoration:none}.rte-link:visited:active{color:var(--content-link-visited-pressed);text-decoration:underline}.rte-link:visited:focus-visible{color:var(--content-link-visited-default);text-decoration:underline;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-link:not(:visited){color:var(--content-link-default)}.rte-link:not(:visited):hover{color:var(--content-link-hover);text-decoration:none}.rte-link:not(:visited):active{color:var(--content-link-pressed);text-decoration:underline}.rte-link:not(:visited):focus-visible{color:var(--content-link-default);text-decoration:underline;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-link.subtle:visited{color:var(--content-primary);text-decoration:none}.rte-link.subtle:visited:hover{color:var(--content-link-secondary);text-decoration:underline}.rte-link.subtle:visited:active{color:var(--content-link-primary);text-decoration:none}.rte-link.subtle:visited:focus-visible{color:var(--content-link-primary);text-decoration:none;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-link.subtle:not(:visited){color:var(--content-primary);text-decoration:none}.rte-link.subtle:not(:visited):hover{color:var(--content-secondary);text-decoration:underline}.rte-link.subtle:not(:visited):active{color:var(--content-primary);text-decoration:none}.rte-link.subtle:not(:visited):focus-visible{color:var(--content-primary);text-decoration:none;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-link.subtle.reverse{color:var(--content-primary-inverse);text-decoration:none}.rte-link.subtle.reverse:hover{color:var(--content-primary-inverse);text-decoration:underline}.rte-link.subtle.reverse:focus-visible{color:var(--content-primary-inverse);text-decoration:underline;outline:1px solid var(--border-inverse);outline-offset:4px;border-radius:4px}.rte-link.reverse{color:var(--content-primary-inverse);text-decoration:underline}.rte-link.reverse:hover{color:var(--content-primary-inverse);text-decoration:none}.rte-link.reverse:focus-visible{color:var(--content-primary-inverse);text-decoration:underline;outline:1px solid var(--border-inverse);outline-offset:4px;border-radius:4px}.rte-link .rte-link-external-icon{align-self:start;margin-left:2px}.rte-link .rte-link-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\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 }); }
|
|
496
495
|
}
|
|
497
496
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: LinkComponent, decorators: [{
|
|
498
497
|
type: Component,
|
|
499
|
-
args: [{ selector: "rte-link", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<a
|
|
498
|
+
args: [{ selector: "rte-link", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n href=\"{{ href() }}\"\n class=\"rte-link\"\n role=\"link\"\n [ngClass]=\"{ subtle: subtle(), reverse: reverse() }\"\n [target]=\"externalLink() ? '_blank' : undefined\"\n [rel]=\"externalLink() ? 'noopener noreferrer' : null\"\n [style.max-width]=\"maxWidth() + 'px'\"\n>\n <span class=\"rte-link-label\" [style.max-width]=\"maxWidth() + 'px'\">\n {{ label() }}\n </span>\n <rte-icon\n *ngIf=\"externalLink()\"\n name=\"external-link\"\n style=\"align-self: start; margin-left: 2px\"\n [size]=\"12\"\n ></rte-icon>\n</a>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-link{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;align-items:center;cursor:pointer;display:inline-flex;justify-content:center}.rte-link:visited{color:var(--content-link-visited-default);text-decoration:underline}.rte-link:visited:hover{color:var(--content-link-visited-hover);text-decoration:none}.rte-link:visited:active{color:var(--content-link-visited-pressed);text-decoration:underline}.rte-link:visited:focus-visible{color:var(--content-link-visited-default);text-decoration:underline;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-link:not(:visited){color:var(--content-link-default)}.rte-link:not(:visited):hover{color:var(--content-link-hover);text-decoration:none}.rte-link:not(:visited):active{color:var(--content-link-pressed);text-decoration:underline}.rte-link:not(:visited):focus-visible{color:var(--content-link-default);text-decoration:underline;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-link.subtle:visited{color:var(--content-primary);text-decoration:none}.rte-link.subtle:visited:hover{color:var(--content-link-secondary);text-decoration:underline}.rte-link.subtle:visited:active{color:var(--content-link-primary);text-decoration:none}.rte-link.subtle:visited:focus-visible{color:var(--content-link-primary);text-decoration:none;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-link.subtle:not(:visited){color:var(--content-primary);text-decoration:none}.rte-link.subtle:not(:visited):hover{color:var(--content-secondary);text-decoration:underline}.rte-link.subtle:not(:visited):active{color:var(--content-primary);text-decoration:none}.rte-link.subtle:not(:visited):focus-visible{color:var(--content-primary);text-decoration:none;outline:1px solid var(--border-brand-focused);outline-offset:4px;border-radius:4px}.rte-link.subtle.reverse{color:var(--content-primary-inverse);text-decoration:none}.rte-link.subtle.reverse:hover{color:var(--content-primary-inverse);text-decoration:underline}.rte-link.subtle.reverse:focus-visible{color:var(--content-primary-inverse);text-decoration:underline;outline:1px solid var(--border-inverse);outline-offset:4px;border-radius:4px}.rte-link.reverse{color:var(--content-primary-inverse);text-decoration:underline}.rte-link.reverse:hover{color:var(--content-primary-inverse);text-decoration:none}.rte-link.reverse:focus-visible{color:var(--content-primary-inverse);text-decoration:underline;outline:1px solid var(--border-inverse);outline-offset:4px;border-radius:4px}.rte-link .rte-link-external-icon{align-self:start;margin-left:2px}.rte-link .rte-link-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n"] }]
|
|
500
499
|
}] });
|
|
501
500
|
|
|
502
501
|
class RadioButtonComponent {
|
|
@@ -511,11 +510,11 @@ class RadioButtonComponent {
|
|
|
511
510
|
this.isDisplayed = computed(() => !(this.disabled() && this.error()));
|
|
512
511
|
}
|
|
513
512
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RadioButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
514
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: RadioButtonComponent, isStandalone: true, selector: "rte-radio-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, groupName: { classPropertyName: "groupName", publicName: "groupName", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: " <div *ngIf=\"isDisplayed()\" class=\"rte-radio-button-container\">\n <input\n type=\"radio\"\n class=\"rte-radio-button\"\n [id]=\"label()\"\n [value]=\"label()\"\n [size]=\"labelSize\"\n [name]=\"groupName()\"\n [ngClass]=\"{'error': error(), 'read-only': readOnly()}\"\n [disabled]=\"disabled()\"\n />\n <label \n *ngIf=\"showLabel()\" \n class=\"rte-radio-button-label\" \n [for]=\"label()\"\n [ngClass]=\"{\n 'error': error(),\n 'read-only': readOnly(),\n 'disabled': disabled()\n }\"\n >\n {{ label() }}\n </label>\n </div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-radio-button-container{display:flex;padding-right:4px;align-items:center;gap:12px}.rte-radio-button{appearance:none;display:flex;width:16px;height:16px;padding:0;justify-content:center;align-items:center;border-radius:999px;border:1px solid var(--content-tertiary);background:var(--background-default);position:relative;cursor:pointer;transition:box-shadow .3s ease-in-out;margin:0}.rte-radio-button:before{content:\"\";width:10px;height:10px;border-radius:999px;background:var(--content-brand-default);opacity:0%}.rte-radio-button:after{content:\"\";width:calc(100% + 8px);height:calc(100% + 8px);border-radius:4px;border:1px solid var(--content-primary);position:absolute;z-index:-1;opacity:0%}.rte-radio-button.error{border:1px solid var(--content-danger);transition:box-shadow .3s ease-in-out}.rte-radio-button.error:checked{border:1px solid var(--content-danger)}.rte-radio-button.error:before{background:var(--content-danger)}.rte-radio-button.error:hover{transition:box-shadow .15s ease-in-out;box-shadow:0 0 0 8px var(--background-hover-opacity-50)}.rte-radio-button.error:hover:checked{box-shadow:0 0 0 8px var(--background-danger-hover-opacity-20)}.rte-radio-button.read-only{pointer-events:none;cursor:default}.rte-radio-button.read-only:before{background:var(--content-tertiary)}.rte-radio-button.read-only:checked{border:1px solid var(--content-tertiary)}.rte-radio-button.read-only.error{border:1px solid var(--content-danger)}.rte-radio-button:focus-visible{outline:none}.rte-radio-button:focus-visible:after{opacity:100%}.rte-radio-button:checked{border:1px solid var(--content-brand-default)}.rte-radio-button:checked:before{opacity:100%}.rte-radio-button:hover{box-shadow:0 0 0 8px var(--background-hover-opacity-50)}.rte-radio-button:hover:checked{box-shadow:0 0 0 8px var(--background-brand-hover-opacity-20)}.rte-radio-button:disabled{pointer-events:none;background:var(--background-disabled);border:1px solid var(--content-disabled);cursor:not-allowed}.rte-radio-button:disabled:before{background:var(--content-disabled)}.rte-radio-button-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:var(--content-primary)}.rte-radio-button-label.read-only{pointer-events:none;cursor:default;color:var(--content-tertiary)}.rte-radio-button-label.disabled{pointer-events:none;color:var(--content-disabled)}\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
513
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: RadioButtonComponent, isStandalone: true, selector: "rte-radio-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, groupName: { classPropertyName: "groupName", publicName: "groupName", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: " <div *ngIf=\"isDisplayed()\" class=\"rte-radio-button-container\">\n <input\n type=\"radio\"\n class=\"rte-radio-button\"\n [id]=\"label()\"\n [value]=\"label()\"\n [size]=\"labelSize\"\n [name]=\"groupName()\"\n [ngClass]=\"{'error': error(), 'read-only': readOnly()}\"\n [disabled]=\"disabled()\"\n />\n <label \n *ngIf=\"showLabel()\" \n class=\"rte-radio-button-label\" \n [for]=\"label()\"\n [ngClass]=\"{\n 'error': error(),\n 'read-only': readOnly(),\n 'disabled': disabled()\n }\"\n >\n {{ label() }}\n </label>\n </div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-radio-button-container{display:flex;padding-right:4px;align-items:center;gap:12px}.rte-radio-button{appearance:none;display:flex;width:16px;height:16px;padding:0;justify-content:center;align-items:center;border-radius:999px;border:1px solid var(--content-tertiary);background:var(--background-default);position:relative;cursor:pointer;transition:box-shadow .3s ease-in-out;margin:0}.rte-radio-button:before{content:\"\";width:10px;height:10px;border-radius:999px;background:var(--content-brand-default);opacity:0%}.rte-radio-button:after{content:\"\";width:calc(100% + 8px);height:calc(100% + 8px);border-radius:4px;border:1px solid var(--content-primary);position:absolute;z-index:-1;opacity:0%}.rte-radio-button.error{border:1px solid var(--content-danger-default);transition:box-shadow .3s ease-in-out}.rte-radio-button.error:checked{border:1px solid var(--content-danger-default)}.rte-radio-button.error:before{background:var(--content-danger-default)}.rte-radio-button.error:hover{transition:box-shadow .15s ease-in-out;box-shadow:0 0 0 8px var(--background-hover-opacity-50)}.rte-radio-button.error:hover:checked{box-shadow:0 0 0 8px var(--background-danger-hover-opacity-20)}.rte-radio-button.read-only{pointer-events:none;cursor:default}.rte-radio-button.read-only:before{background:var(--content-tertiary)}.rte-radio-button.read-only:checked{border:1px solid var(--content-tertiary)}.rte-radio-button.read-only.error{border:1px solid var(--content-danger-default)}.rte-radio-button:focus-visible{outline:none}.rte-radio-button:focus-visible:after{opacity:100%}.rte-radio-button:checked{border:1px solid var(--content-brand-default)}.rte-radio-button:checked:before{opacity:100%}.rte-radio-button:hover{box-shadow:0 0 0 8px var(--background-hover-opacity-50)}.rte-radio-button:hover:checked{box-shadow:0 0 0 8px var(--background-brand-hover-opacity-20)}.rte-radio-button:disabled{pointer-events:none;background:var(--background-disabled);border:1px solid var(--content-disabled);cursor:not-allowed}.rte-radio-button:disabled:before{background:var(--content-disabled)}.rte-radio-button-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:var(--content-primary)}.rte-radio-button-label.read-only{pointer-events:none;cursor:default;color:var(--content-tertiary)}.rte-radio-button-label.disabled{pointer-events:none;color:var(--content-disabled)}\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
515
514
|
}
|
|
516
515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RadioButtonComponent, decorators: [{
|
|
517
516
|
type: Component,
|
|
518
|
-
args: [{ selector: "rte-radio-button", imports: [CommonModule], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: " <div *ngIf=\"isDisplayed()\" class=\"rte-radio-button-container\">\n <input\n type=\"radio\"\n class=\"rte-radio-button\"\n [id]=\"label()\"\n [value]=\"label()\"\n [size]=\"labelSize\"\n [name]=\"groupName()\"\n [ngClass]=\"{'error': error(), 'read-only': readOnly()}\"\n [disabled]=\"disabled()\"\n />\n <label \n *ngIf=\"showLabel()\" \n class=\"rte-radio-button-label\" \n [for]=\"label()\"\n [ngClass]=\"{\n 'error': error(),\n 'read-only': readOnly(),\n 'disabled': disabled()\n }\"\n >\n {{ label() }}\n </label>\n </div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-radio-button-container{display:flex;padding-right:4px;align-items:center;gap:12px}.rte-radio-button{appearance:none;display:flex;width:16px;height:16px;padding:0;justify-content:center;align-items:center;border-radius:999px;border:1px solid var(--content-tertiary);background:var(--background-default);position:relative;cursor:pointer;transition:box-shadow .3s ease-in-out;margin:0}.rte-radio-button:before{content:\"\";width:10px;height:10px;border-radius:999px;background:var(--content-brand-default);opacity:0%}.rte-radio-button:after{content:\"\";width:calc(100% + 8px);height:calc(100% + 8px);border-radius:4px;border:1px solid var(--content-primary);position:absolute;z-index:-1;opacity:0%}.rte-radio-button.error{border:1px solid var(--content-danger);transition:box-shadow .3s ease-in-out}.rte-radio-button.error:checked{border:1px solid var(--content-danger)}.rte-radio-button.error:before{background:var(--content-danger)}.rte-radio-button.error:hover{transition:box-shadow .15s ease-in-out;box-shadow:0 0 0 8px var(--background-hover-opacity-50)}.rte-radio-button.error:hover:checked{box-shadow:0 0 0 8px var(--background-danger-hover-opacity-20)}.rte-radio-button.read-only{pointer-events:none;cursor:default}.rte-radio-button.read-only:before{background:var(--content-tertiary)}.rte-radio-button.read-only:checked{border:1px solid var(--content-tertiary)}.rte-radio-button.read-only.error{border:1px solid var(--content-danger)}.rte-radio-button:focus-visible{outline:none}.rte-radio-button:focus-visible:after{opacity:100%}.rte-radio-button:checked{border:1px solid var(--content-brand-default)}.rte-radio-button:checked:before{opacity:100%}.rte-radio-button:hover{box-shadow:0 0 0 8px var(--background-hover-opacity-50)}.rte-radio-button:hover:checked{box-shadow:0 0 0 8px var(--background-brand-hover-opacity-20)}.rte-radio-button:disabled{pointer-events:none;background:var(--background-disabled);border:1px solid var(--content-disabled);cursor:not-allowed}.rte-radio-button:disabled:before{background:var(--content-disabled)}.rte-radio-button-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:var(--content-primary)}.rte-radio-button-label.read-only{pointer-events:none;cursor:default;color:var(--content-tertiary)}.rte-radio-button-label.disabled{pointer-events:none;color:var(--content-disabled)}\n"] }]
|
|
517
|
+
args: [{ selector: "rte-radio-button", imports: [CommonModule], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: " <div *ngIf=\"isDisplayed()\" class=\"rte-radio-button-container\">\n <input\n type=\"radio\"\n class=\"rte-radio-button\"\n [id]=\"label()\"\n [value]=\"label()\"\n [size]=\"labelSize\"\n [name]=\"groupName()\"\n [ngClass]=\"{'error': error(), 'read-only': readOnly()}\"\n [disabled]=\"disabled()\"\n />\n <label \n *ngIf=\"showLabel()\" \n class=\"rte-radio-button-label\" \n [for]=\"label()\"\n [ngClass]=\"{\n 'error': error(),\n 'read-only': readOnly(),\n 'disabled': disabled()\n }\"\n >\n {{ label() }}\n </label>\n </div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-radio-button-container{display:flex;padding-right:4px;align-items:center;gap:12px}.rte-radio-button{appearance:none;display:flex;width:16px;height:16px;padding:0;justify-content:center;align-items:center;border-radius:999px;border:1px solid var(--content-tertiary);background:var(--background-default);position:relative;cursor:pointer;transition:box-shadow .3s ease-in-out;margin:0}.rte-radio-button:before{content:\"\";width:10px;height:10px;border-radius:999px;background:var(--content-brand-default);opacity:0%}.rte-radio-button:after{content:\"\";width:calc(100% + 8px);height:calc(100% + 8px);border-radius:4px;border:1px solid var(--content-primary);position:absolute;z-index:-1;opacity:0%}.rte-radio-button.error{border:1px solid var(--content-danger-default);transition:box-shadow .3s ease-in-out}.rte-radio-button.error:checked{border:1px solid var(--content-danger-default)}.rte-radio-button.error:before{background:var(--content-danger-default)}.rte-radio-button.error:hover{transition:box-shadow .15s ease-in-out;box-shadow:0 0 0 8px var(--background-hover-opacity-50)}.rte-radio-button.error:hover:checked{box-shadow:0 0 0 8px var(--background-danger-hover-opacity-20)}.rte-radio-button.read-only{pointer-events:none;cursor:default}.rte-radio-button.read-only:before{background:var(--content-tertiary)}.rte-radio-button.read-only:checked{border:1px solid var(--content-tertiary)}.rte-radio-button.read-only.error{border:1px solid var(--content-danger-default)}.rte-radio-button:focus-visible{outline:none}.rte-radio-button:focus-visible:after{opacity:100%}.rte-radio-button:checked{border:1px solid var(--content-brand-default)}.rte-radio-button:checked:before{opacity:100%}.rte-radio-button:hover{box-shadow:0 0 0 8px var(--background-hover-opacity-50)}.rte-radio-button:hover:checked{box-shadow:0 0 0 8px var(--background-brand-hover-opacity-20)}.rte-radio-button:disabled{pointer-events:none;background:var(--background-disabled);border:1px solid var(--content-disabled);cursor:not-allowed}.rte-radio-button:disabled:before{background:var(--content-disabled)}.rte-radio-button-label{font-feature-settings:\"liga\" off,\"clig\" off;font-style:normal;font-family:Arial;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:var(--content-primary)}.rte-radio-button-label.read-only{pointer-events:none;cursor:default;color:var(--content-tertiary)}.rte-radio-button-label.disabled{pointer-events:none;color:var(--content-disabled)}\n"] }]
|
|
519
518
|
}] });
|
|
520
519
|
|
|
521
520
|
class RadioButtonGroupComponent {
|
|
@@ -535,11 +534,11 @@ class RadioButtonGroupComponent {
|
|
|
535
534
|
this.isDisplayed = computed(() => !(this.disabled() && this.error()));
|
|
536
535
|
}
|
|
537
536
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RadioButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
538
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: RadioButtonGroupComponent, isStandalone: true, selector: "rte-radio-button-group", inputs: { groupName: { classPropertyName: "groupName", publicName: "groupName", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, showItemsLabel: { classPropertyName: "showItemsLabel", publicName: "showItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, groupTitle: { classPropertyName: "groupTitle", publicName: "groupTitle", isSignal: true, isRequired: false, transformFunction: null }, showGroupTitle: { classPropertyName: "showGroupTitle", publicName: "showGroupTitle", isSignal: true, isRequired: false, transformFunction: null }, groupHelpText: { classPropertyName: "groupHelpText", publicName: "groupHelpText", isSignal: true, isRequired: false, transformFunction: null }, showHelpText: { classPropertyName: "showHelpText", publicName: "showHelpText", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", 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 } }, ngImport: i0, template: "<div \n *ngIf=\"isDisplayed()\"\n class=\"radio-button-group-container\">\n <div\n class=\"radio-button-group-header\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'error': error(),\n 'read-only': readOnly(),\n }\">\n <h3\n *ngIf=\"showGroupTitle()\"\n class=\"group-title\"\n >\n {{ groupTitle() }}\n </h3>\n <p\n *ngIf=\"showHelpText()\"\n class=\"group-help-text\"\n >\n {{ groupHelpText() }}\n\n </p>\n <p\n *ngIf=\"error()\"\n class=\"group-error-message\"\n >\n {{ errorMessage() }}\n </p>\n </div>\n <div class=\"radio-button-group\" \n [ngClass]=\"{'horizontal': direction() === 'horizontal', 'vertical': direction() === 'vertical'}\">\n <ng-container \n *ngFor=\"let item of items()\">\n <rte-radio-button\n [label]=\"item\"\n [groupName]=\"groupName()\"\n [showLabel]=\"showItemsLabel()\"\n [disabled]=\"disabled()\"\n [error]=\"error()\"\n [readOnly]=\"readOnly()\"\n />\n </ng-container>\n </div>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.radio-button-group-container{display:flex;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px}.radio-button-group-container .radio-button-group-header .group-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;align-self:stretch;margin:0}.radio-button-group-container .radio-button-group-header .group-help-text{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-tertiary);align-self:stretch;margin:0}.radio-button-group-container .radio-button-group-header .group-error-message{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-danger);align-self:stretch;margin:4px 0 0}.radio-button-group-container .radio-button-group-header.error .group-title{color:var(--content-danger)}.radio-button-group-container .radio-button-group-header.read-only .group-title{color:var(--content-tertiary)}.radio-button-group-container .radio-button-group-header.read-only .error .group-title{color:var(--content-danger)}.radio-button-group-container .radio-button-group-header.disabled{pointer-events:none}.radio-button-group-container .radio-button-group-header.disabled .group-title,.radio-button-group-container .radio-button-group-header.disabled .group-help-text{color:var(--content-disabled)}.radio-button-group-container .radio-button-group{display:flex;flex-direction:row;padding:0;align-items:flex-start;gap:24px}.radio-button-group-container .radio-button-group.vertical{flex-direction:column;gap:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RadioButtonComponent, selector: "rte-radio-button", inputs: ["label", "groupName", "showLabel", "disabled", "error", "readOnly"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
537
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: RadioButtonGroupComponent, isStandalone: true, selector: "rte-radio-button-group", inputs: { groupName: { classPropertyName: "groupName", publicName: "groupName", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, showItemsLabel: { classPropertyName: "showItemsLabel", publicName: "showItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, groupTitle: { classPropertyName: "groupTitle", publicName: "groupTitle", isSignal: true, isRequired: false, transformFunction: null }, showGroupTitle: { classPropertyName: "showGroupTitle", publicName: "showGroupTitle", isSignal: true, isRequired: false, transformFunction: null }, groupHelpText: { classPropertyName: "groupHelpText", publicName: "groupHelpText", isSignal: true, isRequired: false, transformFunction: null }, showHelpText: { classPropertyName: "showHelpText", publicName: "showHelpText", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", 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 } }, ngImport: i0, template: "<div \n *ngIf=\"isDisplayed()\"\n class=\"radio-button-group-container\">\n <div\n class=\"radio-button-group-header\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'error': error(),\n 'read-only': readOnly(),\n }\">\n <h3\n *ngIf=\"showGroupTitle()\"\n class=\"group-title\"\n >\n {{ groupTitle() }}\n </h3>\n <p\n *ngIf=\"showHelpText()\"\n class=\"group-help-text\"\n >\n {{ groupHelpText() }}\n\n </p>\n <p\n *ngIf=\"error()\"\n class=\"group-error-message\"\n >\n {{ errorMessage() }}\n </p>\n </div>\n <div class=\"radio-button-group\" \n [ngClass]=\"{'horizontal': direction() === 'horizontal', 'vertical': direction() === 'vertical'}\">\n <ng-container \n *ngFor=\"let item of items()\">\n <rte-radio-button\n [label]=\"item\"\n [groupName]=\"groupName()\"\n [showLabel]=\"showItemsLabel()\"\n [disabled]=\"disabled()\"\n [error]=\"error()\"\n [readOnly]=\"readOnly()\"\n />\n </ng-container>\n </div>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.radio-button-group-container{display:flex;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px}.radio-button-group-container .radio-button-group-header .group-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;align-self:stretch;margin:0}.radio-button-group-container .radio-button-group-header .group-help-text{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-tertiary);align-self:stretch;margin:0}.radio-button-group-container .radio-button-group-header .group-error-message{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-danger-default);align-self:stretch;margin:4px 0 0}.radio-button-group-container .radio-button-group-header.error .group-title{color:var(--content-danger-default)}.radio-button-group-container .radio-button-group-header.read-only .group-title{color:var(--content-tertiary)}.radio-button-group-container .radio-button-group-header.read-only .error .group-title{color:var(--content-danger-default)}.radio-button-group-container .radio-button-group-header.disabled{pointer-events:none}.radio-button-group-container .radio-button-group-header.disabled .group-title,.radio-button-group-container .radio-button-group-header.disabled .group-help-text{color:var(--content-disabled)}.radio-button-group-container .radio-button-group{display:flex;flex-direction:row;padding:0;align-items:flex-start;gap:24px}.radio-button-group-container .radio-button-group.vertical{flex-direction:column;gap:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RadioButtonComponent, selector: "rte-radio-button", inputs: ["label", "groupName", "showLabel", "disabled", "error", "readOnly"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
539
538
|
}
|
|
540
539
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RadioButtonGroupComponent, decorators: [{
|
|
541
540
|
type: Component,
|
|
542
|
-
args: [{ selector: "rte-radio-button-group", imports: [CommonModule, RadioButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div \n *ngIf=\"isDisplayed()\"\n class=\"radio-button-group-container\">\n <div\n class=\"radio-button-group-header\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'error': error(),\n 'read-only': readOnly(),\n }\">\n <h3\n *ngIf=\"showGroupTitle()\"\n class=\"group-title\"\n >\n {{ groupTitle() }}\n </h3>\n <p\n *ngIf=\"showHelpText()\"\n class=\"group-help-text\"\n >\n {{ groupHelpText() }}\n\n </p>\n <p\n *ngIf=\"error()\"\n class=\"group-error-message\"\n >\n {{ errorMessage() }}\n </p>\n </div>\n <div class=\"radio-button-group\" \n [ngClass]=\"{'horizontal': direction() === 'horizontal', 'vertical': direction() === 'vertical'}\">\n <ng-container \n *ngFor=\"let item of items()\">\n <rte-radio-button\n [label]=\"item\"\n [groupName]=\"groupName()\"\n [showLabel]=\"showItemsLabel()\"\n [disabled]=\"disabled()\"\n [error]=\"error()\"\n [readOnly]=\"readOnly()\"\n />\n </ng-container>\n </div>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.radio-button-group-container{display:flex;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px}.radio-button-group-container .radio-button-group-header .group-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;align-self:stretch;margin:0}.radio-button-group-container .radio-button-group-header .group-help-text{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-tertiary);align-self:stretch;margin:0}.radio-button-group-container .radio-button-group-header .group-error-message{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-danger);align-self:stretch;margin:4px 0 0}.radio-button-group-container .radio-button-group-header.error .group-title{color:var(--content-danger)}.radio-button-group-container .radio-button-group-header.read-only .group-title{color:var(--content-tertiary)}.radio-button-group-container .radio-button-group-header.read-only .error .group-title{color:var(--content-danger)}.radio-button-group-container .radio-button-group-header.disabled{pointer-events:none}.radio-button-group-container .radio-button-group-header.disabled .group-title,.radio-button-group-container .radio-button-group-header.disabled .group-help-text{color:var(--content-disabled)}.radio-button-group-container .radio-button-group{display:flex;flex-direction:row;padding:0;align-items:flex-start;gap:24px}.radio-button-group-container .radio-button-group.vertical{flex-direction:column;gap:8px}\n"] }]
|
|
541
|
+
args: [{ selector: "rte-radio-button-group", imports: [CommonModule, RadioButtonComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div \n *ngIf=\"isDisplayed()\"\n class=\"radio-button-group-container\">\n <div\n class=\"radio-button-group-header\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'error': error(),\n 'read-only': readOnly(),\n }\">\n <h3\n *ngIf=\"showGroupTitle()\"\n class=\"group-title\"\n >\n {{ groupTitle() }}\n </h3>\n <p\n *ngIf=\"showHelpText()\"\n class=\"group-help-text\"\n >\n {{ groupHelpText() }}\n\n </p>\n <p\n *ngIf=\"error()\"\n class=\"group-error-message\"\n >\n {{ errorMessage() }}\n </p>\n </div>\n <div class=\"radio-button-group\" \n [ngClass]=\"{'horizontal': direction() === 'horizontal', 'vertical': direction() === 'vertical'}\">\n <ng-container \n *ngFor=\"let item of items()\">\n <rte-radio-button\n [label]=\"item\"\n [groupName]=\"groupName()\"\n [showLabel]=\"showItemsLabel()\"\n [disabled]=\"disabled()\"\n [error]=\"error()\"\n [readOnly]=\"readOnly()\"\n />\n </ng-container>\n </div>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.radio-button-group-container{display:flex;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px}.radio-button-group-container .radio-button-group-header .group-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;align-self:stretch;margin:0}.radio-button-group-container .radio-button-group-header .group-help-text{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-tertiary);align-self:stretch;margin:0}.radio-button-group-container .radio-button-group-header .group-error-message{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-danger-default);align-self:stretch;margin:4px 0 0}.radio-button-group-container .radio-button-group-header.error .group-title{color:var(--content-danger-default)}.radio-button-group-container .radio-button-group-header.read-only .group-title{color:var(--content-tertiary)}.radio-button-group-container .radio-button-group-header.read-only .error .group-title{color:var(--content-danger-default)}.radio-button-group-container .radio-button-group-header.disabled{pointer-events:none}.radio-button-group-container .radio-button-group-header.disabled .group-title,.radio-button-group-container .radio-button-group-header.disabled .group-help-text{color:var(--content-disabled)}.radio-button-group-container .radio-button-group{display:flex;flex-direction:row;padding:0;align-items:flex-start;gap:24px}.radio-button-group-container .radio-button-group.vertical{flex-direction:column;gap:8px}\n"] }]
|
|
543
542
|
}] });
|
|
544
543
|
|
|
545
544
|
class CheckboxComponent {
|
|
@@ -564,11 +563,11 @@ class CheckboxComponent {
|
|
|
564
563
|
}
|
|
565
564
|
}
|
|
566
565
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
567
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CheckboxComponent, isStandalone: true, selector: "rte-checkbox", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: " <div class=\"rte-checkbox-container\">\n <input\n type=\"checkbox\"\n class=\"rte-checkbox\"\n [id]=\"id()\"\n [value]=\"value()\"\n [ngClass]=\"{'error': error(), 'read-only': readOnly()}\"\n [disabled]=\"disabled()\"\n [indeterminate]=\"indeterminate()\"\n [checked]=\"checked()\"\n (keydown)=\"onKeydown($event)\"\n />\n <rte-icon class=\"rte-checkbox-icons rte-checkbox-icon-selected\" name=\"check-small\" [size]=\"16\"/> \n <rte-icon class=\"rte-checkbox-icons rte-checkbox-icon-indeterminated\" name=\"check-indeterminate\" [size]=\"16\" /> \n <div class=\"rte-checkbox-text-container\">\n <label \n *ngIf=\"showLabel()\" \n class=\"rte-checkbox-label\" \n [for]=\"id()\"\n [ngClass]=\"{\n 'error': error(),\n 'read-only': readOnly(),\n 'disabled': disabled()\n }\"\n >\n {{ label() }}\n </label>\n <p class=\"rte-checkbox-description\">{{ description() }}</p>\n <p *ngIf=\"error() && errorMessage()\" class=\"rte-checkbox-error\">{{ errorMessage() }}</p>\n </div>\n </div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-checkbox-container{display:flex;gap:12px}.rte-checkbox-container .rte-checkbox{appearance:none;display:flex;width:16px;height:16px;border-radius:2px;border:1px solid var(--content-tertiary);opacity:100%;background:var(--background-default);align-items:center;justify-content:center;margin:4px 0}.rte-checkbox-container .rte-checkbox:before{content:\"\";display:none;position:absolute;border-radius:999px;background:var(--background-hover);width:32px;height:32px;z-index:-1}.rte-checkbox-container .rte-checkbox:active:before{opacity:100%;transform:scale(0);transition:transform 0s,opacity 0s}.rte-checkbox-container .rte-checkbox:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.rte-checkbox-container .rte-checkbox:hover{cursor:pointer}.rte-checkbox-container .rte-checkbox:hover:not(:disabled):before{display:inline-block}.rte-checkbox-container .rte-checkbox:hover:not(:disabled):not(:active):before{opacity:50%;transition:transform .15s ease,opacity .3s ease}.rte-checkbox-container .rte-checkbox:disabled{cursor:default;border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:disabled~.rte-checkbox-text-container label,.rte-checkbox-container .rte-checkbox:disabled~.rte-checkbox-text-container .rte-checkbox-description{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:checked{border:1px solid var(--content-brand-default);background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:checked:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:checked:disabled{border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:checked:disabled~.rte-checkbox-icons{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:checked.error{background:var(--background-danger-default)}.rte-checkbox-container .rte-checkbox:checked:not(:indeterminate)~.rte-checkbox-icon-selected{display:block}.rte-checkbox-container .rte-checkbox:indeterminate{border:1px solid var(--content-brand-default);background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:indeterminate:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:indeterminate:disabled{border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:indeterminate:disabled~.rte-checkbox-icons{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:indeterminate.error{background:var(--background-danger-default)}.rte-checkbox-container .rte-checkbox:indeterminate~.rte-checkbox-icon-indeterminated{display:block}.rte-checkbox-container .rte-checkbox.read-only{pointer-events:none;cursor:default;border:1px solid var(--content-tertiary);opacity:100%;background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-text-container label,.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-text-container .checkbox-description{color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-icons{color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox.read-only.error{border:1px solid var(--content-danger);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox.error{border:1px solid var(--content-danger);background:var(--background-default)}.rte-checkbox-container .rte-checkbox.error:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-danger-hover)}.rte-checkbox-container .rte-checkbox-text-container label{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-primary)}.rte-checkbox-container .rte-checkbox-text-container .rte-checkbox-description{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;color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox-text-container .rte-checkbox-error{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;font-weight:700;margin:0;color:var(--content-danger)}.rte-checkbox-container .rte-checkbox-icons{display:none;z-index:1;pointer-events:none;transform:translateY(4px);position:absolute;color:#fff}\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 }); }
|
|
566
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CheckboxComponent, isStandalone: true, selector: "rte-checkbox", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: " <div class=\"rte-checkbox-container\">\n <input\n type=\"checkbox\"\n class=\"rte-checkbox\"\n [id]=\"id()\"\n [value]=\"value()\"\n [ngClass]=\"{'error': error(), 'read-only': readOnly()}\"\n [disabled]=\"disabled()\"\n [indeterminate]=\"indeterminate()\"\n [checked]=\"checked()\"\n (keydown)=\"onKeydown($event)\"\n />\n <rte-icon class=\"rte-checkbox-icons rte-checkbox-icon-selected\" name=\"check-small\" [size]=\"16\"/> \n <rte-icon class=\"rte-checkbox-icons rte-checkbox-icon-indeterminated\" name=\"check-indeterminate\" [size]=\"16\" /> \n <div class=\"rte-checkbox-text-container\">\n <label \n *ngIf=\"showLabel()\" \n class=\"rte-checkbox-label\" \n [for]=\"id()\"\n [ngClass]=\"{\n 'error': error(),\n 'read-only': readOnly(),\n 'disabled': disabled()\n }\"\n >\n {{ label() }}\n </label>\n <p class=\"rte-checkbox-description\">{{ description() }}</p>\n <p *ngIf=\"error() && errorMessage()\" class=\"rte-checkbox-error\">{{ errorMessage() }}</p>\n </div>\n </div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-checkbox-container{display:flex;gap:12px}.rte-checkbox-container .rte-checkbox{appearance:none;display:flex;width:16px;height:16px;border-radius:2px;border:1px solid var(--content-tertiary);opacity:100%;background:var(--background-default);align-items:center;justify-content:center;margin:4px 0}.rte-checkbox-container .rte-checkbox:before{content:\"\";display:none;position:absolute;border-radius:999px;background:var(--background-hover);width:32px;height:32px;z-index:-1}.rte-checkbox-container .rte-checkbox:active:before{opacity:100%;transform:scale(0);transition:transform 0s,opacity 0s}.rte-checkbox-container .rte-checkbox:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.rte-checkbox-container .rte-checkbox:hover{cursor:pointer}.rte-checkbox-container .rte-checkbox:hover:not(:disabled):before{display:inline-block}.rte-checkbox-container .rte-checkbox:hover:not(:disabled):not(:active):before{opacity:50%;transition:transform .15s ease,opacity .3s ease}.rte-checkbox-container .rte-checkbox:disabled{cursor:default;border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:disabled~.rte-checkbox-text-container label,.rte-checkbox-container .rte-checkbox:disabled~.rte-checkbox-text-container .rte-checkbox-description{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:checked{border:1px solid var(--content-brand-default);background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:checked:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:checked:disabled{border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:checked:disabled~.rte-checkbox-icons{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:checked.error{background:var(--background-danger-default)}.rte-checkbox-container .rte-checkbox:checked:not(:indeterminate)~.rte-checkbox-icon-selected{display:block}.rte-checkbox-container .rte-checkbox:indeterminate{border:1px solid var(--content-brand-default);background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:indeterminate:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:indeterminate:disabled{border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:indeterminate:disabled~.rte-checkbox-icons{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:indeterminate.error{background:var(--background-danger-default)}.rte-checkbox-container .rte-checkbox:indeterminate~.rte-checkbox-icon-indeterminated{display:block}.rte-checkbox-container .rte-checkbox.read-only{pointer-events:none;cursor:default;border:1px solid var(--content-tertiary);opacity:100%;background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-text-container label,.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-text-container .checkbox-description{color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-icons{color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox.read-only.error{border:1px solid var(--content-danger-default);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox.error{border:1px solid var(--content-danger-default);background:var(--background-default)}.rte-checkbox-container .rte-checkbox.error:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-danger-hover)}.rte-checkbox-container .rte-checkbox-text-container label{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-primary)}.rte-checkbox-container .rte-checkbox-text-container .rte-checkbox-description{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;color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox-text-container .rte-checkbox-error{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;font-weight:700;margin:0;color:var(--content-danger-default)}.rte-checkbox-container .rte-checkbox-icons{display:none;z-index:1;pointer-events:none;transform:translateY(4px);position:absolute;color:#fff}\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 }); }
|
|
568
567
|
}
|
|
569
568
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
570
569
|
type: Component,
|
|
571
|
-
args: [{ selector: "rte-checkbox", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: " <div class=\"rte-checkbox-container\">\n <input\n type=\"checkbox\"\n class=\"rte-checkbox\"\n [id]=\"id()\"\n [value]=\"value()\"\n [ngClass]=\"{'error': error(), 'read-only': readOnly()}\"\n [disabled]=\"disabled()\"\n [indeterminate]=\"indeterminate()\"\n [checked]=\"checked()\"\n (keydown)=\"onKeydown($event)\"\n />\n <rte-icon class=\"rte-checkbox-icons rte-checkbox-icon-selected\" name=\"check-small\" [size]=\"16\"/> \n <rte-icon class=\"rte-checkbox-icons rte-checkbox-icon-indeterminated\" name=\"check-indeterminate\" [size]=\"16\" /> \n <div class=\"rte-checkbox-text-container\">\n <label \n *ngIf=\"showLabel()\" \n class=\"rte-checkbox-label\" \n [for]=\"id()\"\n [ngClass]=\"{\n 'error': error(),\n 'read-only': readOnly(),\n 'disabled': disabled()\n }\"\n >\n {{ label() }}\n </label>\n <p class=\"rte-checkbox-description\">{{ description() }}</p>\n <p *ngIf=\"error() && errorMessage()\" class=\"rte-checkbox-error\">{{ errorMessage() }}</p>\n </div>\n </div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-checkbox-container{display:flex;gap:12px}.rte-checkbox-container .rte-checkbox{appearance:none;display:flex;width:16px;height:16px;border-radius:2px;border:1px solid var(--content-tertiary);opacity:100%;background:var(--background-default);align-items:center;justify-content:center;margin:4px 0}.rte-checkbox-container .rte-checkbox:before{content:\"\";display:none;position:absolute;border-radius:999px;background:var(--background-hover);width:32px;height:32px;z-index:-1}.rte-checkbox-container .rte-checkbox:active:before{opacity:100%;transform:scale(0);transition:transform 0s,opacity 0s}.rte-checkbox-container .rte-checkbox:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.rte-checkbox-container .rte-checkbox:hover{cursor:pointer}.rte-checkbox-container .rte-checkbox:hover:not(:disabled):before{display:inline-block}.rte-checkbox-container .rte-checkbox:hover:not(:disabled):not(:active):before{opacity:50%;transition:transform .15s ease,opacity .3s ease}.rte-checkbox-container .rte-checkbox:disabled{cursor:default;border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:disabled~.rte-checkbox-text-container label,.rte-checkbox-container .rte-checkbox:disabled~.rte-checkbox-text-container .rte-checkbox-description{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:checked{border:1px solid var(--content-brand-default);background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:checked:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:checked:disabled{border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:checked:disabled~.rte-checkbox-icons{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:checked.error{background:var(--background-danger-default)}.rte-checkbox-container .rte-checkbox:checked:not(:indeterminate)~.rte-checkbox-icon-selected{display:block}.rte-checkbox-container .rte-checkbox:indeterminate{border:1px solid var(--content-brand-default);background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:indeterminate:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:indeterminate:disabled{border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:indeterminate:disabled~.rte-checkbox-icons{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:indeterminate.error{background:var(--background-danger-default)}.rte-checkbox-container .rte-checkbox:indeterminate~.rte-checkbox-icon-indeterminated{display:block}.rte-checkbox-container .rte-checkbox.read-only{pointer-events:none;cursor:default;border:1px solid var(--content-tertiary);opacity:100%;background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-text-container label,.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-text-container .checkbox-description{color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-icons{color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox.read-only.error{border:1px solid var(--content-danger);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox.error{border:1px solid var(--content-danger);background:var(--background-default)}.rte-checkbox-container .rte-checkbox.error:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-danger-hover)}.rte-checkbox-container .rte-checkbox-text-container label{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-primary)}.rte-checkbox-container .rte-checkbox-text-container .rte-checkbox-description{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;color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox-text-container .rte-checkbox-error{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;font-weight:700;margin:0;color:var(--content-danger)}.rte-checkbox-container .rte-checkbox-icons{display:none;z-index:1;pointer-events:none;transform:translateY(4px);position:absolute;color:#fff}\n"] }]
|
|
570
|
+
args: [{ selector: "rte-checkbox", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: " <div class=\"rte-checkbox-container\">\n <input\n type=\"checkbox\"\n class=\"rte-checkbox\"\n [id]=\"id()\"\n [value]=\"value()\"\n [ngClass]=\"{'error': error(), 'read-only': readOnly()}\"\n [disabled]=\"disabled()\"\n [indeterminate]=\"indeterminate()\"\n [checked]=\"checked()\"\n (keydown)=\"onKeydown($event)\"\n />\n <rte-icon class=\"rte-checkbox-icons rte-checkbox-icon-selected\" name=\"check-small\" [size]=\"16\"/> \n <rte-icon class=\"rte-checkbox-icons rte-checkbox-icon-indeterminated\" name=\"check-indeterminate\" [size]=\"16\" /> \n <div class=\"rte-checkbox-text-container\">\n <label \n *ngIf=\"showLabel()\" \n class=\"rte-checkbox-label\" \n [for]=\"id()\"\n [ngClass]=\"{\n 'error': error(),\n 'read-only': readOnly(),\n 'disabled': disabled()\n }\"\n >\n {{ label() }}\n </label>\n <p class=\"rte-checkbox-description\">{{ description() }}</p>\n <p *ngIf=\"error() && errorMessage()\" class=\"rte-checkbox-error\">{{ errorMessage() }}</p>\n </div>\n </div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-checkbox-container{display:flex;gap:12px}.rte-checkbox-container .rte-checkbox{appearance:none;display:flex;width:16px;height:16px;border-radius:2px;border:1px solid var(--content-tertiary);opacity:100%;background:var(--background-default);align-items:center;justify-content:center;margin:4px 0}.rte-checkbox-container .rte-checkbox:before{content:\"\";display:none;position:absolute;border-radius:999px;background:var(--background-hover);width:32px;height:32px;z-index:-1}.rte-checkbox-container .rte-checkbox:active:before{opacity:100%;transform:scale(0);transition:transform 0s,opacity 0s}.rte-checkbox-container .rte-checkbox:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.rte-checkbox-container .rte-checkbox:hover{cursor:pointer}.rte-checkbox-container .rte-checkbox:hover:not(:disabled):before{display:inline-block}.rte-checkbox-container .rte-checkbox:hover:not(:disabled):not(:active):before{opacity:50%;transition:transform .15s ease,opacity .3s ease}.rte-checkbox-container .rte-checkbox:disabled{cursor:default;border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:disabled~.rte-checkbox-text-container label,.rte-checkbox-container .rte-checkbox:disabled~.rte-checkbox-text-container .rte-checkbox-description{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:checked{border:1px solid var(--content-brand-default);background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:checked:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:checked:disabled{border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:checked:disabled~.rte-checkbox-icons{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:checked.error{background:var(--background-danger-default)}.rte-checkbox-container .rte-checkbox:checked:not(:indeterminate)~.rte-checkbox-icon-selected{display:block}.rte-checkbox-container .rte-checkbox:indeterminate{border:1px solid var(--content-brand-default);background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:indeterminate:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-brand-default)}.rte-checkbox-container .rte-checkbox:indeterminate:disabled{border:1px solid var(--content-disabled);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox:indeterminate:disabled~.rte-checkbox-icons{color:var(--content-disabled)}.rte-checkbox-container .rte-checkbox:indeterminate.error{background:var(--background-danger-default)}.rte-checkbox-container .rte-checkbox:indeterminate~.rte-checkbox-icon-indeterminated{display:block}.rte-checkbox-container .rte-checkbox.read-only{pointer-events:none;cursor:default;border:1px solid var(--content-tertiary);opacity:100%;background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-text-container label,.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-text-container .checkbox-description{color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox.read-only~.rte-checkbox-icons{color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox.read-only.error{border:1px solid var(--content-danger-default);background:var(--background-disabled)}.rte-checkbox-container .rte-checkbox.error{border:1px solid var(--content-danger-default);background:var(--background-default)}.rte-checkbox-container .rte-checkbox.error:hover:not(:disabled):not(:active):before{opacity:20%;background:var(--background-danger-hover)}.rte-checkbox-container .rte-checkbox-text-container label{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-primary)}.rte-checkbox-container .rte-checkbox-text-container .rte-checkbox-description{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;color:var(--content-tertiary)}.rte-checkbox-container .rte-checkbox-text-container .rte-checkbox-error{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;font-weight:700;margin:0;color:var(--content-danger-default)}.rte-checkbox-container .rte-checkbox-icons{display:none;z-index:1;pointer-events:none;transform:translateY(4px);position:absolute;color:#fff}\n"] }]
|
|
572
571
|
}] });
|
|
573
572
|
|
|
574
573
|
class CheckboxGroupComponent {
|
|
@@ -587,30 +586,42 @@ class CheckboxGroupComponent {
|
|
|
587
586
|
this.isDisplayed = computed(() => !(this.disabled() && this.error()));
|
|
588
587
|
}
|
|
589
588
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CheckboxGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
590
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CheckboxGroupComponent, isStandalone: true, selector: "rte-checkbox-group", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, showItemsLabel: { classPropertyName: "showItemsLabel", publicName: "showItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, groupTitle: { classPropertyName: "groupTitle", publicName: "groupTitle", isSignal: true, isRequired: false, transformFunction: null }, showGroupTitle: { classPropertyName: "showGroupTitle", publicName: "showGroupTitle", isSignal: true, isRequired: false, transformFunction: null }, groupHelpText: { classPropertyName: "groupHelpText", publicName: "groupHelpText", isSignal: true, isRequired: false, transformFunction: null }, showHelpText: { classPropertyName: "showHelpText", publicName: "showHelpText", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", 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 } }, ngImport: i0, template: "<div \n *ngIf=\"isDisplayed()\"\n class=\"checkbox-group-container\">\n <div\n class=\"checkbox-group-header\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'error': error(),\n 'read-only': readOnly(),\n }\">\n <h3\n *ngIf=\"showGroupTitle()\"\n class=\"group-title\"\n >\n {{ groupTitle() }}\n </h3>\n <p\n *ngIf=\"showHelpText()\"\n class=\"group-help-text\"\n >\n {{ groupHelpText() }}\n\n </p>\n <p\n *ngIf=\"error()\"\n class=\"group-error-message\"\n >\n {{ errorMessage() }}\n </p>\n </div>\n <div class=\"checkbox-group\" \n [ngClass]=\"{'horizontal': direction() === 'horizontal', 'vertical': direction() === 'vertical'}\">\n <ng-container \n *ngFor=\"let item of items(); let i = index\">\n <rte-checkbox\n [id]=\"item + '-' + i\"\n [label]=\"item\"\n [showLabel]=\"showItemsLabel()\"\n [disabled]=\"disabled()\"\n [error]=\"error()\"\n [readOnly]=\"readOnly()\"\n />\n </ng-container>\n </div>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.checkbox-group-container{display:flex;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px}.checkbox-group-container .checkbox-group-header .group-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;align-self:stretch;margin:0}.checkbox-group-container .checkbox-group-header .group-help-text{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-tertiary);align-self:stretch;margin:0}.checkbox-group-container .checkbox-group-header .group-error-message{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-danger);align-self:stretch;margin:4px 0 0}.checkbox-group-container .checkbox-group-header.error .group-title{color:var(--content-danger)}.checkbox-group-container .checkbox-group-header.read-only .group-title{color:var(--content-tertiary)}.checkbox-group-container .checkbox-group-header.read-only .error .group-title{color:var(--content-danger)}.checkbox-group-container .checkbox-group-header.disabled{pointer-events:none}.checkbox-group-container .checkbox-group-header.disabled .group-title,.checkbox-group-container .checkbox-group-header.disabled .group-help-text{color:var(--content-disabled)}.checkbox-group-container .checkbox-group{display:flex;flex-direction:row;padding:0;align-items:flex-start;gap:24px}.checkbox-group-container .checkbox-group.vertical{flex-direction:column;gap:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CheckboxComponent, selector: "rte-checkbox", inputs: ["id", "label", "value", "indeterminate", "description", "showLabel", "disabled", "error", "errorMessage", "readOnly", "checked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
589
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: CheckboxGroupComponent, isStandalone: true, selector: "rte-checkbox-group", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, showItemsLabel: { classPropertyName: "showItemsLabel", publicName: "showItemsLabel", isSignal: true, isRequired: false, transformFunction: null }, groupTitle: { classPropertyName: "groupTitle", publicName: "groupTitle", isSignal: true, isRequired: false, transformFunction: null }, showGroupTitle: { classPropertyName: "showGroupTitle", publicName: "showGroupTitle", isSignal: true, isRequired: false, transformFunction: null }, groupHelpText: { classPropertyName: "groupHelpText", publicName: "groupHelpText", isSignal: true, isRequired: false, transformFunction: null }, showHelpText: { classPropertyName: "showHelpText", publicName: "showHelpText", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", 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 } }, ngImport: i0, template: "<div \n *ngIf=\"isDisplayed()\"\n class=\"checkbox-group-container\">\n <div\n class=\"checkbox-group-header\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'error': error(),\n 'read-only': readOnly(),\n }\">\n <h3\n *ngIf=\"showGroupTitle()\"\n class=\"group-title\"\n >\n {{ groupTitle() }}\n </h3>\n <p\n *ngIf=\"showHelpText()\"\n class=\"group-help-text\"\n >\n {{ groupHelpText() }}\n\n </p>\n <p\n *ngIf=\"error()\"\n class=\"group-error-message\"\n >\n {{ errorMessage() }}\n </p>\n </div>\n <div class=\"checkbox-group\" \n [ngClass]=\"{'horizontal': direction() === 'horizontal', 'vertical': direction() === 'vertical'}\">\n <ng-container \n *ngFor=\"let item of items(); let i = index\">\n <rte-checkbox\n [id]=\"item + '-' + i\"\n [label]=\"item\"\n [showLabel]=\"showItemsLabel()\"\n [disabled]=\"disabled()\"\n [error]=\"error()\"\n [readOnly]=\"readOnly()\"\n />\n </ng-container>\n </div>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.checkbox-group-container{display:flex;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px}.checkbox-group-container .checkbox-group-header .group-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;align-self:stretch;margin:0}.checkbox-group-container .checkbox-group-header .group-help-text{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-tertiary);align-self:stretch;margin:0}.checkbox-group-container .checkbox-group-header .group-error-message{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-danger-default);align-self:stretch;margin:4px 0 0}.checkbox-group-container .checkbox-group-header.error .group-title{color:var(--content-danger-default)}.checkbox-group-container .checkbox-group-header.read-only .group-title{color:var(--content-tertiary)}.checkbox-group-container .checkbox-group-header.read-only .error .group-title{color:var(--content-danger-default)}.checkbox-group-container .checkbox-group-header.disabled{pointer-events:none}.checkbox-group-container .checkbox-group-header.disabled .group-title,.checkbox-group-container .checkbox-group-header.disabled .group-help-text{color:var(--content-disabled)}.checkbox-group-container .checkbox-group{display:flex;flex-direction:row;padding:0;align-items:flex-start;gap:24px}.checkbox-group-container .checkbox-group.vertical{flex-direction:column;gap:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CheckboxComponent, selector: "rte-checkbox", inputs: ["id", "label", "value", "indeterminate", "description", "showLabel", "disabled", "error", "errorMessage", "readOnly", "checked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
591
590
|
}
|
|
592
591
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CheckboxGroupComponent, decorators: [{
|
|
593
592
|
type: Component,
|
|
594
|
-
args: [{ selector: "rte-checkbox-group", imports: [CommonModule, CheckboxComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div \n *ngIf=\"isDisplayed()\"\n class=\"checkbox-group-container\">\n <div\n class=\"checkbox-group-header\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'error': error(),\n 'read-only': readOnly(),\n }\">\n <h3\n *ngIf=\"showGroupTitle()\"\n class=\"group-title\"\n >\n {{ groupTitle() }}\n </h3>\n <p\n *ngIf=\"showHelpText()\"\n class=\"group-help-text\"\n >\n {{ groupHelpText() }}\n\n </p>\n <p\n *ngIf=\"error()\"\n class=\"group-error-message\"\n >\n {{ errorMessage() }}\n </p>\n </div>\n <div class=\"checkbox-group\" \n [ngClass]=\"{'horizontal': direction() === 'horizontal', 'vertical': direction() === 'vertical'}\">\n <ng-container \n *ngFor=\"let item of items(); let i = index\">\n <rte-checkbox\n [id]=\"item + '-' + i\"\n [label]=\"item\"\n [showLabel]=\"showItemsLabel()\"\n [disabled]=\"disabled()\"\n [error]=\"error()\"\n [readOnly]=\"readOnly()\"\n />\n </ng-container>\n </div>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.checkbox-group-container{display:flex;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px}.checkbox-group-container .checkbox-group-header .group-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;align-self:stretch;margin:0}.checkbox-group-container .checkbox-group-header .group-help-text{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-tertiary);align-self:stretch;margin:0}.checkbox-group-container .checkbox-group-header .group-error-message{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-danger);align-self:stretch;margin:4px 0 0}.checkbox-group-container .checkbox-group-header.error .group-title{color:var(--content-danger)}.checkbox-group-container .checkbox-group-header.read-only .group-title{color:var(--content-tertiary)}.checkbox-group-container .checkbox-group-header.read-only .error .group-title{color:var(--content-danger)}.checkbox-group-container .checkbox-group-header.disabled{pointer-events:none}.checkbox-group-container .checkbox-group-header.disabled .group-title,.checkbox-group-container .checkbox-group-header.disabled .group-help-text{color:var(--content-disabled)}.checkbox-group-container .checkbox-group{display:flex;flex-direction:row;padding:0;align-items:flex-start;gap:24px}.checkbox-group-container .checkbox-group.vertical{flex-direction:column;gap:8px}\n"] }]
|
|
593
|
+
args: [{ selector: "rte-checkbox-group", imports: [CommonModule, CheckboxComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div \n *ngIf=\"isDisplayed()\"\n class=\"checkbox-group-container\">\n <div\n class=\"checkbox-group-header\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'error': error(),\n 'read-only': readOnly(),\n }\">\n <h3\n *ngIf=\"showGroupTitle()\"\n class=\"group-title\"\n >\n {{ groupTitle() }}\n </h3>\n <p\n *ngIf=\"showHelpText()\"\n class=\"group-help-text\"\n >\n {{ groupHelpText() }}\n\n </p>\n <p\n *ngIf=\"error()\"\n class=\"group-error-message\"\n >\n {{ errorMessage() }}\n </p>\n </div>\n <div class=\"checkbox-group\" \n [ngClass]=\"{'horizontal': direction() === 'horizontal', 'vertical': direction() === 'vertical'}\">\n <ng-container \n *ngFor=\"let item of items(); let i = index\">\n <rte-checkbox\n [id]=\"item + '-' + i\"\n [label]=\"item\"\n [showLabel]=\"showItemsLabel()\"\n [disabled]=\"disabled()\"\n [error]=\"error()\"\n [readOnly]=\"readOnly()\"\n />\n </ng-container>\n </div>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.checkbox-group-container{display:flex;padding:0;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px}.checkbox-group-container .checkbox-group-header .group-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;align-self:stretch;margin:0}.checkbox-group-container .checkbox-group-header .group-help-text{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-tertiary);align-self:stretch;margin:0}.checkbox-group-container .checkbox-group-header .group-error-message{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-danger-default);align-self:stretch;margin:4px 0 0}.checkbox-group-container .checkbox-group-header.error .group-title{color:var(--content-danger-default)}.checkbox-group-container .checkbox-group-header.read-only .group-title{color:var(--content-tertiary)}.checkbox-group-container .checkbox-group-header.read-only .error .group-title{color:var(--content-danger-default)}.checkbox-group-container .checkbox-group-header.disabled{pointer-events:none}.checkbox-group-container .checkbox-group-header.disabled .group-title,.checkbox-group-container .checkbox-group-header.disabled .group-help-text{color:var(--content-disabled)}.checkbox-group-container .checkbox-group{display:flex;flex-direction:row;padding:0;align-items:flex-start;gap:24px}.checkbox-group-container .checkbox-group.vertical{flex-direction:column;gap:8px}\n"] }]
|
|
595
594
|
}] });
|
|
596
595
|
|
|
597
596
|
class OverlayService {
|
|
598
597
|
constructor() {
|
|
599
598
|
this.activeOverlays = new Set();
|
|
599
|
+
this.isNavigationFrozen = false;
|
|
600
600
|
}
|
|
601
|
-
getOverlayRoot() {
|
|
601
|
+
getOverlayRoot(freezeNavigation) {
|
|
602
602
|
if (!this.overlayRoot) {
|
|
603
603
|
this.overlayRoot = document.getElementById("overlay-root");
|
|
604
604
|
if (!this.overlayRoot) {
|
|
605
605
|
this.overlayRoot = document.createElement("div");
|
|
606
606
|
this.overlayRoot.id = "overlay-root";
|
|
607
|
+
this.overlayRoot.tabIndex = -1;
|
|
608
|
+
if (freezeNavigation) {
|
|
609
|
+
this.isNavigationFrozen = true;
|
|
610
|
+
this.overlayRoot.style.position = "fixed";
|
|
611
|
+
this.overlayRoot.style.width = "100%";
|
|
612
|
+
this.overlayRoot.style.height = "100%";
|
|
613
|
+
this.overlayRoot.style.top = "0";
|
|
614
|
+
this.overlayRoot.style.left = "0";
|
|
615
|
+
this.overlayRoot.style.zIndex = "999";
|
|
616
|
+
document.body.style.overflow = "hidden";
|
|
617
|
+
}
|
|
607
618
|
document.body.appendChild(this.overlayRoot);
|
|
608
619
|
}
|
|
609
620
|
}
|
|
610
621
|
return this.overlayRoot;
|
|
611
622
|
}
|
|
612
|
-
create(component, viewContainer) {
|
|
613
|
-
const root = this.getOverlayRoot();
|
|
623
|
+
create(component, viewContainer, freezeNavigation = false) {
|
|
624
|
+
const root = this.getOverlayRoot(freezeNavigation);
|
|
614
625
|
const componentRef = viewContainer.createComponent(component);
|
|
615
626
|
root.appendChild(componentRef.location.nativeElement);
|
|
616
627
|
this.activeOverlays.add(componentRef);
|
|
@@ -623,6 +634,9 @@ class OverlayService {
|
|
|
623
634
|
}
|
|
624
635
|
destroy() {
|
|
625
636
|
if (this.activeOverlays.size === 0) {
|
|
637
|
+
if (this.isNavigationFrozen) {
|
|
638
|
+
document.body.style.overflow = "unset";
|
|
639
|
+
}
|
|
626
640
|
this.overlayRoot?.remove();
|
|
627
641
|
this.overlayRoot = undefined;
|
|
628
642
|
}
|
|
@@ -668,6 +682,7 @@ class TooltipDirective {
|
|
|
668
682
|
this.rteTooltipPosition = input("auto");
|
|
669
683
|
this.rteTooltipAlignment = input("center");
|
|
670
684
|
this.rteTooltipArrow = input(true);
|
|
685
|
+
this.rteTooltipShouldFocusTrigger = input(true);
|
|
671
686
|
this.tooltipRef = null;
|
|
672
687
|
this.elementRef = inject(ElementRef);
|
|
673
688
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
@@ -675,12 +690,25 @@ class TooltipDirective {
|
|
|
675
690
|
this.cdr = inject(ChangeDetectorRef);
|
|
676
691
|
this.overlayService = inject(OverlayService);
|
|
677
692
|
this.hostElement = this.elementRef.nativeElement;
|
|
678
|
-
this.hostElement.setAttribute("tabindex", "0");
|
|
679
693
|
}
|
|
680
694
|
ngAfterViewInit() {
|
|
695
|
+
if (!this.rteTooltipShouldFocusTrigger()) {
|
|
696
|
+
this.renderer.setAttribute(this.hostElement, "tabindex", "-1");
|
|
697
|
+
const focusableTrigger = this.hostElement.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY)[0];
|
|
698
|
+
focusableTrigger.addEventListener("focus", () => this.onFocus());
|
|
699
|
+
focusableTrigger.addEventListener("blur", () => this.onBlur());
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
this.renderer.setAttribute(this.hostElement, "tabindex", "0");
|
|
703
|
+
}
|
|
681
704
|
window.addEventListener("scroll", this.positionTooltip.bind(this));
|
|
682
705
|
}
|
|
683
706
|
ngOnDestroy() {
|
|
707
|
+
if (!this.rteTooltipShouldFocusTrigger()) {
|
|
708
|
+
const focusableTrigger = this.hostElement.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY)[0];
|
|
709
|
+
focusableTrigger.removeEventListener("focus", () => this.onFocus());
|
|
710
|
+
focusableTrigger.removeEventListener("blur", () => this.onBlur());
|
|
711
|
+
}
|
|
684
712
|
window.removeEventListener("scroll", this.positionTooltip.bind(this));
|
|
685
713
|
}
|
|
686
714
|
showTooltip() {
|
|
@@ -726,7 +754,7 @@ class TooltipDirective {
|
|
|
726
754
|
}
|
|
727
755
|
}
|
|
728
756
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
729
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: TooltipDirective, isStandalone: true, selector: "[rteTooltip]", inputs: { rteTooltip: { classPropertyName: "rteTooltip", publicName: "rteTooltip", isSignal: true, isRequired: true, transformFunction: null }, rteTooltipPosition: { classPropertyName: "rteTooltipPosition", publicName: "rteTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, rteTooltipAlignment: { classPropertyName: "rteTooltipAlignment", publicName: "rteTooltipAlignment", isSignal: true, isRequired: false, transformFunction: null }, rteTooltipArrow: { classPropertyName: "rteTooltipArrow", publicName: "rteTooltipArrow", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focus": "onFocus()", "blur": "onBlur()" } }, ngImport: i0 }); }
|
|
757
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.14", type: TooltipDirective, isStandalone: true, selector: "[rteTooltip]", inputs: { rteTooltip: { classPropertyName: "rteTooltip", publicName: "rteTooltip", isSignal: true, isRequired: true, transformFunction: null }, rteTooltipPosition: { classPropertyName: "rteTooltipPosition", publicName: "rteTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, rteTooltipAlignment: { classPropertyName: "rteTooltipAlignment", publicName: "rteTooltipAlignment", isSignal: true, isRequired: false, transformFunction: null }, rteTooltipArrow: { classPropertyName: "rteTooltipArrow", publicName: "rteTooltipArrow", isSignal: true, isRequired: false, transformFunction: null }, rteTooltipShouldFocusTrigger: { classPropertyName: "rteTooltipShouldFocusTrigger", publicName: "rteTooltipShouldFocusTrigger", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focus": "onFocus()", "blur": "onBlur()" } }, ngImport: i0 }); }
|
|
730
758
|
}
|
|
731
759
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
732
760
|
type: Directive,
|
|
@@ -748,262 +776,453 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
748
776
|
args: ["blur"]
|
|
749
777
|
}] } });
|
|
750
778
|
|
|
751
|
-
class
|
|
779
|
+
class DividerComponent {
|
|
752
780
|
constructor() {
|
|
753
|
-
this.
|
|
754
|
-
this.
|
|
755
|
-
this.
|
|
756
|
-
this.
|
|
757
|
-
this.
|
|
758
|
-
this.position = input("bottom-start");
|
|
759
|
-
this.icon = input(null);
|
|
760
|
-
this.disabled = input(false);
|
|
761
|
-
this.ariaLabelRight = input();
|
|
762
|
-
this.splitButtonLeftIconSize = computed(() => splitButtonLeftIconSize[this.size()]);
|
|
763
|
-
this.splitButtonRightIconSize = computed(() => splitButtonRightIconSize[this.size()]);
|
|
764
|
-
this.isOpen = signal(false);
|
|
765
|
-
}
|
|
766
|
-
handleKeyDownOnRightButton(event) {
|
|
767
|
-
this.handleKeyDown(event, "ArrowDown", () => this.isOpen.set(true));
|
|
768
|
-
this.handleKeyDown(event, "Escape", () => this.isOpen.set(false));
|
|
781
|
+
this.orientation = input("horizontal");
|
|
782
|
+
this.thickness = input("light");
|
|
783
|
+
this.appearance = input("default");
|
|
784
|
+
this.endPoint = input("round");
|
|
785
|
+
this.isHorizontal = computed(() => this.orientation() === "horizontal");
|
|
769
786
|
}
|
|
770
|
-
|
|
771
|
-
|
|
787
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
788
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DividerComponent, isStandalone: true, selector: "rte-divider", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, endPoint: { classPropertyName: "endPoint", publicName: "endPoint", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (isHorizontal()) {\n <hr class=\"horizontal {{thickness()}} {{appearance()}} {{endPoint()}}\" />\n} @else {\n <div class=\"vertical {{thickness()}} {{appearance()}} {{endPoint()}}\" role=\"separator\"></div>\n}", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.horizontal{border:none;padding:0;margin:0;width:100%}.horizontal.round{border-radius:999px}.horizontal.light{border-top:1px solid var(--border-divider)}.horizontal.medium{border-top:2px solid var(--border-divider)}.horizontal.bold{border-top:4px solid var(--border-divider)}.horizontal.inverse{border-top-color:var(--border-inverse)}.horizontal.brand{border-top-color:var(--border-brand-default)}.vertical{height:100%;background-color:var(--border-divider);margin:0;padding:0}.vertical.round{border-radius:999px}.vertical.light{width:1px}.vertical.medium{width:2px}.vertical.bold{width:4px}.vertical.inverse{background-color:var(--border-inverse)}.vertical.brand{background-color:var(--border-brand-default)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
789
|
+
}
|
|
790
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DividerComponent, decorators: [{
|
|
791
|
+
type: Component,
|
|
792
|
+
args: [{ selector: "rte-divider", imports: [CommonModule], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (isHorizontal()) {\n <hr class=\"horizontal {{thickness()}} {{appearance()}} {{endPoint()}}\" />\n} @else {\n <div class=\"vertical {{thickness()}} {{appearance()}} {{endPoint()}}\" role=\"separator\"></div>\n}", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.horizontal{border:none;padding:0;margin:0;width:100%}.horizontal.round{border-radius:999px}.horizontal.light{border-top:1px solid var(--border-divider)}.horizontal.medium{border-top:2px solid var(--border-divider)}.horizontal.bold{border-top:4px solid var(--border-divider)}.horizontal.inverse{border-top-color:var(--border-inverse)}.horizontal.brand{border-top-color:var(--border-brand-default)}.vertical{height:100%;background-color:var(--border-divider);margin:0;padding:0}.vertical.round{border-radius:999px}.vertical.light{width:1px}.vertical.medium{width:2px}.vertical.bold{width:4px}.vertical.inverse{background-color:var(--border-inverse)}.vertical.brand{background-color:var(--border-brand-default)}\n"] }]
|
|
793
|
+
}] });
|
|
794
|
+
|
|
795
|
+
class DropdownItemComponent {
|
|
796
|
+
constructor() {
|
|
797
|
+
this.item = input();
|
|
798
|
+
this.menuId = input();
|
|
799
|
+
this.itemEvent = output();
|
|
772
800
|
}
|
|
773
|
-
|
|
774
|
-
if (
|
|
801
|
+
handleClick(event) {
|
|
802
|
+
if (this.item()?.disabled) {
|
|
775
803
|
event.preventDefault();
|
|
776
|
-
|
|
804
|
+
event.stopPropagation();
|
|
805
|
+
return;
|
|
777
806
|
}
|
|
807
|
+
this.itemEvent.emit({ event, id: this.item()?.id || this.item()?.label || "" });
|
|
778
808
|
}
|
|
779
|
-
|
|
780
|
-
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 }, selected: { classPropertyName: "selected", publicName: "selected", 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 } }, 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 \n *ngIf=\"icon()\"\n [name]=\"icon()!\"\n [size]=\"splitButtonLeftIconSize()\"\n />\n <p class=\"split-button-label size-{{ size() }}\">\n {{label()}}\n </p>\n </button>\n\n <div \n class=\"split-button-divider\"\n [ngClass]=\"{'disabled': disabled()}\"\n ></div>\n\n <div class=\"split-button-right-container\">\n <button\n class=\"split-button-right size-{{ size() }}\"\n data-testid=\"Menu button\"\n type=\"button\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-label]=\"ariaLabelRight()\"\n [attr.data-selected]=\"selected()\"\n [disabled]=\"disabled()\"\n (click)=\"isOpen.set(true)\"\n (mouseenter)=\"isOpen.set(true)\"\n (mouseleave)=\"isOpen.set(false)\"\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 <div\n class=\"split-button-dropdown position-{{ position() }}\"\n role=\"menu\"\n data-testid=\"Menu container\"\n [style.visibility]=\"isOpen() ? 'visible' : 'hidden'\"\n (keydown)=\"handleKeyDownOnMenu($event)\"\n >\n <ng-content/>\n </div>\n </div>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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.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-container .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-container .split-button-right:hover{cursor:pointer;background-color:var(--background-brand-inverse-hover)}.split-button-container.secondary .split-button-right-container .split-button-right:active{background-color:var(--background-brand-inverse-pressed)}.split-button-container.secondary .split-button-right-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-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{outline:none;position:relative;z-index:1}.split-button-container .split-button-left:focus: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-container{display:flex;position:relative;padding:0;align-items:center;justify-content:center;gap:0px;align-self:stretch}.split-button-container .split-button-right-container .split-button-right{display:flex;border:none;padding:4px 12px;align-items:center;justify-content:center;align-self:stretch;width:34px;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-container .split-button-right.size-s{width:24px;padding:2px 8px}.split-button-container .split-button-right-container .split-button-right.size-l{width:44px;padding:6px 16px}.split-button-container .split-button-right-container .split-button-right:hover{cursor:pointer;background-color:var(--background-brand-hover)}.split-button-container .split-button-right-container .split-button-right:active{background-color:var(--background-brand-pressed)}.split-button-container .split-button-right-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-container .split-button-right:focus{outline:none;position:relative;z-index:1}.split-button-container .split-button-right-container .split-button-right:focus: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-container .split-button-right .split-button-right-icon-container{display:flex;pointer-events:none}.split-button-container .split-button-right-container .split-button-dropdown{position:absolute}.split-button-container .split-button-right-container .split-button-dropdown.position-bottom-start{top:100%;left:0}.split-button-container .split-button-right-container .split-button-dropdown.position-bottom-end{top:100%;right:0}.split-button-container .split-button-right-container .split-button-dropdown.position-top-start{bottom:100%;left:0}.split-button-container .split-button-right-container .split-button-dropdown.position-top-end{bottom:100%;right:0}.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
809
|
+
handleKeyDown(event) {
|
|
810
|
+
event.preventDefault();
|
|
811
|
+
if ([SPACE_KEY, ENTER_KEY].includes(event.key)) {
|
|
812
|
+
if (this.item()?.link) {
|
|
813
|
+
const link = event.target.closest("li")?.querySelector("a");
|
|
814
|
+
link?.click();
|
|
815
|
+
}
|
|
816
|
+
else {
|
|
817
|
+
this.itemEvent.emit({ event, id: this.item()?.id || this.item()?.label || "" });
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
822
|
+
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.aria-disabled]=\"item()?.disabled\"\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\">{{ item()?.label }} </a>\n <span *ngSwitchDefault style=\"flex: 2\">{{ item()?.label }}</span>\n </ng-container>\n <div *ngIf=\"item()?.trailingText\">{{ item()?.trailingText }}</div>\n </li>\n <div *ngIf=\"item()?.hasSeparator\" class=\"dropdown-divider\">\n <rte-divider/>\n </div>\n</ng-container>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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: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"] }] }); }
|
|
781
823
|
}
|
|
782
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
824
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownItemComponent, decorators: [{
|
|
783
825
|
type: Component,
|
|
784
|
-
args: [{ selector: "rte-
|
|
826
|
+
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.aria-disabled]=\"item()?.disabled\"\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\">{{ item()?.label }} </a>\n <span *ngSwitchDefault style=\"flex: 2\">{{ item()?.label }}</span>\n </ng-container>\n <div *ngIf=\"item()?.trailingText\">{{ item()?.trailingText }}</div>\n </li>\n <div *ngIf=\"item()?.hasSeparator\" class=\"dropdown-divider\">\n <rte-divider/>\n </div>\n</ng-container>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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:focus-visible{outline:none;background-color:var(--background-hover)}.dropdown-divider{width:100%;padding:8px 0}\n"] }]
|
|
785
827
|
}] });
|
|
786
828
|
|
|
787
|
-
class
|
|
829
|
+
class DropdownService {
|
|
788
830
|
constructor() {
|
|
789
|
-
this.
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
this.
|
|
793
|
-
this.
|
|
794
|
-
this.appearance = input("outlined");
|
|
795
|
-
this.compactSpacing = input(false);
|
|
796
|
-
this.ariaLabel = input(undefined);
|
|
797
|
-
this.ariaLabelledBy = input(undefined);
|
|
798
|
-
this.buttonIconSize = computed(() => buttonIconSize[this.size()]);
|
|
799
|
-
this.isValidIconName = computed(() => isValidIconName(this.name()));
|
|
800
|
-
this.click = output();
|
|
831
|
+
this.initialState = {
|
|
832
|
+
activeMenuId: "",
|
|
833
|
+
};
|
|
834
|
+
this.state$ = new BehaviorSubject(this.initialState);
|
|
835
|
+
this.activeMenuId$ = this.state$.pipe(map((state) => state?.activeMenuId));
|
|
801
836
|
}
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
837
|
+
openMenu(menuId) {
|
|
838
|
+
this.state$.next({
|
|
839
|
+
activeMenuId: menuId,
|
|
840
|
+
});
|
|
805
841
|
}
|
|
806
|
-
|
|
807
|
-
|
|
842
|
+
closeAllMenus() {
|
|
843
|
+
this.state$.next(null);
|
|
844
|
+
}
|
|
845
|
+
isMenuActive(menuId) {
|
|
846
|
+
return this.activeMenuId$.pipe(map((activeId) => activeId === menuId));
|
|
847
|
+
}
|
|
848
|
+
reset() {
|
|
849
|
+
this.state$.next(this.initialState);
|
|
850
|
+
console.log("🔵 Dropdown Service - State Reset");
|
|
851
|
+
}
|
|
852
|
+
handleKeyboardInput(key, options) {
|
|
853
|
+
if ([ARROW_DOWN_KEY, ARROW_UP_KEY, ARROW_LEFT_KEY, ARROW_RIGHT_KEY].includes(key)) {
|
|
854
|
+
this.handleKeyboardNavigation(key, options);
|
|
855
|
+
}
|
|
856
|
+
if (key === ESCAPE_KEY) {
|
|
857
|
+
this.closeAllMenus();
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
handleKeyboardNavigation(key, options) {
|
|
861
|
+
const { menuElement } = options;
|
|
862
|
+
const nativeElement = menuElement?.nativeElement;
|
|
863
|
+
switch (key) {
|
|
864
|
+
case ARROW_DOWN_KEY:
|
|
865
|
+
this.focusNextElement(nativeElement);
|
|
866
|
+
break;
|
|
867
|
+
case ARROW_UP_KEY:
|
|
868
|
+
this.focusPreviousElement(nativeElement);
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
focusNextElement(element) {
|
|
873
|
+
if (!element)
|
|
874
|
+
return;
|
|
875
|
+
const focusableElements = this.getFocusableElements(element);
|
|
876
|
+
const currentIndex = focusableElements.indexOf(document.activeElement);
|
|
877
|
+
const nextIndex = currentIndex + 1 < focusableElements.length ? currentIndex + 1 : 0;
|
|
878
|
+
focusableElements[nextIndex]?.focus();
|
|
879
|
+
}
|
|
880
|
+
focusPreviousElement(element) {
|
|
881
|
+
if (!element)
|
|
882
|
+
return;
|
|
883
|
+
const focusableElements = this.getFocusableElements(element);
|
|
884
|
+
const currentIndex = focusableElements.indexOf(document.activeElement);
|
|
885
|
+
const previousIndex = currentIndex ? currentIndex - 1 : focusableElements.length - 1;
|
|
886
|
+
focusableElements[previousIndex]?.focus();
|
|
887
|
+
}
|
|
888
|
+
getFocusableElements(element) {
|
|
889
|
+
const menuId = element.dataset["menuId"];
|
|
890
|
+
return Array.from(element.querySelectorAll("li")).filter((el) => {
|
|
891
|
+
const closestMenu = el.closest("[data-menu-id]");
|
|
892
|
+
return closestMenu?.dataset["menuId"] === menuId;
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
896
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownService, providedIn: "root" }); }
|
|
808
897
|
}
|
|
809
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
810
|
-
type:
|
|
811
|
-
args: [{
|
|
898
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownService, decorators: [{
|
|
899
|
+
type: Injectable,
|
|
900
|
+
args: [{
|
|
901
|
+
providedIn: "root", // Makes the service a singleton
|
|
902
|
+
}]
|
|
812
903
|
}] });
|
|
813
904
|
|
|
814
|
-
class
|
|
905
|
+
class DropdownMenuComponent {
|
|
815
906
|
constructor() {
|
|
816
|
-
this.
|
|
817
|
-
this.
|
|
818
|
-
this.
|
|
819
|
-
this.
|
|
820
|
-
this.
|
|
821
|
-
this.compactSpacing = input(false);
|
|
822
|
-
this.ariaLabel = input();
|
|
823
|
-
this.ariaLabelledBy = input();
|
|
824
|
-
this.selected = input();
|
|
825
|
-
this.internalSelected = signal(false);
|
|
826
|
-
this.defaultSelected = input(false);
|
|
827
|
-
this.isControlled = computed(() => this.selected() !== undefined);
|
|
828
|
-
this.click = output();
|
|
829
|
-
this.isSelected = computed(() => {
|
|
830
|
-
return this.isControlled() ? this.selected() : this.internalSelected();
|
|
831
|
-
});
|
|
832
|
-
this.buttonIconSize = computed(() => buttonIconSize[this.size()]);
|
|
907
|
+
this.elementRef = inject(ElementRef);
|
|
908
|
+
this.dropdownService = inject(DropdownService);
|
|
909
|
+
this.items = input([]);
|
|
910
|
+
this.menuId = input();
|
|
911
|
+
this.itemEvent = output();
|
|
833
912
|
}
|
|
834
|
-
|
|
835
|
-
this.
|
|
913
|
+
getChildMenuId(itemIndex) {
|
|
914
|
+
return `${this.menuId()}:${itemIndex + 1}`;
|
|
836
915
|
}
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
916
|
+
handleItemEvent(itemEvent) {
|
|
917
|
+
this.itemEvent.emit(itemEvent);
|
|
918
|
+
}
|
|
919
|
+
onKeyDown(event) {
|
|
920
|
+
if (!event.target || !this.menuId()) {
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
if ([ARROW_UP_KEY, ARROW_DOWN_KEY, ARROW_LEFT_KEY, ARROW_RIGHT_KEY, TAB_KEY].includes(event.key)) {
|
|
924
|
+
event.preventDefault();
|
|
842
925
|
}
|
|
926
|
+
const menuId = this.menuId();
|
|
927
|
+
this.dropdownService.handleKeyboardInput(event.key, {
|
|
928
|
+
menuElement: this.elementRef,
|
|
929
|
+
menuId,
|
|
930
|
+
});
|
|
843
931
|
}
|
|
844
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
845
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
932
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
933
|
+
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 \n class=\"rte-dropdown-items\"\n role=\"menu\" \n [attr.aria-activedescendant]=\"menuId()\"\n >\n @for (item of items(); track item.label; let i = $index) {\n <rte-dropdown-item \n [item]=\"item\"\n (itemEvent)=\"handleItemEvent($event)\"\n />\n }\n </ul>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";:host{opacity:0;display:none;position:absolute}.rte-dropdown-menu{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.open{transition:opacity .15s ease-in-out}.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: "component", type: DropdownItemComponent, selector: "rte-dropdown-item", inputs: ["item", "menuId"], outputs: ["itemEvent"] }] }); }
|
|
846
934
|
}
|
|
847
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
935
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownMenuComponent, decorators: [{
|
|
848
936
|
type: Component,
|
|
849
|
-
args: [{ selector: "rte-
|
|
850
|
-
}]
|
|
937
|
+
args: [{ selector: "rte-dropdown-menu", imports: [CommonModule, DropdownItemComponent], standalone: true, host: { "[attr.data-menu-id]": "menuId()" }, template: "<div class=\"rte-dropdown-menu\">\n <ul \n class=\"rte-dropdown-items\"\n role=\"menu\" \n [attr.aria-activedescendant]=\"menuId()\"\n >\n @for (item of items(); track item.label; let i = $index) {\n <rte-dropdown-item \n [item]=\"item\"\n (itemEvent)=\"handleItemEvent($event)\"\n />\n }\n </ul>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";:host{opacity:0;display:none;position:absolute}.rte-dropdown-menu{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.open{transition:opacity .15s ease-in-out}.rte-dropdown-menu .rte-dropdown-items{width:100%;padding:0;margin:0}.rte-dropdown-menu .rte-dropdown-items li{list-style:none}\n"] }]
|
|
938
|
+
}], propDecorators: { onKeyDown: [{
|
|
939
|
+
type: HostListener,
|
|
940
|
+
args: ["keydown", ["$event"]]
|
|
941
|
+
}] } });
|
|
851
942
|
|
|
852
|
-
class
|
|
943
|
+
class DropdownTriggerDirective {
|
|
853
944
|
constructor() {
|
|
854
|
-
this.
|
|
855
|
-
this.
|
|
856
|
-
this.
|
|
857
|
-
this.
|
|
858
|
-
this.
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
this.
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
this.
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
this.
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
945
|
+
this.elementRef = inject(ElementRef);
|
|
946
|
+
this.rteDropdownTriggerActivateWithArrowDown = input(false);
|
|
947
|
+
this.dropdownKeyDown = output();
|
|
948
|
+
this.dropdownTriggered = output();
|
|
949
|
+
this.dropdownTriggerFocus = output();
|
|
950
|
+
}
|
|
951
|
+
onDropdownTriggered(event) {
|
|
952
|
+
this.dropdownTriggered.emit(event);
|
|
953
|
+
}
|
|
954
|
+
onDropdownTriggerFocus(event) {
|
|
955
|
+
this.dropdownTriggerFocus.emit(event);
|
|
956
|
+
}
|
|
957
|
+
onKeyDown(event) {
|
|
958
|
+
this.dropdownKeyDown.emit(event);
|
|
959
|
+
}
|
|
960
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
961
|
+
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 }); }
|
|
962
|
+
}
|
|
963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownTriggerDirective, decorators: [{
|
|
964
|
+
type: Directive,
|
|
965
|
+
args: [{
|
|
966
|
+
selector: "[rteDropdownTrigger]",
|
|
967
|
+
standalone: true,
|
|
968
|
+
}]
|
|
969
|
+
}], propDecorators: { onDropdownTriggered: [{
|
|
970
|
+
type: HostListener,
|
|
971
|
+
args: ["click", ["$event"]]
|
|
972
|
+
}], onDropdownTriggerFocus: [{
|
|
973
|
+
type: HostListener,
|
|
974
|
+
args: ["focus", ["$event"]]
|
|
975
|
+
}], onKeyDown: [{
|
|
976
|
+
type: HostListener,
|
|
977
|
+
args: ["keydown", ["$event"]]
|
|
978
|
+
}] } });
|
|
979
|
+
|
|
980
|
+
const focusNextElement = (dropdown) => {
|
|
981
|
+
const menuItems = getDropdownMenuItems(dropdown);
|
|
982
|
+
const activeElementIndex = menuItems.indexOf(document.activeElement);
|
|
983
|
+
if (activeElementIndex < menuItems.length - 1) {
|
|
984
|
+
const nextElement = menuItems[activeElementIndex + 1];
|
|
985
|
+
nextElement.focus();
|
|
986
|
+
}
|
|
987
|
+
else {
|
|
988
|
+
menuItems[0]?.focus();
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
const focusPreviousElement = (dropdown) => {
|
|
992
|
+
const menuItems = getDropdownMenuItems(dropdown);
|
|
993
|
+
const activeElementIndex = menuItems.indexOf(document.activeElement);
|
|
994
|
+
if (activeElementIndex > 0) {
|
|
995
|
+
const previousElement = menuItems[activeElementIndex - 1];
|
|
996
|
+
previousElement.focus();
|
|
997
|
+
}
|
|
998
|
+
else {
|
|
999
|
+
menuItems.at(-1)?.focus();
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
const focusDropdownFirstElement = (dropdownId) => {
|
|
1003
|
+
const childDropdown = document.querySelector(`[data-menu-id='${dropdownId}']`);
|
|
1004
|
+
if (childDropdown) {
|
|
1005
|
+
const allChildDropdownElement = childDropdown?.querySelectorAll('li[role="menuitem"]');
|
|
1006
|
+
allChildDropdownElement[0]?.focus();
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
const focusParentDropdownFirstElement = (dropdownId) => {
|
|
1010
|
+
const parentDropdownId = DropdownManager.getParentDropdownId(dropdownId);
|
|
1011
|
+
const parentDropdown = document.querySelector(`[data-menu-id='${parentDropdownId}']`);
|
|
1012
|
+
parentDropdown?.querySelector("[data-active=true]")?.focus();
|
|
1013
|
+
};
|
|
1014
|
+
const getDropdownMenuItems = (dropdown) => {
|
|
1015
|
+
const allDropdownElement = dropdown?.querySelectorAll('li[role="menuitem"]');
|
|
1016
|
+
return allDropdownElement ? Array.from(allDropdownElement) : [];
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
class DropdownDirective {
|
|
1020
|
+
static { this.idCounter = 0; }
|
|
1021
|
+
constructor() {
|
|
1022
|
+
this.trigger = contentChild(DropdownTriggerDirective);
|
|
1023
|
+
this.menu = contentChild(DropdownMenuComponent);
|
|
1024
|
+
this.rteDropdownPosition = input("bottom");
|
|
1025
|
+
this.rteDropdownAlignment = input("start");
|
|
1026
|
+
this.rteDropdownIsOpen = input(false);
|
|
1027
|
+
this.rteDropdownOffset = input(0);
|
|
1028
|
+
this.dropdownId = `dropdown_${++DropdownDirective.idCounter}`;
|
|
1029
|
+
this.menuEvent = output();
|
|
1030
|
+
this.overlayService = inject(OverlayService);
|
|
1031
|
+
this.dropdownService = inject(DropdownService);
|
|
1032
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
1033
|
+
this.elementRef = inject(ElementRef);
|
|
1034
|
+
this.renderer = inject(Renderer2);
|
|
1035
|
+
this.destroyRef = inject(DestroyRef);
|
|
1036
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1037
|
+
this.dropdownMenuRef = null;
|
|
1038
|
+
this.handleClickOutside = (event) => {
|
|
1039
|
+
const target = event.target;
|
|
1040
|
+
const isMenuItemClick = target.closest(".rte-dropdown-item") !== null;
|
|
1041
|
+
if (isMenuItemClick) {
|
|
1042
|
+
return;
|
|
894
1043
|
}
|
|
895
|
-
|
|
896
|
-
|
|
1044
|
+
const clickedInTrigger = this.hostElement.contains(target);
|
|
1045
|
+
if (!clickedInTrigger) {
|
|
1046
|
+
this.closeDropdown();
|
|
897
1047
|
}
|
|
898
|
-
|
|
1048
|
+
};
|
|
1049
|
+
this.hostElement = this.elementRef.nativeElement;
|
|
1050
|
+
}
|
|
1051
|
+
onTrigger() {
|
|
1052
|
+
this.showDropdownMenu();
|
|
1053
|
+
}
|
|
1054
|
+
onTriggerKeyEvent(event) {
|
|
1055
|
+
if (event.key === SPACE_KEY ||
|
|
1056
|
+
event.key === ENTER_KEY ||
|
|
1057
|
+
(event.key === ARROW_DOWN_KEY && this.trigger()?.rteDropdownTriggerActivateWithArrowDown())) {
|
|
1058
|
+
this.showDropdownMenu();
|
|
1059
|
+
requestAnimationFrame(() => {
|
|
1060
|
+
requestAnimationFrame(() => focusDropdownFirstElement(this.dropdownId));
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
onMenuEvent(event) {
|
|
1065
|
+
this.menuEvent.emit(event);
|
|
1066
|
+
this.dropdownService.closeAllMenus();
|
|
1067
|
+
}
|
|
1068
|
+
ngAfterContentInit() {
|
|
1069
|
+
if (this.trigger()) {
|
|
1070
|
+
this.trigger()?.dropdownTriggered.subscribe(() => {
|
|
1071
|
+
this.onTrigger();
|
|
1072
|
+
});
|
|
1073
|
+
this.trigger()?.dropdownKeyDown.subscribe((event) => {
|
|
1074
|
+
this.onTriggerKeyEvent(event);
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
showDropdownMenu() {
|
|
1079
|
+
if (this.dropdownMenuRef) {
|
|
1080
|
+
this.dropdownMenuRef.destroy();
|
|
1081
|
+
}
|
|
1082
|
+
this.dropdownMenuRef = this.overlayService.create(DropdownMenuComponent, this.viewContainerRef);
|
|
1083
|
+
const menuId = this.dropdownId;
|
|
1084
|
+
this.dropdownMenuRef.setInput("menuId", menuId);
|
|
1085
|
+
this.dropdownService.openMenu(menuId);
|
|
1086
|
+
this.assignItems();
|
|
1087
|
+
this.positionDropdownMenu(this.rteDropdownPosition());
|
|
1088
|
+
this.addClickOutsideListener();
|
|
1089
|
+
this.dropdownMenuRef.instance.itemEvent.subscribe((event) => {
|
|
1090
|
+
this.onMenuEvent(event);
|
|
899
1091
|
});
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
1092
|
+
const dropdownStateSubscription = this.dropdownService.state$
|
|
1093
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1094
|
+
.subscribe((state) => {
|
|
1095
|
+
if (state === null) {
|
|
1096
|
+
if (this.dropdownMenuRef) {
|
|
1097
|
+
this.dropdownMenuRef.destroy();
|
|
1098
|
+
this.dropdownMenuRef = null;
|
|
1099
|
+
this.removeClickOutsideListener();
|
|
1100
|
+
dropdownStateSubscription.unsubscribe();
|
|
1101
|
+
}
|
|
906
1102
|
}
|
|
907
|
-
return this.showRightIcon() && !!this.rightIconAction();
|
|
908
1103
|
});
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
1104
|
+
}
|
|
1105
|
+
assignItems() {
|
|
1106
|
+
if (this.dropdownMenuRef) {
|
|
1107
|
+
this.dropdownMenuRef.setInput("items", this.menu()?.items());
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
positionDropdownMenu(position = "bottom") {
|
|
1111
|
+
if (this.dropdownMenuRef && this.trigger()) {
|
|
1112
|
+
const dropdownMenuElement = this.dropdownMenuRef.location.nativeElement;
|
|
1113
|
+
const triggerElement = this.trigger()?.elementRef.nativeElement;
|
|
1114
|
+
if (triggerElement) {
|
|
1115
|
+
this.renderer.setStyle(dropdownMenuElement, "display", "block");
|
|
1116
|
+
this.cdr.detectChanges();
|
|
1117
|
+
const computedPosition = position === "auto" ? getAutoPlacementDropdown(triggerElement, dropdownMenuElement, "bottom") : position;
|
|
1118
|
+
const autoAlignment = this.rteDropdownAlignment() ?? getAutoAlignment(triggerElement, dropdownMenuElement, computedPosition);
|
|
1119
|
+
const computedCoordinates = getCoordinates(computedPosition, triggerElement, dropdownMenuElement.children[0], this.rteDropdownOffset(), autoAlignment);
|
|
1120
|
+
this.renderer.setStyle(dropdownMenuElement, "top", `${computedCoordinates.top}px`);
|
|
1121
|
+
this.renderer.setStyle(dropdownMenuElement, "left", `${computedCoordinates.left}px`);
|
|
1122
|
+
this.renderer.setStyle(dropdownMenuElement, "opacity", "1");
|
|
915
1123
|
}
|
|
916
|
-
}
|
|
1124
|
+
}
|
|
917
1125
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
this.
|
|
921
|
-
|
|
922
|
-
if (this.maxLength()) {
|
|
923
|
-
this.characterCount.set(input.value.length);
|
|
1126
|
+
ngOnDestroy() {
|
|
1127
|
+
this.removeClickOutsideListener();
|
|
1128
|
+
if (this.dropdownMenuRef) {
|
|
1129
|
+
this.dropdownMenuRef.destroy();
|
|
924
1130
|
}
|
|
925
|
-
this.valueChange.emit(input.value);
|
|
926
1131
|
}
|
|
927
|
-
|
|
928
|
-
this.
|
|
929
|
-
this.triggerRightIconAction();
|
|
1132
|
+
addClickOutsideListener() {
|
|
1133
|
+
document.addEventListener("mousedown", this.handleClickOutside);
|
|
930
1134
|
}
|
|
931
|
-
|
|
932
|
-
|
|
1135
|
+
removeClickOutsideListener() {
|
|
1136
|
+
document.removeEventListener("mousedown", this.handleClickOutside);
|
|
933
1137
|
}
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
this.internalValue.set("");
|
|
937
|
-
this.valueChange.emit("");
|
|
938
|
-
this.characterCount.set(0);
|
|
939
|
-
}
|
|
940
|
-
if (["visibilityOn", "visibilityOff"].includes(this.rightIconAction())) {
|
|
941
|
-
this.toggleInputVisibility();
|
|
942
|
-
}
|
|
1138
|
+
closeDropdown() {
|
|
1139
|
+
this.dropdownService.closeAllMenus();
|
|
943
1140
|
}
|
|
944
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
945
|
-
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\n class=\"container {{labelPosition()}}\"\n [ngClass]=\"{'error': error()}\"\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\">\n {{ characterCount() }}/{{ maxLength() }}\n </p>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"input-container\">\n <div\n class=\"input {{labelPosition()}}\"\n [ngClass]=\"{'disabled': disabled(), 'read-only': readOnly()}\"\n >\n <div class=\"input-bar\" [ngClass]=\"{'with-left-icon': displayedLeftIcon(), 'with-right-icon': rightIconAction()}\">\n <ng-container *ngIf=\"displayedLeftIcon()\">\n <rte-icon\n appearance=\"outlined\"\n class=\"left-icon\"\n aria-hidden=\"true\"\n [name]=\"displayedLeftIcon()!\"\n />\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\">\n {{ characterCount() }}/{{ maxLength() }}\n </p>\n </ng-container>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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)}.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);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)}.container .input-container .assistive-text .assistive-icon-success{color:var(--content-success)}.container .input-container .assistive-text .assistive-label{transition:color .2s}.container .input-container .assistive-text .assistive-label.error{color:var(--content-danger);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);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"], outputs: ["click"] }, { kind: "component", type: LinkComponent, selector: "rte-link", inputs: ["label", "href", "subtle", "externalLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1141
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1142
|
+
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 }); }
|
|
946
1143
|
}
|
|
947
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
948
|
-
type:
|
|
949
|
-
args: [{
|
|
1144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownDirective, decorators: [{
|
|
1145
|
+
type: Directive,
|
|
1146
|
+
args: [{
|
|
1147
|
+
selector: "[rteDropdown]",
|
|
1148
|
+
host: {
|
|
1149
|
+
"[class.dropdown]": "true",
|
|
1150
|
+
"[attr.data-dropdown-id]": "dropdownId",
|
|
1151
|
+
},
|
|
1152
|
+
standalone: true,
|
|
1153
|
+
}]
|
|
950
1154
|
}], ctorParameters: () => [] });
|
|
951
1155
|
|
|
952
|
-
class
|
|
1156
|
+
class DropdownModule {
|
|
1157
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1158
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: DropdownModule, imports: [DropdownDirective, DropdownTriggerDirective, DropdownMenuComponent, DropdownItemComponent], exports: [DropdownDirective, DropdownTriggerDirective, DropdownMenuComponent, DropdownItemComponent] }); }
|
|
1159
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownModule, imports: [DropdownMenuComponent, DropdownItemComponent] }); }
|
|
1160
|
+
}
|
|
1161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownModule, decorators: [{
|
|
1162
|
+
type: NgModule,
|
|
1163
|
+
args: [{
|
|
1164
|
+
imports: [DropdownDirective, DropdownTriggerDirective, DropdownMenuComponent, DropdownItemComponent],
|
|
1165
|
+
exports: [DropdownDirective, DropdownTriggerDirective, DropdownMenuComponent, DropdownItemComponent],
|
|
1166
|
+
}]
|
|
1167
|
+
}] });
|
|
1168
|
+
|
|
1169
|
+
// Main dropdown module - import this to get everything
|
|
1170
|
+
|
|
1171
|
+
class SplitButtonComponent {
|
|
953
1172
|
constructor() {
|
|
954
|
-
this.
|
|
955
|
-
this.
|
|
956
|
-
this.
|
|
957
|
-
this.disabled = input(false);
|
|
958
|
-
this.type = input("single");
|
|
1173
|
+
this.appearance = input("primary");
|
|
1174
|
+
this.size = input("m");
|
|
1175
|
+
this.label = input.required();
|
|
959
1176
|
this.compactSpacing = input(false);
|
|
960
|
-
this.
|
|
961
|
-
this.
|
|
962
|
-
this.
|
|
963
|
-
this.
|
|
1177
|
+
this.position = input("bottom-start");
|
|
1178
|
+
this.icon = input(null);
|
|
1179
|
+
this.disabled = input(false);
|
|
1180
|
+
this.ariaLabelRight = input();
|
|
1181
|
+
this.options = input([]);
|
|
1182
|
+
this.splitButtonLeftIconSize = computed(() => splitButtonLeftIconSize[this.size()]);
|
|
1183
|
+
this.splitButtonRightIconSize = computed(() => splitButtonRightIconSize[this.size()]);
|
|
1184
|
+
this.isOpen = signal(false);
|
|
1185
|
+
this.internalPosition = computed(() => {
|
|
1186
|
+
return this.position().split("-")[0];
|
|
1187
|
+
});
|
|
1188
|
+
this.internalAlignment = computed(() => {
|
|
1189
|
+
return this.position().split("-")[1];
|
|
1190
|
+
});
|
|
964
1191
|
}
|
|
965
|
-
|
|
966
|
-
event.
|
|
967
|
-
|
|
968
|
-
|
|
1192
|
+
handleClickOutside(event) {
|
|
1193
|
+
const target = event.target;
|
|
1194
|
+
const allDropdowns = document.querySelectorAll("[data-dropdown-id]");
|
|
1195
|
+
const clickedInside = Array.from(allDropdowns).some((dropdown) => dropdown.contains(target));
|
|
1196
|
+
if (!clickedInside) {
|
|
1197
|
+
this.isOpen.set(false);
|
|
969
1198
|
}
|
|
970
1199
|
}
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
this.onClick(event);
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
else if ((event.key === BACKSPACE_KEY || event.key === DELETE_KEY) && this.type() === "input") {
|
|
985
|
-
const closeButton = event.target.querySelector(".chip-close-button");
|
|
986
|
-
if (closeButton) {
|
|
987
|
-
closeButton.click();
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
}
|
|
1200
|
+
ngOnInit() {
|
|
1201
|
+
window.addEventListener("click", this.handleClickOutside.bind(this));
|
|
1202
|
+
}
|
|
1203
|
+
ngOnDestroy() {
|
|
1204
|
+
window.removeEventListener("click", this.handleClickOutside.bind(this));
|
|
1205
|
+
}
|
|
1206
|
+
handleKeyDownOnRightButton(event) {
|
|
1207
|
+
this.handleKeyDown(event, ARROW_DOWN_KEY, () => this.isOpen.set(true));
|
|
1208
|
+
this.handleKeyDown(event, SPACE_KEY, () => this.isOpen.set(true));
|
|
1209
|
+
this.handleKeyDown(event, "Escape", () => this.isOpen.set(false));
|
|
991
1210
|
}
|
|
992
|
-
|
|
993
|
-
event.
|
|
1211
|
+
handleKeyDownOnMenu(event) {
|
|
1212
|
+
this.handleKeyDown(event, "Escape", () => this.isOpen.set(false));
|
|
994
1213
|
}
|
|
995
|
-
|
|
996
|
-
event.
|
|
997
|
-
|
|
998
|
-
|
|
1214
|
+
handleKeyDown(event, key, callback) {
|
|
1215
|
+
if (event.key === key) {
|
|
1216
|
+
event.preventDefault();
|
|
1217
|
+
callback();
|
|
999
1218
|
}
|
|
1000
1219
|
}
|
|
1001
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1002
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: ChipComponent, isStandalone: true, selector: "rte-chip", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", 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 } }, outputs: { click: "click", close: "close" }, ngImport: i0, template: "<span\n class=\"chip\"\n tabindex=\"0\"\n [attr.role]=\"role()\"\n [attr.data-selected]=\"isCheckable() ? selected() : null\"\n [attr.data-disabled]=\"disabled()\"\n [attr.data-compact-spacing]=\"compactSpacing()\"\n [attr.data-type]=\"type()\"\n [attr.aria-checked]=\"isCheckable() ? selected() : null\"\n [attr.aria-disabled]=\"disabled()\"\n (click)=\"onClick($event)\"\n (keyup)=\"onKeyUp($event)\"\n (blur)=\"onBlur($event)\"\n>\n <ng-container *ngIf=\"type() === 'multi'\">\n <span class=\"chip-icon-container\">\n <span\n class=\"chip-icon\"\n [class.chip-icon--visible]=\"selected()\"\n [attr.aria-hidden]=\"!selected()\"\n >\n <rte-icon name=\"check-circle\" appearance=\"filled\" [size]=\"16\"></rte-icon>\n </span>\n <span\n class=\"chip-icon\"\n [class.chip-icon--visible]=\"!selected()\"\n [attr.aria-hidden]=\"selected()\"\n >\n <rte-icon name=\"radio-button-empty\" [size]=\"16\"></rte-icon>\n </span>\n </span>\n </ng-container>\n <span class=\"chip-label\" [attr.data-type]=\"type()\">{{ label() }}</span>\n <button\n *ngIf=\"type() === 'input'\"\n type=\"button\"\n class=\"chip-close-button\"\n [attr.aria-label]=\"'Supprimer ' + label()\"\n [disabled]=\"disabled()\"\n [value]=\"label()\"\n (click)=\"onCloseClick($event)\"\n >\n <rte-icon class=\"chip-close-button--icon\" name=\"close\" [size]=\"16\"></rte-icon>\n </button>\n</span>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.chip{overflow:hidden;color:var(--content-brand-default);text-overflow:ellipsis;display:inline-flex;padding:4px 12px;justify-content:center;align-items:center;gap:0px;border-radius:999px;background:var(--background-brand-unselected-default);transition:background-color .2s ease-in-out,color .2s ease-in-out}.chip:hover{cursor:pointer;color:var(--content-brand-hover);background:var(--background-brand-unselected-hover)}.chip:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.chip[data-disabled=true]{cursor:default;color:var(--content-disabled);background:var(--background-disabled);outline:none}.chip[data-selected=true]{color:var(--content-primary-inverse);background:var(--background-brand-selected-default)}.chip[data-selected=true]:hover{background:var(--background-brand-selected-hover)}.chip[data-selected=true][data-disabled=true]{cursor:default;color:var(--content-disabled);background:var(--background-disabled)}.chip[data-compact-spacing=true]{padding:0 12px}.chip[data-type=input]{padding:0 4px;pointer-events:none}.chip-label{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;padding:0 6px}.chip-label[data-type=input]{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;padding:0 8px}.chip-icon-container{position:relative;width:16px;height:16px}.chip-icon{position:absolute;left:0;top:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .2s ease-in-out,transform .2s ease-in-out;pointer-events:none}.chip-icon--visible{opacity:1;pointer-events:auto}.chip-close-button{background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;text-align:center;color:var(--content-brand-default);border-radius:999px;width:16px;height:16px;pointer-events:auto;transition:background-color .2s ease-in-out}.chip-close-button:disabled{cursor:default;color:var(--content-disabled);background:var(--background-disabled);outline:none}.chip-close-button:hover:not(:disabled){background:var(--background-brand-hover);color:var(--background-brand-unselected-hover)}.chip-close-button:focus-visible{outline:1px solid var(--border-brand-focused)}.chip-close-button--icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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 }); }
|
|
1220
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1221
|
+
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\n *ngIf=\"icon()\"\n [name]=\"icon()!\"\n [size]=\"splitButtonLeftIconSize()\"\n />\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\n name=\"arrow-chevron-down\"\n [size]=\"splitButtonRightIconSize()\"\n />\n </div>\n </button>\n <rte-dropdown-menu [items]=\"options()\" />\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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 }); }
|
|
1003
1222
|
}
|
|
1004
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SplitButtonComponent, decorators: [{
|
|
1005
1224
|
type: Component,
|
|
1006
|
-
args: [{ selector: "rte-
|
|
1225
|
+
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\n *ngIf=\"icon()\"\n [name]=\"icon()!\"\n [size]=\"splitButtonLeftIconSize()\"\n />\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\n name=\"arrow-chevron-down\"\n [size]=\"splitButtonRightIconSize()\"\n />\n </div>\n </button>\n <rte-dropdown-menu [items]=\"options()\" />\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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"] }]
|
|
1007
1226
|
}] });
|
|
1008
1227
|
|
|
1009
1228
|
class BadgeComponent {
|
|
@@ -1095,584 +1314,502 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1095
1314
|
}]
|
|
1096
1315
|
}], ctorParameters: () => [] });
|
|
1097
1316
|
|
|
1098
|
-
class
|
|
1099
|
-
constructor() {
|
|
1100
|
-
this.id = input(undefined);
|
|
1101
|
-
this.name = input(undefined);
|
|
1102
|
-
this.ariaLabelledby = input(undefined);
|
|
1103
|
-
this.label = input(undefined);
|
|
1104
|
-
this.labelId = input(undefined);
|
|
1105
|
-
this.labelPosition = input("top");
|
|
1106
|
-
this.assistiveTextLabel = input(undefined);
|
|
1107
|
-
this.assistiveTextAppearance = input("description");
|
|
1108
|
-
this.assistiveTextLink = input(undefined);
|
|
1109
|
-
this.required = input(false);
|
|
1110
|
-
this.showLabelRequirement = input(false);
|
|
1111
|
-
this.resizeable = input(true);
|
|
1112
|
-
this.maxLength = input(undefined);
|
|
1113
|
-
this.disabled = input(false);
|
|
1114
|
-
this.readOnly = input(false);
|
|
1115
|
-
this.value = input(undefined);
|
|
1116
|
-
this.rows = input(3);
|
|
1117
|
-
this.defaultValue = input(undefined);
|
|
1118
|
-
this.showCounter = input(false);
|
|
1119
|
-
this.assistiveTextIconSize = TEXTAREA_ICON_SIZE;
|
|
1120
|
-
this.requirementIndicatorValue = computed(() => this.required()
|
|
1121
|
-
? this.showLabelRequirement()
|
|
1122
|
-
? TEXTAREA_REQUIREMENT_INDICATOR_VALUE.required
|
|
1123
|
-
: TEXTAREA_REQUIREMENT_INDICATOR_VALUE.requiredIcon
|
|
1124
|
-
: TEXTAREA_REQUIREMENT_INDICATOR_VALUE.optional);
|
|
1125
|
-
this.change = output();
|
|
1126
|
-
this.blur = output();
|
|
1127
|
-
this.textareaRef = viewChild("textarea");
|
|
1128
|
-
this.isAssistiveTextLinkVisible = computed(() => this.assistiveTextAppearance() === "link" && this.assistiveTextLink() !== undefined);
|
|
1129
|
-
this.characterCount = 0;
|
|
1130
|
-
this.isCounterVisible = computed(() => {
|
|
1131
|
-
return this.showCounter() && this.maxLength();
|
|
1132
|
-
});
|
|
1133
|
-
}
|
|
1134
|
-
onInput(event) {
|
|
1135
|
-
const target = event.target;
|
|
1136
|
-
this.characterCount = target.value.length;
|
|
1137
|
-
this.change.emit(event);
|
|
1138
|
-
}
|
|
1139
|
-
onBlur(event) {
|
|
1140
|
-
this.textareaRef()?.nativeElement?.scrollTo({ top: 0 });
|
|
1141
|
-
this.blur.emit(event);
|
|
1142
|
-
}
|
|
1143
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1144
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: TextareaComponent, isStandalone: true, selector: "rte-textarea", 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 }, resizeable: { classPropertyName: "resizeable", publicName: "resizeable", 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 }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, showCounter: { classPropertyName: "showCounter", publicName: "showCounter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change", blur: "blur" }, providers: [
|
|
1145
|
-
{
|
|
1146
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1147
|
-
useExisting: TextareaComponent,
|
|
1148
|
-
multi: true,
|
|
1149
|
-
},
|
|
1150
|
-
], viewQueries: [{ propertyName: "textareaRef", first: true, predicate: ["textarea"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"container\" [attr.data-label-position]=\"labelPosition()\"> \n <label *ngIf=\"label() && labelPosition() === 'side'\" [attr.data-label-position]=\"labelPosition()\" [attr.id]=\"labelId()\" [attr.for]=\"id()\">{{label()}}<span *ngIf=\"required() || showLabelRequirement()\" class=\"requirement-indicator\" aria-hidden=\"true\" [ngClass]=\"{'required': required(), 'show-label-requirement': showLabelRequirement() }\">{{requirementIndicatorValue()}}</span></label>\n <div class=\"top-position-container\" [attr.data-label-position]=\"labelPosition()\">\n <div class=\"header-container\" [attr.data-label-position]=\"labelPosition()\">\n <label *ngIf=\"label() && labelPosition() === 'top'\" [attr.id]=\"labelId()\" [attr.for]=\"id()\">{{label()}}<span *ngIf=\"required() || showLabelRequirement()\" class=\"requirement-indicator\" aria-hidden=\"true\" [ngClass]=\"{'required': required(), 'show-label-requirement': showLabelRequirement() }\">{{requirementIndicatorValue()}}</span></label>\n <span *ngIf=\"isCounterVisible()\" class=\"character-counter\">{{ characterCount }}/{{ maxLength() }}</span>\n </div>\n <div class=\"textarea-container\" [attr.data-label-position]=\"labelPosition()\">\n <textarea\n #textarea\n class=\"textarea {{ assistiveTextAppearance() }}\"\n [class.resizeable]=\"resizeable()\"\n [attr.id]=\"id()\"\n [attr.name]=\"name()\"\n [attr.aria-labelledby]=\"labelId() || ariaLabelledby()\"\n [attr.required]=\"required() || null\"\n [attr.maxLength]=\"maxLength() !== undefined ? maxLength() : null\"\n [attr.disabled]=\"disabled() || null\"\n [attr.readonly]=\"readOnly() || null\"\n [value]=\"value() !== undefined ? value() : null\"\n [defaultValue]=\"defaultValue() !== undefined ? defaultValue() : null\"\n [attr.rows]=\"rows()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n ></textarea>\n <rte-link *ngIf=\"isAssistiveTextLinkVisible()\" class=\"assistive-text-link\" [externalLink]=\"true\" [href]=\"assistiveTextLink() || ''\" [label]=\"assistiveTextLabel() || ''\">\n </rte-link>\n <div *ngIf=\"assistiveTextAppearance() !== 'link'\" class=\"assistive-text {{ assistiveTextAppearance() }}\" [ngClass]=\"{'disabled' : disabled()}\">\n <rte-icon *ngIf=\"assistiveTextAppearance() === 'error'\" name=\"error\" [size]=\"assistiveTextIconSize\"></rte-icon>\n <rte-icon *ngIf=\"assistiveTextAppearance() === 'success'\" name=\"check-circle\" [size]=\"assistiveTextIconSize\"></rte-icon>\n <span>{{ assistiveTextLabel() }}</span>\n </div>\n </div>\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.container[data-label-position=side]{display:flex;flex-direction:row}.top-position-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;height:100%;padding:0;flex-direction:column;align-items:flex-start;gap:0px;flex-shrink:0;border-radius:0;opacity:100%}.top-position-container[data-label-position=side]{flex-grow:1}.top-position-container .header-container{display:flex;width:100%;flex-direction:row;align-items:flex-end;justify-content:space-between;padding:2px 8px;box-sizing:border-box;gap:8px}.top-position-container .header-container[data-label-position=side]{padding:0;justify-content:flex-end}.top-position-container .textarea-container{display:flex;flex-direction:column;width:100%;align-items:flex-start}.top-position-container .textarea-container .textarea{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%);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-primary);min-height:70px;padding:8px 16px;width:100%;min-width:140px;border-radius:8px;border:1px solid var(--border-secondary);opacity:100%;background-color:var(--background-default);resize:none;box-sizing:border-box}@media (min-width: 1024px){.top-position-container .textarea-container .textarea{min-height:56px;min-width:112px;max-width:1100px}}.top-position-container .textarea-container .textarea:focus-visible,.top-position-container .textarea-container .textarea:active{outline:none}.top-position-container .textarea-container .textarea:focus-visible:not(:disabled),.top-position-container .textarea-container .textarea:active:not(:disabled){outline:1px solid var(--border-brand-default);border:1px solid var(--border-brand-default)}.top-position-container .textarea-container .textarea.error:not(:disabled){outline:1px solid var(--border-danger);border:1px solid var(--border-danger)}.top-position-container .textarea-container .textarea.resizeable{resize:vertical}.top-position-container .textarea-container .textarea:disabled,.top-position-container .textarea-container .textarea:read-only{cursor:not-allowed;background-color:var(--background-disabled)}.top-position-container .textarea-container .textarea:disabled{resize:none}.top-position-container .textarea-container .textarea:read-only{color:var(--content-secondary)}.top-position-container .textarea-container .assistive-text-link{padding:4px 8px}.top-position-container .textarea-container .assistive-text{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;display:flex;padding:4px 8px;color:var(--content-tertiary);gap:4px}.top-position-container .textarea-container .assistive-text.error:not(.disabled){color:var(--content-danger)}.top-position-container .textarea-container .assistive-text.success{color:var(--content-success)}.character-counter{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)}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;color:var(--content-secondary);max-width:300px;justify-content:space-between;white-space:normal;overflow-wrap:normal;word-break:normal}label[data-label-position=side]{padding:24px 8px;align-items:flex-start;gap:0px;align-self:stretch}label .requirement-indicator{margin-left:2px}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)}label .requirement-indicator.show-label-requirement:not(.required){font-style:italic}label .requirement-indicator:not(.show-label-requirement).required{color:var(--content-danger)}\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: LinkComponent, selector: "rte-link", inputs: ["label", "href", "subtle", "externalLink"] }] }); }
|
|
1151
|
-
}
|
|
1152
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1153
|
-
type: Component,
|
|
1154
|
-
args: [{ selector: "rte-textarea", imports: [CommonModule, IconComponent, LinkComponent], standalone: true, providers: [
|
|
1155
|
-
{
|
|
1156
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1157
|
-
useExisting: TextareaComponent,
|
|
1158
|
-
multi: true,
|
|
1159
|
-
},
|
|
1160
|
-
], template: "<div class=\"container\" [attr.data-label-position]=\"labelPosition()\"> \n <label *ngIf=\"label() && labelPosition() === 'side'\" [attr.data-label-position]=\"labelPosition()\" [attr.id]=\"labelId()\" [attr.for]=\"id()\">{{label()}}<span *ngIf=\"required() || showLabelRequirement()\" class=\"requirement-indicator\" aria-hidden=\"true\" [ngClass]=\"{'required': required(), 'show-label-requirement': showLabelRequirement() }\">{{requirementIndicatorValue()}}</span></label>\n <div class=\"top-position-container\" [attr.data-label-position]=\"labelPosition()\">\n <div class=\"header-container\" [attr.data-label-position]=\"labelPosition()\">\n <label *ngIf=\"label() && labelPosition() === 'top'\" [attr.id]=\"labelId()\" [attr.for]=\"id()\">{{label()}}<span *ngIf=\"required() || showLabelRequirement()\" class=\"requirement-indicator\" aria-hidden=\"true\" [ngClass]=\"{'required': required(), 'show-label-requirement': showLabelRequirement() }\">{{requirementIndicatorValue()}}</span></label>\n <span *ngIf=\"isCounterVisible()\" class=\"character-counter\">{{ characterCount }}/{{ maxLength() }}</span>\n </div>\n <div class=\"textarea-container\" [attr.data-label-position]=\"labelPosition()\">\n <textarea\n #textarea\n class=\"textarea {{ assistiveTextAppearance() }}\"\n [class.resizeable]=\"resizeable()\"\n [attr.id]=\"id()\"\n [attr.name]=\"name()\"\n [attr.aria-labelledby]=\"labelId() || ariaLabelledby()\"\n [attr.required]=\"required() || null\"\n [attr.maxLength]=\"maxLength() !== undefined ? maxLength() : null\"\n [attr.disabled]=\"disabled() || null\"\n [attr.readonly]=\"readOnly() || null\"\n [value]=\"value() !== undefined ? value() : null\"\n [defaultValue]=\"defaultValue() !== undefined ? defaultValue() : null\"\n [attr.rows]=\"rows()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n ></textarea>\n <rte-link *ngIf=\"isAssistiveTextLinkVisible()\" class=\"assistive-text-link\" [externalLink]=\"true\" [href]=\"assistiveTextLink() || ''\" [label]=\"assistiveTextLabel() || ''\">\n </rte-link>\n <div *ngIf=\"assistiveTextAppearance() !== 'link'\" class=\"assistive-text {{ assistiveTextAppearance() }}\" [ngClass]=\"{'disabled' : disabled()}\">\n <rte-icon *ngIf=\"assistiveTextAppearance() === 'error'\" name=\"error\" [size]=\"assistiveTextIconSize\"></rte-icon>\n <rte-icon *ngIf=\"assistiveTextAppearance() === 'success'\" name=\"check-circle\" [size]=\"assistiveTextIconSize\"></rte-icon>\n <span>{{ assistiveTextLabel() }}</span>\n </div>\n </div>\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.container[data-label-position=side]{display:flex;flex-direction:row}.top-position-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;height:100%;padding:0;flex-direction:column;align-items:flex-start;gap:0px;flex-shrink:0;border-radius:0;opacity:100%}.top-position-container[data-label-position=side]{flex-grow:1}.top-position-container .header-container{display:flex;width:100%;flex-direction:row;align-items:flex-end;justify-content:space-between;padding:2px 8px;box-sizing:border-box;gap:8px}.top-position-container .header-container[data-label-position=side]{padding:0;justify-content:flex-end}.top-position-container .textarea-container{display:flex;flex-direction:column;width:100%;align-items:flex-start}.top-position-container .textarea-container .textarea{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%);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-primary);min-height:70px;padding:8px 16px;width:100%;min-width:140px;border-radius:8px;border:1px solid var(--border-secondary);opacity:100%;background-color:var(--background-default);resize:none;box-sizing:border-box}@media (min-width: 1024px){.top-position-container .textarea-container .textarea{min-height:56px;min-width:112px;max-width:1100px}}.top-position-container .textarea-container .textarea:focus-visible,.top-position-container .textarea-container .textarea:active{outline:none}.top-position-container .textarea-container .textarea:focus-visible:not(:disabled),.top-position-container .textarea-container .textarea:active:not(:disabled){outline:1px solid var(--border-brand-default);border:1px solid var(--border-brand-default)}.top-position-container .textarea-container .textarea.error:not(:disabled){outline:1px solid var(--border-danger);border:1px solid var(--border-danger)}.top-position-container .textarea-container .textarea.resizeable{resize:vertical}.top-position-container .textarea-container .textarea:disabled,.top-position-container .textarea-container .textarea:read-only{cursor:not-allowed;background-color:var(--background-disabled)}.top-position-container .textarea-container .textarea:disabled{resize:none}.top-position-container .textarea-container .textarea:read-only{color:var(--content-secondary)}.top-position-container .textarea-container .assistive-text-link{padding:4px 8px}.top-position-container .textarea-container .assistive-text{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;display:flex;padding:4px 8px;color:var(--content-tertiary);gap:4px}.top-position-container .textarea-container .assistive-text.error:not(.disabled){color:var(--content-danger)}.top-position-container .textarea-container .assistive-text.success{color:var(--content-success)}.character-counter{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)}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;color:var(--content-secondary);max-width:300px;justify-content:space-between;white-space:normal;overflow-wrap:normal;word-break:normal}label[data-label-position=side]{padding:24px 8px;align-items:flex-start;gap:0px;align-self:stretch}label .requirement-indicator{margin-left:2px}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)}label .requirement-indicator.show-label-requirement:not(.required){font-style:italic}label .requirement-indicator:not(.show-label-requirement).required{color:var(--content-danger)}\n"] }]
|
|
1161
|
-
}] });
|
|
1162
|
-
|
|
1163
|
-
class DividerComponent {
|
|
1164
|
-
constructor() {
|
|
1165
|
-
this.orientation = input("horizontal");
|
|
1166
|
-
this.thickness = input("light");
|
|
1167
|
-
this.appearance = input("default");
|
|
1168
|
-
this.endPoint = input("round");
|
|
1169
|
-
this.isHorizontal = computed(() => this.orientation() === "horizontal");
|
|
1170
|
-
}
|
|
1171
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1172
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DividerComponent, isStandalone: true, selector: "rte-divider", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, endPoint: { classPropertyName: "endPoint", publicName: "endPoint", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (isHorizontal()) {\n <hr class=\"horizontal {{thickness()}} {{appearance()}} {{endPoint()}}\" />\n} @else {\n <div class=\"vertical {{thickness()}} {{appearance()}} {{endPoint()}}\" role=\"separator\"></div>\n}", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.horizontal{border:none;padding:0;margin:0;width:100%}.horizontal.round{border-radius:999px}.horizontal.light{border-top:1px solid var(--border-divider)}.horizontal.medium{border-top:2px solid var(--border-divider)}.horizontal.bold{border-top:4px solid var(--border-divider)}.horizontal.inverse{border-top-color:var(--border-inverse)}.vertical{height:100%;background-color:var(--border-divider);margin:0;padding:0}.vertical.round{border-radius:999px}.vertical.light{width:1px}.vertical.medium{width:2px}.vertical.bold{width:4px}.vertical.inverse{background-color:var(--border-inverse)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1173
|
-
}
|
|
1174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DividerComponent, decorators: [{
|
|
1175
|
-
type: Component,
|
|
1176
|
-
args: [{ selector: "rte-divider", imports: [CommonModule], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (isHorizontal()) {\n <hr class=\"horizontal {{thickness()}} {{appearance()}} {{endPoint()}}\" />\n} @else {\n <div class=\"vertical {{thickness()}} {{appearance()}} {{endPoint()}}\" role=\"separator\"></div>\n}", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.horizontal{border:none;padding:0;margin:0;width:100%}.horizontal.round{border-radius:999px}.horizontal.light{border-top:1px solid var(--border-divider)}.horizontal.medium{border-top:2px solid var(--border-divider)}.horizontal.bold{border-top:4px solid var(--border-divider)}.horizontal.inverse{border-top-color:var(--border-inverse)}.vertical{height:100%;background-color:var(--border-divider);margin:0;padding:0}.vertical.round{border-radius:999px}.vertical.light{width:1px}.vertical.medium{width:2px}.vertical.bold{width:4px}.vertical.inverse{background-color:var(--border-inverse)}\n"] }]
|
|
1177
|
-
}] });
|
|
1178
|
-
|
|
1179
|
-
class SwitchComponent {
|
|
1317
|
+
class IconButtonComponent {
|
|
1180
1318
|
constructor() {
|
|
1181
|
-
this.label = input("");
|
|
1182
|
-
this.appearance = input("brand");
|
|
1183
|
-
this.showLabel = input(true);
|
|
1184
|
-
this.showIcon = input(true);
|
|
1185
1319
|
this.disabled = input(false);
|
|
1186
|
-
this.
|
|
1187
|
-
this.
|
|
1188
|
-
this.
|
|
1189
|
-
this.
|
|
1190
|
-
this.
|
|
1191
|
-
this.
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
this.
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
this.
|
|
1199
|
-
this.
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
else {
|
|
1206
|
-
const inputElement = event.currentTarget.querySelector('input[type="checkbox"]');
|
|
1207
|
-
if (inputElement) {
|
|
1208
|
-
inputElement.checked = !this.isChecked();
|
|
1209
|
-
const changeEvent = new Event("change", { bubbles: true });
|
|
1210
|
-
Object.defineProperty(changeEvent, "target", {
|
|
1211
|
-
value: inputElement,
|
|
1212
|
-
writable: false,
|
|
1213
|
-
});
|
|
1214
|
-
this.handleChange(changeEvent);
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1219
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SwitchComponent, isStandalone: true, selector: "rte-switch", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", 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 }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stateChange: "stateChange" }, ngImport: i0, template: "<div\n class=\"switch-container appearance-{{appearance()}}\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'read-only': readOnly(),\n 'checked': isChecked()\n }\"\n (click)=\"handleClick($event)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"switch\"\n [attr.aria-checked]=\"isChecked()\"\n [attr.aria-label]=\"label()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-readonly]=\"readOnly()\"\n [ariaLabel]=\"label()\"\n [name]=\"label()\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'read-only': readOnly(),\n 'checked': isChecked()\n }\"\n [style.min-height.px]=\"switchHeight\"\n [style.min-width.px]=\"switchWidth\"\n [disabled]=\"disabled()\"\n [checked]=\"isChecked()\"\n />\n <div class=\"switch-icon-check\" [ngClass]=\"{'checked': isChecked() }\" (click)=\"handleClick($event)\">\n @if (showIcon()) {\n <rte-icon\n class=\"icon\"\n [name]=\"isChecked() ? 'check' : 'close'\"\n [size]=\"16\"\n (click)=\"handleClick($event)\"\n ></rte-icon>\n }\n </div>\n @if (showLabel() && label()) {\n <label\n class=\"switch-label\"\n [for]=\"label()\"\n >\n {{ label() }}\n </label>\n }\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.switch-container{display:inline-flex;align-items:center;gap:12px;position:relative}.switch-container:hover .switch-icon-check{background-color:var(--background-neutral-bold-hover)}.switch-container.checked:hover .switch{background-color:var(--background-brand-selected-hover)}.switch-container .switch{appearance:none;cursor:pointer;position:relative;display:block;padding:0;margin:0;background-color:var(--background-neutral-regular-default);border:2px solid var(--border-primary);border-radius:999px;transition:background-color .4s ease-in-out,border-color .4s ease-in-out}.switch-container .switch:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.switch-container .checked{background-color:var(--background-brand-selected-default);border:none}.switch-container .switch-icon-check{content:\"\";cursor:pointer;display:flex;align-items:center;justify-content:center;position:absolute;background-color:var(--background-neutral-bold-default);color:var(--background-default);height:16px;width:16px;border-radius:999px;top:calc(50% - 8px);left:4px;transition:background-color .4s ease-in-out,color .4s ease-in-out,transform .4s ease-in-out}.switch-container .switch-icon-check.checked{background-color:var(--background-default);color:var(--background-brand-selected-default);transform:translate(16px)}.switch-container.appearance-neutral .switch{background-color:var(--background-neutral-regular-default);border:2px solid var(--border-primary)}.switch-container.appearance-neutral .switch-icon-check{background-color:var(--background-neutral-bold-default);color:var(--content-primary-inverse);border:none}.switch-container.appearance-neutral:hover .switch-icon-check{background-color:var(--background-neutral-bold-hover)}.switch-container.appearance-neutral.checked .switch{background-color:var(--background-neutral-bold-default);border:none}.switch-container.appearance-neutral.checked .switch-icon-check{background-color:var(--background-default);color:var(--content-tertiary)}.switch-container.appearance-neutral.checked:hover .switch{background-color:var(--background-neutral-bold-hover)}.switch-container.appearance-neutral.read-only{cursor:not-allowed}.switch-container.appearance-neutral.read-only:hover .switch{background-color:var(--background-disabled)}.switch-container.appearance-neutral.read-only .switch{background-color:var(--background-disabled);border:none}.switch-container.appearance-neutral.read-only .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-primary);border:2px solid var(--border-primary)}.switch-container.appearance-neutral.read-only .switch-icon-check .icon,.switch-container.appearance-neutral.disabled{cursor:not-allowed}.switch-container.appearance-neutral.disabled .switch{background-color:var(--background-disabled);border:none}.switch-container.appearance-neutral.disabled .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-disabled);border:2px solid var(--border-disabled)}.switch-container.appearance-neutral.disabled .switch-icon-check .icon{cursor:not-allowed}.switch-container .switch-label{cursor:pointer;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-primary);word-wrap:break-word}.switch-container.read-only{cursor:not-allowed}.switch-container.read-only:hover .switch{background-color:var(--background-disabled)}.switch-container.read-only .switch{cursor:not-allowed;background-color:var(--background-disabled);border:none}.switch-container.read-only .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-primary);border:2px solid var(--border-primary)}.switch-container.read-only .switch-label{cursor:not-allowed;color:var(--content-tertiary)}.switch-container.disabled{cursor:not-allowed}.switch-container.disabled:hover .switch{background-color:var(--background-disabled)}.switch-container.disabled .switch{cursor:not-allowed;background-color:var(--background-disabled);border:none}.switch-container.disabled .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-disabled);border:2px solid var(--border-disabled)}.switch-container.disabled .switch-label{cursor:not-allowed;color:var(--content-disabled)}\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1220
|
-
}
|
|
1221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
1222
|
-
type: Component,
|
|
1223
|
-
args: [{ selector: "rte-switch", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"switch-container appearance-{{appearance()}}\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'read-only': readOnly(),\n 'checked': isChecked()\n }\"\n (click)=\"handleClick($event)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"switch\"\n [attr.aria-checked]=\"isChecked()\"\n [attr.aria-label]=\"label()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-readonly]=\"readOnly()\"\n [ariaLabel]=\"label()\"\n [name]=\"label()\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'read-only': readOnly(),\n 'checked': isChecked()\n }\"\n [style.min-height.px]=\"switchHeight\"\n [style.min-width.px]=\"switchWidth\"\n [disabled]=\"disabled()\"\n [checked]=\"isChecked()\"\n />\n <div class=\"switch-icon-check\" [ngClass]=\"{'checked': isChecked() }\" (click)=\"handleClick($event)\">\n @if (showIcon()) {\n <rte-icon\n class=\"icon\"\n [name]=\"isChecked() ? 'check' : 'close'\"\n [size]=\"16\"\n (click)=\"handleClick($event)\"\n ></rte-icon>\n }\n </div>\n @if (showLabel() && label()) {\n <label\n class=\"switch-label\"\n [for]=\"label()\"\n >\n {{ label() }}\n </label>\n }\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.switch-container{display:inline-flex;align-items:center;gap:12px;position:relative}.switch-container:hover .switch-icon-check{background-color:var(--background-neutral-bold-hover)}.switch-container.checked:hover .switch{background-color:var(--background-brand-selected-hover)}.switch-container .switch{appearance:none;cursor:pointer;position:relative;display:block;padding:0;margin:0;background-color:var(--background-neutral-regular-default);border:2px solid var(--border-primary);border-radius:999px;transition:background-color .4s ease-in-out,border-color .4s ease-in-out}.switch-container .switch:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.switch-container .checked{background-color:var(--background-brand-selected-default);border:none}.switch-container .switch-icon-check{content:\"\";cursor:pointer;display:flex;align-items:center;justify-content:center;position:absolute;background-color:var(--background-neutral-bold-default);color:var(--background-default);height:16px;width:16px;border-radius:999px;top:calc(50% - 8px);left:4px;transition:background-color .4s ease-in-out,color .4s ease-in-out,transform .4s ease-in-out}.switch-container .switch-icon-check.checked{background-color:var(--background-default);color:var(--background-brand-selected-default);transform:translate(16px)}.switch-container.appearance-neutral .switch{background-color:var(--background-neutral-regular-default);border:2px solid var(--border-primary)}.switch-container.appearance-neutral .switch-icon-check{background-color:var(--background-neutral-bold-default);color:var(--content-primary-inverse);border:none}.switch-container.appearance-neutral:hover .switch-icon-check{background-color:var(--background-neutral-bold-hover)}.switch-container.appearance-neutral.checked .switch{background-color:var(--background-neutral-bold-default);border:none}.switch-container.appearance-neutral.checked .switch-icon-check{background-color:var(--background-default);color:var(--content-tertiary)}.switch-container.appearance-neutral.checked:hover .switch{background-color:var(--background-neutral-bold-hover)}.switch-container.appearance-neutral.read-only{cursor:not-allowed}.switch-container.appearance-neutral.read-only:hover .switch{background-color:var(--background-disabled)}.switch-container.appearance-neutral.read-only .switch{background-color:var(--background-disabled);border:none}.switch-container.appearance-neutral.read-only .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-primary);border:2px solid var(--border-primary)}.switch-container.appearance-neutral.read-only .switch-icon-check .icon,.switch-container.appearance-neutral.disabled{cursor:not-allowed}.switch-container.appearance-neutral.disabled .switch{background-color:var(--background-disabled);border:none}.switch-container.appearance-neutral.disabled .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-disabled);border:2px solid var(--border-disabled)}.switch-container.appearance-neutral.disabled .switch-icon-check .icon{cursor:not-allowed}.switch-container .switch-label{cursor:pointer;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-primary);word-wrap:break-word}.switch-container.read-only{cursor:not-allowed}.switch-container.read-only:hover .switch{background-color:var(--background-disabled)}.switch-container.read-only .switch{cursor:not-allowed;background-color:var(--background-disabled);border:none}.switch-container.read-only .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-primary);border:2px solid var(--border-primary)}.switch-container.read-only .switch-label{cursor:not-allowed;color:var(--content-tertiary)}.switch-container.disabled{cursor:not-allowed}.switch-container.disabled:hover .switch{background-color:var(--background-disabled)}.switch-container.disabled .switch{cursor:not-allowed;background-color:var(--background-disabled);border:none}.switch-container.disabled .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-disabled);border:2px solid var(--border-disabled)}.switch-container.disabled .switch-label{cursor:not-allowed;color:var(--content-disabled)}\n"] }]
|
|
1224
|
-
}] });
|
|
1225
|
-
|
|
1226
|
-
const segmentClass = "rte-segment";
|
|
1227
|
-
const segmentSelector = `.${segmentClass}`;
|
|
1228
|
-
class SegmentedControlComponent {
|
|
1229
|
-
constructor() {
|
|
1230
|
-
this.options = input([]);
|
|
1231
|
-
this.change = output();
|
|
1232
|
-
this.selectedSegment = input();
|
|
1233
|
-
this.ariaLabel = input();
|
|
1234
|
-
this.ariaLabelledBy = input();
|
|
1235
|
-
this.segmentRefs = viewChildren("segment");
|
|
1236
|
-
this.sliderLeft = signal(0);
|
|
1237
|
-
this.sliderWidth = signal(0);
|
|
1238
|
-
this.sliderTop = signal(0);
|
|
1239
|
-
this.segmentSelectedIndicatorStyle = computed(() => ({
|
|
1240
|
-
left: `${this.sliderLeft()}px`,
|
|
1241
|
-
top: `${this.sliderTop()}px`,
|
|
1242
|
-
width: `${this.sliderWidth()}px`,
|
|
1243
|
-
}));
|
|
1244
|
-
this.isValidOptions = computed(() => isValidSegmentedControlOptions(this.options()));
|
|
1245
|
-
this.lastKeydown = null;
|
|
1246
|
-
this.onGlobalKeyDown = (event) => {
|
|
1247
|
-
this.lastKeydown = event.key;
|
|
1248
|
-
};
|
|
1249
|
-
}
|
|
1250
|
-
ngOnChanges(changes) {
|
|
1251
|
-
if (changes["selectedSegment"]) {
|
|
1252
|
-
this.updateSelectedSegmentIndicator();
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
ngAfterViewInit() {
|
|
1256
|
-
this.updateSelectedSegmentIndicator();
|
|
1257
|
-
window.addEventListener("resize", this.updateSelectedSegmentIndicator.bind(this));
|
|
1258
|
-
window.addEventListener("keydown", this.onGlobalKeyDown.bind(this));
|
|
1259
|
-
this.segmentRefs().forEach((segmentElement) => {
|
|
1260
|
-
segmentElement.nativeElement.addEventListener("focus", this.focusCurrentSegmentElement.bind(this));
|
|
1261
|
-
});
|
|
1262
|
-
}
|
|
1263
|
-
ngOnDestroy() {
|
|
1264
|
-
window.removeEventListener("resize", this.updateSelectedSegmentIndicator.bind(this));
|
|
1265
|
-
window.removeEventListener("keydown", this.onGlobalKeyDown.bind(this));
|
|
1266
|
-
this.segmentRefs().forEach((segmentElement) => {
|
|
1267
|
-
segmentElement.nativeElement.addEventListener("focus", this.focusCurrentSegmentElement.bind(this));
|
|
1320
|
+
this.name = input.required();
|
|
1321
|
+
this.size = input("m");
|
|
1322
|
+
this.variant = input("primary");
|
|
1323
|
+
this.type = input("button");
|
|
1324
|
+
this.appearance = input("outlined");
|
|
1325
|
+
this.compactSpacing = input(false);
|
|
1326
|
+
this.ariaLabel = input(undefined);
|
|
1327
|
+
this.ariaLabelledBy = input(undefined);
|
|
1328
|
+
this.badgeCount = input();
|
|
1329
|
+
this.badgeContent = input();
|
|
1330
|
+
this.badgeType = input();
|
|
1331
|
+
this.badgeIcon = input("settings");
|
|
1332
|
+
this.buttonIconSize = computed(() => buttonIconSize[this.size()]);
|
|
1333
|
+
this.isValidIconName = computed(() => isValidIconName(this.name()));
|
|
1334
|
+
this.click = output();
|
|
1335
|
+
this.shouldDisplayBadge = computed(() => {
|
|
1336
|
+
const count = this.badgeCount();
|
|
1337
|
+
const content = this.badgeContent();
|
|
1338
|
+
return (count && count > 0 && content === "number") || content === "icon";
|
|
1268
1339
|
});
|
|
1269
1340
|
}
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
isSegmentSelected(id) {
|
|
1274
|
-
return this.selectedSegment() === id;
|
|
1275
|
-
}
|
|
1276
|
-
handleKeyUp(event) {
|
|
1277
|
-
event.preventDefault();
|
|
1278
|
-
if (event.key === ARROW_RIGHT_KEY || event.key === ARROW_LEFT_KEY) {
|
|
1279
|
-
const allSegmentElements = Array.from(document.activeElement?.parentElement?.parentElement?.querySelectorAll(segmentSelector)) || [];
|
|
1280
|
-
const currentActiveSegmentElementIndex = Array.from(allSegmentElements).findIndex((element) => element === document.activeElement);
|
|
1281
|
-
if (event.key === ARROW_RIGHT_KEY) {
|
|
1282
|
-
focusNextSegmentElement(currentActiveSegmentElementIndex, allSegmentElements);
|
|
1283
|
-
}
|
|
1284
|
-
else if (event.key === ARROW_LEFT_KEY) {
|
|
1285
|
-
focusPreviousSegmentElement(currentActiveSegmentElementIndex, allSegmentElements);
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
else if (event.key === SPACE_KEY || event.key === ENTER_KEY) {
|
|
1289
|
-
const target = event.target;
|
|
1290
|
-
const dataId = target.getAttribute("data-id");
|
|
1291
|
-
this.selectSegment(dataId || "");
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
handleKeyDown(event) {
|
|
1295
|
-
if (event.key === TAB_KEY || event.key === SPACE_KEY || event.key === ENTER_KEY) {
|
|
1296
|
-
event.preventDefault();
|
|
1297
|
-
}
|
|
1298
|
-
if (event.key === TAB_KEY) {
|
|
1299
|
-
const allFocusableElements = Array.from(document.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY));
|
|
1300
|
-
const currentActiveElement = document.activeElement;
|
|
1301
|
-
const currentIndex = allFocusableElements.indexOf(currentActiveElement);
|
|
1302
|
-
if (event.shiftKey) {
|
|
1303
|
-
focusPreviousNotSegmentElement(currentIndex, allFocusableElements, segmentClass);
|
|
1304
|
-
}
|
|
1305
|
-
else {
|
|
1306
|
-
focusNextNotSegmentElement(currentIndex, allFocusableElements, segmentClass);
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
getSegmentPosition(index) {
|
|
1311
|
-
return getSegmentPosition(index, this.options().length);
|
|
1312
|
-
}
|
|
1313
|
-
updateSelectedSegmentIndicator() {
|
|
1314
|
-
const idx = this.options().findIndex((opt) => opt.id === this.selectedSegment());
|
|
1315
|
-
const segment = this.segmentRefs()[idx]?.nativeElement;
|
|
1316
|
-
if (segment) {
|
|
1317
|
-
this.sliderWidth.set(segment.offsetWidth);
|
|
1318
|
-
this.sliderTop.set(segment.offsetTop);
|
|
1319
|
-
this.sliderLeft.set(segment.offsetLeft);
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
focusCurrentSegmentElement() {
|
|
1323
|
-
if (this.lastKeydown === "Tab") {
|
|
1324
|
-
const selectedSegmentElement = this.segmentRefs().find((segment) => segment.nativeElement.classList.contains("selected"))?.nativeElement;
|
|
1325
|
-
if (selectedSegmentElement) {
|
|
1326
|
-
selectedSegmentElement.focus();
|
|
1327
|
-
}
|
|
1328
|
-
else {
|
|
1329
|
-
this.segmentRefs()[0]?.nativeElement?.focus();
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1341
|
+
onClick(event) {
|
|
1342
|
+
event.stopPropagation();
|
|
1343
|
+
this.click.emit(event);
|
|
1332
1344
|
}
|
|
1333
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1334
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1345
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1346
|
+
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: { click: "click" }, 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 [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\n [name]=\"name()\"\n [appearance]=\"appearance()\"\n [size]=\"buttonIconSize()\"\n />\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\n [name]=\"name()\"\n [appearance]=\"appearance()\"\n [size]=\"buttonIconSize()\"\n />\n </button>\n}\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: "directive", type: BadgeDirective, selector: "[rteBadge]", inputs: ["rteBadgeType", "rteBadgeSize", "rteBadgeContent", "rteBadgeCount", "rteBadgeIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1335
1347
|
}
|
|
1336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
1337
1349
|
type: Component,
|
|
1338
|
-
args: [{ selector: "rte-
|
|
1350
|
+
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\n [name]=\"name()\"\n [appearance]=\"appearance()\"\n [size]=\"buttonIconSize()\"\n />\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\n [name]=\"name()\"\n [appearance]=\"appearance()\"\n [size]=\"buttonIconSize()\"\n />\n </button>\n}\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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"] }]
|
|
1339
1351
|
}] });
|
|
1340
1352
|
|
|
1341
|
-
class
|
|
1353
|
+
class IconButtonToggleComponent {
|
|
1342
1354
|
constructor() {
|
|
1343
|
-
this.
|
|
1344
|
-
this.
|
|
1345
|
-
this.
|
|
1355
|
+
this.disabled = input(false);
|
|
1356
|
+
this.name = input.required();
|
|
1357
|
+
this.size = input("m");
|
|
1358
|
+
this.variant = input("primary");
|
|
1359
|
+
this.type = input("button");
|
|
1360
|
+
this.compactSpacing = input(false);
|
|
1361
|
+
this.ariaLabel = input();
|
|
1362
|
+
this.ariaLabelledBy = input();
|
|
1363
|
+
this.selected = input();
|
|
1364
|
+
this.internalSelected = signal(false);
|
|
1365
|
+
this.defaultSelected = input(false);
|
|
1366
|
+
this.isControlled = computed(() => this.selected() !== undefined);
|
|
1367
|
+
this.click = output();
|
|
1368
|
+
this.isSelected = computed(() => {
|
|
1369
|
+
return this.isControlled() ? this.selected() : this.internalSelected();
|
|
1370
|
+
});
|
|
1371
|
+
this.buttonIconSize = computed(() => buttonIconSize[this.size()]);
|
|
1346
1372
|
}
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
event.preventDefault();
|
|
1350
|
-
event.stopPropagation();
|
|
1351
|
-
return;
|
|
1352
|
-
}
|
|
1353
|
-
this.itemEvent.emit({ event, id: this.item()?.id || this.item()?.label || "" });
|
|
1373
|
+
toggleInternalSelectedState() {
|
|
1374
|
+
this.internalSelected.set(!this.internalSelected());
|
|
1354
1375
|
}
|
|
1355
|
-
|
|
1356
|
-
event.
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
link?.click();
|
|
1361
|
-
}
|
|
1362
|
-
else {
|
|
1363
|
-
this.itemEvent.emit({ event, id: this.item()?.id || this.item()?.label || "" });
|
|
1364
|
-
}
|
|
1376
|
+
onClick(event) {
|
|
1377
|
+
event.stopPropagation();
|
|
1378
|
+
this.click.emit(event);
|
|
1379
|
+
if (!this.isControlled()) {
|
|
1380
|
+
this.toggleInternalSelectedState();
|
|
1365
1381
|
}
|
|
1366
1382
|
}
|
|
1367
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1368
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type:
|
|
1383
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconButtonToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1384
|
+
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 (click)=\"onClick($event)\"\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"], outputs: ["click"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1369
1385
|
}
|
|
1370
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconButtonToggleComponent, decorators: [{
|
|
1371
1387
|
type: Component,
|
|
1372
|
-
args: [{ selector: "rte-
|
|
1388
|
+
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 (click)=\"onClick($event)\"\n/>" }]
|
|
1373
1389
|
}] });
|
|
1374
1390
|
|
|
1375
|
-
class
|
|
1391
|
+
class TextInputComponent {
|
|
1376
1392
|
constructor() {
|
|
1377
|
-
this.
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
this.
|
|
1381
|
-
this.
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
this.
|
|
1385
|
-
|
|
1393
|
+
this.id = input();
|
|
1394
|
+
this.label = input("");
|
|
1395
|
+
this.labelPosition = input("top");
|
|
1396
|
+
this.required = input(false);
|
|
1397
|
+
this.showCounter = input(false);
|
|
1398
|
+
this.value = input("");
|
|
1399
|
+
this.internalValue = signal(this.value());
|
|
1400
|
+
this.leftIcon = input(null);
|
|
1401
|
+
this.showRightIcon = input(true);
|
|
1402
|
+
this.rightIconAction = input("clean");
|
|
1403
|
+
this.showLabelRequirement = input(false);
|
|
1404
|
+
this.assistiveAppearance = input("description");
|
|
1405
|
+
this.showAssistiveIcon = input(false);
|
|
1406
|
+
this.assistiveTextLabel = input("");
|
|
1407
|
+
this.error = input(false);
|
|
1408
|
+
this.maxLength = input(150);
|
|
1409
|
+
this.disabled = input(false);
|
|
1410
|
+
this.readOnly = input(false);
|
|
1411
|
+
this.width = input("300px");
|
|
1412
|
+
this.ariaLabel = input("");
|
|
1413
|
+
this.ariaRequired = input(false);
|
|
1414
|
+
this.ariaLabelledby = input("");
|
|
1415
|
+
this.valueChange = output();
|
|
1416
|
+
this.rightIconClick = output();
|
|
1417
|
+
this.characterCount = signal(this.internalValue().length);
|
|
1418
|
+
this.isHiddenInput = signal(this.showRightIcon() && this.rightIconAction() === "visibilityOn");
|
|
1419
|
+
this.displayedLeftIcon = computed(() => (this.error() ? "error" : this.leftIcon()));
|
|
1420
|
+
this.displayCounter = computed(() => this.showCounter() && typeof this.maxLength() === "number");
|
|
1421
|
+
this.rightIconName = computed(() => {
|
|
1422
|
+
if (["visibilityOn", "visibilityOff"].includes(this.rightIconAction())) {
|
|
1423
|
+
return this.isHiddenInput() ? "visibility-show" : "visibility-hide";
|
|
1424
|
+
}
|
|
1425
|
+
else if (this.rightIconAction() === "clean") {
|
|
1426
|
+
return "close";
|
|
1427
|
+
}
|
|
1428
|
+
return "";
|
|
1429
|
+
});
|
|
1430
|
+
this.rightIconAriaLabel = computed(() => {
|
|
1431
|
+
if (["visibilityOn", "visibilityOff"].includes(this.rightIconAction())) {
|
|
1432
|
+
return this.isHiddenInput() ? "show text" : "hide text";
|
|
1433
|
+
}
|
|
1434
|
+
else if (this.rightIconAction() === "clean") {
|
|
1435
|
+
return "clear";
|
|
1436
|
+
}
|
|
1437
|
+
return "";
|
|
1438
|
+
});
|
|
1439
|
+
this.shouldShowRightIcon = computed(() => {
|
|
1440
|
+
if (this.readOnly() || this.disabled()) {
|
|
1441
|
+
return false;
|
|
1442
|
+
}
|
|
1443
|
+
if (this.rightIconAction() === "clean") {
|
|
1444
|
+
return !!this.internalValue()?.length && this.showRightIcon();
|
|
1445
|
+
}
|
|
1446
|
+
return this.showRightIcon() && !!this.rightIconAction();
|
|
1386
1447
|
});
|
|
1448
|
+
this.lastParentValue = this.value();
|
|
1449
|
+
effect(() => {
|
|
1450
|
+
const parentValue = this.value();
|
|
1451
|
+
if (parentValue !== this.lastParentValue) {
|
|
1452
|
+
this.lastParentValue = parentValue;
|
|
1453
|
+
this.internalValue.set(parentValue);
|
|
1454
|
+
}
|
|
1455
|
+
}, { allowSignalWrites: true });
|
|
1387
1456
|
}
|
|
1388
|
-
|
|
1389
|
-
|
|
1457
|
+
handleChange(event) {
|
|
1458
|
+
const input = event.target;
|
|
1459
|
+
this.internalValue.set(input.value);
|
|
1460
|
+
this.valueChange.emit(input.value);
|
|
1461
|
+
if (this.maxLength()) {
|
|
1462
|
+
this.characterCount.set(input.value.length);
|
|
1463
|
+
}
|
|
1464
|
+
this.valueChange.emit(input.value);
|
|
1390
1465
|
}
|
|
1391
|
-
|
|
1392
|
-
|
|
1466
|
+
onRightIconClickHandler() {
|
|
1467
|
+
this.rightIconClick.emit();
|
|
1468
|
+
this.triggerRightIconAction();
|
|
1393
1469
|
}
|
|
1394
|
-
|
|
1395
|
-
this.
|
|
1396
|
-
console.log("🔵 Dropdown Service - State Reset");
|
|
1470
|
+
toggleInputVisibility() {
|
|
1471
|
+
this.isHiddenInput.set(!this.isHiddenInput());
|
|
1397
1472
|
}
|
|
1398
|
-
|
|
1399
|
-
if (
|
|
1400
|
-
this.
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
this.closeAllMenus();
|
|
1473
|
+
triggerRightIconAction() {
|
|
1474
|
+
if (this.rightIconAction() === "clean") {
|
|
1475
|
+
this.internalValue.set("");
|
|
1476
|
+
this.valueChange.emit("");
|
|
1477
|
+
this.characterCount.set(0);
|
|
1404
1478
|
}
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
const { menuElement } = options;
|
|
1408
|
-
const nativeElement = menuElement?.nativeElement;
|
|
1409
|
-
switch (key) {
|
|
1410
|
-
case ARROW_DOWN_KEY:
|
|
1411
|
-
this.focusNextElement(nativeElement);
|
|
1412
|
-
break;
|
|
1413
|
-
case ARROW_UP_KEY:
|
|
1414
|
-
this.focusPreviousElement(nativeElement);
|
|
1415
|
-
break;
|
|
1479
|
+
if (["visibilityOn", "visibilityOff"].includes(this.rightIconAction())) {
|
|
1480
|
+
this.toggleInputVisibility();
|
|
1416
1481
|
}
|
|
1417
1482
|
}
|
|
1418
|
-
|
|
1419
|
-
if (!element)
|
|
1420
|
-
return;
|
|
1421
|
-
const focusableElements = this.getFocusableElements(element);
|
|
1422
|
-
const currentIndex = focusableElements.indexOf(document.activeElement);
|
|
1423
|
-
const nextIndex = currentIndex + 1 < focusableElements.length ? currentIndex + 1 : 0;
|
|
1424
|
-
focusableElements[nextIndex]?.focus();
|
|
1425
|
-
}
|
|
1426
|
-
focusPreviousElement(element) {
|
|
1427
|
-
if (!element)
|
|
1428
|
-
return;
|
|
1429
|
-
const focusableElements = this.getFocusableElements(element);
|
|
1430
|
-
const currentIndex = focusableElements.indexOf(document.activeElement);
|
|
1431
|
-
const previousIndex = currentIndex ? currentIndex - 1 : focusableElements.length - 1;
|
|
1432
|
-
focusableElements[previousIndex]?.focus();
|
|
1433
|
-
}
|
|
1434
|
-
getFocusableElements(element) {
|
|
1435
|
-
const menuId = element.dataset["menuId"];
|
|
1436
|
-
return Array.from(element.querySelectorAll("li")).filter((el) => {
|
|
1437
|
-
const closestMenu = el.closest("[data-menu-id]");
|
|
1438
|
-
return closestMenu?.dataset["menuId"] === menuId;
|
|
1439
|
-
});
|
|
1440
|
-
}
|
|
1441
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1442
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DropdownService, providedIn: "root" }); }
|
|
1483
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1484
|
+
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\n class=\"container {{labelPosition()}}\"\n [ngClass]=\"{'error': error()}\"\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\">\n {{ characterCount() }}/{{ maxLength() }}\n </p>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"input-container\">\n <div\n class=\"input {{labelPosition()}}\"\n [ngClass]=\"{'disabled': disabled(), 'read-only': readOnly()}\"\n >\n <div class=\"input-bar\" [ngClass]=\"{'with-left-icon': displayedLeftIcon(), 'with-right-icon': rightIconAction()}\">\n <ng-container *ngIf=\"displayedLeftIcon()\">\n <rte-icon\n appearance=\"outlined\"\n class=\"left-icon\"\n aria-hidden=\"true\"\n [name]=\"displayedLeftIcon()!\"\n />\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\">\n {{ characterCount() }}/{{ maxLength() }}\n </p>\n </ng-container>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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 }); }
|
|
1443
1485
|
}
|
|
1444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1445
|
-
type:
|
|
1446
|
-
args: [{
|
|
1447
|
-
|
|
1448
|
-
}]
|
|
1449
|
-
}] });
|
|
1486
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextInputComponent, decorators: [{
|
|
1487
|
+
type: Component,
|
|
1488
|
+
args: [{ selector: "rte-text-input", imports: [CommonModule, IconComponent, IconButtonComponent, LinkComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"container {{labelPosition()}}\"\n [ngClass]=\"{'error': error()}\"\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\">\n {{ characterCount() }}/{{ maxLength() }}\n </p>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"input-container\">\n <div\n class=\"input {{labelPosition()}}\"\n [ngClass]=\"{'disabled': disabled(), 'read-only': readOnly()}\"\n >\n <div class=\"input-bar\" [ngClass]=\"{'with-left-icon': displayedLeftIcon(), 'with-right-icon': rightIconAction()}\">\n <ng-container *ngIf=\"displayedLeftIcon()\">\n <rte-icon\n appearance=\"outlined\"\n class=\"left-icon\"\n aria-hidden=\"true\"\n [name]=\"displayedLeftIcon()!\"\n />\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\">\n {{ characterCount() }}/{{ maxLength() }}\n </p>\n </ng-container>\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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"] }]
|
|
1489
|
+
}], ctorParameters: () => [] });
|
|
1450
1490
|
|
|
1451
|
-
class
|
|
1491
|
+
class ChipComponent {
|
|
1452
1492
|
constructor() {
|
|
1453
|
-
this.
|
|
1454
|
-
this.
|
|
1455
|
-
this.
|
|
1456
|
-
this.
|
|
1457
|
-
this.
|
|
1493
|
+
this.id = input();
|
|
1494
|
+
this.label = input("");
|
|
1495
|
+
this.selected = input(false);
|
|
1496
|
+
this.disabled = input(false);
|
|
1497
|
+
this.type = input("single");
|
|
1498
|
+
this.compactSpacing = input(false);
|
|
1499
|
+
this.click = output();
|
|
1500
|
+
this.close = output();
|
|
1501
|
+
this.isCheckable = computed(() => this.type() === "single" || this.type() === "multi");
|
|
1502
|
+
this.role = computed(() => CHIP_TYPE_TO_ARIA_ROLE_MAP[this.type()] || null);
|
|
1458
1503
|
}
|
|
1459
|
-
|
|
1460
|
-
|
|
1504
|
+
onClick(event) {
|
|
1505
|
+
event.stopPropagation();
|
|
1506
|
+
if (!this.disabled()) {
|
|
1507
|
+
this.click.emit(event);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
onKeyUp(event) {
|
|
1511
|
+
event.preventDefault();
|
|
1512
|
+
if (!this.disabled()) {
|
|
1513
|
+
if (event.key === SPACE_KEY || event.key === ENTER_KEY) {
|
|
1514
|
+
const target = event.target;
|
|
1515
|
+
const isCloseButton = target.classList.contains("chip-close-button");
|
|
1516
|
+
if (isCloseButton) {
|
|
1517
|
+
target.click();
|
|
1518
|
+
}
|
|
1519
|
+
else {
|
|
1520
|
+
this.onClick(event);
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
else if ((event.key === BACKSPACE_KEY || event.key === DELETE_KEY) && this.type() === "input") {
|
|
1524
|
+
const closeButton = event.target.querySelector(".chip-close-button");
|
|
1525
|
+
if (closeButton) {
|
|
1526
|
+
closeButton.click();
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1461
1530
|
}
|
|
1462
|
-
|
|
1463
|
-
|
|
1531
|
+
onBlur(event) {
|
|
1532
|
+
event.stopPropagation();
|
|
1464
1533
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
if ([ARROW_UP_KEY, ARROW_DOWN_KEY, ARROW_LEFT_KEY, ARROW_RIGHT_KEY, TAB_KEY].includes(event.key)) {
|
|
1470
|
-
event.preventDefault();
|
|
1534
|
+
onCloseClick(event) {
|
|
1535
|
+
event.stopPropagation();
|
|
1536
|
+
if (!this.disabled()) {
|
|
1537
|
+
this.close.emit(event);
|
|
1471
1538
|
}
|
|
1472
|
-
const menuId = this.menuId();
|
|
1473
|
-
this.dropdownService.handleKeyboardInput(event.key, {
|
|
1474
|
-
menuElement: this.elementRef,
|
|
1475
|
-
menuId,
|
|
1476
|
-
});
|
|
1477
1539
|
}
|
|
1478
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1479
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1540
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1541
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: ChipComponent, isStandalone: true, selector: "rte-chip", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", 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 } }, outputs: { click: "click", close: "close" }, ngImport: i0, template: "<span\n class=\"chip\"\n tabindex=\"0\"\n [attr.role]=\"role()\"\n [attr.data-selected]=\"isCheckable() ? selected() : null\"\n [attr.data-disabled]=\"disabled()\"\n [attr.data-compact-spacing]=\"compactSpacing()\"\n [attr.data-type]=\"type()\"\n [attr.aria-checked]=\"isCheckable() ? selected() : null\"\n [attr.aria-disabled]=\"disabled()\"\n (click)=\"onClick($event)\"\n (keyup)=\"onKeyUp($event)\"\n (blur)=\"onBlur($event)\"\n>\n <ng-container *ngIf=\"type() === 'multi'\">\n <span class=\"chip-icon-container\">\n <span\n class=\"chip-icon\"\n [class.chip-icon--visible]=\"selected()\"\n [attr.aria-hidden]=\"!selected()\"\n >\n <rte-icon name=\"check-circle\" appearance=\"filled\" [size]=\"16\"></rte-icon>\n </span>\n <span\n class=\"chip-icon\"\n [class.chip-icon--visible]=\"!selected()\"\n [attr.aria-hidden]=\"selected()\"\n >\n <rte-icon name=\"radio-button-empty\" [size]=\"16\"></rte-icon>\n </span>\n </span>\n </ng-container>\n <span class=\"chip-label\" [attr.data-type]=\"type()\">{{ label() }}</span>\n <button\n *ngIf=\"type() === 'input'\"\n type=\"button\"\n class=\"chip-close-button\"\n [attr.aria-label]=\"'Supprimer ' + label()\"\n [disabled]=\"disabled()\"\n [value]=\"label()\"\n (click)=\"onCloseClick($event)\"\n >\n <rte-icon class=\"chip-close-button--icon\" name=\"close\" [size]=\"16\"></rte-icon>\n </button>\n</span>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.chip{overflow:hidden;color:var(--content-brand-default);text-overflow:ellipsis;display:inline-flex;padding:4px 12px;justify-content:center;align-items:center;gap:0px;border-radius:999px;background:var(--background-brand-unselected-default);transition:background-color .2s ease-in-out,color .2s ease-in-out}.chip:hover{cursor:pointer;color:var(--content-brand-hover);background:var(--background-brand-unselected-hover)}.chip:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.chip[data-disabled=true]{cursor:default;color:var(--content-disabled);background:var(--background-disabled);outline:none}.chip[data-selected=true]{color:var(--content-primary-inverse);background:var(--background-brand-selected-default)}.chip[data-selected=true]:hover{background:var(--background-brand-selected-hover)}.chip[data-selected=true][data-disabled=true]{cursor:default;color:var(--content-disabled);background:var(--background-disabled)}.chip[data-compact-spacing=true]{padding:0 12px}.chip[data-type=input]{padding:0 4px;pointer-events:none}.chip-label{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;padding:0 6px}.chip-label[data-type=input]{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;padding:0 8px}.chip-icon-container{position:relative;width:16px;height:16px}.chip-icon{position:absolute;left:0;top:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .2s ease-in-out,transform .2s ease-in-out;pointer-events:none}.chip-icon--visible{opacity:1;pointer-events:auto}.chip-close-button{background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;text-align:center;color:var(--content-brand-default);border-radius:999px;width:16px;height:16px;pointer-events:auto;transition:background-color .2s ease-in-out}.chip-close-button:disabled{cursor:default;color:var(--content-disabled);background:var(--background-disabled);outline:none}.chip-close-button:hover:not(:disabled){background:var(--background-brand-hover);color:var(--background-brand-unselected-hover)}.chip-close-button:focus-visible{outline:1px solid var(--border-brand-focused)}.chip-close-button--icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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 }); }
|
|
1480
1542
|
}
|
|
1481
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChipComponent, decorators: [{
|
|
1482
1544
|
type: Component,
|
|
1483
|
-
args: [{ selector: "rte-
|
|
1484
|
-
}]
|
|
1485
|
-
type: HostListener,
|
|
1486
|
-
args: ["keydown", ["$event"]]
|
|
1487
|
-
}] } });
|
|
1545
|
+
args: [{ selector: "rte-chip", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n class=\"chip\"\n tabindex=\"0\"\n [attr.role]=\"role()\"\n [attr.data-selected]=\"isCheckable() ? selected() : null\"\n [attr.data-disabled]=\"disabled()\"\n [attr.data-compact-spacing]=\"compactSpacing()\"\n [attr.data-type]=\"type()\"\n [attr.aria-checked]=\"isCheckable() ? selected() : null\"\n [attr.aria-disabled]=\"disabled()\"\n (click)=\"onClick($event)\"\n (keyup)=\"onKeyUp($event)\"\n (blur)=\"onBlur($event)\"\n>\n <ng-container *ngIf=\"type() === 'multi'\">\n <span class=\"chip-icon-container\">\n <span\n class=\"chip-icon\"\n [class.chip-icon--visible]=\"selected()\"\n [attr.aria-hidden]=\"!selected()\"\n >\n <rte-icon name=\"check-circle\" appearance=\"filled\" [size]=\"16\"></rte-icon>\n </span>\n <span\n class=\"chip-icon\"\n [class.chip-icon--visible]=\"!selected()\"\n [attr.aria-hidden]=\"selected()\"\n >\n <rte-icon name=\"radio-button-empty\" [size]=\"16\"></rte-icon>\n </span>\n </span>\n </ng-container>\n <span class=\"chip-label\" [attr.data-type]=\"type()\">{{ label() }}</span>\n <button\n *ngIf=\"type() === 'input'\"\n type=\"button\"\n class=\"chip-close-button\"\n [attr.aria-label]=\"'Supprimer ' + label()\"\n [disabled]=\"disabled()\"\n [value]=\"label()\"\n (click)=\"onCloseClick($event)\"\n >\n <rte-icon class=\"chip-close-button--icon\" name=\"close\" [size]=\"16\"></rte-icon>\n </button>\n</span>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.chip{overflow:hidden;color:var(--content-brand-default);text-overflow:ellipsis;display:inline-flex;padding:4px 12px;justify-content:center;align-items:center;gap:0px;border-radius:999px;background:var(--background-brand-unselected-default);transition:background-color .2s ease-in-out,color .2s ease-in-out}.chip:hover{cursor:pointer;color:var(--content-brand-hover);background:var(--background-brand-unselected-hover)}.chip:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.chip[data-disabled=true]{cursor:default;color:var(--content-disabled);background:var(--background-disabled);outline:none}.chip[data-selected=true]{color:var(--content-primary-inverse);background:var(--background-brand-selected-default)}.chip[data-selected=true]:hover{background:var(--background-brand-selected-hover)}.chip[data-selected=true][data-disabled=true]{cursor:default;color:var(--content-disabled);background:var(--background-disabled)}.chip[data-compact-spacing=true]{padding:0 12px}.chip[data-type=input]{padding:0 4px;pointer-events:none}.chip-label{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;padding:0 6px}.chip-label[data-type=input]{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;padding:0 8px}.chip-icon-container{position:relative;width:16px;height:16px}.chip-icon{position:absolute;left:0;top:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .2s ease-in-out,transform .2s ease-in-out;pointer-events:none}.chip-icon--visible{opacity:1;pointer-events:auto}.chip-close-button{background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;text-align:center;color:var(--content-brand-default);border-radius:999px;width:16px;height:16px;pointer-events:auto;transition:background-color .2s ease-in-out}.chip-close-button:disabled{cursor:default;color:var(--content-disabled);background:var(--background-disabled);outline:none}.chip-close-button:hover:not(:disabled){background:var(--background-brand-hover);color:var(--background-brand-unselected-hover)}.chip-close-button:focus-visible{outline:1px solid var(--border-brand-focused)}.chip-close-button--icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center}\n"] }]
|
|
1546
|
+
}] });
|
|
1488
1547
|
|
|
1489
|
-
class
|
|
1548
|
+
class TextareaComponent {
|
|
1490
1549
|
constructor() {
|
|
1491
|
-
this.
|
|
1492
|
-
this.
|
|
1493
|
-
this.
|
|
1550
|
+
this.id = input(undefined);
|
|
1551
|
+
this.name = input(undefined);
|
|
1552
|
+
this.ariaLabelledby = input(undefined);
|
|
1553
|
+
this.label = input(undefined);
|
|
1554
|
+
this.labelId = input(undefined);
|
|
1555
|
+
this.labelPosition = input("top");
|
|
1556
|
+
this.assistiveTextLabel = input(undefined);
|
|
1557
|
+
this.assistiveTextAppearance = input("description");
|
|
1558
|
+
this.assistiveTextLink = input(undefined);
|
|
1559
|
+
this.required = input(false);
|
|
1560
|
+
this.showLabelRequirement = input(false);
|
|
1561
|
+
this.resizeable = input(true);
|
|
1562
|
+
this.maxLength = input(undefined);
|
|
1563
|
+
this.disabled = input(false);
|
|
1564
|
+
this.readOnly = input(false);
|
|
1565
|
+
this.value = input(undefined);
|
|
1566
|
+
this.rows = input(3);
|
|
1567
|
+
this.defaultValue = input(undefined);
|
|
1568
|
+
this.showCounter = input(false);
|
|
1569
|
+
this.assistiveTextIconSize = TEXTAREA_ICON_SIZE;
|
|
1570
|
+
this.requirementIndicatorValue = computed(() => this.required()
|
|
1571
|
+
? this.showLabelRequirement()
|
|
1572
|
+
? TEXTAREA_REQUIREMENT_INDICATOR_VALUE.required
|
|
1573
|
+
: TEXTAREA_REQUIREMENT_INDICATOR_VALUE.requiredIcon
|
|
1574
|
+
: TEXTAREA_REQUIREMENT_INDICATOR_VALUE.optional);
|
|
1575
|
+
this.change = output();
|
|
1576
|
+
this.blur = output();
|
|
1577
|
+
this.textareaRef = viewChild("textarea");
|
|
1578
|
+
this.isAssistiveTextLinkVisible = computed(() => this.assistiveTextAppearance() === "link" && this.assistiveTextLink() !== undefined);
|
|
1579
|
+
this.characterCount = 0;
|
|
1580
|
+
this.isCounterVisible = computed(() => {
|
|
1581
|
+
return this.showCounter() && this.maxLength();
|
|
1582
|
+
});
|
|
1494
1583
|
}
|
|
1495
|
-
|
|
1496
|
-
|
|
1584
|
+
onInput(event) {
|
|
1585
|
+
const target = event.target;
|
|
1586
|
+
this.characterCount = target.value.length;
|
|
1587
|
+
this.change.emit(event);
|
|
1497
1588
|
}
|
|
1498
|
-
|
|
1499
|
-
this.
|
|
1589
|
+
onBlur(event) {
|
|
1590
|
+
this.textareaRef()?.nativeElement?.scrollTo({ top: 0 });
|
|
1591
|
+
this.blur.emit(event);
|
|
1500
1592
|
}
|
|
1501
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1502
|
-
static { this.ɵ
|
|
1593
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1594
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.14", type: TextareaComponent, isStandalone: true, selector: "rte-textarea", 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 }, resizeable: { classPropertyName: "resizeable", publicName: "resizeable", 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 }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, showCounter: { classPropertyName: "showCounter", publicName: "showCounter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change", blur: "blur" }, providers: [
|
|
1595
|
+
{
|
|
1596
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1597
|
+
useExisting: TextareaComponent,
|
|
1598
|
+
multi: true,
|
|
1599
|
+
},
|
|
1600
|
+
], viewQueries: [{ propertyName: "textareaRef", first: true, predicate: ["textarea"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"container\" [attr.data-label-position]=\"labelPosition()\"> \n <label *ngIf=\"label() && labelPosition() === 'side'\" [attr.data-label-position]=\"labelPosition()\" [attr.id]=\"labelId()\" [attr.for]=\"id()\">{{label()}}<span *ngIf=\"required() || showLabelRequirement()\" class=\"requirement-indicator\" aria-hidden=\"true\" [ngClass]=\"{'required': required(), 'show-label-requirement': showLabelRequirement() }\">{{requirementIndicatorValue()}}</span></label>\n <div class=\"top-position-container\" [attr.data-label-position]=\"labelPosition()\">\n <div class=\"header-container\" [attr.data-label-position]=\"labelPosition()\">\n <label *ngIf=\"label() && labelPosition() === 'top'\" [attr.id]=\"labelId()\" [attr.for]=\"id()\">{{label()}}<span *ngIf=\"required() || showLabelRequirement()\" class=\"requirement-indicator\" aria-hidden=\"true\" [ngClass]=\"{'required': required(), 'show-label-requirement': showLabelRequirement() }\">{{requirementIndicatorValue()}}</span></label>\n <span *ngIf=\"isCounterVisible()\" class=\"character-counter\">{{ characterCount }}/{{ maxLength() }}</span>\n </div>\n <div class=\"textarea-container\" [attr.data-label-position]=\"labelPosition()\">\n <textarea\n #textarea\n class=\"textarea {{ assistiveTextAppearance() }}\"\n [class.resizeable]=\"resizeable()\"\n [attr.id]=\"id()\"\n [attr.name]=\"name()\"\n [attr.aria-labelledby]=\"labelId() || ariaLabelledby()\"\n [attr.required]=\"required() || null\"\n [attr.maxLength]=\"maxLength() !== undefined ? maxLength() : null\"\n [attr.disabled]=\"disabled() || null\"\n [attr.readonly]=\"readOnly() || null\"\n [value]=\"value() !== undefined ? value() : null\"\n [defaultValue]=\"defaultValue() !== undefined ? defaultValue() : null\"\n [attr.rows]=\"rows()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n ></textarea>\n <rte-link *ngIf=\"isAssistiveTextLinkVisible()\" class=\"assistive-text-link\" [externalLink]=\"true\" [href]=\"assistiveTextLink() || ''\" [label]=\"assistiveTextLabel() || ''\">\n </rte-link>\n <div *ngIf=\"assistiveTextAppearance() !== 'link'\" class=\"assistive-text {{ assistiveTextAppearance() }}\" [ngClass]=\"{'disabled' : disabled()}\">\n <rte-icon *ngIf=\"assistiveTextAppearance() === 'error'\" name=\"error\" [size]=\"assistiveTextIconSize\"></rte-icon>\n <rte-icon *ngIf=\"assistiveTextAppearance() === 'success'\" name=\"check-circle\" [size]=\"assistiveTextIconSize\"></rte-icon>\n <span>{{ assistiveTextLabel() }}</span>\n </div>\n </div>\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";:host{width:100%}.container{width:100%}.container[data-label-position=side]{display:flex;flex-direction:row}.top-position-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;height:100%;padding:0;flex-direction:column;align-items:flex-start;gap:0px;flex-shrink:0;border-radius:0;opacity:100%;width:100%}.top-position-container[data-label-position=side]{flex-grow:1}.top-position-container .header-container{display:flex;width:100%;flex-direction:row;align-items:flex-end;justify-content:space-between;padding:2px 8px;box-sizing:border-box;gap:8px}.top-position-container .header-container[data-label-position=side]{padding:0;justify-content:flex-end}.top-position-container .textarea-container{display:flex;flex-direction:column;width:100%;align-items:flex-start}.top-position-container .textarea-container .textarea{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%);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-primary);min-height:70px;padding:8px 16px;width:100%;min-width:140px;border-radius:8px;border:1px solid var(--border-secondary);opacity:100%;background-color:var(--background-default);resize:none;box-sizing:border-box}@media (min-width: 1024px){.top-position-container .textarea-container .textarea{min-height:56px;min-width:112px;max-width:1100px}}.top-position-container .textarea-container .textarea:focus-visible,.top-position-container .textarea-container .textarea:active{outline:none}.top-position-container .textarea-container .textarea:focus-visible:not(:disabled),.top-position-container .textarea-container .textarea:active:not(:disabled){outline:1px solid var(--border-brand-default);border:1px solid var(--border-brand-default)}.top-position-container .textarea-container .textarea.error:not(:disabled){outline:1px solid var(--border-danger);border:1px solid var(--border-danger)}.top-position-container .textarea-container .textarea.resizeable{resize:vertical}.top-position-container .textarea-container .textarea:disabled,.top-position-container .textarea-container .textarea:read-only{cursor:not-allowed;background-color:var(--background-disabled)}.top-position-container .textarea-container .textarea:disabled{resize:none}.top-position-container .textarea-container .textarea:read-only{color:var(--content-secondary)}.top-position-container .textarea-container .assistive-text-link{padding:4px 8px}.top-position-container .textarea-container .assistive-text{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;display:flex;padding:4px 8px;color:var(--content-tertiary);gap:4px}.top-position-container .textarea-container .assistive-text.error:not(.disabled){color:var(--content-danger-default)}.top-position-container .textarea-container .assistive-text.success{color:var(--content-success-default)}.character-counter{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)}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;color:var(--content-secondary);max-width:300px;justify-content:space-between;white-space:normal;overflow-wrap:normal;word-break:normal}label[data-label-position=side]{padding:24px 8px;align-items:flex-start;gap:0px;align-self:stretch}label .requirement-indicator{margin-left:2px}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)}label .requirement-indicator.show-label-requirement:not(.required){font-style:italic}label .requirement-indicator:not(.show-label-requirement).required{color:var(--content-danger-default)}\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: LinkComponent, selector: "rte-link", inputs: ["label", "href", "subtle", "externalLink", "reverse", "maxWidth"] }] }); }
|
|
1503
1601
|
}
|
|
1504
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1505
|
-
type:
|
|
1506
|
-
args: [{
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
type: HostListener,
|
|
1515
|
-
args: ["keydown", ["$event"]]
|
|
1516
|
-
}] } });
|
|
1602
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1603
|
+
type: Component,
|
|
1604
|
+
args: [{ selector: "rte-textarea", imports: [CommonModule, IconComponent, LinkComponent], standalone: true, providers: [
|
|
1605
|
+
{
|
|
1606
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1607
|
+
useExisting: TextareaComponent,
|
|
1608
|
+
multi: true,
|
|
1609
|
+
},
|
|
1610
|
+
], template: "<div class=\"container\" [attr.data-label-position]=\"labelPosition()\"> \n <label *ngIf=\"label() && labelPosition() === 'side'\" [attr.data-label-position]=\"labelPosition()\" [attr.id]=\"labelId()\" [attr.for]=\"id()\">{{label()}}<span *ngIf=\"required() || showLabelRequirement()\" class=\"requirement-indicator\" aria-hidden=\"true\" [ngClass]=\"{'required': required(), 'show-label-requirement': showLabelRequirement() }\">{{requirementIndicatorValue()}}</span></label>\n <div class=\"top-position-container\" [attr.data-label-position]=\"labelPosition()\">\n <div class=\"header-container\" [attr.data-label-position]=\"labelPosition()\">\n <label *ngIf=\"label() && labelPosition() === 'top'\" [attr.id]=\"labelId()\" [attr.for]=\"id()\">{{label()}}<span *ngIf=\"required() || showLabelRequirement()\" class=\"requirement-indicator\" aria-hidden=\"true\" [ngClass]=\"{'required': required(), 'show-label-requirement': showLabelRequirement() }\">{{requirementIndicatorValue()}}</span></label>\n <span *ngIf=\"isCounterVisible()\" class=\"character-counter\">{{ characterCount }}/{{ maxLength() }}</span>\n </div>\n <div class=\"textarea-container\" [attr.data-label-position]=\"labelPosition()\">\n <textarea\n #textarea\n class=\"textarea {{ assistiveTextAppearance() }}\"\n [class.resizeable]=\"resizeable()\"\n [attr.id]=\"id()\"\n [attr.name]=\"name()\"\n [attr.aria-labelledby]=\"labelId() || ariaLabelledby()\"\n [attr.required]=\"required() || null\"\n [attr.maxLength]=\"maxLength() !== undefined ? maxLength() : null\"\n [attr.disabled]=\"disabled() || null\"\n [attr.readonly]=\"readOnly() || null\"\n [value]=\"value() !== undefined ? value() : null\"\n [defaultValue]=\"defaultValue() !== undefined ? defaultValue() : null\"\n [attr.rows]=\"rows()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n ></textarea>\n <rte-link *ngIf=\"isAssistiveTextLinkVisible()\" class=\"assistive-text-link\" [externalLink]=\"true\" [href]=\"assistiveTextLink() || ''\" [label]=\"assistiveTextLabel() || ''\">\n </rte-link>\n <div *ngIf=\"assistiveTextAppearance() !== 'link'\" class=\"assistive-text {{ assistiveTextAppearance() }}\" [ngClass]=\"{'disabled' : disabled()}\">\n <rte-icon *ngIf=\"assistiveTextAppearance() === 'error'\" name=\"error\" [size]=\"assistiveTextIconSize\"></rte-icon>\n <rte-icon *ngIf=\"assistiveTextAppearance() === 'success'\" name=\"check-circle\" [size]=\"assistiveTextIconSize\"></rte-icon>\n <span>{{ assistiveTextLabel() }}</span>\n </div>\n </div>\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";:host{width:100%}.container{width:100%}.container[data-label-position=side]{display:flex;flex-direction:row}.top-position-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;height:100%;padding:0;flex-direction:column;align-items:flex-start;gap:0px;flex-shrink:0;border-radius:0;opacity:100%;width:100%}.top-position-container[data-label-position=side]{flex-grow:1}.top-position-container .header-container{display:flex;width:100%;flex-direction:row;align-items:flex-end;justify-content:space-between;padding:2px 8px;box-sizing:border-box;gap:8px}.top-position-container .header-container[data-label-position=side]{padding:0;justify-content:flex-end}.top-position-container .textarea-container{display:flex;flex-direction:column;width:100%;align-items:flex-start}.top-position-container .textarea-container .textarea{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%);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-primary);min-height:70px;padding:8px 16px;width:100%;min-width:140px;border-radius:8px;border:1px solid var(--border-secondary);opacity:100%;background-color:var(--background-default);resize:none;box-sizing:border-box}@media (min-width: 1024px){.top-position-container .textarea-container .textarea{min-height:56px;min-width:112px;max-width:1100px}}.top-position-container .textarea-container .textarea:focus-visible,.top-position-container .textarea-container .textarea:active{outline:none}.top-position-container .textarea-container .textarea:focus-visible:not(:disabled),.top-position-container .textarea-container .textarea:active:not(:disabled){outline:1px solid var(--border-brand-default);border:1px solid var(--border-brand-default)}.top-position-container .textarea-container .textarea.error:not(:disabled){outline:1px solid var(--border-danger);border:1px solid var(--border-danger)}.top-position-container .textarea-container .textarea.resizeable{resize:vertical}.top-position-container .textarea-container .textarea:disabled,.top-position-container .textarea-container .textarea:read-only{cursor:not-allowed;background-color:var(--background-disabled)}.top-position-container .textarea-container .textarea:disabled{resize:none}.top-position-container .textarea-container .textarea:read-only{color:var(--content-secondary)}.top-position-container .textarea-container .assistive-text-link{padding:4px 8px}.top-position-container .textarea-container .assistive-text{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;display:flex;padding:4px 8px;color:var(--content-tertiary);gap:4px}.top-position-container .textarea-container .assistive-text.error:not(.disabled){color:var(--content-danger-default)}.top-position-container .textarea-container .assistive-text.success{color:var(--content-success-default)}.character-counter{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)}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;color:var(--content-secondary);max-width:300px;justify-content:space-between;white-space:normal;overflow-wrap:normal;word-break:normal}label[data-label-position=side]{padding:24px 8px;align-items:flex-start;gap:0px;align-self:stretch}label .requirement-indicator{margin-left:2px}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)}label .requirement-indicator.show-label-requirement:not(.required){font-style:italic}label .requirement-indicator:not(.show-label-requirement).required{color:var(--content-danger-default)}\n"] }]
|
|
1611
|
+
}] });
|
|
1517
1612
|
|
|
1518
|
-
class
|
|
1519
|
-
static { this.idCounter = 0; }
|
|
1613
|
+
class SwitchComponent {
|
|
1520
1614
|
constructor() {
|
|
1521
|
-
this.
|
|
1522
|
-
this.
|
|
1523
|
-
this.
|
|
1524
|
-
this.
|
|
1525
|
-
this.
|
|
1526
|
-
this.
|
|
1527
|
-
this.
|
|
1528
|
-
this.
|
|
1529
|
-
this.
|
|
1530
|
-
this.
|
|
1531
|
-
this.
|
|
1532
|
-
this.renderer = inject(Renderer2);
|
|
1533
|
-
this.destroyRef = inject(DestroyRef);
|
|
1534
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
1535
|
-
this.dropdownMenuRef = null;
|
|
1536
|
-
this.handleClickOutside = (event) => {
|
|
1537
|
-
const target = event.target;
|
|
1538
|
-
const isMenuItemClick = target.closest(".rte-dropdown-item") !== null;
|
|
1539
|
-
if (isMenuItemClick) {
|
|
1540
|
-
return;
|
|
1541
|
-
}
|
|
1542
|
-
const clickedInTrigger = this.hostElement.contains(target);
|
|
1543
|
-
if (!clickedInTrigger) {
|
|
1544
|
-
this.closeDropdown();
|
|
1545
|
-
}
|
|
1546
|
-
};
|
|
1547
|
-
this.hostElement = this.elementRef.nativeElement;
|
|
1615
|
+
this.label = input("");
|
|
1616
|
+
this.appearance = input("brand");
|
|
1617
|
+
this.showLabel = input(true);
|
|
1618
|
+
this.showIcon = input(true);
|
|
1619
|
+
this.disabled = input(false);
|
|
1620
|
+
this.readOnly = input(false);
|
|
1621
|
+
this.checked = input(false);
|
|
1622
|
+
this.stateChange = output();
|
|
1623
|
+
this.switchHeight = switchHeight;
|
|
1624
|
+
this.switchWidth = switchWidth;
|
|
1625
|
+
this.isChecked = signal(false);
|
|
1548
1626
|
}
|
|
1549
|
-
|
|
1550
|
-
this.
|
|
1627
|
+
ngOnInit() {
|
|
1628
|
+
this.isChecked.set(this.checked());
|
|
1551
1629
|
}
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1630
|
+
handleChange(event) {
|
|
1631
|
+
const target = event.target;
|
|
1632
|
+
this.isChecked.set(target.checked);
|
|
1633
|
+
this.stateChange.emit(event);
|
|
1634
|
+
}
|
|
1635
|
+
handleClick(event) {
|
|
1636
|
+
if (this.readOnly() || this.disabled()) {
|
|
1637
|
+
event.stopPropagation();
|
|
1555
1638
|
}
|
|
1556
|
-
|
|
1557
|
-
event.
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1639
|
+
else {
|
|
1640
|
+
const inputElement = event.currentTarget.querySelector('input[type="checkbox"]');
|
|
1641
|
+
if (inputElement) {
|
|
1642
|
+
inputElement.checked = !this.isChecked();
|
|
1643
|
+
const changeEvent = new Event("change", { bubbles: true });
|
|
1644
|
+
Object.defineProperty(changeEvent, "target", {
|
|
1645
|
+
value: inputElement,
|
|
1646
|
+
writable: false,
|
|
1647
|
+
});
|
|
1648
|
+
this.handleChange(changeEvent);
|
|
1562
1649
|
}
|
|
1563
1650
|
}
|
|
1564
1651
|
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1652
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1653
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SwitchComponent, isStandalone: true, selector: "rte-switch", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", 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 }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stateChange: "stateChange" }, ngImport: i0, template: "<div\n class=\"switch-container appearance-{{appearance()}}\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'read-only': readOnly(),\n 'checked': isChecked()\n }\"\n (click)=\"handleClick($event)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"switch\"\n [attr.aria-checked]=\"isChecked()\"\n [attr.aria-label]=\"label()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-readonly]=\"readOnly()\"\n [ariaLabel]=\"label()\"\n [name]=\"label()\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'read-only': readOnly(),\n 'checked': isChecked()\n }\"\n [style.min-height.px]=\"switchHeight\"\n [style.min-width.px]=\"switchWidth\"\n [disabled]=\"disabled()\"\n [checked]=\"isChecked()\"\n />\n <div class=\"switch-icon-check\" [ngClass]=\"{'checked': isChecked() }\" (click)=\"handleClick($event)\">\n @if (showIcon()) {\n <rte-icon\n class=\"icon\"\n [name]=\"isChecked() ? 'check' : 'close'\"\n [size]=\"16\"\n (click)=\"handleClick($event)\"\n ></rte-icon>\n }\n </div>\n @if (showLabel() && label()) {\n <label\n class=\"switch-label\"\n [for]=\"label()\"\n >\n {{ label() }}\n </label>\n }\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.switch-container{display:inline-flex;align-items:center;gap:12px;position:relative}.switch-container:hover .switch-icon-check{background-color:var(--background-neutral-bold-hover)}.switch-container.checked:hover .switch{background-color:var(--background-brand-selected-hover)}.switch-container .switch{appearance:none;cursor:pointer;position:relative;display:block;padding:0;margin:0;background-color:var(--background-neutral-regular-default);border:2px solid var(--border-primary);border-radius:999px;transition:background-color .4s ease-in-out,border-color .4s ease-in-out}.switch-container .switch:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.switch-container .checked{background-color:var(--background-brand-selected-default);border:none}.switch-container .switch-icon-check{content:\"\";cursor:pointer;display:flex;align-items:center;justify-content:center;position:absolute;background-color:var(--background-neutral-bold-default);color:var(--background-default);height:16px;width:16px;border-radius:999px;top:calc(50% - 8px);left:4px;transition:background-color .4s ease-in-out,color .4s ease-in-out,transform .4s ease-in-out}.switch-container .switch-icon-check.checked{background-color:var(--background-default);color:var(--background-brand-selected-default);transform:translate(16px)}.switch-container.appearance-neutral .switch{background-color:var(--background-neutral-regular-default);border:2px solid var(--border-primary)}.switch-container.appearance-neutral .switch-icon-check{background-color:var(--background-neutral-bold-default);color:var(--content-primary-inverse);border:none}.switch-container.appearance-neutral:hover .switch-icon-check{background-color:var(--background-neutral-bold-hover)}.switch-container.appearance-neutral.checked .switch{background-color:var(--background-neutral-bold-default);border:none}.switch-container.appearance-neutral.checked .switch-icon-check{background-color:var(--background-default);color:var(--content-tertiary)}.switch-container.appearance-neutral.checked:hover .switch{background-color:var(--background-neutral-bold-hover)}.switch-container.appearance-neutral.read-only{cursor:not-allowed}.switch-container.appearance-neutral.read-only:hover .switch{background-color:var(--background-disabled)}.switch-container.appearance-neutral.read-only .switch{background-color:var(--background-disabled);border:none}.switch-container.appearance-neutral.read-only .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-primary);border:2px solid var(--border-primary)}.switch-container.appearance-neutral.read-only .switch-icon-check .icon,.switch-container.appearance-neutral.disabled{cursor:not-allowed}.switch-container.appearance-neutral.disabled .switch{background-color:var(--background-disabled);border:none}.switch-container.appearance-neutral.disabled .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-disabled);border:2px solid var(--border-disabled)}.switch-container.appearance-neutral.disabled .switch-icon-check .icon{cursor:not-allowed}.switch-container .switch-label{cursor:pointer;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-primary);word-wrap:break-word}.switch-container.read-only{cursor:not-allowed}.switch-container.read-only:hover .switch{background-color:var(--background-disabled)}.switch-container.read-only .switch{cursor:not-allowed;background-color:var(--background-disabled);border:none}.switch-container.read-only .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-primary);border:2px solid var(--border-primary)}.switch-container.read-only .switch-label{cursor:not-allowed;color:var(--content-tertiary)}.switch-container.disabled{cursor:not-allowed}.switch-container.disabled:hover .switch{background-color:var(--background-disabled)}.switch-container.disabled .switch{cursor:not-allowed;background-color:var(--background-disabled);border:none}.switch-container.disabled .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-disabled);border:2px solid var(--border-disabled)}.switch-container.disabled .switch-label{cursor:not-allowed;color:var(--content-disabled)}\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1654
|
+
}
|
|
1655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
1656
|
+
type: Component,
|
|
1657
|
+
args: [{ selector: "rte-switch", imports: [CommonModule, IconComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"switch-container appearance-{{appearance()}}\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'read-only': readOnly(),\n 'checked': isChecked()\n }\"\n (click)=\"handleClick($event)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"switch\"\n [attr.aria-checked]=\"isChecked()\"\n [attr.aria-label]=\"label()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-readonly]=\"readOnly()\"\n [ariaLabel]=\"label()\"\n [name]=\"label()\"\n [ngClass]=\"{\n 'disabled': disabled(),\n 'read-only': readOnly(),\n 'checked': isChecked()\n }\"\n [style.min-height.px]=\"switchHeight\"\n [style.min-width.px]=\"switchWidth\"\n [disabled]=\"disabled()\"\n [checked]=\"isChecked()\"\n />\n <div class=\"switch-icon-check\" [ngClass]=\"{'checked': isChecked() }\" (click)=\"handleClick($event)\">\n @if (showIcon()) {\n <rte-icon\n class=\"icon\"\n [name]=\"isChecked() ? 'check' : 'close'\"\n [size]=\"16\"\n (click)=\"handleClick($event)\"\n ></rte-icon>\n }\n </div>\n @if (showLabel() && label()) {\n <label\n class=\"switch-label\"\n [for]=\"label()\"\n >\n {{ label() }}\n </label>\n }\n</div>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.switch-container{display:inline-flex;align-items:center;gap:12px;position:relative}.switch-container:hover .switch-icon-check{background-color:var(--background-neutral-bold-hover)}.switch-container.checked:hover .switch{background-color:var(--background-brand-selected-hover)}.switch-container .switch{appearance:none;cursor:pointer;position:relative;display:block;padding:0;margin:0;background-color:var(--background-neutral-regular-default);border:2px solid var(--border-primary);border-radius:999px;transition:background-color .4s ease-in-out,border-color .4s ease-in-out}.switch-container .switch:focus-visible{outline:1px solid var(--border-brand-focused);outline-offset:4px}.switch-container .checked{background-color:var(--background-brand-selected-default);border:none}.switch-container .switch-icon-check{content:\"\";cursor:pointer;display:flex;align-items:center;justify-content:center;position:absolute;background-color:var(--background-neutral-bold-default);color:var(--background-default);height:16px;width:16px;border-radius:999px;top:calc(50% - 8px);left:4px;transition:background-color .4s ease-in-out,color .4s ease-in-out,transform .4s ease-in-out}.switch-container .switch-icon-check.checked{background-color:var(--background-default);color:var(--background-brand-selected-default);transform:translate(16px)}.switch-container.appearance-neutral .switch{background-color:var(--background-neutral-regular-default);border:2px solid var(--border-primary)}.switch-container.appearance-neutral .switch-icon-check{background-color:var(--background-neutral-bold-default);color:var(--content-primary-inverse);border:none}.switch-container.appearance-neutral:hover .switch-icon-check{background-color:var(--background-neutral-bold-hover)}.switch-container.appearance-neutral.checked .switch{background-color:var(--background-neutral-bold-default);border:none}.switch-container.appearance-neutral.checked .switch-icon-check{background-color:var(--background-default);color:var(--content-tertiary)}.switch-container.appearance-neutral.checked:hover .switch{background-color:var(--background-neutral-bold-hover)}.switch-container.appearance-neutral.read-only{cursor:not-allowed}.switch-container.appearance-neutral.read-only:hover .switch{background-color:var(--background-disabled)}.switch-container.appearance-neutral.read-only .switch{background-color:var(--background-disabled);border:none}.switch-container.appearance-neutral.read-only .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-primary);border:2px solid var(--border-primary)}.switch-container.appearance-neutral.read-only .switch-icon-check .icon,.switch-container.appearance-neutral.disabled{cursor:not-allowed}.switch-container.appearance-neutral.disabled .switch{background-color:var(--background-disabled);border:none}.switch-container.appearance-neutral.disabled .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-disabled);border:2px solid var(--border-disabled)}.switch-container.appearance-neutral.disabled .switch-icon-check .icon{cursor:not-allowed}.switch-container .switch-label{cursor:pointer;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-primary);word-wrap:break-word}.switch-container.read-only{cursor:not-allowed}.switch-container.read-only:hover .switch{background-color:var(--background-disabled)}.switch-container.read-only .switch{cursor:not-allowed;background-color:var(--background-disabled);border:none}.switch-container.read-only .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-primary);border:2px solid var(--border-primary)}.switch-container.read-only .switch-label{cursor:not-allowed;color:var(--content-tertiary)}.switch-container.disabled{cursor:not-allowed}.switch-container.disabled:hover .switch{background-color:var(--background-disabled)}.switch-container.disabled .switch{cursor:not-allowed;background-color:var(--background-disabled);border:none}.switch-container.disabled .switch-icon-check{cursor:not-allowed;top:calc(50% - 10px);left:2px;background-color:var(--background-default);color:var(--border-disabled);border:2px solid var(--border-disabled)}.switch-container.disabled .switch-label{cursor:not-allowed;color:var(--content-disabled)}\n"] }]
|
|
1658
|
+
}] });
|
|
1659
|
+
|
|
1660
|
+
const segmentClass = "rte-segment";
|
|
1661
|
+
const segmentSelector = `.${segmentClass}`;
|
|
1662
|
+
class SegmentedControlComponent {
|
|
1663
|
+
constructor() {
|
|
1664
|
+
this.options = input([]);
|
|
1665
|
+
this.change = output();
|
|
1666
|
+
this.selectedSegment = input();
|
|
1667
|
+
this.ariaLabel = input();
|
|
1668
|
+
this.ariaLabelledBy = input();
|
|
1669
|
+
this.segmentRefs = viewChildren("segment");
|
|
1670
|
+
this.sliderLeft = signal(0);
|
|
1671
|
+
this.sliderWidth = signal(0);
|
|
1672
|
+
this.sliderTop = signal(0);
|
|
1673
|
+
this.segmentSelectedIndicatorStyle = computed(() => ({
|
|
1674
|
+
left: `${this.sliderLeft()}px`,
|
|
1675
|
+
top: `${this.sliderTop()}px`,
|
|
1676
|
+
width: `${this.sliderWidth()}px`,
|
|
1677
|
+
}));
|
|
1678
|
+
this.isValidOptions = computed(() => isValidSegmentedControlOptions(this.options()));
|
|
1679
|
+
this.lastKeydown = null;
|
|
1680
|
+
this.onGlobalKeyDown = (event) => {
|
|
1681
|
+
this.lastKeydown = event.key;
|
|
1682
|
+
};
|
|
1568
1683
|
}
|
|
1569
|
-
|
|
1570
|
-
if (
|
|
1571
|
-
this.
|
|
1572
|
-
this.onTrigger();
|
|
1573
|
-
});
|
|
1574
|
-
this.trigger()?.dropdownKeyDown.subscribe((event) => {
|
|
1575
|
-
this.onTriggerKeyEvent(event);
|
|
1576
|
-
});
|
|
1684
|
+
ngOnChanges(changes) {
|
|
1685
|
+
if (changes["selectedSegment"]) {
|
|
1686
|
+
this.updateSelectedSegmentIndicator();
|
|
1577
1687
|
}
|
|
1578
1688
|
}
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
this.
|
|
1584
|
-
|
|
1585
|
-
this.dropdownMenuRef.setInput("menuId", menuId);
|
|
1586
|
-
this.dropdownService.openMenu(menuId);
|
|
1587
|
-
this.assignItems();
|
|
1588
|
-
this.positionDropdownMenu(this.rteDropdownPosition());
|
|
1589
|
-
this.addClickOutsideListener();
|
|
1590
|
-
this.dropdownMenuRef.instance.itemEvent.subscribe((event) => {
|
|
1591
|
-
this.onMenuEvent(event);
|
|
1689
|
+
ngAfterViewInit() {
|
|
1690
|
+
this.updateSelectedSegmentIndicator();
|
|
1691
|
+
window.addEventListener("resize", this.updateSelectedSegmentIndicator.bind(this));
|
|
1692
|
+
window.addEventListener("keydown", this.onGlobalKeyDown.bind(this));
|
|
1693
|
+
this.segmentRefs().forEach((segmentElement) => {
|
|
1694
|
+
segmentElement.nativeElement.addEventListener("focus", this.focusCurrentSegmentElement.bind(this));
|
|
1592
1695
|
});
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
this.dropdownMenuRef = null;
|
|
1600
|
-
this.removeClickOutsideListener();
|
|
1601
|
-
dropdownStateSubscription.unsubscribe();
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1696
|
+
}
|
|
1697
|
+
ngOnDestroy() {
|
|
1698
|
+
window.removeEventListener("resize", this.updateSelectedSegmentIndicator.bind(this));
|
|
1699
|
+
window.removeEventListener("keydown", this.onGlobalKeyDown.bind(this));
|
|
1700
|
+
this.segmentRefs().forEach((segmentElement) => {
|
|
1701
|
+
segmentElement.nativeElement.addEventListener("focus", this.focusCurrentSegmentElement.bind(this));
|
|
1604
1702
|
});
|
|
1605
1703
|
}
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
this.dropdownMenuRef.setInput("items", this.menu()?.items());
|
|
1609
|
-
}
|
|
1704
|
+
selectSegment(id) {
|
|
1705
|
+
this.change.emit(id);
|
|
1610
1706
|
}
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1707
|
+
isSegmentSelected(id) {
|
|
1708
|
+
return this.selectedSegment() === id;
|
|
1709
|
+
}
|
|
1710
|
+
handleKeyUp(event) {
|
|
1711
|
+
event.preventDefault();
|
|
1712
|
+
if (event.key === ARROW_RIGHT_KEY || event.key === ARROW_LEFT_KEY) {
|
|
1713
|
+
const allSegmentElements = Array.from(document.activeElement?.parentElement?.parentElement?.querySelectorAll(segmentSelector)) || [];
|
|
1714
|
+
const currentActiveSegmentElementIndex = Array.from(allSegmentElements).findIndex((element) => element === document.activeElement);
|
|
1715
|
+
if (event.key === ARROW_RIGHT_KEY) {
|
|
1716
|
+
focusNextSegmentElement(currentActiveSegmentElementIndex, allSegmentElements);
|
|
1717
|
+
}
|
|
1718
|
+
else if (event.key === ARROW_LEFT_KEY) {
|
|
1719
|
+
focusPreviousSegmentElement(currentActiveSegmentElementIndex, allSegmentElements);
|
|
1624
1720
|
}
|
|
1625
1721
|
}
|
|
1722
|
+
else if (event.key === SPACE_KEY || event.key === ENTER_KEY) {
|
|
1723
|
+
const target = event.target;
|
|
1724
|
+
const dataId = target.getAttribute("data-id");
|
|
1725
|
+
this.selectSegment(dataId || "");
|
|
1726
|
+
}
|
|
1626
1727
|
}
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1728
|
+
handleKeyDown(event) {
|
|
1729
|
+
if (event.key === TAB_KEY || event.key === SPACE_KEY || event.key === ENTER_KEY) {
|
|
1730
|
+
event.preventDefault();
|
|
1731
|
+
}
|
|
1732
|
+
if (event.key === TAB_KEY) {
|
|
1733
|
+
const allFocusableElements = Array.from(document.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY));
|
|
1734
|
+
const currentActiveElement = document.activeElement;
|
|
1735
|
+
const currentIndex = allFocusableElements.indexOf(currentActiveElement);
|
|
1736
|
+
if (event.shiftKey) {
|
|
1737
|
+
focusPreviousNotSegmentElement(currentIndex, allFocusableElements, segmentClass);
|
|
1738
|
+
}
|
|
1739
|
+
else {
|
|
1740
|
+
focusNextNotSegmentElement(currentIndex, allFocusableElements, segmentClass);
|
|
1741
|
+
}
|
|
1631
1742
|
}
|
|
1632
1743
|
}
|
|
1633
|
-
|
|
1634
|
-
|
|
1744
|
+
getSegmentPosition(index) {
|
|
1745
|
+
return getSegmentPosition(index, this.options().length);
|
|
1635
1746
|
}
|
|
1636
|
-
|
|
1637
|
-
|
|
1747
|
+
updateSelectedSegmentIndicator() {
|
|
1748
|
+
const idx = this.options().findIndex((opt) => opt.id === this.selectedSegment());
|
|
1749
|
+
const segment = this.segmentRefs()[idx]?.nativeElement;
|
|
1750
|
+
if (segment) {
|
|
1751
|
+
this.sliderWidth.set(segment.offsetWidth);
|
|
1752
|
+
this.sliderTop.set(segment.offsetTop);
|
|
1753
|
+
this.sliderLeft.set(segment.offsetLeft);
|
|
1754
|
+
}
|
|
1638
1755
|
}
|
|
1639
|
-
|
|
1640
|
-
this.
|
|
1756
|
+
focusCurrentSegmentElement() {
|
|
1757
|
+
if (this.lastKeydown === "Tab") {
|
|
1758
|
+
const selectedSegmentElement = this.segmentRefs().find((segment) => segment.nativeElement.classList.contains("selected"))?.nativeElement;
|
|
1759
|
+
if (selectedSegmentElement) {
|
|
1760
|
+
selectedSegmentElement.focus();
|
|
1761
|
+
}
|
|
1762
|
+
else {
|
|
1763
|
+
this.segmentRefs()[0]?.nativeElement?.focus();
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1641
1766
|
}
|
|
1642
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1643
|
-
static { this.ɵ
|
|
1767
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1768
|
+
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\n *ngIf=\"isSegmentSelected(option.id)\"\n name=\"check-small\"\n class=\"rte-selected-icon\"\n [size]=\"24\"\n />\n <div class=\"rte-segment-content\">\n <ng-container *ngIf=\"option.icon; else label\">\n <rte-icon [name]=\"option.icon\" [size]=\"24\" [appearance]=\"isSegmentSelected(option.id) ? 'filled' : 'outlined' \"></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>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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 }); }
|
|
1644
1769
|
}
|
|
1645
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1646
|
-
type:
|
|
1647
|
-
args: [{
|
|
1648
|
-
|
|
1649
|
-
host: {
|
|
1650
|
-
"[class.dropdown]": "true",
|
|
1651
|
-
"[attr.data-dropdown-id]": "dropdownId",
|
|
1652
|
-
},
|
|
1653
|
-
standalone: true,
|
|
1654
|
-
}]
|
|
1655
|
-
}], ctorParameters: () => [] });
|
|
1770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SegmentedControlComponent, decorators: [{
|
|
1771
|
+
type: Component,
|
|
1772
|
+
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\n *ngIf=\"isSegmentSelected(option.id)\"\n name=\"check-small\"\n class=\"rte-selected-icon\"\n [size]=\"24\"\n />\n <div class=\"rte-segment-content\">\n <ng-container *ngIf=\"option.icon; else label\">\n <rte-icon [name]=\"option.icon\" [size]=\"24\" [appearance]=\"isSegmentSelected(option.id) ? 'filled' : 'outlined' \"></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>", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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"] }]
|
|
1773
|
+
}] });
|
|
1656
1774
|
|
|
1657
|
-
class
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1775
|
+
class BreadcrumbItemComponent {
|
|
1776
|
+
constructor() {
|
|
1777
|
+
this.item = input();
|
|
1778
|
+
this.isLast = input(false);
|
|
1779
|
+
this.breadcrumbItemMaxWidth = input();
|
|
1780
|
+
this.initialScrollWidth = signal(Number.MAX_VALUE);
|
|
1781
|
+
this.elementRef = inject(ElementRef);
|
|
1782
|
+
this.isEllipsisActive = computed(() => {
|
|
1783
|
+
const maxValue = this.breadcrumbItemMaxWidth();
|
|
1784
|
+
if (maxValue) {
|
|
1785
|
+
return this.initialScrollWidth() >= maxValue;
|
|
1786
|
+
}
|
|
1787
|
+
return false;
|
|
1788
|
+
});
|
|
1789
|
+
this.tooltipTriggerStyle = computed(() => {
|
|
1790
|
+
return `overflow: hidden; text-overflow: ellipsis; white-space: nowrap; ${this.breadcrumbItemMaxWidth() ? "max-width:" + this.breadcrumbItemMaxWidth() + "px" : ""}`;
|
|
1791
|
+
});
|
|
1792
|
+
this.linkStyle = computed(() => {
|
|
1793
|
+
return `${this.breadcrumbItemMaxWidth() ? "max-width:" + this.breadcrumbItemMaxWidth() + "px" : ""}`;
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1796
|
+
ngAfterViewInit() {
|
|
1797
|
+
const el = this.elementRef.nativeElement.querySelector(".rte-breadcrumb-item");
|
|
1798
|
+
this.initialScrollWidth.set(el.scrollWidth);
|
|
1799
|
+
}
|
|
1800
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BreadcrumbItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1801
|
+
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\n [rteTooltip]=\"item()!.label\"\n [rteTooltipPosition]=\"'bottom'\"\n [style]=\"tooltipTriggerStyle()\"\n >\n <a\n role=\"link\"\n aria-current=\"page\"\n tabindex=\"-1\"\n [attr.aria-label]=\"item()!.label\"\n [style]=\"linkStyle()\"\n >\n {{ item()!.label }}\n </a>\n </div>\n } @else {\n <a\n role=\"link\"\n aria-current=\"page\"\n tabindex=\"0\"\n [attr.aria-label]=\"item()!.label\"\n [style]=\"linkStyle()\"\n >\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\n [href]=\"item()!.link\"\n [label]=\"item()!.label\"\n [subtle]=\"true\"\n [maxWidth]=\"breadcrumbItemMaxWidth()\"\n />\n </div>\n } @else {\n <rte-link\n [href]=\"item()!.link\"\n [label]=\"item()!.label\"\n [subtle]=\"true\"\n [maxWidth]=\"breadcrumbItemMaxWidth()\"\n />\n }\n }\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1661
1802
|
}
|
|
1662
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
1663
|
-
type:
|
|
1664
|
-
args: [{
|
|
1665
|
-
imports: [DropdownDirective, DropdownTriggerDirective, DropdownMenuComponent, DropdownItemComponent],
|
|
1666
|
-
exports: [DropdownDirective, DropdownTriggerDirective, DropdownMenuComponent, DropdownItemComponent],
|
|
1667
|
-
}]
|
|
1803
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BreadcrumbItemComponent, decorators: [{
|
|
1804
|
+
type: Component,
|
|
1805
|
+
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\n [rteTooltip]=\"item()!.label\"\n [rteTooltipPosition]=\"'bottom'\"\n [style]=\"tooltipTriggerStyle()\"\n >\n <a\n role=\"link\"\n aria-current=\"page\"\n tabindex=\"-1\"\n [attr.aria-label]=\"item()!.label\"\n [style]=\"linkStyle()\"\n >\n {{ item()!.label }}\n </a>\n </div>\n } @else {\n <a\n role=\"link\"\n aria-current=\"page\"\n tabindex=\"0\"\n [attr.aria-label]=\"item()!.label\"\n [style]=\"linkStyle()\"\n >\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\n [href]=\"item()!.link\"\n [label]=\"item()!.label\"\n [subtle]=\"true\"\n [maxWidth]=\"breadcrumbItemMaxWidth()\"\n />\n </div>\n } @else {\n <rte-link\n [href]=\"item()!.link\"\n [label]=\"item()!.label\"\n [subtle]=\"true\"\n [maxWidth]=\"breadcrumbItemMaxWidth()\"\n />\n }\n }\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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"] }]
|
|
1668
1806
|
}] });
|
|
1669
1807
|
|
|
1670
|
-
// Main dropdown module - import this to get everything
|
|
1671
|
-
|
|
1672
1808
|
class BreadcrumbsComponent {
|
|
1673
1809
|
constructor() {
|
|
1674
1810
|
this.items = input([]);
|
|
1675
1811
|
this.ariaLabel = input(BREADCRUMBS_DEFAULT_ARIA_LABEL);
|
|
1812
|
+
this.breadcrumbItemMaxWidth = input(150);
|
|
1676
1813
|
this.truncatedItems = computed(() => {
|
|
1677
1814
|
if (shouldTruncateBreadcrumbs(this.items())) {
|
|
1678
1815
|
return getBreadcrumbsTruncatedItems(this.items());
|
|
@@ -1681,11 +1818,11 @@ class BreadcrumbsComponent {
|
|
|
1681
1818
|
});
|
|
1682
1819
|
}
|
|
1683
1820
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BreadcrumbsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1684
|
-
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 } }, 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 <
|
|
1821
|
+
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\n [item]=\"truncatedItems()!.root\"\n [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\"\n />\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 dropdownTrigger\n tabindex=\"-1\"\n [compactSpacing]=\"true\"\n />\n <rte-dropdown-menu [items]=\"truncatedItems()?.truncated ?? []\" />\n </span>\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n @for (\n item of truncatedItems()!.remaining;\n track item.link;\n let i = $index\n ) {\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: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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: "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"] }, { 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: BreadcrumbItemComponent, selector: "rte-breadcrumb-item", inputs: ["item", "isLast", "breadcrumbItemMaxWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1685
1822
|
}
|
|
1686
1823
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BreadcrumbsComponent, decorators: [{
|
|
1687
1824
|
type: Component,
|
|
1688
|
-
args: [{ selector: "rte-breadcrumbs", imports: [CommonModule,
|
|
1825
|
+
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\n [item]=\"truncatedItems()!.root\"\n [breadcrumbItemMaxWidth]=\"breadcrumbItemMaxWidth()\"\n />\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 dropdownTrigger\n tabindex=\"-1\"\n [compactSpacing]=\"true\"\n />\n <rte-dropdown-menu [items]=\"truncatedItems()?.truncated ?? []\" />\n </span>\n <span aria-hidden=\"true\" class=\"separator\">/</span>\n @for (\n item of truncatedItems()!.remaining;\n track item.link;\n let i = $index\n ) {\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: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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"] }]
|
|
1689
1826
|
}] });
|
|
1690
1827
|
|
|
1691
1828
|
class BannerComponent {
|
|
@@ -1739,13 +1876,74 @@ class BannerComponent {
|
|
|
1739
1876
|
});
|
|
1740
1877
|
}
|
|
1741
1878
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BannerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1742
|
-
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 }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", 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 [ngClass]=\"{ open: visible(), close: !visible() }\"\n [attr.role]=\"type() === 'default' ? 'status' : 'alert'\"\n>\n <div class=\"rte-banner\">\n <div *ngIf=\"showIcon()\" class=\"rte-banner-icon\">\n <rte-icon [name]=\"type() === 'default' ? 'info' : 'error'\" [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 <
|
|
1879
|
+
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 }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", 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 [ngClass]=\"{ open: visible(), close: !visible() }\"\n [attr.role]=\"type() === 'default' ? 'status' : 'alert'\"\n>\n <div class=\"rte-banner\">\n <div *ngIf=\"showIcon()\" class=\"rte-banner-icon\">\n <rte-icon [name]=\"type() === 'default' ? 'info' : 'error'\" [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 <button *ngIf=\"actionLabel()\"\n rteButton\n rteButtonVariant=\"neutral\"\n rteButtonSize=\"s\"\n [attr.aria-label]=\"actionLabel()!\"\n (click)=\"clickAction()\"\n >{{ actionLabel() }}</button>\n </div>\n </div>\n <div *ngIf=\"closable()\" class=\"rte-banner-close-icon\">\n <rte-icon-button\n name=\"close\"\n variant=\"neutral\"\n ariaLabel=\"close banner\"\n (click)=\"closeBanner()\"\n />\n </div>\n </div>\n</section>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-banner-container{display:flex;box-sizing:border-box;width:100%;min-width:320px;padding:24px;flex-direction:column;justify-content:center;align-items:center;gap:0px;border-radius:0;background:var(--background-info-default);color:var(--content-info-default);top:0;left:0;transition:opacity .2s ease,transform .2s ease;z-index:10}.rte-banner-container.alert{background:var(--background-danger-default);color:var(--content-danger-default)}.rte-banner-container.overlay{position:fixed}.rte-banner-container.open{opacity:1;transform:translateY(0)}.rte-banner-container.close{opacity:0;transform:translateY(-10px)}.rte-banner-container .rte-banner{display:flex;padding:16px;align-items:flex-start;gap:16px;align-self:stretch;border-radius:var(--radius-S, 4px);opacity:var(--100, 1);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, #FFF)}.rte-banner-container .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-container .rte-banner .banner-close-icon{color:var(--content-secondary)}.rte-banner-container .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-container .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-container .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:12px;line-height:16px;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-container .rte-banner .rte-banner-content .rte-banner-message .rte-banner-action-button{width:max-content}.rte-banner-container .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"], outputs: ["click"] }, { kind: "component", type: ButtonComponent, selector: "button[rteButton]", inputs: ["rteButtonVariant", "rteButtonSize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1743
1880
|
}
|
|
1744
1881
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BannerComponent, decorators: [{
|
|
1745
1882
|
type: Component,
|
|
1746
|
-
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 [ngClass]=\"{ open: visible(), close: !visible() }\"\n [attr.role]=\"type() === 'default' ? 'status' : 'alert'\"\n>\n <div class=\"rte-banner\">\n <div *ngIf=\"showIcon()\" class=\"rte-banner-icon\">\n <rte-icon [name]=\"type() === 'default' ? 'info' : 'error'\" [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 <
|
|
1883
|
+
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 [ngClass]=\"{ open: visible(), close: !visible() }\"\n [attr.role]=\"type() === 'default' ? 'status' : 'alert'\"\n>\n <div class=\"rte-banner\">\n <div *ngIf=\"showIcon()\" class=\"rte-banner-icon\">\n <rte-icon [name]=\"type() === 'default' ? 'info' : 'error'\" [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 <button *ngIf=\"actionLabel()\"\n rteButton\n rteButtonVariant=\"neutral\"\n rteButtonSize=\"s\"\n [attr.aria-label]=\"actionLabel()!\"\n (click)=\"clickAction()\"\n >{{ actionLabel() }}</button>\n </div>\n </div>\n <div *ngIf=\"closable()\" class=\"rte-banner-close-icon\">\n <rte-icon-button\n name=\"close\"\n variant=\"neutral\"\n ariaLabel=\"close banner\"\n (click)=\"closeBanner()\"\n />\n </div>\n </div>\n</section>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-banner-container{display:flex;box-sizing:border-box;width:100%;min-width:320px;padding:24px;flex-direction:column;justify-content:center;align-items:center;gap:0px;border-radius:0;background:var(--background-info-default);color:var(--content-info-default);top:0;left:0;transition:opacity .2s ease,transform .2s ease;z-index:10}.rte-banner-container.alert{background:var(--background-danger-default);color:var(--content-danger-default)}.rte-banner-container.overlay{position:fixed}.rte-banner-container.open{opacity:1;transform:translateY(0)}.rte-banner-container.close{opacity:0;transform:translateY(-10px)}.rte-banner-container .rte-banner{display:flex;padding:16px;align-items:flex-start;gap:16px;align-self:stretch;border-radius:var(--radius-S, 4px);opacity:var(--100, 1);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, #FFF)}.rte-banner-container .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-container .rte-banner .banner-close-icon{color:var(--content-secondary)}.rte-banner-container .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-container .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-container .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:12px;line-height:16px;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-container .rte-banner .rte-banner-content .rte-banner-message .rte-banner-action-button{width:max-content}.rte-banner-container .rte-banner .rte-banner-close-icon{color:var(--content-secondary)}\n"] }]
|
|
1747
1884
|
}] });
|
|
1748
1885
|
|
|
1886
|
+
class FocusTrapService {
|
|
1887
|
+
constructor() {
|
|
1888
|
+
this.activeTrapElement = null;
|
|
1889
|
+
this.previouslyFocusedElement = null;
|
|
1890
|
+
this.focusable = [];
|
|
1891
|
+
this.rendererFactory = inject(RendererFactory2);
|
|
1892
|
+
this.renderer = this.rendererFactory.createRenderer(null, null);
|
|
1893
|
+
}
|
|
1894
|
+
activate(element) {
|
|
1895
|
+
this.previouslyFocusedElement = document.activeElement;
|
|
1896
|
+
this.activeTrapElement = element;
|
|
1897
|
+
this.focusable = this.getFocusableElements(element);
|
|
1898
|
+
this.focusFirstElement();
|
|
1899
|
+
this.keyUnlisten = this.renderer.listen(element, "keydown", (event) => {
|
|
1900
|
+
if (event.key === "Tab") {
|
|
1901
|
+
this.handleTab(event, this.focusable);
|
|
1902
|
+
}
|
|
1903
|
+
});
|
|
1904
|
+
}
|
|
1905
|
+
deactivate() {
|
|
1906
|
+
if (this.keyUnlisten)
|
|
1907
|
+
this.keyUnlisten();
|
|
1908
|
+
this.keyUnlisten = undefined;
|
|
1909
|
+
if (this.previouslyFocusedElement) {
|
|
1910
|
+
this.previouslyFocusedElement.focus();
|
|
1911
|
+
}
|
|
1912
|
+
this.activeTrapElement = null;
|
|
1913
|
+
}
|
|
1914
|
+
focusFirstElement() {
|
|
1915
|
+
if (!this.activeTrapElement)
|
|
1916
|
+
return;
|
|
1917
|
+
const focusable = this.activeTrapElement.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY);
|
|
1918
|
+
if (focusable.length > 0)
|
|
1919
|
+
focusable[0].focus();
|
|
1920
|
+
}
|
|
1921
|
+
handleTab(event, focusable) {
|
|
1922
|
+
if (!this.activeTrapElement || focusable.length === 0)
|
|
1923
|
+
return;
|
|
1924
|
+
const first = focusable[0];
|
|
1925
|
+
const last = focusable[focusable.length - 1];
|
|
1926
|
+
const current = document.activeElement;
|
|
1927
|
+
if (event.shiftKey && current === first) {
|
|
1928
|
+
last.focus();
|
|
1929
|
+
event.preventDefault();
|
|
1930
|
+
}
|
|
1931
|
+
else if (!event.shiftKey && current === last) {
|
|
1932
|
+
first.focus();
|
|
1933
|
+
event.preventDefault();
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
getFocusableElements(container) {
|
|
1937
|
+
return Array.from(container.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY));
|
|
1938
|
+
}
|
|
1939
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FocusTrapService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1940
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FocusTrapService, providedIn: "root" }); }
|
|
1941
|
+
}
|
|
1942
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FocusTrapService, decorators: [{
|
|
1943
|
+
type: Injectable,
|
|
1944
|
+
args: [{ providedIn: "root" }]
|
|
1945
|
+
}], ctorParameters: () => [] });
|
|
1946
|
+
|
|
1749
1947
|
class PopoverComponent {
|
|
1750
1948
|
constructor() {
|
|
1751
1949
|
this.primaryButtonLabel = input.required();
|
|
@@ -1760,45 +1958,29 @@ class PopoverComponent {
|
|
|
1760
1958
|
this.clickPrimaryButton = output();
|
|
1761
1959
|
this.clickSecondaryButton = output();
|
|
1762
1960
|
this.elementRef = inject(ElementRef);
|
|
1763
|
-
this.
|
|
1961
|
+
this.focusTrap = inject(FocusTrapService);
|
|
1764
1962
|
}
|
|
1765
1963
|
ngAfterViewInit() {
|
|
1766
|
-
this.
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
if (event.key === TAB_KEY) {
|
|
1770
|
-
if (this.isOpen()) {
|
|
1771
|
-
const focusable = this.element.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY);
|
|
1772
|
-
const first = focusable[0];
|
|
1773
|
-
const last = focusable[focusable.length - 1];
|
|
1774
|
-
if (event.shiftKey && document.activeElement === first) {
|
|
1775
|
-
event.preventDefault();
|
|
1776
|
-
last.focus();
|
|
1777
|
-
}
|
|
1778
|
-
else if (!event.shiftKey && document.activeElement === last) {
|
|
1779
|
-
event.preventDefault();
|
|
1780
|
-
first.focus();
|
|
1781
|
-
}
|
|
1782
|
-
}
|
|
1964
|
+
const native = this.elementRef?.nativeElement;
|
|
1965
|
+
if (native) {
|
|
1966
|
+
this.focusTrap.activate(native);
|
|
1783
1967
|
}
|
|
1784
1968
|
}
|
|
1969
|
+
ngOnDestroy() {
|
|
1970
|
+
this.focusTrap.deactivate();
|
|
1971
|
+
}
|
|
1785
1972
|
handleClickPrimaryButton() {
|
|
1786
1973
|
this.clickPrimaryButton.emit();
|
|
1787
1974
|
}
|
|
1788
1975
|
handleClickSecondaryButton() {
|
|
1789
1976
|
this.clickSecondaryButton.emit();
|
|
1790
1977
|
}
|
|
1791
|
-
focusFirstElement() {
|
|
1792
|
-
const focusable = this.element.querySelectorAll(FOCUSABLE_ELEMENTS_QUERY);
|
|
1793
|
-
if (focusable.length > 0)
|
|
1794
|
-
focusable[0].focus();
|
|
1795
|
-
}
|
|
1796
1978
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1797
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: PopoverComponent, isStandalone: true, selector: "rte-popover", inputs: { primaryButtonLabel: { classPropertyName: "primaryButtonLabel", publicName: "primaryButtonLabel", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", 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 }, coordinates: { classPropertyName: "coordinates", publicName: "coordinates", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickPrimaryButton: "clickPrimaryButton", clickSecondaryButton: "clickSecondaryButton" }, ngImport: i0, template: "<div\n #root\n class=\"rte-popover\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.data-arrow]=\"arrow()\"\n [attr.data-position]=\"position()\"\n [attr.data-alignment]=\"alignment()\"\n [attr.data-open]=\"isOpen()\"\n [style]=\"{ top: coordinates().top + 'px', left: coordinates().left + 'px' }\"\n
|
|
1979
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: PopoverComponent, isStandalone: true, selector: "rte-popover", inputs: { primaryButtonLabel: { classPropertyName: "primaryButtonLabel", publicName: "primaryButtonLabel", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", 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 }, coordinates: { classPropertyName: "coordinates", publicName: "coordinates", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickPrimaryButton: "clickPrimaryButton", clickSecondaryButton: "clickSecondaryButton" }, ngImport: i0, template: "<div\n #root\n class=\"rte-popover\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.data-arrow]=\"arrow()\"\n [attr.data-position]=\"position()\"\n [attr.data-alignment]=\"alignment()\"\n [attr.data-open]=\"isOpen()\"\n [style]=\"{ top: coordinates().top + 'px', left: coordinates().left + 'px' }\"\n>\n <div class=\"popoverInner\">\n <div class=\"popoverContentContainer\">\n <div *ngIf=\"title\" class=\"popoverTitle\">{{ title() }}</div>\n <div class=\"popoverContent\">{{ content() }}</div>\n </div>\n <div class=\"popoverButtonContainer\">\n <button *ngIf=\"secondaryButtonLabel()\"\n rteButton\n rteButtonVariant=\"secondary\"\n (click)=\"handleClickSecondaryButton()\"\n >{{ secondaryButtonLabel() }}</button>\n <button rteButton\n rteButtonVariant=\"primary\"\n (click)=\"handleClickPrimaryButton()\"\n >{{ primaryButtonLabel() }}</button>\n </div>\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-popoverTrigger{position:relative;width:max-content}.rte-popover{position:absolute;pointer-events:auto;top:0;left:0;padding:0;display:flex;flex-direction:column;gap:0px;filter:drop-shadow(0 4px 8px rgba(0,0,0,.12)) drop-shadow(0 2px 4px rgba(0,0,0,.08));background-color:var(--background-default);transition:opacity .15s ease-out;opacity:0;z-index:1000;min-width:320px;max-width:600px;width:fit-content;height:fit-content}.rte-popover .popoverInner{display:flex;flex-direction:column;align-items:flex-start;padding:24px;gap:24px;border-radius:4px}.rte-popover .popoverInner .popoverContentContainer{display:flex;flex-direction:column;align-items:flex-start;padding:0;gap:16px}.rte-popover .popoverInner .popoverContentContainer .popoverTitle{overflow:hidden;text-overflow:ellipsis;color:var(--content-primary);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}.rte-popover .popoverInner .popoverContentContainer .popoverContent{color:var(--content-secondary);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;width:100%;word-break:break-word}.rte-popover .popoverInner .popoverButtonContainer{display:flex;justify-content:flex-end;align-items:flex-start;padding:0;gap:24px;width:100%}.rte-popover:after{content:\"\";position:absolute;border-width:12px;border-style:solid}.rte-popover[data-position=top]:after{top:100%;left:50%;margin-left:-12px;border-color:var(--background-default) transparent transparent transparent}.rte-popover[data-position=top][data-alignment=start]:after{left:20px}.rte-popover[data-position=top][data-alignment=end]:after{left:auto;right:20px}.rte-popover[data-position=bottom]:after{bottom:100%;left:50%;margin-left:-12px;border-color:transparent transparent var(--background-default) transparent}.rte-popover[data-position=bottom][data-alignment=start]:after{left:20px}.rte-popover[data-position=bottom][data-alignment=end]:after{left:auto;right:20px}.rte-popover[data-position=left]:after{top:50%;left:100%;margin-top:-12px;border-color:transparent transparent transparent var(--background-default)}.rte-popover[data-position=left][data-alignment=start]:after{top:20px}.rte-popover[data-position=left][data-alignment=end]:after{top:auto;bottom:20px}.rte-popover[data-position=right]:after{top:50%;right:100%;margin-top:-12px;border-color:transparent var(--background-default) transparent transparent}.rte-popover[data-position=right][data-alignment=start]:after{top:20px}.rte-popover[data-position=right][data-alignment=end]:after{top:auto;bottom:20px}.rte-popover[data-arrow=false]:after{display:none}.rte-popover[data-open=true]{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "button[rteButton]", inputs: ["rteButtonVariant", "rteButtonSize"] }] }); }
|
|
1798
1980
|
}
|
|
1799
1981
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PopoverComponent, decorators: [{
|
|
1800
1982
|
type: Component,
|
|
1801
|
-
args: [{ selector: "rte-popover", imports: [CommonModule, ButtonComponent], standalone: true, template: "<div\n #root\n class=\"rte-popover\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.data-arrow]=\"arrow()\"\n [attr.data-position]=\"position()\"\n [attr.data-alignment]=\"alignment()\"\n [attr.data-open]=\"isOpen()\"\n [style]=\"{ top: coordinates().top + 'px', left: coordinates().left + 'px' }\"\n
|
|
1983
|
+
args: [{ selector: "rte-popover", imports: [CommonModule, ButtonComponent], standalone: true, template: "<div\n #root\n class=\"rte-popover\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.data-arrow]=\"arrow()\"\n [attr.data-position]=\"position()\"\n [attr.data-alignment]=\"alignment()\"\n [attr.data-open]=\"isOpen()\"\n [style]=\"{ top: coordinates().top + 'px', left: coordinates().left + 'px' }\"\n>\n <div class=\"popoverInner\">\n <div class=\"popoverContentContainer\">\n <div *ngIf=\"title\" class=\"popoverTitle\">{{ title() }}</div>\n <div class=\"popoverContent\">{{ content() }}</div>\n </div>\n <div class=\"popoverButtonContainer\">\n <button *ngIf=\"secondaryButtonLabel()\"\n rteButton\n rteButtonVariant=\"secondary\"\n (click)=\"handleClickSecondaryButton()\"\n >{{ secondaryButtonLabel() }}</button>\n <button rteButton\n rteButtonVariant=\"primary\"\n (click)=\"handleClickPrimaryButton()\"\n >{{ primaryButtonLabel() }}</button>\n </div>\n </div>\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.rte-popoverTrigger{position:relative;width:max-content}.rte-popover{position:absolute;pointer-events:auto;top:0;left:0;padding:0;display:flex;flex-direction:column;gap:0px;filter:drop-shadow(0 4px 8px rgba(0,0,0,.12)) drop-shadow(0 2px 4px rgba(0,0,0,.08));background-color:var(--background-default);transition:opacity .15s ease-out;opacity:0;z-index:1000;min-width:320px;max-width:600px;width:fit-content;height:fit-content}.rte-popover .popoverInner{display:flex;flex-direction:column;align-items:flex-start;padding:24px;gap:24px;border-radius:4px}.rte-popover .popoverInner .popoverContentContainer{display:flex;flex-direction:column;align-items:flex-start;padding:0;gap:16px}.rte-popover .popoverInner .popoverContentContainer .popoverTitle{overflow:hidden;text-overflow:ellipsis;color:var(--content-primary);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}.rte-popover .popoverInner .popoverContentContainer .popoverContent{color:var(--content-secondary);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;width:100%;word-break:break-word}.rte-popover .popoverInner .popoverButtonContainer{display:flex;justify-content:flex-end;align-items:flex-start;padding:0;gap:24px;width:100%}.rte-popover:after{content:\"\";position:absolute;border-width:12px;border-style:solid}.rte-popover[data-position=top]:after{top:100%;left:50%;margin-left:-12px;border-color:var(--background-default) transparent transparent transparent}.rte-popover[data-position=top][data-alignment=start]:after{left:20px}.rte-popover[data-position=top][data-alignment=end]:after{left:auto;right:20px}.rte-popover[data-position=bottom]:after{bottom:100%;left:50%;margin-left:-12px;border-color:transparent transparent var(--background-default) transparent}.rte-popover[data-position=bottom][data-alignment=start]:after{left:20px}.rte-popover[data-position=bottom][data-alignment=end]:after{left:auto;right:20px}.rte-popover[data-position=left]:after{top:50%;left:100%;margin-top:-12px;border-color:transparent transparent transparent var(--background-default)}.rte-popover[data-position=left][data-alignment=start]:after{top:20px}.rte-popover[data-position=left][data-alignment=end]:after{top:auto;bottom:20px}.rte-popover[data-position=right]:after{top:50%;right:100%;margin-top:-12px;border-color:transparent var(--background-default) transparent transparent}.rte-popover[data-position=right][data-alignment=start]:after{top:20px}.rte-popover[data-position=right][data-alignment=end]:after{top:auto;bottom:20px}.rte-popover[data-arrow=false]:after{display:none}.rte-popover[data-open=true]{opacity:1}\n"] }]
|
|
1802
1984
|
}], ctorParameters: () => [] });
|
|
1803
1985
|
|
|
1804
1986
|
class PopoverDirective {
|
|
@@ -1941,9 +2123,202 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1941
2123
|
args: ["click"]
|
|
1942
2124
|
}] } });
|
|
1943
2125
|
|
|
2126
|
+
class ModalTriggerDirective {
|
|
2127
|
+
constructor() {
|
|
2128
|
+
this.elementRef = inject(ElementRef);
|
|
2129
|
+
this.modalTriggerKeyDown = output();
|
|
2130
|
+
this.modalTriggerClicked = output();
|
|
2131
|
+
}
|
|
2132
|
+
onModalTriggerClicked(event) {
|
|
2133
|
+
this.modalTriggerClicked.emit(event);
|
|
2134
|
+
}
|
|
2135
|
+
onKeyDown(event) {
|
|
2136
|
+
this.modalTriggerKeyDown.emit(event);
|
|
2137
|
+
}
|
|
2138
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2139
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ModalTriggerDirective, isStandalone: true, selector: "[rteModalTrigger]", outputs: { modalTriggerKeyDown: "modalTriggerKeyDown", modalTriggerClicked: "modalTriggerClicked" }, host: { listeners: { "click": "onModalTriggerClicked($event)", "keydown": "onKeyDown($event)" } }, ngImport: i0 }); }
|
|
2140
|
+
}
|
|
2141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalTriggerDirective, decorators: [{
|
|
2142
|
+
type: Directive,
|
|
2143
|
+
args: [{
|
|
2144
|
+
selector: "[rteModalTrigger]",
|
|
2145
|
+
standalone: true,
|
|
2146
|
+
}]
|
|
2147
|
+
}], propDecorators: { onModalTriggerClicked: [{
|
|
2148
|
+
type: HostListener,
|
|
2149
|
+
args: ["click", ["$event"]]
|
|
2150
|
+
}], onKeyDown: [{
|
|
2151
|
+
type: HostListener,
|
|
2152
|
+
args: ["keydown", ["$event"]]
|
|
2153
|
+
}] } });
|
|
2154
|
+
|
|
2155
|
+
class ModalComponent {
|
|
2156
|
+
constructor() {
|
|
2157
|
+
this.id = input();
|
|
2158
|
+
this.icon = input();
|
|
2159
|
+
this.iconAppearance = input("outlined");
|
|
2160
|
+
this.title = input();
|
|
2161
|
+
this.description = input();
|
|
2162
|
+
this.secondaryButtonLabel = input();
|
|
2163
|
+
this.isOpen = input(false);
|
|
2164
|
+
this.size = input("m");
|
|
2165
|
+
this.ariaDescribedby = input(undefined);
|
|
2166
|
+
this.primaryButton = input(null);
|
|
2167
|
+
this.secondaryButton = input(null);
|
|
2168
|
+
this.customContent = input(null);
|
|
2169
|
+
this.elementRef = viewChild("modal");
|
|
2170
|
+
this.focusTrap = inject(FocusTrapService);
|
|
2171
|
+
this.closeModal = output();
|
|
2172
|
+
this.iconSize = signal(IconSize["xl"]);
|
|
2173
|
+
}
|
|
2174
|
+
ngAfterViewInit() {
|
|
2175
|
+
const native = this.elementRef()?.nativeElement;
|
|
2176
|
+
if (native) {
|
|
2177
|
+
this.focusTrap.activate(native);
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
ngOnDestroy() {
|
|
2181
|
+
this.focusTrap.deactivate();
|
|
2182
|
+
}
|
|
2183
|
+
onClose() {
|
|
2184
|
+
this.closeModal.emit();
|
|
2185
|
+
}
|
|
2186
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2187
|
+
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]=\"\n description() ? id() + '-modal-desc' : ariaDescribedby()\n \"\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\n *ngIf=\"icon()\"\n [name]=\"icon() ?? ''\"\n [size]=\"iconSize()\"\n [appearance]=\"iconAppearance()\"\n />\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 (click)=\"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: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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 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%);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}.rte-modal-container[data-size=xl]{width:1328px}.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"], outputs: ["click"] }, { 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"] }] }); }
|
|
2188
|
+
}
|
|
2189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalComponent, decorators: [{
|
|
2190
|
+
type: Component,
|
|
2191
|
+
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]=\"\n description() ? id() + '-modal-desc' : ariaDescribedby()\n \"\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\n *ngIf=\"icon()\"\n [name]=\"icon() ?? ''\"\n [size]=\"iconSize()\"\n [appearance]=\"iconAppearance()\"\n />\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 (click)=\"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: ["@import\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:wght,FILL,GRAD@400,0,0&display=swap\";@import\"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap\";.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 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%);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}.rte-modal-container[data-size=xl]{width:1328px}.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"] }]
|
|
2192
|
+
}], ctorParameters: () => [] });
|
|
2193
|
+
|
|
2194
|
+
class ModalDirective {
|
|
2195
|
+
constructor() {
|
|
2196
|
+
this.modalCompRef = null;
|
|
2197
|
+
this.elementRef = inject(ElementRef);
|
|
2198
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
2199
|
+
this.trigger = contentChild(ModalTriggerDirective);
|
|
2200
|
+
this.rteModalId = input();
|
|
2201
|
+
this.rteModalIcon = input();
|
|
2202
|
+
this.rteModalIconAppearance = input("outlined");
|
|
2203
|
+
this.rteModalTitle = input();
|
|
2204
|
+
this.rteModalDescription = input();
|
|
2205
|
+
this.rteModalIsOpen = input(false);
|
|
2206
|
+
this.rteModalSize = input("m");
|
|
2207
|
+
this.rteModalAriaDescribedby = input();
|
|
2208
|
+
this.rteModalCloseOnClickOutside = input(true);
|
|
2209
|
+
this.primaryButton = contentChild.required("primaryButton");
|
|
2210
|
+
this.secondaryButton = contentChild("secondaryButton");
|
|
2211
|
+
this.customContent = contentChild("customContent");
|
|
2212
|
+
this.modalElement = null;
|
|
2213
|
+
this.onMouseDown = (e) => this.handleClickAway(e);
|
|
2214
|
+
this.onKeyDown = (e) => this.handleKeydown(e);
|
|
2215
|
+
this.overlayService = inject(OverlayService);
|
|
2216
|
+
this.hostElement = this.elementRef.nativeElement;
|
|
2217
|
+
}
|
|
2218
|
+
onTrigger() {
|
|
2219
|
+
this.showModal();
|
|
2220
|
+
}
|
|
2221
|
+
ngAfterContentInit() {
|
|
2222
|
+
document.addEventListener("mousedown", this.onMouseDown);
|
|
2223
|
+
document.addEventListener("keydown", this.onKeyDown);
|
|
2224
|
+
if (this.trigger()) {
|
|
2225
|
+
this.trigger()?.modalTriggerClicked.subscribe(() => {
|
|
2226
|
+
this.onTrigger();
|
|
2227
|
+
});
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
ngOnDestroy() {
|
|
2231
|
+
this.destroyModal();
|
|
2232
|
+
}
|
|
2233
|
+
showModal() {
|
|
2234
|
+
if (this.modalCompRef) {
|
|
2235
|
+
this.modalCompRef.destroy();
|
|
2236
|
+
}
|
|
2237
|
+
if (!this.primaryButton()) {
|
|
2238
|
+
console.warn("Primary button required, add it as child to the modal directive.");
|
|
2239
|
+
return;
|
|
2240
|
+
}
|
|
2241
|
+
this.modalCompRef = this.overlayService.create(ModalComponent, this.viewContainerRef, true);
|
|
2242
|
+
this.modalCompRef?.instance.closeModal.subscribe(() => {
|
|
2243
|
+
this.closeModal();
|
|
2244
|
+
});
|
|
2245
|
+
this.modalElement = this.modalCompRef?.location.nativeElement.children[0].children[1];
|
|
2246
|
+
this.assignInputsValues();
|
|
2247
|
+
}
|
|
2248
|
+
handleKeydown(event) {
|
|
2249
|
+
if (event.key === ESCAPE_KEY && this.rteModalCloseOnClickOutside()) {
|
|
2250
|
+
event.preventDefault();
|
|
2251
|
+
this.closeModal();
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
assignInputsValues() {
|
|
2255
|
+
if (this.modalCompRef) {
|
|
2256
|
+
this.modalCompRef.setInput("id", this.rteModalId());
|
|
2257
|
+
this.modalCompRef.setInput("icon", this.rteModalIcon());
|
|
2258
|
+
this.modalCompRef.setInput("iconAppearance", this.rteModalIconAppearance());
|
|
2259
|
+
this.modalCompRef.setInput("title", this.rteModalTitle());
|
|
2260
|
+
this.modalCompRef.setInput("description", this.rteModalDescription());
|
|
2261
|
+
this.modalCompRef.setInput("size", this.rteModalSize());
|
|
2262
|
+
this.modalCompRef.setInput("ariaDescribedby", this.rteModalAriaDescribedby());
|
|
2263
|
+
this.modalCompRef.setInput("primaryButton", this.primaryButton());
|
|
2264
|
+
this.modalCompRef.setInput("secondaryButton", this.secondaryButton());
|
|
2265
|
+
this.modalCompRef.setInput("customContent", this.customContent());
|
|
2266
|
+
requestAnimationFrame(() => {
|
|
2267
|
+
requestAnimationFrame(() => {
|
|
2268
|
+
this.modalCompRef?.setInput("isOpen", true);
|
|
2269
|
+
});
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
handleClickAway(event) {
|
|
2274
|
+
const elements = [this.hostElement, this.modalElement];
|
|
2275
|
+
if (elements.some((element) => !element))
|
|
2276
|
+
return;
|
|
2277
|
+
const shouldIgnore = elements.some((element) => element.contains(event.target));
|
|
2278
|
+
if (!shouldIgnore && this.rteModalCloseOnClickOutside()) {
|
|
2279
|
+
this.closeModal();
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
closeModal() {
|
|
2283
|
+
if (this.modalCompRef) {
|
|
2284
|
+
this.modalCompRef.setInput("isOpen", false);
|
|
2285
|
+
setTimeout(() => this.destroyModal(), 200);
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
destroyModal() {
|
|
2289
|
+
if (this.modalCompRef) {
|
|
2290
|
+
this.modalCompRef.destroy();
|
|
2291
|
+
this.modalCompRef = null;
|
|
2292
|
+
this.overlayService.destroy();
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2296
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.2.14", type: ModalDirective, isStandalone: true, selector: "[rteModal]", inputs: { rteModalId: { classPropertyName: "rteModalId", publicName: "rteModalId", isSignal: true, isRequired: false, transformFunction: null }, rteModalIcon: { classPropertyName: "rteModalIcon", publicName: "rteModalIcon", isSignal: true, isRequired: false, transformFunction: null }, rteModalIconAppearance: { classPropertyName: "rteModalIconAppearance", publicName: "rteModalIconAppearance", isSignal: true, isRequired: false, transformFunction: null }, rteModalTitle: { classPropertyName: "rteModalTitle", publicName: "rteModalTitle", isSignal: true, isRequired: false, transformFunction: null }, rteModalDescription: { classPropertyName: "rteModalDescription", publicName: "rteModalDescription", isSignal: true, isRequired: false, transformFunction: null }, rteModalIsOpen: { classPropertyName: "rteModalIsOpen", publicName: "rteModalIsOpen", isSignal: true, isRequired: false, transformFunction: null }, rteModalSize: { classPropertyName: "rteModalSize", publicName: "rteModalSize", isSignal: true, isRequired: false, transformFunction: null }, rteModalAriaDescribedby: { classPropertyName: "rteModalAriaDescribedby", publicName: "rteModalAriaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, rteModalCloseOnClickOutside: { classPropertyName: "rteModalCloseOnClickOutside", publicName: "rteModalCloseOnClickOutside", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "trigger", first: true, predicate: ModalTriggerDirective, descendants: true, isSignal: true }, { propertyName: "primaryButton", first: true, predicate: ["primaryButton"], descendants: true, isSignal: true }, { propertyName: "secondaryButton", first: true, predicate: ["secondaryButton"], descendants: true, isSignal: true }, { propertyName: "customContent", first: true, predicate: ["customContent"], descendants: true, isSignal: true }], ngImport: i0 }); }
|
|
2297
|
+
}
|
|
2298
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalDirective, decorators: [{
|
|
2299
|
+
type: Directive,
|
|
2300
|
+
args: [{
|
|
2301
|
+
selector: "[rteModal]",
|
|
2302
|
+
standalone: true,
|
|
2303
|
+
}]
|
|
2304
|
+
}], ctorParameters: () => [] });
|
|
2305
|
+
|
|
2306
|
+
class ModalModule {
|
|
2307
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2308
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: ModalModule, imports: [ModalDirective, ModalTriggerDirective], exports: [ModalDirective, ModalTriggerDirective] }); }
|
|
2309
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalModule }); }
|
|
2310
|
+
}
|
|
2311
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalModule, decorators: [{
|
|
2312
|
+
type: NgModule,
|
|
2313
|
+
args: [{
|
|
2314
|
+
imports: [ModalDirective, ModalTriggerDirective],
|
|
2315
|
+
exports: [ModalDirective, ModalTriggerDirective],
|
|
2316
|
+
}]
|
|
2317
|
+
}] });
|
|
2318
|
+
|
|
1944
2319
|
/**
|
|
1945
2320
|
* Generated bundle index. Do not edit.
|
|
1946
2321
|
*/
|
|
1947
2322
|
|
|
1948
|
-
export { BadgeDirective, BannerComponent, BreadcrumbsComponent, ButtonComponent, CheckboxComponent, CheckboxGroupComponent, ChipComponent, ColDirective, DividerComponent, GridDirective, IconButtonComponent, IconButtonToggleComponent, IconComponent, LinkComponent, PopoverDirective, RadioButtonComponent, RadioButtonGroupComponent, SegmentedControlComponent, SplitButtonComponent, SwitchComponent, TextInputComponent, TextareaComponent, TooltipDirective };
|
|
2323
|
+
export { BadgeDirective, BannerComponent, BreadcrumbsComponent, ButtonComponent, CheckboxComponent, CheckboxGroupComponent, ChipComponent, ColDirective, DividerComponent, GridDirective, IconButtonComponent, IconButtonToggleComponent, IconComponent, LinkComponent, ModalDirective, ModalModule, ModalTriggerDirective, PopoverDirective, RadioButtonComponent, RadioButtonGroupComponent, SegmentedControlComponent, SplitButtonComponent, SwitchComponent, TextInputComponent, TextareaComponent, TooltipDirective };
|
|
1949
2324
|
//# sourceMappingURL=design-system-rte-angular.mjs.map
|