@ethlete/components 0.1.0-next.7 → 0.1.0-next.9
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/CHANGELOG.md +12 -0
- package/fesm2022/ethlete-components.mjs +1789 -823
- package/fesm2022/ethlete-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ethlete-components.d.ts +128 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ChangeDetectionStrategy, ViewEncapsulation, Component, Directive, input, booleanAttribute, signal, effect, numberAttribute, computed, inject, ElementRef, InjectionToken, afterNextRender, untracked, DestroyRef, model, viewChild, Injector, output, ApplicationRef, EnvironmentInjector, DOCUMENT, createEnvironmentInjector, createComponent, TemplateRef, linkedSignal, afterRenderEffect, contentChild, inputBinding, PLATFORM_ID, isDevMode, contentChildren } from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, ViewEncapsulation, Component, Directive, input, booleanAttribute, signal, effect, numberAttribute, computed, inject, ElementRef, InjectionToken, afterNextRender, untracked, DestroyRef, model, viewChild, Injector, output, ApplicationRef, EnvironmentInjector, DOCUMENT as DOCUMENT$1, createEnvironmentInjector, createComponent, TemplateRef, linkedSignal, afterRenderEffect, contentChild, inputBinding, PLATFORM_ID, isDevMode, contentChildren } from '@angular/core';
|
|
3
3
|
import * as i2 from '@ethlete/core';
|
|
4
|
-
import { injectStyleManager, createCanAnimateSignal, ColorInteractiveDirective, ProvideColorDirective, RuntimeError, injectErrorTheme, signalElementDimensions, createProvider, AnimatableDirective, ColorInteractiveContainerDirective, ColorInteractiveExcludeDirective, ProvideSurfaceDirective, SURFACE_PROVIDER, injectSurfaceThemes, resolveSurfaceByElevation, ColorInteractiveHasFocusDirective, createStaticRootProvider, signalHostElementDimensions, DragHandleDirective,
|
|
5
|
-
import { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
|
|
4
|
+
import { injectStyleManager, SurfaceInteractiveDirective, createCanAnimateSignal, ColorInteractiveDirective, ProvideColorDirective, RuntimeError, injectErrorTheme, signalElementDimensions, createProvider, AnimatableDirective, ColorInteractiveContainerDirective, ColorInteractiveExcludeDirective, ProvideSurfaceDirective, SURFACE_PROVIDER, injectSurfaceThemes, resolveSurfaceByElevation, ColorInteractiveHasFocusDirective, injectRenderer, htmlToMarkdown, markdownToHtml, createStaticRootProvider, signalHostElementDimensions, DragHandleDirective, injectLocale, ResizeHandlesComponent, ANIMATED_LIFECYCLE_TOKEN, injectSurfaceContextTracker, AnimatedLifecycleDirective, createRootProvider, injectOverlayRuntime, typedBreakpointTransform, signalElementChildren, signalElementScrollState, signalElementIntersection, signalHostAttributes, signalHostClasses, signalHostStyles, getScrollContainerTarget, getScrollItemTarget, getElementScrollCoordinates, provideBreakpointInstance, signalClasses, useCursorDragScroll, signalStyles, getScrollSnapTarget, ScrollObserverDirective, ScrollObserverStartDirective, ScrollObserverEndDirective, injectViewportSize, createFlipAnimation, signalHostElementIntersection, injectHostElement, setInputSignal, injectRouterEvent, canUseSessionMemory, createAutoSessionMemoryKey, createSessionMemory, COLOR_PROVIDER, injectFocusVisibleTracker } from '@ethlete/core';
|
|
5
|
+
import { NgTemplateOutlet, DOCUMENT, NgComponentOutlet, isPlatformBrowser } from '@angular/common';
|
|
6
6
|
import { toObservable, takeUntilDestroyed, outputToObservable, outputFromObservable, rxResource } from '@angular/core/rxjs-interop';
|
|
7
|
-
import { switchMap, EMPTY, filter, tap, timer, take, of, animationFrameScheduler, Subject,
|
|
8
|
-
import { tap as tap$1 } from 'rxjs/operators';
|
|
7
|
+
import { switchMap, EMPTY, filter, tap, fromEvent, timer, take, of, animationFrameScheduler, Subject, debounceTime, map, exhaustMap, takeUntil, finalize, distinctUntilChanged, Observable, shareReplay, catchError, interval } from 'rxjs';
|
|
9
8
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
9
|
+
import { tap as tap$1 } from 'rxjs/operators';
|
|
10
10
|
import * as i1 from '@angular/router';
|
|
11
11
|
import { RouterLinkActive, NavigationEnd, RouterLink } from '@angular/router';
|
|
12
12
|
|
|
@@ -375,21 +375,27 @@ class ButtonDirective {
|
|
|
375
375
|
this.type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
376
376
|
this.pressed = input(false, { ...(ngDevMode ? { debugName: "pressed" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
377
377
|
this.emitAriaPressed = input(true, { ...(ngDevMode ? { debugName: "emitAriaPressed" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
378
|
+
// Opt-in: keep the button visually neutral (surface-themed) until it's pressed, only picking
|
|
379
|
+
// up the provided color theme once active — for toggle-style buttons (e.g. a formatting
|
|
380
|
+
// toolbar) where every button always being tinted by the ambient color theme reads as noise.
|
|
381
|
+
this.mutedUntilPressed = input(false, { ...(ngDevMode ? { debugName: "mutedUntilPressed" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
378
382
|
this.IS_BUTTON = this.elementRef.nativeElement.tagName === 'BUTTON';
|
|
379
383
|
this.IS_ANCHOR = this.elementRef.nativeElement.tagName === 'A';
|
|
380
384
|
this.isInactive = computed(() => this.disabled() || this.loading(), ...(ngDevMode ? [{ debugName: "isInactive" }] : /* istanbul ignore next */ []));
|
|
381
385
|
}
|
|
382
386
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
383
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: ButtonDirective, isStandalone: true, selector: "[etButton]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, emitAriaPressed: { classPropertyName: "emitAriaPressed", publicName: "emitAriaPressed", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-loading": "loading() ? true : null", "attr.data-pressed": "pressed() ? true : null", "attr.disabled": "IS_BUTTON && isInactive() ? \"\" : null", "attr.aria-busy": "loading() ? true : null", "attr.aria-disabled": "isInactive() ? true : null", "attr.aria-pressed": "emitAriaPressed() && pressed() ? true : null", "attr.type": "IS_BUTTON ? type() : null", "attr.tabindex": "IS_ANCHOR && isInactive() ? -1 : null" } }, exportAs: ["etButton"], ngImport: i0 }); }
|
|
387
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: ButtonDirective, isStandalone: true, selector: "[etButton]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, emitAriaPressed: { classPropertyName: "emitAriaPressed", publicName: "emitAriaPressed", isSignal: true, isRequired: false, transformFunction: null }, mutedUntilPressed: { classPropertyName: "mutedUntilPressed", publicName: "mutedUntilPressed", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-loading": "loading() ? true : null", "attr.data-pressed": "pressed() ? true : null", "attr.data-muted-until-pressed": "mutedUntilPressed() ? true : null", "attr.disabled": "IS_BUTTON && isInactive() ? \"\" : null", "attr.aria-busy": "loading() ? true : null", "attr.aria-disabled": "isInactive() ? true : null", "attr.aria-pressed": "emitAriaPressed() && pressed() ? true : null", "attr.type": "IS_BUTTON ? type() : null", "attr.tabindex": "IS_ANCHOR && isInactive() ? -1 : null" } }, exportAs: ["etButton"], hostDirectives: [{ directive: i2.SurfaceInteractiveDirective }], ngImport: i0 }); }
|
|
384
388
|
}
|
|
385
389
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ButtonDirective, decorators: [{
|
|
386
390
|
type: Directive,
|
|
387
391
|
args: [{
|
|
388
392
|
selector: '[etButton]',
|
|
389
393
|
exportAs: 'etButton',
|
|
394
|
+
hostDirectives: [SurfaceInteractiveDirective],
|
|
390
395
|
host: {
|
|
391
396
|
'[attr.data-loading]': 'loading() ? true : null',
|
|
392
397
|
'[attr.data-pressed]': 'pressed() ? true : null',
|
|
398
|
+
'[attr.data-muted-until-pressed]': 'mutedUntilPressed() ? true : null',
|
|
393
399
|
'[attr.disabled]': 'IS_BUTTON && isInactive() ? "" : null',
|
|
394
400
|
'[attr.aria-busy]': 'loading() ? true : null',
|
|
395
401
|
'[attr.aria-disabled]': 'isInactive() ? true : null',
|
|
@@ -398,7 +404,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
398
404
|
'[attr.tabindex]': 'IS_ANCHOR && isInactive() ? -1 : null',
|
|
399
405
|
},
|
|
400
406
|
}]
|
|
401
|
-
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], pressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressed", required: false }] }], emitAriaPressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "emitAriaPressed", required: false }] }] } });
|
|
407
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], pressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressed", required: false }] }], emitAriaPressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "emitAriaPressed", required: false }] }], mutedUntilPressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "mutedUntilPressed", required: false }] }] } });
|
|
402
408
|
|
|
403
409
|
const BUTTON_SIZES = {
|
|
404
410
|
XS: 'xs',
|
|
@@ -441,7 +447,7 @@ class ButtonComponent {
|
|
|
441
447
|
this.pressedVariant = computed(() => (this.buttonDir.pressed() ? PRESSED_VARIANT_MAP$2[this.variant()] : null), ...(ngDevMode ? [{ debugName: "pressedVariant" }] : /* istanbul ignore next */ []));
|
|
442
448
|
}
|
|
443
449
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
444
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: ButtonComponent, isStandalone: true, selector: "[et-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, iconAlignment: { classPropertyName: "iconAlignment", publicName: "iconAlignment", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-icon-alignment": "iconAlignment()", "attr.data-variant": "variant()", "attr.data-size": "size()", "attr.data-pressed-variant": "pressedVariant()", "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-button" }, hostDirectives: [{ directive: ButtonDirective, inputs: ["disabled", "disabled", "loading", "loading", "type", "type", "pressed", "pressed"] }, { directive: ButtonStylesDirective }, { directive: i2.ColorInteractiveDirective }, { directive: FocusRingDirective }, { directive: i2.ProvideColorDirective, inputs: ["etProvideColor", "color"] }], ngImport: i0, template: `
|
|
450
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: ButtonComponent, isStandalone: true, selector: "[et-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, iconAlignment: { classPropertyName: "iconAlignment", publicName: "iconAlignment", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-icon-alignment": "iconAlignment()", "attr.data-variant": "variant()", "attr.data-size": "size()", "attr.data-pressed-variant": "pressedVariant()", "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-button" }, hostDirectives: [{ directive: ButtonDirective, inputs: ["disabled", "disabled", "loading", "loading", "type", "type", "pressed", "pressed", "mutedUntilPressed", "mutedUntilPressed"] }, { directive: ButtonStylesDirective }, { directive: i2.ColorInteractiveDirective }, { directive: FocusRingDirective }, { directive: i2.ProvideColorDirective, inputs: ["etProvideColor", "color"] }], ngImport: i0, template: `
|
|
445
451
|
@if (iconAlignment() === 'start') {
|
|
446
452
|
<div class="et-button-icon">
|
|
447
453
|
<ng-container *ngTemplateOutlet="iconTpl" />
|
|
@@ -471,7 +477,7 @@ class ButtonComponent {
|
|
|
471
477
|
<ng-template #iconTpl>
|
|
472
478
|
<ng-content select="[etIcon]" />
|
|
473
479
|
</ng-template>
|
|
474
|
-
`, isInline: true, styles: [".et-button{--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-on-primary);--_et-button-border-color: transparent;display:inline-flex;position:relative;align-items:center;justify-content:center;gap:var(--et-button-gap);background:var(--_et-button-background);color:var(--_et-button-color);border-radius:var(--et-button-border-radius);padding:var(--et-button-padding);font-size:var(--et-button-font-size);font-weight:var(--et-button-font-weight);border:var(--et-button-border-width, .1rem) solid var(--_et-button-border-color);box-shadow:var(--et-button-shadow, 0 0 #0000);cursor:var(--et-button-cursor);text-decoration:none;appearance:none;box-sizing:border-box;-webkit-user-select:none;user-select:none;line-height:var(--et-button-line-height);white-space:nowrap}.et-button[data-can-animate]{transition:background .12s ease,color .12s ease,border-color .12s ease,box-shadow .12s ease,outline-color .12s ease,opacity .12s ease}.et-button:where([data-size=xs]){--et-button-padding: .2rem .8rem;--et-button-font-size: 1.2rem;--et-button-border-radius: .3rem;--et-button-gap: .4rem}.et-button:where([data-size=sm]){--et-button-padding: .4rem 1.2rem;--et-button-font-size: 1.4rem;--et-button-border-radius: .4rem;--et-button-gap: .5rem}.et-button:where([data-size=md]){--et-button-padding: .8rem 1.6rem;--et-button-font-size: 1.4rem;--et-button-border-radius: .4rem;--et-button-gap: .6rem}.et-button:where([data-size=lg]){--et-button-padding: 1rem 2rem;--et-button-font-size: 1.6rem;--et-button-border-radius: .6rem;--et-button-gap: .7rem}.et-button:where([data-size=xl]){--et-button-padding: 1.4rem 2.8rem;--et-button-font-size: 1.8rem;--et-button-border-radius: .8rem;--et-button-gap: .8rem}.et-button:where([disabled]),.et-button:where([aria-disabled=true]){cursor:not-allowed;pointer-events:none}.et-button:where([disabled],[aria-disabled=true]):where([data-variant=outline]),.et-button:where([disabled],[aria-disabled=true]):where([data-variant=tonal]),.et-button:where([disabled],[aria-disabled=true]):where([data-variant=transparent]),.et-button:where([disabled],[aria-disabled=true])[data-pressed=true]{opacity:var(--et-button-opacity-disabled)}.et-button:where([data-variant=outline]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: var(--et-theme-color-ink-solid)}.et-button:where([data-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-button:where([data-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button:where([data-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=outline]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: var(--et-theme-color-ink-solid)}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=outline])[data-loading=true]:not([disabled],[aria-disabled=true]){--_et-button-color: var(--et-theme-color-primary-solid);--_et-button-border-color: var(--et-theme-color-primary-solid)}.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal]){--et-theme-color-primary-opacity: .16;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: transparent}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):hover{--et-theme-color-primary-opacity: .24}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):focus-visible{--et-theme-color-primary-opacity: .28}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):active{--et-theme-color-primary-opacity: .32}.et-button:where([data-variant=transparent]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: transparent}.et-button:where([data-variant=transparent]):hover{--et-theme-color-primary-opacity: .08}.et-button:where([data-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button:where([data-variant=transparent]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=filled]){--et-theme-color-primary-opacity: 1;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-on-primary);--_et-button-border-color: transparent}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):hover{--et-theme-color-primary-opacity: 1}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):focus-visible{--et-theme-color-primary-opacity: 1}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):active{--et-theme-color-primary-opacity: 1}.et-button .et-button-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:opacity .12s ease}.et-button .et-button-icon:empty{display:none}.et-button .et-button-icon .et-icon{width:1em;height:1em}.et-button .et-button-contents{display:inline-flex;align-items:center;min-width:0;transition:opacity .12s ease}.et-button[data-loading=true] .et-button-icon,.et-button[data-loading=true] .et-button-contents{opacity:0}.et-button[data-loading=true] .et-button-loader{opacity:1}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SpinnerComponent, selector: "et-spinner", inputs: ["diameter", "strokeWidth", "track", "value", "determinate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
480
|
+
`, isInline: true, styles: [".et-button{--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-on-primary);--_et-button-border-color: transparent;display:inline-flex;position:relative;align-items:center;justify-content:center;gap:var(--et-button-gap);background:var(--_et-button-background);color:var(--_et-button-color);border-radius:var(--et-button-border-radius);padding:var(--et-button-padding);font-size:var(--et-button-font-size);font-weight:var(--et-button-font-weight);border:var(--et-button-border-width, .1rem) solid var(--_et-button-border-color);box-shadow:var(--et-button-shadow, 0 0 #0000);cursor:var(--et-button-cursor);text-decoration:none;appearance:none;box-sizing:border-box;-webkit-user-select:none;user-select:none;line-height:var(--et-button-line-height);white-space:nowrap}.et-button[data-can-animate]{transition:background .12s ease,color .12s ease,border-color .12s ease,box-shadow .12s ease,outline-color .12s ease,opacity .12s ease}.et-button:where([data-size=xs]){--et-button-padding: .2rem .8rem;--et-button-font-size: 1.2rem;--et-button-border-radius: .3rem;--et-button-gap: .4rem}.et-button:where([data-size=sm]){--et-button-padding: .4rem 1.2rem;--et-button-font-size: 1.4rem;--et-button-border-radius: .4rem;--et-button-gap: .5rem}.et-button:where([data-size=md]){--et-button-padding: .8rem 1.6rem;--et-button-font-size: 1.4rem;--et-button-border-radius: .4rem;--et-button-gap: .6rem}.et-button:where([data-size=lg]){--et-button-padding: 1rem 2rem;--et-button-font-size: 1.6rem;--et-button-border-radius: .6rem;--et-button-gap: .7rem}.et-button:where([data-size=xl]){--et-button-padding: 1.4rem 2.8rem;--et-button-font-size: 1.8rem;--et-button-border-radius: .8rem;--et-button-gap: .8rem}.et-button:where([disabled]),.et-button:where([aria-disabled=true]){cursor:not-allowed;pointer-events:none}.et-button:where([disabled],[aria-disabled=true]):where([data-variant=outline]),.et-button:where([disabled],[aria-disabled=true]):where([data-variant=tonal]),.et-button:where([disabled],[aria-disabled=true]):where([data-variant=transparent]),.et-button:where([disabled],[aria-disabled=true])[data-pressed=true]{opacity:var(--et-button-opacity-disabled)}.et-button:where([data-variant=outline]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: var(--et-theme-color-ink-solid)}.et-button:where([data-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-button:where([data-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button:where([data-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=outline]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: var(--et-theme-color-ink-solid)}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=outline])[data-loading=true]:not([disabled],[aria-disabled=true]){--_et-button-color: var(--et-theme-color-primary-solid);--_et-button-border-color: var(--et-theme-color-primary-solid)}.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal]){--et-theme-color-primary-opacity: .16;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: transparent}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):hover{--et-theme-color-primary-opacity: .24}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):focus-visible{--et-theme-color-primary-opacity: .28}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):active{--et-theme-color-primary-opacity: .32}.et-button:where([data-variant=transparent]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: transparent}.et-button:where([data-variant=transparent]):hover{--et-theme-color-primary-opacity: .08}.et-button:where([data-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button:where([data-variant=transparent]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=filled]){--et-theme-color-primary-opacity: 1;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-on-primary);--_et-button-border-color: transparent}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):hover{--et-theme-color-primary-opacity: 1}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):focus-visible{--et-theme-color-primary-opacity: 1}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):active{--et-theme-color-primary-opacity: 1}.et-button[data-muted-until-pressed]:not([data-pressed=true]){--_et-button-background: transparent;--_et-button-color: currentColor;--_et-button-border-color: transparent}.et-button[data-muted-until-pressed]:not([data-pressed=true]):hover:not([disabled]):not([aria-disabled=true]){--_et-button-background: color-mix(in srgb, var(--et-surface-interaction-solid) 12%, transparent)}.et-button[data-muted-until-pressed]:not([data-pressed=true]):focus-visible{--_et-button-background: color-mix(in srgb, var(--et-surface-interaction-solid) 16%, transparent)}.et-button[data-muted-until-pressed]:not([data-pressed=true]):active{--_et-button-background: color-mix(in srgb, var(--et-surface-interaction-solid) 20%, transparent)}.et-button .et-button-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:opacity .12s ease}.et-button .et-button-icon:empty{display:none}.et-button .et-button-icon .et-icon{width:1em;height:1em}.et-button .et-button-contents{display:inline-flex;align-items:center;min-width:0;transition:opacity .12s ease}.et-button[data-loading=true] .et-button-icon,.et-button[data-loading=true] .et-button-contents{opacity:0}.et-button[data-loading=true] .et-button-loader{opacity:1}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SpinnerComponent, selector: "et-spinner", inputs: ["diameter", "strokeWidth", "track", "value", "determinate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
475
481
|
}
|
|
476
482
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
477
483
|
type: Component,
|
|
@@ -508,7 +514,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
508
514
|
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, SpinnerComponent], hostDirectives: [
|
|
509
515
|
{
|
|
510
516
|
directive: ButtonDirective,
|
|
511
|
-
inputs: ['disabled', 'loading', 'type', 'pressed'],
|
|
517
|
+
inputs: ['disabled', 'loading', 'type', 'pressed', 'mutedUntilPressed'],
|
|
512
518
|
},
|
|
513
519
|
ButtonStylesDirective,
|
|
514
520
|
ColorInteractiveDirective,
|
|
@@ -524,7 +530,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
524
530
|
'[attr.data-size]': 'size()',
|
|
525
531
|
'[attr.data-pressed-variant]': 'pressedVariant()',
|
|
526
532
|
'[attr.data-can-animate]': 'canAnimate.state() || null',
|
|
527
|
-
}, styles: [".et-button{--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-on-primary);--_et-button-border-color: transparent;display:inline-flex;position:relative;align-items:center;justify-content:center;gap:var(--et-button-gap);background:var(--_et-button-background);color:var(--_et-button-color);border-radius:var(--et-button-border-radius);padding:var(--et-button-padding);font-size:var(--et-button-font-size);font-weight:var(--et-button-font-weight);border:var(--et-button-border-width, .1rem) solid var(--_et-button-border-color);box-shadow:var(--et-button-shadow, 0 0 #0000);cursor:var(--et-button-cursor);text-decoration:none;appearance:none;box-sizing:border-box;-webkit-user-select:none;user-select:none;line-height:var(--et-button-line-height);white-space:nowrap}.et-button[data-can-animate]{transition:background .12s ease,color .12s ease,border-color .12s ease,box-shadow .12s ease,outline-color .12s ease,opacity .12s ease}.et-button:where([data-size=xs]){--et-button-padding: .2rem .8rem;--et-button-font-size: 1.2rem;--et-button-border-radius: .3rem;--et-button-gap: .4rem}.et-button:where([data-size=sm]){--et-button-padding: .4rem 1.2rem;--et-button-font-size: 1.4rem;--et-button-border-radius: .4rem;--et-button-gap: .5rem}.et-button:where([data-size=md]){--et-button-padding: .8rem 1.6rem;--et-button-font-size: 1.4rem;--et-button-border-radius: .4rem;--et-button-gap: .6rem}.et-button:where([data-size=lg]){--et-button-padding: 1rem 2rem;--et-button-font-size: 1.6rem;--et-button-border-radius: .6rem;--et-button-gap: .7rem}.et-button:where([data-size=xl]){--et-button-padding: 1.4rem 2.8rem;--et-button-font-size: 1.8rem;--et-button-border-radius: .8rem;--et-button-gap: .8rem}.et-button:where([disabled]),.et-button:where([aria-disabled=true]){cursor:not-allowed;pointer-events:none}.et-button:where([disabled],[aria-disabled=true]):where([data-variant=outline]),.et-button:where([disabled],[aria-disabled=true]):where([data-variant=tonal]),.et-button:where([disabled],[aria-disabled=true]):where([data-variant=transparent]),.et-button:where([disabled],[aria-disabled=true])[data-pressed=true]{opacity:var(--et-button-opacity-disabled)}.et-button:where([data-variant=outline]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: var(--et-theme-color-ink-solid)}.et-button:where([data-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-button:where([data-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button:where([data-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=outline]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: var(--et-theme-color-ink-solid)}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=outline])[data-loading=true]:not([disabled],[aria-disabled=true]){--_et-button-color: var(--et-theme-color-primary-solid);--_et-button-border-color: var(--et-theme-color-primary-solid)}.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal]){--et-theme-color-primary-opacity: .16;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: transparent}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):hover{--et-theme-color-primary-opacity: .24}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):focus-visible{--et-theme-color-primary-opacity: .28}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):active{--et-theme-color-primary-opacity: .32}.et-button:where([data-variant=transparent]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: transparent}.et-button:where([data-variant=transparent]):hover{--et-theme-color-primary-opacity: .08}.et-button:where([data-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button:where([data-variant=transparent]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=filled]){--et-theme-color-primary-opacity: 1;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-on-primary);--_et-button-border-color: transparent}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):hover{--et-theme-color-primary-opacity: 1}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):focus-visible{--et-theme-color-primary-opacity: 1}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):active{--et-theme-color-primary-opacity: 1}.et-button .et-button-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:opacity .12s ease}.et-button .et-button-icon:empty{display:none}.et-button .et-button-icon .et-icon{width:1em;height:1em}.et-button .et-button-contents{display:inline-flex;align-items:center;min-width:0;transition:opacity .12s ease}.et-button[data-loading=true] .et-button-icon,.et-button[data-loading=true] .et-button-contents{opacity:0}.et-button[data-loading=true] .et-button-loader{opacity:1}\n"] }]
|
|
533
|
+
}, styles: [".et-button{--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-on-primary);--_et-button-border-color: transparent;display:inline-flex;position:relative;align-items:center;justify-content:center;gap:var(--et-button-gap);background:var(--_et-button-background);color:var(--_et-button-color);border-radius:var(--et-button-border-radius);padding:var(--et-button-padding);font-size:var(--et-button-font-size);font-weight:var(--et-button-font-weight);border:var(--et-button-border-width, .1rem) solid var(--_et-button-border-color);box-shadow:var(--et-button-shadow, 0 0 #0000);cursor:var(--et-button-cursor);text-decoration:none;appearance:none;box-sizing:border-box;-webkit-user-select:none;user-select:none;line-height:var(--et-button-line-height);white-space:nowrap}.et-button[data-can-animate]{transition:background .12s ease,color .12s ease,border-color .12s ease,box-shadow .12s ease,outline-color .12s ease,opacity .12s ease}.et-button:where([data-size=xs]){--et-button-padding: .2rem .8rem;--et-button-font-size: 1.2rem;--et-button-border-radius: .3rem;--et-button-gap: .4rem}.et-button:where([data-size=sm]){--et-button-padding: .4rem 1.2rem;--et-button-font-size: 1.4rem;--et-button-border-radius: .4rem;--et-button-gap: .5rem}.et-button:where([data-size=md]){--et-button-padding: .8rem 1.6rem;--et-button-font-size: 1.4rem;--et-button-border-radius: .4rem;--et-button-gap: .6rem}.et-button:where([data-size=lg]){--et-button-padding: 1rem 2rem;--et-button-font-size: 1.6rem;--et-button-border-radius: .6rem;--et-button-gap: .7rem}.et-button:where([data-size=xl]){--et-button-padding: 1.4rem 2.8rem;--et-button-font-size: 1.8rem;--et-button-border-radius: .8rem;--et-button-gap: .8rem}.et-button:where([disabled]),.et-button:where([aria-disabled=true]){cursor:not-allowed;pointer-events:none}.et-button:where([disabled],[aria-disabled=true]):where([data-variant=outline]),.et-button:where([disabled],[aria-disabled=true]):where([data-variant=tonal]),.et-button:where([disabled],[aria-disabled=true]):where([data-variant=transparent]),.et-button:where([disabled],[aria-disabled=true])[data-pressed=true]{opacity:var(--et-button-opacity-disabled)}.et-button:where([data-variant=outline]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: var(--et-theme-color-ink-solid)}.et-button:where([data-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-button:where([data-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button:where([data-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=outline]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: var(--et-theme-color-ink-solid)}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button[data-pressed=true]:where([data-pressed-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=outline])[data-loading=true]:not([disabled],[aria-disabled=true]){--_et-button-color: var(--et-theme-color-primary-solid);--_et-button-border-color: var(--et-theme-color-primary-solid)}.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal]){--et-theme-color-primary-opacity: .16;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: transparent}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):hover{--et-theme-color-primary-opacity: .24}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):focus-visible{--et-theme-color-primary-opacity: .28}:is(.et-button:where([data-variant=tonal]),.et-button[data-pressed=true]:where([data-pressed-variant=tonal])):active{--et-theme-color-primary-opacity: .32}.et-button:where([data-variant=transparent]){--et-theme-color-primary-opacity: 0;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-ink-solid);--_et-button-border-color: transparent}.et-button:where([data-variant=transparent]):hover{--et-theme-color-primary-opacity: .08}.et-button:where([data-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .12}.et-button:where([data-variant=transparent]):active{--et-theme-color-primary-opacity: .16}.et-button[data-pressed=true]:where([data-pressed-variant=filled]){--et-theme-color-primary-opacity: 1;--_et-button-background: var(--et-theme-color-primary);--_et-button-color: var(--et-theme-color-on-primary);--_et-button-border-color: transparent}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):hover{--et-theme-color-primary-opacity: 1}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):focus-visible{--et-theme-color-primary-opacity: 1}.et-button[data-pressed=true]:where([data-pressed-variant=filled]):active{--et-theme-color-primary-opacity: 1}.et-button[data-muted-until-pressed]:not([data-pressed=true]){--_et-button-background: transparent;--_et-button-color: currentColor;--_et-button-border-color: transparent}.et-button[data-muted-until-pressed]:not([data-pressed=true]):hover:not([disabled]):not([aria-disabled=true]){--_et-button-background: color-mix(in srgb, var(--et-surface-interaction-solid) 12%, transparent)}.et-button[data-muted-until-pressed]:not([data-pressed=true]):focus-visible{--_et-button-background: color-mix(in srgb, var(--et-surface-interaction-solid) 16%, transparent)}.et-button[data-muted-until-pressed]:not([data-pressed=true]):active{--_et-button-background: color-mix(in srgb, var(--et-surface-interaction-solid) 20%, transparent)}.et-button .et-button-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:opacity .12s ease}.et-button .et-button-icon:empty{display:none}.et-button .et-button-icon .et-icon{width:1em;height:1em}.et-button .et-button-contents{display:inline-flex;align-items:center;min-width:0;transition:opacity .12s ease}.et-button[data-loading=true] .et-button-icon,.et-button[data-loading=true] .et-button-contents{opacity:0}.et-button[data-loading=true] .et-button-loader{opacity:1}\n"] }]
|
|
528
534
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], iconAlignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconAlignment", required: false }] }] } });
|
|
529
535
|
|
|
530
536
|
class FabComponent {
|
|
@@ -636,7 +642,7 @@ class IconButtonComponent {
|
|
|
636
642
|
this.pressedVariant = computed(() => (this.buttonDir.pressed() ? PRESSED_VARIANT_MAP$1[this.variant()] : null), ...(ngDevMode ? [{ debugName: "pressedVariant" }] : /* istanbul ignore next */ []));
|
|
637
643
|
}
|
|
638
644
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
639
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: IconButtonComponent, isStandalone: true, selector: "[et-icon-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-variant": "variant()", "attr.data-size": "size()", "attr.data-pressed-variant": "pressedVariant()", "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-icon-button" }, hostDirectives: [{ directive: ButtonDirective, inputs: ["disabled", "disabled", "loading", "loading", "type", "type", "pressed", "pressed"] }, { directive: ButtonStylesDirective }, { directive: i2.ColorInteractiveDirective }, { directive: FocusRingDirective }, { directive: i2.ProvideColorDirective, inputs: ["etProvideColor", "color"] }], ngImport: i0, template: `
|
|
645
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: IconButtonComponent, isStandalone: true, selector: "[et-icon-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-variant": "variant()", "attr.data-size": "size()", "attr.data-pressed-variant": "pressedVariant()", "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-icon-button" }, hostDirectives: [{ directive: ButtonDirective, inputs: ["disabled", "disabled", "loading", "loading", "type", "type", "pressed", "pressed", "mutedUntilPressed", "mutedUntilPressed"] }, { directive: ButtonStylesDirective }, { directive: i2.ColorInteractiveDirective }, { directive: FocusRingDirective }, { directive: i2.ProvideColorDirective, inputs: ["etProvideColor", "color"] }], ngImport: i0, template: `
|
|
640
646
|
<div class="et-icon-button-icon">
|
|
641
647
|
<ng-content select="[etIcon]" />
|
|
642
648
|
</div>
|
|
@@ -650,7 +656,7 @@ class IconButtonComponent {
|
|
|
650
656
|
/>
|
|
651
657
|
</div>
|
|
652
658
|
}
|
|
653
|
-
`, isInline: true, styles: ["@property --_et-icon-button-icon-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}.et-icon-button{display:inline-flex;position:relative;align-items:center;justify-content:center;background:var(--et-theme-color-primary);color:var(--et-theme-color-ink-solid);border:none;border-radius:9999px;padding:0;font-size:var(--et-button-font-size);cursor:var(--et-button-cursor);appearance:none;box-sizing:border-box;-webkit-user-select:none;user-select:none;overflow:hidden;flex-shrink:0;--et-theme-color-primary-opacity: 0}.et-icon-button[data-can-animate]{transition:background .12s ease,color .12s ease,box-shadow .12s ease,outline-color .12s ease,opacity .12s ease}.et-icon-button:where([data-size=xs]){width:2.8rem;height:2.8rem;--_et-icon-button-icon-size: 1.4rem}.et-icon-button:where([data-size=sm]){width:3.6rem;height:3.6rem;--_et-icon-button-icon-size: 1.8rem}.et-icon-button:where([data-size=md]){width:4rem;height:4rem;--_et-icon-button-icon-size: 2rem}.et-icon-button:where([data-size=lg]){width:4.8rem;height:4.8rem;--_et-icon-button-icon-size: 2.4rem}.et-icon-button:where([data-size=xl]){width:5.6rem;height:5.6rem;--_et-icon-button-icon-size: 2.8rem}.et-icon-button:where([disabled]),.et-icon-button:where([aria-disabled=true]){opacity:var(--et-button-opacity-disabled);cursor:not-allowed;pointer-events:none}.et-icon-button:where([data-variant=filled]){--et-theme-color-primary-opacity: 1;color:var(--et-theme-color-on-primary)}.et-icon-button:where([data-variant=filled]):hover{--et-theme-color-primary-opacity: .92}.et-icon-button:where([data-variant=filled]):focus-visible{--et-theme-color-primary-opacity: .88}.et-icon-button:where([data-variant=filled]):active{--et-theme-color-primary-opacity: .84}.et-icon-button:where([data-variant=outline]){--et-theme-color-primary-opacity: 0;border:var(--et-button-border-width, .1rem) solid var(--et-theme-color-ink-solid)}.et-icon-button:where([data-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-icon-button:where([data-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-icon-button:where([data-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-icon-button:where([data-variant=tonal]){--et-theme-color-primary-opacity: .16}.et-icon-button:where([data-variant=tonal]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button:where([data-variant=tonal]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button:where([data-variant=tonal]):active{--et-theme-color-primary-opacity: .32}.et-icon-button:where([data-variant=transparent]){--et-theme-color-primary-opacity: 0}.et-icon-button:where([data-variant=transparent]):hover{--et-theme-color-primary-opacity: .08}.et-icon-button:where([data-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .12}.et-icon-button:where([data-variant=transparent]):active{--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]){--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):active{--et-theme-color-primary-opacity: .32}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]){--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):active{--et-theme-color-primary-opacity: .32}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]){--et-theme-color-primary-opacity: 1;color:var(--et-theme-color-on-primary)}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):hover{--et-theme-color-primary-opacity: .92}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):focus-visible{--et-theme-color-primary-opacity: .88}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):active{--et-theme-color-primary-opacity: .84}.et-icon-button .et-icon-button-icon{display:flex;align-items:center;justify-content:center;width:100%;height:100%;transition:opacity .12s ease}.et-icon-button .et-icon-button-icon .et-icon{width:var(--_et-icon-button-icon-size);height:var(--_et-icon-button-icon-size)}.et-icon-button[data-loading=true] .et-icon-button-icon{opacity:0}.et-icon-button[data-loading=true] .et-button-loader{opacity:1}\n"], dependencies: [{ kind: "component", type: SpinnerComponent, selector: "et-spinner", inputs: ["diameter", "strokeWidth", "track", "value", "determinate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
659
|
+
`, isInline: true, styles: ["@property --_et-icon-button-icon-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}.et-icon-button{display:inline-flex;position:relative;align-items:center;justify-content:center;background:var(--et-theme-color-primary);color:var(--et-theme-color-ink-solid);border:none;border-radius:9999px;padding:0;font-size:var(--et-button-font-size);cursor:var(--et-button-cursor);appearance:none;box-sizing:border-box;-webkit-user-select:none;user-select:none;overflow:hidden;flex-shrink:0;--et-theme-color-primary-opacity: 0}.et-icon-button[data-can-animate]{transition:background .12s ease,color .12s ease,box-shadow .12s ease,outline-color .12s ease,opacity .12s ease}.et-icon-button:where([data-size=xs]){width:2.8rem;height:2.8rem;--_et-icon-button-icon-size: 1.4rem}.et-icon-button:where([data-size=sm]){width:3.6rem;height:3.6rem;--_et-icon-button-icon-size: 1.8rem}.et-icon-button:where([data-size=md]){width:4rem;height:4rem;--_et-icon-button-icon-size: 2rem}.et-icon-button:where([data-size=lg]){width:4.8rem;height:4.8rem;--_et-icon-button-icon-size: 2.4rem}.et-icon-button:where([data-size=xl]){width:5.6rem;height:5.6rem;--_et-icon-button-icon-size: 2.8rem}.et-icon-button:where([disabled]),.et-icon-button:where([aria-disabled=true]){opacity:var(--et-button-opacity-disabled);cursor:not-allowed;pointer-events:none}.et-icon-button:where([data-variant=filled]){--et-theme-color-primary-opacity: 1;color:var(--et-theme-color-on-primary)}.et-icon-button:where([data-variant=filled]):hover{--et-theme-color-primary-opacity: .92}.et-icon-button:where([data-variant=filled]):focus-visible{--et-theme-color-primary-opacity: .88}.et-icon-button:where([data-variant=filled]):active{--et-theme-color-primary-opacity: .84}.et-icon-button:where([data-variant=outline]){--et-theme-color-primary-opacity: 0;border:var(--et-button-border-width, .1rem) solid var(--et-theme-color-ink-solid)}.et-icon-button:where([data-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-icon-button:where([data-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-icon-button:where([data-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-icon-button:where([data-variant=tonal]){--et-theme-color-primary-opacity: .16}.et-icon-button:where([data-variant=tonal]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button:where([data-variant=tonal]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button:where([data-variant=tonal]):active{--et-theme-color-primary-opacity: .32}.et-icon-button:where([data-variant=transparent]){--et-theme-color-primary-opacity: 0}.et-icon-button:where([data-variant=transparent]):hover{--et-theme-color-primary-opacity: .08}.et-icon-button:where([data-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .12}.et-icon-button:where([data-variant=transparent]):active{--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]){--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):active{--et-theme-color-primary-opacity: .32}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]){--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):active{--et-theme-color-primary-opacity: .32}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]){--et-theme-color-primary-opacity: 1;color:var(--et-theme-color-on-primary)}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):hover{--et-theme-color-primary-opacity: .92}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):focus-visible{--et-theme-color-primary-opacity: .88}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):active{--et-theme-color-primary-opacity: .84}.et-icon-button[data-muted-until-pressed]:not([data-pressed=true]){background:transparent;color:currentColor}.et-icon-button[data-muted-until-pressed]:not([data-pressed=true]):hover:not([disabled]):not([aria-disabled=true]){background:color-mix(in srgb,var(--et-surface-interaction-solid) 12%,transparent)}.et-icon-button[data-muted-until-pressed]:not([data-pressed=true]):focus-visible{background:color-mix(in srgb,var(--et-surface-interaction-solid) 16%,transparent)}.et-icon-button[data-muted-until-pressed]:not([data-pressed=true]):active{background:color-mix(in srgb,var(--et-surface-interaction-solid) 20%,transparent)}.et-icon-button .et-icon-button-icon{display:flex;align-items:center;justify-content:center;width:100%;height:100%;transition:opacity .12s ease}.et-icon-button .et-icon-button-icon .et-icon{width:var(--_et-icon-button-icon-size);height:var(--_et-icon-button-icon-size)}.et-icon-button[data-loading=true] .et-icon-button-icon{opacity:0}.et-icon-button[data-loading=true] .et-button-loader{opacity:1}\n"], dependencies: [{ kind: "component", type: SpinnerComponent, selector: "et-spinner", inputs: ["diameter", "strokeWidth", "track", "value", "determinate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
654
660
|
}
|
|
655
661
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
656
662
|
type: Component,
|
|
@@ -671,7 +677,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
671
677
|
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SpinnerComponent], hostDirectives: [
|
|
672
678
|
{
|
|
673
679
|
directive: ButtonDirective,
|
|
674
|
-
inputs: ['disabled', 'loading', 'type', 'pressed'],
|
|
680
|
+
inputs: ['disabled', 'loading', 'type', 'pressed', 'mutedUntilPressed'],
|
|
675
681
|
},
|
|
676
682
|
ButtonStylesDirective,
|
|
677
683
|
ColorInteractiveDirective,
|
|
@@ -686,7 +692,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
686
692
|
'[attr.data-size]': 'size()',
|
|
687
693
|
'[attr.data-pressed-variant]': 'pressedVariant()',
|
|
688
694
|
'[attr.data-can-animate]': 'canAnimate.state() || null',
|
|
689
|
-
}, styles: ["@property --_et-icon-button-icon-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}.et-icon-button{display:inline-flex;position:relative;align-items:center;justify-content:center;background:var(--et-theme-color-primary);color:var(--et-theme-color-ink-solid);border:none;border-radius:9999px;padding:0;font-size:var(--et-button-font-size);cursor:var(--et-button-cursor);appearance:none;box-sizing:border-box;-webkit-user-select:none;user-select:none;overflow:hidden;flex-shrink:0;--et-theme-color-primary-opacity: 0}.et-icon-button[data-can-animate]{transition:background .12s ease,color .12s ease,box-shadow .12s ease,outline-color .12s ease,opacity .12s ease}.et-icon-button:where([data-size=xs]){width:2.8rem;height:2.8rem;--_et-icon-button-icon-size: 1.4rem}.et-icon-button:where([data-size=sm]){width:3.6rem;height:3.6rem;--_et-icon-button-icon-size: 1.8rem}.et-icon-button:where([data-size=md]){width:4rem;height:4rem;--_et-icon-button-icon-size: 2rem}.et-icon-button:where([data-size=lg]){width:4.8rem;height:4.8rem;--_et-icon-button-icon-size: 2.4rem}.et-icon-button:where([data-size=xl]){width:5.6rem;height:5.6rem;--_et-icon-button-icon-size: 2.8rem}.et-icon-button:where([disabled]),.et-icon-button:where([aria-disabled=true]){opacity:var(--et-button-opacity-disabled);cursor:not-allowed;pointer-events:none}.et-icon-button:where([data-variant=filled]){--et-theme-color-primary-opacity: 1;color:var(--et-theme-color-on-primary)}.et-icon-button:where([data-variant=filled]):hover{--et-theme-color-primary-opacity: .92}.et-icon-button:where([data-variant=filled]):focus-visible{--et-theme-color-primary-opacity: .88}.et-icon-button:where([data-variant=filled]):active{--et-theme-color-primary-opacity: .84}.et-icon-button:where([data-variant=outline]){--et-theme-color-primary-opacity: 0;border:var(--et-button-border-width, .1rem) solid var(--et-theme-color-ink-solid)}.et-icon-button:where([data-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-icon-button:where([data-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-icon-button:where([data-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-icon-button:where([data-variant=tonal]){--et-theme-color-primary-opacity: .16}.et-icon-button:where([data-variant=tonal]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button:where([data-variant=tonal]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button:where([data-variant=tonal]):active{--et-theme-color-primary-opacity: .32}.et-icon-button:where([data-variant=transparent]){--et-theme-color-primary-opacity: 0}.et-icon-button:where([data-variant=transparent]):hover{--et-theme-color-primary-opacity: .08}.et-icon-button:where([data-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .12}.et-icon-button:where([data-variant=transparent]):active{--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]){--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):active{--et-theme-color-primary-opacity: .32}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]){--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):active{--et-theme-color-primary-opacity: .32}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]){--et-theme-color-primary-opacity: 1;color:var(--et-theme-color-on-primary)}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):hover{--et-theme-color-primary-opacity: .92}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):focus-visible{--et-theme-color-primary-opacity: .88}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):active{--et-theme-color-primary-opacity: .84}.et-icon-button .et-icon-button-icon{display:flex;align-items:center;justify-content:center;width:100%;height:100%;transition:opacity .12s ease}.et-icon-button .et-icon-button-icon .et-icon{width:var(--_et-icon-button-icon-size);height:var(--_et-icon-button-icon-size)}.et-icon-button[data-loading=true] .et-icon-button-icon{opacity:0}.et-icon-button[data-loading=true] .et-button-loader{opacity:1}\n"] }]
|
|
695
|
+
}, styles: ["@property --_et-icon-button-icon-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}.et-icon-button{display:inline-flex;position:relative;align-items:center;justify-content:center;background:var(--et-theme-color-primary);color:var(--et-theme-color-ink-solid);border:none;border-radius:9999px;padding:0;font-size:var(--et-button-font-size);cursor:var(--et-button-cursor);appearance:none;box-sizing:border-box;-webkit-user-select:none;user-select:none;overflow:hidden;flex-shrink:0;--et-theme-color-primary-opacity: 0}.et-icon-button[data-can-animate]{transition:background .12s ease,color .12s ease,box-shadow .12s ease,outline-color .12s ease,opacity .12s ease}.et-icon-button:where([data-size=xs]){width:2.8rem;height:2.8rem;--_et-icon-button-icon-size: 1.4rem}.et-icon-button:where([data-size=sm]){width:3.6rem;height:3.6rem;--_et-icon-button-icon-size: 1.8rem}.et-icon-button:where([data-size=md]){width:4rem;height:4rem;--_et-icon-button-icon-size: 2rem}.et-icon-button:where([data-size=lg]){width:4.8rem;height:4.8rem;--_et-icon-button-icon-size: 2.4rem}.et-icon-button:where([data-size=xl]){width:5.6rem;height:5.6rem;--_et-icon-button-icon-size: 2.8rem}.et-icon-button:where([disabled]),.et-icon-button:where([aria-disabled=true]){opacity:var(--et-button-opacity-disabled);cursor:not-allowed;pointer-events:none}.et-icon-button:where([data-variant=filled]){--et-theme-color-primary-opacity: 1;color:var(--et-theme-color-on-primary)}.et-icon-button:where([data-variant=filled]):hover{--et-theme-color-primary-opacity: .92}.et-icon-button:where([data-variant=filled]):focus-visible{--et-theme-color-primary-opacity: .88}.et-icon-button:where([data-variant=filled]):active{--et-theme-color-primary-opacity: .84}.et-icon-button:where([data-variant=outline]){--et-theme-color-primary-opacity: 0;border:var(--et-button-border-width, .1rem) solid var(--et-theme-color-ink-solid)}.et-icon-button:where([data-variant=outline]):hover{--et-theme-color-primary-opacity: .08}.et-icon-button:where([data-variant=outline]):focus-visible{--et-theme-color-primary-opacity: .12}.et-icon-button:where([data-variant=outline]):active{--et-theme-color-primary-opacity: .16}.et-icon-button:where([data-variant=tonal]){--et-theme-color-primary-opacity: .16}.et-icon-button:where([data-variant=tonal]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button:where([data-variant=tonal]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button:where([data-variant=tonal]):active{--et-theme-color-primary-opacity: .32}.et-icon-button:where([data-variant=transparent]){--et-theme-color-primary-opacity: 0}.et-icon-button:where([data-variant=transparent]):hover{--et-theme-color-primary-opacity: .08}.et-icon-button:where([data-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .12}.et-icon-button:where([data-variant=transparent]):active{--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]){--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button[data-pressed=true]:where([data-pressed-variant=transparent]):active{--et-theme-color-primary-opacity: .32}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]){--et-theme-color-primary-opacity: .16}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):hover{--et-theme-color-primary-opacity: .24}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):focus-visible{--et-theme-color-primary-opacity: .28}.et-icon-button[data-pressed=true]:where([data-pressed-variant=tonal]):active{--et-theme-color-primary-opacity: .32}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]){--et-theme-color-primary-opacity: 1;color:var(--et-theme-color-on-primary)}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):hover{--et-theme-color-primary-opacity: .92}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):focus-visible{--et-theme-color-primary-opacity: .88}.et-icon-button[data-pressed=true]:where([data-pressed-variant=filled]):active{--et-theme-color-primary-opacity: .84}.et-icon-button[data-muted-until-pressed]:not([data-pressed=true]){background:transparent;color:currentColor}.et-icon-button[data-muted-until-pressed]:not([data-pressed=true]):hover:not([disabled]):not([aria-disabled=true]){background:color-mix(in srgb,var(--et-surface-interaction-solid) 12%,transparent)}.et-icon-button[data-muted-until-pressed]:not([data-pressed=true]):focus-visible{background:color-mix(in srgb,var(--et-surface-interaction-solid) 16%,transparent)}.et-icon-button[data-muted-until-pressed]:not([data-pressed=true]):active{background:color-mix(in srgb,var(--et-surface-interaction-solid) 20%,transparent)}.et-icon-button .et-icon-button-icon{display:flex;align-items:center;justify-content:center;width:100%;height:100%;transition:opacity .12s ease}.et-icon-button .et-icon-button-icon .et-icon{width:var(--_et-icon-button-icon-size);height:var(--_et-icon-button-icon-size)}.et-icon-button[data-loading=true] .et-icon-button-icon{opacity:0}.et-icon-button[data-loading=true] .et-button-loader{opacity:1}\n"] }]
|
|
690
696
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
691
697
|
|
|
692
698
|
class TextButtonComponent {
|
|
@@ -872,6 +878,7 @@ const FORM_FIELD_ERROR_CODES = {
|
|
|
872
878
|
|
|
873
879
|
const FORM_FIELD_CONTROL_TYPES = {
|
|
874
880
|
TEXT_INPUT: 'text-input',
|
|
881
|
+
RICH_TEXT: 'rich-text',
|
|
875
882
|
CHECKBOX: 'checkbox',
|
|
876
883
|
RADIO: 'radio',
|
|
877
884
|
SWITCH: 'switch',
|
|
@@ -911,7 +918,8 @@ class FormFieldDirective {
|
|
|
911
918
|
this.controlType = computed(() => this.registeredControl()?.controlType() ?? FORM_FIELD_CONTROL_TYPES.TEXT_INPUT, ...(ngDevMode ? [{ debugName: "controlType" }] : /* istanbul ignore next */ []));
|
|
912
919
|
this.focused = computed(() => this.registeredControl()?.focused?.() ?? false, ...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
|
|
913
920
|
this.hasValue = computed(() => this.registeredControl()?.hasValue?.() ?? false, ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
914
|
-
this.usesTextFieldShell = computed(() => this.controlType() === FORM_FIELD_CONTROL_TYPES.TEXT_INPUT
|
|
921
|
+
this.usesTextFieldShell = computed(() => this.controlType() === FORM_FIELD_CONTROL_TYPES.TEXT_INPUT ||
|
|
922
|
+
this.controlType() === FORM_FIELD_CONTROL_TYPES.RICH_TEXT, ...(ngDevMode ? [{ debugName: "usesTextFieldShell" }] : /* istanbul ignore next */ []));
|
|
915
923
|
this.shouldFloatLabel = computed(() => this.focused() || this.hasValue(), ...(ngDevMode ? [{ debugName: "shouldFloatLabel" }] : /* istanbul ignore next */ []));
|
|
916
924
|
this.describedById = computed(() => {
|
|
917
925
|
if (this.shouldDisplayError() && this.errors().length > 0) {
|
|
@@ -1278,7 +1286,7 @@ class CheckboxComponent {
|
|
|
1278
1286
|
});
|
|
1279
1287
|
}
|
|
1280
1288
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1281
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.13", type: CheckboxComponent, isStandalone: true, selector: "et-checkbox", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-checkbox" }, viewQueries: [{ propertyName: "checkmarkEl", first: true, predicate: ["checkmark"], descendants: true, isSignal: true }, { propertyName: "indeterminateEl", first: true, predicate: ["indeterminate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: CheckboxDirective, inputs: ["checked", "checked", "indeterminate", "indeterminate", "disabled", "disabled", "invalid", "invalid", "errors", "errors", "required", "required", "name", "name"], outputs: ["checkedChange", "checkedChange", "indeterminateChange", "indeterminateChange", "touchedChange", "touchedChange"] }, { directive: i2.ColorInteractiveDirective }, { directive: FocusRingDirective }], ngImport: i0, template: "<div class=\"et-checkbox-box\">\n <svg\n #checkmark\n [style.color]=\"frozenCheckmarkColor()\"\n class=\"et-checkbox-checkmark\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <polyline\n class=\"et-checkbox-checkmark-path\"\n points=\"3.5 8 6.5 11 12.5 5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n #indeterminate\n [style.color]=\"frozenIndeterminateColor()\"\n class=\"et-checkbox-indeterminate\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <line\n class=\"et-checkbox-indeterminate-path\"\n x1=\"4\"\n y1=\"8\"\n x2=\"12\"\n y2=\"8\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n</div>\n", styles: ["@property --et-checkbox-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-checkbox-border-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --et-checkbox-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-checkbox-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-checkbox-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-checkbox{
|
|
1289
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.13", type: CheckboxComponent, isStandalone: true, selector: "et-checkbox", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-checkbox" }, viewQueries: [{ propertyName: "checkmarkEl", first: true, predicate: ["checkmark"], descendants: true, isSignal: true }, { propertyName: "indeterminateEl", first: true, predicate: ["indeterminate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: CheckboxDirective, inputs: ["checked", "checked", "indeterminate", "indeterminate", "disabled", "disabled", "invalid", "invalid", "errors", "errors", "required", "required", "name", "name"], outputs: ["checkedChange", "checkedChange", "indeterminateChange", "indeterminateChange", "touchedChange", "touchedChange"] }, { directive: i2.ColorInteractiveDirective }, { directive: FocusRingDirective }], ngImport: i0, template: "<div class=\"et-checkbox-box\">\n <svg\n #checkmark\n [style.color]=\"frozenCheckmarkColor()\"\n class=\"et-checkbox-checkmark\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <polyline\n class=\"et-checkbox-checkmark-path\"\n points=\"3.5 8 6.5 11 12.5 5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n #indeterminate\n [style.color]=\"frozenIndeterminateColor()\"\n class=\"et-checkbox-indeterminate\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <line\n class=\"et-checkbox-indeterminate-path\"\n x1=\"4\"\n y1=\"8\"\n x2=\"12\"\n y2=\"8\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n</div>\n", styles: ["@property --et-checkbox-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-checkbox-border-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --et-checkbox-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-checkbox-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-checkbox-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-checkbox{display:inline-flex;align-items:center;cursor:pointer;border-radius:var(--et-checkbox-border-radius);transition:opacity .15s ease,outline-color .15s ease}et-checkbox[aria-disabled=true]{opacity:var(--et-checkbox-opacity-disabled);pointer-events:none;cursor:default}et-checkbox .et-checkbox-box{position:relative;display:grid;place-items:center;width:var(--et-checkbox-size);height:var(--et-checkbox-size);border:var(--et-checkbox-border-width) solid var(--et-surface-border-solid, currentColor);border-radius:var(--et-checkbox-border-radius)}et-checkbox:hover:not([aria-disabled=true]) .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-checkbox:not([aria-disabled=true]) .et-checkbox-box{border-color:var(--et-surface-interaction-hover-solid, currentColor)}:where(et-choice-field[data-error]) et-checkbox:not([aria-disabled=true]) .et-checkbox-box{border-color:var(--et-theme-color-primary-solid)}:where(et-choice-field[data-error]) et-checkbox:hover:not([aria-disabled=true]) .et-checkbox-box,:where(et-choice-field[data-error]:has(.et-choice-field-label-area:hover)) et-checkbox:not([aria-disabled=true]) .et-checkbox-box{border-color:var(--et-theme-color-primary-solid)}et-checkbox:focus-visible:not([aria-checked=true]):not([aria-checked=mixed]){--_et-focus-ring-color: var(--et-surface-color-solid, currentColor)}et-checkbox:focus-visible:not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box{border-color:var(--et-surface-color-solid, currentColor)}et-checkbox:focus-visible:is([aria-checked=true],[aria-checked=mixed]) .et-checkbox-box{border-color:var(--et-theme-color-primary-solid)}et-choice-field[data-error] et-checkbox:focus-visible:not([aria-checked=true]):not([aria-checked=mixed]){--_et-focus-ring-color: var(--et-theme-color-primary-solid)}et-choice-field[data-error] et-checkbox:focus-visible:not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box{border-color:var(--et-theme-color-primary-solid)}et-checkbox:active:not([aria-disabled=true]):not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box,et-checkbox.et-focus-ring--active:not([aria-disabled=true]):not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:active)) et-checkbox:not([aria-disabled=true]):not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box{border-color:var(--et-surface-interaction-hover-solid, currentColor);transform:scale(.95)}et-checkbox:active:not([aria-disabled=true]):is([aria-checked=true],[aria-checked=mixed]) .et-checkbox-box,et-checkbox.et-focus-ring--active:not([aria-disabled=true]):is([aria-checked=true],[aria-checked=mixed]) .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:active)) et-checkbox:not([aria-disabled=true]):is([aria-checked=true],[aria-checked=mixed]) .et-checkbox-box{transform:scale(.95)}et-checkbox .et-checkbox-checkmark{position:absolute;inset:0;width:100%;height:100%;color:var(--et-theme-color-on-primary-solid, white);opacity:0}et-checkbox .et-checkbox-checkmark-path{stroke-dasharray:18;stroke-dashoffset:18}et-checkbox .et-checkbox-indeterminate{position:absolute;inset:0;width:100%;height:100%;color:var(--et-theme-color-on-primary-solid, white);opacity:0}et-checkbox .et-checkbox-indeterminate-path{stroke-dasharray:8;stroke-dashoffset:8}et-checkbox[aria-checked=true] .et-checkbox-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox[aria-checked=true] .et-checkbox-checkmark{opacity:1}et-checkbox[aria-checked=true] .et-checkbox-checkmark-path{stroke-dashoffset:0}et-checkbox[aria-checked=true]:hover .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-checkbox[aria-checked=true] .et-checkbox-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox[aria-checked=mixed] .et-checkbox-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox[aria-checked=mixed] .et-checkbox-indeterminate{opacity:1}et-checkbox[aria-checked=mixed] .et-checkbox-indeterminate-path{stroke-dashoffset:0}et-checkbox[aria-checked=mixed]:hover .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-checkbox[aria-checked=mixed] .et-checkbox-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox[data-can-animate]{transition:opacity var(--et-checkbox-transition-duration) ease,outline-color var(--et-checkbox-transition-duration) ease}et-checkbox[data-can-animate] .et-checkbox-box{transition:background-color var(--et-checkbox-transition-duration) ease,border-color var(--et-checkbox-transition-duration) ease,transform var(--et-checkbox-transition-duration) ease}et-checkbox[data-can-animate] .et-checkbox-checkmark{transition:opacity 0s calc(var(--et-checkbox-transition-duration) * 1.5)}et-checkbox[data-can-animate] .et-checkbox-checkmark-path{transition:stroke-dashoffset calc(var(--et-checkbox-transition-duration) * 1.5) ease}et-checkbox[data-can-animate] .et-checkbox-indeterminate{transition:opacity 0s calc(var(--et-checkbox-transition-duration) * 1.5)}et-checkbox[data-can-animate] .et-checkbox-indeterminate-path{transition:stroke-dashoffset calc(var(--et-checkbox-transition-duration) * 1.5) ease}et-checkbox[data-can-animate][aria-checked=true] .et-checkbox-checkmark{transition:opacity 0s 0s}et-checkbox[data-can-animate][aria-checked=mixed] .et-checkbox-indeterminate{transition:opacity 0s 0s}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1282
1290
|
}
|
|
1283
1291
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
1284
1292
|
type: Component,
|
|
@@ -1293,7 +1301,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
1293
1301
|
], host: {
|
|
1294
1302
|
class: 'et-checkbox',
|
|
1295
1303
|
'[attr.data-can-animate]': 'canAnimate.state() || null',
|
|
1296
|
-
}, template: "<div class=\"et-checkbox-box\">\n <svg\n #checkmark\n [style.color]=\"frozenCheckmarkColor()\"\n class=\"et-checkbox-checkmark\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <polyline\n class=\"et-checkbox-checkmark-path\"\n points=\"3.5 8 6.5 11 12.5 5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n #indeterminate\n [style.color]=\"frozenIndeterminateColor()\"\n class=\"et-checkbox-indeterminate\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <line\n class=\"et-checkbox-indeterminate-path\"\n x1=\"4\"\n y1=\"8\"\n x2=\"12\"\n y2=\"8\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n</div>\n", styles: ["@property --et-checkbox-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-checkbox-border-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --et-checkbox-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-checkbox-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-checkbox-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-checkbox{
|
|
1304
|
+
}, template: "<div class=\"et-checkbox-box\">\n <svg\n #checkmark\n [style.color]=\"frozenCheckmarkColor()\"\n class=\"et-checkbox-checkmark\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <polyline\n class=\"et-checkbox-checkmark-path\"\n points=\"3.5 8 6.5 11 12.5 5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n #indeterminate\n [style.color]=\"frozenIndeterminateColor()\"\n class=\"et-checkbox-indeterminate\"\n viewBox=\"0 0 16 16\"\n aria-hidden=\"true\"\n >\n <line\n class=\"et-checkbox-indeterminate-path\"\n x1=\"4\"\n y1=\"8\"\n x2=\"12\"\n y2=\"8\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n</div>\n", styles: ["@property --et-checkbox-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-checkbox-border-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --et-checkbox-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-checkbox-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-checkbox-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-checkbox{display:inline-flex;align-items:center;cursor:pointer;border-radius:var(--et-checkbox-border-radius);transition:opacity .15s ease,outline-color .15s ease}et-checkbox[aria-disabled=true]{opacity:var(--et-checkbox-opacity-disabled);pointer-events:none;cursor:default}et-checkbox .et-checkbox-box{position:relative;display:grid;place-items:center;width:var(--et-checkbox-size);height:var(--et-checkbox-size);border:var(--et-checkbox-border-width) solid var(--et-surface-border-solid, currentColor);border-radius:var(--et-checkbox-border-radius)}et-checkbox:hover:not([aria-disabled=true]) .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-checkbox:not([aria-disabled=true]) .et-checkbox-box{border-color:var(--et-surface-interaction-hover-solid, currentColor)}:where(et-choice-field[data-error]) et-checkbox:not([aria-disabled=true]) .et-checkbox-box{border-color:var(--et-theme-color-primary-solid)}:where(et-choice-field[data-error]) et-checkbox:hover:not([aria-disabled=true]) .et-checkbox-box,:where(et-choice-field[data-error]:has(.et-choice-field-label-area:hover)) et-checkbox:not([aria-disabled=true]) .et-checkbox-box{border-color:var(--et-theme-color-primary-solid)}et-checkbox:focus-visible:not([aria-checked=true]):not([aria-checked=mixed]){--_et-focus-ring-color: var(--et-surface-color-solid, currentColor)}et-checkbox:focus-visible:not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box{border-color:var(--et-surface-color-solid, currentColor)}et-checkbox:focus-visible:is([aria-checked=true],[aria-checked=mixed]) .et-checkbox-box{border-color:var(--et-theme-color-primary-solid)}et-choice-field[data-error] et-checkbox:focus-visible:not([aria-checked=true]):not([aria-checked=mixed]){--_et-focus-ring-color: var(--et-theme-color-primary-solid)}et-choice-field[data-error] et-checkbox:focus-visible:not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box{border-color:var(--et-theme-color-primary-solid)}et-checkbox:active:not([aria-disabled=true]):not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box,et-checkbox.et-focus-ring--active:not([aria-disabled=true]):not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:active)) et-checkbox:not([aria-disabled=true]):not([aria-checked=true]):not([aria-checked=mixed]) .et-checkbox-box{border-color:var(--et-surface-interaction-hover-solid, currentColor);transform:scale(.95)}et-checkbox:active:not([aria-disabled=true]):is([aria-checked=true],[aria-checked=mixed]) .et-checkbox-box,et-checkbox.et-focus-ring--active:not([aria-disabled=true]):is([aria-checked=true],[aria-checked=mixed]) .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:active)) et-checkbox:not([aria-disabled=true]):is([aria-checked=true],[aria-checked=mixed]) .et-checkbox-box{transform:scale(.95)}et-checkbox .et-checkbox-checkmark{position:absolute;inset:0;width:100%;height:100%;color:var(--et-theme-color-on-primary-solid, white);opacity:0}et-checkbox .et-checkbox-checkmark-path{stroke-dasharray:18;stroke-dashoffset:18}et-checkbox .et-checkbox-indeterminate{position:absolute;inset:0;width:100%;height:100%;color:var(--et-theme-color-on-primary-solid, white);opacity:0}et-checkbox .et-checkbox-indeterminate-path{stroke-dasharray:8;stroke-dashoffset:8}et-checkbox[aria-checked=true] .et-checkbox-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox[aria-checked=true] .et-checkbox-checkmark{opacity:1}et-checkbox[aria-checked=true] .et-checkbox-checkmark-path{stroke-dashoffset:0}et-checkbox[aria-checked=true]:hover .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-checkbox[aria-checked=true] .et-checkbox-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox[aria-checked=mixed] .et-checkbox-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox[aria-checked=mixed] .et-checkbox-indeterminate{opacity:1}et-checkbox[aria-checked=mixed] .et-checkbox-indeterminate-path{stroke-dashoffset:0}et-checkbox[aria-checked=mixed]:hover .et-checkbox-box,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-checkbox[aria-checked=mixed] .et-checkbox-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox[data-can-animate]{transition:opacity var(--et-checkbox-transition-duration) ease,outline-color var(--et-checkbox-transition-duration) ease}et-checkbox[data-can-animate] .et-checkbox-box{transition:background-color var(--et-checkbox-transition-duration) ease,border-color var(--et-checkbox-transition-duration) ease,transform var(--et-checkbox-transition-duration) ease}et-checkbox[data-can-animate] .et-checkbox-checkmark{transition:opacity 0s calc(var(--et-checkbox-transition-duration) * 1.5)}et-checkbox[data-can-animate] .et-checkbox-checkmark-path{transition:stroke-dashoffset calc(var(--et-checkbox-transition-duration) * 1.5) ease}et-checkbox[data-can-animate] .et-checkbox-indeterminate{transition:opacity 0s calc(var(--et-checkbox-transition-duration) * 1.5)}et-checkbox[data-can-animate] .et-checkbox-indeterminate-path{transition:stroke-dashoffset calc(var(--et-checkbox-transition-duration) * 1.5) ease}et-checkbox[data-can-animate][aria-checked=true] .et-checkbox-checkmark{transition:opacity 0s 0s}et-checkbox[data-can-animate][aria-checked=mixed] .et-checkbox-indeterminate{transition:opacity 0s 0s}\n"] }]
|
|
1297
1305
|
}], ctorParameters: () => [], propDecorators: { checkmarkEl: [{ type: i0.ViewChild, args: ['checkmark', { isSignal: true }] }], indeterminateEl: [{ type: i0.ViewChild, args: ['indeterminate', { isSignal: true }] }] } });
|
|
1298
1306
|
|
|
1299
1307
|
const CHECKBOX_IMPORTS = [CheckboxComponent, CheckboxDirective];
|
|
@@ -1646,7 +1654,8 @@ class FormFieldComponent {
|
|
|
1646
1654
|
}
|
|
1647
1655
|
const target = event.target;
|
|
1648
1656
|
const tagName = target.tagName;
|
|
1649
|
-
if (
|
|
1657
|
+
if (target.isContentEditable ||
|
|
1658
|
+
tagName === 'INPUT' ||
|
|
1650
1659
|
tagName === 'TEXTAREA' ||
|
|
1651
1660
|
tagName === 'SELECT' ||
|
|
1652
1661
|
tagName === 'BUTTON' ||
|
|
@@ -1657,7 +1666,7 @@ class FormFieldComponent {
|
|
|
1657
1666
|
this.formFieldDir.activate();
|
|
1658
1667
|
}
|
|
1659
1668
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1660
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: FormFieldComponent, isStandalone: true, selector: "et-form-field", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, labelMode: { classPropertyName: "labelMode", publicName: "labelMode", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-can-animate": "canAnimate.state() || null", "attr.data-control-type": "formFieldDir.controlType()", "attr.data-error": "displaysError() || null", "attr.data-appearance": "formFieldDir.usesTextFieldShell() ? appearance() : null", "attr.data-fill": "formFieldDir.usesTextFieldShell() ? fill() : null", "attr.data-label-floated": "hasFloatingTextLabel() && formFieldDir.shouldFloatLabel() ? \"\" : null", "attr.data-label-mode": "formFieldDir.usesTextFieldShell() ? labelMode() : null", "attr.data-size": "formFieldDir.usesTextFieldShell() ? size() : null", "attr.data-text-shell": "formFieldDir.usesTextFieldShell() || null", "style.--_et-form-field-prefix-offset": "prefixOffset()" }, classAttribute: "et-form-field" }, viewQueries: [{ propertyName: "errorContent", first: true, predicate: ["errorContent"], descendants: true, isSignal: true }, { propertyName: "hintContent", first: true, predicate: ["hintContent"], descendants: true, isSignal: true }, { propertyName: "prefixEl", first: true, predicate: ["prefixEl"], descendants: true, isSignal: true }, { propertyName: "errorAnimatable", first: true, predicate: ["errorAnimatable"], descendants: true, isSignal: true }, { propertyName: "hintAnimatable", first: true, predicate: ["hintAnimatable"], descendants: true, isSignal: true }], hostDirectives: [{ directive: FormFieldDirective }, { directive: i2.ProvideColorDirective, inputs: ["etProvideColor", "color"] }, { directive: i2.ProvideSurfaceDirective, inputs: ["etProvideSurface", "surface"] }, { directive: i2.ColorInteractiveHasFocusDirective }], ngImport: i0, template: "<div class=\"et-form-field-shell\">\n <div (mousedown)=\"handleFramePointerDown($event)\" class=\"et-form-field-control-frame\">\n <div #prefixEl class=\"et-form-field-affix et-form-field-prefix\">\n <ng-content select=\"[etInputPrefix]\" />\n </div>\n\n <div class=\"et-form-field-control-area\">\n <div\n [class.et-form-field-label-area--floating]=\"hasFloatingTextLabel()\"\n [class.et-form-field-label-area--inline]=\"hasInlineLabel()\"\n class=\"et-form-field-label-area\"\n >\n <ng-content select=\"et-label\" />\n </div>\n\n <div class=\"et-form-field-control-slot\">\n <ng-content />\n </div>\n </div>\n\n <div class=\"et-form-field-affix et-form-field-suffix\">\n <ng-content select=\"[etInputSuffix]\" />\n </div>\n </div>\n</div>\n\n@if (shouldRenderSupport()) {\n <div [style.block-size.px]=\"supportHeight()\" class=\"et-form-field-support\" etColorInteractiveExclude>\n <div class=\"et-form-field-support-stack\">\n @if (shouldRenderError()) {\n <div\n #errorContent\n #errorAnimatable=\"etAnimatable\"\n [id]=\"formFieldDir.errorId()\"\n [attr.aria-atomic]=\"errorActive() ? 'true' : null\"\n [attr.aria-hidden]=\"!errorActive() ? 'true' : null\"\n [attr.aria-live]=\"errorActive() ? 'polite' : null\"\n [attr.data-active]=\"errorActive() || null\"\n [attr.data-direction]=\"errorDirection()\"\n [attr.data-state]=\"errorState()\"\n [etProvideColor]=\"errorColorTheme\"\n class=\"et-form-field-support-content et-form-field-errors\"\n etAnimatable\n >\n @for (error of visibleErrors(); track $index) {\n <et-form-error [error]=\"error\" />\n }\n </div>\n }\n\n @if (shouldRenderHint()) {\n <div\n #hintContent\n #hintAnimatable=\"etAnimatable\"\n [id]=\"formFieldDir.hintId()\"\n [attr.aria-hidden]=\"!hintActive() ? 'true' : null\"\n [attr.data-active]=\"hintActive() || null\"\n [attr.data-direction]=\"hintDirection()\"\n [attr.data-state]=\"hintState()\"\n class=\"et-form-field-support-content et-form-field-hint\"\n etAnimatable\n >\n <ng-content select=\"et-hint\" />\n </div>\n }\n </div>\n </div>\n}\n", styles: ["@property --et-form-field-gap{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-form-field-control-border-radius{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-form-field-control-border-width{syntax: \"<length>\"; inherits: true; initial-value: 1px;}@property --et-form-field-control-padding-block{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --et-form-field-control-padding-inline{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-control-font-size{syntax: \"<length>\"; inherits: true; initial-value: 14px;}@property --et-form-field-control-line-height{syntax: \"<number>\"; inherits: true; initial-value: 1.5;}@property --et-form-field-control-affix-gap{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --et-form-field-control-disabled-opacity{syntax: \"<number>\"; inherits: true; initial-value: .5;}@property --et-form-field-control-min-height{syntax: \"<length>\"; inherits: true; initial-value: 40px;}@property --et-form-field-label-font-size{syntax: \"<length>\"; inherits: true; initial-value: 14px;}@property --et-form-field-error-font-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-hint-font-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-support-duration{syntax: \"<time>\"; inherits: true; initial-value: .18s;}@property --et-form-field-support-offset{syntax: \"<length>\"; inherits: true; initial-value: 4px;}et-form-field{--et-theme-color-primary-solid: rgb(var(--et-theme-color-primary-rgb));--_et-form-field-control-background: transparent;--_et-form-field-control-focus-ring: color-mix(in srgb, var(--et-theme-color-primary-solid) 18%, transparent);--_et-form-field-floating-label-scale: .75;display:flex;flex-direction:column;gap:var(--et-form-field-gap);color:var(--et-surface-color-solid, currentColor)}et-form-field:where([data-size=sm]){--et-form-field-gap: 4px;--et-form-field-control-border-radius: 4px;--et-form-field-control-padding-block: 4px;--et-form-field-control-padding-inline: 10px;--et-form-field-control-affix-gap: 6px;--et-form-field-control-font-size: 12px;--et-form-field-control-min-height: 42px;--et-form-field-label-font-size: 12px}et-form-field:where([data-size=md]){--et-form-field-gap: 5px;--et-form-field-control-border-radius: 5px;--et-form-field-control-padding-block: 6px;--et-form-field-control-padding-inline: 12px;--et-form-field-control-affix-gap: 8px;--et-form-field-control-font-size: 14px;--et-form-field-control-min-height: 50px;--et-form-field-label-font-size: 13px}et-form-field:where([data-size=lg]){--et-form-field-gap: 6px;--et-form-field-control-border-radius: 6px;--et-form-field-control-padding-block: 8px;--et-form-field-control-padding-inline: 14px;--et-form-field-control-affix-gap: 10px;--et-form-field-control-font-size: 16px;--et-form-field-control-min-height: 58px;--et-form-field-label-font-size: 14px}et-form-field[data-fill=filled]{--_et-form-field-control-background: var(--et-surface-background-solid, var(--et-surface-base-solid, transparent))}et-form-field .et-form-field-shell{display:flex;flex-direction:column;gap:var(--et-form-field-gap);min-inline-size:0;overflow:visible}et-form-field .et-form-field-label-area{display:flex;align-items:center;font-size:var(--et-form-field-label-font-size);font-weight:500;line-height:1.2;letter-spacing:-.01em;color:var(--et-surface-color-muted-solid, currentColor);cursor:text;-webkit-user-select:none;user-select:none;min-inline-size:0;transition:color .15s ease,opacity .15s ease}et-form-field .et-form-field-label-area et-label{display:inline;min-inline-size:0}et-form-field .et-form-field-label-area--floating{position:absolute;inset-block-start:50%;inset-inline-start:0;z-index:1;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transform:translateY(-50%);transform-origin:left top;pointer-events:none}et-form-field[data-can-animate] .et-form-field-label-area--floating{transition:color .15s ease,opacity .15s ease,inset-block-start .15s ease,inset-inline-start .15s ease,transform .15s ease}et-form-field .et-form-field-control-frame{position:relative;display:flex;align-items:center;box-sizing:border-box;gap:var(--et-form-field-control-affix-gap);min-inline-size:0;min-block-size:var(--et-form-field-control-min-height);padding-block:var(--et-form-field-control-padding-block);padding-inline:var(--et-form-field-control-padding-inline);border:var(--et-form-field-control-border-width) solid var(--et-surface-border-solid, currentColor);border-radius:var(--et-form-field-control-border-radius);background:var(--_et-form-field-control-background);font-size:var(--et-form-field-control-font-size);line-height:var(--et-form-field-control-line-height);transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease;cursor:text}et-form-field .et-form-field-affix{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--et-surface-color-muted-solid, currentColor);opacity:.78;pointer-events:none;transition:color .15s ease,opacity .15s ease}et-form-field .et-form-field-affix:empty{display:none}et-form-field .et-form-field-affix>*{pointer-events:none}et-form-field .et-form-field-affix>:is(button,a[href],input,select,textarea,summary,label,[role=button],[tabindex]:not([tabindex=\"-1\"])){pointer-events:auto}et-form-field .et-form-field-affix button{font:inherit;color:inherit;border:none;background:transparent;padding:0;cursor:pointer}et-form-field .et-form-field-control-area{position:relative;display:flex;align-items:center;flex:1;min-inline-size:0}et-form-field .et-form-field-control-area>*{min-inline-size:0}et-form-field .et-form-field-control-slot{display:flex;align-items:center;flex:1;min-inline-size:0}et-form-field:where([data-control-type=text-input])[data-label-mode=static] .et-form-field-shell{padding-block-start:calc(var(--et-form-field-label-font-size) * 1.2 + var(--et-form-field-gap))}et-form-field:where([data-control-type=text-input])[data-label-mode=static] .et-form-field-control-area{position:static}et-form-field:where([data-control-type=text-input])[data-label-mode=static] .et-form-field-label-area{position:absolute;inset-block-start:0;inset-inline-start:var(--et-form-field-control-padding-inline);transform:translateY(calc(-100% - var(--et-form-field-gap) - var(--et-form-field-control-border-width)))}et-form-field:where([data-control-type=text-input])[data-label-mode=static][data-appearance=underline][data-fill=transparent] .et-form-field-label-area{inset-inline-start:0}et-form-field:where([data-control-type=text-input])[data-label-mode=inline] .et-form-field-control-frame{align-items:stretch}et-form-field:where([data-control-type=text-input])[data-label-mode=inline] .et-form-field-control-area{position:static;gap:var(--et-form-field-control-affix-gap);align-items:stretch}et-form-field:where([data-control-type=text-input])[data-label-mode=inline] .et-form-field-control-slot{display:flex;align-items:center}et-form-field:where([data-control-type=text-input])[data-label-mode=inline] .et-form-field-label-area--inline{position:static;flex-shrink:0;transform:none;white-space:nowrap;pointer-events:auto;font-size:var(--et-form-field-control-font-size);line-height:var(--et-form-field-control-line-height);display:flex;align-items:center;margin-block:calc(var(--et-form-field-control-padding-block) * -1)}et-form-field:where([data-control-type=text-input])[data-label-mode=inline][data-appearance=underline] .et-form-field-label-area--inline:after{content:\":\"}et-form-field:where([data-control-type=text-input])[data-label-mode=inline][data-appearance=box] .et-form-field-label-area--inline{padding-inline-end:var(--et-form-field-control-padding-inline);margin-inline-end:calc(var(--et-form-field-control-padding-inline) - var(--et-form-field-control-affix-gap));border-inline-end:var(--et-form-field-control-border-width) solid var(--et-surface-border-solid, currentColor)}:is(et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside],et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside]) .et-input-native::placeholder{transition:color .15s ease}:is(et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside],et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside]):not([data-label-floated]) .et-input-native::placeholder{color:transparent}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside] .et-form-field-control-area{align-self:stretch;display:flex;align-items:center}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside] .et-form-field-label-area--floating{inset-inline-start:0}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside] .et-form-field-shell{padding-block-start:calc(var(--et-form-field-label-font-size) * 1.2 + var(--et-form-field-gap))}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside][data-label-floated] .et-form-field-label-area--floating{inset-block-start:0;inset-inline-start:calc(var(--_et-form-field-prefix-offset, 0px) * -1);transform:translateY(calc(-100% - var(--et-form-field-gap) - var(--et-form-field-control-border-width) - var(--et-form-field-control-padding-block)))}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside]{--_et-form-field-float-inside-extra-padding: calc( var(--et-form-field-label-font-size) * var(--_et-form-field-floating-label-scale) + 2px )}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside] .et-form-field-control-area{align-self:stretch;display:flex;align-items:center;padding-block-start:var(--_et-form-field-float-inside-extra-padding)}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside] .et-form-field-label-area--floating{inset-inline-start:0}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside][data-label-floated] .et-form-field-label-area--floating{inset-block-start:4px;transform:scale(var(--_et-form-field-floating-label-scale))}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside] .et-form-field-control-slot{font-size:calc(var(--et-form-field-control-font-size) * .96)}et-form-field:where([data-control-type=text-input]) .et-form-field-label-area{max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}et-form-field:where([data-control-type=text-input]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-control-frame{border-color:var(--et-surface-interaction-hover-solid, currentColor)}et-form-field:where([data-control-type=text-input]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-label-area,et-form-field:where([data-control-type=text-input]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-affix{color:var(--et-surface-color-solid, currentColor);opacity:1}et-form-field:where([data-control-type=text-input]):where(:has(:focus-visible)) .et-form-field-control-frame{border-color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input]):where(:has(:focus-visible)) .et-form-field-label-area,et-form-field:where([data-control-type=text-input]):where(:has(:focus-visible)) .et-form-field-affix{color:var(--et-surface-color-solid, currentColor);opacity:1}et-form-field:where([data-control-type=text-input])[data-error] .et-form-field-control-frame{border-color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input])[data-error] .et-form-field-label-area{color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input])[data-error] .et-form-field-affix{color:var(--et-theme-color-primary-solid);opacity:1}et-form-field:where([data-control-type=text-input]):has(:disabled) .et-form-field-control-frame{opacity:var(--et-form-field-control-disabled-opacity);pointer-events:none;box-shadow:none}et-form-field:where([data-control-type=text-input]):has(:disabled) .et-form-field-label-area{cursor:not-allowed}et-form-field:where([data-control-type=text-input])[data-appearance=underline] .et-form-field-control-frame{border-top:none;border-inline:none;border-radius:0;box-shadow:none}et-form-field:where([data-control-type=text-input])[data-appearance=underline][data-fill=transparent] .et-form-field-control-frame{padding-inline:0}et-form-field:where([data-control-type=text-input])[data-appearance=underline][data-fill=transparent] .et-form-field-errors,et-form-field:where([data-control-type=text-input])[data-appearance=underline][data-fill=transparent] .et-form-field-hint{padding-inline-start:0}et-form-field .et-form-field-support{overflow:clip;block-size:0}et-form-field .et-form-field-support-stack{position:relative;display:grid}et-form-field .et-form-field-support-content{grid-area:1 / 1;min-inline-size:0;opacity:0;transform:translateY(0)}et-form-field .et-form-field-support-content[data-active]{opacity:1;transform:translateY(0)}et-form-field .et-form-field-support-content[data-state=leaving][data-direction=to-above]{position:absolute;inset:0;opacity:0;transform:translateY(calc(var(--et-form-field-support-offset) * -1));pointer-events:none}et-form-field .et-form-field-support-content[data-state=leaving][data-direction=to-below]{position:absolute;inset:0;opacity:0;transform:translateY(var(--et-form-field-support-offset));pointer-events:none}et-form-field .et-form-field-errors{display:flex;flex-direction:column;gap:2px;font-size:var(--et-form-field-error-font-size);color:var(--et-theme-color-primary-solid);padding-inline-start:calc(var(--et-form-field-control-padding-inline) + var(--et-form-field-control-border-width))}et-form-field .et-form-field-hint{font-size:var(--et-form-field-hint-font-size);color:var(--et-surface-color-muted-solid, currentColor);padding-inline-start:calc(var(--et-form-field-control-padding-inline) + var(--et-form-field-control-border-width));transition:color .15s ease}et-form-field .et-form-field-hint:empty{display:none}et-form-field:has(:disabled) .et-form-field-hint{color:var(--et-surface-interaction-disabled-solid, currentColor)}et-form-field[data-can-animate] .et-form-field-support{transition:block-size var(--et-form-field-support-duration) ease}et-form-field[data-can-animate] .et-form-field-support-content{transition:opacity var(--et-form-field-support-duration) ease,transform var(--et-form-field-support-duration) ease}@starting-style{et-form-field[data-can-animate] .et-form-field-support-content[data-active][data-direction=from-above]{opacity:0;transform:translateY(calc(var(--et-form-field-support-offset) * -1))}}@starting-style{et-form-field[data-can-animate] .et-form-field-support-content[data-active][data-direction=from-below]{opacity:0;transform:translateY(var(--et-form-field-support-offset))}}@media(prefers-reduced-motion:reduce){et-form-field{--et-form-field-support-duration: 1ms;--et-form-field-support-offset: 0px}}\n"], dependencies: [{ kind: "directive", type: AnimatableDirective, selector: "[etAnimatable]", exportAs: ["etAnimatable"] }, { kind: "directive", type: ColorInteractiveExcludeDirective, selector: "[etColorInteractiveExclude]" }, { kind: "component", type: FormErrorComponent, selector: "et-form-error", inputs: ["error"] }, { kind: "directive", type: ProvideColorDirective, selector: "[etProvideColor]", inputs: ["etProvideColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1669
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: FormFieldComponent, isStandalone: true, selector: "et-form-field", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, labelMode: { classPropertyName: "labelMode", publicName: "labelMode", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-can-animate": "canAnimate.state() || null", "attr.data-control-type": "formFieldDir.controlType()", "attr.data-error": "displaysError() || null", "attr.data-appearance": "formFieldDir.usesTextFieldShell() ? appearance() : null", "attr.data-fill": "formFieldDir.usesTextFieldShell() ? fill() : null", "attr.data-label-floated": "hasFloatingTextLabel() && formFieldDir.shouldFloatLabel() ? \"\" : null", "attr.data-label-mode": "formFieldDir.usesTextFieldShell() ? labelMode() : null", "attr.data-size": "formFieldDir.usesTextFieldShell() ? size() : null", "attr.data-text-shell": "formFieldDir.usesTextFieldShell() || null", "style.--_et-form-field-prefix-offset": "prefixOffset()" }, classAttribute: "et-form-field" }, viewQueries: [{ propertyName: "errorContent", first: true, predicate: ["errorContent"], descendants: true, isSignal: true }, { propertyName: "hintContent", first: true, predicate: ["hintContent"], descendants: true, isSignal: true }, { propertyName: "prefixEl", first: true, predicate: ["prefixEl"], descendants: true, isSignal: true }, { propertyName: "errorAnimatable", first: true, predicate: ["errorAnimatable"], descendants: true, isSignal: true }, { propertyName: "hintAnimatable", first: true, predicate: ["hintAnimatable"], descendants: true, isSignal: true }], hostDirectives: [{ directive: FormFieldDirective }, { directive: i2.ProvideColorDirective, inputs: ["etProvideColor", "color"] }, { directive: i2.ProvideSurfaceDirective, inputs: ["etProvideSurface", "surface"] }, { directive: i2.ColorInteractiveHasFocusDirective }], ngImport: i0, template: "<div class=\"et-form-field-shell\">\n <div (mousedown)=\"handleFramePointerDown($event)\" class=\"et-form-field-control-frame\">\n <div #prefixEl class=\"et-form-field-affix et-form-field-prefix\">\n <ng-content select=\"[etInputPrefix]\" />\n </div>\n\n <div class=\"et-form-field-control-area\">\n <div\n [class.et-form-field-label-area--floating]=\"hasFloatingTextLabel()\"\n [class.et-form-field-label-area--inline]=\"hasInlineLabel()\"\n class=\"et-form-field-label-area\"\n >\n <ng-content select=\"et-label\" />\n </div>\n\n <div class=\"et-form-field-control-slot\">\n <ng-content />\n </div>\n </div>\n\n <div class=\"et-form-field-affix et-form-field-suffix\">\n <ng-content select=\"[etInputSuffix]\" />\n </div>\n </div>\n</div>\n\n@if (shouldRenderSupport()) {\n <div [style.block-size.px]=\"supportHeight()\" class=\"et-form-field-support\" etColorInteractiveExclude>\n <div class=\"et-form-field-support-stack\">\n @if (shouldRenderError()) {\n <div\n #errorContent\n #errorAnimatable=\"etAnimatable\"\n [id]=\"formFieldDir.errorId()\"\n [attr.aria-atomic]=\"errorActive() ? 'true' : null\"\n [attr.aria-hidden]=\"!errorActive() ? 'true' : null\"\n [attr.aria-live]=\"errorActive() ? 'polite' : null\"\n [attr.data-active]=\"errorActive() || null\"\n [attr.data-direction]=\"errorDirection()\"\n [attr.data-state]=\"errorState()\"\n [etProvideColor]=\"errorColorTheme\"\n class=\"et-form-field-support-content et-form-field-errors\"\n etAnimatable\n >\n @for (error of visibleErrors(); track $index) {\n <et-form-error [error]=\"error\" />\n }\n </div>\n }\n\n @if (shouldRenderHint()) {\n <div\n #hintContent\n #hintAnimatable=\"etAnimatable\"\n [id]=\"formFieldDir.hintId()\"\n [attr.aria-hidden]=\"!hintActive() ? 'true' : null\"\n [attr.data-active]=\"hintActive() || null\"\n [attr.data-direction]=\"hintDirection()\"\n [attr.data-state]=\"hintState()\"\n class=\"et-form-field-support-content et-form-field-hint\"\n etAnimatable\n >\n <ng-content select=\"et-hint\" />\n </div>\n }\n </div>\n </div>\n}\n", styles: ["@property --et-form-field-gap{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-form-field-control-border-radius{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-form-field-control-border-width{syntax: \"<length>\"; inherits: true; initial-value: 1px;}@property --et-form-field-control-padding-block{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --et-form-field-control-padding-inline{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-control-font-size{syntax: \"<length>\"; inherits: true; initial-value: 14px;}@property --et-form-field-control-line-height{syntax: \"<number>\"; inherits: true; initial-value: 1.5;}@property --et-form-field-control-affix-gap{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --et-form-field-control-disabled-opacity{syntax: \"<number>\"; inherits: true; initial-value: .5;}@property --et-form-field-control-min-height{syntax: \"<length>\"; inherits: true; initial-value: 40px;}@property --et-form-field-label-font-size{syntax: \"<length>\"; inherits: true; initial-value: 14px;}@property --et-form-field-error-font-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-hint-font-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-support-duration{syntax: \"<time>\"; inherits: true; initial-value: .18s;}@property --et-form-field-support-offset{syntax: \"<length>\"; inherits: true; initial-value: 4px;}et-form-field{--et-theme-color-primary-solid: rgb(var(--et-theme-color-primary-rgb));--_et-form-field-control-background: transparent;--_et-form-field-control-focus-ring: color-mix(in srgb, var(--et-theme-color-primary-solid) 18%, transparent);--_et-form-field-floating-label-scale: .75;display:flex;flex-direction:column;gap:var(--et-form-field-gap);color:var(--et-surface-color-solid, currentColor)}et-form-field:where([data-size=sm]){--et-form-field-gap: 4px;--et-form-field-control-border-radius: 4px;--et-form-field-control-padding-block: 4px;--et-form-field-control-padding-inline: 10px;--et-form-field-control-affix-gap: 6px;--et-form-field-control-font-size: 12px;--et-form-field-control-min-height: 42px;--et-form-field-label-font-size: 12px}et-form-field:where([data-size=md]){--et-form-field-gap: 5px;--et-form-field-control-border-radius: 5px;--et-form-field-control-padding-block: 6px;--et-form-field-control-padding-inline: 12px;--et-form-field-control-affix-gap: 8px;--et-form-field-control-font-size: 14px;--et-form-field-control-min-height: 50px;--et-form-field-label-font-size: 13px}et-form-field:where([data-size=lg]){--et-form-field-gap: 6px;--et-form-field-control-border-radius: 6px;--et-form-field-control-padding-block: 8px;--et-form-field-control-padding-inline: 14px;--et-form-field-control-affix-gap: 10px;--et-form-field-control-font-size: 16px;--et-form-field-control-min-height: 58px;--et-form-field-label-font-size: 14px}et-form-field[data-fill=filled]{--_et-form-field-control-background: var(--et-surface-background-solid, var(--et-surface-base-solid, transparent))}et-form-field .et-form-field-shell{display:flex;flex-direction:column;gap:var(--et-form-field-gap);min-inline-size:0;overflow:visible}et-form-field .et-form-field-label-area{display:flex;align-items:center;font-size:var(--et-form-field-label-font-size);font-weight:500;line-height:1.2;letter-spacing:-.01em;color:var(--et-surface-color-muted-solid, currentColor);cursor:text;-webkit-user-select:none;user-select:none;min-inline-size:0;transition:color .15s ease,opacity .15s ease}et-form-field .et-form-field-label-area et-label{display:inline;min-inline-size:0}et-form-field .et-form-field-label-area--floating{position:absolute;inset-block-start:50%;inset-inline-start:0;z-index:1;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transform:translateY(-50%);transform-origin:left top;pointer-events:none}et-form-field[data-can-animate] .et-form-field-label-area--floating{transition:color .15s ease,opacity .15s ease,inset-block-start .15s ease,inset-inline-start .15s ease,transform .15s ease}et-form-field .et-form-field-control-frame{position:relative;display:flex;align-items:center;box-sizing:border-box;gap:var(--et-form-field-control-affix-gap);min-inline-size:0;min-block-size:var(--et-form-field-control-min-height);padding-block:var(--et-form-field-control-padding-block);padding-inline:var(--et-form-field-control-padding-inline);border:var(--et-form-field-control-border-width) solid var(--et-surface-border-solid, currentColor);border-radius:var(--et-form-field-control-border-radius);background:var(--_et-form-field-control-background);font-size:var(--et-form-field-control-font-size);line-height:var(--et-form-field-control-line-height);transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease;cursor:text}et-form-field .et-form-field-affix{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--et-surface-color-muted-solid, currentColor);opacity:.78;pointer-events:none;transition:color .15s ease,opacity .15s ease}et-form-field .et-form-field-affix:empty{display:none}et-form-field .et-form-field-affix>*{pointer-events:none}et-form-field .et-form-field-affix>:is(button,a[href],input,select,textarea,summary,label,[role=button],[tabindex]:not([tabindex=\"-1\"])){pointer-events:auto}et-form-field .et-form-field-affix button{font:inherit;color:inherit;border:none;background:transparent;padding:0;cursor:pointer}et-form-field .et-form-field-control-area{position:relative;display:flex;align-items:center;flex:1;min-inline-size:0}et-form-field .et-form-field-control-area>*{min-inline-size:0}et-form-field .et-form-field-control-slot{display:flex;align-items:center;flex:1;min-inline-size:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=static] .et-form-field-shell{padding-block-start:calc(var(--et-form-field-label-font-size) * 1.2 + var(--et-form-field-gap))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=static] .et-form-field-control-area{position:static}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=static] .et-form-field-label-area{position:absolute;inset-block-start:0;inset-inline-start:var(--et-form-field-control-padding-inline);transform:translateY(calc(-100% - var(--et-form-field-gap) - var(--et-form-field-control-border-width)))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=static][data-appearance=underline][data-fill=transparent] .et-form-field-label-area{inset-inline-start:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline] .et-form-field-control-frame{align-items:stretch}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline] .et-form-field-control-area{position:static;gap:var(--et-form-field-control-affix-gap);align-items:stretch}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline] .et-form-field-control-slot{display:flex;align-items:center}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline] .et-form-field-label-area--inline{position:static;flex-shrink:0;transform:none;white-space:nowrap;pointer-events:auto;font-size:var(--et-form-field-control-font-size);line-height:var(--et-form-field-control-line-height);display:flex;align-items:center;margin-block:calc(var(--et-form-field-control-padding-block) * -1)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline][data-appearance=underline] .et-form-field-label-area--inline:after{content:\":\"}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline][data-appearance=box] .et-form-field-label-area--inline{padding-inline-end:var(--et-form-field-control-padding-inline);margin-inline-end:calc(var(--et-form-field-control-padding-inline) - var(--et-form-field-control-affix-gap));border-inline-end:var(--et-form-field-control-border-width) solid var(--et-surface-border-solid, currentColor)}:is(et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside],et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside]) .et-input-native::placeholder{transition:color .15s ease}:is(et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside],et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside]):not([data-label-floated]) .et-input-native::placeholder{color:transparent}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside] .et-form-field-control-area{align-self:stretch;display:flex;align-items:center}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside] .et-form-field-label-area--floating{inset-inline-start:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside] .et-form-field-shell{padding-block-start:calc(var(--et-form-field-label-font-size) * 1.2 + var(--et-form-field-gap))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside][data-label-floated] .et-form-field-label-area--floating{inset-block-start:0;inset-inline-start:calc(var(--_et-form-field-prefix-offset, 0px) * -1);transform:translateY(calc(-100% - var(--et-form-field-gap) - var(--et-form-field-control-border-width) - var(--et-form-field-control-padding-block)))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside]{--_et-form-field-float-inside-extra-padding: calc( var(--et-form-field-label-font-size) * var(--_et-form-field-floating-label-scale) + 2px )}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside] .et-form-field-control-area{align-self:stretch;display:flex;align-items:center;padding-block-start:var(--_et-form-field-float-inside-extra-padding)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside] .et-form-field-label-area--floating{inset-inline-start:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside][data-label-floated] .et-form-field-label-area--floating{inset-block-start:4px;transform:scale(var(--_et-form-field-floating-label-scale))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside] .et-form-field-control-slot{font-size:calc(var(--et-form-field-control-font-size) * .96)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]) .et-form-field-label-area{max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-control-frame{border-color:var(--et-surface-interaction-hover-solid, currentColor)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-label-area,et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-affix{color:var(--et-surface-color-solid, currentColor);opacity:1}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:has(:focus-visible)) .et-form-field-control-frame{border-color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:has(:focus-visible)) .et-form-field-label-area,et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:has(:focus-visible)) .et-form-field-affix{color:var(--et-surface-color-solid, currentColor);opacity:1}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-error] .et-form-field-control-frame{border-color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-error] .et-form-field-label-area{color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-error] .et-form-field-affix{color:var(--et-theme-color-primary-solid);opacity:1}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):has(:disabled) .et-form-field-control-frame{opacity:var(--et-form-field-control-disabled-opacity);pointer-events:none;box-shadow:none}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):has(:disabled) .et-form-field-label-area{cursor:not-allowed}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-appearance=underline] .et-form-field-control-frame{border-top:none;border-inline:none;border-radius:0;box-shadow:none}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-appearance=underline][data-fill=transparent] .et-form-field-control-frame{padding-inline:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-appearance=underline][data-fill=transparent] .et-form-field-errors,et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-appearance=underline][data-fill=transparent] .et-form-field-hint{padding-inline-start:0}et-form-field:where([data-control-type=rich-text]) .et-form-field-control-frame{align-items:stretch;padding:0;cursor:auto}et-form-field:where([data-control-type=rich-text]) .et-form-field-control-area,et-form-field:where([data-control-type=rich-text]) .et-form-field-control-slot{align-items:stretch}et-form-field .et-form-field-support{overflow:clip;block-size:0}et-form-field .et-form-field-support-stack{position:relative;display:grid}et-form-field .et-form-field-support-content{grid-area:1 / 1;min-inline-size:0;opacity:0;transform:translateY(0)}et-form-field .et-form-field-support-content[data-active]{opacity:1;transform:translateY(0)}et-form-field .et-form-field-support-content[data-state=leaving][data-direction=to-above]{position:absolute;inset:0;opacity:0;transform:translateY(calc(var(--et-form-field-support-offset) * -1));pointer-events:none}et-form-field .et-form-field-support-content[data-state=leaving][data-direction=to-below]{position:absolute;inset:0;opacity:0;transform:translateY(var(--et-form-field-support-offset));pointer-events:none}et-form-field .et-form-field-errors{display:flex;flex-direction:column;gap:2px;font-size:var(--et-form-field-error-font-size);color:var(--et-theme-color-primary-solid);padding-inline-start:calc(var(--et-form-field-control-padding-inline) + var(--et-form-field-control-border-width))}et-form-field .et-form-field-hint{font-size:var(--et-form-field-hint-font-size);color:var(--et-surface-color-muted-solid, currentColor);padding-inline-start:calc(var(--et-form-field-control-padding-inline) + var(--et-form-field-control-border-width));transition:color .15s ease}et-form-field .et-form-field-hint:empty{display:none}et-form-field:has(:disabled) .et-form-field-hint{color:var(--et-surface-interaction-disabled-solid, currentColor)}et-form-field[data-can-animate] .et-form-field-support{transition:block-size var(--et-form-field-support-duration) ease}et-form-field[data-can-animate] .et-form-field-support-content{transition:opacity var(--et-form-field-support-duration) ease,transform var(--et-form-field-support-duration) ease}@starting-style{et-form-field[data-can-animate] .et-form-field-support-content[data-active][data-direction=from-above]{opacity:0;transform:translateY(calc(var(--et-form-field-support-offset) * -1))}}@starting-style{et-form-field[data-can-animate] .et-form-field-support-content[data-active][data-direction=from-below]{opacity:0;transform:translateY(var(--et-form-field-support-offset))}}@media(prefers-reduced-motion:reduce){et-form-field{--et-form-field-support-duration: 1ms;--et-form-field-support-offset: 0px}}\n"], dependencies: [{ kind: "directive", type: AnimatableDirective, selector: "[etAnimatable]", exportAs: ["etAnimatable"] }, { kind: "directive", type: ColorInteractiveExcludeDirective, selector: "[etColorInteractiveExclude]" }, { kind: "component", type: FormErrorComponent, selector: "et-form-error", inputs: ["error"] }, { kind: "directive", type: ProvideColorDirective, selector: "[etProvideColor]", inputs: ["etProvideColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1661
1670
|
}
|
|
1662
1671
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
1663
1672
|
type: Component,
|
|
@@ -1678,7 +1687,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
1678
1687
|
'[attr.data-size]': 'formFieldDir.usesTextFieldShell() ? size() : null',
|
|
1679
1688
|
'[attr.data-text-shell]': 'formFieldDir.usesTextFieldShell() || null',
|
|
1680
1689
|
'[style.--_et-form-field-prefix-offset]': 'prefixOffset()',
|
|
1681
|
-
}, template: "<div class=\"et-form-field-shell\">\n <div (mousedown)=\"handleFramePointerDown($event)\" class=\"et-form-field-control-frame\">\n <div #prefixEl class=\"et-form-field-affix et-form-field-prefix\">\n <ng-content select=\"[etInputPrefix]\" />\n </div>\n\n <div class=\"et-form-field-control-area\">\n <div\n [class.et-form-field-label-area--floating]=\"hasFloatingTextLabel()\"\n [class.et-form-field-label-area--inline]=\"hasInlineLabel()\"\n class=\"et-form-field-label-area\"\n >\n <ng-content select=\"et-label\" />\n </div>\n\n <div class=\"et-form-field-control-slot\">\n <ng-content />\n </div>\n </div>\n\n <div class=\"et-form-field-affix et-form-field-suffix\">\n <ng-content select=\"[etInputSuffix]\" />\n </div>\n </div>\n</div>\n\n@if (shouldRenderSupport()) {\n <div [style.block-size.px]=\"supportHeight()\" class=\"et-form-field-support\" etColorInteractiveExclude>\n <div class=\"et-form-field-support-stack\">\n @if (shouldRenderError()) {\n <div\n #errorContent\n #errorAnimatable=\"etAnimatable\"\n [id]=\"formFieldDir.errorId()\"\n [attr.aria-atomic]=\"errorActive() ? 'true' : null\"\n [attr.aria-hidden]=\"!errorActive() ? 'true' : null\"\n [attr.aria-live]=\"errorActive() ? 'polite' : null\"\n [attr.data-active]=\"errorActive() || null\"\n [attr.data-direction]=\"errorDirection()\"\n [attr.data-state]=\"errorState()\"\n [etProvideColor]=\"errorColorTheme\"\n class=\"et-form-field-support-content et-form-field-errors\"\n etAnimatable\n >\n @for (error of visibleErrors(); track $index) {\n <et-form-error [error]=\"error\" />\n }\n </div>\n }\n\n @if (shouldRenderHint()) {\n <div\n #hintContent\n #hintAnimatable=\"etAnimatable\"\n [id]=\"formFieldDir.hintId()\"\n [attr.aria-hidden]=\"!hintActive() ? 'true' : null\"\n [attr.data-active]=\"hintActive() || null\"\n [attr.data-direction]=\"hintDirection()\"\n [attr.data-state]=\"hintState()\"\n class=\"et-form-field-support-content et-form-field-hint\"\n etAnimatable\n >\n <ng-content select=\"et-hint\" />\n </div>\n }\n </div>\n </div>\n}\n", styles: ["@property --et-form-field-gap{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-form-field-control-border-radius{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-form-field-control-border-width{syntax: \"<length>\"; inherits: true; initial-value: 1px;}@property --et-form-field-control-padding-block{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --et-form-field-control-padding-inline{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-control-font-size{syntax: \"<length>\"; inherits: true; initial-value: 14px;}@property --et-form-field-control-line-height{syntax: \"<number>\"; inherits: true; initial-value: 1.5;}@property --et-form-field-control-affix-gap{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --et-form-field-control-disabled-opacity{syntax: \"<number>\"; inherits: true; initial-value: .5;}@property --et-form-field-control-min-height{syntax: \"<length>\"; inherits: true; initial-value: 40px;}@property --et-form-field-label-font-size{syntax: \"<length>\"; inherits: true; initial-value: 14px;}@property --et-form-field-error-font-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-hint-font-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-support-duration{syntax: \"<time>\"; inherits: true; initial-value: .18s;}@property --et-form-field-support-offset{syntax: \"<length>\"; inherits: true; initial-value: 4px;}et-form-field{--et-theme-color-primary-solid: rgb(var(--et-theme-color-primary-rgb));--_et-form-field-control-background: transparent;--_et-form-field-control-focus-ring: color-mix(in srgb, var(--et-theme-color-primary-solid) 18%, transparent);--_et-form-field-floating-label-scale: .75;display:flex;flex-direction:column;gap:var(--et-form-field-gap);color:var(--et-surface-color-solid, currentColor)}et-form-field:where([data-size=sm]){--et-form-field-gap: 4px;--et-form-field-control-border-radius: 4px;--et-form-field-control-padding-block: 4px;--et-form-field-control-padding-inline: 10px;--et-form-field-control-affix-gap: 6px;--et-form-field-control-font-size: 12px;--et-form-field-control-min-height: 42px;--et-form-field-label-font-size: 12px}et-form-field:where([data-size=md]){--et-form-field-gap: 5px;--et-form-field-control-border-radius: 5px;--et-form-field-control-padding-block: 6px;--et-form-field-control-padding-inline: 12px;--et-form-field-control-affix-gap: 8px;--et-form-field-control-font-size: 14px;--et-form-field-control-min-height: 50px;--et-form-field-label-font-size: 13px}et-form-field:where([data-size=lg]){--et-form-field-gap: 6px;--et-form-field-control-border-radius: 6px;--et-form-field-control-padding-block: 8px;--et-form-field-control-padding-inline: 14px;--et-form-field-control-affix-gap: 10px;--et-form-field-control-font-size: 16px;--et-form-field-control-min-height: 58px;--et-form-field-label-font-size: 14px}et-form-field[data-fill=filled]{--_et-form-field-control-background: var(--et-surface-background-solid, var(--et-surface-base-solid, transparent))}et-form-field .et-form-field-shell{display:flex;flex-direction:column;gap:var(--et-form-field-gap);min-inline-size:0;overflow:visible}et-form-field .et-form-field-label-area{display:flex;align-items:center;font-size:var(--et-form-field-label-font-size);font-weight:500;line-height:1.2;letter-spacing:-.01em;color:var(--et-surface-color-muted-solid, currentColor);cursor:text;-webkit-user-select:none;user-select:none;min-inline-size:0;transition:color .15s ease,opacity .15s ease}et-form-field .et-form-field-label-area et-label{display:inline;min-inline-size:0}et-form-field .et-form-field-label-area--floating{position:absolute;inset-block-start:50%;inset-inline-start:0;z-index:1;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transform:translateY(-50%);transform-origin:left top;pointer-events:none}et-form-field[data-can-animate] .et-form-field-label-area--floating{transition:color .15s ease,opacity .15s ease,inset-block-start .15s ease,inset-inline-start .15s ease,transform .15s ease}et-form-field .et-form-field-control-frame{position:relative;display:flex;align-items:center;box-sizing:border-box;gap:var(--et-form-field-control-affix-gap);min-inline-size:0;min-block-size:var(--et-form-field-control-min-height);padding-block:var(--et-form-field-control-padding-block);padding-inline:var(--et-form-field-control-padding-inline);border:var(--et-form-field-control-border-width) solid var(--et-surface-border-solid, currentColor);border-radius:var(--et-form-field-control-border-radius);background:var(--_et-form-field-control-background);font-size:var(--et-form-field-control-font-size);line-height:var(--et-form-field-control-line-height);transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease;cursor:text}et-form-field .et-form-field-affix{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--et-surface-color-muted-solid, currentColor);opacity:.78;pointer-events:none;transition:color .15s ease,opacity .15s ease}et-form-field .et-form-field-affix:empty{display:none}et-form-field .et-form-field-affix>*{pointer-events:none}et-form-field .et-form-field-affix>:is(button,a[href],input,select,textarea,summary,label,[role=button],[tabindex]:not([tabindex=\"-1\"])){pointer-events:auto}et-form-field .et-form-field-affix button{font:inherit;color:inherit;border:none;background:transparent;padding:0;cursor:pointer}et-form-field .et-form-field-control-area{position:relative;display:flex;align-items:center;flex:1;min-inline-size:0}et-form-field .et-form-field-control-area>*{min-inline-size:0}et-form-field .et-form-field-control-slot{display:flex;align-items:center;flex:1;min-inline-size:0}et-form-field:where([data-control-type=text-input])[data-label-mode=static] .et-form-field-shell{padding-block-start:calc(var(--et-form-field-label-font-size) * 1.2 + var(--et-form-field-gap))}et-form-field:where([data-control-type=text-input])[data-label-mode=static] .et-form-field-control-area{position:static}et-form-field:where([data-control-type=text-input])[data-label-mode=static] .et-form-field-label-area{position:absolute;inset-block-start:0;inset-inline-start:var(--et-form-field-control-padding-inline);transform:translateY(calc(-100% - var(--et-form-field-gap) - var(--et-form-field-control-border-width)))}et-form-field:where([data-control-type=text-input])[data-label-mode=static][data-appearance=underline][data-fill=transparent] .et-form-field-label-area{inset-inline-start:0}et-form-field:where([data-control-type=text-input])[data-label-mode=inline] .et-form-field-control-frame{align-items:stretch}et-form-field:where([data-control-type=text-input])[data-label-mode=inline] .et-form-field-control-area{position:static;gap:var(--et-form-field-control-affix-gap);align-items:stretch}et-form-field:where([data-control-type=text-input])[data-label-mode=inline] .et-form-field-control-slot{display:flex;align-items:center}et-form-field:where([data-control-type=text-input])[data-label-mode=inline] .et-form-field-label-area--inline{position:static;flex-shrink:0;transform:none;white-space:nowrap;pointer-events:auto;font-size:var(--et-form-field-control-font-size);line-height:var(--et-form-field-control-line-height);display:flex;align-items:center;margin-block:calc(var(--et-form-field-control-padding-block) * -1)}et-form-field:where([data-control-type=text-input])[data-label-mode=inline][data-appearance=underline] .et-form-field-label-area--inline:after{content:\":\"}et-form-field:where([data-control-type=text-input])[data-label-mode=inline][data-appearance=box] .et-form-field-label-area--inline{padding-inline-end:var(--et-form-field-control-padding-inline);margin-inline-end:calc(var(--et-form-field-control-padding-inline) - var(--et-form-field-control-affix-gap));border-inline-end:var(--et-form-field-control-border-width) solid var(--et-surface-border-solid, currentColor)}:is(et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside],et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside]) .et-input-native::placeholder{transition:color .15s ease}:is(et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside],et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside]):not([data-label-floated]) .et-input-native::placeholder{color:transparent}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside] .et-form-field-control-area{align-self:stretch;display:flex;align-items:center}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside] .et-form-field-label-area--floating{inset-inline-start:0}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside] .et-form-field-shell{padding-block-start:calc(var(--et-form-field-label-font-size) * 1.2 + var(--et-form-field-gap))}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-outside][data-label-floated] .et-form-field-label-area--floating{inset-block-start:0;inset-inline-start:calc(var(--_et-form-field-prefix-offset, 0px) * -1);transform:translateY(calc(-100% - var(--et-form-field-gap) - var(--et-form-field-control-border-width) - var(--et-form-field-control-padding-block)))}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside]{--_et-form-field-float-inside-extra-padding: calc( var(--et-form-field-label-font-size) * var(--_et-form-field-floating-label-scale) + 2px )}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside] .et-form-field-control-area{align-self:stretch;display:flex;align-items:center;padding-block-start:var(--_et-form-field-float-inside-extra-padding)}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside] .et-form-field-label-area--floating{inset-inline-start:0}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside][data-label-floated] .et-form-field-label-area--floating{inset-block-start:4px;transform:scale(var(--_et-form-field-floating-label-scale))}et-form-field:where([data-control-type=text-input])[data-label-mode=floating-inside] .et-form-field-control-slot{font-size:calc(var(--et-form-field-control-font-size) * .96)}et-form-field:where([data-control-type=text-input]) .et-form-field-label-area{max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}et-form-field:where([data-control-type=text-input]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-control-frame{border-color:var(--et-surface-interaction-hover-solid, currentColor)}et-form-field:where([data-control-type=text-input]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-label-area,et-form-field:where([data-control-type=text-input]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-affix{color:var(--et-surface-color-solid, currentColor);opacity:1}et-form-field:where([data-control-type=text-input]):where(:has(:focus-visible)) .et-form-field-control-frame{border-color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input]):where(:has(:focus-visible)) .et-form-field-label-area,et-form-field:where([data-control-type=text-input]):where(:has(:focus-visible)) .et-form-field-affix{color:var(--et-surface-color-solid, currentColor);opacity:1}et-form-field:where([data-control-type=text-input])[data-error] .et-form-field-control-frame{border-color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input])[data-error] .et-form-field-label-area{color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input])[data-error] .et-form-field-affix{color:var(--et-theme-color-primary-solid);opacity:1}et-form-field:where([data-control-type=text-input]):has(:disabled) .et-form-field-control-frame{opacity:var(--et-form-field-control-disabled-opacity);pointer-events:none;box-shadow:none}et-form-field:where([data-control-type=text-input]):has(:disabled) .et-form-field-label-area{cursor:not-allowed}et-form-field:where([data-control-type=text-input])[data-appearance=underline] .et-form-field-control-frame{border-top:none;border-inline:none;border-radius:0;box-shadow:none}et-form-field:where([data-control-type=text-input])[data-appearance=underline][data-fill=transparent] .et-form-field-control-frame{padding-inline:0}et-form-field:where([data-control-type=text-input])[data-appearance=underline][data-fill=transparent] .et-form-field-errors,et-form-field:where([data-control-type=text-input])[data-appearance=underline][data-fill=transparent] .et-form-field-hint{padding-inline-start:0}et-form-field .et-form-field-support{overflow:clip;block-size:0}et-form-field .et-form-field-support-stack{position:relative;display:grid}et-form-field .et-form-field-support-content{grid-area:1 / 1;min-inline-size:0;opacity:0;transform:translateY(0)}et-form-field .et-form-field-support-content[data-active]{opacity:1;transform:translateY(0)}et-form-field .et-form-field-support-content[data-state=leaving][data-direction=to-above]{position:absolute;inset:0;opacity:0;transform:translateY(calc(var(--et-form-field-support-offset) * -1));pointer-events:none}et-form-field .et-form-field-support-content[data-state=leaving][data-direction=to-below]{position:absolute;inset:0;opacity:0;transform:translateY(var(--et-form-field-support-offset));pointer-events:none}et-form-field .et-form-field-errors{display:flex;flex-direction:column;gap:2px;font-size:var(--et-form-field-error-font-size);color:var(--et-theme-color-primary-solid);padding-inline-start:calc(var(--et-form-field-control-padding-inline) + var(--et-form-field-control-border-width))}et-form-field .et-form-field-hint{font-size:var(--et-form-field-hint-font-size);color:var(--et-surface-color-muted-solid, currentColor);padding-inline-start:calc(var(--et-form-field-control-padding-inline) + var(--et-form-field-control-border-width));transition:color .15s ease}et-form-field .et-form-field-hint:empty{display:none}et-form-field:has(:disabled) .et-form-field-hint{color:var(--et-surface-interaction-disabled-solid, currentColor)}et-form-field[data-can-animate] .et-form-field-support{transition:block-size var(--et-form-field-support-duration) ease}et-form-field[data-can-animate] .et-form-field-support-content{transition:opacity var(--et-form-field-support-duration) ease,transform var(--et-form-field-support-duration) ease}@starting-style{et-form-field[data-can-animate] .et-form-field-support-content[data-active][data-direction=from-above]{opacity:0;transform:translateY(calc(var(--et-form-field-support-offset) * -1))}}@starting-style{et-form-field[data-can-animate] .et-form-field-support-content[data-active][data-direction=from-below]{opacity:0;transform:translateY(var(--et-form-field-support-offset))}}@media(prefers-reduced-motion:reduce){et-form-field{--et-form-field-support-duration: 1ms;--et-form-field-support-offset: 0px}}\n"] }]
|
|
1690
|
+
}, template: "<div class=\"et-form-field-shell\">\n <div (mousedown)=\"handleFramePointerDown($event)\" class=\"et-form-field-control-frame\">\n <div #prefixEl class=\"et-form-field-affix et-form-field-prefix\">\n <ng-content select=\"[etInputPrefix]\" />\n </div>\n\n <div class=\"et-form-field-control-area\">\n <div\n [class.et-form-field-label-area--floating]=\"hasFloatingTextLabel()\"\n [class.et-form-field-label-area--inline]=\"hasInlineLabel()\"\n class=\"et-form-field-label-area\"\n >\n <ng-content select=\"et-label\" />\n </div>\n\n <div class=\"et-form-field-control-slot\">\n <ng-content />\n </div>\n </div>\n\n <div class=\"et-form-field-affix et-form-field-suffix\">\n <ng-content select=\"[etInputSuffix]\" />\n </div>\n </div>\n</div>\n\n@if (shouldRenderSupport()) {\n <div [style.block-size.px]=\"supportHeight()\" class=\"et-form-field-support\" etColorInteractiveExclude>\n <div class=\"et-form-field-support-stack\">\n @if (shouldRenderError()) {\n <div\n #errorContent\n #errorAnimatable=\"etAnimatable\"\n [id]=\"formFieldDir.errorId()\"\n [attr.aria-atomic]=\"errorActive() ? 'true' : null\"\n [attr.aria-hidden]=\"!errorActive() ? 'true' : null\"\n [attr.aria-live]=\"errorActive() ? 'polite' : null\"\n [attr.data-active]=\"errorActive() || null\"\n [attr.data-direction]=\"errorDirection()\"\n [attr.data-state]=\"errorState()\"\n [etProvideColor]=\"errorColorTheme\"\n class=\"et-form-field-support-content et-form-field-errors\"\n etAnimatable\n >\n @for (error of visibleErrors(); track $index) {\n <et-form-error [error]=\"error\" />\n }\n </div>\n }\n\n @if (shouldRenderHint()) {\n <div\n #hintContent\n #hintAnimatable=\"etAnimatable\"\n [id]=\"formFieldDir.hintId()\"\n [attr.aria-hidden]=\"!hintActive() ? 'true' : null\"\n [attr.data-active]=\"hintActive() || null\"\n [attr.data-direction]=\"hintDirection()\"\n [attr.data-state]=\"hintState()\"\n class=\"et-form-field-support-content et-form-field-hint\"\n etAnimatable\n >\n <ng-content select=\"et-hint\" />\n </div>\n }\n </div>\n </div>\n}\n", styles: ["@property --et-form-field-gap{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-form-field-control-border-radius{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-form-field-control-border-width{syntax: \"<length>\"; inherits: true; initial-value: 1px;}@property --et-form-field-control-padding-block{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --et-form-field-control-padding-inline{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-control-font-size{syntax: \"<length>\"; inherits: true; initial-value: 14px;}@property --et-form-field-control-line-height{syntax: \"<number>\"; inherits: true; initial-value: 1.5;}@property --et-form-field-control-affix-gap{syntax: \"<length>\"; inherits: true; initial-value: 8px;}@property --et-form-field-control-disabled-opacity{syntax: \"<number>\"; inherits: true; initial-value: .5;}@property --et-form-field-control-min-height{syntax: \"<length>\"; inherits: true; initial-value: 40px;}@property --et-form-field-label-font-size{syntax: \"<length>\"; inherits: true; initial-value: 14px;}@property --et-form-field-error-font-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-hint-font-size{syntax: \"<length>\"; inherits: true; initial-value: 12px;}@property --et-form-field-support-duration{syntax: \"<time>\"; inherits: true; initial-value: .18s;}@property --et-form-field-support-offset{syntax: \"<length>\"; inherits: true; initial-value: 4px;}et-form-field{--et-theme-color-primary-solid: rgb(var(--et-theme-color-primary-rgb));--_et-form-field-control-background: transparent;--_et-form-field-control-focus-ring: color-mix(in srgb, var(--et-theme-color-primary-solid) 18%, transparent);--_et-form-field-floating-label-scale: .75;display:flex;flex-direction:column;gap:var(--et-form-field-gap);color:var(--et-surface-color-solid, currentColor)}et-form-field:where([data-size=sm]){--et-form-field-gap: 4px;--et-form-field-control-border-radius: 4px;--et-form-field-control-padding-block: 4px;--et-form-field-control-padding-inline: 10px;--et-form-field-control-affix-gap: 6px;--et-form-field-control-font-size: 12px;--et-form-field-control-min-height: 42px;--et-form-field-label-font-size: 12px}et-form-field:where([data-size=md]){--et-form-field-gap: 5px;--et-form-field-control-border-radius: 5px;--et-form-field-control-padding-block: 6px;--et-form-field-control-padding-inline: 12px;--et-form-field-control-affix-gap: 8px;--et-form-field-control-font-size: 14px;--et-form-field-control-min-height: 50px;--et-form-field-label-font-size: 13px}et-form-field:where([data-size=lg]){--et-form-field-gap: 6px;--et-form-field-control-border-radius: 6px;--et-form-field-control-padding-block: 8px;--et-form-field-control-padding-inline: 14px;--et-form-field-control-affix-gap: 10px;--et-form-field-control-font-size: 16px;--et-form-field-control-min-height: 58px;--et-form-field-label-font-size: 14px}et-form-field[data-fill=filled]{--_et-form-field-control-background: var(--et-surface-background-solid, var(--et-surface-base-solid, transparent))}et-form-field .et-form-field-shell{display:flex;flex-direction:column;gap:var(--et-form-field-gap);min-inline-size:0;overflow:visible}et-form-field .et-form-field-label-area{display:flex;align-items:center;font-size:var(--et-form-field-label-font-size);font-weight:500;line-height:1.2;letter-spacing:-.01em;color:var(--et-surface-color-muted-solid, currentColor);cursor:text;-webkit-user-select:none;user-select:none;min-inline-size:0;transition:color .15s ease,opacity .15s ease}et-form-field .et-form-field-label-area et-label{display:inline;min-inline-size:0}et-form-field .et-form-field-label-area--floating{position:absolute;inset-block-start:50%;inset-inline-start:0;z-index:1;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transform:translateY(-50%);transform-origin:left top;pointer-events:none}et-form-field[data-can-animate] .et-form-field-label-area--floating{transition:color .15s ease,opacity .15s ease,inset-block-start .15s ease,inset-inline-start .15s ease,transform .15s ease}et-form-field .et-form-field-control-frame{position:relative;display:flex;align-items:center;box-sizing:border-box;gap:var(--et-form-field-control-affix-gap);min-inline-size:0;min-block-size:var(--et-form-field-control-min-height);padding-block:var(--et-form-field-control-padding-block);padding-inline:var(--et-form-field-control-padding-inline);border:var(--et-form-field-control-border-width) solid var(--et-surface-border-solid, currentColor);border-radius:var(--et-form-field-control-border-radius);background:var(--_et-form-field-control-background);font-size:var(--et-form-field-control-font-size);line-height:var(--et-form-field-control-line-height);transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease;cursor:text}et-form-field .et-form-field-affix{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--et-surface-color-muted-solid, currentColor);opacity:.78;pointer-events:none;transition:color .15s ease,opacity .15s ease}et-form-field .et-form-field-affix:empty{display:none}et-form-field .et-form-field-affix>*{pointer-events:none}et-form-field .et-form-field-affix>:is(button,a[href],input,select,textarea,summary,label,[role=button],[tabindex]:not([tabindex=\"-1\"])){pointer-events:auto}et-form-field .et-form-field-affix button{font:inherit;color:inherit;border:none;background:transparent;padding:0;cursor:pointer}et-form-field .et-form-field-control-area{position:relative;display:flex;align-items:center;flex:1;min-inline-size:0}et-form-field .et-form-field-control-area>*{min-inline-size:0}et-form-field .et-form-field-control-slot{display:flex;align-items:center;flex:1;min-inline-size:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=static] .et-form-field-shell{padding-block-start:calc(var(--et-form-field-label-font-size) * 1.2 + var(--et-form-field-gap))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=static] .et-form-field-control-area{position:static}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=static] .et-form-field-label-area{position:absolute;inset-block-start:0;inset-inline-start:var(--et-form-field-control-padding-inline);transform:translateY(calc(-100% - var(--et-form-field-gap) - var(--et-form-field-control-border-width)))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=static][data-appearance=underline][data-fill=transparent] .et-form-field-label-area{inset-inline-start:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline] .et-form-field-control-frame{align-items:stretch}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline] .et-form-field-control-area{position:static;gap:var(--et-form-field-control-affix-gap);align-items:stretch}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline] .et-form-field-control-slot{display:flex;align-items:center}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline] .et-form-field-label-area--inline{position:static;flex-shrink:0;transform:none;white-space:nowrap;pointer-events:auto;font-size:var(--et-form-field-control-font-size);line-height:var(--et-form-field-control-line-height);display:flex;align-items:center;margin-block:calc(var(--et-form-field-control-padding-block) * -1)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline][data-appearance=underline] .et-form-field-label-area--inline:after{content:\":\"}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=inline][data-appearance=box] .et-form-field-label-area--inline{padding-inline-end:var(--et-form-field-control-padding-inline);margin-inline-end:calc(var(--et-form-field-control-padding-inline) - var(--et-form-field-control-affix-gap));border-inline-end:var(--et-form-field-control-border-width) solid var(--et-surface-border-solid, currentColor)}:is(et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside],et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside]) .et-input-native::placeholder{transition:color .15s ease}:is(et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside],et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside]):not([data-label-floated]) .et-input-native::placeholder{color:transparent}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside] .et-form-field-control-area{align-self:stretch;display:flex;align-items:center}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside] .et-form-field-label-area--floating{inset-inline-start:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside] .et-form-field-shell{padding-block-start:calc(var(--et-form-field-label-font-size) * 1.2 + var(--et-form-field-gap))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-outside][data-label-floated] .et-form-field-label-area--floating{inset-block-start:0;inset-inline-start:calc(var(--_et-form-field-prefix-offset, 0px) * -1);transform:translateY(calc(-100% - var(--et-form-field-gap) - var(--et-form-field-control-border-width) - var(--et-form-field-control-padding-block)))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside]{--_et-form-field-float-inside-extra-padding: calc( var(--et-form-field-label-font-size) * var(--_et-form-field-floating-label-scale) + 2px )}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside] .et-form-field-control-area{align-self:stretch;display:flex;align-items:center;padding-block-start:var(--_et-form-field-float-inside-extra-padding)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside] .et-form-field-label-area--floating{inset-inline-start:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside][data-label-floated] .et-form-field-label-area--floating{inset-block-start:4px;transform:scale(var(--_et-form-field-floating-label-scale))}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-label-mode=floating-inside] .et-form-field-control-slot{font-size:calc(var(--et-form-field-control-font-size) * .96)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]) .et-form-field-label-area{max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-control-frame{border-color:var(--et-surface-interaction-hover-solid, currentColor)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-label-area,et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:hover:not(:has(.et-color-interactive-exclude:hover))) .et-form-field-affix{color:var(--et-surface-color-solid, currentColor);opacity:1}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:has(:focus-visible)) .et-form-field-control-frame{border-color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:has(:focus-visible)) .et-form-field-label-area,et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):where(:has(:focus-visible)) .et-form-field-affix{color:var(--et-surface-color-solid, currentColor);opacity:1}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-error] .et-form-field-control-frame{border-color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-error] .et-form-field-label-area{color:var(--et-theme-color-primary-solid)}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-error] .et-form-field-affix{color:var(--et-theme-color-primary-solid);opacity:1}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):has(:disabled) .et-form-field-control-frame{opacity:var(--et-form-field-control-disabled-opacity);pointer-events:none;box-shadow:none}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text]):has(:disabled) .et-form-field-label-area{cursor:not-allowed}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-appearance=underline] .et-form-field-control-frame{border-top:none;border-inline:none;border-radius:0;box-shadow:none}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-appearance=underline][data-fill=transparent] .et-form-field-control-frame{padding-inline:0}et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-appearance=underline][data-fill=transparent] .et-form-field-errors,et-form-field:where([data-control-type=text-input],[data-control-type=rich-text])[data-appearance=underline][data-fill=transparent] .et-form-field-hint{padding-inline-start:0}et-form-field:where([data-control-type=rich-text]) .et-form-field-control-frame{align-items:stretch;padding:0;cursor:auto}et-form-field:where([data-control-type=rich-text]) .et-form-field-control-area,et-form-field:where([data-control-type=rich-text]) .et-form-field-control-slot{align-items:stretch}et-form-field .et-form-field-support{overflow:clip;block-size:0}et-form-field .et-form-field-support-stack{position:relative;display:grid}et-form-field .et-form-field-support-content{grid-area:1 / 1;min-inline-size:0;opacity:0;transform:translateY(0)}et-form-field .et-form-field-support-content[data-active]{opacity:1;transform:translateY(0)}et-form-field .et-form-field-support-content[data-state=leaving][data-direction=to-above]{position:absolute;inset:0;opacity:0;transform:translateY(calc(var(--et-form-field-support-offset) * -1));pointer-events:none}et-form-field .et-form-field-support-content[data-state=leaving][data-direction=to-below]{position:absolute;inset:0;opacity:0;transform:translateY(var(--et-form-field-support-offset));pointer-events:none}et-form-field .et-form-field-errors{display:flex;flex-direction:column;gap:2px;font-size:var(--et-form-field-error-font-size);color:var(--et-theme-color-primary-solid);padding-inline-start:calc(var(--et-form-field-control-padding-inline) + var(--et-form-field-control-border-width))}et-form-field .et-form-field-hint{font-size:var(--et-form-field-hint-font-size);color:var(--et-surface-color-muted-solid, currentColor);padding-inline-start:calc(var(--et-form-field-control-padding-inline) + var(--et-form-field-control-border-width));transition:color .15s ease}et-form-field .et-form-field-hint:empty{display:none}et-form-field:has(:disabled) .et-form-field-hint{color:var(--et-surface-interaction-disabled-solid, currentColor)}et-form-field[data-can-animate] .et-form-field-support{transition:block-size var(--et-form-field-support-duration) ease}et-form-field[data-can-animate] .et-form-field-support-content{transition:opacity var(--et-form-field-support-duration) ease,transform var(--et-form-field-support-duration) ease}@starting-style{et-form-field[data-can-animate] .et-form-field-support-content[data-active][data-direction=from-above]{opacity:0;transform:translateY(calc(var(--et-form-field-support-offset) * -1))}}@starting-style{et-form-field[data-can-animate] .et-form-field-support-content[data-active][data-direction=from-below]{opacity:0;transform:translateY(var(--et-form-field-support-offset))}}@media(prefers-reduced-motion:reduce){et-form-field{--et-form-field-support-duration: 1ms;--et-form-field-support-offset: 0px}}\n"] }]
|
|
1682
1691
|
}], ctorParameters: () => [], propDecorators: { appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], labelMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelMode", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], errorContent: [{ type: i0.ViewChild, args: ['errorContent', { isSignal: true }] }], hintContent: [{ type: i0.ViewChild, args: ['hintContent', { isSignal: true }] }], prefixEl: [{ type: i0.ViewChild, args: ['prefixEl', { isSignal: true }] }], errorAnimatable: [{ type: i0.ViewChild, args: ['errorAnimatable', { isSignal: true }] }], hintAnimatable: [{ type: i0.ViewChild, args: ['hintAnimatable', { isSignal: true }] }] } });
|
|
1683
1692
|
|
|
1684
1693
|
class InputPrefixDirective {
|
|
@@ -1814,230 +1823,1405 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
1814
1823
|
|
|
1815
1824
|
const INPUT_IMPORTS = [InputComponent, InputDirective];
|
|
1816
1825
|
|
|
1817
|
-
const
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1826
|
+
const richTextEditorDomFactory = () => {
|
|
1827
|
+
const renderer = injectRenderer();
|
|
1828
|
+
const doc = inject(DOCUMENT);
|
|
1829
|
+
/** The contenteditable element, set by the owning directive once its view exists. */
|
|
1830
|
+
const root = signal(null, ...(ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []));
|
|
1831
|
+
const getSelection = () => {
|
|
1832
|
+
const el = root();
|
|
1833
|
+
if (!el) {
|
|
1834
|
+
return null;
|
|
1835
|
+
}
|
|
1836
|
+
const selection = doc.getSelection();
|
|
1837
|
+
if (!selection || selection.rangeCount === 0) {
|
|
1838
|
+
return null;
|
|
1839
|
+
}
|
|
1840
|
+
const range = selection.getRangeAt(0);
|
|
1841
|
+
if (!el.contains(range.commonAncestorContainer)) {
|
|
1842
|
+
return null;
|
|
1843
|
+
}
|
|
1844
|
+
return { selection, range };
|
|
1845
|
+
};
|
|
1846
|
+
const closestWithin = (node, selector) => {
|
|
1847
|
+
const el = root();
|
|
1848
|
+
if (!el) {
|
|
1849
|
+
return null;
|
|
1850
|
+
}
|
|
1851
|
+
let current = node instanceof HTMLElement ? node : (node?.parentElement ?? null);
|
|
1852
|
+
while (current && el.contains(current)) {
|
|
1853
|
+
if (current.matches(selector)) {
|
|
1854
|
+
return current;
|
|
1829
1855
|
}
|
|
1830
|
-
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1856
|
+
current = current.parentElement;
|
|
1857
|
+
}
|
|
1858
|
+
return null;
|
|
1859
|
+
};
|
|
1860
|
+
const selectNodeContents = (node) => {
|
|
1861
|
+
const selection = doc.getSelection();
|
|
1862
|
+
if (!selection) {
|
|
1835
1863
|
return;
|
|
1836
1864
|
}
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
selector: '[etSelectionListControl]',
|
|
1846
|
-
host: {
|
|
1847
|
-
'[attr.role]': '"option"',
|
|
1848
|
-
'[attr.aria-checked]': 'ariaChecked()',
|
|
1849
|
-
'[attr.aria-disabled]': 'list.disabled() || null',
|
|
1850
|
-
'[attr.tabindex]': 'list.disabled() ? -1 : 0',
|
|
1851
|
-
'(click)': 'toggle()',
|
|
1852
|
-
'(keydown.space)': 'toggle(); $event.preventDefault()',
|
|
1853
|
-
'(keydown.enter)': 'toggle(); $event.preventDefault()',
|
|
1854
|
-
},
|
|
1855
|
-
}]
|
|
1856
|
-
}] });
|
|
1857
|
-
let uniqueControlLabelId = 0;
|
|
1858
|
-
|
|
1859
|
-
class SelectionListDirective {
|
|
1860
|
-
constructor() {
|
|
1861
|
-
this.formField = inject(FORM_FIELD_TOKEN, { optional: true });
|
|
1862
|
-
this.destroyRef = inject(DestroyRef);
|
|
1863
|
-
this.multipleOverride = inject(SELECTION_LIST_MULTIPLE, { optional: true });
|
|
1864
|
-
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1865
|
-
this.touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
1866
|
-
this.multipleInput = input(false, { ...(ngDevMode ? { debugName: "multipleInput" } : /* istanbul ignore next */ {}), alias: 'multiple' });
|
|
1867
|
-
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1868
|
-
this.invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
1869
|
-
this.errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1870
|
-
this.required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
1871
|
-
this.name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1872
|
-
this.multiple = computed(() => this.multipleOverride ?? this.multipleInput(), ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
1873
|
-
this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
1874
|
-
this.shouldDisplayError = computed(() => this.touched() && this.invalid(), ...(ngDevMode ? [{ debugName: "shouldDisplayError" }] : /* istanbul ignore next */ []));
|
|
1875
|
-
this.role = computed(() => (this.multiple() ? 'group' : 'radiogroup'), ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
1876
|
-
this.describedBy = signal(null, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
1877
|
-
this.controlType = signal(FORM_FIELD_CONTROL_TYPES.SELECTION_LIST, ...(ngDevMode ? [{ debugName: "controlType" }] : /* istanbul ignore next */ []));
|
|
1878
|
-
this.describedById = computed(() => this.describedBy(), ...(ngDevMode ? [{ debugName: "describedById" }] : /* istanbul ignore next */ []));
|
|
1879
|
-
this.labelId = computed(() => this.formField?.registeredLabel()?.id() ?? null, ...(ngDevMode ? [{ debugName: "labelId" }] : /* istanbul ignore next */ []));
|
|
1880
|
-
this.allSelected = computed(() => {
|
|
1881
|
-
const list = this.items();
|
|
1882
|
-
if (list.length === 0) {
|
|
1883
|
-
return false;
|
|
1884
|
-
}
|
|
1885
|
-
return list.every((item) => item.checked());
|
|
1886
|
-
}, ...(ngDevMode ? [{ debugName: "allSelected" }] : /* istanbul ignore next */ []));
|
|
1887
|
-
this.someSelected = computed(() => {
|
|
1888
|
-
const list = this.items();
|
|
1889
|
-
if (list.length === 0) {
|
|
1890
|
-
return false;
|
|
1891
|
-
}
|
|
1892
|
-
const checkedCount = list.filter((item) => item.checked()).length;
|
|
1893
|
-
return checkedCount > 0 && checkedCount < list.length;
|
|
1894
|
-
}, ...(ngDevMode ? [{ debugName: "someSelected" }] : /* istanbul ignore next */ []));
|
|
1895
|
-
this.formField?.registerControl(this);
|
|
1896
|
-
this.destroyRef.onDestroy(() => this.formField?.unregisterControl(this));
|
|
1897
|
-
effect(() => {
|
|
1898
|
-
const currentValue = this.value();
|
|
1899
|
-
const currentItems = this.items();
|
|
1900
|
-
if (currentItems.length === 0) {
|
|
1901
|
-
return;
|
|
1902
|
-
}
|
|
1903
|
-
untracked(() => {
|
|
1904
|
-
if (this.multiple()) {
|
|
1905
|
-
const valueArray = Array.isArray(currentValue) ? currentValue : [];
|
|
1906
|
-
for (const item of currentItems) {
|
|
1907
|
-
item.checked.set(valueArray.includes(item.value()));
|
|
1908
|
-
}
|
|
1909
|
-
}
|
|
1910
|
-
else {
|
|
1911
|
-
for (const item of currentItems) {
|
|
1912
|
-
item.checked.set(item.value() === currentValue);
|
|
1913
|
-
}
|
|
1914
|
-
}
|
|
1915
|
-
});
|
|
1916
|
-
});
|
|
1917
|
-
}
|
|
1918
|
-
registerItem(item) {
|
|
1919
|
-
this.items.update((items) => [...items, item]);
|
|
1920
|
-
}
|
|
1921
|
-
unregisterItem(item) {
|
|
1922
|
-
this.items.update((items) => items.filter((i) => i !== item));
|
|
1923
|
-
}
|
|
1924
|
-
markTouched() {
|
|
1925
|
-
this.touched.set(true);
|
|
1926
|
-
}
|
|
1927
|
-
select(item) {
|
|
1928
|
-
if (this.disabled() || item.disabled()) {
|
|
1865
|
+
const range = doc.createRange();
|
|
1866
|
+
range.selectNodeContents(node);
|
|
1867
|
+
selection.removeAllRanges();
|
|
1868
|
+
selection.addRange(range);
|
|
1869
|
+
};
|
|
1870
|
+
const selectAcross = (first, last) => {
|
|
1871
|
+
const selection = doc.getSelection();
|
|
1872
|
+
if (!selection) {
|
|
1929
1873
|
return;
|
|
1930
1874
|
}
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1875
|
+
const range = doc.createRange();
|
|
1876
|
+
range.setStartBefore(first);
|
|
1877
|
+
range.setEndAfter(last);
|
|
1878
|
+
selection.removeAllRanges();
|
|
1879
|
+
selection.addRange(range);
|
|
1880
|
+
};
|
|
1881
|
+
const collapseInto = (node, offset) => {
|
|
1882
|
+
const selection = doc.getSelection();
|
|
1883
|
+
if (!selection) {
|
|
1884
|
+
return;
|
|
1936
1885
|
}
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1886
|
+
const range = doc.createRange();
|
|
1887
|
+
range.setStart(node, offset);
|
|
1888
|
+
range.collapse(true);
|
|
1889
|
+
selection.removeAllRanges();
|
|
1890
|
+
selection.addRange(range);
|
|
1891
|
+
};
|
|
1892
|
+
const unwrapElement = (el) => {
|
|
1893
|
+
const parent = el.parentNode;
|
|
1894
|
+
if (!parent) {
|
|
1895
|
+
return;
|
|
1942
1896
|
}
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1897
|
+
while (el.firstChild) {
|
|
1898
|
+
renderer.insertBefore(parent, el.firstChild, el);
|
|
1899
|
+
}
|
|
1900
|
+
renderer.removeChild(parent, el);
|
|
1901
|
+
};
|
|
1902
|
+
const replaceWith = (oldEl, newNodes) => {
|
|
1903
|
+
const parent = oldEl.parentNode;
|
|
1904
|
+
if (!parent) {
|
|
1949
1905
|
return;
|
|
1950
1906
|
}
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1907
|
+
newNodes.forEach((node) => renderer.insertBefore(parent, node, oldEl));
|
|
1908
|
+
renderer.removeChild(parent, oldEl);
|
|
1909
|
+
};
|
|
1910
|
+
const collectDescendants = (node, selector) => {
|
|
1911
|
+
const out = [];
|
|
1912
|
+
node.childNodes.forEach((child) => {
|
|
1913
|
+
if (child instanceof HTMLElement) {
|
|
1914
|
+
if (child.matches(selector)) {
|
|
1915
|
+
out.push(child);
|
|
1916
|
+
}
|
|
1917
|
+
out.push(...collectDescendants(child, selector));
|
|
1955
1918
|
}
|
|
1919
|
+
});
|
|
1920
|
+
return out;
|
|
1921
|
+
};
|
|
1922
|
+
const childrenByTag = (parent, tag) => {
|
|
1923
|
+
const out = [];
|
|
1924
|
+
Array.from(parent.children).forEach((child) => {
|
|
1925
|
+
if (child instanceof HTMLElement && child.tagName.toLowerCase() === tag) {
|
|
1926
|
+
out.push(child);
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1929
|
+
return out;
|
|
1930
|
+
};
|
|
1931
|
+
const blocksInRange = (range) => {
|
|
1932
|
+
const el = root();
|
|
1933
|
+
const blocks = [];
|
|
1934
|
+
el?.childNodes.forEach((child) => {
|
|
1935
|
+
if (range.intersectsNode(child)) {
|
|
1936
|
+
blocks.push(child);
|
|
1937
|
+
}
|
|
1938
|
+
});
|
|
1939
|
+
return blocks;
|
|
1940
|
+
};
|
|
1941
|
+
const isBlockEmpty = (el) => (el.textContent ?? '').trim().length === 0;
|
|
1942
|
+
const wrapInline = (range, tag) => {
|
|
1943
|
+
const wrapper = renderer.createElement(tag);
|
|
1944
|
+
try {
|
|
1945
|
+
range.surroundContents(wrapper);
|
|
1946
|
+
}
|
|
1947
|
+
catch {
|
|
1948
|
+
renderer.appendChild(wrapper, range.extractContents());
|
|
1949
|
+
range.insertNode(wrapper);
|
|
1950
|
+
}
|
|
1951
|
+
collectDescendants(wrapper, tag).forEach((nested) => unwrapElement(nested));
|
|
1952
|
+
selectNodeContents(wrapper);
|
|
1953
|
+
};
|
|
1954
|
+
const pathFromAncestor = (ancestor, node) => {
|
|
1955
|
+
const path = [];
|
|
1956
|
+
let current = node;
|
|
1957
|
+
while (current && current !== ancestor) {
|
|
1958
|
+
const parent = current.parentNode;
|
|
1959
|
+
if (!parent) {
|
|
1960
|
+
return null;
|
|
1961
|
+
}
|
|
1962
|
+
path.unshift(Array.from(parent.childNodes).indexOf(current));
|
|
1963
|
+
current = parent;
|
|
1956
1964
|
}
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
this.focusItem(firstItem);
|
|
1966
|
-
}
|
|
1967
|
-
}
|
|
1968
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SelectionListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1969
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: SelectionListDirective, isStandalone: true, selector: "[etSelectionList]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, multipleInput: { classPropertyName: "multipleInput", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, host: { properties: { "attr.role": "role()", "attr.aria-invalid": "shouldDisplayError() || null", "attr.aria-required": "required() || null", "attr.aria-describedby": "describedById() || null", "attr.aria-labelledby": "labelId() || null", "attr.data-disabled": "disabled() || null" } }, providers: [{ provide: SELECTION_LIST_TOKEN, useExisting: SelectionListDirective }], ngImport: i0 }); }
|
|
1970
|
-
}
|
|
1971
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SelectionListDirective, decorators: [{
|
|
1972
|
-
type: Directive,
|
|
1973
|
-
args: [{
|
|
1974
|
-
selector: '[etSelectionList]',
|
|
1975
|
-
providers: [{ provide: SELECTION_LIST_TOKEN, useExisting: SelectionListDirective }],
|
|
1976
|
-
host: {
|
|
1977
|
-
'[attr.role]': 'role()',
|
|
1978
|
-
'[attr.aria-invalid]': 'shouldDisplayError() || null',
|
|
1979
|
-
'[attr.aria-required]': 'required() || null',
|
|
1980
|
-
'[attr.aria-describedby]': 'describedById() || null',
|
|
1981
|
-
'[attr.aria-labelledby]': 'labelId() || null',
|
|
1982
|
-
'[attr.data-disabled]': 'disabled() || null',
|
|
1983
|
-
},
|
|
1984
|
-
}]
|
|
1985
|
-
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], multipleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
|
|
1986
|
-
|
|
1987
|
-
let uniqueOptionLabelId = 0;
|
|
1988
|
-
class SelectionOptionDirective {
|
|
1989
|
-
constructor() {
|
|
1990
|
-
this.list = inject(SELECTION_LIST_TOKEN, { optional: true });
|
|
1991
|
-
this.destroyRef = inject(DestroyRef);
|
|
1992
|
-
this.el = inject(ElementRef);
|
|
1993
|
-
this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1994
|
-
this.checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
1995
|
-
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1996
|
-
this.effectiveDisabled = computed(() => this.disabled() || (this.list?.disabled() ?? false), ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
1997
|
-
this.role = computed(() => (this.list?.multiple() ? 'option' : 'radio'), ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
1998
|
-
this.labelId = signal(`et-selection-option-label-${uniqueOptionLabelId++}`, ...(ngDevMode ? [{ debugName: "labelId" }] : /* istanbul ignore next */ []));
|
|
1999
|
-
this.listItem = {
|
|
2000
|
-
value: this.value,
|
|
2001
|
-
checked: this.checked,
|
|
2002
|
-
disabled: this.effectiveDisabled,
|
|
2003
|
-
elementRef: this.el,
|
|
2004
|
-
};
|
|
2005
|
-
this.tabindex = computed(() => {
|
|
2006
|
-
if (this.effectiveDisabled()) {
|
|
2007
|
-
return -1;
|
|
1965
|
+
return current === ancestor ? path : null;
|
|
1966
|
+
};
|
|
1967
|
+
const resolvePath = (ancestor, path) => {
|
|
1968
|
+
let current = ancestor;
|
|
1969
|
+
for (const index of path) {
|
|
1970
|
+
const next = current.childNodes[index];
|
|
1971
|
+
if (!next) {
|
|
1972
|
+
return null;
|
|
2008
1973
|
}
|
|
2009
|
-
|
|
2010
|
-
|
|
1974
|
+
current = next;
|
|
1975
|
+
}
|
|
1976
|
+
return current;
|
|
1977
|
+
};
|
|
1978
|
+
// `range.cloneContents()` collapses to plain text whenever the range's start and end share a
|
|
1979
|
+
// container (the common case when the whole marked run is selected) — it can't reconstruct any
|
|
1980
|
+
// ancestor elements in that situation, so nested marks (e.g. an <em> inside the <strong> being
|
|
1981
|
+
// unbolded) would be silently dropped. Work around it by trimming a clone of `markEl` down to
|
|
1982
|
+
// the selected span instead, which preserves every nested element other than `markEl` itself.
|
|
1983
|
+
const extractMarkedMiddle = (markEl, range) => {
|
|
1984
|
+
const startPath = pathFromAncestor(markEl, range.startContainer);
|
|
1985
|
+
const endPath = pathFromAncestor(markEl, range.endContainer);
|
|
1986
|
+
if (!startPath || !endPath) {
|
|
1987
|
+
return Array.from(range.cloneContents().childNodes);
|
|
1988
|
+
}
|
|
1989
|
+
const clone = markEl.cloneNode(true);
|
|
1990
|
+
const clonedStart = resolvePath(clone, startPath);
|
|
1991
|
+
const clonedEnd = resolvePath(clone, endPath);
|
|
1992
|
+
if (!clonedStart || !clonedEnd) {
|
|
1993
|
+
return Array.from(range.cloneContents().childNodes);
|
|
1994
|
+
}
|
|
1995
|
+
const trimAfter = doc.createRange();
|
|
1996
|
+
trimAfter.setStart(clonedEnd, range.endOffset);
|
|
1997
|
+
trimAfter.setEnd(clone, clone.childNodes.length);
|
|
1998
|
+
trimAfter.deleteContents();
|
|
1999
|
+
const trimBefore = doc.createRange();
|
|
2000
|
+
trimBefore.setStart(clone, 0);
|
|
2001
|
+
trimBefore.setEnd(clonedStart, range.startOffset);
|
|
2002
|
+
trimBefore.deleteContents();
|
|
2003
|
+
return Array.from(clone.childNodes);
|
|
2004
|
+
};
|
|
2005
|
+
// A mark wrapping nothing but whitespace has no markdown representation (`** **` isn't valid
|
|
2006
|
+
// CommonMark emphasis), so a before/after split must never leave one behind — fall through to
|
|
2007
|
+
// plain, unwrapped text for a whitespace-only slice instead of re-wrapping it in `tag`.
|
|
2008
|
+
const markSegmentNodes = (frag, tag) => {
|
|
2009
|
+
const text = frag.textContent ?? '';
|
|
2010
|
+
if (text.length === 0) {
|
|
2011
|
+
return [];
|
|
2012
|
+
}
|
|
2013
|
+
if (text.trim().length === 0) {
|
|
2014
|
+
return Array.from(frag.childNodes);
|
|
2015
|
+
}
|
|
2016
|
+
const wrapper = renderer.createElement(tag);
|
|
2017
|
+
renderer.appendChild(wrapper, frag);
|
|
2018
|
+
return [wrapper];
|
|
2019
|
+
};
|
|
2020
|
+
const unwrapInline = (range, tag) => {
|
|
2021
|
+
const startEl = closestWithin(range.startContainer, tag);
|
|
2022
|
+
const endEl = closestWithin(range.endContainer, tag);
|
|
2023
|
+
if (startEl && startEl === endEl) {
|
|
2024
|
+
const beforeRange = doc.createRange();
|
|
2025
|
+
beforeRange.selectNodeContents(startEl);
|
|
2026
|
+
beforeRange.setEnd(range.startContainer, range.startOffset);
|
|
2027
|
+
const afterRange = doc.createRange();
|
|
2028
|
+
afterRange.selectNodeContents(startEl);
|
|
2029
|
+
afterRange.setStart(range.endContainer, range.endOffset);
|
|
2030
|
+
const beforeFrag = beforeRange.cloneContents();
|
|
2031
|
+
const afterFrag = afterRange.cloneContents();
|
|
2032
|
+
const selectedNodes = extractMarkedMiddle(startEl, range);
|
|
2033
|
+
const replacement = [];
|
|
2034
|
+
replacement.push(...markSegmentNodes(beforeFrag, tag));
|
|
2035
|
+
selectedNodes.forEach((node) => replacement.push(node));
|
|
2036
|
+
replacement.push(...markSegmentNodes(afterFrag, tag));
|
|
2037
|
+
replaceWith(startEl, replacement);
|
|
2038
|
+
const first = selectedNodes[0];
|
|
2039
|
+
const last = selectedNodes[selectedNodes.length - 1];
|
|
2040
|
+
if (first && last) {
|
|
2041
|
+
selectAcross(first, last);
|
|
2011
2042
|
}
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2043
|
+
return;
|
|
2044
|
+
}
|
|
2045
|
+
const affected = new Set();
|
|
2046
|
+
if (startEl)
|
|
2047
|
+
affected.add(startEl);
|
|
2048
|
+
if (endEl)
|
|
2049
|
+
affected.add(endEl);
|
|
2050
|
+
const el = root();
|
|
2051
|
+
if (el) {
|
|
2052
|
+
collectDescendants(el, tag).forEach((marked) => {
|
|
2053
|
+
if (range.intersectsNode(marked)) {
|
|
2054
|
+
affected.add(marked);
|
|
2055
|
+
}
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2058
|
+
affected.forEach((marked) => unwrapElement(marked));
|
|
2059
|
+
};
|
|
2060
|
+
const unwrapList = (list) => {
|
|
2061
|
+
const paragraphs = [];
|
|
2062
|
+
childrenByTag(list, 'li').forEach((li) => {
|
|
2063
|
+
const paragraph = renderer.createElement('p');
|
|
2064
|
+
while (li.firstChild) {
|
|
2065
|
+
renderer.appendChild(paragraph, li.firstChild);
|
|
2016
2066
|
}
|
|
2017
|
-
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2067
|
+
paragraphs.push(paragraph);
|
|
2068
|
+
});
|
|
2069
|
+
replaceWith(list, paragraphs);
|
|
2070
|
+
const first = paragraphs[0];
|
|
2071
|
+
const last = paragraphs[paragraphs.length - 1];
|
|
2072
|
+
if (first && last) {
|
|
2073
|
+
selectAcross(first, last);
|
|
2023
2074
|
}
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
|
|
2075
|
+
};
|
|
2076
|
+
const exitListItem = (li) => {
|
|
2077
|
+
const list = li.parentElement;
|
|
2078
|
+
const parent = list?.parentNode;
|
|
2079
|
+
if (!list || !parent) {
|
|
2027
2080
|
return;
|
|
2028
2081
|
}
|
|
2029
|
-
|
|
2030
|
-
|
|
2082
|
+
const tag = list.tagName.toLowerCase();
|
|
2083
|
+
// Element siblings after the empty item move into a continuation list of the same type.
|
|
2084
|
+
const trailing = [];
|
|
2085
|
+
let sibling = li.nextElementSibling;
|
|
2086
|
+
while (sibling) {
|
|
2087
|
+
trailing.push(sibling);
|
|
2088
|
+
sibling = sibling.nextElementSibling;
|
|
2089
|
+
}
|
|
2090
|
+
const paragraph = renderer.createElement('p');
|
|
2091
|
+
const refAfterList = list.nextSibling;
|
|
2092
|
+
// Carry over whatever the (empty) item held — typically the <br> a browser inserts so an
|
|
2093
|
+
// empty line still has a caret-able line box. Without one, a bare <p> can end up with no
|
|
2094
|
+
// line box at all, and the caret falls through to the next focusable position instead.
|
|
2095
|
+
while (li.firstChild) {
|
|
2096
|
+
renderer.appendChild(paragraph, li.firstChild);
|
|
2097
|
+
}
|
|
2098
|
+
if (!paragraph.firstChild) {
|
|
2099
|
+
renderer.appendChild(paragraph, renderer.createElement('br'));
|
|
2100
|
+
}
|
|
2101
|
+
if (trailing.length > 0) {
|
|
2102
|
+
const continuation = renderer.createElement(tag);
|
|
2103
|
+
trailing.forEach((item) => renderer.appendChild(continuation, item));
|
|
2104
|
+
renderer.insertBefore(parent, continuation, refAfterList);
|
|
2105
|
+
renderer.insertBefore(parent, paragraph, continuation);
|
|
2031
2106
|
}
|
|
2032
2107
|
else {
|
|
2033
|
-
|
|
2108
|
+
renderer.insertBefore(parent, paragraph, refAfterList);
|
|
2034
2109
|
}
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
this.list.markTouched();
|
|
2110
|
+
renderer.removeChild(list, li);
|
|
2111
|
+
if (childrenByTag(list, 'li').length === 0) {
|
|
2112
|
+
renderer.removeChild(parent, list);
|
|
2039
2113
|
}
|
|
2040
|
-
|
|
2114
|
+
collapseInto(paragraph, 0);
|
|
2115
|
+
};
|
|
2116
|
+
const mergeParagraphIntoPreviousList = (paragraph) => {
|
|
2117
|
+
const previous = paragraph.previousElementSibling;
|
|
2118
|
+
const tag = previous?.tagName.toLowerCase();
|
|
2119
|
+
if (!previous || (tag !== 'ul' && tag !== 'ol')) {
|
|
2120
|
+
return false;
|
|
2121
|
+
}
|
|
2122
|
+
const items = childrenByTag(previous, 'li');
|
|
2123
|
+
const lastLi = items[items.length - 1];
|
|
2124
|
+
if (!lastLi) {
|
|
2125
|
+
return false;
|
|
2126
|
+
}
|
|
2127
|
+
const parent = paragraph.parentNode;
|
|
2128
|
+
if (parent) {
|
|
2129
|
+
renderer.removeChild(parent, paragraph);
|
|
2130
|
+
}
|
|
2131
|
+
const selection = doc.getSelection();
|
|
2132
|
+
if (selection) {
|
|
2133
|
+
const range = doc.createRange();
|
|
2134
|
+
range.selectNodeContents(lastLi);
|
|
2135
|
+
range.collapse(false);
|
|
2136
|
+
selection.removeAllRanges();
|
|
2137
|
+
selection.addRange(range);
|
|
2138
|
+
}
|
|
2139
|
+
return true;
|
|
2140
|
+
};
|
|
2141
|
+
const markStates = () => {
|
|
2142
|
+
const editable = getSelection();
|
|
2143
|
+
if (!editable) {
|
|
2144
|
+
return null;
|
|
2145
|
+
}
|
|
2146
|
+
const node = editable.range.startContainer;
|
|
2147
|
+
return {
|
|
2148
|
+
bold: !!closestWithin(node, 'strong'),
|
|
2149
|
+
italic: !!closestWithin(node, 'em'),
|
|
2150
|
+
strike: !!closestWithin(node, 'del'),
|
|
2151
|
+
unorderedList: !!closestWithin(node, 'ul'),
|
|
2152
|
+
orderedList: !!closestWithin(node, 'ol'),
|
|
2153
|
+
link: !!closestWithin(node, 'a'),
|
|
2154
|
+
};
|
|
2155
|
+
};
|
|
2156
|
+
// wrapInline's surroundContents fallback can leave behind an untouched sibling with the same
|
|
2157
|
+
// tag right next to the new wrapper (e.g. selecting partway into an already-bold word produces
|
|
2158
|
+
// two adjacent `<strong>` elements). Left unmerged, markdown serialization emits a delimiter per
|
|
2159
|
+
// element (duplicated `**` markers), so collapse adjacent same-tag runs back into one.
|
|
2160
|
+
const mergeAdjacentSameTag = (tag) => {
|
|
2161
|
+
const el = root();
|
|
2162
|
+
if (!el) {
|
|
2163
|
+
return;
|
|
2164
|
+
}
|
|
2165
|
+
let merged = true;
|
|
2166
|
+
while (merged) {
|
|
2167
|
+
merged = false;
|
|
2168
|
+
for (const node of collectDescendants(el, tag)) {
|
|
2169
|
+
const next = node.nextSibling;
|
|
2170
|
+
if (next instanceof HTMLElement && next.tagName.toLowerCase() === tag) {
|
|
2171
|
+
while (next.firstChild) {
|
|
2172
|
+
renderer.appendChild(node, next.firstChild);
|
|
2173
|
+
}
|
|
2174
|
+
renderer.removeChild(next.parentNode, next);
|
|
2175
|
+
merged = true;
|
|
2176
|
+
break;
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
};
|
|
2181
|
+
// wrapInline's surroundContents fallback uses Range.extractContents(), which — per spec —
|
|
2182
|
+
// leaves the original ancestor element in place (now empty) whenever the range's boundary
|
|
2183
|
+
// fully consumes that ancestor's content, since only a clone of it travels into the extracted
|
|
2184
|
+
// fragment. That empty shell can be of any of the three inline tags, not just the one being
|
|
2185
|
+
// toggled (e.g. italicizing text that starts inside a <strong> can strand an empty <strong>).
|
|
2186
|
+
const pruneEmptyInline = () => {
|
|
2187
|
+
const el = root();
|
|
2188
|
+
if (!el) {
|
|
2189
|
+
return;
|
|
2190
|
+
}
|
|
2191
|
+
const tags = ['strong', 'em', 'del'];
|
|
2192
|
+
let removed = true;
|
|
2193
|
+
while (removed) {
|
|
2194
|
+
removed = false;
|
|
2195
|
+
for (const t of tags) {
|
|
2196
|
+
for (const node of collectDescendants(el, t)) {
|
|
2197
|
+
// extractContents() fully drains a wholly-selected text node's data via replaceData
|
|
2198
|
+
// rather than removing the node, so an "empty" shell can still hold a zero-length
|
|
2199
|
+
// Text child — check textContent, not childNodes.length, to catch that case too.
|
|
2200
|
+
if ((node.textContent ?? '').length === 0) {
|
|
2201
|
+
renderer.removeChild(node.parentNode, node);
|
|
2202
|
+
removed = true;
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
// A mark applied to whitespace at the very edge of the selection is invisible and has no
|
|
2209
|
+
// markdown representation, so shrink the range inward past any leading/trailing whitespace
|
|
2210
|
+
// before (un)marking it — matching how most rich text editors ignore edge whitespace on toggle.
|
|
2211
|
+
const trimRangeWhitespace = (range) => {
|
|
2212
|
+
if (range.collapsed) {
|
|
2213
|
+
return;
|
|
2214
|
+
}
|
|
2215
|
+
const { startContainer, endContainer } = range;
|
|
2216
|
+
if (startContainer.nodeType === Node.TEXT_NODE) {
|
|
2217
|
+
const data = startContainer.textContent ?? '';
|
|
2218
|
+
const limit = startContainer === endContainer ? range.endOffset : data.length;
|
|
2219
|
+
let offset = range.startOffset;
|
|
2220
|
+
while (offset < limit && /\s/.test(data[offset] ?? '')) {
|
|
2221
|
+
offset++;
|
|
2222
|
+
}
|
|
2223
|
+
range.setStart(startContainer, offset);
|
|
2224
|
+
}
|
|
2225
|
+
if (range.collapsed) {
|
|
2226
|
+
return;
|
|
2227
|
+
}
|
|
2228
|
+
if (endContainer.nodeType === Node.TEXT_NODE) {
|
|
2229
|
+
const data = endContainer.textContent ?? '';
|
|
2230
|
+
const limit = endContainer === startContainer ? range.startOffset : 0;
|
|
2231
|
+
let offset = range.endOffset;
|
|
2232
|
+
while (offset > limit && /\s/.test(data[offset - 1] ?? '')) {
|
|
2233
|
+
offset--;
|
|
2234
|
+
}
|
|
2235
|
+
range.setEnd(endContainer, offset);
|
|
2236
|
+
}
|
|
2237
|
+
};
|
|
2238
|
+
const toggleInline = (tag) => {
|
|
2239
|
+
const editable = getSelection();
|
|
2240
|
+
const el = root();
|
|
2241
|
+
if (!el || !editable || editable.range.collapsed) {
|
|
2242
|
+
return;
|
|
2243
|
+
}
|
|
2244
|
+
trimRangeWhitespace(editable.range);
|
|
2245
|
+
if (editable.range.collapsed) {
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
const { range } = editable;
|
|
2249
|
+
const fullyMarked = !!closestWithin(range.startContainer, tag) && !!closestWithin(range.endContainer, tag);
|
|
2250
|
+
if (fullyMarked) {
|
|
2251
|
+
unwrapInline(range, tag);
|
|
2252
|
+
}
|
|
2253
|
+
else {
|
|
2254
|
+
wrapInline(range, tag);
|
|
2255
|
+
}
|
|
2256
|
+
pruneEmptyInline();
|
|
2257
|
+
mergeAdjacentSameTag(tag);
|
|
2258
|
+
el.normalize();
|
|
2259
|
+
};
|
|
2260
|
+
const toggleList = (listTag) => {
|
|
2261
|
+
const editable = getSelection();
|
|
2262
|
+
const el = root();
|
|
2263
|
+
if (!el || !editable) {
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2266
|
+
const existingList = closestWithin(editable.range.startContainer, listTag);
|
|
2267
|
+
if (existingList) {
|
|
2268
|
+
unwrapList(existingList);
|
|
2269
|
+
el.normalize();
|
|
2270
|
+
return;
|
|
2271
|
+
}
|
|
2272
|
+
const blocks = blocksInRange(editable.range);
|
|
2273
|
+
if (blocks.length === 0) {
|
|
2274
|
+
return;
|
|
2275
|
+
}
|
|
2276
|
+
const list = renderer.createElement(listTag);
|
|
2277
|
+
blocks.forEach((block) => {
|
|
2278
|
+
const li = renderer.createElement('li');
|
|
2279
|
+
if (block.nodeType === Node.TEXT_NODE) {
|
|
2280
|
+
renderer.appendChild(li, block.cloneNode(true));
|
|
2281
|
+
}
|
|
2282
|
+
else {
|
|
2283
|
+
while (block.firstChild) {
|
|
2284
|
+
renderer.appendChild(li, block.firstChild);
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
renderer.appendChild(list, li);
|
|
2288
|
+
});
|
|
2289
|
+
renderer.insertBefore(el, list, blocks[0] ?? null);
|
|
2290
|
+
blocks.forEach((block) => {
|
|
2291
|
+
if (block.parentNode === el) {
|
|
2292
|
+
renderer.removeChild(el, block);
|
|
2293
|
+
}
|
|
2294
|
+
});
|
|
2295
|
+
selectNodeContents(list);
|
|
2296
|
+
el.normalize();
|
|
2297
|
+
};
|
|
2298
|
+
const applyLink = (href) => {
|
|
2299
|
+
const editable = getSelection();
|
|
2300
|
+
if (!editable) {
|
|
2301
|
+
return;
|
|
2302
|
+
}
|
|
2303
|
+
const existing = closestWithin(editable.range.startContainer, 'a');
|
|
2304
|
+
if (existing) {
|
|
2305
|
+
renderer.setAttribute(existing, 'href', href);
|
|
2306
|
+
return;
|
|
2307
|
+
}
|
|
2308
|
+
if (editable.range.collapsed) {
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
const el = root();
|
|
2312
|
+
const anchor = renderer.createElement('a');
|
|
2313
|
+
renderer.setAttribute(anchor, 'href', href);
|
|
2314
|
+
try {
|
|
2315
|
+
editable.range.surroundContents(anchor);
|
|
2316
|
+
}
|
|
2317
|
+
catch {
|
|
2318
|
+
// The range crosses an existing <a> boundary (e.g. it starts before the anchor and ends
|
|
2319
|
+
// inside it) — surroundContents throws, so fall back to extract + insert. That fallback can
|
|
2320
|
+
// pull the whole existing anchor's content into the new one (nesting an <a> inside an <a>)
|
|
2321
|
+
// and, per Range.extractContents()'s spec, strand the drained original anchor as an empty
|
|
2322
|
+
// shell — both of which produce broken markdown (nested/empty link syntax).
|
|
2323
|
+
renderer.appendChild(anchor, editable.range.extractContents());
|
|
2324
|
+
editable.range.insertNode(anchor);
|
|
2325
|
+
}
|
|
2326
|
+
collectDescendants(anchor, 'a').forEach((nested) => unwrapElement(nested));
|
|
2327
|
+
if (el) {
|
|
2328
|
+
collectDescendants(el, 'a')
|
|
2329
|
+
.filter((node) => (node.textContent ?? '').length === 0)
|
|
2330
|
+
.forEach((empty) => renderer.removeChild(empty.parentNode, empty));
|
|
2331
|
+
el.normalize();
|
|
2332
|
+
}
|
|
2333
|
+
selectNodeContents(anchor);
|
|
2334
|
+
};
|
|
2335
|
+
const removeLink = () => {
|
|
2336
|
+
const editable = getSelection();
|
|
2337
|
+
const anchor = editable ? closestWithin(editable.range.startContainer, 'a') : null;
|
|
2338
|
+
const el = root();
|
|
2339
|
+
if (anchor && el) {
|
|
2340
|
+
unwrapElement(anchor);
|
|
2341
|
+
el.normalize();
|
|
2342
|
+
}
|
|
2343
|
+
};
|
|
2344
|
+
const insertToken = (node) => {
|
|
2345
|
+
const editable = getSelection();
|
|
2346
|
+
if (!editable) {
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2349
|
+
const { selection, range } = editable;
|
|
2350
|
+
range.deleteContents();
|
|
2351
|
+
range.insertNode(node);
|
|
2352
|
+
range.setStartAfter(node);
|
|
2353
|
+
range.collapse(true);
|
|
2354
|
+
selection.removeAllRanges();
|
|
2355
|
+
selection.addRange(range);
|
|
2356
|
+
};
|
|
2357
|
+
const handleBackspace = () => {
|
|
2358
|
+
const editable = getSelection();
|
|
2359
|
+
if (!editable || !editable.range.collapsed) {
|
|
2360
|
+
return false;
|
|
2361
|
+
}
|
|
2362
|
+
const node = editable.range.startContainer;
|
|
2363
|
+
const li = closestWithin(node, 'li');
|
|
2364
|
+
if (li && isBlockEmpty(li)) {
|
|
2365
|
+
exitListItem(li);
|
|
2366
|
+
return true;
|
|
2367
|
+
}
|
|
2368
|
+
const paragraph = closestWithin(node, 'p');
|
|
2369
|
+
if (paragraph && isBlockEmpty(paragraph)) {
|
|
2370
|
+
return mergeParagraphIntoPreviousList(paragraph);
|
|
2371
|
+
}
|
|
2372
|
+
return false;
|
|
2373
|
+
};
|
|
2374
|
+
return {
|
|
2375
|
+
root,
|
|
2376
|
+
getSelection,
|
|
2377
|
+
closestWithin,
|
|
2378
|
+
markStates,
|
|
2379
|
+
toggleInline,
|
|
2380
|
+
toggleList,
|
|
2381
|
+
applyLink,
|
|
2382
|
+
removeLink,
|
|
2383
|
+
insertToken,
|
|
2384
|
+
handleBackspace,
|
|
2385
|
+
};
|
|
2386
|
+
};
|
|
2387
|
+
const [provideRichTextEditorDom, injectRichTextEditorDom] = createProvider(richTextEditorDomFactory, {
|
|
2388
|
+
name: 'RichTextEditorDom',
|
|
2389
|
+
});
|
|
2390
|
+
|
|
2391
|
+
class RichTextEditorDirective {
|
|
2392
|
+
constructor() {
|
|
2393
|
+
this.formField = inject(FORM_FIELD_TOKEN, { optional: true });
|
|
2394
|
+
this.destroyRef = inject(DestroyRef);
|
|
2395
|
+
this.value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2396
|
+
this.touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
2397
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2398
|
+
this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
2399
|
+
this.hidden = input(false, ...(ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []));
|
|
2400
|
+
this.invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
2401
|
+
this.errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
2402
|
+
this.required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
2403
|
+
this.name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
2404
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2405
|
+
this.shouldDisplayError = computed(() => this.touched() && this.invalid(), ...(ngDevMode ? [{ debugName: "shouldDisplayError" }] : /* istanbul ignore next */ []));
|
|
2406
|
+
this.hasValue = computed(() => this.value().trim().length > 0, ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
2407
|
+
this.describedBy = signal(null, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
2408
|
+
this.controlType = signal(FORM_FIELD_CONTROL_TYPES.RICH_TEXT, ...(ngDevMode ? [{ debugName: "controlType" }] : /* istanbul ignore next */ []));
|
|
2409
|
+
this.focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
|
|
2410
|
+
this.labelId = computed(() => this.formField?.registeredLabel()?.id() ?? null, ...(ngDevMode ? [{ debugName: "labelId" }] : /* istanbul ignore next */ []));
|
|
2411
|
+
this.describedById = computed(() => this.describedBy(), ...(ngDevMode ? [{ debugName: "describedById" }] : /* istanbul ignore next */ []));
|
|
2412
|
+
this.boldActive = signal(false, ...(ngDevMode ? [{ debugName: "boldActive" }] : /* istanbul ignore next */ []));
|
|
2413
|
+
this.italicActive = signal(false, ...(ngDevMode ? [{ debugName: "italicActive" }] : /* istanbul ignore next */ []));
|
|
2414
|
+
this.strikeActive = signal(false, ...(ngDevMode ? [{ debugName: "strikeActive" }] : /* istanbul ignore next */ []));
|
|
2415
|
+
this.unorderedListActive = signal(false, ...(ngDevMode ? [{ debugName: "unorderedListActive" }] : /* istanbul ignore next */ []));
|
|
2416
|
+
this.orderedListActive = signal(false, ...(ngDevMode ? [{ debugName: "orderedListActive" }] : /* istanbul ignore next */ []));
|
|
2417
|
+
this.linkActive = signal(false, ...(ngDevMode ? [{ debugName: "linkActive" }] : /* istanbul ignore next */ []));
|
|
2418
|
+
/** @internal */
|
|
2419
|
+
this.lastEmittedMarkdown = null;
|
|
2420
|
+
/** @internal */
|
|
2421
|
+
this.editorDom = injectRichTextEditorDom();
|
|
2422
|
+
this.formField?.registerControl(this);
|
|
2423
|
+
this.destroyRef.onDestroy(() => this.formField?.unregisterControl(this));
|
|
2424
|
+
}
|
|
2425
|
+
activate() {
|
|
2426
|
+
if (this.disabled())
|
|
2427
|
+
return;
|
|
2428
|
+
const el = this.editorDom.root();
|
|
2429
|
+
// Re-focusing a contenteditable that already holds the caret collapses the selection to its
|
|
2430
|
+
// start, so only focus when the editor isn't already focused (e.g. a click on the frame padding).
|
|
2431
|
+
if (!el || el.ownerDocument.activeElement === el)
|
|
2432
|
+
return;
|
|
2433
|
+
el.focus();
|
|
2434
|
+
}
|
|
2435
|
+
syncFromDom() {
|
|
2436
|
+
const root = this.editorDom.root();
|
|
2437
|
+
if (!root)
|
|
2438
|
+
return;
|
|
2439
|
+
// Browsers create <div> line wrappers in contenteditable; map them to <p> so htmlToMarkdown
|
|
2440
|
+
// treats them as paragraph breaks instead of stripping the tags and merging lines.
|
|
2441
|
+
const html = root.innerHTML.replace(/<div>/gi, '<p>').replace(/<\/div>/gi, '</p>');
|
|
2442
|
+
const markdown = htmlToMarkdown(html);
|
|
2443
|
+
this.lastEmittedMarkdown = markdown;
|
|
2444
|
+
this.value.set(markdown);
|
|
2445
|
+
this.refreshActiveMarks();
|
|
2446
|
+
}
|
|
2447
|
+
refreshActiveMarks() {
|
|
2448
|
+
const states = this.editorDom.markStates();
|
|
2449
|
+
this.boldActive.set(states?.bold ?? false);
|
|
2450
|
+
this.italicActive.set(states?.italic ?? false);
|
|
2451
|
+
this.strikeActive.set(states?.strike ?? false);
|
|
2452
|
+
this.unorderedListActive.set(states?.unorderedList ?? false);
|
|
2453
|
+
this.orderedListActive.set(states?.orderedList ?? false);
|
|
2454
|
+
this.linkActive.set(states?.link ?? false);
|
|
2455
|
+
}
|
|
2456
|
+
toggleBold() {
|
|
2457
|
+
this.runCommand(() => this.editorDom.toggleInline('strong'));
|
|
2458
|
+
}
|
|
2459
|
+
toggleItalic() {
|
|
2460
|
+
this.runCommand(() => this.editorDom.toggleInline('em'));
|
|
2461
|
+
}
|
|
2462
|
+
toggleStrikethrough() {
|
|
2463
|
+
this.runCommand(() => this.editorDom.toggleInline('del'));
|
|
2464
|
+
}
|
|
2465
|
+
toggleUnorderedList() {
|
|
2466
|
+
this.runCommand(() => this.editorDom.toggleList('ul'));
|
|
2467
|
+
}
|
|
2468
|
+
toggleOrderedList() {
|
|
2469
|
+
this.runCommand(() => this.editorDom.toggleList('ol'));
|
|
2470
|
+
}
|
|
2471
|
+
setLink(href) {
|
|
2472
|
+
const url = href.trim();
|
|
2473
|
+
this.runCommand(() => (url ? this.editorDom.applyLink(url) : this.editorDom.removeLink()));
|
|
2474
|
+
}
|
|
2475
|
+
handleBackspace() {
|
|
2476
|
+
if (this.disabled() || this.readonly() || !this.editorDom.root())
|
|
2477
|
+
return false;
|
|
2478
|
+
const handled = this.editorDom.handleBackspace();
|
|
2479
|
+
if (handled) {
|
|
2480
|
+
this.syncFromDom();
|
|
2481
|
+
}
|
|
2482
|
+
return handled;
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* @internal Extension seam for the follow-up `@`/`#` autocomplete: inserts an atomic inline
|
|
2486
|
+
* node (a mention/placeholder token) at the caret, then re-syncs.
|
|
2487
|
+
*/
|
|
2488
|
+
insertAtomicToken(node) {
|
|
2489
|
+
if (this.disabled() || this.readonly() || !this.editorDom.root())
|
|
2490
|
+
return;
|
|
2491
|
+
this.editorDom.insertToken(node);
|
|
2492
|
+
this.syncFromDom();
|
|
2493
|
+
}
|
|
2494
|
+
runCommand(command) {
|
|
2495
|
+
if (this.disabled() || this.readonly() || !this.editorDom.root())
|
|
2496
|
+
return;
|
|
2497
|
+
command();
|
|
2498
|
+
this.syncFromDom();
|
|
2499
|
+
}
|
|
2500
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: RichTextEditorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2501
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: RichTextEditorDirective, isStandalone: true, selector: "[etRichTextEditor]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", 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 }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, providers: [provideRichTextEditorDom()], ngImport: i0 }); }
|
|
2502
|
+
}
|
|
2503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: RichTextEditorDirective, decorators: [{
|
|
2504
|
+
type: Directive,
|
|
2505
|
+
args: [{
|
|
2506
|
+
selector: '[etRichTextEditor]',
|
|
2507
|
+
providers: [provideRichTextEditorDom()],
|
|
2508
|
+
}]
|
|
2509
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
|
|
2510
|
+
|
|
2511
|
+
const ARROW_OUT_UP_RIGHT_ICON = {
|
|
2512
|
+
name: 'et-arrow-out-up-right',
|
|
2513
|
+
data: `
|
|
2514
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2515
|
+
<path
|
|
2516
|
+
fill="currentColor"
|
|
2517
|
+
d="M5 6.75A1.75 1.75 0 0 1 6.75 5h4.5a.75.75 0 0 1 0 1.5h-4.5a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-4.5a.75.75 0 0 1 1.5 0v4.5A1.75 1.75 0 0 1 17.25 19H6.75A1.75 1.75 0 0 1 5 17.25V6.75Z"
|
|
2518
|
+
/>
|
|
2519
|
+
<path
|
|
2520
|
+
fill="currentColor"
|
|
2521
|
+
d="M11.5 5.75c0-.414.336-.75.75-.75h6c.414 0 .75.336.75.75v6a.75.75 0 0 1-1.5 0V7.56l-6.72 6.72a.75.75 0 1 1-1.06-1.06l6.72-6.72h-4.19a.75.75 0 0 1-.75-.75Z"
|
|
2522
|
+
/>
|
|
2523
|
+
</svg>
|
|
2524
|
+
`,
|
|
2525
|
+
};
|
|
2526
|
+
|
|
2527
|
+
const ARROW_RIGHT_ICON = {
|
|
2528
|
+
name: 'et-arrow-right',
|
|
2529
|
+
data: `
|
|
2530
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2531
|
+
<path
|
|
2532
|
+
d="M4 12h14"
|
|
2533
|
+
stroke="currentColor"
|
|
2534
|
+
stroke-width="1.8"
|
|
2535
|
+
stroke-linecap="round"
|
|
2536
|
+
stroke-linejoin="round"
|
|
2537
|
+
/>
|
|
2538
|
+
<path
|
|
2539
|
+
d="M13 7l5 5-5 5"
|
|
2540
|
+
stroke="currentColor"
|
|
2541
|
+
stroke-width="1.8"
|
|
2542
|
+
stroke-linecap="round"
|
|
2543
|
+
stroke-linejoin="round"
|
|
2544
|
+
/>
|
|
2545
|
+
</svg>
|
|
2546
|
+
`,
|
|
2547
|
+
};
|
|
2548
|
+
|
|
2549
|
+
// Custom icon.
|
|
2550
|
+
const BOLD_ICON = {
|
|
2551
|
+
name: 'et-bold',
|
|
2552
|
+
data: `
|
|
2553
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
|
2554
|
+
<text x="8" y="12" font-size="12" font-weight="700" text-anchor="middle" fill="currentColor">B</text>
|
|
2555
|
+
</svg>
|
|
2556
|
+
`,
|
|
2557
|
+
};
|
|
2558
|
+
|
|
2559
|
+
// Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.
|
|
2560
|
+
const CHEVRON_ICON = {
|
|
2561
|
+
name: 'et-chevron',
|
|
2562
|
+
data: `
|
|
2563
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2564
|
+
<path
|
|
2565
|
+
fill="currentColor"
|
|
2566
|
+
d="M244.7 116.7c6.2-6.2 16.4-6.2 22.6 0l192 192c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L256 150.6 75.3 331.3c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l192-192z"
|
|
2567
|
+
/>
|
|
2568
|
+
</svg>
|
|
2569
|
+
`,
|
|
2570
|
+
};
|
|
2571
|
+
|
|
2572
|
+
const CLIPBOARD_CHECK_ICON = {
|
|
2573
|
+
name: 'et-clipboard-check',
|
|
2574
|
+
data: `
|
|
2575
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2576
|
+
<path
|
|
2577
|
+
d="M9 4.5h6"
|
|
2578
|
+
stroke="currentColor"
|
|
2579
|
+
stroke-width="1.8"
|
|
2580
|
+
stroke-linecap="round"
|
|
2581
|
+
/>
|
|
2582
|
+
<path
|
|
2583
|
+
d="M9 3h6a1.5 1.5 0 0 1 1.5 1.5V6H18a2 2 0 0 1 2 2v10.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 4 18.5V8a2 2 0 0 1 2-2h1.5V4.5A1.5 1.5 0 0 1 9 3z"
|
|
2584
|
+
stroke="currentColor"
|
|
2585
|
+
stroke-width="1.8"
|
|
2586
|
+
stroke-linejoin="round"
|
|
2587
|
+
/>
|
|
2588
|
+
<path
|
|
2589
|
+
d="M8.5 13l2.2 2.2 4.8-4.9"
|
|
2590
|
+
stroke="currentColor"
|
|
2591
|
+
stroke-width="1.8"
|
|
2592
|
+
stroke-linecap="round"
|
|
2593
|
+
stroke-linejoin="round"
|
|
2594
|
+
/>
|
|
2595
|
+
</svg>
|
|
2596
|
+
`,
|
|
2597
|
+
};
|
|
2598
|
+
|
|
2599
|
+
const FLOPPY_DISK_ICON = {
|
|
2600
|
+
name: 'et-floppy-disk',
|
|
2601
|
+
data: `
|
|
2602
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2603
|
+
<path
|
|
2604
|
+
d="M5 3h11l3 3v13a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V3z"
|
|
2605
|
+
stroke="currentColor"
|
|
2606
|
+
stroke-width="1.8"
|
|
2607
|
+
stroke-linejoin="round"
|
|
2608
|
+
/>
|
|
2609
|
+
<path
|
|
2610
|
+
d="M8 3v6h7V3"
|
|
2611
|
+
stroke="currentColor"
|
|
2612
|
+
stroke-width="1.8"
|
|
2613
|
+
stroke-linejoin="round"
|
|
2614
|
+
/>
|
|
2615
|
+
<path
|
|
2616
|
+
d="M8 17h8"
|
|
2617
|
+
stroke="currentColor"
|
|
2618
|
+
stroke-width="1.8"
|
|
2619
|
+
stroke-linecap="round"
|
|
2620
|
+
/>
|
|
2621
|
+
</svg>
|
|
2622
|
+
`,
|
|
2623
|
+
};
|
|
2624
|
+
|
|
2625
|
+
const FOCUS_FRAME_ICON = {
|
|
2626
|
+
name: 'et-focus-frame',
|
|
2627
|
+
data: `
|
|
2628
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2629
|
+
<path
|
|
2630
|
+
fill="currentColor"
|
|
2631
|
+
fill-rule="evenodd"
|
|
2632
|
+
d="M5.75 4A1.75 1.75 0 0 0 4 5.75v12.5C4 19.216 4.784 20 5.75 20h12.5A1.75 1.75 0 0 0 20 18.25V5.75A1.75 1.75 0 0 0 18.25 4H5.75Zm0 1.5a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V5.75a.25.25 0 0 0-.25-.25H5.75Z"
|
|
2633
|
+
clip-rule="evenodd"
|
|
2634
|
+
/>
|
|
2635
|
+
<rect x="8" y="8" width="8" height="8" rx="1.25" fill="currentColor" />
|
|
2636
|
+
</svg>
|
|
2637
|
+
`,
|
|
2638
|
+
};
|
|
2639
|
+
|
|
2640
|
+
const GRID_2X2_ICON = {
|
|
2641
|
+
name: 'et-grid-2x2',
|
|
2642
|
+
data: `
|
|
2643
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2644
|
+
<path
|
|
2645
|
+
fill="currentColor"
|
|
2646
|
+
fill-rule="evenodd"
|
|
2647
|
+
d="M5.75 4A1.75 1.75 0 0 0 4 5.75v12.5C4 19.216 4.784 20 5.75 20h12.5A1.75 1.75 0 0 0 20 18.25V5.75A1.75 1.75 0 0 0 18.25 4H5.75Zm0 1.5a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V5.75a.25.25 0 0 0-.25-.25H5.75Z"
|
|
2648
|
+
clip-rule="evenodd"
|
|
2649
|
+
/>
|
|
2650
|
+
<rect x="11.25" y="5.5" width="1.5" height="13" fill="currentColor" />
|
|
2651
|
+
<rect x="5.5" y="11.25" width="13" height="1.5" fill="currentColor" />
|
|
2652
|
+
</svg>
|
|
2653
|
+
`,
|
|
2654
|
+
};
|
|
2655
|
+
|
|
2656
|
+
const ICON_ERROR_CODES = {
|
|
2657
|
+
NO_ICONS_PROVIDED: 1800,
|
|
2658
|
+
ICON_NOT_FOUND: 1801,
|
|
2659
|
+
INVALID_SVG: 1802,
|
|
2660
|
+
MISSING_XMLNS: 1803,
|
|
2661
|
+
MISSING_DIMENSIONS: 1804,
|
|
2662
|
+
HARDCODED_COLOR: 1805,
|
|
2663
|
+
DUPLICATE_ICON_NAME: 1806,
|
|
2664
|
+
};
|
|
2665
|
+
|
|
2666
|
+
const ICONS_TOKEN = new InjectionToken('ET_ICONS_TOKEN');
|
|
2667
|
+
const provideIcons = (...icons) => {
|
|
2668
|
+
const map = {};
|
|
2669
|
+
for (const def of icons) {
|
|
2670
|
+
if (map[def.name]) {
|
|
2671
|
+
throw new RuntimeError(ICON_ERROR_CODES.DUPLICATE_ICON_NAME, `[provideIcons] Icon with name "${def.name}" already exists. Please provide unique icon names.`);
|
|
2672
|
+
}
|
|
2673
|
+
map[def.name] = def;
|
|
2674
|
+
}
|
|
2675
|
+
return {
|
|
2676
|
+
provide: ICONS_TOKEN,
|
|
2677
|
+
useValue: map,
|
|
2678
|
+
};
|
|
2679
|
+
};
|
|
2680
|
+
|
|
2681
|
+
const ICON_DIRECTIVE_TOKEN = new InjectionToken('ET_ICON_DIRECTIVE_TOKEN');
|
|
2682
|
+
const SVG_COLOR_ATTRIBUTES = ['fill', 'stroke', 'stop-color', 'stop-opacity'];
|
|
2683
|
+
class IconDirective {
|
|
2684
|
+
constructor() {
|
|
2685
|
+
this.icons = inject(ICONS_TOKEN, { optional: true });
|
|
2686
|
+
this.sanitizer = inject(DomSanitizer);
|
|
2687
|
+
this.iconNameToUse = input.required({ ...(ngDevMode ? { debugName: "iconNameToUse" } : /* istanbul ignore next */ {}), alias: 'etIcon' });
|
|
2688
|
+
this.allowHardcodedColor = input(false, { ...(ngDevMode ? { debugName: "allowHardcodedColor" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2689
|
+
this.iconSrc = computed(() => {
|
|
2690
|
+
if (!this.icons) {
|
|
2691
|
+
return null;
|
|
2692
|
+
}
|
|
2693
|
+
const icon = this.icons[this.iconNameToUse()];
|
|
2694
|
+
if (!icon) {
|
|
2695
|
+
throw new RuntimeError(ICON_ERROR_CODES.ICON_NOT_FOUND, `[IconDirective] Icon "${this.iconNameToUse()}" not found. Available icons: ${Object.keys(this.icons).join(', ')}.`);
|
|
2696
|
+
}
|
|
2697
|
+
const svg = icon.data.trim();
|
|
2698
|
+
if (ngDevMode) {
|
|
2699
|
+
if (!svg.includes('<svg')) {
|
|
2700
|
+
throw new RuntimeError(ICON_ERROR_CODES.INVALID_SVG, `[IconDirective] Icon "${this.iconNameToUse()}" is not a valid SVG. The data must contain an <svg> element.`);
|
|
2701
|
+
}
|
|
2702
|
+
if (!svg.includes('xmlns="http://www.w3.org/2000/svg"')) {
|
|
2703
|
+
throw new RuntimeError(ICON_ERROR_CODES.MISSING_XMLNS, `[IconDirective] Icon "${this.iconNameToUse()}" is missing xmlns="http://www.w3.org/2000/svg". Add the attribute to the <svg> element.`);
|
|
2704
|
+
}
|
|
2705
|
+
if (!svg.includes('width="100%"') || !svg.includes('height="100%"')) {
|
|
2706
|
+
throw new RuntimeError(ICON_ERROR_CODES.MISSING_DIMENSIONS, `[IconDirective] Icon "${this.iconNameToUse()}" is missing width="100%" and/or height="100%". Add both attributes to the <svg> element.`);
|
|
2707
|
+
}
|
|
2708
|
+
if (!this.allowHardcodedColor()) {
|
|
2709
|
+
for (const colorAttribute of SVG_COLOR_ATTRIBUTES) {
|
|
2710
|
+
if (svg.includes(`${colorAttribute}="`) && !svg.includes(`${colorAttribute}="currentColor"`)) {
|
|
2711
|
+
throw new RuntimeError(ICON_ERROR_CODES.HARDCODED_COLOR, `[IconDirective] Icon "${this.iconNameToUse()}" uses a hardcoded value for "${colorAttribute}". Use currentColor instead, or set [allowHardcodedColor]="true".`);
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
return this.sanitizer.bypassSecurityTrustHtml(svg);
|
|
2717
|
+
}, ...(ngDevMode ? [{ debugName: "iconSrc" }] : /* istanbul ignore next */ []));
|
|
2718
|
+
this.hostClasses = computed(() => `et-icon et-icon--${this.iconNameToUse()}`, ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
2719
|
+
if (!this.icons) {
|
|
2720
|
+
throw new RuntimeError(ICON_ERROR_CODES.NO_ICONS_PROVIDED, '[IconDirective] No icons provided. Register icons via provideIcons() in the component or application providers.');
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: IconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2724
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: IconDirective, isStandalone: true, selector: "[etIcon]", inputs: { iconNameToUse: { classPropertyName: "iconNameToUse", publicName: "etIcon", isSignal: true, isRequired: true, transformFunction: null }, allowHardcodedColor: { classPropertyName: "allowHardcodedColor", publicName: "allowHardcodedColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "innerHTML": "iconSrc()", "class": "hostClasses()" }, styleAttribute: "display: flex; align-items: center; justify-content: center;" }, providers: [
|
|
2725
|
+
{
|
|
2726
|
+
provide: ICON_DIRECTIVE_TOKEN,
|
|
2727
|
+
useExisting: IconDirective,
|
|
2728
|
+
},
|
|
2729
|
+
], ngImport: i0 }); }
|
|
2730
|
+
}
|
|
2731
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: IconDirective, decorators: [{
|
|
2732
|
+
type: Directive,
|
|
2733
|
+
args: [{
|
|
2734
|
+
selector: '[etIcon]',
|
|
2735
|
+
providers: [
|
|
2736
|
+
{
|
|
2737
|
+
provide: ICON_DIRECTIVE_TOKEN,
|
|
2738
|
+
useExisting: IconDirective,
|
|
2739
|
+
},
|
|
2740
|
+
],
|
|
2741
|
+
host: {
|
|
2742
|
+
'[innerHTML]': 'iconSrc()',
|
|
2743
|
+
'aria-hidden': 'true',
|
|
2744
|
+
'[class]': 'hostClasses()',
|
|
2745
|
+
style: 'display: flex; align-items: center; justify-content: center;',
|
|
2746
|
+
},
|
|
2747
|
+
}]
|
|
2748
|
+
}], ctorParameters: () => [], propDecorators: { iconNameToUse: [{ type: i0.Input, args: [{ isSignal: true, alias: "etIcon", required: true }] }], allowHardcodedColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowHardcodedColor", required: false }] }] } });
|
|
2749
|
+
|
|
2750
|
+
// Custom icon.
|
|
2751
|
+
const ITALIC_ICON = {
|
|
2752
|
+
name: 'et-italic',
|
|
2753
|
+
data: `
|
|
2754
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
|
2755
|
+
<text
|
|
2756
|
+
x="8"
|
|
2757
|
+
y="12"
|
|
2758
|
+
font-size="12"
|
|
2759
|
+
font-style="italic"
|
|
2760
|
+
font-family="serif"
|
|
2761
|
+
text-anchor="middle"
|
|
2762
|
+
fill="currentColor"
|
|
2763
|
+
>I</text>
|
|
2764
|
+
</svg>
|
|
2765
|
+
`,
|
|
2766
|
+
};
|
|
2767
|
+
|
|
2768
|
+
// Custom icon.
|
|
2769
|
+
const LINK_ICON = {
|
|
2770
|
+
name: 'et-link',
|
|
2771
|
+
data: `
|
|
2772
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none">
|
|
2773
|
+
<path
|
|
2774
|
+
d="M6.5 9.5l3-3M7 4.5l1-1a2.5 2.5 0 013.5 3.5l-1 1M9 11.5l-1 1A2.5 2.5 0 014.5 9l1-1"
|
|
2775
|
+
stroke="currentColor"
|
|
2776
|
+
stroke-width="1.4"
|
|
2777
|
+
stroke-linecap="round"
|
|
2778
|
+
stroke-linejoin="round"
|
|
2779
|
+
/>
|
|
2780
|
+
</svg>
|
|
2781
|
+
`,
|
|
2782
|
+
};
|
|
2783
|
+
|
|
2784
|
+
// Custom icon.
|
|
2785
|
+
const LIST_BULLETED_ICON = {
|
|
2786
|
+
name: 'et-list-bulleted',
|
|
2787
|
+
data: `
|
|
2788
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none">
|
|
2789
|
+
<circle cx="2.5" cy="4" r="1.2" fill="currentColor" />
|
|
2790
|
+
<circle cx="2.5" cy="8" r="1.2" fill="currentColor" />
|
|
2791
|
+
<circle cx="2.5" cy="12" r="1.2" fill="currentColor" />
|
|
2792
|
+
<path d="M6 4h8M6 8h8M6 12h8" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
|
2793
|
+
</svg>
|
|
2794
|
+
`,
|
|
2795
|
+
};
|
|
2796
|
+
|
|
2797
|
+
// Custom icon.
|
|
2798
|
+
const LIST_NUMBERED_ICON = {
|
|
2799
|
+
name: 'et-list-numbered',
|
|
2800
|
+
data: `
|
|
2801
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none">
|
|
2802
|
+
<path d="M6 4h8M6 8h8M6 12h8" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
|
2803
|
+
<text x="1" y="5.4" font-size="5" fill="currentColor">1</text>
|
|
2804
|
+
<text x="1" y="9.6" font-size="5" fill="currentColor">2</text>
|
|
2805
|
+
<text x="1" y="13.8" font-size="5" fill="currentColor">3</text>
|
|
2806
|
+
</svg>
|
|
2807
|
+
`,
|
|
2808
|
+
};
|
|
2809
|
+
|
|
2810
|
+
// Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.
|
|
2811
|
+
const LOCK_ICON = {
|
|
2812
|
+
name: 'et-lock',
|
|
2813
|
+
data: `
|
|
2814
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
2815
|
+
<path
|
|
2816
|
+
fill="currentColor"
|
|
2817
|
+
d="M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 48 0c26.5 0 48 21.5 48 48l0 224c0 26.5-21.5 48-48 48L32 512c-26.5 0-48-21.5-48-48L-16 240c0-26.5 21.5-48 48-48l48 0zm144 184c22.1 0 40-17.9 40-40s-17.9-40-40-40s-40 17.9-40 40s17.9 40 40 40z"
|
|
2818
|
+
/>
|
|
2819
|
+
</svg>
|
|
2820
|
+
`,
|
|
2821
|
+
};
|
|
2822
|
+
|
|
2823
|
+
const PENCIL_ICON = {
|
|
2824
|
+
name: 'et-pencil',
|
|
2825
|
+
data: `
|
|
2826
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2827
|
+
<path
|
|
2828
|
+
d="M4 20l4.2-1 9.3-9.3a1.8 1.8 0 0 0 0-2.5l-.7-.7a1.8 1.8 0 0 0-2.5 0L5 15.8 4 20z"
|
|
2829
|
+
stroke="currentColor"
|
|
2830
|
+
stroke-width="1.8"
|
|
2831
|
+
stroke-linejoin="round"
|
|
2832
|
+
/>
|
|
2833
|
+
<path
|
|
2834
|
+
d="M12.8 7.2l4 4"
|
|
2835
|
+
stroke="currentColor"
|
|
2836
|
+
stroke-width="1.8"
|
|
2837
|
+
stroke-linecap="round"
|
|
2838
|
+
/>
|
|
2839
|
+
</svg>
|
|
2840
|
+
`,
|
|
2841
|
+
};
|
|
2842
|
+
|
|
2843
|
+
const PLUS_ICON = {
|
|
2844
|
+
name: 'et-plus',
|
|
2845
|
+
data: `
|
|
2846
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2847
|
+
<path
|
|
2848
|
+
d="M12 5v14"
|
|
2849
|
+
stroke="currentColor"
|
|
2850
|
+
stroke-width="1.8"
|
|
2851
|
+
stroke-linecap="round"
|
|
2852
|
+
/>
|
|
2853
|
+
<path
|
|
2854
|
+
d="M5 12h14"
|
|
2855
|
+
stroke="currentColor"
|
|
2856
|
+
stroke-width="1.8"
|
|
2857
|
+
stroke-linecap="round"
|
|
2858
|
+
/>
|
|
2859
|
+
</svg>
|
|
2860
|
+
`,
|
|
2861
|
+
};
|
|
2862
|
+
|
|
2863
|
+
// Custom icon.
|
|
2864
|
+
const STRIKETHROUGH_ICON = {
|
|
2865
|
+
name: 'et-strikethrough',
|
|
2866
|
+
data: `
|
|
2867
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
|
2868
|
+
<text
|
|
2869
|
+
x="8"
|
|
2870
|
+
y="12"
|
|
2871
|
+
font-size="12"
|
|
2872
|
+
text-decoration="line-through"
|
|
2873
|
+
text-anchor="middle"
|
|
2874
|
+
fill="currentColor"
|
|
2875
|
+
>S</text>
|
|
2876
|
+
</svg>
|
|
2877
|
+
`,
|
|
2878
|
+
};
|
|
2879
|
+
|
|
2880
|
+
// Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.
|
|
2881
|
+
const TIMES_ICON = {
|
|
2882
|
+
name: 'et-times',
|
|
2883
|
+
data: `
|
|
2884
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
|
|
2885
|
+
<path
|
|
2886
|
+
fill="currentColor"
|
|
2887
|
+
d="M324.5 411.1c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L214.6 256 347.1 123.5c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L192 233.4 59.6 100.9c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L169.4 256 36.9 388.5c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L192 278.6 324.5 411.1z"
|
|
2888
|
+
/>
|
|
2889
|
+
</svg>
|
|
2890
|
+
`,
|
|
2891
|
+
};
|
|
2892
|
+
|
|
2893
|
+
// Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.
|
|
2894
|
+
const TRIANGLE_EXCLAMATION_ICON = {
|
|
2895
|
+
name: 'et-triangle-exclamation',
|
|
2896
|
+
data: `
|
|
2897
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2898
|
+
<path
|
|
2899
|
+
fill="currentColor"
|
|
2900
|
+
d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S489.3 480 475.1 480H36.9c-14.3 0-27.6-7.7-34.8-20.2s-7-27.6 .2-40.1l216-368C225.6 39.5 238.7 32 252.9 32h3.1zm0 128c-13.3 0-24 10.7-24 24v112c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0-64 0 32 32 0 1 0 64 0z"
|
|
2901
|
+
/>
|
|
2902
|
+
</svg>
|
|
2903
|
+
`,
|
|
2904
|
+
};
|
|
2905
|
+
|
|
2906
|
+
const ICON_IMPORTS = [IconDirective];
|
|
2907
|
+
|
|
2908
|
+
class RichTextEditorComponent {
|
|
2909
|
+
constructor() {
|
|
2910
|
+
this.dir = inject(RichTextEditorDirective);
|
|
2911
|
+
this.document = inject(DOCUMENT);
|
|
2912
|
+
this.editable = viewChild.required('editable');
|
|
2913
|
+
afterNextRender(() => {
|
|
2914
|
+
this.dir.editorDom.root.set(this.editable().nativeElement ?? null);
|
|
2915
|
+
this.renderExternalValue();
|
|
2916
|
+
});
|
|
2917
|
+
// Keep the toolbar's active-mark highlighting in sync with caret movement. The directive
|
|
2918
|
+
// ignores selection changes that land outside its editable root.
|
|
2919
|
+
fromEvent(this.document, 'selectionchange')
|
|
2920
|
+
.pipe(tap(() => this.dir.refreshActiveMarks()), takeUntilDestroyed())
|
|
2921
|
+
.subscribe();
|
|
2922
|
+
// Render programmatic (external) value changes into the DOM. Skip the user's own edits -
|
|
2923
|
+
// those already match `lastEmittedMarkdown`, so re-rendering would reset the caret.
|
|
2924
|
+
effect(() => {
|
|
2925
|
+
const markdown = this.dir.value();
|
|
2926
|
+
if (markdown === this.dir.lastEmittedMarkdown)
|
|
2927
|
+
return;
|
|
2928
|
+
this.renderExternalValue(markdown);
|
|
2929
|
+
});
|
|
2930
|
+
}
|
|
2931
|
+
onInput() {
|
|
2932
|
+
this.dir.syncFromDom();
|
|
2933
|
+
}
|
|
2934
|
+
onKeydown(event) {
|
|
2935
|
+
if (event.key !== 'Backspace')
|
|
2936
|
+
return;
|
|
2937
|
+
if (this.dir.handleBackspace()) {
|
|
2938
|
+
event.preventDefault();
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
onBeforeInput(event) {
|
|
2942
|
+
// Keep keyboard shortcuts (Ctrl/Cmd+B, …) running through our Selection/Range commands
|
|
2943
|
+
// instead of the browser's deprecated execCommand-backed formatting.
|
|
2944
|
+
switch (event.inputType) {
|
|
2945
|
+
case 'formatBold':
|
|
2946
|
+
event.preventDefault();
|
|
2947
|
+
this.dir.toggleBold();
|
|
2948
|
+
break;
|
|
2949
|
+
case 'formatItalic':
|
|
2950
|
+
event.preventDefault();
|
|
2951
|
+
this.dir.toggleItalic();
|
|
2952
|
+
break;
|
|
2953
|
+
case 'formatStrikeThrough':
|
|
2954
|
+
event.preventDefault();
|
|
2955
|
+
this.dir.toggleStrikethrough();
|
|
2956
|
+
break;
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
promptForLink() {
|
|
2960
|
+
// Mirror the other toolbar buttons' toggle behavior: with the caret already inside a link,
|
|
2961
|
+
// clicking again removes it instead of re-prompting for a URL to edit it.
|
|
2962
|
+
if (this.dir.linkActive()) {
|
|
2963
|
+
this.dir.setLink('');
|
|
2964
|
+
return;
|
|
2965
|
+
}
|
|
2966
|
+
const url = this.document.defaultView?.prompt('Link URL');
|
|
2967
|
+
if (url === null || url === undefined)
|
|
2968
|
+
return;
|
|
2969
|
+
this.dir.setLink(url);
|
|
2970
|
+
}
|
|
2971
|
+
renderExternalValue(markdown = this.dir.value()) {
|
|
2972
|
+
const el = this.editable()?.nativeElement;
|
|
2973
|
+
if (!el)
|
|
2974
|
+
return;
|
|
2975
|
+
el.innerHTML = markdownToHtml(markdown);
|
|
2976
|
+
this.dir.lastEmittedMarkdown = markdown;
|
|
2977
|
+
}
|
|
2978
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: RichTextEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2979
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.13", type: RichTextEditorComponent, isStandalone: true, selector: "et-rich-text-editor", host: { listeners: { "click": "dir.activate()" }, classAttribute: "et-rich-text-editor" }, providers: [
|
|
2980
|
+
provideIcons(BOLD_ICON, ITALIC_ICON, STRIKETHROUGH_ICON, LIST_BULLETED_ICON, LIST_NUMBERED_ICON, LINK_ICON),
|
|
2981
|
+
], viewQueries: [{ propertyName: "editable", first: true, predicate: ["editable"], descendants: true, isSignal: true }], hostDirectives: [{ directive: RichTextEditorDirective, inputs: ["value", "value", "disabled", "disabled", "readonly", "readonly", "hidden", "hidden", "invalid", "invalid", "errors", "errors", "required", "required", "name", "name", "placeholder", "placeholder"], outputs: ["valueChange", "valueChange", "touchedChange", "touchedChange"] }], ngImport: i0, template: "<div class=\"et-rte-toolbar\" role=\"toolbar\" aria-label=\"Text formatting\">\n <button\n [pressed]=\"dir.boldActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleBold()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Bold\"\n >\n <i etIcon=\"et-bold\"></i>\n </button>\n\n <button\n [pressed]=\"dir.italicActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleItalic()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Italic\"\n >\n <i etIcon=\"et-italic\"></i>\n </button>\n\n <button\n [pressed]=\"dir.strikeActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleStrikethrough()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Strikethrough\"\n >\n <i etIcon=\"et-strikethrough\"></i>\n </button>\n\n <span class=\"et-rte-toolbar-divider\" aria-hidden=\"true\"></span>\n\n <button\n [pressed]=\"dir.unorderedListActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleUnorderedList()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Bulleted list\"\n >\n <i etIcon=\"et-list-bulleted\"></i>\n </button>\n\n <button\n [pressed]=\"dir.orderedListActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleOrderedList()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Numbered list\"\n >\n <i etIcon=\"et-list-numbered\"></i>\n </button>\n\n <button\n [pressed]=\"dir.linkActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"promptForLink()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Link\"\n >\n <i [allowHardcodedColor]=\"true\" etIcon=\"et-link\"></i>\n </button>\n</div>\n\n<div\n #editable\n [attr.contenteditable]=\"dir.disabled() || dir.readonly() ? 'false' : 'true'\"\n [attr.tabindex]=\"dir.disabled() ? -1 : 0\"\n [attr.data-placeholder]=\"dir.placeholder() || null\"\n [attr.aria-invalid]=\"dir.shouldDisplayError() || null\"\n [attr.aria-describedby]=\"dir.describedById() || null\"\n [attr.aria-labelledby]=\"dir.labelId() || null\"\n [attr.aria-disabled]=\"dir.disabled() || null\"\n [attr.aria-readonly]=\"dir.readonly() || null\"\n (input)=\"onInput()\"\n (beforeinput)=\"onBeforeInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"dir.focused.set(true)\"\n (blur)=\"dir.focused.set(false); dir.touched.set(true)\"\n class=\"et-rte-content\"\n role=\"textbox\"\n aria-multiline=\"true\"\n></div>\n", styles: ["@property --et-rich-text-editor-toolbar-gap{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --et-rich-text-editor-toolbar-padding{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-rich-text-editor-button-radius{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-rich-text-editor-min-height{syntax: \"<length>\"; inherits: true; initial-value: 96px;}@property --et-rich-text-editor-content-gap{syntax: \"<length>\"; inherits: true; initial-value: 8px;}et-rich-text-editor{display:flex;flex:1;flex-direction:column;min-inline-size:0;color:inherit}et-rich-text-editor .et-rte-toolbar{display:flex;align-items:center;gap:var(--et-rich-text-editor-toolbar-gap);padding:var(--et-rich-text-editor-toolbar-padding);padding-inline:calc(var(--et-form-field-control-padding-inline) - var(--et-rich-text-editor-toolbar-padding));border-block-end:var(--et-form-field-control-border-width, 1px) solid color-mix(in srgb,currentColor 12%,transparent)}et-rich-text-editor .et-rte-toolbar .et-icon-button{border-radius:var(--et-rich-text-editor-button-radius)}et-rich-text-editor .et-rte-toolbar-divider{inline-size:1px;align-self:stretch;margin-block:4px;margin-inline:2px;background:color-mix(in srgb,currentColor 12%,transparent)}et-rich-text-editor .et-rte-content{display:block;flex:1;min-inline-size:0;padding-block:var(--et-form-field-control-padding-block);padding-inline:var(--et-form-field-control-padding-inline);min-block-size:var(--et-rich-text-editor-min-height);outline:none;color:inherit;caret-color:var(--et-theme-color-primary-solid, currentColor);overflow-wrap:anywhere}et-rich-text-editor .et-rte-content:empty:before{content:attr(data-placeholder);color:color-mix(in srgb,currentColor 46%,transparent);pointer-events:none}et-rich-text-editor .et-rte-content>:first-child{margin-block-start:0}et-rich-text-editor .et-rte-content>:last-child{margin-block-end:0}et-rich-text-editor .et-rte-content p{margin-block:0}et-rich-text-editor .et-rte-content p+p,et-rich-text-editor .et-rte-content ul,et-rich-text-editor .et-rte-content ol{margin-block-start:var(--et-rich-text-editor-content-gap)}et-rich-text-editor .et-rte-content ul,et-rich-text-editor .et-rte-content ol{margin-block-end:0;padding-inline-start:1.5em;list-style-position:outside}et-rich-text-editor .et-rte-content ul{list-style-type:disc}et-rich-text-editor .et-rte-content ol{list-style-type:decimal}et-rich-text-editor .et-rte-content li{margin-block:0}et-rich-text-editor .et-rte-content li::marker{color:color-mix(in srgb,currentColor 60%,transparent)}et-rich-text-editor .et-rte-content a{color:var(--et-theme-color-primary-solid, currentColor);text-decoration:underline}\n"], dependencies: [{ kind: "component", type: IconButtonComponent, selector: "[et-icon-button]", inputs: ["variant", "size"] }, { kind: "directive", type: IconDirective, selector: "[etIcon]", inputs: ["etIcon", "allowHardcodedColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2982
|
+
}
|
|
2983
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: RichTextEditorComponent, decorators: [{
|
|
2984
|
+
type: Component,
|
|
2985
|
+
args: [{ selector: 'et-rich-text-editor', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [IconButtonComponent, IconDirective], providers: [
|
|
2986
|
+
provideIcons(BOLD_ICON, ITALIC_ICON, STRIKETHROUGH_ICON, LIST_BULLETED_ICON, LIST_NUMBERED_ICON, LINK_ICON),
|
|
2987
|
+
], hostDirectives: [
|
|
2988
|
+
{
|
|
2989
|
+
directive: RichTextEditorDirective,
|
|
2990
|
+
inputs: ['value', 'disabled', 'readonly', 'hidden', 'invalid', 'errors', 'required', 'name', 'placeholder'],
|
|
2991
|
+
outputs: ['valueChange', 'touchedChange'],
|
|
2992
|
+
},
|
|
2993
|
+
], host: {
|
|
2994
|
+
class: 'et-rich-text-editor',
|
|
2995
|
+
'(click)': 'dir.activate()',
|
|
2996
|
+
}, template: "<div class=\"et-rte-toolbar\" role=\"toolbar\" aria-label=\"Text formatting\">\n <button\n [pressed]=\"dir.boldActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleBold()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Bold\"\n >\n <i etIcon=\"et-bold\"></i>\n </button>\n\n <button\n [pressed]=\"dir.italicActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleItalic()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Italic\"\n >\n <i etIcon=\"et-italic\"></i>\n </button>\n\n <button\n [pressed]=\"dir.strikeActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleStrikethrough()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Strikethrough\"\n >\n <i etIcon=\"et-strikethrough\"></i>\n </button>\n\n <span class=\"et-rte-toolbar-divider\" aria-hidden=\"true\"></span>\n\n <button\n [pressed]=\"dir.unorderedListActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleUnorderedList()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Bulleted list\"\n >\n <i etIcon=\"et-list-bulleted\"></i>\n </button>\n\n <button\n [pressed]=\"dir.orderedListActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"dir.toggleOrderedList()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Numbered list\"\n >\n <i etIcon=\"et-list-numbered\"></i>\n </button>\n\n <button\n [pressed]=\"dir.linkActive()\"\n [disabled]=\"dir.disabled() || dir.readonly()\"\n [mutedUntilPressed]=\"true\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"promptForLink()\"\n et-icon-button\n size=\"xs\"\n type=\"button\"\n aria-label=\"Link\"\n >\n <i [allowHardcodedColor]=\"true\" etIcon=\"et-link\"></i>\n </button>\n</div>\n\n<div\n #editable\n [attr.contenteditable]=\"dir.disabled() || dir.readonly() ? 'false' : 'true'\"\n [attr.tabindex]=\"dir.disabled() ? -1 : 0\"\n [attr.data-placeholder]=\"dir.placeholder() || null\"\n [attr.aria-invalid]=\"dir.shouldDisplayError() || null\"\n [attr.aria-describedby]=\"dir.describedById() || null\"\n [attr.aria-labelledby]=\"dir.labelId() || null\"\n [attr.aria-disabled]=\"dir.disabled() || null\"\n [attr.aria-readonly]=\"dir.readonly() || null\"\n (input)=\"onInput()\"\n (beforeinput)=\"onBeforeInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"dir.focused.set(true)\"\n (blur)=\"dir.focused.set(false); dir.touched.set(true)\"\n class=\"et-rte-content\"\n role=\"textbox\"\n aria-multiline=\"true\"\n></div>\n", styles: ["@property --et-rich-text-editor-toolbar-gap{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --et-rich-text-editor-toolbar-padding{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-rich-text-editor-button-radius{syntax: \"<length>\"; inherits: true; initial-value: 4px;}@property --et-rich-text-editor-min-height{syntax: \"<length>\"; inherits: true; initial-value: 96px;}@property --et-rich-text-editor-content-gap{syntax: \"<length>\"; inherits: true; initial-value: 8px;}et-rich-text-editor{display:flex;flex:1;flex-direction:column;min-inline-size:0;color:inherit}et-rich-text-editor .et-rte-toolbar{display:flex;align-items:center;gap:var(--et-rich-text-editor-toolbar-gap);padding:var(--et-rich-text-editor-toolbar-padding);padding-inline:calc(var(--et-form-field-control-padding-inline) - var(--et-rich-text-editor-toolbar-padding));border-block-end:var(--et-form-field-control-border-width, 1px) solid color-mix(in srgb,currentColor 12%,transparent)}et-rich-text-editor .et-rte-toolbar .et-icon-button{border-radius:var(--et-rich-text-editor-button-radius)}et-rich-text-editor .et-rte-toolbar-divider{inline-size:1px;align-self:stretch;margin-block:4px;margin-inline:2px;background:color-mix(in srgb,currentColor 12%,transparent)}et-rich-text-editor .et-rte-content{display:block;flex:1;min-inline-size:0;padding-block:var(--et-form-field-control-padding-block);padding-inline:var(--et-form-field-control-padding-inline);min-block-size:var(--et-rich-text-editor-min-height);outline:none;color:inherit;caret-color:var(--et-theme-color-primary-solid, currentColor);overflow-wrap:anywhere}et-rich-text-editor .et-rte-content:empty:before{content:attr(data-placeholder);color:color-mix(in srgb,currentColor 46%,transparent);pointer-events:none}et-rich-text-editor .et-rte-content>:first-child{margin-block-start:0}et-rich-text-editor .et-rte-content>:last-child{margin-block-end:0}et-rich-text-editor .et-rte-content p{margin-block:0}et-rich-text-editor .et-rte-content p+p,et-rich-text-editor .et-rte-content ul,et-rich-text-editor .et-rte-content ol{margin-block-start:var(--et-rich-text-editor-content-gap)}et-rich-text-editor .et-rte-content ul,et-rich-text-editor .et-rte-content ol{margin-block-end:0;padding-inline-start:1.5em;list-style-position:outside}et-rich-text-editor .et-rte-content ul{list-style-type:disc}et-rich-text-editor .et-rte-content ol{list-style-type:decimal}et-rich-text-editor .et-rte-content li{margin-block:0}et-rich-text-editor .et-rte-content li::marker{color:color-mix(in srgb,currentColor 60%,transparent)}et-rich-text-editor .et-rte-content a{color:var(--et-theme-color-primary-solid, currentColor);text-decoration:underline}\n"] }]
|
|
2997
|
+
}], ctorParameters: () => [], propDecorators: { editable: [{ type: i0.ViewChild, args: ['editable', { isSignal: true }] }] } });
|
|
2998
|
+
|
|
2999
|
+
const RICH_TEXT_EDITOR_IMPORTS = [RichTextEditorComponent, RichTextEditorDirective];
|
|
3000
|
+
|
|
3001
|
+
const SELECTION_LIST_TOKEN = new InjectionToken('SELECTION_LIST_TOKEN');
|
|
3002
|
+
const SELECTION_LIST_MULTIPLE = new InjectionToken('SELECTION_LIST_MULTIPLE');
|
|
3003
|
+
|
|
3004
|
+
class SelectionListControlDirective {
|
|
3005
|
+
constructor() {
|
|
3006
|
+
this.list = inject(SELECTION_LIST_TOKEN);
|
|
3007
|
+
this.checked = computed(() => this.list.allSelected(), ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
3008
|
+
this.indeterminate = computed(() => this.list.someSelected(), ...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
3009
|
+
this.labelId = signal(`et-selection-list-control-label-${uniqueControlLabelId++}`, ...(ngDevMode ? [{ debugName: "labelId" }] : /* istanbul ignore next */ []));
|
|
3010
|
+
this.ariaChecked = computed(() => {
|
|
3011
|
+
if (this.indeterminate()) {
|
|
3012
|
+
return 'mixed';
|
|
3013
|
+
}
|
|
3014
|
+
return this.checked();
|
|
3015
|
+
}, ...(ngDevMode ? [{ debugName: "ariaChecked" }] : /* istanbul ignore next */ []));
|
|
3016
|
+
}
|
|
3017
|
+
toggle() {
|
|
3018
|
+
if (this.list.disabled()) {
|
|
3019
|
+
return;
|
|
3020
|
+
}
|
|
3021
|
+
this.list.toggleAll();
|
|
3022
|
+
}
|
|
3023
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SelectionListControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3024
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.13", type: SelectionListControlDirective, isStandalone: true, selector: "[etSelectionListControl]", host: { listeners: { "click": "toggle()", "keydown.space": "toggle(); $event.preventDefault()", "keydown.enter": "toggle(); $event.preventDefault()" }, properties: { "attr.role": "\"option\"", "attr.aria-checked": "ariaChecked()", "attr.aria-disabled": "list.disabled() || null", "attr.tabindex": "list.disabled() ? -1 : 0" } }, ngImport: i0 }); }
|
|
3025
|
+
}
|
|
3026
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SelectionListControlDirective, decorators: [{
|
|
3027
|
+
type: Directive,
|
|
3028
|
+
args: [{
|
|
3029
|
+
selector: '[etSelectionListControl]',
|
|
3030
|
+
host: {
|
|
3031
|
+
'[attr.role]': '"option"',
|
|
3032
|
+
'[attr.aria-checked]': 'ariaChecked()',
|
|
3033
|
+
'[attr.aria-disabled]': 'list.disabled() || null',
|
|
3034
|
+
'[attr.tabindex]': 'list.disabled() ? -1 : 0',
|
|
3035
|
+
'(click)': 'toggle()',
|
|
3036
|
+
'(keydown.space)': 'toggle(); $event.preventDefault()',
|
|
3037
|
+
'(keydown.enter)': 'toggle(); $event.preventDefault()',
|
|
3038
|
+
},
|
|
3039
|
+
}]
|
|
3040
|
+
}] });
|
|
3041
|
+
let uniqueControlLabelId = 0;
|
|
3042
|
+
|
|
3043
|
+
class SelectionListDirective {
|
|
3044
|
+
constructor() {
|
|
3045
|
+
this.formField = inject(FORM_FIELD_TOKEN, { optional: true });
|
|
3046
|
+
this.destroyRef = inject(DestroyRef);
|
|
3047
|
+
this.multipleOverride = inject(SELECTION_LIST_MULTIPLE, { optional: true });
|
|
3048
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3049
|
+
this.touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
3050
|
+
this.multipleInput = input(false, { ...(ngDevMode ? { debugName: "multipleInput" } : /* istanbul ignore next */ {}), alias: 'multiple' });
|
|
3051
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
3052
|
+
this.invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
3053
|
+
this.errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
3054
|
+
this.required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
3055
|
+
this.name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
3056
|
+
this.multiple = computed(() => this.multipleOverride ?? this.multipleInput(), ...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
3057
|
+
this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
3058
|
+
this.shouldDisplayError = computed(() => this.touched() && this.invalid(), ...(ngDevMode ? [{ debugName: "shouldDisplayError" }] : /* istanbul ignore next */ []));
|
|
3059
|
+
this.role = computed(() => (this.multiple() ? 'group' : 'radiogroup'), ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
3060
|
+
this.describedBy = signal(null, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
3061
|
+
this.controlType = signal(FORM_FIELD_CONTROL_TYPES.SELECTION_LIST, ...(ngDevMode ? [{ debugName: "controlType" }] : /* istanbul ignore next */ []));
|
|
3062
|
+
this.describedById = computed(() => this.describedBy(), ...(ngDevMode ? [{ debugName: "describedById" }] : /* istanbul ignore next */ []));
|
|
3063
|
+
this.labelId = computed(() => this.formField?.registeredLabel()?.id() ?? null, ...(ngDevMode ? [{ debugName: "labelId" }] : /* istanbul ignore next */ []));
|
|
3064
|
+
this.allSelected = computed(() => {
|
|
3065
|
+
const list = this.items();
|
|
3066
|
+
if (list.length === 0) {
|
|
3067
|
+
return false;
|
|
3068
|
+
}
|
|
3069
|
+
return list.every((item) => item.checked());
|
|
3070
|
+
}, ...(ngDevMode ? [{ debugName: "allSelected" }] : /* istanbul ignore next */ []));
|
|
3071
|
+
this.someSelected = computed(() => {
|
|
3072
|
+
const list = this.items();
|
|
3073
|
+
if (list.length === 0) {
|
|
3074
|
+
return false;
|
|
3075
|
+
}
|
|
3076
|
+
const checkedCount = list.filter((item) => item.checked()).length;
|
|
3077
|
+
return checkedCount > 0 && checkedCount < list.length;
|
|
3078
|
+
}, ...(ngDevMode ? [{ debugName: "someSelected" }] : /* istanbul ignore next */ []));
|
|
3079
|
+
this.formField?.registerControl(this);
|
|
3080
|
+
this.destroyRef.onDestroy(() => this.formField?.unregisterControl(this));
|
|
3081
|
+
effect(() => {
|
|
3082
|
+
const currentValue = this.value();
|
|
3083
|
+
const currentItems = this.items();
|
|
3084
|
+
if (currentItems.length === 0) {
|
|
3085
|
+
return;
|
|
3086
|
+
}
|
|
3087
|
+
untracked(() => {
|
|
3088
|
+
if (this.multiple()) {
|
|
3089
|
+
const valueArray = Array.isArray(currentValue) ? currentValue : [];
|
|
3090
|
+
for (const item of currentItems) {
|
|
3091
|
+
item.checked.set(valueArray.includes(item.value()));
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
else {
|
|
3095
|
+
for (const item of currentItems) {
|
|
3096
|
+
item.checked.set(item.value() === currentValue);
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3099
|
+
});
|
|
3100
|
+
});
|
|
3101
|
+
}
|
|
3102
|
+
registerItem(item) {
|
|
3103
|
+
this.items.update((items) => [...items, item]);
|
|
3104
|
+
}
|
|
3105
|
+
unregisterItem(item) {
|
|
3106
|
+
this.items.update((items) => items.filter((i) => i !== item));
|
|
3107
|
+
}
|
|
3108
|
+
markTouched() {
|
|
3109
|
+
this.touched.set(true);
|
|
3110
|
+
}
|
|
3111
|
+
select(item) {
|
|
3112
|
+
if (this.disabled() || item.disabled()) {
|
|
3113
|
+
return;
|
|
3114
|
+
}
|
|
3115
|
+
if (this.multiple()) {
|
|
3116
|
+
item.checked.update((v) => !v);
|
|
3117
|
+
this.value.set(this.items()
|
|
3118
|
+
.filter((i) => i.checked())
|
|
3119
|
+
.map((i) => i.value()));
|
|
3120
|
+
}
|
|
3121
|
+
else {
|
|
3122
|
+
for (const i of this.items()) {
|
|
3123
|
+
i.checked.set(i === item);
|
|
3124
|
+
}
|
|
3125
|
+
this.value.set(item.value());
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
focusItem(item) {
|
|
3129
|
+
item.elementRef.nativeElement.focus();
|
|
3130
|
+
}
|
|
3131
|
+
toggleAll() {
|
|
3132
|
+
if (this.disabled()) {
|
|
3133
|
+
return;
|
|
3134
|
+
}
|
|
3135
|
+
const shouldCheck = !this.allSelected();
|
|
3136
|
+
for (const item of this.items()) {
|
|
3137
|
+
if (!item.disabled()) {
|
|
3138
|
+
item.checked.set(shouldCheck);
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
3141
|
+
this.value.set(this.items()
|
|
3142
|
+
.filter((i) => i.checked())
|
|
3143
|
+
.map((i) => i.value()));
|
|
3144
|
+
}
|
|
3145
|
+
activate() {
|
|
3146
|
+
const firstItem = this.items().find((i) => !i.disabled());
|
|
3147
|
+
if (firstItem) {
|
|
3148
|
+
this.select(firstItem);
|
|
3149
|
+
this.focusItem(firstItem);
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SelectionListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3153
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: SelectionListDirective, isStandalone: true, selector: "[etSelectionList]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, multipleInput: { classPropertyName: "multipleInput", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange" }, host: { properties: { "attr.role": "role()", "attr.aria-invalid": "shouldDisplayError() || null", "attr.aria-required": "required() || null", "attr.aria-describedby": "describedById() || null", "attr.aria-labelledby": "labelId() || null", "attr.data-disabled": "disabled() || null" } }, providers: [{ provide: SELECTION_LIST_TOKEN, useExisting: SelectionListDirective }], ngImport: i0 }); }
|
|
3154
|
+
}
|
|
3155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SelectionListDirective, decorators: [{
|
|
3156
|
+
type: Directive,
|
|
3157
|
+
args: [{
|
|
3158
|
+
selector: '[etSelectionList]',
|
|
3159
|
+
providers: [{ provide: SELECTION_LIST_TOKEN, useExisting: SelectionListDirective }],
|
|
3160
|
+
host: {
|
|
3161
|
+
'[attr.role]': 'role()',
|
|
3162
|
+
'[attr.aria-invalid]': 'shouldDisplayError() || null',
|
|
3163
|
+
'[attr.aria-required]': 'required() || null',
|
|
3164
|
+
'[attr.aria-describedby]': 'describedById() || null',
|
|
3165
|
+
'[attr.aria-labelledby]': 'labelId() || null',
|
|
3166
|
+
'[attr.data-disabled]': 'disabled() || null',
|
|
3167
|
+
},
|
|
3168
|
+
}]
|
|
3169
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], multipleInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
|
|
3170
|
+
|
|
3171
|
+
let uniqueOptionLabelId = 0;
|
|
3172
|
+
class SelectionOptionDirective {
|
|
3173
|
+
constructor() {
|
|
3174
|
+
this.list = inject(SELECTION_LIST_TOKEN, { optional: true });
|
|
3175
|
+
this.destroyRef = inject(DestroyRef);
|
|
3176
|
+
this.el = inject(ElementRef);
|
|
3177
|
+
this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3178
|
+
this.checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
3179
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
3180
|
+
this.effectiveDisabled = computed(() => this.disabled() || (this.list?.disabled() ?? false), ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
3181
|
+
this.role = computed(() => (this.list?.multiple() ? 'option' : 'radio'), ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
3182
|
+
this.labelId = signal(`et-selection-option-label-${uniqueOptionLabelId++}`, ...(ngDevMode ? [{ debugName: "labelId" }] : /* istanbul ignore next */ []));
|
|
3183
|
+
this.listItem = {
|
|
3184
|
+
value: this.value,
|
|
3185
|
+
checked: this.checked,
|
|
3186
|
+
disabled: this.effectiveDisabled,
|
|
3187
|
+
elementRef: this.el,
|
|
3188
|
+
};
|
|
3189
|
+
this.tabindex = computed(() => {
|
|
3190
|
+
if (this.effectiveDisabled()) {
|
|
3191
|
+
return -1;
|
|
3192
|
+
}
|
|
3193
|
+
if (!this.list) {
|
|
3194
|
+
return 0;
|
|
3195
|
+
}
|
|
3196
|
+
const items = this.list.items();
|
|
3197
|
+
const checkedItem = items.find((i) => i.checked());
|
|
3198
|
+
if (checkedItem) {
|
|
3199
|
+
return checkedItem === this.listItem ? 0 : -1;
|
|
3200
|
+
}
|
|
3201
|
+
return items[0] === this.listItem ? 0 : -1;
|
|
3202
|
+
}, ...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
|
|
3203
|
+
if (this.list) {
|
|
3204
|
+
const list = this.list;
|
|
3205
|
+
list.registerItem(this.listItem);
|
|
3206
|
+
this.destroyRef.onDestroy(() => list.unregisterItem(this.listItem));
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
select() {
|
|
3210
|
+
if (this.effectiveDisabled()) {
|
|
3211
|
+
return;
|
|
3212
|
+
}
|
|
3213
|
+
if (this.list) {
|
|
3214
|
+
this.list.select(this.listItem);
|
|
3215
|
+
}
|
|
3216
|
+
else {
|
|
3217
|
+
this.checked.update((v) => !v);
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
markTouched() {
|
|
3221
|
+
if (this.list) {
|
|
3222
|
+
this.list.markTouched();
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
2041
3225
|
focusNext(event) {
|
|
2042
3226
|
event.preventDefault();
|
|
2043
3227
|
if (!this.list || this.effectiveDisabled()) {
|
|
@@ -2142,7 +3326,7 @@ class CheckboxOptionComponent {
|
|
|
2142
3326
|
this.canAnimate = createCanAnimateSignal();
|
|
2143
3327
|
}
|
|
2144
3328
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: CheckboxOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2145
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: CheckboxOptionComponent, isStandalone: true, selector: "et-checkbox-option", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-checkbox-option" }, hostDirectives: [{ directive: SelectionOptionDirective, inputs: ["value", "value", "checked", "checked", "disabled", "disabled"], outputs: ["checkedChange", "checkedChange"] }, { directive: i2.ColorInteractiveDirective }], ngImport: i0, template: "<div class=\"et-checkbox-option-box\">\n <svg class=\"et-checkbox-option-check\" viewBox=\"0 0 12 10\" fill=\"none\">\n <path\n d=\"M1 5L4.5 8.5L11 1.5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</div>\n<div class=\"et-checkbox-option-content\">\n <span [attr.id]=\"optionDirective.labelId()\" class=\"et-checkbox-option-label\">\n <ng-content />\n </span>\n <ng-content select=\"et-description\" />\n</div>\n", styles: ["@property --et-checkbox-option-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-checkbox-option-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-checkbox-option-border-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --et-checkbox-option-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-checkbox-option-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --et-checkbox-option-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}et-checkbox-option{
|
|
3329
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: CheckboxOptionComponent, isStandalone: true, selector: "et-checkbox-option", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-checkbox-option" }, hostDirectives: [{ directive: SelectionOptionDirective, inputs: ["value", "value", "checked", "checked", "disabled", "disabled"], outputs: ["checkedChange", "checkedChange"] }, { directive: i2.ColorInteractiveDirective }], ngImport: i0, template: "<div class=\"et-checkbox-option-box\">\n <svg class=\"et-checkbox-option-check\" viewBox=\"0 0 12 10\" fill=\"none\">\n <path\n d=\"M1 5L4.5 8.5L11 1.5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</div>\n<div class=\"et-checkbox-option-content\">\n <span [attr.id]=\"optionDirective.labelId()\" class=\"et-checkbox-option-label\">\n <ng-content />\n </span>\n <ng-content select=\"et-description\" />\n</div>\n", styles: ["@property --et-checkbox-option-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-checkbox-option-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-checkbox-option-border-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --et-checkbox-option-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-checkbox-option-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --et-checkbox-option-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}et-checkbox-option{display:flex;align-items:flex-start;gap:var(--et-checkbox-option-gap);cursor:pointer;outline:none;-webkit-user-select:none;user-select:none}et-checkbox-option .et-checkbox-option-box{flex-shrink:0;inline-size:var(--et-checkbox-option-size);block-size:var(--et-checkbox-option-size);border-radius:var(--et-checkbox-option-border-radius);border:var(--et-checkbox-option-border-width) solid var(--_et-control-border, var(--et-surface-border-solid, currentColor));display:grid;place-items:center;margin-block-start:2px}et-checkbox-option .et-checkbox-option-check{inline-size:12px;block-size:10px;opacity:0;transform:scale(.5);color:var(--et-theme-color-on-primary-solid, white)}et-checkbox-option .et-checkbox-option-content{display:flex;flex-direction:column;gap:2px;min-inline-size:0}et-checkbox-option .et-checkbox-option-label{color:var(--et-surface-color-muted-solid, currentColor)}et-checkbox-option:hover .et-checkbox-option-box{border-color:var(--_et-control-border, var(--et-surface-interaction-hover-solid, currentColor))}et-checkbox-option:focus-visible .et-checkbox-option-box{border-color:var(--et-theme-color-primary-solid);outline:1px solid var(--et-theme-color-primary-solid);outline-offset:2px}et-checkbox-option[aria-disabled=true]{opacity:var(--et-checkbox-option-opacity-disabled);pointer-events:none;cursor:default}et-checkbox-option[aria-disabled=true] .et-checkbox-option-label{color:var(--et-surface-interaction-disabled-solid, currentColor)}et-checkbox-option[aria-checked=true] .et-checkbox-option-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox-option[aria-checked=true] .et-checkbox-option-box .et-checkbox-option-check{opacity:1;transform:scale(1)}et-checkbox-option[data-can-animate] .et-checkbox-option-box{transition:border-color var(--et-checkbox-option-transition-duration) ease,background-color var(--et-checkbox-option-transition-duration) ease}et-checkbox-option[data-can-animate] .et-checkbox-option-check{transition:opacity var(--et-checkbox-option-transition-duration) ease,transform var(--et-checkbox-option-transition-duration) ease}@media(prefers-reduced-motion:reduce){et-checkbox-option{--et-checkbox-option-transition-duration: 1ms}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2146
3330
|
}
|
|
2147
3331
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: CheckboxOptionComponent, decorators: [{
|
|
2148
3332
|
type: Component,
|
|
@@ -2156,7 +3340,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
2156
3340
|
], host: {
|
|
2157
3341
|
class: 'et-checkbox-option',
|
|
2158
3342
|
'[attr.data-can-animate]': 'canAnimate.state() || null',
|
|
2159
|
-
}, template: "<div class=\"et-checkbox-option-box\">\n <svg class=\"et-checkbox-option-check\" viewBox=\"0 0 12 10\" fill=\"none\">\n <path\n d=\"M1 5L4.5 8.5L11 1.5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</div>\n<div class=\"et-checkbox-option-content\">\n <span [attr.id]=\"optionDirective.labelId()\" class=\"et-checkbox-option-label\">\n <ng-content />\n </span>\n <ng-content select=\"et-description\" />\n</div>\n", styles: ["@property --et-checkbox-option-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-checkbox-option-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-checkbox-option-border-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --et-checkbox-option-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-checkbox-option-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --et-checkbox-option-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}et-checkbox-option{
|
|
3343
|
+
}, template: "<div class=\"et-checkbox-option-box\">\n <svg class=\"et-checkbox-option-check\" viewBox=\"0 0 12 10\" fill=\"none\">\n <path\n d=\"M1 5L4.5 8.5L11 1.5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</div>\n<div class=\"et-checkbox-option-content\">\n <span [attr.id]=\"optionDirective.labelId()\" class=\"et-checkbox-option-label\">\n <ng-content />\n </span>\n <ng-content select=\"et-description\" />\n</div>\n", styles: ["@property --et-checkbox-option-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-checkbox-option-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-checkbox-option-border-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --et-checkbox-option-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-checkbox-option-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --et-checkbox-option-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}et-checkbox-option{display:flex;align-items:flex-start;gap:var(--et-checkbox-option-gap);cursor:pointer;outline:none;-webkit-user-select:none;user-select:none}et-checkbox-option .et-checkbox-option-box{flex-shrink:0;inline-size:var(--et-checkbox-option-size);block-size:var(--et-checkbox-option-size);border-radius:var(--et-checkbox-option-border-radius);border:var(--et-checkbox-option-border-width) solid var(--_et-control-border, var(--et-surface-border-solid, currentColor));display:grid;place-items:center;margin-block-start:2px}et-checkbox-option .et-checkbox-option-check{inline-size:12px;block-size:10px;opacity:0;transform:scale(.5);color:var(--et-theme-color-on-primary-solid, white)}et-checkbox-option .et-checkbox-option-content{display:flex;flex-direction:column;gap:2px;min-inline-size:0}et-checkbox-option .et-checkbox-option-label{color:var(--et-surface-color-muted-solid, currentColor)}et-checkbox-option:hover .et-checkbox-option-box{border-color:var(--_et-control-border, var(--et-surface-interaction-hover-solid, currentColor))}et-checkbox-option:focus-visible .et-checkbox-option-box{border-color:var(--et-theme-color-primary-solid);outline:1px solid var(--et-theme-color-primary-solid);outline-offset:2px}et-checkbox-option[aria-disabled=true]{opacity:var(--et-checkbox-option-opacity-disabled);pointer-events:none;cursor:default}et-checkbox-option[aria-disabled=true] .et-checkbox-option-label{color:var(--et-surface-interaction-disabled-solid, currentColor)}et-checkbox-option[aria-checked=true] .et-checkbox-option-box{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-checkbox-option[aria-checked=true] .et-checkbox-option-box .et-checkbox-option-check{opacity:1;transform:scale(1)}et-checkbox-option[data-can-animate] .et-checkbox-option-box{transition:border-color var(--et-checkbox-option-transition-duration) ease,background-color var(--et-checkbox-option-transition-duration) ease}et-checkbox-option[data-can-animate] .et-checkbox-option-check{transition:opacity var(--et-checkbox-option-transition-duration) ease,transform var(--et-checkbox-option-transition-duration) ease}@media(prefers-reduced-motion:reduce){et-checkbox-option{--et-checkbox-option-transition-duration: 1ms}}\n"] }]
|
|
2160
3344
|
}] });
|
|
2161
3345
|
|
|
2162
3346
|
class RadioGroupComponent {
|
|
@@ -2200,7 +3384,7 @@ class RadioComponent {
|
|
|
2200
3384
|
this.canAnimate = createCanAnimateSignal();
|
|
2201
3385
|
}
|
|
2202
3386
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: RadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2203
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: RadioComponent, isStandalone: true, selector: "et-radio", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-radio" }, hostDirectives: [{ directive: SelectionOptionDirective, inputs: ["value", "value", "checked", "checked", "disabled", "disabled"], outputs: ["checkedChange", "checkedChange"] }, { directive: i2.ColorInteractiveDirective }], ngImport: i0, template: "<div class=\"et-radio-circle\"></div>\n<div class=\"et-radio-content\">\n <span [attr.id]=\"optionDirective.labelId()\" class=\"et-radio-label\">\n <ng-content />\n </span>\n <ng-content select=\"et-description\" />\n</div>\n", styles: ["@property --et-radio-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-radio-dot-size{syntax: \"<length>\"; inherits: false; initial-value: 10px;}@property --et-radio-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-radio-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-radio-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --et-radio-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}et-radio{
|
|
3387
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: RadioComponent, isStandalone: true, selector: "et-radio", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-radio" }, hostDirectives: [{ directive: SelectionOptionDirective, inputs: ["value", "value", "checked", "checked", "disabled", "disabled"], outputs: ["checkedChange", "checkedChange"] }, { directive: i2.ColorInteractiveDirective }], ngImport: i0, template: "<div class=\"et-radio-circle\"></div>\n<div class=\"et-radio-content\">\n <span [attr.id]=\"optionDirective.labelId()\" class=\"et-radio-label\">\n <ng-content />\n </span>\n <ng-content select=\"et-description\" />\n</div>\n", styles: ["@property --et-radio-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-radio-dot-size{syntax: \"<length>\"; inherits: false; initial-value: 10px;}@property --et-radio-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-radio-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-radio-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --et-radio-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}et-radio{display:flex;align-items:flex-start;gap:var(--et-radio-gap);cursor:pointer;outline:none;-webkit-user-select:none;user-select:none}et-radio .et-radio-circle{flex-shrink:0;inline-size:var(--et-radio-size);block-size:var(--et-radio-size);border-radius:50%;border:var(--et-radio-border-width) solid var(--_et-control-border, var(--et-surface-border-solid, currentColor));display:grid;place-items:center;margin-block-start:2px}et-radio .et-radio-circle:after{content:\"\";inline-size:var(--et-radio-dot-size);block-size:var(--et-radio-dot-size);border-radius:50%;background-color:var(--et-theme-color-primary-solid, currentColor);transform:scale(0)}et-radio .et-radio-content{display:flex;flex-direction:column;gap:2px;min-inline-size:0}et-radio .et-radio-label{color:var(--et-surface-color-muted-solid, currentColor)}et-radio:hover .et-radio-circle{border-color:var(--_et-control-border, var(--et-surface-interaction-hover-solid, currentColor))}et-radio:focus-visible .et-radio-circle{border-color:var(--et-theme-color-primary-solid);outline:1px solid var(--et-theme-color-primary-solid);outline-offset:2px}et-radio[aria-disabled=true]{opacity:var(--et-radio-opacity-disabled);pointer-events:none;cursor:default}et-radio[aria-disabled=true] .et-radio-label{color:var(--et-surface-interaction-disabled-solid, currentColor)}et-radio[aria-checked=true] .et-radio-circle{border-color:var(--et-theme-color-primary-solid, currentColor)}et-radio[aria-checked=true] .et-radio-circle:after{transform:scale(1)}et-radio[data-can-animate] .et-radio-circle{transition:border-color var(--et-radio-transition-duration) ease}et-radio[data-can-animate] .et-radio-circle:after{transition:transform var(--et-radio-transition-duration) ease}@media(prefers-reduced-motion:reduce){et-radio{--et-radio-transition-duration: 1ms}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2204
3388
|
}
|
|
2205
3389
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: RadioComponent, decorators: [{
|
|
2206
3390
|
type: Component,
|
|
@@ -2214,7 +3398,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
2214
3398
|
], host: {
|
|
2215
3399
|
class: 'et-radio',
|
|
2216
3400
|
'[attr.data-can-animate]': 'canAnimate.state() || null',
|
|
2217
|
-
}, template: "<div class=\"et-radio-circle\"></div>\n<div class=\"et-radio-content\">\n <span [attr.id]=\"optionDirective.labelId()\" class=\"et-radio-label\">\n <ng-content />\n </span>\n <ng-content select=\"et-description\" />\n</div>\n", styles: ["@property --et-radio-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-radio-dot-size{syntax: \"<length>\"; inherits: false; initial-value: 10px;}@property --et-radio-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-radio-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-radio-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --et-radio-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}et-radio{
|
|
3401
|
+
}, template: "<div class=\"et-radio-circle\"></div>\n<div class=\"et-radio-content\">\n <span [attr.id]=\"optionDirective.labelId()\" class=\"et-radio-label\">\n <ng-content />\n </span>\n <ng-content select=\"et-description\" />\n</div>\n", styles: ["@property --et-radio-size{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-radio-dot-size{syntax: \"<length>\"; inherits: false; initial-value: 10px;}@property --et-radio-border-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-radio-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-radio-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}@property --et-radio-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}et-radio{display:flex;align-items:flex-start;gap:var(--et-radio-gap);cursor:pointer;outline:none;-webkit-user-select:none;user-select:none}et-radio .et-radio-circle{flex-shrink:0;inline-size:var(--et-radio-size);block-size:var(--et-radio-size);border-radius:50%;border:var(--et-radio-border-width) solid var(--_et-control-border, var(--et-surface-border-solid, currentColor));display:grid;place-items:center;margin-block-start:2px}et-radio .et-radio-circle:after{content:\"\";inline-size:var(--et-radio-dot-size);block-size:var(--et-radio-dot-size);border-radius:50%;background-color:var(--et-theme-color-primary-solid, currentColor);transform:scale(0)}et-radio .et-radio-content{display:flex;flex-direction:column;gap:2px;min-inline-size:0}et-radio .et-radio-label{color:var(--et-surface-color-muted-solid, currentColor)}et-radio:hover .et-radio-circle{border-color:var(--_et-control-border, var(--et-surface-interaction-hover-solid, currentColor))}et-radio:focus-visible .et-radio-circle{border-color:var(--et-theme-color-primary-solid);outline:1px solid var(--et-theme-color-primary-solid);outline-offset:2px}et-radio[aria-disabled=true]{opacity:var(--et-radio-opacity-disabled);pointer-events:none;cursor:default}et-radio[aria-disabled=true] .et-radio-label{color:var(--et-surface-interaction-disabled-solid, currentColor)}et-radio[aria-checked=true] .et-radio-circle{border-color:var(--et-theme-color-primary-solid, currentColor)}et-radio[aria-checked=true] .et-radio-circle:after{transform:scale(1)}et-radio[data-can-animate] .et-radio-circle{transition:border-color var(--et-radio-transition-duration) ease}et-radio[data-can-animate] .et-radio-circle:after{transition:transform var(--et-radio-transition-duration) ease}@media(prefers-reduced-motion:reduce){et-radio{--et-radio-transition-duration: 1ms}}\n"] }]
|
|
2218
3402
|
}] });
|
|
2219
3403
|
|
|
2220
3404
|
class SegmentedButtonGroupComponent {
|
|
@@ -2258,7 +3442,7 @@ class SegmentedButtonComponent {
|
|
|
2258
3442
|
this.canAnimate = createCanAnimateSignal();
|
|
2259
3443
|
}
|
|
2260
3444
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SegmentedButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2261
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: SegmentedButtonComponent, isStandalone: true, selector: "et-segmented-button", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-segmented-button" }, hostDirectives: [{ directive: SelectionOptionDirective, inputs: ["value", "value", "checked", "checked", "disabled", "disabled"], outputs: ["checkedChange", "checkedChange"] }, { directive: i2.ColorInteractiveDirective }], ngImport: i0, template: '<ng-content />', isInline: true, styles: ["@property --et-segmented-button-padding-x{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-segmented-button-padding-y{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --et-segmented-button-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --et-segmented-button-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-segmented-button-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-segmented-button{
|
|
3445
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: SegmentedButtonComponent, isStandalone: true, selector: "et-segmented-button", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-segmented-button" }, hostDirectives: [{ directive: SelectionOptionDirective, inputs: ["value", "value", "checked", "checked", "disabled", "disabled"], outputs: ["checkedChange", "checkedChange"] }, { directive: i2.ColorInteractiveDirective }], ngImport: i0, template: '<ng-content />', isInline: true, styles: ["@property --et-segmented-button-padding-x{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-segmented-button-padding-y{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --et-segmented-button-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --et-segmented-button-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-segmented-button-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-segmented-button{display:inline-flex;align-items:center;justify-content:center;padding:var(--et-segmented-button-padding-y) var(--et-segmented-button-padding-x);cursor:pointer;outline:none;border:var(--et-segmented-button-border-width) solid var(--_et-control-border, var(--et-surface-border-solid, currentColor));background:transparent;color:inherit;-webkit-user-select:none;user-select:none}et-segmented-button[aria-disabled=true]{opacity:var(--et-segmented-button-opacity-disabled);pointer-events:none;cursor:default}et-segmented-button:hover:not([aria-disabled=true]){border-color:var(--_et-control-border, var(--et-surface-interaction-hover-solid, currentColor))}et-segmented-button:focus-visible{border-color:var(--et-theme-color-primary-solid);outline:1px solid var(--et-theme-color-primary-solid);outline-offset:-1px}et-segmented-button:active:not([aria-disabled=true]){transform:scale(.97)}et-segmented-button[aria-checked=true]{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor);color:var(--et-theme-color-on-primary-solid, white)}et-segmented-button[aria-checked=true]:hover{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-segmented-button[data-can-animate]{transition:background-color var(--et-segmented-button-transition-duration) ease,border-color var(--et-segmented-button-transition-duration) ease,color var(--et-segmented-button-transition-duration) ease}@media(prefers-reduced-motion:reduce){et-segmented-button{--et-segmented-button-transition-duration: 1ms}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2262
3446
|
}
|
|
2263
3447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SegmentedButtonComponent, decorators: [{
|
|
2264
3448
|
type: Component,
|
|
@@ -2272,7 +3456,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
2272
3456
|
], host: {
|
|
2273
3457
|
class: 'et-segmented-button',
|
|
2274
3458
|
'[attr.data-can-animate]': 'canAnimate.state() || null',
|
|
2275
|
-
}, styles: ["@property --et-segmented-button-padding-x{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-segmented-button-padding-y{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --et-segmented-button-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --et-segmented-button-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-segmented-button-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-segmented-button{
|
|
3459
|
+
}, styles: ["@property --et-segmented-button-padding-x{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-segmented-button-padding-y{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --et-segmented-button-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --et-segmented-button-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-segmented-button-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-segmented-button{display:inline-flex;align-items:center;justify-content:center;padding:var(--et-segmented-button-padding-y) var(--et-segmented-button-padding-x);cursor:pointer;outline:none;border:var(--et-segmented-button-border-width) solid var(--_et-control-border, var(--et-surface-border-solid, currentColor));background:transparent;color:inherit;-webkit-user-select:none;user-select:none}et-segmented-button[aria-disabled=true]{opacity:var(--et-segmented-button-opacity-disabled);pointer-events:none;cursor:default}et-segmented-button:hover:not([aria-disabled=true]){border-color:var(--_et-control-border, var(--et-surface-interaction-hover-solid, currentColor))}et-segmented-button:focus-visible{border-color:var(--et-theme-color-primary-solid);outline:1px solid var(--et-theme-color-primary-solid);outline-offset:-1px}et-segmented-button:active:not([aria-disabled=true]){transform:scale(.97)}et-segmented-button[aria-checked=true]{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor);color:var(--et-theme-color-on-primary-solid, white)}et-segmented-button[aria-checked=true]:hover{background-color:var(--et-theme-color-primary-solid, currentColor);border-color:var(--et-theme-color-primary-solid, currentColor)}et-segmented-button[data-can-animate]{transition:background-color var(--et-segmented-button-transition-duration) ease,border-color var(--et-segmented-button-transition-duration) ease,color var(--et-segmented-button-transition-duration) ease}@media(prefers-reduced-motion:reduce){et-segmented-button{--et-segmented-button-transition-duration: 1ms}}\n"] }]
|
|
2276
3460
|
}] });
|
|
2277
3461
|
|
|
2278
3462
|
class SwitchDirective {
|
|
@@ -2335,7 +3519,7 @@ class SwitchComponent {
|
|
|
2335
3519
|
this.canAnimate = createCanAnimateSignal();
|
|
2336
3520
|
}
|
|
2337
3521
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2338
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: SwitchComponent, isStandalone: true, selector: "et-switch", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-switch" }, hostDirectives: [{ directive: SwitchDirective, inputs: ["checked", "checked", "disabled", "disabled", "invalid", "invalid", "errors", "errors", "required", "required", "name", "name"], outputs: ["checkedChange", "checkedChange", "touchedChange", "touchedChange"] }, { directive: i2.ColorInteractiveDirective }], ngImport: i0, template: "<div class=\"et-switch-track\">\n <div class=\"et-switch-thumb\"></div>\n</div>\n", styles: ["@property --et-switch-track-width{syntax: \"<length>\"; inherits: false; initial-value: 36px;}@property --et-switch-track-height{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-switch-thumb-size{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-switch-thumb-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-switch-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-switch-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-switch{
|
|
3522
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: SwitchComponent, isStandalone: true, selector: "et-switch", host: { properties: { "attr.data-can-animate": "canAnimate.state() || null" }, classAttribute: "et-switch" }, hostDirectives: [{ directive: SwitchDirective, inputs: ["checked", "checked", "disabled", "disabled", "invalid", "invalid", "errors", "errors", "required", "required", "name", "name"], outputs: ["checkedChange", "checkedChange", "touchedChange", "touchedChange"] }, { directive: i2.ColorInteractiveDirective }], ngImport: i0, template: "<div class=\"et-switch-track\">\n <div class=\"et-switch-thumb\"></div>\n</div>\n", styles: ["@property --et-switch-track-width{syntax: \"<length>\"; inherits: false; initial-value: 36px;}@property --et-switch-track-height{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-switch-thumb-size{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-switch-thumb-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-switch-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-switch-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-switch{display:inline-flex;align-items:center;cursor:pointer;outline:none}et-switch[aria-disabled=true]{opacity:var(--et-switch-opacity-disabled);pointer-events:none;cursor:default}et-switch .et-switch-track{position:relative;width:var(--et-switch-track-width);height:var(--et-switch-track-height);border-radius:calc(var(--et-switch-track-height) / 2);background-color:var(--_et-control-border, var(--et-surface-border-solid, currentColor));opacity:.4}et-switch:hover:not([aria-disabled=true]) .et-switch-track,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-switch:not([aria-disabled=true]) .et-switch-track{opacity:.55}:where(et-choice-field[data-error]) et-switch:not([aria-disabled=true]) .et-switch-track{background-color:var(--et-theme-color-primary-solid);opacity:.4}et-switch:focus-visible .et-switch-track{outline:2px solid var(--et-theme-color-primary-solid);outline-offset:2px}et-switch:active:not([aria-disabled=true]) .et-switch-track{transform:scale(.95)}et-switch .et-switch-thumb{position:absolute;top:var(--et-switch-thumb-offset);left:var(--et-switch-thumb-offset);width:var(--et-switch-thumb-size);height:var(--et-switch-thumb-size);border-radius:50%;background-color:var(--et-theme-color-on-primary-solid, white)}et-switch[aria-checked=true] .et-switch-track{background-color:var(--et-theme-color-primary-solid, currentColor);opacity:1}et-switch[aria-checked=true] .et-switch-thumb{left:calc(var(--et-switch-track-width) - var(--et-switch-thumb-size) - var(--et-switch-thumb-offset))}et-switch[aria-checked=true]:hover .et-switch-track,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-switch[aria-checked=true] .et-switch-track{background-color:var(--et-theme-color-primary-solid, currentColor);opacity:1}et-switch[data-can-animate] .et-switch-track{transition:background-color var(--et-switch-transition-duration) ease,opacity var(--et-switch-transition-duration) ease}et-switch[data-can-animate] .et-switch-thumb{transition:left var(--et-switch-transition-duration) ease}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2339
3523
|
}
|
|
2340
3524
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
2341
3525
|
type: Component,
|
|
@@ -2349,7 +3533,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
2349
3533
|
], host: {
|
|
2350
3534
|
class: 'et-switch',
|
|
2351
3535
|
'[attr.data-can-animate]': 'canAnimate.state() || null',
|
|
2352
|
-
}, template: "<div class=\"et-switch-track\">\n <div class=\"et-switch-thumb\"></div>\n</div>\n", styles: ["@property --et-switch-track-width{syntax: \"<length>\"; inherits: false; initial-value: 36px;}@property --et-switch-track-height{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-switch-thumb-size{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-switch-thumb-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-switch-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-switch-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-switch{
|
|
3536
|
+
}, template: "<div class=\"et-switch-track\">\n <div class=\"et-switch-thumb\"></div>\n</div>\n", styles: ["@property --et-switch-track-width{syntax: \"<length>\"; inherits: false; initial-value: 36px;}@property --et-switch-track-height{syntax: \"<length>\"; inherits: false; initial-value: 20px;}@property --et-switch-thumb-size{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-switch-thumb-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --et-switch-transition-duration{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --et-switch-opacity-disabled{syntax: \"<number>\"; inherits: false; initial-value: .5;}et-switch{display:inline-flex;align-items:center;cursor:pointer;outline:none}et-switch[aria-disabled=true]{opacity:var(--et-switch-opacity-disabled);pointer-events:none;cursor:default}et-switch .et-switch-track{position:relative;width:var(--et-switch-track-width);height:var(--et-switch-track-height);border-radius:calc(var(--et-switch-track-height) / 2);background-color:var(--_et-control-border, var(--et-surface-border-solid, currentColor));opacity:.4}et-switch:hover:not([aria-disabled=true]) .et-switch-track,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-switch:not([aria-disabled=true]) .et-switch-track{opacity:.55}:where(et-choice-field[data-error]) et-switch:not([aria-disabled=true]) .et-switch-track{background-color:var(--et-theme-color-primary-solid);opacity:.4}et-switch:focus-visible .et-switch-track{outline:2px solid var(--et-theme-color-primary-solid);outline-offset:2px}et-switch:active:not([aria-disabled=true]) .et-switch-track{transform:scale(.95)}et-switch .et-switch-thumb{position:absolute;top:var(--et-switch-thumb-offset);left:var(--et-switch-thumb-offset);width:var(--et-switch-thumb-size);height:var(--et-switch-thumb-size);border-radius:50%;background-color:var(--et-theme-color-on-primary-solid, white)}et-switch[aria-checked=true] .et-switch-track{background-color:var(--et-theme-color-primary-solid, currentColor);opacity:1}et-switch[aria-checked=true] .et-switch-thumb{left:calc(var(--et-switch-track-width) - var(--et-switch-thumb-size) - var(--et-switch-thumb-offset))}et-switch[aria-checked=true]:hover .et-switch-track,:where(et-choice-field:has(.et-choice-field-label-area:hover)) et-switch[aria-checked=true] .et-switch-track{background-color:var(--et-theme-color-primary-solid, currentColor);opacity:1}et-switch[data-can-animate] .et-switch-track{transition:background-color var(--et-switch-transition-duration) ease,opacity var(--et-switch-transition-duration) ease}et-switch[data-can-animate] .et-switch-thumb{transition:left var(--et-switch-transition-duration) ease}\n"] }]
|
|
2353
3537
|
}] });
|
|
2354
3538
|
|
|
2355
3539
|
const SWITCH_IMPORTS = [SwitchComponent, SwitchDirective];
|
|
@@ -3594,118 +4778,79 @@ class GridResizeDirective {
|
|
|
3594
4778
|
finishResize() {
|
|
3595
4779
|
this.resizeStartPos.set(null);
|
|
3596
4780
|
this.isResizing.set(false);
|
|
3597
|
-
this.grid.commitResize();
|
|
3598
|
-
}
|
|
3599
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3600
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.13", type: GridResizeDirective, isStandalone: true, selector: "[etGridResize]", host: { properties: { "class.et-grid-resize--active": "isResizing()" }, classAttribute: "et-grid-resize" }, ngImport: i0 }); }
|
|
3601
|
-
}
|
|
3602
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridResizeDirective, decorators: [{
|
|
3603
|
-
type: Directive,
|
|
3604
|
-
args: [{
|
|
3605
|
-
selector: '[etGridResize]',
|
|
3606
|
-
host: {
|
|
3607
|
-
class: 'et-grid-resize',
|
|
3608
|
-
'[class.et-grid-resize--active]': 'isResizing()',
|
|
3609
|
-
},
|
|
3610
|
-
}]
|
|
3611
|
-
}] });
|
|
3612
|
-
|
|
3613
|
-
/**
|
|
3614
|
-
* Injectable reference provided to configComponent instances.
|
|
3615
|
-
* Gives the config form access to the item's current data and the ability to save or cancel.
|
|
3616
|
-
*/
|
|
3617
|
-
class GridItemRef {
|
|
3618
|
-
}
|
|
3619
|
-
|
|
3620
|
-
const createGridAdapter = (fromItem, toItem) => ({
|
|
3621
|
-
fromExternal: (items) => items.map(fromItem),
|
|
3622
|
-
toExternal: (items) => items.map(toItem),
|
|
3623
|
-
});
|
|
3624
|
-
/** Map a backend position shaped as `{x, y, cols, rows}` to a `GridItemPosition`. */
|
|
3625
|
-
const toGridPosition = (pos) => ({
|
|
3626
|
-
col: pos.x,
|
|
3627
|
-
row: pos.y,
|
|
3628
|
-
colSpan: pos.cols,
|
|
3629
|
-
rowSpan: pos.rows,
|
|
3630
|
-
});
|
|
3631
|
-
/** Map a `GridItemPosition` to a backend position shaped as `{x, y, cols, rows}`. */
|
|
3632
|
-
const fromGridPosition = (pos) => ({
|
|
3633
|
-
x: pos.col,
|
|
3634
|
-
y: pos.row,
|
|
3635
|
-
cols: pos.colSpan,
|
|
3636
|
-
rows: pos.rowSpan,
|
|
3637
|
-
});
|
|
3638
|
-
|
|
3639
|
-
class GridComponent {
|
|
3640
|
-
constructor() {
|
|
3641
|
-
this.grid = inject(GridDirective);
|
|
3642
|
-
this.ghostRef = viewChild('ghostRef', ...(ngDevMode ? [{ debugName: "ghostRef" }] : /* istanbul ignore next */ []));
|
|
3643
|
-
this.gridConfig = injectGridConfig();
|
|
3644
|
-
this.locale = injectLocale();
|
|
3645
|
-
this.ariaLabel = computed(() => {
|
|
3646
|
-
const label = this.grid.readOnly() ? this.gridConfig.readonlyAriaLabel : this.gridConfig.interactiveAriaLabel;
|
|
3647
|
-
return this.gridConfig.transformer(label, this.locale.currentLocale());
|
|
3648
|
-
}, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
3649
|
-
this.gridColumns = computed(() => this.grid.activeColumns(), ...(ngDevMode ? [{ debugName: "gridColumns" }] : /* istanbul ignore next */ []));
|
|
3650
|
-
this.gridGap = computed(() => `${this.grid.gap()}px`, ...(ngDevMode ? [{ debugName: "gridGap" }] : /* istanbul ignore next */ []));
|
|
3651
|
-
this.gridRowHeight = computed(() => `${this.grid.rowHeight()}px`, ...(ngDevMode ? [{ debugName: "gridRowHeight" }] : /* istanbul ignore next */ []));
|
|
3652
|
-
effect(() => {
|
|
3653
|
-
this.grid.setGhostElement(this.ghostRef()?.nativeElement ?? null);
|
|
3654
|
-
});
|
|
3655
|
-
}
|
|
3656
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3657
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: GridComponent, isStandalone: true, selector: "et-grid, [et-grid]", host: { attributes: { "role": "region" }, properties: { "attr.aria-label": "ariaLabel()", "style.--_et-grid-columns": "gridColumns()", "style.--et-grid-gap": "gridGap()", "style.--et-grid-row-height": "gridRowHeight()" }, classAttribute: "et-grid" }, viewQueries: [{ propertyName: "ghostRef", first: true, predicate: ["ghostRef"], descendants: true, isSignal: true }], hostDirectives: [{ directive: GridDirective, inputs: ["breakpoints", "breakpoints", "rowHeight", "rowHeight", "gap", "gap", "initialItems", "initialItems", "readOnly", "readOnly"], outputs: ["layoutChange", "layoutChange"] }], ngImport: i0, template: `
|
|
3658
|
-
<ng-content />
|
|
3659
|
-
@if (grid.ghostPosition(); as ghost) {
|
|
3660
|
-
<div
|
|
3661
|
-
#ghostRef
|
|
3662
|
-
[style.grid-column]="ghost.col + 1 + ' / span ' + ghost.colSpan"
|
|
3663
|
-
[style.grid-row]="ghost.row + 1 + ' / span ' + ghost.rowSpan"
|
|
3664
|
-
class="et-grid-ghost"
|
|
3665
|
-
></div>
|
|
3666
|
-
}
|
|
3667
|
-
`, isInline: true, styles: ["@property --et-grid-gap{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-grid-row-height{syntax: \"<length>\"; inherits: false; initial-value: 100px;}@property --et-grid-padding{syntax: \"<length>\"; inherits: false; initial-value: 0px;}.et-grid{display:grid;grid-template-columns:repeat(var(--_et-grid-columns, 12),1fr);grid-auto-rows:var(--et-grid-row-height);gap:var(--et-grid-gap);padding:var(--et-grid-padding);position:relative;min-height:0}.et-grid:has(.et-grid-item--dragging,.et-grid-item--resizing){-webkit-user-select:none;user-select:none;cursor:grabbing}.et-grid:has(.et-grid-item--resizing){cursor:nwse-resize}.et-grid-ghost{border-radius:8px;background:rgb(var(--et-surface-color, 23 23 23) / .08);border:2px dashed rgb(var(--et-surface-color, 23 23 23) / .2);pointer-events:none;transition:grid-column 0s,grid-row 0s}.et-grid--readonly .et-grid-item__drag-handle{cursor:default;pointer-events:none}.et-grid--readonly .et-grid-item__actions{display:none}.et-grid--readonly .et-grid-item:hover .et-resize-handle--e:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--s:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--w:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--n:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--se:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--sw:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--ne:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--nw:after{content:unset}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
3668
|
-
}
|
|
3669
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridComponent, decorators: [{
|
|
3670
|
-
type: Component,
|
|
3671
|
-
args: [{ selector: 'et-grid, [et-grid]', template: `
|
|
3672
|
-
<ng-content />
|
|
3673
|
-
@if (grid.ghostPosition(); as ghost) {
|
|
3674
|
-
<div
|
|
3675
|
-
#ghostRef
|
|
3676
|
-
[style.grid-column]="ghost.col + 1 + ' / span ' + ghost.colSpan"
|
|
3677
|
-
[style.grid-row]="ghost.row + 1 + ' / span ' + ghost.rowSpan"
|
|
3678
|
-
class="et-grid-ghost"
|
|
3679
|
-
></div>
|
|
3680
|
-
}
|
|
3681
|
-
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
|
|
3682
|
-
{
|
|
3683
|
-
directive: GridDirective,
|
|
3684
|
-
inputs: ['breakpoints', 'rowHeight', 'gap', 'initialItems', 'readOnly'],
|
|
3685
|
-
outputs: ['layoutChange'],
|
|
3686
|
-
},
|
|
3687
|
-
], host: {
|
|
3688
|
-
class: 'et-grid',
|
|
3689
|
-
role: 'region',
|
|
3690
|
-
'[attr.aria-label]': 'ariaLabel()',
|
|
3691
|
-
'[style.--_et-grid-columns]': 'gridColumns()',
|
|
3692
|
-
'[style.--et-grid-gap]': 'gridGap()',
|
|
3693
|
-
'[style.--et-grid-row-height]': 'gridRowHeight()',
|
|
3694
|
-
}, styles: ["@property --et-grid-gap{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-grid-row-height{syntax: \"<length>\"; inherits: false; initial-value: 100px;}@property --et-grid-padding{syntax: \"<length>\"; inherits: false; initial-value: 0px;}.et-grid{display:grid;grid-template-columns:repeat(var(--_et-grid-columns, 12),1fr);grid-auto-rows:var(--et-grid-row-height);gap:var(--et-grid-gap);padding:var(--et-grid-padding);position:relative;min-height:0}.et-grid:has(.et-grid-item--dragging,.et-grid-item--resizing){-webkit-user-select:none;user-select:none;cursor:grabbing}.et-grid:has(.et-grid-item--resizing){cursor:nwse-resize}.et-grid-ghost{border-radius:8px;background:rgb(var(--et-surface-color, 23 23 23) / .08);border:2px dashed rgb(var(--et-surface-color, 23 23 23) / .2);pointer-events:none;transition:grid-column 0s,grid-row 0s}.et-grid--readonly .et-grid-item__drag-handle{cursor:default;pointer-events:none}.et-grid--readonly .et-grid-item__actions{display:none}.et-grid--readonly .et-grid-item:hover .et-resize-handle--e:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--s:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--w:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--n:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--se:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--sw:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--ne:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--nw:after{content:unset}\n"] }]
|
|
3695
|
-
}], ctorParameters: () => [], propDecorators: { ghostRef: [{ type: i0.ViewChild, args: ['ghostRef', { isSignal: true }] }] } });
|
|
4781
|
+
this.grid.commitResize();
|
|
4782
|
+
}
|
|
4783
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridResizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4784
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.13", type: GridResizeDirective, isStandalone: true, selector: "[etGridResize]", host: { properties: { "class.et-grid-resize--active": "isResizing()" }, classAttribute: "et-grid-resize" }, ngImport: i0 }); }
|
|
4785
|
+
}
|
|
4786
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridResizeDirective, decorators: [{
|
|
4787
|
+
type: Directive,
|
|
4788
|
+
args: [{
|
|
4789
|
+
selector: '[etGridResize]',
|
|
4790
|
+
host: {
|
|
4791
|
+
class: 'et-grid-resize',
|
|
4792
|
+
'[class.et-grid-resize--active]': 'isResizing()',
|
|
4793
|
+
},
|
|
4794
|
+
}]
|
|
4795
|
+
}] });
|
|
4796
|
+
|
|
4797
|
+
/**
|
|
4798
|
+
* Injectable reference provided to configComponent instances.
|
|
4799
|
+
* Gives the config form access to the item's current data and the ability to save or cancel.
|
|
4800
|
+
*/
|
|
4801
|
+
class GridItemRef {
|
|
4802
|
+
}
|
|
4803
|
+
|
|
4804
|
+
const createGridAdapter = (fromItem, toItem) => ({
|
|
4805
|
+
fromExternal: (items) => items.map(fromItem),
|
|
4806
|
+
toExternal: (items) => items.map(toItem),
|
|
4807
|
+
});
|
|
4808
|
+
/** Map a backend position shaped as `{x, y, cols, rows}` to a `GridItemPosition`. */
|
|
4809
|
+
const toGridPosition = (pos) => ({
|
|
4810
|
+
col: pos.x,
|
|
4811
|
+
row: pos.y,
|
|
4812
|
+
colSpan: pos.cols,
|
|
4813
|
+
rowSpan: pos.rows,
|
|
4814
|
+
});
|
|
4815
|
+
/** Map a `GridItemPosition` to a backend position shaped as `{x, y, cols, rows}`. */
|
|
4816
|
+
const fromGridPosition = (pos) => ({
|
|
4817
|
+
x: pos.col,
|
|
4818
|
+
y: pos.row,
|
|
4819
|
+
cols: pos.colSpan,
|
|
4820
|
+
rows: pos.rowSpan,
|
|
4821
|
+
});
|
|
3696
4822
|
|
|
3697
4823
|
class GridItemComponent {
|
|
3698
4824
|
constructor() {
|
|
3699
4825
|
this.grid = inject(GRID_TOKEN);
|
|
3700
4826
|
this.gridItem = inject(GridItemDirective);
|
|
4827
|
+
this.provideSurface = inject(ProvideSurfaceDirective);
|
|
4828
|
+
this.parentSurfaceProvider = inject(SURFACE_PROVIDER, { optional: true, skipSelf: true });
|
|
3701
4829
|
this.gridDrag = inject(GridDragDirective);
|
|
3702
4830
|
this.gridResize = inject(GridResizeDirective);
|
|
3703
4831
|
this.ariaLabel = input('Grid item', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
3704
4832
|
this.removed = output();
|
|
4833
|
+
this.surfaceThemes = injectSurfaceThemes({ optional: true });
|
|
3705
4834
|
this.gridConfig = injectGridConfig();
|
|
3706
4835
|
this.locale = injectLocale();
|
|
3707
4836
|
this.isReadOnly = computed(() => this.grid.readOnly(), ...(ngDevMode ? [{ debugName: "isReadOnly" }] : /* istanbul ignore next */ []));
|
|
3708
4837
|
this.dragHandleAriaLabel = computed(() => this.gridConfig.transformer(this.gridConfig.dragHandleAriaLabel, this.locale.currentLocale()), ...(ngDevMode ? [{ debugName: "dragHandleAriaLabel" }] : /* istanbul ignore next */ []));
|
|
4838
|
+
this.resolvedSurface = computed(() => {
|
|
4839
|
+
const themes = this.surfaceThemes;
|
|
4840
|
+
const parent = this.parentSurfaceProvider;
|
|
4841
|
+
if (!themes || !parent)
|
|
4842
|
+
return null;
|
|
4843
|
+
return resolveSurfaceByElevation(themes, parent.surfaceType() ?? 'dark', parent.elevation() + 1);
|
|
4844
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedSurface" }] : /* istanbul ignore next */ []));
|
|
4845
|
+
effect(() => {
|
|
4846
|
+
const surface = this.resolvedSurface();
|
|
4847
|
+
if (surface) {
|
|
4848
|
+
this.provideSurface.forceSurface(surface.name);
|
|
4849
|
+
}
|
|
4850
|
+
else {
|
|
4851
|
+
this.provideSurface.clearForcedSurface();
|
|
4852
|
+
}
|
|
4853
|
+
});
|
|
3709
4854
|
}
|
|
3710
4855
|
applyKeyboardShortcut(event) {
|
|
3711
4856
|
if (this.isReadOnly())
|
|
@@ -3769,7 +4914,7 @@ class GridItemComponent {
|
|
|
3769
4914
|
}
|
|
3770
4915
|
}
|
|
3771
4916
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3772
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.13", type: GridItemComponent, isStandalone: true, selector: "et-grid-item, [et-grid-item]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removed: "removed" }, host: { listeners: { "keydown": "applyKeyboardShortcut($event)" }, properties: { "class.et-grid-item--dragging": "!isReadOnly() && gridDrag.dragHandle.isDragging()", "class.et-grid-item--resizing": "gridResize.isResizing()", "attr.role": "\"group\"", "attr.aria-label": "ariaLabel()", "attr.tabindex": "\"0\"" }, classAttribute: "et-grid-item" }, hostDirectives: [{ directive: GridItemDirective, inputs: ["itemId", "itemId", "minColSpan", "minColSpan", "maxColSpan", "maxColSpan", "minRowSpan", "minRowSpan", "maxRowSpan", "maxRowSpan"] }, { directive: GridDragDirective }, { directive: GridResizeDirective }], ngImport: i0, template: `
|
|
4917
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.13", type: GridItemComponent, isStandalone: true, selector: "et-grid-item, [et-grid-item]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removed: "removed" }, host: { listeners: { "keydown": "applyKeyboardShortcut($event)" }, properties: { "class.et-grid-item--dragging": "!isReadOnly() && gridDrag.dragHandle.isDragging()", "class.et-grid-item--resizing": "gridResize.isResizing()", "attr.role": "\"group\"", "attr.aria-label": "ariaLabel()", "attr.tabindex": "\"0\"" }, classAttribute: "et-grid-item" }, hostDirectives: [{ directive: GridItemDirective, inputs: ["itemId", "itemId", "minColSpan", "minColSpan", "maxColSpan", "maxColSpan", "minRowSpan", "minRowSpan", "maxRowSpan", "maxRowSpan"] }, { directive: GridDragDirective }, { directive: GridResizeDirective }, { directive: i2.ProvideSurfaceDirective }], ngImport: i0, template: `
|
|
3773
4918
|
<div [attr.aria-label]="dragHandleAriaLabel()" class="et-grid-item__drag-handle">
|
|
3774
4919
|
<ng-content select="[etGridItemDragHandle]" />
|
|
3775
4920
|
</div>
|
|
@@ -3790,7 +4935,7 @@ class GridItemComponent {
|
|
|
3790
4935
|
<div (pointerdown)="$event.stopPropagation()" class="et-grid-item__actions">
|
|
3791
4936
|
<ng-content select="[etGridItemAction]" />
|
|
3792
4937
|
</div>
|
|
3793
|
-
`, isInline: true, styles: ["
|
|
4938
|
+
`, isInline: true, styles: [".et-grid-item{position:relative;display:flex;flex-direction:column;outline:none;will-change:transform;border-radius:var(--et-grid-item-radius, 0);background:var(--et-grid-item-bg, var(--et-surface-background-solid))}.et-grid-item:is(.et-grid-item--dragging){z-index:100;cursor:grabbing;-webkit-user-select:none;user-select:none}.et-grid-item:is(.et-grid-item--resizing){z-index:100;-webkit-user-select:none;user-select:none}.et-grid-item:hover .et-resize-handle--e:after,.et-grid-item:hover .et-resize-handle--s:after,.et-grid-item:hover .et-resize-handle--w:after,.et-grid-item:hover .et-resize-handle--n:after,.et-grid-item:hover .et-resize-handle--se:after,.et-grid-item:hover .et-resize-handle--sw:after,.et-grid-item:hover .et-resize-handle--ne:after,.et-grid-item:hover .et-resize-handle--nw:after,.et-grid-item--resizing .et-resize-handle--e:after,.et-grid-item--resizing .et-resize-handle--s:after,.et-grid-item--resizing .et-resize-handle--w:after,.et-grid-item--resizing .et-resize-handle--n:after,.et-grid-item--resizing .et-resize-handle--se:after,.et-grid-item--resizing .et-resize-handle--sw:after,.et-grid-item--resizing .et-resize-handle--ne:after,.et-grid-item--resizing .et-resize-handle--nw:after{content:\"\";position:absolute;border-radius:2px;background:var(--et-grid-item-resize-handle-color, var(--et-surface-color-solid));opacity:.2}.et-grid-item:hover .et-resize-handle--e:after,.et-grid-item--resizing .et-resize-handle--e:after{right:2px;top:50%;transform:translateY(-50%);width:3px;height:24px}.et-grid-item:hover .et-resize-handle--w:after,.et-grid-item--resizing .et-resize-handle--w:after{left:2px;top:50%;transform:translateY(-50%);width:3px;height:24px}.et-grid-item:hover .et-resize-handle--s:after,.et-grid-item--resizing .et-resize-handle--s:after{bottom:2px;left:50%;transform:translate(-50%);height:3px;width:24px}.et-grid-item:hover .et-resize-handle--n:after,.et-grid-item--resizing .et-resize-handle--n:after{top:2px;left:50%;transform:translate(-50%);height:3px;width:24px}.et-grid-item:hover .et-resize-handle--se:after,.et-grid-item--resizing .et-resize-handle--se:after{bottom:3px;right:3px;width:8px;height:8px;border-radius:1px}.et-grid-item:hover .et-resize-handle--sw:after,.et-grid-item--resizing .et-resize-handle--sw:after{bottom:3px;left:3px;width:8px;height:8px;border-radius:1px}.et-grid-item:hover .et-resize-handle--ne:after,.et-grid-item--resizing .et-resize-handle--ne:after{top:3px;right:3px;width:8px;height:8px;border-radius:1px}.et-grid-item:hover .et-resize-handle--nw:after,.et-grid-item--resizing .et-resize-handle--nw:after{top:3px;left:3px;width:8px;height:8px;border-radius:1px}.et-grid-item__drag-handle{cursor:grab;display:flex;align-items:center;-webkit-user-select:none;user-select:none;touch-action:none}.et-grid-item--dragging .et-grid-item__drag-handle{cursor:grabbing}.et-grid-item__content{flex:1;min-height:0}.et-grid-item__actions{position:absolute;top:4px;right:4px;display:flex;gap:4px}\n"], dependencies: [{ kind: "component", type: ResizeHandlesComponent, selector: "et-resize-handles", inputs: ["edges", "disabled"], outputs: ["resizeStarted", "resizeMoved", "resizeEnded"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
3794
4939
|
}
|
|
3795
4940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridItemComponent, decorators: [{
|
|
3796
4941
|
type: Component,
|
|
@@ -3822,6 +4967,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
3822
4967
|
},
|
|
3823
4968
|
GridDragDirective,
|
|
3824
4969
|
GridResizeDirective,
|
|
4970
|
+
ProvideSurfaceDirective,
|
|
3825
4971
|
], host: {
|
|
3826
4972
|
class: 'et-grid-item',
|
|
3827
4973
|
'[class.et-grid-item--dragging]': '!isReadOnly() && gridDrag.dragHandle.isDragging()',
|
|
@@ -3830,8 +4976,138 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
3830
4976
|
'[attr.aria-label]': 'ariaLabel()',
|
|
3831
4977
|
'[attr.tabindex]': '"0"',
|
|
3832
4978
|
'(keydown)': 'applyKeyboardShortcut($event)',
|
|
3833
|
-
}, styles: ["
|
|
3834
|
-
}], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], removed: [{ type: i0.Output, args: ["removed"] }] } });
|
|
4979
|
+
}, styles: [".et-grid-item{position:relative;display:flex;flex-direction:column;outline:none;will-change:transform;border-radius:var(--et-grid-item-radius, 0);background:var(--et-grid-item-bg, var(--et-surface-background-solid))}.et-grid-item:is(.et-grid-item--dragging){z-index:100;cursor:grabbing;-webkit-user-select:none;user-select:none}.et-grid-item:is(.et-grid-item--resizing){z-index:100;-webkit-user-select:none;user-select:none}.et-grid-item:hover .et-resize-handle--e:after,.et-grid-item:hover .et-resize-handle--s:after,.et-grid-item:hover .et-resize-handle--w:after,.et-grid-item:hover .et-resize-handle--n:after,.et-grid-item:hover .et-resize-handle--se:after,.et-grid-item:hover .et-resize-handle--sw:after,.et-grid-item:hover .et-resize-handle--ne:after,.et-grid-item:hover .et-resize-handle--nw:after,.et-grid-item--resizing .et-resize-handle--e:after,.et-grid-item--resizing .et-resize-handle--s:after,.et-grid-item--resizing .et-resize-handle--w:after,.et-grid-item--resizing .et-resize-handle--n:after,.et-grid-item--resizing .et-resize-handle--se:after,.et-grid-item--resizing .et-resize-handle--sw:after,.et-grid-item--resizing .et-resize-handle--ne:after,.et-grid-item--resizing .et-resize-handle--nw:after{content:\"\";position:absolute;border-radius:2px;background:var(--et-grid-item-resize-handle-color, var(--et-surface-color-solid));opacity:.2}.et-grid-item:hover .et-resize-handle--e:after,.et-grid-item--resizing .et-resize-handle--e:after{right:2px;top:50%;transform:translateY(-50%);width:3px;height:24px}.et-grid-item:hover .et-resize-handle--w:after,.et-grid-item--resizing .et-resize-handle--w:after{left:2px;top:50%;transform:translateY(-50%);width:3px;height:24px}.et-grid-item:hover .et-resize-handle--s:after,.et-grid-item--resizing .et-resize-handle--s:after{bottom:2px;left:50%;transform:translate(-50%);height:3px;width:24px}.et-grid-item:hover .et-resize-handle--n:after,.et-grid-item--resizing .et-resize-handle--n:after{top:2px;left:50%;transform:translate(-50%);height:3px;width:24px}.et-grid-item:hover .et-resize-handle--se:after,.et-grid-item--resizing .et-resize-handle--se:after{bottom:3px;right:3px;width:8px;height:8px;border-radius:1px}.et-grid-item:hover .et-resize-handle--sw:after,.et-grid-item--resizing .et-resize-handle--sw:after{bottom:3px;left:3px;width:8px;height:8px;border-radius:1px}.et-grid-item:hover .et-resize-handle--ne:after,.et-grid-item--resizing .et-resize-handle--ne:after{top:3px;right:3px;width:8px;height:8px;border-radius:1px}.et-grid-item:hover .et-resize-handle--nw:after,.et-grid-item--resizing .et-resize-handle--nw:after{top:3px;left:3px;width:8px;height:8px;border-radius:1px}.et-grid-item__drag-handle{cursor:grab;display:flex;align-items:center;-webkit-user-select:none;user-select:none;touch-action:none}.et-grid-item--dragging .et-grid-item__drag-handle{cursor:grabbing}.et-grid-item__content{flex:1;min-height:0}.et-grid-item__actions{position:absolute;top:4px;right:4px;display:flex;gap:4px}\n"] }]
|
|
4980
|
+
}], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], removed: [{ type: i0.Output, args: ["removed"] }] } });
|
|
4981
|
+
|
|
4982
|
+
class GridComponent {
|
|
4983
|
+
constructor() {
|
|
4984
|
+
this.grid = inject(GridDirective);
|
|
4985
|
+
this.ghostRef = viewChild('ghostRef', ...(ngDevMode ? [{ debugName: "ghostRef" }] : /* istanbul ignore next */ []));
|
|
4986
|
+
this.gridConfig = injectGridConfig();
|
|
4987
|
+
this.locale = injectLocale();
|
|
4988
|
+
this.isReadOnly = computed(() => this.grid.readOnly(), ...(ngDevMode ? [{ debugName: "isReadOnly" }] : /* istanbul ignore next */ []));
|
|
4989
|
+
this.dragHandleComponent = computed(() => this.gridConfig.dragHandleComponent, ...(ngDevMode ? [{ debugName: "dragHandleComponent" }] : /* istanbul ignore next */ []));
|
|
4990
|
+
this.actionsComponent = computed(() => this.gridConfig.actionsComponent, ...(ngDevMode ? [{ debugName: "actionsComponent" }] : /* istanbul ignore next */ []));
|
|
4991
|
+
this.registeredItems = computed(() => {
|
|
4992
|
+
const registrations = this.gridConfig.registrations;
|
|
4993
|
+
return this.grid.items().flatMap((item) => {
|
|
4994
|
+
const reg = registrations.find((r) => r.type === item.type);
|
|
4995
|
+
return reg ? [{ item, reg }] : [];
|
|
4996
|
+
});
|
|
4997
|
+
}, ...(ngDevMode ? [{ debugName: "registeredItems" }] : /* istanbul ignore next */ []));
|
|
4998
|
+
this.ariaLabel = computed(() => {
|
|
4999
|
+
const label = this.grid.readOnly() ? this.gridConfig.readonlyAriaLabel : this.gridConfig.interactiveAriaLabel;
|
|
5000
|
+
return this.gridConfig.transformer(label, this.locale.currentLocale());
|
|
5001
|
+
}, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
5002
|
+
this.gridColumns = computed(() => this.grid.activeColumns(), ...(ngDevMode ? [{ debugName: "gridColumns" }] : /* istanbul ignore next */ []));
|
|
5003
|
+
this.gridGap = computed(() => `${this.grid.gap()}px`, ...(ngDevMode ? [{ debugName: "gridGap" }] : /* istanbul ignore next */ []));
|
|
5004
|
+
this.gridRowHeight = computed(() => `${this.grid.rowHeight()}px`, ...(ngDevMode ? [{ debugName: "gridRowHeight" }] : /* istanbul ignore next */ []));
|
|
5005
|
+
effect(() => {
|
|
5006
|
+
this.grid.setGhostElement(this.ghostRef()?.nativeElement ?? null);
|
|
5007
|
+
});
|
|
5008
|
+
}
|
|
5009
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5010
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: GridComponent, isStandalone: true, selector: "et-grid, [et-grid]", host: { attributes: { "role": "region" }, properties: { "attr.aria-label": "ariaLabel()", "style.--_et-grid-columns": "gridColumns()", "style.--et-grid-gap": "gridGap()", "style.--et-grid-row-height": "gridRowHeight()" }, classAttribute: "et-grid" }, viewQueries: [{ propertyName: "ghostRef", first: true, predicate: ["ghostRef"], descendants: true, isSignal: true }], hostDirectives: [{ directive: GridDirective, inputs: ["breakpoints", "breakpoints", "rowHeight", "rowHeight", "gap", "gap", "initialItems", "initialItems", "readOnly", "readOnly"], outputs: ["layoutChange", "layoutChange"] }], ngImport: i0, template: `
|
|
5011
|
+
@for (entry of registeredItems(); track entry.item.id) {
|
|
5012
|
+
<et-grid-item
|
|
5013
|
+
[itemId]="entry.item.id"
|
|
5014
|
+
[minColSpan]="entry.reg.constraints?.minColSpan ?? 1"
|
|
5015
|
+
[maxColSpan]="entry.reg.constraints?.maxColSpan ?? 12"
|
|
5016
|
+
[minRowSpan]="entry.reg.constraints?.minRowSpan ?? 1"
|
|
5017
|
+
[maxRowSpan]="entry.reg.constraints?.maxRowSpan ?? 4"
|
|
5018
|
+
>
|
|
5019
|
+
@if (dragHandleComponent()) {
|
|
5020
|
+
<div etGridItemDragHandle>
|
|
5021
|
+
<ng-container
|
|
5022
|
+
[ngComponentOutlet]="dragHandleComponent()!"
|
|
5023
|
+
[ngComponentOutletInputs]="{ data: entry.item.data, itemId: entry.item.id }"
|
|
5024
|
+
/>
|
|
5025
|
+
</div>
|
|
5026
|
+
} @else {
|
|
5027
|
+
<div etGridItemDragHandle></div>
|
|
5028
|
+
}
|
|
5029
|
+
<ng-container [ngComponentOutlet]="entry.reg.component" [ngComponentOutletInputs]="{ data: entry.item.data }" />
|
|
5030
|
+
@if (actionsComponent()) {
|
|
5031
|
+
<div etGridItemAction>
|
|
5032
|
+
<ng-container
|
|
5033
|
+
[ngComponentOutlet]="actionsComponent()!"
|
|
5034
|
+
[ngComponentOutletInputs]="{ data: entry.item.data, itemId: entry.item.id }"
|
|
5035
|
+
/>
|
|
5036
|
+
</div>
|
|
5037
|
+
} @else if (!isReadOnly()) {
|
|
5038
|
+
<button (click)="grid.removeItem(entry.item.id)" etGridItemAction>✕</button>
|
|
5039
|
+
}
|
|
5040
|
+
</et-grid-item>
|
|
5041
|
+
}
|
|
5042
|
+
<ng-content />
|
|
5043
|
+
@if (grid.ghostPosition(); as ghost) {
|
|
5044
|
+
<div
|
|
5045
|
+
#ghostRef
|
|
5046
|
+
[style.grid-column]="ghost.col + 1 + ' / span ' + ghost.colSpan"
|
|
5047
|
+
[style.grid-row]="ghost.row + 1 + ' / span ' + ghost.rowSpan"
|
|
5048
|
+
class="et-grid-ghost"
|
|
5049
|
+
></div>
|
|
5050
|
+
}
|
|
5051
|
+
`, isInline: true, styles: ["@property --et-grid-gap{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-grid-row-height{syntax: \"<length>\"; inherits: false; initial-value: 100px;}@property --et-grid-padding{syntax: \"<length>\"; inherits: false; initial-value: 0px;}.et-grid{display:grid;grid-template-columns:repeat(var(--_et-grid-columns, 12),1fr);grid-auto-rows:var(--et-grid-row-height);gap:var(--et-grid-gap);padding:var(--et-grid-padding);position:relative;min-height:0}.et-grid:has(.et-grid-item--dragging,.et-grid-item--resizing){-webkit-user-select:none;user-select:none;cursor:grabbing}.et-grid:has(.et-grid-item--resizing){cursor:nwse-resize}.et-grid-ghost{border-radius:8px;background:rgb(var(--et-surface-color, 23 23 23) / .08);border:2px dashed rgb(var(--et-surface-color, 23 23 23) / .2);pointer-events:none;transition:grid-column 0s,grid-row 0s}.et-grid--readonly .et-grid-item__drag-handle{cursor:default;pointer-events:none}.et-grid--readonly .et-grid-item__actions{display:none}.et-grid--readonly .et-grid-item:hover .et-resize-handle--e:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--s:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--w:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--n:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--se:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--sw:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--ne:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--nw:after{content:unset}\n"], dependencies: [{ kind: "component", type: GridItemComponent, selector: "et-grid-item, [et-grid-item]", inputs: ["ariaLabel"], outputs: ["removed"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5052
|
+
}
|
|
5053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridComponent, decorators: [{
|
|
5054
|
+
type: Component,
|
|
5055
|
+
args: [{ selector: 'et-grid, [et-grid]', template: `
|
|
5056
|
+
@for (entry of registeredItems(); track entry.item.id) {
|
|
5057
|
+
<et-grid-item
|
|
5058
|
+
[itemId]="entry.item.id"
|
|
5059
|
+
[minColSpan]="entry.reg.constraints?.minColSpan ?? 1"
|
|
5060
|
+
[maxColSpan]="entry.reg.constraints?.maxColSpan ?? 12"
|
|
5061
|
+
[minRowSpan]="entry.reg.constraints?.minRowSpan ?? 1"
|
|
5062
|
+
[maxRowSpan]="entry.reg.constraints?.maxRowSpan ?? 4"
|
|
5063
|
+
>
|
|
5064
|
+
@if (dragHandleComponent()) {
|
|
5065
|
+
<div etGridItemDragHandle>
|
|
5066
|
+
<ng-container
|
|
5067
|
+
[ngComponentOutlet]="dragHandleComponent()!"
|
|
5068
|
+
[ngComponentOutletInputs]="{ data: entry.item.data, itemId: entry.item.id }"
|
|
5069
|
+
/>
|
|
5070
|
+
</div>
|
|
5071
|
+
} @else {
|
|
5072
|
+
<div etGridItemDragHandle></div>
|
|
5073
|
+
}
|
|
5074
|
+
<ng-container [ngComponentOutlet]="entry.reg.component" [ngComponentOutletInputs]="{ data: entry.item.data }" />
|
|
5075
|
+
@if (actionsComponent()) {
|
|
5076
|
+
<div etGridItemAction>
|
|
5077
|
+
<ng-container
|
|
5078
|
+
[ngComponentOutlet]="actionsComponent()!"
|
|
5079
|
+
[ngComponentOutletInputs]="{ data: entry.item.data, itemId: entry.item.id }"
|
|
5080
|
+
/>
|
|
5081
|
+
</div>
|
|
5082
|
+
} @else if (!isReadOnly()) {
|
|
5083
|
+
<button (click)="grid.removeItem(entry.item.id)" etGridItemAction>✕</button>
|
|
5084
|
+
}
|
|
5085
|
+
</et-grid-item>
|
|
5086
|
+
}
|
|
5087
|
+
<ng-content />
|
|
5088
|
+
@if (grid.ghostPosition(); as ghost) {
|
|
5089
|
+
<div
|
|
5090
|
+
#ghostRef
|
|
5091
|
+
[style.grid-column]="ghost.col + 1 + ' / span ' + ghost.colSpan"
|
|
5092
|
+
[style.grid-row]="ghost.row + 1 + ' / span ' + ghost.rowSpan"
|
|
5093
|
+
class="et-grid-ghost"
|
|
5094
|
+
></div>
|
|
5095
|
+
}
|
|
5096
|
+
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [GridItemComponent, NgComponentOutlet], hostDirectives: [
|
|
5097
|
+
{
|
|
5098
|
+
directive: GridDirective,
|
|
5099
|
+
inputs: ['breakpoints', 'rowHeight', 'gap', 'initialItems', 'readOnly'],
|
|
5100
|
+
outputs: ['layoutChange'],
|
|
5101
|
+
},
|
|
5102
|
+
], host: {
|
|
5103
|
+
class: 'et-grid',
|
|
5104
|
+
role: 'region',
|
|
5105
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
5106
|
+
'[style.--_et-grid-columns]': 'gridColumns()',
|
|
5107
|
+
'[style.--et-grid-gap]': 'gridGap()',
|
|
5108
|
+
'[style.--et-grid-row-height]': 'gridRowHeight()',
|
|
5109
|
+
}, styles: ["@property --et-grid-gap{syntax: \"<length>\"; inherits: false; initial-value: 16px;}@property --et-grid-row-height{syntax: \"<length>\"; inherits: false; initial-value: 100px;}@property --et-grid-padding{syntax: \"<length>\"; inherits: false; initial-value: 0px;}.et-grid{display:grid;grid-template-columns:repeat(var(--_et-grid-columns, 12),1fr);grid-auto-rows:var(--et-grid-row-height);gap:var(--et-grid-gap);padding:var(--et-grid-padding);position:relative;min-height:0}.et-grid:has(.et-grid-item--dragging,.et-grid-item--resizing){-webkit-user-select:none;user-select:none;cursor:grabbing}.et-grid:has(.et-grid-item--resizing){cursor:nwse-resize}.et-grid-ghost{border-radius:8px;background:rgb(var(--et-surface-color, 23 23 23) / .08);border:2px dashed rgb(var(--et-surface-color, 23 23 23) / .2);pointer-events:none;transition:grid-column 0s,grid-row 0s}.et-grid--readonly .et-grid-item__drag-handle{cursor:default;pointer-events:none}.et-grid--readonly .et-grid-item__actions{display:none}.et-grid--readonly .et-grid-item:hover .et-resize-handle--e:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--s:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--w:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--n:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--se:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--sw:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--ne:after,.et-grid--readonly .et-grid-item:hover .et-resize-handle--nw:after{content:unset}\n"] }]
|
|
5110
|
+
}], ctorParameters: () => [], propDecorators: { ghostRef: [{ type: i0.ViewChild, args: ['ghostRef', { isSignal: true }] }] } });
|
|
3835
5111
|
|
|
3836
5112
|
const posEq = (a, b) => {
|
|
3837
5113
|
if (!a && !b)
|
|
@@ -3906,139 +5182,24 @@ class GridDebugComponent {
|
|
|
3906
5182
|
const external = this.externalItems();
|
|
3907
5183
|
const snapshot = {
|
|
3908
5184
|
timestamp: new Date().toISOString(),
|
|
3909
|
-
activeBreakpoint: this.activeBreakpoint(),
|
|
3910
|
-
containerWidth: this.containerWidth(),
|
|
3911
|
-
breakpoints: this.breakpoints(),
|
|
3912
|
-
internalItems: this.items().map((i) => ({ id: i.id, type: i.type, layout: i.layout })),
|
|
3913
|
-
activeLayout: this.layout(),
|
|
3914
|
-
...(external ? { externalItems: external.map((i) => ({ id: i.id, type: i.type, layout: i.layout })) } : {}),
|
|
3915
|
-
issues,
|
|
3916
|
-
};
|
|
3917
|
-
navigator.clipboard.writeText(JSON.stringify(snapshot, null, 2)).catch(() => {
|
|
3918
|
-
/* clipboard unavailable in this context */
|
|
3919
|
-
});
|
|
3920
|
-
this.copied.set(true);
|
|
3921
|
-
timer(2000)
|
|
3922
|
-
.pipe(takeUntilDestroyed(this.destroyRef), tap$1(() => this.copied.set(false)))
|
|
3923
|
-
.subscribe();
|
|
3924
|
-
}
|
|
3925
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridDebugComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3926
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: GridDebugComponent, isStandalone: true, selector: "et-grid-debug", inputs: { grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: true, transformFunction: null }, externalItems: { classPropertyName: "externalItems", publicName: "externalItems", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
3927
|
-
<details
|
|
3928
|
-
style="font-family: monospace; font-size: 11px; border: 1px solid #d1d5db; border-radius: 4px; margin-top: 8px; background: #f9fafb; color: #111"
|
|
3929
|
-
>
|
|
3930
|
-
<summary
|
|
3931
|
-
style="padding: 6px 10px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; user-select: none"
|
|
3932
|
-
>
|
|
3933
|
-
<span style="font-weight: 700; color: #6b7280">et-grid-debug</span>
|
|
3934
|
-
|
|
3935
|
-
<span style="color: #6b7280">
|
|
3936
|
-
bp: <strong style="color: #111827">{{ activeBreakpoint() }}</strong> · {{ containerWidth() }}px
|
|
3937
|
-
· {{ items().length }} items
|
|
3938
|
-
@if (hasDrag()) {
|
|
3939
|
-
· <span style="color: #d97706">⠿ dragging</span>
|
|
3940
|
-
}
|
|
3941
|
-
</span>
|
|
3942
|
-
|
|
3943
|
-
@if (issueCount() > 0) {
|
|
3944
|
-
<span style="color: #dc2626; font-weight: 700"
|
|
3945
|
-
>⚠ {{ issueCount() }} issue{{ issueCount() === 1 ? '' : 's' }}</span
|
|
3946
|
-
>
|
|
3947
|
-
}
|
|
3948
|
-
|
|
3949
|
-
<button
|
|
3950
|
-
(click)="copyJson($event)"
|
|
3951
|
-
style="margin-left: auto; padding: 2px 8px; border: 1px solid #d1d5db; border-radius: 3px; background: #fff; cursor: pointer; font-size: 11px; color: #374151"
|
|
3952
|
-
>
|
|
3953
|
-
Copy JSON
|
|
3954
|
-
</button>
|
|
3955
|
-
|
|
3956
|
-
@if (copied()) {
|
|
3957
|
-
<span style="color: #16a34a; font-size: 10px">✓ copied</span>
|
|
3958
|
-
}
|
|
3959
|
-
</summary>
|
|
3960
|
-
|
|
3961
|
-
<div style="padding: 8px 10px; overflow-x: auto; border-top: 1px solid #e5e7eb">
|
|
3962
|
-
<!-- Breakpoint legend -->
|
|
3963
|
-
<div style="display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap">
|
|
3964
|
-
@for (bp of breakpoints(); track bp.name) {
|
|
3965
|
-
<span
|
|
3966
|
-
[style.fontWeight]="bp.name === activeBreakpoint() ? '700' : '400'"
|
|
3967
|
-
[style.color]="bp.name === activeBreakpoint() ? '#1d4ed8' : '#9ca3af'"
|
|
3968
|
-
style="padding: 1px 7px; border: 1px solid currentColor; border-radius: 99px"
|
|
3969
|
-
>{{ bp.name }} {{ bp.columns }}col ≥{{ bp.minWidth }}px</span
|
|
3970
|
-
>
|
|
3971
|
-
}
|
|
3972
|
-
</div>
|
|
3973
|
-
|
|
3974
|
-
<!-- Layout table -->
|
|
3975
|
-
<table style="border-collapse: collapse; white-space: nowrap">
|
|
3976
|
-
<thead>
|
|
3977
|
-
<tr style="background: #f3f4f6">
|
|
3978
|
-
<th style="padding: 3px 8px; text-align: left; border: 1px solid #e5e7eb">id</th>
|
|
3979
|
-
<th style="padding: 3px 8px; text-align: left; border: 1px solid #e5e7eb">type</th>
|
|
3980
|
-
@for (bp of breakpoints(); track bp.name) {
|
|
3981
|
-
<th
|
|
3982
|
-
[style.background]="bp.name === activeBreakpoint() ? '#dbeafe' : '#f3f4f6'"
|
|
3983
|
-
style="padding: 3px 8px; text-align: center; border: 1px solid #e5e7eb"
|
|
3984
|
-
>
|
|
3985
|
-
{{ bp.name }}{{ hasExternal() ? ' int' : '' }}
|
|
3986
|
-
</th>
|
|
3987
|
-
@if (hasExternal()) {
|
|
3988
|
-
<th
|
|
3989
|
-
[style.background]="bp.name === activeBreakpoint() ? '#dbeafe' : '#f3f4f6'"
|
|
3990
|
-
style="padding: 3px 8px; text-align: center; border: 1px solid #e5e7eb; opacity: .65"
|
|
3991
|
-
>
|
|
3992
|
-
{{ bp.name }} ext
|
|
3993
|
-
</th>
|
|
3994
|
-
}
|
|
3995
|
-
}
|
|
3996
|
-
</tr>
|
|
3997
|
-
</thead>
|
|
3998
|
-
<tbody>
|
|
3999
|
-
@for (row of rows(); track row.id) {
|
|
4000
|
-
<tr>
|
|
4001
|
-
<td style="padding: 3px 8px; border: 1px solid #e5e7eb; color: #6b7280">{{ row.id }}</td>
|
|
4002
|
-
<td style="padding: 3px 8px; border: 1px solid #e5e7eb; color: #9ca3af">{{ row.type }}</td>
|
|
4003
|
-
@for (cell of row.cells; track cell.bp) {
|
|
4004
|
-
<td
|
|
4005
|
-
[style.color]="cell.intMissing ? '#dc2626' : '#111'"
|
|
4006
|
-
[title]="cell.intMissing ? 'MISSING — layout.' + cell.bp + ' undefined in internal state' : ''"
|
|
4007
|
-
style="padding: 3px 8px; border: 1px solid #e5e7eb; text-align: center"
|
|
4008
|
-
>
|
|
4009
|
-
{{ fmtPos(cell.int) }}
|
|
4010
|
-
</td>
|
|
4011
|
-
@if (hasExternal()) {
|
|
4012
|
-
<td
|
|
4013
|
-
[style.color]="cell.extMissing ? '#dc2626' : cell.mismatch ? '#d97706' : '#9ca3af'"
|
|
4014
|
-
[title]="cell.mismatch ? 'MISMATCH — ext=' + fmtPos(cell.ext) + ' int=' + fmtPos(cell.int) : ''"
|
|
4015
|
-
style="padding: 3px 8px; border: 1px solid #e5e7eb; text-align: center"
|
|
4016
|
-
>
|
|
4017
|
-
{{ fmtPos(cell.ext) }}
|
|
4018
|
-
</td>
|
|
4019
|
-
}
|
|
4020
|
-
}
|
|
4021
|
-
</tr>
|
|
4022
|
-
}
|
|
4023
|
-
</tbody>
|
|
4024
|
-
</table>
|
|
4025
|
-
|
|
4026
|
-
@if (hasExternal()) {
|
|
4027
|
-
<p style="margin-top: 6px; color: #9ca3af; font-size: 10px">
|
|
4028
|
-
int = grid.items() (internal) · ext = externalItems input ·
|
|
4029
|
-
<span style="color: #dc2626">red = undefined</span> ·
|
|
4030
|
-
<span style="color: #d97706">orange = mismatch</span>
|
|
4031
|
-
</p>
|
|
4032
|
-
}
|
|
4033
|
-
</div>
|
|
4034
|
-
</details>
|
|
4035
|
-
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
4036
|
-
}
|
|
4037
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridDebugComponent, decorators: [{
|
|
4038
|
-
type: Component,
|
|
4039
|
-
args: [{
|
|
4040
|
-
selector: 'et-grid-debug',
|
|
4041
|
-
template: `
|
|
5185
|
+
activeBreakpoint: this.activeBreakpoint(),
|
|
5186
|
+
containerWidth: this.containerWidth(),
|
|
5187
|
+
breakpoints: this.breakpoints(),
|
|
5188
|
+
internalItems: this.items().map((i) => ({ id: i.id, type: i.type, layout: i.layout })),
|
|
5189
|
+
activeLayout: this.layout(),
|
|
5190
|
+
...(external ? { externalItems: external.map((i) => ({ id: i.id, type: i.type, layout: i.layout })) } : {}),
|
|
5191
|
+
issues,
|
|
5192
|
+
};
|
|
5193
|
+
navigator.clipboard.writeText(JSON.stringify(snapshot, null, 2)).catch(() => {
|
|
5194
|
+
/* clipboard unavailable in this context */
|
|
5195
|
+
});
|
|
5196
|
+
this.copied.set(true);
|
|
5197
|
+
timer(2000)
|
|
5198
|
+
.pipe(takeUntilDestroyed(this.destroyRef), tap$1(() => this.copied.set(false)))
|
|
5199
|
+
.subscribe();
|
|
5200
|
+
}
|
|
5201
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridDebugComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5202
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: GridDebugComponent, isStandalone: true, selector: "et-grid-debug", inputs: { grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: true, transformFunction: null }, externalItems: { classPropertyName: "externalItems", publicName: "externalItems", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
4042
5203
|
<details
|
|
4043
5204
|
style="font-family: monospace; font-size: 11px; border: 1px solid #d1d5db; border-radius: 4px; margin-top: 8px; background: #f9fafb; color: #111"
|
|
4044
5205
|
>
|
|
@@ -4117,360 +5278,165 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
4117
5278
|
<td style="padding: 3px 8px; border: 1px solid #e5e7eb; color: #9ca3af">{{ row.type }}</td>
|
|
4118
5279
|
@for (cell of row.cells; track cell.bp) {
|
|
4119
5280
|
<td
|
|
4120
|
-
[style.color]="cell.intMissing ? '#dc2626' : '#111'"
|
|
4121
|
-
[title]="cell.intMissing ? 'MISSING — layout.' + cell.bp + ' undefined in internal state' : ''"
|
|
4122
|
-
style="padding: 3px 8px; border: 1px solid #e5e7eb; text-align: center"
|
|
4123
|
-
>
|
|
4124
|
-
{{ fmtPos(cell.int) }}
|
|
4125
|
-
</td>
|
|
4126
|
-
@if (hasExternal()) {
|
|
4127
|
-
<td
|
|
4128
|
-
[style.color]="cell.extMissing ? '#dc2626' : cell.mismatch ? '#d97706' : '#9ca3af'"
|
|
4129
|
-
[title]="cell.mismatch ? 'MISMATCH — ext=' + fmtPos(cell.ext) + ' int=' + fmtPos(cell.int) : ''"
|
|
4130
|
-
style="padding: 3px 8px; border: 1px solid #e5e7eb; text-align: center"
|
|
4131
|
-
>
|
|
4132
|
-
{{ fmtPos(cell.ext) }}
|
|
4133
|
-
</td>
|
|
4134
|
-
}
|
|
4135
|
-
}
|
|
4136
|
-
</tr>
|
|
4137
|
-
}
|
|
4138
|
-
</tbody>
|
|
4139
|
-
</table>
|
|
4140
|
-
|
|
4141
|
-
@if (hasExternal()) {
|
|
4142
|
-
<p style="margin-top: 6px; color: #9ca3af; font-size: 10px">
|
|
4143
|
-
int = grid.items() (internal) · ext = externalItems input ·
|
|
4144
|
-
<span style="color: #dc2626">red = undefined</span> ·
|
|
4145
|
-
<span style="color: #d97706">orange = mismatch</span>
|
|
4146
|
-
</p>
|
|
4147
|
-
}
|
|
4148
|
-
</div>
|
|
4149
|
-
</details>
|
|
4150
|
-
`,
|
|
4151
|
-
encapsulation: ViewEncapsulation.None,
|
|
4152
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4153
|
-
}]
|
|
4154
|
-
}], propDecorators: { grid: [{ type: i0.Input, args: [{ isSignal: true, alias: "grid", required: true }] }], externalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "externalItems", required: false }] }] } });
|
|
4155
|
-
|
|
4156
|
-
const GRID_ERROR_CODES = {
|
|
4157
|
-
MISSING_GRID: 1900,
|
|
4158
|
-
MISSING_GRID_ITEM: 1901,
|
|
4159
|
-
DUPLICATE_ITEM_ID: 1902,
|
|
4160
|
-
INVALID_LAYOUT_STATE: 1903,
|
|
4161
|
-
};
|
|
4162
|
-
|
|
4163
|
-
const GridImports = [GridComponent, GridItemComponent, GridDebugComponent];
|
|
4164
|
-
|
|
4165
|
-
const ARROW_OUT_UP_RIGHT_ICON = {
|
|
4166
|
-
name: 'et-arrow-out-up-right',
|
|
4167
|
-
data: `
|
|
4168
|
-
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
4169
|
-
<path
|
|
4170
|
-
fill="currentColor"
|
|
4171
|
-
d="M5 6.75A1.75 1.75 0 0 1 6.75 5h4.5a.75.75 0 0 1 0 1.5h-4.5a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-4.5a.75.75 0 0 1 1.5 0v4.5A1.75 1.75 0 0 1 17.25 19H6.75A1.75 1.75 0 0 1 5 17.25V6.75Z"
|
|
4172
|
-
/>
|
|
4173
|
-
<path
|
|
4174
|
-
fill="currentColor"
|
|
4175
|
-
d="M11.5 5.75c0-.414.336-.75.75-.75h6c.414 0 .75.336.75.75v6a.75.75 0 0 1-1.5 0V7.56l-6.72 6.72a.75.75 0 1 1-1.06-1.06l6.72-6.72h-4.19a.75.75 0 0 1-.75-.75Z"
|
|
4176
|
-
/>
|
|
4177
|
-
</svg>
|
|
4178
|
-
`,
|
|
4179
|
-
};
|
|
4180
|
-
|
|
4181
|
-
const ARROW_RIGHT_ICON = {
|
|
4182
|
-
name: 'et-arrow-right',
|
|
4183
|
-
data: `
|
|
4184
|
-
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
4185
|
-
<path
|
|
4186
|
-
d="M4 12h14"
|
|
4187
|
-
stroke="currentColor"
|
|
4188
|
-
stroke-width="1.8"
|
|
4189
|
-
stroke-linecap="round"
|
|
4190
|
-
stroke-linejoin="round"
|
|
4191
|
-
/>
|
|
4192
|
-
<path
|
|
4193
|
-
d="M13 7l5 5-5 5"
|
|
4194
|
-
stroke="currentColor"
|
|
4195
|
-
stroke-width="1.8"
|
|
4196
|
-
stroke-linecap="round"
|
|
4197
|
-
stroke-linejoin="round"
|
|
4198
|
-
/>
|
|
4199
|
-
</svg>
|
|
4200
|
-
`,
|
|
4201
|
-
};
|
|
4202
|
-
|
|
4203
|
-
// Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.
|
|
4204
|
-
const CHEVRON_ICON = {
|
|
4205
|
-
name: 'et-chevron',
|
|
4206
|
-
data: `
|
|
4207
|
-
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
4208
|
-
<path
|
|
4209
|
-
fill="currentColor"
|
|
4210
|
-
d="M244.7 116.7c6.2-6.2 16.4-6.2 22.6 0l192 192c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0L256 150.6 75.3 331.3c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l192-192z"
|
|
4211
|
-
/>
|
|
4212
|
-
</svg>
|
|
4213
|
-
`,
|
|
4214
|
-
};
|
|
4215
|
-
|
|
4216
|
-
const CLIPBOARD_CHECK_ICON = {
|
|
4217
|
-
name: 'et-clipboard-check',
|
|
4218
|
-
data: `
|
|
4219
|
-
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
4220
|
-
<path
|
|
4221
|
-
d="M9 4.5h6"
|
|
4222
|
-
stroke="currentColor"
|
|
4223
|
-
stroke-width="1.8"
|
|
4224
|
-
stroke-linecap="round"
|
|
4225
|
-
/>
|
|
4226
|
-
<path
|
|
4227
|
-
d="M9 3h6a1.5 1.5 0 0 1 1.5 1.5V6H18a2 2 0 0 1 2 2v10.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 4 18.5V8a2 2 0 0 1 2-2h1.5V4.5A1.5 1.5 0 0 1 9 3z"
|
|
4228
|
-
stroke="currentColor"
|
|
4229
|
-
stroke-width="1.8"
|
|
4230
|
-
stroke-linejoin="round"
|
|
4231
|
-
/>
|
|
4232
|
-
<path
|
|
4233
|
-
d="M8.5 13l2.2 2.2 4.8-4.9"
|
|
4234
|
-
stroke="currentColor"
|
|
4235
|
-
stroke-width="1.8"
|
|
4236
|
-
stroke-linecap="round"
|
|
4237
|
-
stroke-linejoin="round"
|
|
4238
|
-
/>
|
|
4239
|
-
</svg>
|
|
4240
|
-
`,
|
|
4241
|
-
};
|
|
4242
|
-
|
|
4243
|
-
const FLOPPY_DISK_ICON = {
|
|
4244
|
-
name: 'et-floppy-disk',
|
|
4245
|
-
data: `
|
|
4246
|
-
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
4247
|
-
<path
|
|
4248
|
-
d="M5 3h11l3 3v13a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V3z"
|
|
4249
|
-
stroke="currentColor"
|
|
4250
|
-
stroke-width="1.8"
|
|
4251
|
-
stroke-linejoin="round"
|
|
4252
|
-
/>
|
|
4253
|
-
<path
|
|
4254
|
-
d="M8 3v6h7V3"
|
|
4255
|
-
stroke="currentColor"
|
|
4256
|
-
stroke-width="1.8"
|
|
4257
|
-
stroke-linejoin="round"
|
|
4258
|
-
/>
|
|
4259
|
-
<path
|
|
4260
|
-
d="M8 17h8"
|
|
4261
|
-
stroke="currentColor"
|
|
4262
|
-
stroke-width="1.8"
|
|
4263
|
-
stroke-linecap="round"
|
|
4264
|
-
/>
|
|
4265
|
-
</svg>
|
|
4266
|
-
`,
|
|
4267
|
-
};
|
|
4268
|
-
|
|
4269
|
-
const FOCUS_FRAME_ICON = {
|
|
4270
|
-
name: 'et-focus-frame',
|
|
4271
|
-
data: `
|
|
4272
|
-
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
4273
|
-
<path
|
|
4274
|
-
fill="currentColor"
|
|
4275
|
-
fill-rule="evenodd"
|
|
4276
|
-
d="M5.75 4A1.75 1.75 0 0 0 4 5.75v12.5C4 19.216 4.784 20 5.75 20h12.5A1.75 1.75 0 0 0 20 18.25V5.75A1.75 1.75 0 0 0 18.25 4H5.75Zm0 1.5a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V5.75a.25.25 0 0 0-.25-.25H5.75Z"
|
|
4277
|
-
clip-rule="evenodd"
|
|
4278
|
-
/>
|
|
4279
|
-
<rect x="8" y="8" width="8" height="8" rx="1.25" fill="currentColor" />
|
|
4280
|
-
</svg>
|
|
4281
|
-
`,
|
|
4282
|
-
};
|
|
4283
|
-
|
|
4284
|
-
const GRID_2X2_ICON = {
|
|
4285
|
-
name: 'et-grid-2x2',
|
|
4286
|
-
data: `
|
|
4287
|
-
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
4288
|
-
<path
|
|
4289
|
-
fill="currentColor"
|
|
4290
|
-
fill-rule="evenodd"
|
|
4291
|
-
d="M5.75 4A1.75 1.75 0 0 0 4 5.75v12.5C4 19.216 4.784 20 5.75 20h12.5A1.75 1.75 0 0 0 20 18.25V5.75A1.75 1.75 0 0 0 18.25 4H5.75Zm0 1.5a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V5.75a.25.25 0 0 0-.25-.25H5.75Z"
|
|
4292
|
-
clip-rule="evenodd"
|
|
4293
|
-
/>
|
|
4294
|
-
<rect x="11.25" y="5.5" width="1.5" height="13" fill="currentColor" />
|
|
4295
|
-
<rect x="5.5" y="11.25" width="13" height="1.5" fill="currentColor" />
|
|
4296
|
-
</svg>
|
|
4297
|
-
`,
|
|
4298
|
-
};
|
|
4299
|
-
|
|
4300
|
-
const ICON_ERROR_CODES = {
|
|
4301
|
-
NO_ICONS_PROVIDED: 1800,
|
|
4302
|
-
ICON_NOT_FOUND: 1801,
|
|
4303
|
-
INVALID_SVG: 1802,
|
|
4304
|
-
MISSING_XMLNS: 1803,
|
|
4305
|
-
MISSING_DIMENSIONS: 1804,
|
|
4306
|
-
HARDCODED_COLOR: 1805,
|
|
4307
|
-
DUPLICATE_ICON_NAME: 1806,
|
|
4308
|
-
};
|
|
4309
|
-
|
|
4310
|
-
const ICONS_TOKEN = new InjectionToken('ET_ICONS_TOKEN');
|
|
4311
|
-
const provideIcons = (...icons) => {
|
|
4312
|
-
const map = {};
|
|
4313
|
-
for (const def of icons) {
|
|
4314
|
-
if (map[def.name]) {
|
|
4315
|
-
throw new RuntimeError(ICON_ERROR_CODES.DUPLICATE_ICON_NAME, `[provideIcons] Icon with name "${def.name}" already exists. Please provide unique icon names.`);
|
|
4316
|
-
}
|
|
4317
|
-
map[def.name] = def;
|
|
4318
|
-
}
|
|
4319
|
-
return {
|
|
4320
|
-
provide: ICONS_TOKEN,
|
|
4321
|
-
useValue: map,
|
|
4322
|
-
};
|
|
4323
|
-
};
|
|
4324
|
-
|
|
4325
|
-
const ICON_DIRECTIVE_TOKEN = new InjectionToken('ET_ICON_DIRECTIVE_TOKEN');
|
|
4326
|
-
const SVG_COLOR_ATTRIBUTES = ['fill', 'stroke', 'stop-color', 'stop-opacity'];
|
|
4327
|
-
class IconDirective {
|
|
4328
|
-
constructor() {
|
|
4329
|
-
this.icons = inject(ICONS_TOKEN, { optional: true });
|
|
4330
|
-
this.sanitizer = inject(DomSanitizer);
|
|
4331
|
-
this.iconNameToUse = input.required({ ...(ngDevMode ? { debugName: "iconNameToUse" } : /* istanbul ignore next */ {}), alias: 'etIcon' });
|
|
4332
|
-
this.allowHardcodedColor = input(false, { ...(ngDevMode ? { debugName: "allowHardcodedColor" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4333
|
-
this.iconSrc = computed(() => {
|
|
4334
|
-
if (!this.icons) {
|
|
4335
|
-
return null;
|
|
4336
|
-
}
|
|
4337
|
-
const icon = this.icons[this.iconNameToUse()];
|
|
4338
|
-
if (!icon) {
|
|
4339
|
-
throw new RuntimeError(ICON_ERROR_CODES.ICON_NOT_FOUND, `[IconDirective] Icon "${this.iconNameToUse()}" not found. Available icons: ${Object.keys(this.icons).join(', ')}.`);
|
|
4340
|
-
}
|
|
4341
|
-
const svg = icon.data.trim();
|
|
4342
|
-
if (ngDevMode) {
|
|
4343
|
-
if (!svg.includes('<svg')) {
|
|
4344
|
-
throw new RuntimeError(ICON_ERROR_CODES.INVALID_SVG, `[IconDirective] Icon "${this.iconNameToUse()}" is not a valid SVG. The data must contain an <svg> element.`);
|
|
4345
|
-
}
|
|
4346
|
-
if (!svg.includes('xmlns="http://www.w3.org/2000/svg"')) {
|
|
4347
|
-
throw new RuntimeError(ICON_ERROR_CODES.MISSING_XMLNS, `[IconDirective] Icon "${this.iconNameToUse()}" is missing xmlns="http://www.w3.org/2000/svg". Add the attribute to the <svg> element.`);
|
|
4348
|
-
}
|
|
4349
|
-
if (!svg.includes('width="100%"') || !svg.includes('height="100%"')) {
|
|
4350
|
-
throw new RuntimeError(ICON_ERROR_CODES.MISSING_DIMENSIONS, `[IconDirective] Icon "${this.iconNameToUse()}" is missing width="100%" and/or height="100%". Add both attributes to the <svg> element.`);
|
|
4351
|
-
}
|
|
4352
|
-
if (!this.allowHardcodedColor()) {
|
|
4353
|
-
for (const colorAttribute of SVG_COLOR_ATTRIBUTES) {
|
|
4354
|
-
if (svg.includes(`${colorAttribute}="`) && !svg.includes(`${colorAttribute}="currentColor"`)) {
|
|
4355
|
-
throw new RuntimeError(ICON_ERROR_CODES.HARDCODED_COLOR, `[IconDirective] Icon "${this.iconNameToUse()}" uses a hardcoded value for "${colorAttribute}". Use currentColor instead, or set [allowHardcodedColor]="true".`);
|
|
4356
|
-
}
|
|
4357
|
-
}
|
|
5281
|
+
[style.color]="cell.intMissing ? '#dc2626' : '#111'"
|
|
5282
|
+
[title]="cell.intMissing ? 'MISSING — layout.' + cell.bp + ' undefined in internal state' : ''"
|
|
5283
|
+
style="padding: 3px 8px; border: 1px solid #e5e7eb; text-align: center"
|
|
5284
|
+
>
|
|
5285
|
+
{{ fmtPos(cell.int) }}
|
|
5286
|
+
</td>
|
|
5287
|
+
@if (hasExternal()) {
|
|
5288
|
+
<td
|
|
5289
|
+
[style.color]="cell.extMissing ? '#dc2626' : cell.mismatch ? '#d97706' : '#9ca3af'"
|
|
5290
|
+
[title]="cell.mismatch ? 'MISMATCH — ext=' + fmtPos(cell.ext) + ' int=' + fmtPos(cell.int) : ''"
|
|
5291
|
+
style="padding: 3px 8px; border: 1px solid #e5e7eb; text-align: center"
|
|
5292
|
+
>
|
|
5293
|
+
{{ fmtPos(cell.ext) }}
|
|
5294
|
+
</td>
|
|
5295
|
+
}
|
|
4358
5296
|
}
|
|
5297
|
+
</tr>
|
|
4359
5298
|
}
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
if (
|
|
4364
|
-
|
|
5299
|
+
</tbody>
|
|
5300
|
+
</table>
|
|
5301
|
+
|
|
5302
|
+
@if (hasExternal()) {
|
|
5303
|
+
<p style="margin-top: 6px; color: #9ca3af; font-size: 10px">
|
|
5304
|
+
int = grid.items() (internal) · ext = externalItems input ·
|
|
5305
|
+
<span style="color: #dc2626">red = undefined</span> ·
|
|
5306
|
+
<span style="color: #d97706">orange = mismatch</span>
|
|
5307
|
+
</p>
|
|
4365
5308
|
}
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
{
|
|
4370
|
-
provide: ICON_DIRECTIVE_TOKEN,
|
|
4371
|
-
useExisting: IconDirective,
|
|
4372
|
-
},
|
|
4373
|
-
], ngImport: i0 }); }
|
|
5309
|
+
</div>
|
|
5310
|
+
</details>
|
|
5311
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
4374
5312
|
}
|
|
4375
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type:
|
|
4376
|
-
type:
|
|
5313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: GridDebugComponent, decorators: [{
|
|
5314
|
+
type: Component,
|
|
4377
5315
|
args: [{
|
|
4378
|
-
selector: '
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
'aria-hidden': 'true',
|
|
4388
|
-
'[class]': 'hostClasses()',
|
|
4389
|
-
style: 'display: flex; align-items: center; justify-content: center;',
|
|
4390
|
-
},
|
|
4391
|
-
}]
|
|
4392
|
-
}], ctorParameters: () => [], propDecorators: { iconNameToUse: [{ type: i0.Input, args: [{ isSignal: true, alias: "etIcon", required: true }] }], allowHardcodedColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowHardcodedColor", required: false }] }] } });
|
|
5316
|
+
selector: 'et-grid-debug',
|
|
5317
|
+
template: `
|
|
5318
|
+
<details
|
|
5319
|
+
style="font-family: monospace; font-size: 11px; border: 1px solid #d1d5db; border-radius: 4px; margin-top: 8px; background: #f9fafb; color: #111"
|
|
5320
|
+
>
|
|
5321
|
+
<summary
|
|
5322
|
+
style="padding: 6px 10px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; user-select: none"
|
|
5323
|
+
>
|
|
5324
|
+
<span style="font-weight: 700; color: #6b7280">et-grid-debug</span>
|
|
4393
5325
|
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
d="M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 48 0c26.5 0 48 21.5 48 48l0 224c0 26.5-21.5 48-48 48L32 512c-26.5 0-48-21.5-48-48L-16 240c0-26.5 21.5-48 48-48l48 0zm144 184c22.1 0 40-17.9 40-40s-17.9-40-40-40s-40 17.9-40 40s17.9 40 40 40z"
|
|
4402
|
-
/>
|
|
4403
|
-
</svg>
|
|
4404
|
-
`,
|
|
4405
|
-
};
|
|
5326
|
+
<span style="color: #6b7280">
|
|
5327
|
+
bp: <strong style="color: #111827">{{ activeBreakpoint() }}</strong> · {{ containerWidth() }}px
|
|
5328
|
+
· {{ items().length }} items
|
|
5329
|
+
@if (hasDrag()) {
|
|
5330
|
+
· <span style="color: #d97706">⠿ dragging</span>
|
|
5331
|
+
}
|
|
5332
|
+
</span>
|
|
4406
5333
|
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
d="M4 20l4.2-1 9.3-9.3a1.8 1.8 0 0 0 0-2.5l-.7-.7a1.8 1.8 0 0 0-2.5 0L5 15.8 4 20z"
|
|
4413
|
-
stroke="currentColor"
|
|
4414
|
-
stroke-width="1.8"
|
|
4415
|
-
stroke-linejoin="round"
|
|
4416
|
-
/>
|
|
4417
|
-
<path
|
|
4418
|
-
d="M12.8 7.2l4 4"
|
|
4419
|
-
stroke="currentColor"
|
|
4420
|
-
stroke-width="1.8"
|
|
4421
|
-
stroke-linecap="round"
|
|
4422
|
-
/>
|
|
4423
|
-
</svg>
|
|
4424
|
-
`,
|
|
4425
|
-
};
|
|
5334
|
+
@if (issueCount() > 0) {
|
|
5335
|
+
<span style="color: #dc2626; font-weight: 700"
|
|
5336
|
+
>⚠ {{ issueCount() }} issue{{ issueCount() === 1 ? '' : 's' }}</span
|
|
5337
|
+
>
|
|
5338
|
+
}
|
|
4426
5339
|
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
stroke="currentColor"
|
|
4434
|
-
stroke-width="1.8"
|
|
4435
|
-
stroke-linecap="round"
|
|
4436
|
-
/>
|
|
4437
|
-
<path
|
|
4438
|
-
d="M5 12h14"
|
|
4439
|
-
stroke="currentColor"
|
|
4440
|
-
stroke-width="1.8"
|
|
4441
|
-
stroke-linecap="round"
|
|
4442
|
-
/>
|
|
4443
|
-
</svg>
|
|
4444
|
-
`,
|
|
4445
|
-
};
|
|
5340
|
+
<button
|
|
5341
|
+
(click)="copyJson($event)"
|
|
5342
|
+
style="margin-left: auto; padding: 2px 8px; border: 1px solid #d1d5db; border-radius: 3px; background: #fff; cursor: pointer; font-size: 11px; color: #374151"
|
|
5343
|
+
>
|
|
5344
|
+
Copy JSON
|
|
5345
|
+
</button>
|
|
4446
5346
|
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
|
|
4452
|
-
<path
|
|
4453
|
-
fill="currentColor"
|
|
4454
|
-
d="M324.5 411.1c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6L214.6 256 347.1 123.5c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L192 233.4 59.6 100.9c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L169.4 256 36.9 388.5c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0L192 278.6 324.5 411.1z"
|
|
4455
|
-
/>
|
|
4456
|
-
</svg>
|
|
4457
|
-
`,
|
|
4458
|
-
};
|
|
5347
|
+
@if (copied()) {
|
|
5348
|
+
<span style="color: #16a34a; font-size: 10px">✓ copied</span>
|
|
5349
|
+
}
|
|
5350
|
+
</summary>
|
|
4459
5351
|
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
5352
|
+
<div style="padding: 8px 10px; overflow-x: auto; border-top: 1px solid #e5e7eb">
|
|
5353
|
+
<!-- Breakpoint legend -->
|
|
5354
|
+
<div style="display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap">
|
|
5355
|
+
@for (bp of breakpoints(); track bp.name) {
|
|
5356
|
+
<span
|
|
5357
|
+
[style.fontWeight]="bp.name === activeBreakpoint() ? '700' : '400'"
|
|
5358
|
+
[style.color]="bp.name === activeBreakpoint() ? '#1d4ed8' : '#9ca3af'"
|
|
5359
|
+
style="padding: 1px 7px; border: 1px solid currentColor; border-radius: 99px"
|
|
5360
|
+
>{{ bp.name }} {{ bp.columns }}col ≥{{ bp.minWidth }}px</span
|
|
5361
|
+
>
|
|
5362
|
+
}
|
|
5363
|
+
</div>
|
|
5364
|
+
|
|
5365
|
+
<!-- Layout table -->
|
|
5366
|
+
<table style="border-collapse: collapse; white-space: nowrap">
|
|
5367
|
+
<thead>
|
|
5368
|
+
<tr style="background: #f3f4f6">
|
|
5369
|
+
<th style="padding: 3px 8px; text-align: left; border: 1px solid #e5e7eb">id</th>
|
|
5370
|
+
<th style="padding: 3px 8px; text-align: left; border: 1px solid #e5e7eb">type</th>
|
|
5371
|
+
@for (bp of breakpoints(); track bp.name) {
|
|
5372
|
+
<th
|
|
5373
|
+
[style.background]="bp.name === activeBreakpoint() ? '#dbeafe' : '#f3f4f6'"
|
|
5374
|
+
style="padding: 3px 8px; text-align: center; border: 1px solid #e5e7eb"
|
|
5375
|
+
>
|
|
5376
|
+
{{ bp.name }}{{ hasExternal() ? ' int' : '' }}
|
|
5377
|
+
</th>
|
|
5378
|
+
@if (hasExternal()) {
|
|
5379
|
+
<th
|
|
5380
|
+
[style.background]="bp.name === activeBreakpoint() ? '#dbeafe' : '#f3f4f6'"
|
|
5381
|
+
style="padding: 3px 8px; text-align: center; border: 1px solid #e5e7eb; opacity: .65"
|
|
5382
|
+
>
|
|
5383
|
+
{{ bp.name }} ext
|
|
5384
|
+
</th>
|
|
5385
|
+
}
|
|
5386
|
+
}
|
|
5387
|
+
</tr>
|
|
5388
|
+
</thead>
|
|
5389
|
+
<tbody>
|
|
5390
|
+
@for (row of rows(); track row.id) {
|
|
5391
|
+
<tr>
|
|
5392
|
+
<td style="padding: 3px 8px; border: 1px solid #e5e7eb; color: #6b7280">{{ row.id }}</td>
|
|
5393
|
+
<td style="padding: 3px 8px; border: 1px solid #e5e7eb; color: #9ca3af">{{ row.type }}</td>
|
|
5394
|
+
@for (cell of row.cells; track cell.bp) {
|
|
5395
|
+
<td
|
|
5396
|
+
[style.color]="cell.intMissing ? '#dc2626' : '#111'"
|
|
5397
|
+
[title]="cell.intMissing ? 'MISSING — layout.' + cell.bp + ' undefined in internal state' : ''"
|
|
5398
|
+
style="padding: 3px 8px; border: 1px solid #e5e7eb; text-align: center"
|
|
5399
|
+
>
|
|
5400
|
+
{{ fmtPos(cell.int) }}
|
|
5401
|
+
</td>
|
|
5402
|
+
@if (hasExternal()) {
|
|
5403
|
+
<td
|
|
5404
|
+
[style.color]="cell.extMissing ? '#dc2626' : cell.mismatch ? '#d97706' : '#9ca3af'"
|
|
5405
|
+
[title]="cell.mismatch ? 'MISMATCH — ext=' + fmtPos(cell.ext) + ' int=' + fmtPos(cell.int) : ''"
|
|
5406
|
+
style="padding: 3px 8px; border: 1px solid #e5e7eb; text-align: center"
|
|
5407
|
+
>
|
|
5408
|
+
{{ fmtPos(cell.ext) }}
|
|
5409
|
+
</td>
|
|
5410
|
+
}
|
|
5411
|
+
}
|
|
5412
|
+
</tr>
|
|
5413
|
+
}
|
|
5414
|
+
</tbody>
|
|
5415
|
+
</table>
|
|
5416
|
+
|
|
5417
|
+
@if (hasExternal()) {
|
|
5418
|
+
<p style="margin-top: 6px; color: #9ca3af; font-size: 10px">
|
|
5419
|
+
int = grid.items() (internal) · ext = externalItems input ·
|
|
5420
|
+
<span style="color: #dc2626">red = undefined</span> ·
|
|
5421
|
+
<span style="color: #d97706">orange = mismatch</span>
|
|
5422
|
+
</p>
|
|
5423
|
+
}
|
|
5424
|
+
</div>
|
|
5425
|
+
</details>
|
|
4470
5426
|
`,
|
|
5427
|
+
encapsulation: ViewEncapsulation.None,
|
|
5428
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5429
|
+
}]
|
|
5430
|
+
}], propDecorators: { grid: [{ type: i0.Input, args: [{ isSignal: true, alias: "grid", required: true }] }], externalItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "externalItems", required: false }] }] } });
|
|
5431
|
+
|
|
5432
|
+
const GRID_ERROR_CODES = {
|
|
5433
|
+
MISSING_GRID: 1900,
|
|
5434
|
+
MISSING_GRID_ITEM: 1901,
|
|
5435
|
+
DUPLICATE_ITEM_ID: 1902,
|
|
5436
|
+
INVALID_LAYOUT_STATE: 1903,
|
|
4471
5437
|
};
|
|
4472
5438
|
|
|
4473
|
-
const
|
|
5439
|
+
const GridImports = [GridComponent, GridItemComponent, GridDebugComponent];
|
|
4474
5440
|
|
|
4475
5441
|
const NOTIFICATION_ERROR_CODES = {
|
|
4476
5442
|
ACTION_OUTSIDE_NOTIFICATION: 1700,
|
|
@@ -4964,7 +5930,7 @@ const [provideNotificationManagerInstance, injectNotificationManager] = createRo
|
|
|
4964
5930
|
const appRef = inject(ApplicationRef);
|
|
4965
5931
|
const envInjector = inject(EnvironmentInjector);
|
|
4966
5932
|
const destroyRef = inject(DestroyRef);
|
|
4967
|
-
const document = inject(DOCUMENT);
|
|
5933
|
+
const document = inject(DOCUMENT$1);
|
|
4968
5934
|
const renderer = injectRenderer();
|
|
4969
5935
|
const notifications = signal([], ...(ngDevMode ? [{ debugName: "notifications" }] : /* istanbul ignore next */ []));
|
|
4970
5936
|
const visibleNotifications = computed(() => {
|
|
@@ -6541,7 +7507,7 @@ const DEFAULT_PIP_CHROME_CONFIG = {
|
|
|
6541
7507
|
};
|
|
6542
7508
|
|
|
6543
7509
|
const [provideStreamManager, injectStreamManager] = createRootProvider(() => {
|
|
6544
|
-
const document = inject(DOCUMENT);
|
|
7510
|
+
const document = inject(DOCUMENT$1);
|
|
6545
7511
|
const renderer = injectRenderer();
|
|
6546
7512
|
const container = renderer.createElement('div');
|
|
6547
7513
|
renderer.addClass(container, 'et-stream-manager');
|
|
@@ -6696,7 +7662,7 @@ const [provideStreamManager, injectStreamManager] = createRootProvider(() => {
|
|
|
6696
7662
|
}, { name: 'Stream Manager' });
|
|
6697
7663
|
|
|
6698
7664
|
const [providePipManager, injectPipManager] = createRootProvider(() => {
|
|
6699
|
-
const document = inject(DOCUMENT);
|
|
7665
|
+
const document = inject(DOCUMENT$1);
|
|
6700
7666
|
const renderer = injectRenderer();
|
|
6701
7667
|
const streamManager = injectStreamManager();
|
|
6702
7668
|
const viewportSize = injectViewportSize();
|
|
@@ -7307,7 +8273,7 @@ const PIP_WINDOW_ASPECT_RATIO_TOKEN = new InjectionToken('PIP_WINDOW_ASPECT_RATI
|
|
|
7307
8273
|
|
|
7308
8274
|
class PipPlayerComponent {
|
|
7309
8275
|
constructor() {
|
|
7310
|
-
this.document = inject(DOCUMENT);
|
|
8276
|
+
this.document = inject(DOCUMENT$1);
|
|
7311
8277
|
this.el = inject(ElementRef);
|
|
7312
8278
|
this.pipCell = inject(PipCellDirective, { optional: true });
|
|
7313
8279
|
this.entry = input(...(ngDevMode ? [undefined, { debugName: "entry" }] : /* istanbul ignore next */ []));
|
|
@@ -7531,7 +8497,7 @@ const createPipWindowPosition = (options) => {
|
|
|
7531
8497
|
const { params, titleBarH, size, resizeHandles, dragHandle, forcedTitleBar } = options;
|
|
7532
8498
|
const el = inject(ElementRef);
|
|
7533
8499
|
const renderer = injectRenderer();
|
|
7534
|
-
const document = inject(DOCUMENT);
|
|
8500
|
+
const document = inject(DOCUMENT$1);
|
|
7535
8501
|
const destroyRef = inject(DestroyRef);
|
|
7536
8502
|
const viewportSize = injectViewportSize();
|
|
7537
8503
|
const isDragging = computed(() => dragHandle().isDragging(), ...(ngDevMode ? [{ debugName: "isDragging" }] : /* istanbul ignore next */ []));
|
|
@@ -8127,7 +9093,7 @@ const [providePipChromeManager, injectPipChromeManager] = createRootProvider(()
|
|
|
8127
9093
|
const appRef = inject(ApplicationRef);
|
|
8128
9094
|
const envInjector = inject(EnvironmentInjector);
|
|
8129
9095
|
const destroyRef = inject(DestroyRef);
|
|
8130
|
-
const document = inject(DOCUMENT);
|
|
9096
|
+
const document = inject(DOCUMENT$1);
|
|
8131
9097
|
const renderer = injectRenderer();
|
|
8132
9098
|
let pipChromeRef = null;
|
|
8133
9099
|
const destroyPipChrome = () => {
|
|
@@ -8708,7 +9674,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
8708
9674
|
}], propDecorators: { videoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "videoId", required: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }] } });
|
|
8709
9675
|
|
|
8710
9676
|
const [, injectStreamScriptLoader] = createRootProvider(() => {
|
|
8711
|
-
const document = inject(DOCUMENT);
|
|
9677
|
+
const document = inject(DOCUMENT$1);
|
|
8712
9678
|
const cache = new Map();
|
|
8713
9679
|
const mountedScripts = new Set();
|
|
8714
9680
|
const renderer = injectRenderer();
|
|
@@ -8751,7 +9717,7 @@ const FACEBOOK_PLAYER_TOKEN = new InjectionToken('FACEBOOK_PLAYER_TOKEN');
|
|
|
8751
9717
|
class FacebookPlayerDirective {
|
|
8752
9718
|
constructor() {
|
|
8753
9719
|
this.platformId = inject(PLATFORM_ID);
|
|
8754
|
-
this.document = inject(DOCUMENT);
|
|
9720
|
+
this.document = inject(DOCUMENT$1);
|
|
8755
9721
|
this.params = inject(FacebookPlayerParamsDirective);
|
|
8756
9722
|
this.el = injectHostElement();
|
|
8757
9723
|
this.scriptLoader = injectStreamScriptLoader();
|
|
@@ -8996,7 +9962,7 @@ const KICK_PLAYER_TOKEN = new InjectionToken('KICK_PLAYER_TOKEN');
|
|
|
8996
9962
|
class KickPlayerDirective {
|
|
8997
9963
|
constructor() {
|
|
8998
9964
|
this.platformId = inject(PLATFORM_ID);
|
|
8999
|
-
this.document = inject(DOCUMENT);
|
|
9965
|
+
this.document = inject(DOCUMENT$1);
|
|
9000
9966
|
this.params = inject(KickPlayerParamsDirective);
|
|
9001
9967
|
this.el = injectHostElement();
|
|
9002
9968
|
this.renderer = injectRenderer();
|
|
@@ -9625,7 +10591,7 @@ const TWITCH_PLAYER_TOKEN = new InjectionToken('TWITCH_PLAYER_TOKEN');
|
|
|
9625
10591
|
class TwitchPlayerDirective {
|
|
9626
10592
|
constructor() {
|
|
9627
10593
|
this.platformId = inject(PLATFORM_ID);
|
|
9628
|
-
this.document = inject(DOCUMENT);
|
|
10594
|
+
this.document = inject(DOCUMENT$1);
|
|
9629
10595
|
this.params = inject(TwitchPlayerParamsDirective);
|
|
9630
10596
|
this.el = injectHostElement();
|
|
9631
10597
|
this.scriptLoader = injectStreamScriptLoader();
|
|
@@ -9880,7 +10846,7 @@ const VIMEO_PLAYER_TOKEN = new InjectionToken('VIMEO_PLAYER_TOKEN');
|
|
|
9880
10846
|
class VimeoPlayerDirective {
|
|
9881
10847
|
constructor() {
|
|
9882
10848
|
this.platformId = inject(PLATFORM_ID);
|
|
9883
|
-
this.document = inject(DOCUMENT);
|
|
10849
|
+
this.document = inject(DOCUMENT$1);
|
|
9884
10850
|
this.params = inject(VimeoPlayerParamsDirective);
|
|
9885
10851
|
this.el = injectHostElement();
|
|
9886
10852
|
this.scriptLoader = injectStreamScriptLoader();
|
|
@@ -10136,7 +11102,7 @@ const waitForYtReady = (win) => {
|
|
|
10136
11102
|
class YoutubePlayerDirective {
|
|
10137
11103
|
constructor() {
|
|
10138
11104
|
this.platformId = inject(PLATFORM_ID);
|
|
10139
|
-
this.document = inject(DOCUMENT);
|
|
11105
|
+
this.document = inject(DOCUMENT$1);
|
|
10140
11106
|
this.params = inject(YoutubePlayerParamsDirective);
|
|
10141
11107
|
this.el = injectHostElement();
|
|
10142
11108
|
this.scriptLoader = injectStreamScriptLoader();
|
|
@@ -11762,7 +12728,7 @@ const createTooltipId = (prefix = 'et-tooltip') => {
|
|
|
11762
12728
|
const DEFAULT_TOOLTIP_DELAY = 300;
|
|
11763
12729
|
class TooltipDirective {
|
|
11764
12730
|
constructor() {
|
|
11765
|
-
this.document = inject(DOCUMENT);
|
|
12731
|
+
this.document = inject(DOCUMENT$1);
|
|
11766
12732
|
this.destroyRef = inject(DestroyRef);
|
|
11767
12733
|
this.elementRef = inject(ElementRef);
|
|
11768
12734
|
this.colorProvider = inject(COLOR_PROVIDER, { optional: true });
|
|
@@ -11977,5 +12943,5 @@ const TOOLTIP_IMPORTS = [TooltipDirective, TooltipComponent];
|
|
|
11977
12943
|
* Generated bundle index. Do not edit.
|
|
11978
12944
|
*/
|
|
11979
12945
|
|
|
11980
|
-
export { ARROW_OUT_UP_RIGHT_ICON, ARROW_RIGHT_ICON, BUTTON_ICON_ALIGNMENTS, BUTTON_IMPORTS, BUTTON_SIZES, BUTTON_SPINNER_CONFIG, BUTTON_TYPES, BUTTON_VARIANTS, BrandLoaderComponent, ButtonComponent, ButtonDirective, ButtonStylesDirective, CHECKBOX_IMPORTS, CHEVRON_ICON, CHOICE_FIELD_IMPORTS, CLIPBOARD_CHECK_ICON, CheckboxComponent, CheckboxDirective, CheckboxGroupComponent, CheckboxOptionComponent, ChoiceFieldComponent, DAILYMOTION_PLAYER_TOKEN, DEFAULT_NOTIFICATION_MANAGER_CONFIG, DEFAULT_PIP_WINDOW_CONFIG, DEFAULT_STREAM_PLAYER_STATE, DailymotionPlayerComponent, DailymotionPlayerDirective, DailymotionPlayerParamsDirective, DailymotionPlayerSlotComponent, DescriptionComponent, FACEBOOK_PLAYER_TOKEN, FLOPPY_DISK_ICON, FOCUS_FRAME_ICON, FORM_FIELD_APPEARANCES, FORM_FIELD_CONTROL_TYPES, FORM_FIELD_ERROR_CODES, FORM_FIELD_FILLS, FORM_FIELD_IMPORTS, FORM_FIELD_LABEL_MODES, FORM_FIELD_SIZES, FORM_FIELD_TOKEN, FabComponent, FacebookPlayerComponent, FacebookPlayerDirective, FacebookPlayerParamsDirective, FacebookPlayerSlotComponent, FocusRingDirective, FormErrorComponent, FormFieldComponent, FormFieldDirective, GRID_2X2_ICON, GRID_ERROR_CODES, GRID_TOKEN, GridComponent, GridDebugComponent, GridDirective, GridDragDirective, GridImports, GridItemComponent, GridItemDirective, GridItemRef, GridResizeDirective, HintComponent, ICONS_TOKEN, ICON_DIRECTIVE_TOKEN, ICON_ERROR_CODES, ICON_IMPORTS, INPUT_IMPORTS, INPUT_TEXT_ALIGNMENTS, INPUT_TYPES, IconButtonComponent, IconDirective, InputComponent, InputDirective, InputPrefixDirective, InputSuffixDirective, KICK_PLAYER_TOKEN, KickPlayerComponent, KickPlayerDirective, KickPlayerParamsDirective, KickPlayerSlotComponent, LOCK_ICON, LabelDirective, NAV_TABS_TOKEN, NOTIFICATION_ERROR_CODES, NOTIFICATION_IMPORTS, NOTIFICATION_STACK_CONTEXT_TOKEN, NOTIFICATION_STATUS, NavTabImports, NavTabLinkComponent, NavTabLinkDirective, NavTabsComponent, NavTabsDirective, NavTabsOutletComponent, NavTabsOutletDirective, NotificationActionDirective, NotificationComponent, NotificationDirective, NotificationDismissDirective, NotificationItemDirective, NotificationStackDirective, OVERLAY_ERROR_CODES, OVERLAY_IMPORTS, OVERLAY_REF, OverlayAnchorDirective, OverlayDirective, OverlaySurfaceDirective, OverlayTriggerDirective, PENCIL_ICON, PIP_CHROME_REF_TOKEN, PIP_ENTRY_TOKEN, PIP_WINDOW_ASPECT_RATIO_TOKEN, PLUS_ICON, PipBackDirective, PipBringBackDirective, PipCellDirective, PipCloseDirective, PipCollapseOverlayDirective, PipGridToggleDirective, PipPlayerComponent, PipSlotPlaceholderComponent, PipStageDirective, PipTitleBarDirective, PipTitleBarTemplateDirective, PipWindowComponent, PipWindowParamsDirective, ProgressBarComponent, RadioComponent, RadioGroupComponent, SCROLLABLE_IMPORTS, SELECTION_LIST_MULTIPLE, SELECTION_LIST_TOKEN, SOOP_PLAYER_TOKEN, STREAM_CONSENT_TOKEN, STREAM_PLAYER_COMPONENT_TOKEN, STREAM_PLAYER_ERROR_CONTEXT_TOKEN, STREAM_PLAYER_ERROR_TOKEN, STREAM_PLAYER_PARAMS_TOKEN, STREAM_PLAYER_SLOT_TOKEN, STREAM_PLAYER_TOKEN, STREAM_SLOT_PLAYER_ID_TOKEN, STREAM_USER_CONSENT_PROVIDER_TOKEN, SWITCH_IMPORTS, ScrollableActiveChildDirective, ScrollableButtonsDirective, ScrollableComponent, ScrollableDarkenDirective, ScrollableDirective, ScrollableDragDirective, ScrollableErrorCode, ScrollableIgnoreChildDirective, ScrollableLoadingTemplateDirective, ScrollableMasksDirective, ScrollableNavigationDirective, ScrollableSnapDirective, SegmentedButtonComponent, SegmentedButtonGroupComponent, SelectionListControlDirective, SelectionListDirective, SelectionOptionDirective, SoopPlayerComponent, SoopPlayerDirective, SoopPlayerParamsDirective, SoopPlayerSlotComponent, SpinnerComponent, StreamConsentAcceptDirective, StreamConsentComponent, StreamConsentDirective, StreamImports, StreamPipChromeComponent, StreamPlayerErrorComponent, StreamPlayerErrorDirective, StreamPlayerLoadingComponent, StreamPlayerSlotDirective, SwitchComponent, SwitchDirective, TAB_BAR_FITS, TAB_BAR_ORIENTATIONS, TAB_BAR_TOKEN, TAB_BAR_TRIGGER_TOKEN, TAB_BAR_VARIANTS, TAB_ERROR_CODES, TAB_GROUP_TOKEN, TAB_PANEL_TOKEN, TAB_SIZES, TIKTOK_PLAYER_TOKEN, TIMES_ICON, TOGGLETIP_ERROR_CODES, TOGGLETIP_IMPORTS, TOOLTIP_ERROR_CODES, TOOLTIP_IMPORTS, TRIANGLE_EXCLAMATION_ICON, TWITCH_PLAYER_TOKEN, TabBarDirective, TabBarTriggerDirective, TabBarUnderlineDirective, TabComponent, TabGroupComponent, TabGroupDirective, TabImports, TabLabelDirective, TabPanelDirective, TabTriggerDirective, TextButtonComponent, TikTokPlayerComponent, TikTokPlayerDirective, TikTokPlayerParamsDirective, TikTokPlayerSlotComponent, ToggletipCloseDirective, ToggletipComponent, ToggletipDirective, ToggletipTriggerDirective, TooltipComponent, TooltipDirective, TwitchPlayerComponent, TwitchPlayerDirective, TwitchPlayerParamsDirective, TwitchPlayerSlotComponent, VIMEO_PLAYER_TOKEN, VimeoPlayerComponent, VimeoPlayerDirective, VimeoPlayerParamsDirective, VimeoPlayerSlotComponent, WINDOW_CONTROL_BUTTON_KINDS, WINDOW_CONTROL_BUTTON_SIZES, WindowControlButtonComponent, YOUTUBE_PLAYER_SLOT_TOKEN, YOUTUBE_PLAYER_TOKEN, YoutubePlayerComponent, YoutubePlayerDirective, YoutubePlayerParamsDirective, YoutubePlayerSlotComponent, YoutubePlayerSlotDirective, createGridAdapter, createNotificationRef, createOverlayRef, createPipChromeAnimations, createPipChromeState, createStreamConfig, createStreamPlayerSlot, fromGridPosition, injectFormSupport, injectGridConfig, injectNotificationManager, injectNotificationManagerConfig, injectOverlayManager, injectPipChromeManager, injectPipManager, injectPipSlotPlaceholderConfig, injectStreamConfig, injectStreamConsentConfig, injectStreamManager, injectStreamPlayerErrorConfig, injectStreamPlayerLoadingConfig, injectStreamScriptLoader, injectStreamUserConsentProvider, provideFormSupport, provideGridConfig, provideIcons, provideNotificationManager, provideNotificationManagerConfig, provideNotificationManagerInstance, provideOverlayManager, providePipChromeManager, providePipManager, providePipSlotPlaceholderConfig, provideStreamConfig, provideStreamConsentConfig, provideStreamManager, provideStreamPlayerErrorConfig, provideStreamPlayerLoadingConfig, toGridPosition };
|
|
12946
|
+
export { ARROW_OUT_UP_RIGHT_ICON, ARROW_RIGHT_ICON, BOLD_ICON, BUTTON_ICON_ALIGNMENTS, BUTTON_IMPORTS, BUTTON_SIZES, BUTTON_SPINNER_CONFIG, BUTTON_TYPES, BUTTON_VARIANTS, BrandLoaderComponent, ButtonComponent, ButtonDirective, ButtonStylesDirective, CHECKBOX_IMPORTS, CHEVRON_ICON, CHOICE_FIELD_IMPORTS, CLIPBOARD_CHECK_ICON, CheckboxComponent, CheckboxDirective, CheckboxGroupComponent, CheckboxOptionComponent, ChoiceFieldComponent, DAILYMOTION_PLAYER_TOKEN, DEFAULT_NOTIFICATION_MANAGER_CONFIG, DEFAULT_PIP_WINDOW_CONFIG, DEFAULT_STREAM_PLAYER_STATE, DailymotionPlayerComponent, DailymotionPlayerDirective, DailymotionPlayerParamsDirective, DailymotionPlayerSlotComponent, DescriptionComponent, FACEBOOK_PLAYER_TOKEN, FLOPPY_DISK_ICON, FOCUS_FRAME_ICON, FORM_FIELD_APPEARANCES, FORM_FIELD_CONTROL_TYPES, FORM_FIELD_ERROR_CODES, FORM_FIELD_FILLS, FORM_FIELD_IMPORTS, FORM_FIELD_LABEL_MODES, FORM_FIELD_SIZES, FORM_FIELD_TOKEN, FabComponent, FacebookPlayerComponent, FacebookPlayerDirective, FacebookPlayerParamsDirective, FacebookPlayerSlotComponent, FocusRingDirective, FormErrorComponent, FormFieldComponent, FormFieldDirective, GRID_2X2_ICON, GRID_ERROR_CODES, GRID_TOKEN, GridComponent, GridDebugComponent, GridDirective, GridDragDirective, GridImports, GridItemComponent, GridItemDirective, GridItemRef, GridResizeDirective, HintComponent, ICONS_TOKEN, ICON_DIRECTIVE_TOKEN, ICON_ERROR_CODES, ICON_IMPORTS, INPUT_IMPORTS, INPUT_TEXT_ALIGNMENTS, INPUT_TYPES, ITALIC_ICON, IconButtonComponent, IconDirective, InputComponent, InputDirective, InputPrefixDirective, InputSuffixDirective, KICK_PLAYER_TOKEN, KickPlayerComponent, KickPlayerDirective, KickPlayerParamsDirective, KickPlayerSlotComponent, LINK_ICON, LIST_BULLETED_ICON, LIST_NUMBERED_ICON, LOCK_ICON, LabelDirective, NAV_TABS_TOKEN, NOTIFICATION_ERROR_CODES, NOTIFICATION_IMPORTS, NOTIFICATION_STACK_CONTEXT_TOKEN, NOTIFICATION_STATUS, NavTabImports, NavTabLinkComponent, NavTabLinkDirective, NavTabsComponent, NavTabsDirective, NavTabsOutletComponent, NavTabsOutletDirective, NotificationActionDirective, NotificationComponent, NotificationDirective, NotificationDismissDirective, NotificationItemDirective, NotificationStackDirective, OVERLAY_ERROR_CODES, OVERLAY_IMPORTS, OVERLAY_REF, OverlayAnchorDirective, OverlayDirective, OverlaySurfaceDirective, OverlayTriggerDirective, PENCIL_ICON, PIP_CHROME_REF_TOKEN, PIP_ENTRY_TOKEN, PIP_WINDOW_ASPECT_RATIO_TOKEN, PLUS_ICON, PipBackDirective, PipBringBackDirective, PipCellDirective, PipCloseDirective, PipCollapseOverlayDirective, PipGridToggleDirective, PipPlayerComponent, PipSlotPlaceholderComponent, PipStageDirective, PipTitleBarDirective, PipTitleBarTemplateDirective, PipWindowComponent, PipWindowParamsDirective, ProgressBarComponent, RICH_TEXT_EDITOR_IMPORTS, RadioComponent, RadioGroupComponent, RichTextEditorComponent, RichTextEditorDirective, SCROLLABLE_IMPORTS, SELECTION_LIST_MULTIPLE, SELECTION_LIST_TOKEN, SOOP_PLAYER_TOKEN, STREAM_CONSENT_TOKEN, STREAM_PLAYER_COMPONENT_TOKEN, STREAM_PLAYER_ERROR_CONTEXT_TOKEN, STREAM_PLAYER_ERROR_TOKEN, STREAM_PLAYER_PARAMS_TOKEN, STREAM_PLAYER_SLOT_TOKEN, STREAM_PLAYER_TOKEN, STREAM_SLOT_PLAYER_ID_TOKEN, STREAM_USER_CONSENT_PROVIDER_TOKEN, STRIKETHROUGH_ICON, SWITCH_IMPORTS, ScrollableActiveChildDirective, ScrollableButtonsDirective, ScrollableComponent, ScrollableDarkenDirective, ScrollableDirective, ScrollableDragDirective, ScrollableErrorCode, ScrollableIgnoreChildDirective, ScrollableLoadingTemplateDirective, ScrollableMasksDirective, ScrollableNavigationDirective, ScrollableSnapDirective, SegmentedButtonComponent, SegmentedButtonGroupComponent, SelectionListControlDirective, SelectionListDirective, SelectionOptionDirective, SoopPlayerComponent, SoopPlayerDirective, SoopPlayerParamsDirective, SoopPlayerSlotComponent, SpinnerComponent, StreamConsentAcceptDirective, StreamConsentComponent, StreamConsentDirective, StreamImports, StreamPipChromeComponent, StreamPlayerErrorComponent, StreamPlayerErrorDirective, StreamPlayerLoadingComponent, StreamPlayerSlotDirective, SwitchComponent, SwitchDirective, TAB_BAR_FITS, TAB_BAR_ORIENTATIONS, TAB_BAR_TOKEN, TAB_BAR_TRIGGER_TOKEN, TAB_BAR_VARIANTS, TAB_ERROR_CODES, TAB_GROUP_TOKEN, TAB_PANEL_TOKEN, TAB_SIZES, TIKTOK_PLAYER_TOKEN, TIMES_ICON, TOGGLETIP_ERROR_CODES, TOGGLETIP_IMPORTS, TOOLTIP_ERROR_CODES, TOOLTIP_IMPORTS, TRIANGLE_EXCLAMATION_ICON, TWITCH_PLAYER_TOKEN, TabBarDirective, TabBarTriggerDirective, TabBarUnderlineDirective, TabComponent, TabGroupComponent, TabGroupDirective, TabImports, TabLabelDirective, TabPanelDirective, TabTriggerDirective, TextButtonComponent, TikTokPlayerComponent, TikTokPlayerDirective, TikTokPlayerParamsDirective, TikTokPlayerSlotComponent, ToggletipCloseDirective, ToggletipComponent, ToggletipDirective, ToggletipTriggerDirective, TooltipComponent, TooltipDirective, TwitchPlayerComponent, TwitchPlayerDirective, TwitchPlayerParamsDirective, TwitchPlayerSlotComponent, VIMEO_PLAYER_TOKEN, VimeoPlayerComponent, VimeoPlayerDirective, VimeoPlayerParamsDirective, VimeoPlayerSlotComponent, WINDOW_CONTROL_BUTTON_KINDS, WINDOW_CONTROL_BUTTON_SIZES, WindowControlButtonComponent, YOUTUBE_PLAYER_SLOT_TOKEN, YOUTUBE_PLAYER_TOKEN, YoutubePlayerComponent, YoutubePlayerDirective, YoutubePlayerParamsDirective, YoutubePlayerSlotComponent, YoutubePlayerSlotDirective, createGridAdapter, createNotificationRef, createOverlayRef, createPipChromeAnimations, createPipChromeState, createStreamConfig, createStreamPlayerSlot, fromGridPosition, injectFormSupport, injectGridConfig, injectNotificationManager, injectNotificationManagerConfig, injectOverlayManager, injectPipChromeManager, injectPipManager, injectPipSlotPlaceholderConfig, injectStreamConfig, injectStreamConsentConfig, injectStreamManager, injectStreamPlayerErrorConfig, injectStreamPlayerLoadingConfig, injectStreamScriptLoader, injectStreamUserConsentProvider, provideFormSupport, provideGridConfig, provideIcons, provideNotificationManager, provideNotificationManagerConfig, provideNotificationManagerInstance, provideOverlayManager, providePipChromeManager, providePipManager, providePipSlotPlaceholderConfig, provideStreamConfig, provideStreamConsentConfig, provideStreamManager, provideStreamPlayerErrorConfig, provideStreamPlayerLoadingConfig, toGridPosition };
|
|
11981
12947
|
//# sourceMappingURL=ethlete-components.mjs.map
|